From: support
Date: Thu, 10 Mar 2022 13:52:22 +0000 (+0000)
Subject: Built motion from commit 16cc2bd2.|2.6.5
X-Git-Url: http://repos.xcallymotion.com/base//%22https:/wiki.xcallymotion.com/display/XMV/%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%2014%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C21110E%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C202%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%200%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C205?a=commitdiff_plain;h=6a3ccdcb9915207f04604d1c44f824b9a4820161;p=motion2.git
Built motion from commit 16cc2bd2.|2.6.5
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 4ff4032..c32672e 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-10T12:55:23.355Z",
+ "time": "2022-03-10T13:42:49.509Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9a279b7..344c75e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-10T12:55:23.355Z",
+ "time": "2022-03-10T13:42:49.509Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index f97d803..f2236ff 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44e5=['urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty'];(function(_0x456626,_0x5931f8){var _0x36b37d=function(_0x5942ab){while(--_0x5942ab){_0x456626['push'](_0x456626['shift']());}};_0x36b37d(++_0x5931f8);}(_0x44e5,0x187));var _0x544e=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0x44e5[_0x4dbdda];return _0x1acbf1;};'use strict';var Sequelize=require(_0x544e('0x0'));module[_0x544e('0x1')]={'name':{'type':Sequelize[_0x544e('0x2')],'get':function(_0x567ec9){return this[_0x544e('0x3')](_0x544e('0x4'));}},'action':{'type':Sequelize[_0x544e('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x544e('0x6'),_0x544e('0x7'),_0x544e('0x8'),_0x544e('0x9'),'browser',_0x544e('0xa'),_0x544e('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x544e('0xc')},'data1':{'type':Sequelize[_0x544e('0x5')](0x1000),'comment':_0x544e('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x544e('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x544e('0xf')},'data4':{'type':Sequelize[_0x544e('0x5')](0x1000),'comments':_0x544e('0x10')},'data5':{'type':Sequelize[_0x544e('0x5')](0x1000),'comments':_0x544e('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x544e('0x12')},'data7':{'type':Sequelize[_0x544e('0x13')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xd04c=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x47ea0f,_0x5832ad){var _0x8b46c7=function(_0x4e02d8){while(--_0x4e02d8){_0x47ea0f['push'](_0x47ea0f['shift']());}};_0x8b46c7(++_0x5832ad);}(_0xd04c,0xd3));var _0xcd04=function(_0x5204b9,_0x224243){_0x5204b9=_0x5204b9-0x0;var _0x358775=_0xd04c[_0x5204b9];return _0x358775;};'use strict';var Sequelize=require(_0xcd04('0x0'));module[_0xcd04('0x1')]={'name':{'type':Sequelize[_0xcd04('0x2')],'get':function(_0x458085){return this[_0xcd04('0x3')](_0xcd04('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xcd04('0x5'),_0xcd04('0x6'),_0xcd04('0x7'),_0xcd04('0x8'),_0xcd04('0x9'),_0xcd04('0xa'),_0xcd04('0xb'),_0xcd04('0xc')]],'msg':_0xcd04('0xd')}},'comment':_0xcd04('0xd')},'data1':{'type':Sequelize[_0xcd04('0xe')](0x1000),'comment':_0xcd04('0xf')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xcd04('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xcd04('0xe')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0xcd04('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xcd04('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 96f02b2..ae31395 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa623=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','end','stack','name','send','body','params','Action','catch','rimraf','zip-dir','fast-json-patch','util','path','sox'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xa623,0x108));var _0x3a62=function(_0x198149,_0x390963){_0x198149=_0x198149-0x0;var _0x1357d6=_0xa623[_0x198149];return _0x1357d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a62('0x0'));var zipdir=require(_0x3a62('0x1'));var jsonpatch=require(_0x3a62('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3a62('0x3'));var path=require(_0x3a62('0x4'));var sox=require(_0x3a62('0x5'));var csv=require(_0x3a62('0x6'));var ejs=require(_0x3a62('0x7'));var fs=require('fs');var fs_extra=require(_0x3a62('0x8'));var _=require('lodash');var squel=require(_0x3a62('0x9'));var crypto=require(_0x3a62('0xa'));var jsforce=require(_0x3a62('0xb'));var deskjs=require(_0x3a62('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3a62('0xd'));var Papa=require(_0x3a62('0xe'));var Redis=require(_0x3a62('0xf'));var authService=require(_0x3a62('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3a62('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a62('0x12'))(_0x3a62('0x13'));var utils=require(_0x3a62('0x14'));var config=require(_0x3a62('0x15'));var licenseUtil=require(_0x3a62('0x16'));var db=require(_0x3a62('0x17'))['db'];function respondWithStatusCode(_0x338271,_0x531a15){_0x531a15=_0x531a15||0xcc;return function(_0x40d543){if(_0x40d543){return _0x338271[_0x3a62('0x18')](_0x531a15);}return _0x338271[_0x3a62('0x19')](_0x531a15)['end']();};}function respondWithResult(_0x2be410,_0x162635){_0x162635=_0x162635||0xc8;return function(_0x156a35){if(_0x156a35){return _0x2be410[_0x3a62('0x19')](_0x162635)[_0x3a62('0x1a')](_0x156a35);}};}function respondWithFilteredResult(_0x1e6927,_0x3fc493){return function(_0x1d02b3){if(_0x1d02b3){var _0x580689=typeof _0x3fc493[_0x3a62('0x1b')]==='undefined'&&typeof _0x3fc493['limit']===_0x3a62('0x1c');var _0x241464=_0x1d02b3[_0x3a62('0x1d')];var _0x33dde9=_0x580689?0x0:_0x3fc493[_0x3a62('0x1b')];var _0x2e7f5e=_0x580689?_0x1d02b3[_0x3a62('0x1d')]:_0x3fc493[_0x3a62('0x1b')]+_0x3fc493[_0x3a62('0x1e')];var _0x25cc01;if(_0x2e7f5e>=_0x241464){_0x2e7f5e=_0x241464;_0x25cc01=0xc8;}else{_0x25cc01=0xce;}_0x1e6927['status'](_0x25cc01);return _0x1e6927[_0x3a62('0x1f')](_0x3a62('0x20'),_0x33dde9+'-'+_0x2e7f5e+'/'+_0x241464)[_0x3a62('0x1a')](_0x1d02b3);}return null;};}function patchUpdates(_0x23060b){return function(_0xac3c40){try{jsonpatch['apply'](_0xac3c40,_0x23060b,!![]);}catch(_0x1b0522){return BPromise[_0x3a62('0x21')](_0x1b0522);}return _0xac3c40['save']();};}function saveUpdates(_0x4bdf51,_0x56657b){return function(_0xa5d6d9){if(_0xa5d6d9){return _0xa5d6d9[_0x3a62('0x22')](_0x4bdf51)[_0x3a62('0x23')](function(_0x1113bf){return _0x1113bf;});}return null;};}function removeEntity(_0x78ef5d,_0x4f095c){return function(_0x6ae70d){if(_0x6ae70d){return _0x6ae70d[_0x3a62('0x24')]()[_0x3a62('0x23')](function(){_0x78ef5d['status'](0xcc)[_0x3a62('0x25')]();});}};}function handleEntityNotFound(_0x242538,_0x113866){return function(_0x24daa4){if(!_0x24daa4){_0x242538['sendStatus'](0x194);}return _0x24daa4;};}function handleError(_0x2f91d6,_0x2e4336){_0x2e4336=_0x2e4336||0x1f4;return function(_0x3183f5){logger['error'](_0x3183f5[_0x3a62('0x26')]);if(_0x3183f5[_0x3a62('0x27')]){delete _0x3183f5['name'];}_0x2f91d6[_0x3a62('0x19')](_0x2e4336)[_0x3a62('0x28')](_0x3183f5);};}exports[_0x3a62('0x22')]=function(_0x3cb754,_0x3ca625){if(_0x3cb754[_0x3a62('0x29')]['id']){delete _0x3cb754[_0x3a62('0x29')]['id'];}return db['Action']['find']({'where':{'id':_0x3cb754[_0x3a62('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3ca625,null))[_0x3a62('0x23')](saveUpdates(_0x3cb754[_0x3a62('0x29')],null))[_0x3a62('0x23')](respondWithResult(_0x3ca625,null))['catch'](handleError(_0x3ca625,null));};exports['destroy']=function(_0x291944,_0xce27b3){return db[_0x3a62('0x2b')]['find']({'where':{'id':_0x291944['params']['id']}})[_0x3a62('0x23')](handleEntityNotFound(_0xce27b3,null))[_0x3a62('0x23')](removeEntity(_0xce27b3,null))[_0x3a62('0x2c')](handleError(_0xce27b3,null));};
\ No newline at end of file
+var _0xdc9a=['apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','Action','find','params','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','limit','count','offset','set','Content-Range'];(function(_0x2f131d,_0x190c7c){var _0x281910=function(_0x5cb623){while(--_0x5cb623){_0x2f131d['push'](_0x2f131d['shift']());}};_0x281910(++_0x190c7c);}(_0xdc9a,0x1c9));var _0xadc9=function(_0x2bdc75,_0x1100ec){_0x2bdc75=_0x2bdc75-0x0;var _0x103e50=_0xdc9a[_0x2bdc75];return _0x103e50;};'use strict';var emlformat=require(_0xadc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadc9('0x1'));var jsonpatch=require(_0xadc9('0x2'));var rp=require(_0xadc9('0x3'));var moment=require(_0xadc9('0x4'));var BPromise=require(_0xadc9('0x5'));var Mustache=require(_0xadc9('0x6'));var util=require(_0xadc9('0x7'));var path=require(_0xadc9('0x8'));var sox=require(_0xadc9('0x9'));var csv=require(_0xadc9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xadc9('0xb'));var _=require(_0xadc9('0xc'));var squel=require(_0xadc9('0xd'));var crypto=require('crypto');var jsforce=require(_0xadc9('0xe'));var deskjs=require(_0xadc9('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xadc9('0x10'));var Redis=require(_0xadc9('0x11'));var authService=require(_0xadc9('0x12'));var qs=require(_0xadc9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xadc9('0x14'));var logger=require(_0xadc9('0x15'))(_0xadc9('0x16'));var utils=require(_0xadc9('0x17'));var config=require(_0xadc9('0x18'));var licenseUtil=require(_0xadc9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c6174,_0x4e3cac){_0x4e3cac=_0x4e3cac||0xcc;return function(_0xb19a80){if(_0xb19a80){return _0x1c6174['sendStatus'](_0x4e3cac);}return _0x1c6174[_0xadc9('0x1a')](_0x4e3cac)['end']();};}function respondWithResult(_0x20da86,_0x551cc7){_0x551cc7=_0x551cc7||0xc8;return function(_0x5e916c){if(_0x5e916c){return _0x20da86[_0xadc9('0x1a')](_0x551cc7)['json'](_0x5e916c);}};}function respondWithFilteredResult(_0x27f740,_0x4a6fb4){return function(_0x335f9d){if(_0x335f9d){var _0x3b9213=typeof _0x4a6fb4['offset']===_0xadc9('0x1b')&&typeof _0x4a6fb4[_0xadc9('0x1c')]===_0xadc9('0x1b');var _0x45d019=_0x335f9d[_0xadc9('0x1d')];var _0x3335e5=_0x3b9213?0x0:_0x4a6fb4[_0xadc9('0x1e')];var _0x7c4b21=_0x3b9213?_0x335f9d[_0xadc9('0x1d')]:_0x4a6fb4[_0xadc9('0x1e')]+_0x4a6fb4[_0xadc9('0x1c')];var _0x436dc6;if(_0x7c4b21>=_0x45d019){_0x7c4b21=_0x45d019;_0x436dc6=0xc8;}else{_0x436dc6=0xce;}_0x27f740['status'](_0x436dc6);return _0x27f740[_0xadc9('0x1f')](_0xadc9('0x20'),_0x3335e5+'-'+_0x7c4b21+'/'+_0x45d019)['json'](_0x335f9d);}return null;};}function patchUpdates(_0xaa0540){return function(_0x3baeea){try{jsonpatch[_0xadc9('0x21')](_0x3baeea,_0xaa0540,!![]);}catch(_0x1253f7){return BPromise[_0xadc9('0x22')](_0x1253f7);}return _0x3baeea[_0xadc9('0x23')]();};}function saveUpdates(_0x52c03a,_0x50dd06){return function(_0xbce0a2){if(_0xbce0a2){return _0xbce0a2[_0xadc9('0x24')](_0x52c03a)[_0xadc9('0x25')](function(_0x2e73a9){return _0x2e73a9;});}return null;};}function removeEntity(_0x64dbb8,_0x35c2d3){return function(_0x1a7d57){if(_0x1a7d57){return _0x1a7d57[_0xadc9('0x26')]()['then'](function(){_0x64dbb8['status'](0xcc)[_0xadc9('0x27')]();});}};}function handleEntityNotFound(_0x5d1a9d,_0x145aec){return function(_0x5b3b38){if(!_0x5b3b38){_0x5d1a9d[_0xadc9('0x28')](0x194);}return _0x5b3b38;};}function handleError(_0x5e97e1,_0x414a1a){_0x414a1a=_0x414a1a||0x1f4;return function(_0x1e14e4){logger[_0xadc9('0x29')](_0x1e14e4[_0xadc9('0x2a')]);if(_0x1e14e4[_0xadc9('0x2b')]){delete _0x1e14e4[_0xadc9('0x2b')];}_0x5e97e1[_0xadc9('0x1a')](_0x414a1a)['send'](_0x1e14e4);};}exports[_0xadc9('0x24')]=function(_0x51349f,_0x2741e9){if(_0x51349f['body']['id']){delete _0x51349f['body']['id'];}return db[_0xadc9('0x2c')][_0xadc9('0x2d')]({'where':{'id':_0x51349f[_0xadc9('0x2e')]['id']}})[_0xadc9('0x25')](handleEntityNotFound(_0x2741e9,null))[_0xadc9('0x25')](saveUpdates(_0x51349f[_0xadc9('0x2f')],null))['then'](respondWithResult(_0x2741e9,null))[_0xadc9('0x30')](handleError(_0x2741e9,null));};exports[_0xadc9('0x26')]=function(_0x4118cd,_0x1bb776){return db[_0xadc9('0x2c')][_0xadc9('0x2d')]({'where':{'id':_0x4118cd[_0xadc9('0x2e')]['id']}})[_0xadc9('0x25')](handleEntityNotFound(_0x1bb776,null))[_0xadc9('0x25')](removeEntity(_0x1bb776,null))[_0xadc9('0x30')](handleError(_0x1bb776,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 5802e97..128fa82 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39fd=['define','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x39fd,0x1d6));var _0xd39f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x39fd[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var logger=require(_0xd39f('0x2'))('api');var moment=require(_0xd39f('0x3'));var BPromise=require(_0xd39f('0x4'));var rp=require(_0xd39f('0x5'));var fs=require('fs');var path=require(_0xd39f('0x6'));var rimraf=require(_0xd39f('0x7'));var config=require(_0xd39f('0x8'));var attributes=require(_0xd39f('0x9'));module[_0xd39f('0xa')]=function(_0x7252de,_0x4b6567){return _0x7252de[_0xd39f('0xb')]('Action',attributes,{'tableName':_0xd39f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a21=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x246e91,_0x2960aa){var _0x3d3e82=function(_0x1f243a){while(--_0x1f243a){_0x246e91['push'](_0x246e91['shift']());}};_0x3d3e82(++_0x2960aa);}(_0x1a21,0x1d9));var _0x11a2=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x1a21[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x11a2('0x0'));var util=require(_0x11a2('0x1'));var logger=require(_0x11a2('0x2'))(_0x11a2('0x3'));var moment=require(_0x11a2('0x4'));var BPromise=require(_0x11a2('0x5'));var rp=require(_0x11a2('0x6'));var fs=require('fs');var path=require(_0x11a2('0x7'));var rimraf=require(_0x11a2('0x8'));var config=require(_0x11a2('0x9'));var attributes=require(_0x11a2('0xa'));module['exports']=function(_0x25ba2c,_0x374aa3){return _0x25ba2c[_0x11a2('0xb')](_0x11a2('0xc'),attributes,{'tableName':_0x11a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 631d40a..008e8d1 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x226685,_0x54f77d){var _0x12ed69=function(_0xc9411d){while(--_0xc9411d){_0x226685['push'](_0x226685['shift']());}};_0x12ed69(++_0x54f77d);}(_0x1261,0x144));var _0x1126=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x1261[_0x9df3d8];return _0x366da1;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0xf494,0x1c6));var _0x4f49=function(_0x48a169,_0x25ac39){_0x48a169=_0x48a169-0x0;var _0x171f2e=_0xf494[_0x48a169];return _0x171f2e;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9e1181a..980edbb 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xafc2=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','delete','isAuthenticated','exports','multer'];(function(_0x460114,_0x4e0935){var _0x5a124f=function(_0x2e26bd){while(--_0x2e26bd){_0x460114['push'](_0x460114['shift']());}};_0x5a124f(++_0x4e0935);}(_0xafc2,0x8b));var _0x2afc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xafc2[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x2afc('0x0'));var util=require(_0x2afc('0x1'));var path=require(_0x2afc('0x2'));var timeout=require(_0x2afc('0x3'));var express=require(_0x2afc('0x4'));var router=express[_0x2afc('0x5')]();var fs_extra=require(_0x2afc('0x6'));var auth=require(_0x2afc('0x7'));var interaction=require(_0x2afc('0x8'));var config=require(_0x2afc('0x9'));var controller=require('./action.controller');router['put'](_0x2afc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2afc('0xb')](_0x2afc('0xa'),auth[_0x2afc('0xc')](),controller['destroy']);module[_0x2afc('0xd')]=router;
\ No newline at end of file
+var _0x648a=['Router','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','util','express'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x648a,0x1e2));var _0xa648=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x648a[_0x342baa];return _0x1208f3;};'use strict';var multer=require('multer');var util=require(_0xa648('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa648('0x1'));var router=express[_0xa648('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa648('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa648('0x4'));var controller=require('./action.controller');router[_0xa648('0x5')](_0xa648('0x6'),auth[_0xa648('0x7')](),controller[_0xa648('0x8')]);router[_0xa648('0x9')](_0xa648('0x6'),auth[_0xa648('0x7')](),controller[_0xa648('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index f8e8a83..341bcdb 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae24=['sequelize','STRING'];(function(_0x4e5770,_0x194f1e){var _0x32f748=function(_0x467fe2){while(--_0x467fe2){_0x4e5770['push'](_0x4e5770['shift']());}};_0x32f748(++_0x194f1e);}(_0xae24,0x182));var _0x4ae2=function(_0x2afa27,_0x1fd584){_0x2afa27=_0x2afa27-0x0;var _0x262db6=_0xae24[_0x2afa27];return _0x262db6;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x43719c,_0x3d52e2){var _0x5c4f8a=function(_0x29f2b3){while(--_0x29f2b3){_0x43719c['push'](_0x43719c['shift']());}};_0x5c4f8a(++_0x3d52e2);}(_0x814b,0x1a2));var _0xb814=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0x814b[_0x4b1012];return _0x23d715;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 2ef0c85..3e918c4 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5360=['%s-%s.%s','randomstring','generate','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','alias','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','CustomReports','end','error','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','autoAssociation','UserProfileResource','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','AnalyticMetric','findAll','select','output','web','fullPath'];(function(_0x3f0ac0,_0x117243){var _0x2bb684=function(_0x287d0d){while(--_0x287d0d){_0x3f0ac0['push'](_0x3f0ac0['shift']());}};_0x2bb684(++_0x117243);}(_0x5360,0x157));var _0x0536=function(_0x53517b,_0x23472d){_0x53517b=_0x53517b-0x0;var _0x2031a8=_0x5360[_0x53517b];return _0x2031a8;};'use strict';var emlformat=require(_0x0536('0x0'));var rimraf=require(_0x0536('0x1'));var zipdir=require(_0x0536('0x2'));var jsonpatch=require(_0x0536('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0536('0x4'));var Mustache=require('mustache');var util=require(_0x0536('0x5'));var path=require(_0x0536('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0536('0x7'));var _=require(_0x0536('0x8'));var squel=require(_0x0536('0x9'));var crypto=require(_0x0536('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0536('0xb'));var toCsv=require(_0x0536('0xc'));var querystring=require(_0x0536('0xd'));var Papa=require('papaparse');var Redis=require(_0x0536('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0536('0xf'))(_0x0536('0x10'));var utils=require(_0x0536('0x11'));var config=require(_0x0536('0x12'));var licenseUtil=require(_0x0536('0x13'));var db=require(_0x0536('0x14'))['db'];var dbH=require(_0x0536('0x14'))[_0x0536('0x15')];function respondWithStatusCode(_0x46da69,_0x1d2790){_0x1d2790=_0x1d2790||0xcc;return function(_0x2552aa){if(_0x2552aa){return _0x46da69[_0x0536('0x16')](_0x1d2790);}return _0x46da69[_0x0536('0x17')](_0x1d2790)['end']();};}function respondWithResult(_0x29123b,_0x114f64){_0x114f64=_0x114f64||0xc8;return function(_0xcd2622){if(_0xcd2622){return _0x29123b[_0x0536('0x17')](_0x114f64)[_0x0536('0x18')](_0xcd2622);}};}function respondWithFilteredResult(_0x58dddc,_0x3d6b68){return function(_0x3785ba){if(_0x3785ba){var _0x1ea9db=typeof _0x3d6b68[_0x0536('0x19')]==='undefined'&&typeof _0x3d6b68['limit']===_0x0536('0x1a');var _0x25fb28=_0x3785ba[_0x0536('0x1b')];var _0x5c676c=_0x1ea9db?0x0:_0x3d6b68['offset'];var _0x260faa=_0x1ea9db?_0x3785ba[_0x0536('0x1b')]:_0x3d6b68['offset']+_0x3d6b68[_0x0536('0x1c')];var _0xe7d2f;if(_0x260faa>=_0x25fb28){_0x260faa=_0x25fb28;_0xe7d2f=0xc8;}else{_0xe7d2f=0xce;}_0x58dddc[_0x0536('0x17')](_0xe7d2f);return _0x58dddc[_0x0536('0x1d')](_0x0536('0x1e'),_0x5c676c+'-'+_0x260faa+'/'+_0x25fb28)['json'](_0x3785ba);}return null;};}function patchUpdates(_0x173414){return function(_0x51ba52){try{jsonpatch['apply'](_0x51ba52,_0x173414,!![]);}catch(_0x21f3ae){return BPromise[_0x0536('0x1f')](_0x21f3ae);}return _0x51ba52[_0x0536('0x20')]();};}function saveUpdates(_0x2f5ebd,_0x139523){return function(_0x3a54ab){if(_0x3a54ab){return _0x3a54ab[_0x0536('0x21')](_0x2f5ebd)['then'](function(_0x475b87){return _0x475b87;});}return null;};}function removeEntity(_0x3e3542,_0x5a52b0){return function(_0x3294da){if(_0x3294da){return _0x3294da[_0x0536('0x22')]()[_0x0536('0x23')](function(){var _0x4e3287=_0x3294da[_0x0536('0x24')]({'plain':!![]});var _0x290701=_0x0536('0x25');return db['UserProfileResource'][_0x0536('0x22')]({'where':{'type':_0x290701,'resourceId':_0x4e3287['id']}})[_0x0536('0x23')](function(){return _0x3294da;});})[_0x0536('0x23')](function(){_0x3e3542[_0x0536('0x17')](0xcc)[_0x0536('0x26')]();});}};}function handleEntityNotFound(_0x83fa55,_0x81b08c){return function(_0x1fe89a){if(!_0x1fe89a){_0x83fa55[_0x0536('0x16')](0x194);}return _0x1fe89a;};}function handleError(_0x2e3ab1,_0x5f4b92){_0x5f4b92=_0x5f4b92||0x1f4;return function(_0x2ab6dd){logger[_0x0536('0x27')](_0x2ab6dd['stack']);if(_0x2ab6dd[_0x0536('0x28')]){delete _0x2ab6dd[_0x0536('0x28')];}_0x2e3ab1[_0x0536('0x17')](_0x5f4b92)[_0x0536('0x29')](_0x2ab6dd);};}exports['index']=function(_0x2e5ad0,_0x562ce1){var _0x4a74d3={},_0x2d8700={},_0x32121a={'count':0x0,'rows':[]};var _0x1efa98=_[_0x0536('0x2a')](db[_0x0536('0x2b')][_0x0536('0x2c')],function(_0x5830e0){return{'name':_0x5830e0[_0x0536('0x2d')],'type':_0x5830e0[_0x0536('0x2e')]['key']};});_0x2d8700[_0x0536('0x2f')]=_['map'](_0x1efa98,_0x0536('0x28'));_0x2d8700[_0x0536('0x30')]=_[_0x0536('0x31')](_0x2e5ad0[_0x0536('0x30')]);_0x2d8700[_0x0536('0x32')]=_[_0x0536('0x33')](_0x2d8700['model'],_0x2d8700[_0x0536('0x30')]);_0x4a74d3['attributes']=_['intersection'](_0x2d8700[_0x0536('0x2f')],qs[_0x0536('0x34')](_0x2e5ad0[_0x0536('0x30')]['fields']));_0x4a74d3[_0x0536('0x35')]=_0x4a74d3[_0x0536('0x35')][_0x0536('0x36')]?_0x4a74d3[_0x0536('0x35')]:_0x2d8700[_0x0536('0x2f')];if(!_0x2e5ad0['query'][_0x0536('0x37')](_0x0536('0x38'))){_0x4a74d3[_0x0536('0x1c')]=qs[_0x0536('0x1c')](_0x2e5ad0[_0x0536('0x30')]['limit']);_0x4a74d3[_0x0536('0x19')]=qs['offset'](_0x2e5ad0[_0x0536('0x30')][_0x0536('0x19')]);}_0x4a74d3[_0x0536('0x39')]=qs['sort'](_0x2e5ad0[_0x0536('0x30')][_0x0536('0x3a')]);_0x4a74d3[_0x0536('0x3b')]=qs[_0x0536('0x32')](_['pick'](_0x2e5ad0[_0x0536('0x30')],_0x2d8700[_0x0536('0x32')]),_0x1efa98);if(_0x2e5ad0['query'][_0x0536('0x3c')]){_0x4a74d3['where']=_['merge'](_0x4a74d3[_0x0536('0x3b')],{'$or':_[_0x0536('0x2a')](_0x1efa98,function(_0x29c9df){if(_0x29c9df['type']!=='VIRTUAL'){var _0x582325={};_0x582325[_0x29c9df[_0x0536('0x28')]]={'$like':'%'+_0x2e5ad0[_0x0536('0x30')]['filter']+'%'};return _0x582325;}})});}_0x4a74d3=_[_0x0536('0x3d')]({},_0x4a74d3,_0x2e5ad0[_0x0536('0x3e')]);var _0x3f5ef2={'where':_0x4a74d3[_0x0536('0x3b')]};return db['AnalyticCustomReport'][_0x0536('0x1b')](_0x3f5ef2)[_0x0536('0x23')](function(_0x25f37e){_0x32121a[_0x0536('0x1b')]=_0x25f37e;if(_0x2e5ad0[_0x0536('0x30')][_0x0536('0x3f')]){_0x4a74d3[_0x0536('0x40')]=[{'all':!![]}];}return db[_0x0536('0x2b')]['findAll'](_0x4a74d3);})[_0x0536('0x23')](function(_0x18f9da){_0x32121a[_0x0536('0x41')]=_0x18f9da;return _0x32121a;})['then'](respondWithFilteredResult(_0x562ce1,_0x4a74d3))[_0x0536('0x42')](handleError(_0x562ce1,null));};exports[_0x0536('0x43')]=function(_0x41deb2,_0x251555){var _0x3a765b={'raw':![],'where':{'id':_0x41deb2[_0x0536('0x44')]['id']}},_0x49c5b7={};_0x49c5b7[_0x0536('0x2f')]=_['keys'](db[_0x0536('0x2b')][_0x0536('0x2c')]);_0x49c5b7[_0x0536('0x30')]=_[_0x0536('0x31')](_0x41deb2[_0x0536('0x30')]);_0x49c5b7[_0x0536('0x32')]=_[_0x0536('0x33')](_0x49c5b7['model'],_0x49c5b7['query']);_0x3a765b[_0x0536('0x35')]=_[_0x0536('0x33')](_0x49c5b7[_0x0536('0x2f')],qs[_0x0536('0x34')](_0x41deb2[_0x0536('0x30')][_0x0536('0x34')]));_0x3a765b[_0x0536('0x35')]=_0x3a765b[_0x0536('0x35')]['length']?_0x3a765b[_0x0536('0x35')]:_0x49c5b7[_0x0536('0x2f')];if(_0x41deb2['query'][_0x0536('0x3f')]){_0x3a765b['include']=[{'all':!![]}];}_0x3a765b=_[_0x0536('0x3d')]({},_0x3a765b,_0x41deb2[_0x0536('0x3e')]);return db['AnalyticCustomReport']['find'](_0x3a765b)[_0x0536('0x23')](handleEntityNotFound(_0x251555,null))[_0x0536('0x23')](respondWithResult(_0x251555,null))[_0x0536('0x42')](handleError(_0x251555,null));};exports[_0x0536('0x45')]=function(_0x284c5b,_0x342a67){return db[_0x0536('0x2b')][_0x0536('0x45')](_0x284c5b[_0x0536('0x46')],{})[_0x0536('0x23')](function(_0x632a91){var _0x2a801b=_0x284c5b[_0x0536('0x47')]['get']({'plain':!![]});if(!_0x2a801b)throw new Error(_0x0536('0x48'));if(_0x2a801b[_0x0536('0x49')]===_0x0536('0x47')){var _0x4d356c=_0x632a91[_0x0536('0x24')]({'plain':!![]});var _0xda98ac=_0x0536('0x4a');return db[_0x0536('0x4b')][_0x0536('0x4c')]({'where':{'name':_0xda98ac,'userProfileId':_0x2a801b['userProfileId']},'raw':!![]})[_0x0536('0x23')](function(_0x36807b){if(_0x36807b&&_0x36807b[_0x0536('0x4d')]===0x0){return db[_0x0536('0x4e')][_0x0536('0x45')]({'name':_0x4d356c[_0x0536('0x28')],'resourceId':_0x4d356c['id'],'type':_0x0536('0x25'),'sectionId':_0x36807b['id']},{})['then'](function(){return _0x632a91;});}else{return _0x632a91;}})[_0x0536('0x42')](function(_0x12172a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12172a);throw _0x12172a;});}return _0x632a91;})[_0x0536('0x23')](respondWithResult(_0x342a67,0xc9))[_0x0536('0x42')](handleError(_0x342a67,null));};exports[_0x0536('0x21')]=function(_0x3e247e,_0x126103){if(_0x3e247e['body']['id']){delete _0x3e247e[_0x0536('0x46')]['id'];}return db['AnalyticCustomReport'][_0x0536('0x4c')]({'where':{'id':_0x3e247e[_0x0536('0x44')]['id']}})[_0x0536('0x23')](handleEntityNotFound(_0x126103,null))[_0x0536('0x23')](saveUpdates(_0x3e247e[_0x0536('0x46')],null))[_0x0536('0x23')](respondWithResult(_0x126103,null))[_0x0536('0x42')](handleError(_0x126103,null));};exports[_0x0536('0x22')]=function(_0x10022f,_0x35da14){return db[_0x0536('0x2b')][_0x0536('0x4c')]({'where':{'id':_0x10022f[_0x0536('0x44')]['id']}})[_0x0536('0x23')](handleEntityNotFound(_0x35da14,null))['then'](removeEntity(_0x35da14,null))['catch'](handleError(_0x35da14,null));};exports['preview']=function(_0x524553,_0x2e0005){var _0x4e05f2=0xa;var _0x502938=[_0x0536('0x4f'),_0x0536('0x50'),_0x0536('0x51'),_0x0536('0x52')];var _0x502172={'SUM':_0x0536('0x53'),'COUNT':_0x0536('0x54'),'COUNT DISTINCT':_0x0536('0x55'),'MAX':_0x0536('0x56'),'MIN':'MIN(%s)','AVG':_0x0536('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0536('0x58')};var _0x2cbc1e={'SEC_TO_TIME':_0x0536('0x59'),'DATE':_0x0536('0x5a'),'HOUR':_0x0536('0x5b'),'ROUND':_0x0536('0x5c'),'UNIX_TIMESTAMP':_0x0536('0x5d')};var _0xbc7916=function(_0x291dae){return!_['includes']([_0x0536('0x5e'),_0x0536('0x5f'),_0x0536('0x60'),_0x0536('0x61')],_0x291dae);};var _0x236d1a=function(_0x275039){if(!_0x275039||!_0x275039[_0x0536('0x62')][_0x0536('0x36')]){return'';}for(var _0x26cbf5='(',_0x4ea409=0x0;_0x4ea409<_0x275039[_0x0536('0x62')][_0x0536('0x36')];_0x4ea409+=0x1){_0x4ea409>0x0&&(_0x26cbf5+='\x20'+_0x275039[_0x0536('0x63')]+'\x20');_0x26cbf5+=_0x275039[_0x0536('0x62')][_0x4ea409][_0x0536('0x64')]?_0x236d1a(_0x275039[_0x0536('0x62')][_0x4ea409][_0x0536('0x64')]):_0x275039['rules'][_0x4ea409][_0x0536('0x65')]+'\x20'+_0x275039[_0x0536('0x62')][_0x4ea409]['condition']+(_0xbc7916(_0x275039[_0x0536('0x62')][_0x4ea409][_0x0536('0x66')])?'\x20'+_0x275039['rules'][_0x4ea409][_0x0536('0x67')]:'');}return _0x26cbf5+')';};var _0x2f7ae7={'where':{'id':_0x524553[_0x0536('0x44')]['id']}},_0x508700,_0x4b91ac,_0x182066,_0x2a955a,_0x6de5f9;_0x2f7ae7=_['merge']({},_0x2f7ae7,_0x524553[_0x0536('0x3e')]);return db[_0x0536('0x2b')]['find'](_0x2f7ae7)[_0x0536('0x23')](function(_0x196020){if(_0x196020){_0x508700=_0x196020;return _0x196020[_0x0536('0x68')]();}return null;})[_0x0536('0x23')](function(_0x1d7fbe){if(_0x1d7fbe){if(!_0x1d7fbe[_0x0536('0x36')]){throw new db[(_0x0536('0x69'))][(_0x0536('0x6a'))](_0x0536('0x6b'),0x193);}_0x4b91ac=_0x1d7fbe;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x0536('0x23')](function(_0x584d6b){if(_0x584d6b){_0x182066=_[_0x0536('0x6c')](_0x584d6b,'id');var _0x4445fb;var _0x56a8b9=squel['select']();_0x56a8b9[_0x0536('0x6d')](_0x508700[_0x0536('0x6e')]);for(var _0x5aa832=0x0;_0x5aa832<_0x4b91ac[_0x0536('0x36')];_0x5aa832+=0x1){_0x4445fb=_0x4b91ac[_0x5aa832][_0x0536('0x6f')]?_0x182066[_0x4b91ac[_0x5aa832][_0x0536('0x6f')]][_0x0536('0x70')]:_0x4b91ac[_0x5aa832]['field'];_0x4445fb=_0x4b91ac[_0x5aa832][_0x0536('0x71')]?_[_0x0536('0x72')](_0x502172[_0x4b91ac[_0x5aa832][_0x0536('0x71')]],'%s',_0x4445fb):_0x4445fb;_0x4445fb=_0x4b91ac[_0x5aa832]['format']?_[_0x0536('0x72')](_0x2cbc1e[_0x4b91ac[_0x5aa832][_0x0536('0x73')]],'%s',_0x4445fb):_0x4445fb;if(_0x4b91ac[_0x5aa832][_0x0536('0x74')]){_0x56a8b9['group'](_0x4445fb);}_0x4b91ac[_0x5aa832][_0x0536('0x75')]&&_0x56a8b9[_0x0536('0x39')](_0x4445fb,_0x4b91ac[_0x5aa832][_0x0536('0x75')]===_0x0536('0x76')?![]:!![]);_0x56a8b9['field'](_0x4445fb,_0x4b91ac[_0x5aa832]['alias']||_0x4445fb);}if(_0x508700['joins']){_0x508700[_0x0536('0x77')]=JSON['parse'](_0x508700['joins']);for(var _0x2cf2d4=0x0;_0x2cf2d4<_0x508700[_0x0536('0x77')]['length'];_0x2cf2d4+=0x1){if(_0x508700[_0x0536('0x77')][_0x2cf2d4][_0x0536('0x2e')]&&_[_0x0536('0x78')](_0x502938,_0x508700[_0x0536('0x77')][_0x2cf2d4]['type'])&&_0x508700[_0x0536('0x77')][_0x2cf2d4][_0x0536('0x79')]&&_0x508700[_0x0536('0x77')][_0x2cf2d4][_0x0536('0x7a')]&&_0x508700[_0x0536('0x77')][_0x2cf2d4]['foreignKey']){_0x56a8b9[_0x508700[_0x0536('0x77')][_0x2cf2d4][_0x0536('0x2e')]](_0x508700[_0x0536('0x77')][_0x2cf2d4][_0x0536('0x7a')],null,util[_0x0536('0x73')](_0x0536('0x7b'),_0x508700['table'],_0x508700[_0x0536('0x77')][_0x2cf2d4][_0x0536('0x79')],_0x508700[_0x0536('0x77')][_0x2cf2d4]['foreignTable'],_0x508700['joins'][_0x2cf2d4][_0x0536('0x7c')]));}}}if(_0x508700[_0x0536('0x7d')]){_0x508700[_0x0536('0x7d')]=JSON[_0x0536('0x7e')](_0x508700[_0x0536('0x7d')]);_0x56a8b9[_0x0536('0x3b')](_0x236d1a(_0x508700[_0x0536('0x7d')][_0x0536('0x64')]));}_0x6de5f9=_0x56a8b9[_0x0536('0x7f')]();_0x56a8b9[_0x0536('0x1c')](_0x4e05f2);_0x56a8b9[_0x0536('0x19')](0x0);logger[_0x0536('0x80')](_0x0536('0x81'),_0x56a8b9[_0x0536('0x82')]());return dbH['sequelize'][_0x0536('0x30')](_0x56a8b9[_0x0536('0x82')](),{'type':dbH[_0x0536('0x83')][_0x0536('0x84')][_0x0536('0x85')]});}})['then'](respondWithResult(_0x2e0005,null))[_0x0536('0x42')](handleError(_0x2e0005,null));};function runReport(_0x59854a,_0x3a7fbf,_0x215811){var _0xe638c8=_0x3a7fbf[_0x0536('0x28')];var _0x436023=0xa;var _0x928050=[_0x0536('0x4f'),_0x0536('0x50'),_0x0536('0x51'),_0x0536('0x52')];var _0x5b8af9={'SUM':_0x0536('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0536('0x55'),'MAX':_0x0536('0x56'),'MIN':_0x0536('0x86'),'AVG':_0x0536('0x57'),'GROUP_CONCAT':_0x0536('0x87'),'GROUP_CONCAT ASC':_0x0536('0x88'),'GROUP_CONCAT DESC':_0x0536('0x58')};var _0x35dbb6={'SEC_TO_TIME':_0x0536('0x59'),'DATE':'DATE(%s)','HOUR':_0x0536('0x5b'),'ROUND':_0x0536('0x5c'),'UNIX_TIMESTAMP':_0x0536('0x5d')};var _0x55028f=function(_0x955667){return!_[_0x0536('0x78')]([_0x0536('0x5e'),_0x0536('0x5f'),_0x0536('0x60'),_0x0536('0x61')],_0x955667);};var _0x4f0beb=function(_0x465f28){if(!_0x465f28||!_0x465f28[_0x0536('0x62')]['length']){return'';}for(var _0xcf7892='(',_0x311ca5=0x0;_0x311ca5<_0x465f28[_0x0536('0x62')]['length'];_0x311ca5+=0x1){_0x311ca5>0x0&&(_0xcf7892+='\x20'+_0x465f28[_0x0536('0x63')]+'\x20');_0xcf7892+=_0x465f28[_0x0536('0x62')][_0x311ca5][_0x0536('0x64')]?_0x4f0beb(_0x465f28[_0x0536('0x62')][_0x311ca5][_0x0536('0x64')]):_0x465f28[_0x0536('0x62')][_0x311ca5]['field']+'\x20'+_0x465f28[_0x0536('0x62')][_0x311ca5][_0x0536('0x66')]+(_0x55028f(_0x465f28[_0x0536('0x62')][_0x311ca5][_0x0536('0x66')])?'\x20'+_0x465f28[_0x0536('0x62')][_0x311ca5][_0x0536('0x67')]:'');}return _0xcf7892+')';};var _0xe1c650={'where':{'id':_0x59854a['id']}},_0x49aa80,_0x52c853,_0x2ce85a,_0x23b32f,_0x2680c1;_0xe1c650=_['merge']({},_0xe1c650,_0x215811);return db[_0x0536('0x2b')][_0x0536('0x4c')](_0xe1c650)[_0x0536('0x23')](function(_0x490d5d){if(_0x490d5d){_0x49aa80=_0x490d5d;return _0x490d5d['getFields']();}return null;})[_0x0536('0x23')](function(_0x24e44a){if(_0x24e44a){if(!_0x24e44a['length']){throw new db[(_0x0536('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x52c853=_0x24e44a;return db[_0x0536('0x89')][_0x0536('0x8a')]({'raw':!![]});}return null;})[_0x0536('0x23')](function(_0xb0a97){if(_0xb0a97){_0x2ce85a=_[_0x0536('0x6c')](_0xb0a97,'id');var _0x28896c;var _0x3ae3cb=squel[_0x0536('0x8b')]();_0x3ae3cb[_0x0536('0x6d')](_0x49aa80[_0x0536('0x6e')]);for(var _0x4eceb4=0x0;_0x4eceb4<_0x52c853[_0x0536('0x36')];_0x4eceb4+=0x1){_0x28896c=_0x52c853[_0x4eceb4][_0x0536('0x6f')]?_0x2ce85a[_0x52c853[_0x4eceb4][_0x0536('0x6f')]][_0x0536('0x70')]:_0x52c853[_0x4eceb4][_0x0536('0x65')];_0x28896c=_0x52c853[_0x4eceb4]['function']?_[_0x0536('0x72')](_0x5b8af9[_0x52c853[_0x4eceb4][_0x0536('0x71')]],'%s',_0x28896c):_0x28896c;_0x28896c=_0x52c853[_0x4eceb4]['format']?_[_0x0536('0x72')](_0x35dbb6[_0x52c853[_0x4eceb4]['format']],'%s',_0x28896c):_0x28896c;if(_0x52c853[_0x4eceb4][_0x0536('0x74')]){_0x3ae3cb['group'](_0x28896c);}_0x52c853[_0x4eceb4][_0x0536('0x75')]&&_0x3ae3cb[_0x0536('0x39')](_0x28896c,_0x52c853[_0x4eceb4][_0x0536('0x75')]===_0x0536('0x76')?![]:!![]);_0x3ae3cb['field'](_0x28896c,_0x52c853[_0x4eceb4]['alias']||_0x28896c);}if(_0x49aa80[_0x0536('0x77')]){_0x49aa80[_0x0536('0x77')]=JSON[_0x0536('0x7e')](_0x49aa80['joins']);for(var _0x20c413=0x0;_0x20c413<_0x49aa80[_0x0536('0x77')][_0x0536('0x36')];_0x20c413+=0x1){if(_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x2e')]&&_[_0x0536('0x78')](_0x928050,_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x2e')])&&_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x79')]&&_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x7a')]&&_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x7c')]){_0x3ae3cb[_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x2e')]](_0x49aa80[_0x0536('0x77')][_0x20c413]['foreignTable'],null,util[_0x0536('0x73')](_0x0536('0x7b'),_0x49aa80['table'],_0x49aa80[_0x0536('0x77')][_0x20c413]['parentKey'],_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x7a')],_0x49aa80[_0x0536('0x77')][_0x20c413][_0x0536('0x7c')]));}}}if(_0x49aa80[_0x0536('0x7d')]){_0x49aa80[_0x0536('0x7d')]=JSON[_0x0536('0x7e')](_0x49aa80[_0x0536('0x7d')]);_0x3ae3cb[_0x0536('0x3b')](_0x4f0beb(_0x49aa80[_0x0536('0x7d')][_0x0536('0x64')]));}_0x2680c1=_0x3ae3cb[_0x0536('0x7f')]();_0x3ae3cb['limit'](_0x436023);_0x3ae3cb[_0x0536('0x19')](0x0);return;}})[_0x0536('0x23')](function(){if(_0x3a7fbf[_0x0536('0x8c')]===_0x0536('0x8d')){return null;}var _0x5a2f99=_[_0x0536('0x3d')](_0x3a7fbf,{'name':_0x3a7fbf[_0x0536('0x8e')]||_0x3a7fbf[_0x0536('0x28')]||_0x49aa80[_0x0536('0x28')],'basename':_0xe638c8,'savename':util[_0x0536('0x73')](_0x0536('0x8f'),_0x3a7fbf[_0x0536('0x28')]||_0x49aa80[_0x0536('0x28')],require(_0x0536('0x90'))[_0x0536('0x91')](0x4),_0x3a7fbf['output']||'csv'),'reportId':_0x49aa80['id'],'reportType':'custom'});return db[_0x0536('0x92')][_0x0536('0x45')](_0x5a2f99,{'raw':!![]});})[_0x0536('0x23')](function(_0x1a5c5b){if(_0x49aa80['table']==='cdr'){_0x2680c1['where'](_0x49aa80[_0x0536('0x6e')]+_0x0536('0x93'),_0x3a7fbf[_0x0536('0x94')],_0x3a7fbf[_0x0536('0x95')]);}else{_0x2680c1['where'](_0x49aa80[_0x0536('0x6e')]+_0x0536('0x96'),_0x3a7fbf[_0x0536('0x94')],_0x3a7fbf[_0x0536('0x95')]);}if(_0x1a5c5b){logger[_0x0536('0x97')](_0x0536('0x98'),_0x2680c1[_0x0536('0x82')]());require(_0x0536('0x99'))['fork'](path[_0x0536('0x4f')](__dirname,_0x0536('0x9a'),_0x1a5c5b['output']),[_0x1a5c5b['id'],_0x2680c1['toString'](),path[_0x0536('0x4f')](__dirname,_0x0536('0x9b'),_0x1a5c5b[_0x0536('0x9c')]),_0xe638c8]);return _0x1a5c5b;}else{var _0x5b0149=squel[_0x0536('0x8b')]();_0x5b0149['from']('('+_0x2680c1[_0x0536('0x82')]()+')',_0x0536('0x9d'));_0x5b0149[_0x0536('0x65')](_0x0536('0x9e'),_0x0536('0x1b'));_0x2680c1[_0x0536('0x1c')](_0x3a7fbf['limit']||_0x436023);_0x2680c1['offset'](_0x3a7fbf[_0x0536('0x19')]||0x0);return dbH[_0x0536('0x83')][_0x0536('0x30')](_0x5b0149[_0x0536('0x82')](),{'type':dbH[_0x0536('0x83')][_0x0536('0x84')][_0x0536('0x85')]})['then'](function(_0x4b2a88){if(!_0x4b2a88['length']){_0x23b32f=0x0;}else{_0x23b32f=_0x4b2a88[0x0][_0x0536('0x1b')]||0x0;}return dbH[_0x0536('0x83')][_0x0536('0x30')](_0x2680c1['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x0536('0x23')](function(_0x37e324){return{'rows':_0x37e324||[],'count':_0x23b32f};});}});}exports[_0x0536('0x9f')]=function(_0x1ca1bf,_0x37bc19){return runReport(_0x1ca1bf[_0x0536('0x44')],_0x1ca1bf['query'],_0x1ca1bf[_0x0536('0x3e')])['then'](respondWithResult(_0x37bc19,null))[_0x0536('0x42')](handleError(_0x37bc19,null));};exports[_0x0536('0xa0')]=runReport;exports[_0x0536('0x30')]=function(_0x33d3be,_0x51f52d){var _0x4d7093=0xa;var _0x4fe845=[_0x0536('0x4f'),_0x0536('0x50'),_0x0536('0x51'),_0x0536('0x52')];var _0x2cd217={'SUM':'SUM(%s)','COUNT':_0x0536('0x54'),'COUNT DISTINCT':_0x0536('0x55'),'MAX':_0x0536('0x56'),'MIN':_0x0536('0x86'),'AVG':_0x0536('0x57'),'GROUP_CONCAT':_0x0536('0x87'),'GROUP_CONCAT ASC':_0x0536('0x88'),'GROUP_CONCAT DESC':_0x0536('0x58')};var _0x3a0661={'SEC_TO_TIME':_0x0536('0x59'),'DATE':'DATE(%s)','HOUR':_0x0536('0x5b'),'ROUND':_0x0536('0x5c'),'UNIX_TIMESTAMP':_0x0536('0x5d')};var _0x93a14e=function(_0xc4a3d){return!_[_0x0536('0x78')]([_0x0536('0x5e'),'IS\x20NOT\x20NULL',_0x0536('0x60'),'IS\x20NOT\x20EMPTY'],_0xc4a3d);};var _0x16bc27=function(_0x350169){if(!_0x350169||!_0x350169['rules'][_0x0536('0x36')]){return'';}for(var _0x54e5fe='(',_0x5bc238=0x0;_0x5bc238<_0x350169[_0x0536('0x62')][_0x0536('0x36')];_0x5bc238+=0x1){_0x5bc238>0x0&&(_0x54e5fe+='\x20'+_0x350169[_0x0536('0x63')]+'\x20');_0x54e5fe+=_0x350169['rules'][_0x5bc238]['group']?_0x16bc27(_0x350169['rules'][_0x5bc238]['group']):_0x350169['rules'][_0x5bc238][_0x0536('0x65')]+'\x20'+_0x350169[_0x0536('0x62')][_0x5bc238][_0x0536('0x66')]+(_0x93a14e(_0x350169[_0x0536('0x62')][_0x5bc238][_0x0536('0x66')])?'\x20'+_0x350169[_0x0536('0x62')][_0x5bc238][_0x0536('0x67')]:'');}return _0x54e5fe+')';};var _0x535c81={'where':{'id':_0x33d3be[_0x0536('0x44')]['id']}},_0x3a998b,_0x5085fe,_0x31bca8,_0x56dd99,_0x9e0a8f;_0x535c81=_['merge']({},_0x535c81,_0x33d3be[_0x0536('0x3e')]);return db[_0x0536('0x2b')]['find'](_0x535c81)['then'](function(_0x45d399){if(_0x45d399){_0x3a998b=_0x45d399;return _0x45d399[_0x0536('0x68')]();}return null;})[_0x0536('0x23')](function(_0x4931a2){if(_0x4931a2){if(!_0x4931a2['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5085fe=_0x4931a2;return db['AnalyticMetric'][_0x0536('0x8a')]({'raw':!![]});}return null;})[_0x0536('0x23')](function(_0x36a3df){if(_0x36a3df){_0x31bca8=_['keyBy'](_0x36a3df,'id');var _0x2b1497;var _0x48a338=squel[_0x0536('0x8b')]();_0x48a338[_0x0536('0x6d')](_0x3a998b[_0x0536('0x6e')]);for(var _0x290db7=0x0;_0x290db7<_0x5085fe['length'];_0x290db7+=0x1){_0x2b1497=_0x5085fe[_0x290db7]['MetricId']?_0x31bca8[_0x5085fe[_0x290db7][_0x0536('0x6f')]][_0x0536('0x70')]:_0x5085fe[_0x290db7][_0x0536('0x65')];_0x2b1497=_0x5085fe[_0x290db7][_0x0536('0x71')]?_[_0x0536('0x72')](_0x2cd217[_0x5085fe[_0x290db7]['function']],'%s',_0x2b1497):_0x2b1497;_0x2b1497=_0x5085fe[_0x290db7][_0x0536('0x73')]?_[_0x0536('0x72')](_0x3a0661[_0x5085fe[_0x290db7][_0x0536('0x73')]],'%s',_0x2b1497):_0x2b1497;if(_0x5085fe[_0x290db7]['groupBy']){_0x48a338[_0x0536('0x64')](_0x2b1497);}_0x5085fe[_0x290db7][_0x0536('0x75')]&&_0x48a338[_0x0536('0x39')](_0x2b1497,_0x5085fe[_0x290db7][_0x0536('0x75')]==='DESC'?![]:!![]);_0x48a338[_0x0536('0x65')](_0x2b1497,_0x5085fe[_0x290db7][_0x0536('0xa1')]||_0x2b1497);}if(_0x3a998b[_0x0536('0x77')]){_0x3a998b['joins']=JSON[_0x0536('0x7e')](_0x3a998b[_0x0536('0x77')]);for(var _0x48d95d=0x0;_0x48d95d<_0x3a998b['joins'][_0x0536('0x36')];_0x48d95d+=0x1){if(_0x3a998b[_0x0536('0x77')][_0x48d95d][_0x0536('0x2e')]&&_[_0x0536('0x78')](_0x4fe845,_0x3a998b[_0x0536('0x77')][_0x48d95d][_0x0536('0x2e')])&&_0x3a998b[_0x0536('0x77')][_0x48d95d][_0x0536('0x79')]&&_0x3a998b[_0x0536('0x77')][_0x48d95d][_0x0536('0x7a')]&&_0x3a998b[_0x0536('0x77')][_0x48d95d][_0x0536('0x7c')]){_0x48a338[_0x3a998b['joins'][_0x48d95d][_0x0536('0x2e')]](_0x3a998b['joins'][_0x48d95d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a998b[_0x0536('0x6e')],_0x3a998b[_0x0536('0x77')][_0x48d95d][_0x0536('0x79')],_0x3a998b[_0x0536('0x77')][_0x48d95d]['foreignTable'],_0x3a998b['joins'][_0x48d95d][_0x0536('0x7c')]));}}}if(_0x3a998b[_0x0536('0x7d')]){_0x3a998b[_0x0536('0x7d')]=JSON[_0x0536('0x7e')](_0x3a998b[_0x0536('0x7d')]);_0x48a338['where'](_0x16bc27(_0x3a998b[_0x0536('0x7d')][_0x0536('0x64')]));}_0x9e0a8f=_0x48a338[_0x0536('0x7f')]();_0x48a338['limit'](_0x4d7093);_0x48a338['offset'](0x0);logger[_0x0536('0x80')](_0x0536('0x81'),_0x48a338['toString']());return dbH[_0x0536('0x83')][_0x0536('0x30')](_0x48a338['toString'](),{'type':dbH[_0x0536('0x83')][_0x0536('0x84')][_0x0536('0x85')]});}})[_0x0536('0x23')](function(){return{'sql':_0x9e0a8f[_0x0536('0x82')]()};})[_0x0536('0x23')](respondWithResult(_0x51f52d,null))[_0x0536('0x42')](handleError(_0x51f52d,null));};
\ No newline at end of file
+var _0xebd5=['update','body','preview','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','left_join','operator','getFields','AnalyticMetric','alias','web','fullPath','randomstring','generate','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','SELECT','run','value','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','sendStatus','error','name','send','index','map','AnalyticCustomReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x320ee9,_0x338339){var _0x1fbd8a=function(_0x2c1612){while(--_0x2c1612){_0x320ee9['push'](_0x320ee9['shift']());}};_0x1fbd8a(++_0x338339);}(_0xebd5,0xf4));var _0x5ebd=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xebd5[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x5ebd('0x0'));var rimraf=require(_0x5ebd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ebd('0x2'));var rp=require(_0x5ebd('0x3'));var moment=require(_0x5ebd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ebd('0x5'));var util=require(_0x5ebd('0x6'));var path=require(_0x5ebd('0x7'));var sox=require(_0x5ebd('0x8'));var csv=require(_0x5ebd('0x9'));var ejs=require(_0x5ebd('0xa'));var fs=require('fs');var fs_extra=require(_0x5ebd('0xb'));var _=require(_0x5ebd('0xc'));var squel=require(_0x5ebd('0xd'));var crypto=require(_0x5ebd('0xe'));var jsforce=require(_0x5ebd('0xf'));var deskjs=require(_0x5ebd('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5ebd('0x11'));var Papa=require(_0x5ebd('0x12'));var Redis=require(_0x5ebd('0x13'));var authService=require(_0x5ebd('0x14'));var qs=require(_0x5ebd('0x15'));var as=require(_0x5ebd('0x16'));var hardwareService=require(_0x5ebd('0x17'));var logger=require(_0x5ebd('0x18'))(_0x5ebd('0x19'));var utils=require(_0x5ebd('0x1a'));var config=require(_0x5ebd('0x1b'));var licenseUtil=require(_0x5ebd('0x1c'));var db=require(_0x5ebd('0x1d'))['db'];var dbH=require(_0x5ebd('0x1d'))[_0x5ebd('0x1e')];function respondWithStatusCode(_0x459d86,_0x532bb8){_0x532bb8=_0x532bb8||0xcc;return function(_0x21a2e1){if(_0x21a2e1){return _0x459d86['sendStatus'](_0x532bb8);}return _0x459d86['status'](_0x532bb8)[_0x5ebd('0x1f')]();};}function respondWithResult(_0x292ee3,_0x2e908e){_0x2e908e=_0x2e908e||0xc8;return function(_0x1bca06){if(_0x1bca06){return _0x292ee3[_0x5ebd('0x20')](_0x2e908e)[_0x5ebd('0x21')](_0x1bca06);}};}function respondWithFilteredResult(_0x2d989c,_0x17ab58){return function(_0x8a5773){if(_0x8a5773){var _0xfb46c2=typeof _0x17ab58[_0x5ebd('0x22')]===_0x5ebd('0x23')&&typeof _0x17ab58[_0x5ebd('0x24')]==='undefined';var _0x309d57=_0x8a5773[_0x5ebd('0x25')];var _0x1a7cf8=_0xfb46c2?0x0:_0x17ab58['offset'];var _0x3e4fc0=_0xfb46c2?_0x8a5773['count']:_0x17ab58[_0x5ebd('0x22')]+_0x17ab58[_0x5ebd('0x24')];var _0x43e1a6;if(_0x3e4fc0>=_0x309d57){_0x3e4fc0=_0x309d57;_0x43e1a6=0xc8;}else{_0x43e1a6=0xce;}_0x2d989c[_0x5ebd('0x20')](_0x43e1a6);return _0x2d989c[_0x5ebd('0x26')](_0x5ebd('0x27'),_0x1a7cf8+'-'+_0x3e4fc0+'/'+_0x309d57)[_0x5ebd('0x21')](_0x8a5773);}return null;};}function patchUpdates(_0x49213d){return function(_0x2fce12){try{jsonpatch[_0x5ebd('0x28')](_0x2fce12,_0x49213d,!![]);}catch(_0x566e72){return BPromise[_0x5ebd('0x29')](_0x566e72);}return _0x2fce12[_0x5ebd('0x2a')]();};}function saveUpdates(_0x28bd90,_0xcb0041){return function(_0x58a191){if(_0x58a191){return _0x58a191['update'](_0x28bd90)[_0x5ebd('0x2b')](function(_0x166542){return _0x166542;});}return null;};}function removeEntity(_0xefc578,_0x58069d){return function(_0x343001){if(_0x343001){return _0x343001[_0x5ebd('0x2c')]()[_0x5ebd('0x2b')](function(){var _0x1334c5=_0x343001[_0x5ebd('0x2d')]({'plain':!![]});var _0x5d36a1=_0x5ebd('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x5d36a1,'resourceId':_0x1334c5['id']}})[_0x5ebd('0x2b')](function(){return _0x343001;});})[_0x5ebd('0x2b')](function(){_0xefc578[_0x5ebd('0x20')](0xcc)[_0x5ebd('0x1f')]();});}};}function handleEntityNotFound(_0x32080e,_0x1d3ca5){return function(_0x392e16){if(!_0x392e16){_0x32080e[_0x5ebd('0x2f')](0x194);}return _0x392e16;};}function handleError(_0x526052,_0x1f617c){_0x1f617c=_0x1f617c||0x1f4;return function(_0x39b161){logger[_0x5ebd('0x30')](_0x39b161['stack']);if(_0x39b161[_0x5ebd('0x31')]){delete _0x39b161['name'];}_0x526052[_0x5ebd('0x20')](_0x1f617c)[_0x5ebd('0x32')](_0x39b161);};}exports[_0x5ebd('0x33')]=function(_0x5e3a47,_0x1238a3){var _0x1df9ae={},_0x2206bc={},_0x39fe86={'count':0x0,'rows':[]};var _0x4946f8=_[_0x5ebd('0x34')](db[_0x5ebd('0x35')]['rawAttributes'],function(_0x57b665){return{'name':_0x57b665['fieldName'],'type':_0x57b665[_0x5ebd('0x36')][_0x5ebd('0x37')]};});_0x2206bc[_0x5ebd('0x38')]=_[_0x5ebd('0x34')](_0x4946f8,_0x5ebd('0x31'));_0x2206bc[_0x5ebd('0x39')]=_[_0x5ebd('0x3a')](_0x5e3a47[_0x5ebd('0x39')]);_0x2206bc[_0x5ebd('0x3b')]=_[_0x5ebd('0x3c')](_0x2206bc['model'],_0x2206bc[_0x5ebd('0x39')]);_0x1df9ae[_0x5ebd('0x3d')]=_[_0x5ebd('0x3c')](_0x2206bc['model'],qs[_0x5ebd('0x3e')](_0x5e3a47[_0x5ebd('0x39')]['fields']));_0x1df9ae[_0x5ebd('0x3d')]=_0x1df9ae['attributes'][_0x5ebd('0x3f')]?_0x1df9ae['attributes']:_0x2206bc[_0x5ebd('0x38')];if(!_0x5e3a47['query']['hasOwnProperty']('nolimit')){_0x1df9ae[_0x5ebd('0x24')]=qs[_0x5ebd('0x24')](_0x5e3a47['query'][_0x5ebd('0x24')]);_0x1df9ae['offset']=qs['offset'](_0x5e3a47[_0x5ebd('0x39')][_0x5ebd('0x22')]);}_0x1df9ae[_0x5ebd('0x40')]=qs[_0x5ebd('0x41')](_0x5e3a47[_0x5ebd('0x39')][_0x5ebd('0x41')]);_0x1df9ae[_0x5ebd('0x42')]=qs[_0x5ebd('0x3b')](_[_0x5ebd('0x43')](_0x5e3a47[_0x5ebd('0x39')],_0x2206bc[_0x5ebd('0x3b')]),_0x4946f8);if(_0x5e3a47[_0x5ebd('0x39')][_0x5ebd('0x44')]){_0x1df9ae[_0x5ebd('0x42')]=_[_0x5ebd('0x45')](_0x1df9ae[_0x5ebd('0x42')],{'$or':_['map'](_0x4946f8,function(_0x189c8a){if(_0x189c8a[_0x5ebd('0x36')]!==_0x5ebd('0x46')){var _0x4b0728={};_0x4b0728[_0x189c8a[_0x5ebd('0x31')]]={'$like':'%'+_0x5e3a47[_0x5ebd('0x39')]['filter']+'%'};return _0x4b0728;}})});}_0x1df9ae=_['merge']({},_0x1df9ae,_0x5e3a47[_0x5ebd('0x47')]);var _0x5e30ac={'where':_0x1df9ae[_0x5ebd('0x42')]};return db[_0x5ebd('0x35')][_0x5ebd('0x25')](_0x5e30ac)[_0x5ebd('0x2b')](function(_0x40a9c2){_0x39fe86['count']=_0x40a9c2;if(_0x5e3a47[_0x5ebd('0x39')]['includeAll']){_0x1df9ae['include']=[{'all':!![]}];}return db[_0x5ebd('0x35')][_0x5ebd('0x48')](_0x1df9ae);})['then'](function(_0x58b9ed){_0x39fe86['rows']=_0x58b9ed;return _0x39fe86;})[_0x5ebd('0x2b')](respondWithFilteredResult(_0x1238a3,_0x1df9ae))[_0x5ebd('0x49')](handleError(_0x1238a3,null));};exports[_0x5ebd('0x4a')]=function(_0x1f16d1,_0x57d551){var _0x3e3af5={'raw':![],'where':{'id':_0x1f16d1[_0x5ebd('0x4b')]['id']}},_0x3005d5={};_0x3005d5[_0x5ebd('0x38')]=_[_0x5ebd('0x3a')](db['AnalyticCustomReport'][_0x5ebd('0x4c')]);_0x3005d5[_0x5ebd('0x39')]=_['keys'](_0x1f16d1['query']);_0x3005d5['filters']=_[_0x5ebd('0x3c')](_0x3005d5[_0x5ebd('0x38')],_0x3005d5[_0x5ebd('0x39')]);_0x3e3af5[_0x5ebd('0x3d')]=_[_0x5ebd('0x3c')](_0x3005d5[_0x5ebd('0x38')],qs[_0x5ebd('0x3e')](_0x1f16d1[_0x5ebd('0x39')][_0x5ebd('0x3e')]));_0x3e3af5['attributes']=_0x3e3af5['attributes'][_0x5ebd('0x3f')]?_0x3e3af5[_0x5ebd('0x3d')]:_0x3005d5['model'];if(_0x1f16d1['query']['includeAll']){_0x3e3af5[_0x5ebd('0x4d')]=[{'all':!![]}];}_0x3e3af5=_[_0x5ebd('0x45')]({},_0x3e3af5,_0x1f16d1[_0x5ebd('0x47')]);return db[_0x5ebd('0x35')][_0x5ebd('0x4e')](_0x3e3af5)[_0x5ebd('0x2b')](handleEntityNotFound(_0x57d551,null))['then'](respondWithResult(_0x57d551,null))[_0x5ebd('0x49')](handleError(_0x57d551,null));};exports[_0x5ebd('0x4f')]=function(_0x441dde,_0x2fc307){return db['AnalyticCustomReport'][_0x5ebd('0x4f')](_0x441dde['body'],{})[_0x5ebd('0x2b')](function(_0x4a3a5a){var _0x1ca8bf=_0x441dde[_0x5ebd('0x50')][_0x5ebd('0x2d')]({'plain':!![]});if(!_0x1ca8bf)throw new Error(_0x5ebd('0x51'));if(_0x1ca8bf[_0x5ebd('0x52')]===_0x5ebd('0x50')){var _0x4c3f2a=_0x4a3a5a[_0x5ebd('0x2d')]({'plain':!![]});var _0x59f62a=_0x5ebd('0x53');return db[_0x5ebd('0x54')][_0x5ebd('0x4e')]({'where':{'name':_0x59f62a,'userProfileId':_0x1ca8bf['userProfileId']},'raw':!![]})[_0x5ebd('0x2b')](function(_0x216621){if(_0x216621&&_0x216621[_0x5ebd('0x55')]===0x0){return db[_0x5ebd('0x56')][_0x5ebd('0x4f')]({'name':_0x4c3f2a[_0x5ebd('0x31')],'resourceId':_0x4c3f2a['id'],'type':_0x5ebd('0x2e'),'sectionId':_0x216621['id']},{})[_0x5ebd('0x2b')](function(){return _0x4a3a5a;});}else{return _0x4a3a5a;}})[_0x5ebd('0x49')](function(_0x1216c8){logger[_0x5ebd('0x30')](_0x5ebd('0x57'),_0x1216c8);throw _0x1216c8;});}return _0x4a3a5a;})['then'](respondWithResult(_0x2fc307,0xc9))['catch'](handleError(_0x2fc307,null));};exports[_0x5ebd('0x58')]=function(_0x559cf0,_0x40a4ca){if(_0x559cf0['body']['id']){delete _0x559cf0[_0x5ebd('0x59')]['id'];}return db[_0x5ebd('0x35')][_0x5ebd('0x4e')]({'where':{'id':_0x559cf0['params']['id']}})[_0x5ebd('0x2b')](handleEntityNotFound(_0x40a4ca,null))[_0x5ebd('0x2b')](saveUpdates(_0x559cf0[_0x5ebd('0x59')],null))[_0x5ebd('0x2b')](respondWithResult(_0x40a4ca,null))['catch'](handleError(_0x40a4ca,null));};exports[_0x5ebd('0x2c')]=function(_0x18e0cf,_0x1ba85f){return db['AnalyticCustomReport'][_0x5ebd('0x4e')]({'where':{'id':_0x18e0cf[_0x5ebd('0x4b')]['id']}})[_0x5ebd('0x2b')](handleEntityNotFound(_0x1ba85f,null))[_0x5ebd('0x2b')](removeEntity(_0x1ba85f,null))[_0x5ebd('0x49')](handleError(_0x1ba85f,null));};exports[_0x5ebd('0x5a')]=function(_0x4c0544,_0x49f5e3){var _0x303517=0xa;var _0x54f86c=['join','left_join',_0x5ebd('0x5b'),_0x5ebd('0x5c')];var _0x930e5d={'SUM':'SUM(%s)','COUNT':_0x5ebd('0x5d'),'COUNT DISTINCT':_0x5ebd('0x5e'),'MAX':_0x5ebd('0x5f'),'MIN':_0x5ebd('0x60'),'AVG':_0x5ebd('0x61'),'GROUP_CONCAT':_0x5ebd('0x62'),'GROUP_CONCAT ASC':_0x5ebd('0x63'),'GROUP_CONCAT DESC':_0x5ebd('0x64')};var _0x57ece2={'SEC_TO_TIME':_0x5ebd('0x65'),'DATE':_0x5ebd('0x66'),'HOUR':_0x5ebd('0x67'),'ROUND':_0x5ebd('0x68'),'UNIX_TIMESTAMP':_0x5ebd('0x69')};var _0x1ebe30=function(_0x49fef7){return!_[_0x5ebd('0x6a')]([_0x5ebd('0x6b'),_0x5ebd('0x6c'),_0x5ebd('0x6d'),_0x5ebd('0x6e')],_0x49fef7);};var _0x54c66a=function(_0x304a05){if(!_0x304a05||!_0x304a05[_0x5ebd('0x6f')][_0x5ebd('0x3f')]){return'';}for(var _0x239b79='(',_0x214143=0x0;_0x214143<_0x304a05[_0x5ebd('0x6f')]['length'];_0x214143+=0x1){_0x214143>0x0&&(_0x239b79+='\x20'+_0x304a05['operator']+'\x20');_0x239b79+=_0x304a05[_0x5ebd('0x6f')][_0x214143][_0x5ebd('0x70')]?_0x54c66a(_0x304a05[_0x5ebd('0x6f')][_0x214143][_0x5ebd('0x70')]):_0x304a05[_0x5ebd('0x6f')][_0x214143][_0x5ebd('0x71')]+'\x20'+_0x304a05[_0x5ebd('0x6f')][_0x214143][_0x5ebd('0x72')]+(_0x1ebe30(_0x304a05[_0x5ebd('0x6f')][_0x214143][_0x5ebd('0x72')])?'\x20'+_0x304a05[_0x5ebd('0x6f')][_0x214143]['value']:'');}return _0x239b79+')';};var _0x20aaac={'where':{'id':_0x4c0544[_0x5ebd('0x4b')]['id']}},_0x1d795e,_0x2e2d4d,_0x51027d,_0x8194a,_0x283782;_0x20aaac=_[_0x5ebd('0x45')]({},_0x20aaac,_0x4c0544[_0x5ebd('0x47')]);return db[_0x5ebd('0x35')]['find'](_0x20aaac)[_0x5ebd('0x2b')](function(_0x1959db){if(_0x1959db){_0x1d795e=_0x1959db;return _0x1959db['getFields']();}return null;})['then'](function(_0xe24974){if(_0xe24974){if(!_0xe24974[_0x5ebd('0x3f')]){throw new db[(_0x5ebd('0x73'))][(_0x5ebd('0x74'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2e2d4d=_0xe24974;return db['AnalyticMetric'][_0x5ebd('0x48')]({'raw':!![]});}return null;})[_0x5ebd('0x2b')](function(_0x1c2139){if(_0x1c2139){_0x51027d=_[_0x5ebd('0x75')](_0x1c2139,'id');var _0x54fb15;var _0x5accbb=squel[_0x5ebd('0x76')]();_0x5accbb[_0x5ebd('0x77')](_0x1d795e[_0x5ebd('0x78')]);for(var _0x786039=0x0;_0x786039<_0x2e2d4d[_0x5ebd('0x3f')];_0x786039+=0x1){_0x54fb15=_0x2e2d4d[_0x786039][_0x5ebd('0x79')]?_0x51027d[_0x2e2d4d[_0x786039][_0x5ebd('0x79')]][_0x5ebd('0x7a')]:_0x2e2d4d[_0x786039][_0x5ebd('0x71')];_0x54fb15=_0x2e2d4d[_0x786039][_0x5ebd('0x7b')]?_['replace'](_0x930e5d[_0x2e2d4d[_0x786039][_0x5ebd('0x7b')]],'%s',_0x54fb15):_0x54fb15;_0x54fb15=_0x2e2d4d[_0x786039][_0x5ebd('0x7c')]?_[_0x5ebd('0x7d')](_0x57ece2[_0x2e2d4d[_0x786039]['format']],'%s',_0x54fb15):_0x54fb15;if(_0x2e2d4d[_0x786039][_0x5ebd('0x7e')]){_0x5accbb[_0x5ebd('0x70')](_0x54fb15);}_0x2e2d4d[_0x786039][_0x5ebd('0x7f')]&&_0x5accbb['order'](_0x54fb15,_0x2e2d4d[_0x786039]['orderBy']===_0x5ebd('0x80')?![]:!![]);_0x5accbb[_0x5ebd('0x71')](_0x54fb15,_0x2e2d4d[_0x786039]['alias']||_0x54fb15);}if(_0x1d795e['joins']){_0x1d795e['joins']=JSON[_0x5ebd('0x81')](_0x1d795e[_0x5ebd('0x82')]);for(var _0x54c301=0x0;_0x54c301<_0x1d795e[_0x5ebd('0x82')][_0x5ebd('0x3f')];_0x54c301+=0x1){if(_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x36')]&&_[_0x5ebd('0x6a')](_0x54f86c,_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x36')])&&_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x83')]&&_0x1d795e['joins'][_0x54c301]['foreignTable']&&_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x84')]){_0x5accbb[_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x36')]](_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x85')],null,util[_0x5ebd('0x7c')](_0x5ebd('0x86'),_0x1d795e[_0x5ebd('0x78')],_0x1d795e['joins'][_0x54c301][_0x5ebd('0x83')],_0x1d795e[_0x5ebd('0x82')][_0x54c301][_0x5ebd('0x85')],_0x1d795e['joins'][_0x54c301][_0x5ebd('0x84')]));}}}if(_0x1d795e[_0x5ebd('0x87')]){_0x1d795e['conditions']=JSON[_0x5ebd('0x81')](_0x1d795e[_0x5ebd('0x87')]);_0x5accbb[_0x5ebd('0x42')](_0x54c66a(_0x1d795e[_0x5ebd('0x87')][_0x5ebd('0x70')]));}_0x283782=_0x5accbb[_0x5ebd('0x88')]();_0x5accbb[_0x5ebd('0x24')](_0x303517);_0x5accbb[_0x5ebd('0x22')](0x0);logger[_0x5ebd('0x89')](_0x5ebd('0x8a'),_0x5accbb[_0x5ebd('0x8b')]());return dbH[_0x5ebd('0x8c')]['query'](_0x5accbb[_0x5ebd('0x8b')](),{'type':dbH[_0x5ebd('0x8c')][_0x5ebd('0x8d')]['SELECT']});}})['then'](respondWithResult(_0x49f5e3,null))['catch'](handleError(_0x49f5e3,null));};function runReport(_0x5b3a21,_0x15d1c5,_0x27bd2b){var _0x4ed5d0=_0x15d1c5[_0x5ebd('0x31')];var _0x7d8aad=0xa;var _0x284eb8=[_0x5ebd('0x8e'),_0x5ebd('0x8f'),_0x5ebd('0x5b'),_0x5ebd('0x5c')];var _0x1d7210={'SUM':'SUM(%s)','COUNT':_0x5ebd('0x5d'),'COUNT DISTINCT':_0x5ebd('0x5e'),'MAX':_0x5ebd('0x5f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5ebd('0x62'),'GROUP_CONCAT ASC':_0x5ebd('0x63'),'GROUP_CONCAT DESC':_0x5ebd('0x64')};var _0x4b23e7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5ebd('0x66'),'HOUR':_0x5ebd('0x67'),'ROUND':_0x5ebd('0x68'),'UNIX_TIMESTAMP':_0x5ebd('0x69')};var _0x550bf7=function(_0xc97852){return!_[_0x5ebd('0x6a')](['IS\x20NULL',_0x5ebd('0x6c'),_0x5ebd('0x6d'),_0x5ebd('0x6e')],_0xc97852);};var _0x54c5a7=function(_0x1714dc){if(!_0x1714dc||!_0x1714dc[_0x5ebd('0x6f')]['length']){return'';}for(var _0x2326c9='(',_0x4afb2f=0x0;_0x4afb2f<_0x1714dc['rules'][_0x5ebd('0x3f')];_0x4afb2f+=0x1){_0x4afb2f>0x0&&(_0x2326c9+='\x20'+_0x1714dc[_0x5ebd('0x90')]+'\x20');_0x2326c9+=_0x1714dc[_0x5ebd('0x6f')][_0x4afb2f][_0x5ebd('0x70')]?_0x54c5a7(_0x1714dc['rules'][_0x4afb2f]['group']):_0x1714dc['rules'][_0x4afb2f][_0x5ebd('0x71')]+'\x20'+_0x1714dc[_0x5ebd('0x6f')][_0x4afb2f]['condition']+(_0x550bf7(_0x1714dc[_0x5ebd('0x6f')][_0x4afb2f][_0x5ebd('0x72')])?'\x20'+_0x1714dc['rules'][_0x4afb2f]['value']:'');}return _0x2326c9+')';};var _0x10adc3={'where':{'id':_0x5b3a21['id']}},_0x1c386c,_0x209503,_0x2735b4,_0x1bf540,_0x4f57b4;_0x10adc3=_[_0x5ebd('0x45')]({},_0x10adc3,_0x27bd2b);return db[_0x5ebd('0x35')][_0x5ebd('0x4e')](_0x10adc3)['then'](function(_0x115483){if(_0x115483){_0x1c386c=_0x115483;return _0x115483[_0x5ebd('0x91')]();}return null;})[_0x5ebd('0x2b')](function(_0x1dcffd){if(_0x1dcffd){if(!_0x1dcffd[_0x5ebd('0x3f')]){throw new db[(_0x5ebd('0x73'))][(_0x5ebd('0x74'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x209503=_0x1dcffd;return db[_0x5ebd('0x92')][_0x5ebd('0x48')]({'raw':!![]});}return null;})['then'](function(_0x188b40){if(_0x188b40){_0x2735b4=_[_0x5ebd('0x75')](_0x188b40,'id');var _0x2984d5;var _0x59cdb5=squel[_0x5ebd('0x76')]();_0x59cdb5[_0x5ebd('0x77')](_0x1c386c[_0x5ebd('0x78')]);for(var _0x2a8f71=0x0;_0x2a8f71<_0x209503[_0x5ebd('0x3f')];_0x2a8f71+=0x1){_0x2984d5=_0x209503[_0x2a8f71][_0x5ebd('0x79')]?_0x2735b4[_0x209503[_0x2a8f71]['MetricId']]['metric']:_0x209503[_0x2a8f71][_0x5ebd('0x71')];_0x2984d5=_0x209503[_0x2a8f71][_0x5ebd('0x7b')]?_['replace'](_0x1d7210[_0x209503[_0x2a8f71][_0x5ebd('0x7b')]],'%s',_0x2984d5):_0x2984d5;_0x2984d5=_0x209503[_0x2a8f71][_0x5ebd('0x7c')]?_['replace'](_0x4b23e7[_0x209503[_0x2a8f71][_0x5ebd('0x7c')]],'%s',_0x2984d5):_0x2984d5;if(_0x209503[_0x2a8f71]['groupBy']){_0x59cdb5['group'](_0x2984d5);}_0x209503[_0x2a8f71][_0x5ebd('0x7f')]&&_0x59cdb5[_0x5ebd('0x40')](_0x2984d5,_0x209503[_0x2a8f71][_0x5ebd('0x7f')]===_0x5ebd('0x80')?![]:!![]);_0x59cdb5[_0x5ebd('0x71')](_0x2984d5,_0x209503[_0x2a8f71][_0x5ebd('0x93')]||_0x2984d5);}if(_0x1c386c['joins']){_0x1c386c[_0x5ebd('0x82')]=JSON[_0x5ebd('0x81')](_0x1c386c[_0x5ebd('0x82')]);for(var _0x3b42be=0x0;_0x3b42be<_0x1c386c['joins'][_0x5ebd('0x3f')];_0x3b42be+=0x1){if(_0x1c386c[_0x5ebd('0x82')][_0x3b42be][_0x5ebd('0x36')]&&_[_0x5ebd('0x6a')](_0x284eb8,_0x1c386c[_0x5ebd('0x82')][_0x3b42be][_0x5ebd('0x36')])&&_0x1c386c['joins'][_0x3b42be][_0x5ebd('0x83')]&&_0x1c386c[_0x5ebd('0x82')][_0x3b42be][_0x5ebd('0x85')]&&_0x1c386c[_0x5ebd('0x82')][_0x3b42be][_0x5ebd('0x84')]){_0x59cdb5[_0x1c386c[_0x5ebd('0x82')][_0x3b42be][_0x5ebd('0x36')]](_0x1c386c[_0x5ebd('0x82')][_0x3b42be][_0x5ebd('0x85')],null,util['format'](_0x5ebd('0x86'),_0x1c386c[_0x5ebd('0x78')],_0x1c386c['joins'][_0x3b42be][_0x5ebd('0x83')],_0x1c386c[_0x5ebd('0x82')][_0x3b42be]['foreignTable'],_0x1c386c[_0x5ebd('0x82')][_0x3b42be]['foreignKey']));}}}if(_0x1c386c[_0x5ebd('0x87')]){_0x1c386c['conditions']=JSON[_0x5ebd('0x81')](_0x1c386c[_0x5ebd('0x87')]);_0x59cdb5['where'](_0x54c5a7(_0x1c386c[_0x5ebd('0x87')][_0x5ebd('0x70')]));}_0x4f57b4=_0x59cdb5['clone']();_0x59cdb5['limit'](_0x7d8aad);_0x59cdb5['offset'](0x0);return;}})['then'](function(){if(_0x15d1c5['output']===_0x5ebd('0x94')){return null;}var _0x326e08=_[_0x5ebd('0x45')](_0x15d1c5,{'name':_0x15d1c5[_0x5ebd('0x95')]||_0x15d1c5[_0x5ebd('0x31')]||_0x1c386c[_0x5ebd('0x31')],'basename':_0x4ed5d0,'savename':util[_0x5ebd('0x7c')]('%s-%s.%s',_0x15d1c5[_0x5ebd('0x31')]||_0x1c386c[_0x5ebd('0x31')],require(_0x5ebd('0x96'))[_0x5ebd('0x97')](0x4),_0x15d1c5['output']||'csv'),'reportId':_0x1c386c['id'],'reportType':'custom'});return db[_0x5ebd('0x98')][_0x5ebd('0x4f')](_0x326e08,{'raw':!![]});})[_0x5ebd('0x2b')](function(_0x22fbe){if(_0x1c386c[_0x5ebd('0x78')]==='cdr'){_0x4f57b4['where'](_0x1c386c[_0x5ebd('0x78')]+_0x5ebd('0x99'),_0x15d1c5[_0x5ebd('0x9a')],_0x15d1c5[_0x5ebd('0x9b')]);}else{_0x4f57b4[_0x5ebd('0x42')](_0x1c386c[_0x5ebd('0x78')]+_0x5ebd('0x9c'),_0x15d1c5[_0x5ebd('0x9a')],_0x15d1c5['endDate']);}if(_0x22fbe){logger[_0x5ebd('0x9d')]('Run\x20Query:',_0x4f57b4[_0x5ebd('0x8b')]());require(_0x5ebd('0x9e'))[_0x5ebd('0x9f')](path[_0x5ebd('0x8e')](__dirname,_0x5ebd('0xa0'),_0x22fbe['output']),[_0x22fbe['id'],_0x4f57b4['toString'](),path['join'](__dirname,_0x5ebd('0xa1'),_0x22fbe['savename']),_0x4ed5d0]);return _0x22fbe;}else{var _0x1513ee=squel[_0x5ebd('0x76')]();_0x1513ee[_0x5ebd('0x77')]('('+_0x4f57b4['toString']()+')','countTable');_0x1513ee[_0x5ebd('0x71')]('COUNT(*)',_0x5ebd('0x25'));_0x4f57b4[_0x5ebd('0x24')](_0x15d1c5[_0x5ebd('0x24')]||_0x7d8aad);_0x4f57b4['offset'](_0x15d1c5['offset']||0x0);return dbH['sequelize'][_0x5ebd('0x39')](_0x1513ee[_0x5ebd('0x8b')](),{'type':dbH[_0x5ebd('0x8c')]['QueryTypes'][_0x5ebd('0xa2')]})[_0x5ebd('0x2b')](function(_0x345cd3){if(!_0x345cd3[_0x5ebd('0x3f')]){_0x1bf540=0x0;}else{_0x1bf540=_0x345cd3[0x0][_0x5ebd('0x25')]||0x0;}return dbH[_0x5ebd('0x8c')]['query'](_0x4f57b4['toString'](),{'type':dbH[_0x5ebd('0x8c')][_0x5ebd('0x8d')]['SELECT']});})[_0x5ebd('0x2b')](function(_0x4a6789){return{'rows':_0x4a6789||[],'count':_0x1bf540};});}});}exports[_0x5ebd('0xa3')]=function(_0x149a09,_0x4cba6d){return runReport(_0x149a09[_0x5ebd('0x4b')],_0x149a09[_0x5ebd('0x39')],_0x149a09['options'])['then'](respondWithResult(_0x4cba6d,null))[_0x5ebd('0x49')](handleError(_0x4cba6d,null));};exports['runReport']=runReport;exports[_0x5ebd('0x39')]=function(_0x48fae8,_0x367d0c){var _0x4f10c9=0xa;var _0x16ba04=[_0x5ebd('0x8e'),_0x5ebd('0x8f'),_0x5ebd('0x5b'),'cross_join'];var _0x167420={'SUM':'SUM(%s)','COUNT':_0x5ebd('0x5d'),'COUNT DISTINCT':_0x5ebd('0x5e'),'MAX':_0x5ebd('0x5f'),'MIN':_0x5ebd('0x60'),'AVG':_0x5ebd('0x61'),'GROUP_CONCAT':_0x5ebd('0x62'),'GROUP_CONCAT ASC':_0x5ebd('0x63'),'GROUP_CONCAT DESC':_0x5ebd('0x64')};var _0x54bcb2={'SEC_TO_TIME':_0x5ebd('0x65'),'DATE':'DATE(%s)','HOUR':_0x5ebd('0x67'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x288844=function(_0x364dc2){return!_[_0x5ebd('0x6a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5ebd('0x6d'),'IS\x20NOT\x20EMPTY'],_0x364dc2);};var _0x540114=function(_0x107541){if(!_0x107541||!_0x107541['rules'][_0x5ebd('0x3f')]){return'';}for(var _0x1342fa='(',_0x42e11d=0x0;_0x42e11d<_0x107541[_0x5ebd('0x6f')][_0x5ebd('0x3f')];_0x42e11d+=0x1){_0x42e11d>0x0&&(_0x1342fa+='\x20'+_0x107541['operator']+'\x20');_0x1342fa+=_0x107541[_0x5ebd('0x6f')][_0x42e11d][_0x5ebd('0x70')]?_0x540114(_0x107541['rules'][_0x42e11d][_0x5ebd('0x70')]):_0x107541[_0x5ebd('0x6f')][_0x42e11d][_0x5ebd('0x71')]+'\x20'+_0x107541[_0x5ebd('0x6f')][_0x42e11d]['condition']+(_0x288844(_0x107541[_0x5ebd('0x6f')][_0x42e11d][_0x5ebd('0x72')])?'\x20'+_0x107541[_0x5ebd('0x6f')][_0x42e11d][_0x5ebd('0xa4')]:'');}return _0x1342fa+')';};var _0x6f86c5={'where':{'id':_0x48fae8[_0x5ebd('0x4b')]['id']}},_0x5ebb51,_0x5aa78d,_0x47adb7,_0x50a5e7,_0x3a7b61;_0x6f86c5=_[_0x5ebd('0x45')]({},_0x6f86c5,_0x48fae8['options']);return db['AnalyticCustomReport']['find'](_0x6f86c5)[_0x5ebd('0x2b')](function(_0x206f4d){if(_0x206f4d){_0x5ebb51=_0x206f4d;return _0x206f4d['getFields']();}return null;})[_0x5ebd('0x2b')](function(_0x654d6){if(_0x654d6){if(!_0x654d6[_0x5ebd('0x3f')]){throw new db[(_0x5ebd('0x73'))][(_0x5ebd('0x74'))](_0x5ebd('0xa5'),0x193);}_0x5aa78d=_0x654d6;return db['AnalyticMetric'][_0x5ebd('0x48')]({'raw':!![]});}return null;})[_0x5ebd('0x2b')](function(_0x317b67){if(_0x317b67){_0x47adb7=_[_0x5ebd('0x75')](_0x317b67,'id');var _0x3ed5e4;var _0x1bf155=squel['select']();_0x1bf155[_0x5ebd('0x77')](_0x5ebb51[_0x5ebd('0x78')]);for(var _0x1e1bff=0x0;_0x1e1bff<_0x5aa78d[_0x5ebd('0x3f')];_0x1e1bff+=0x1){_0x3ed5e4=_0x5aa78d[_0x1e1bff]['MetricId']?_0x47adb7[_0x5aa78d[_0x1e1bff]['MetricId']][_0x5ebd('0x7a')]:_0x5aa78d[_0x1e1bff][_0x5ebd('0x71')];_0x3ed5e4=_0x5aa78d[_0x1e1bff][_0x5ebd('0x7b')]?_[_0x5ebd('0x7d')](_0x167420[_0x5aa78d[_0x1e1bff][_0x5ebd('0x7b')]],'%s',_0x3ed5e4):_0x3ed5e4;_0x3ed5e4=_0x5aa78d[_0x1e1bff][_0x5ebd('0x7c')]?_[_0x5ebd('0x7d')](_0x54bcb2[_0x5aa78d[_0x1e1bff][_0x5ebd('0x7c')]],'%s',_0x3ed5e4):_0x3ed5e4;if(_0x5aa78d[_0x1e1bff][_0x5ebd('0x7e')]){_0x1bf155['group'](_0x3ed5e4);}_0x5aa78d[_0x1e1bff][_0x5ebd('0x7f')]&&_0x1bf155[_0x5ebd('0x40')](_0x3ed5e4,_0x5aa78d[_0x1e1bff][_0x5ebd('0x7f')]===_0x5ebd('0x80')?![]:!![]);_0x1bf155[_0x5ebd('0x71')](_0x3ed5e4,_0x5aa78d[_0x1e1bff][_0x5ebd('0x93')]||_0x3ed5e4);}if(_0x5ebb51[_0x5ebd('0x82')]){_0x5ebb51['joins']=JSON['parse'](_0x5ebb51['joins']);for(var _0x5a76b5=0x0;_0x5a76b5<_0x5ebb51['joins']['length'];_0x5a76b5+=0x1){if(_0x5ebb51['joins'][_0x5a76b5][_0x5ebd('0x36')]&&_[_0x5ebd('0x6a')](_0x16ba04,_0x5ebb51['joins'][_0x5a76b5]['type'])&&_0x5ebb51[_0x5ebd('0x82')][_0x5a76b5][_0x5ebd('0x83')]&&_0x5ebb51['joins'][_0x5a76b5][_0x5ebd('0x85')]&&_0x5ebb51[_0x5ebd('0x82')][_0x5a76b5][_0x5ebd('0x84')]){_0x1bf155[_0x5ebb51['joins'][_0x5a76b5][_0x5ebd('0x36')]](_0x5ebb51['joins'][_0x5a76b5]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5ebb51[_0x5ebd('0x78')],_0x5ebb51['joins'][_0x5a76b5]['parentKey'],_0x5ebb51[_0x5ebd('0x82')][_0x5a76b5][_0x5ebd('0x85')],_0x5ebb51[_0x5ebd('0x82')][_0x5a76b5]['foreignKey']));}}}if(_0x5ebb51['conditions']){_0x5ebb51[_0x5ebd('0x87')]=JSON[_0x5ebd('0x81')](_0x5ebb51[_0x5ebd('0x87')]);_0x1bf155[_0x5ebd('0x42')](_0x540114(_0x5ebb51[_0x5ebd('0x87')][_0x5ebd('0x70')]));}_0x3a7b61=_0x1bf155[_0x5ebd('0x88')]();_0x1bf155['limit'](_0x4f10c9);_0x1bf155['offset'](0x0);logger[_0x5ebd('0x89')](_0x5ebd('0x8a'),_0x1bf155[_0x5ebd('0x8b')]());return dbH['sequelize'][_0x5ebd('0x39')](_0x1bf155['toString'](),{'type':dbH[_0x5ebd('0x8c')][_0x5ebd('0x8d')][_0x5ebd('0xa2')]});}})['then'](function(){return{'sql':_0x3a7b61[_0x5ebd('0x8b')]()};})[_0x5ebd('0x2b')](respondWithResult(_0x367d0c,null))[_0x5ebd('0x49')](handleError(_0x367d0c,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 963bf91..a589833 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a5c=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash','util','api','bluebird','request-promise'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x0a5c,0x1b3));var _0xc0a5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a5c[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xc0a5('0x0'));var util=require(_0xc0a5('0x1'));var logger=require('../../config/logger')(_0xc0a5('0x2'));var moment=require('moment');var BPromise=require(_0xc0a5('0x3'));var rp=require(_0xc0a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a5('0x5'));var config=require(_0xc0a5('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xc0a5('0x7')]=function(_0x3e5e68,_0x4fb17e){return _0x3e5e68[_0xc0a5('0x8')](_0xc0a5('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbaa=['../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x1d2cd0,_0x50754a){var _0x37f696=function(_0x495d19){while(--_0x495d19){_0x1d2cd0['push'](_0x1d2cd0['shift']());}};_0x37f696(++_0x50754a);}(_0xcbaa,0x16a));var _0xacba=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xcbaa[_0x34d275];return _0x1379cc;};'use strict';var _=require(_0xacba('0x0'));var util=require(_0xacba('0x1'));var logger=require(_0xacba('0x2'))(_0xacba('0x3'));var moment=require(_0xacba('0x4'));var BPromise=require('bluebird');var rp=require(_0xacba('0x5'));var fs=require('fs');var path=require(_0xacba('0x6'));var rimraf=require('rimraf');var config=require(_0xacba('0x7'));var attributes=require(_0xacba('0x8'));module[_0xacba('0x9')]=function(_0x453d93,_0x568740){return _0x453d93[_0xacba('0xa')](_0xacba('0xb'),attributes,{'tableName':_0xacba('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 81c687c..0496b5b 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d59=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird'];(function(_0x3ed75e,_0x5f465a){var _0x441dac=function(_0x4b2182){while(--_0x4b2182){_0x3ed75e['push'](_0x3ed75e['shift']());}};_0x441dac(++_0x5f465a);}(_0x9d59,0x1e1));var _0x99d5=function(_0x5e5a29,_0x5e5ffc){_0x5e5a29=_0x5e5a29-0x0;var _0x48c4fa=_0x9d59[_0x5e5a29];return _0x48c4fa;};'use strict';var _=require(_0x99d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x99d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99d5('0x2'));var db=require(_0x99d5('0x3'))['db'];var utils=require(_0x99d5('0x4'));var logger=require(_0x99d5('0x5'))(_0x99d5('0x6'));var config=require(_0x99d5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x99d5('0x8')][_0x99d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x560f99,_0x362a7c,_0x28fcc8){return new BPromise(function(_0x2bb5f7,_0x12f399){return client[_0x99d5('0xa')](_0x560f99,_0x28fcc8)[_0x99d5('0xb')](function(_0x1d317c){logger[_0x99d5('0xc')](_0x99d5('0xd'),_0x362a7c,_0x99d5('0xe'));logger[_0x99d5('0xf')](_0x99d5('0x10'),_0x362a7c,_0x99d5('0xe'),JSON[_0x99d5('0x11')](_0x1d317c));if(_0x1d317c[_0x99d5('0x12')]){if(_0x1d317c[_0x99d5('0x12')][_0x99d5('0x13')]===0x1f4){logger[_0x99d5('0x12')](_0x99d5('0xd'),_0x362a7c,_0x1d317c['error'][_0x99d5('0x14')]);return _0x12f399(_0x1d317c['error'][_0x99d5('0x14')]);}logger['error'](_0x99d5('0xd'),_0x362a7c,_0x1d317c[_0x99d5('0x12')][_0x99d5('0x14')]);return _0x2bb5f7(_0x1d317c[_0x99d5('0x12')][_0x99d5('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x362a7c,_0x99d5('0xe'));_0x2bb5f7(_0x1d317c['result']['message']);}})['catch'](function(_0x3de37b){logger[_0x99d5('0x12')](_0x99d5('0xd'),_0x362a7c,_0x3de37b);_0x12f399(_0x3de37b);});});}
\ No newline at end of file
+var _0x2e67=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2f1dc5,_0x5cd881){var _0x52cdcc=function(_0x4b7806){while(--_0x4b7806){_0x2f1dc5['push'](_0x2f1dc5['shift']());}};_0x52cdcc(++_0x5cd881);}(_0x2e67,0x106));var _0x72e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2e67[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x72e6('0x0'));var util=require(_0x72e6('0x1'));var moment=require('moment');var BPromise=require(_0x72e6('0x2'));var rs=require(_0x72e6('0x3'));var fs=require('fs');var Redis=require(_0x72e6('0x4'));var db=require(_0x72e6('0x5'))['db'];var utils=require(_0x72e6('0x6'));var logger=require(_0x72e6('0x7'))(_0x72e6('0x8'));var config=require(_0x72e6('0x9'));var jayson=require(_0x72e6('0xa'));var client=jayson[_0x72e6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18cf02,_0x3b1c54,_0x233996){return new BPromise(function(_0x3cf089,_0x4903ba){return client[_0x72e6('0xc')](_0x18cf02,_0x233996)[_0x72e6('0xd')](function(_0x3b37bb){logger[_0x72e6('0xe')](_0x72e6('0xf'),_0x3b1c54,'request\x20sent');logger[_0x72e6('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3b1c54,_0x72e6('0x11'),JSON[_0x72e6('0x12')](_0x3b37bb));if(_0x3b37bb[_0x72e6('0x13')]){if(_0x3b37bb[_0x72e6('0x13')][_0x72e6('0x14')]===0x1f4){logger[_0x72e6('0x13')](_0x72e6('0xf'),_0x3b1c54,_0x3b37bb[_0x72e6('0x13')][_0x72e6('0x15')]);return _0x4903ba(_0x3b37bb[_0x72e6('0x13')]['message']);}logger[_0x72e6('0x13')](_0x72e6('0xf'),_0x3b1c54,_0x3b37bb[_0x72e6('0x13')][_0x72e6('0x15')]);return _0x3cf089(_0x3b37bb[_0x72e6('0x13')][_0x72e6('0x15')]);}else{logger[_0x72e6('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3b1c54,'request\x20sent');_0x3cf089(_0x3b37bb[_0x72e6('0x16')]['message']);}})[_0x72e6('0x17')](function(_0x24a1e7){logger[_0x72e6('0x13')](_0x72e6('0xf'),_0x3b1c54,_0x24a1e7);_0x4903ba(_0x24a1e7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 69f83f3..169a089 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x89ee=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','query','create','update'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0x89ee,0x1a7));var _0xe89e=function(_0xa20cda,_0x25c9ae){_0xa20cda=_0xa20cda-0x0;var _0x37b33f=_0x89ee[_0xa20cda];return _0x37b33f;};'use strict';var multer=require(_0xe89e('0x0'));var util=require(_0xe89e('0x1'));var path=require(_0xe89e('0x2'));var timeout=require(_0xe89e('0x3'));var express=require('express');var router=express[_0xe89e('0x4')]();var fs_extra=require(_0xe89e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe89e('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xe89e('0x7')]('/',auth['isAuthenticated'](),controller[_0xe89e('0x8')]);router[_0xe89e('0x7')](_0xe89e('0x9'),auth[_0xe89e('0xa')](),controller[_0xe89e('0xb')]);router[_0xe89e('0x7')](_0xe89e('0xc'),auth[_0xe89e('0xa')](),controller['preview']);router[_0xe89e('0x7')](_0xe89e('0xd'),auth[_0xe89e('0xa')](),controller['run']);router['get'](_0xe89e('0xe'),auth['isAuthenticated'](),controller[_0xe89e('0xf')]);router['post']('/',auth[_0xe89e('0xa')](),controller[_0xe89e('0x10')]);router['put'](_0xe89e('0x9'),auth[_0xe89e('0xa')](),controller[_0xe89e('0x11')]);router[_0xe89e('0x12')](_0xe89e('0x9'),auth['isAuthenticated'](),controller[_0xe89e('0x13')]);module[_0xe89e('0x14')]=router;
\ No newline at end of file
+var _0xef2a=['preview','/:id/run','query','create','put','update','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview'];(function(_0x35d261,_0x48d9e0){var _0x3efc32=function(_0x117261){while(--_0x117261){_0x35d261['push'](_0x35d261['shift']());}};_0x3efc32(++_0x48d9e0);}(_0xef2a,0x118));var _0xaef2=function(_0x4a0990,_0x27f16e){_0x4a0990=_0x4a0990-0x0;var _0x309dd3=_0xef2a[_0x4a0990];return _0x309dd3;};'use strict';var multer=require('multer');var util=require(_0xaef2('0x0'));var path=require(_0xaef2('0x1'));var timeout=require('connect-timeout');var express=require(_0xaef2('0x2'));var router=express['Router']();var fs_extra=require(_0xaef2('0x3'));var auth=require(_0xaef2('0x4'));var interaction=require(_0xaef2('0x5'));var config=require(_0xaef2('0x6'));var controller=require(_0xaef2('0x7'));router[_0xaef2('0x8')]('/',auth['isAuthenticated'](),controller[_0xaef2('0x9')]);router[_0xaef2('0x8')](_0xaef2('0xa'),auth[_0xaef2('0xb')](),controller[_0xaef2('0xc')]);router[_0xaef2('0x8')](_0xaef2('0xd'),auth[_0xaef2('0xb')](),controller[_0xaef2('0xe')]);router[_0xaef2('0x8')](_0xaef2('0xf'),auth[_0xaef2('0xb')](),controller['run']);router[_0xaef2('0x8')]('/:id/query',auth[_0xaef2('0xb')](),controller[_0xaef2('0x10')]);router['post']('/',auth[_0xaef2('0xb')](),controller[_0xaef2('0x11')]);router[_0xaef2('0x12')]('/:id',auth[_0xaef2('0xb')](),controller[_0xaef2('0x13')]);router['delete']('/:id',auth[_0xaef2('0xb')](),controller[_0xaef2('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 86e9764..3ed4a9b 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5c7464,_0x426607){_0x5c7464=_0x5c7464-0x0;var _0x54752e=_0xdc97[_0x5c7464];return _0x54752e;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x4b85a1,_0x1d48f4){var _0x16a58f=function(_0x3f27eb){while(--_0x3f27eb){_0x4b85a1['push'](_0x4b85a1['shift']());}};_0x16a58f(++_0x1d48f4);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xbcd81d,_0xb2f44e){_0xbcd81d=_0xbcd81d-0x0;var _0x42f2bf=_0x3eea[_0xbcd81d];return _0x42f2bf;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index c01c92e..be4904b 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x326f,0xd1));var _0xf326=function(_0x193d18,_0x5d4070){_0x193d18=_0x193d18-0x0;var _0x5a2e4c=_0x326f[_0x193d18];return _0x5a2e4c;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x2f6b1f,_0x368020){var _0x5bcb88=function(_0x38b2cc){while(--_0x38b2cc){_0x2f6b1f['push'](_0x2f6b1f['shift']());}};_0x5bcb88(++_0x368020);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index b194d70..14f98dd 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x919d=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','../../config/logger','moment','path'];(function(_0x4ffee4,_0x1db54d){var _0x5e9fe4=function(_0x5d3216){while(--_0x5d3216){_0x4ffee4['push'](_0x4ffee4['shift']());}};_0x5e9fe4(++_0x1db54d);}(_0x919d,0x1d5));var _0xd919=function(_0x3d6a4c,_0x1ec6db){_0x3d6a4c=_0x3d6a4c-0x0;var _0x57243d=_0x919d[_0x3d6a4c];return _0x57243d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd919('0x0'))('api');var moment=require(_0xd919('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd919('0x2'));var rimraf=require(_0xd919('0x3'));var config=require(_0xd919('0x4'));var attributes=require(_0xd919('0x5'));module['exports']=function(_0x27b235,_0x41ce3f){return _0x27b235[_0xd919('0x6')]('AnalyticDefaultReport',attributes,{'tableName':_0xd919('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x28d8=['rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x45ca7e,_0x21ed81){var _0x136e56=function(_0x178a92){while(--_0x178a92){_0x45ca7e['push'](_0x45ca7e['shift']());}};_0x136e56(++_0x21ed81);}(_0x28d8,0xae));var _0x828d=function(_0x21fd99,_0x23cc5e){_0x21fd99=_0x21fd99-0x0;var _0xbdcea6=_0x28d8[_0x21fd99];return _0xbdcea6;};'use strict';var _=require(_0x828d('0x0'));var util=require(_0x828d('0x1'));var logger=require(_0x828d('0x2'))(_0x828d('0x3'));var moment=require(_0x828d('0x4'));var BPromise=require(_0x828d('0x5'));var rp=require(_0x828d('0x6'));var fs=require('fs');var path=require(_0x828d('0x7'));var rimraf=require(_0x828d('0x8'));var config=require(_0x828d('0x9'));var attributes=require('./analyticDefaultReport.attributes');module[_0x828d('0xa')]=function(_0x17f9e3,_0x15f587){return _0x17f9e3[_0x828d('0xb')](_0x828d('0xc'),attributes,{'tableName':_0x828d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 8a1e9f1..56569d3 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecbc=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xecbc,0x1e7));var _0xcecb=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xecbc[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xcecb('0x0'));var util=require(_0xcecb('0x1'));var moment=require(_0xcecb('0x2'));var BPromise=require(_0xcecb('0x3'));var rs=require(_0xcecb('0x4'));var fs=require('fs');var Redis=require(_0xcecb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcecb('0x6'));var logger=require('../../config/logger')(_0xcecb('0x7'));var config=require(_0xcecb('0x8'));var jayson=require(_0xcecb('0x9'));var client=jayson[_0xcecb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11e3ea,_0x549108,_0x5b2556){return new BPromise(function(_0x4cffca,_0x3fbc7f){return client[_0xcecb('0xb')](_0x11e3ea,_0x5b2556)[_0xcecb('0xc')](function(_0x33d698){logger[_0xcecb('0xd')](_0xcecb('0xe'),_0x549108,'request\x20sent');logger[_0xcecb('0xf')](_0xcecb('0x10'),_0x549108,_0xcecb('0x11'),JSON[_0xcecb('0x12')](_0x33d698));if(_0x33d698['error']){if(_0x33d698[_0xcecb('0x13')][_0xcecb('0x14')]===0x1f4){logger[_0xcecb('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x549108,_0x33d698[_0xcecb('0x13')][_0xcecb('0x15')]);return _0x3fbc7f(_0x33d698[_0xcecb('0x13')][_0xcecb('0x15')]);}logger[_0xcecb('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x549108,_0x33d698[_0xcecb('0x13')][_0xcecb('0x15')]);return _0x4cffca(_0x33d698[_0xcecb('0x13')]['message']);}else{logger[_0xcecb('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x549108,_0xcecb('0x11'));_0x4cffca(_0x33d698['result'][_0xcecb('0x15')]);}})['catch'](function(_0xc46015){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x549108,_0xc46015);_0x3fbc7f(_0xc46015);});});}
\ No newline at end of file
+var _0x3fcc=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x12be6d,_0x340a27){var _0x52981f=function(_0x39578f){while(--_0x39578f){_0x12be6d['push'](_0x12be6d['shift']());}};_0x52981f(++_0x340a27);}(_0x3fcc,0xd0));var _0xc3fc=function(_0xcd14f0,_0x560055){_0xcd14f0=_0xcd14f0-0x0;var _0x15e062=_0x3fcc[_0xcd14f0];return _0x15e062;};'use strict';var _=require(_0xc3fc('0x0'));var util=require(_0xc3fc('0x1'));var moment=require('moment');var BPromise=require(_0xc3fc('0x2'));var rs=require(_0xc3fc('0x3'));var fs=require('fs');var Redis=require(_0xc3fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3fc('0x5'));var logger=require(_0xc3fc('0x6'))(_0xc3fc('0x7'));var config=require('../../config/environment');var jayson=require(_0xc3fc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ba422,_0x174861,_0x2e8466){return new BPromise(function(_0x3fd3ac,_0x26b6f1){return client[_0xc3fc('0x9')](_0x5ba422,_0x2e8466)['then'](function(_0x568ed4){logger[_0xc3fc('0xa')](_0xc3fc('0xb'),_0x174861,_0xc3fc('0xc'));logger['debug'](_0xc3fc('0xd'),_0x174861,_0xc3fc('0xc'),JSON['stringify'](_0x568ed4));if(_0x568ed4['error']){if(_0x568ed4[_0xc3fc('0xe')][_0xc3fc('0xf')]===0x1f4){logger[_0xc3fc('0xe')](_0xc3fc('0xb'),_0x174861,_0x568ed4['error'][_0xc3fc('0x10')]);return _0x26b6f1(_0x568ed4[_0xc3fc('0xe')][_0xc3fc('0x10')]);}logger[_0xc3fc('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x174861,_0x568ed4[_0xc3fc('0xe')][_0xc3fc('0x10')]);return _0x3fd3ac(_0x568ed4['error'][_0xc3fc('0x10')]);}else{logger[_0xc3fc('0xa')](_0xc3fc('0xb'),_0x174861,_0xc3fc('0xc'));_0x3fd3ac(_0x568ed4[_0xc3fc('0x11')][_0xc3fc('0x10')]);}})[_0xc3fc('0x12')](function(_0x1ff150){logger[_0xc3fc('0xe')](_0xc3fc('0xb'),_0x174861,_0x1ff150);_0x26b6f1(_0x1ff150);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2cef69b..4e9be92 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a9f=['post','create','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','query'];(function(_0x572420,_0x5c9276){var _0x308ed2=function(_0x2351eb){while(--_0x2351eb){_0x572420['push'](_0x572420['shift']());}};_0x308ed2(++_0x5c9276);}(_0x3a9f,0x1e8));var _0xf3a9=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x3a9f[_0x46b22a];return _0x44c2e8;};'use strict';var multer=require(_0xf3a9('0x0'));var util=require(_0xf3a9('0x1'));var path=require('path');var timeout=require(_0xf3a9('0x2'));var express=require(_0xf3a9('0x3'));var router=express['Router']();var fs_extra=require(_0xf3a9('0x4'));var auth=require(_0xf3a9('0x5'));var interaction=require(_0xf3a9('0x6'));var config=require(_0xf3a9('0x7'));var controller=require(_0xf3a9('0x8'));router[_0xf3a9('0x9')]('/',auth[_0xf3a9('0xa')](),controller['index']);router['get'](_0xf3a9('0xb'),auth[_0xf3a9('0xa')](),controller[_0xf3a9('0xc')]);router[_0xf3a9('0x9')](_0xf3a9('0xd'),auth[_0xf3a9('0xa')](),controller[_0xf3a9('0xe')]);router['get'](_0xf3a9('0xf'),auth[_0xf3a9('0xa')](),controller[_0xf3a9('0x10')]);router[_0xf3a9('0x9')]('/:id/query',auth[_0xf3a9('0xa')](),controller[_0xf3a9('0x11')]);router[_0xf3a9('0x12')]('/',auth[_0xf3a9('0xa')](),controller[_0xf3a9('0x13')]);router['put'](_0xf3a9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf3a9('0x14')]('/:id',auth[_0xf3a9('0xa')](),controller[_0xf3a9('0x15')]);module[_0xf3a9('0x16')]=router;
\ No newline at end of file
+var _0xea68=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','destroy','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x592af7,_0x2a1ba7){var _0x4738f1=function(_0x23596d){while(--_0x23596d){_0x592af7['push'](_0x592af7['shift']());}};_0x4738f1(++_0x2a1ba7);}(_0xea68,0x77));var _0x8ea6=function(_0x13b313,_0x1f1a19){_0x13b313=_0x13b313-0x0;var _0x100c85=_0xea68[_0x13b313];return _0x100c85;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ea6('0x0'));var router=express[_0x8ea6('0x1')]();var fs_extra=require(_0x8ea6('0x2'));var auth=require(_0x8ea6('0x3'));var interaction=require(_0x8ea6('0x4'));var config=require(_0x8ea6('0x5'));var controller=require(_0x8ea6('0x6'));router[_0x8ea6('0x7')]('/',auth[_0x8ea6('0x8')](),controller[_0x8ea6('0x9')]);router['get'](_0x8ea6('0xa'),auth[_0x8ea6('0x8')](),controller[_0x8ea6('0xb')]);router[_0x8ea6('0x7')](_0x8ea6('0xc'),auth[_0x8ea6('0x8')](),controller[_0x8ea6('0xd')]);router['get'](_0x8ea6('0xe'),auth[_0x8ea6('0x8')](),controller[_0x8ea6('0xf')]);router[_0x8ea6('0x7')]('/:id/query',auth[_0x8ea6('0x8')](),controller[_0x8ea6('0x10')]);router[_0x8ea6('0x11')]('/',auth[_0x8ea6('0x8')](),controller[_0x8ea6('0x12')]);router[_0x8ea6('0x13')](_0x8ea6('0xa'),auth[_0x8ea6('0x8')](),controller['update']);router['delete'](_0x8ea6('0xa'),auth[_0x8ea6('0x8')](),controller[_0x8ea6('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c4f0faf..967f885 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bed=['Loading','ENUM','manual','scheduled','sequelize','moment','exports','STRING','csv','pdf','DATE'];(function(_0x2ddeca,_0x21c2a2){var _0x4b5c5f=function(_0x45d372){while(--_0x45d372){_0x2ddeca['push'](_0x2ddeca['shift']());}};_0x4b5c5f(++_0x21c2a2);}(_0x1bed,0x1b1));var _0xd1be=function(_0xc4e277,_0xedbd0e){_0xc4e277=_0xc4e277-0x0;var _0xe667d2=_0x1bed[_0xc4e277];return _0xe667d2;};'use strict';var Sequelize=require(_0xd1be('0x0'));var moment=require(_0xd1be('0x1'));module[_0xd1be('0x2')]={'name':{'type':Sequelize[_0xd1be('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xd1be('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd1be('0x4'),_0xd1be('0x5'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd1be('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd1be('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xd1be('0x3')],'defaultValue':_0xd1be('0x7')},'type':{'type':Sequelize[_0xd1be('0x8')](_0xd1be('0x9'),_0xd1be('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xd1be('0x3')]}};
\ No newline at end of file
+var _0x723c=['xlsx','STRING','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','pdf'];(function(_0xced432,_0x3e8a0d){var _0x74b51c=function(_0x16105f){while(--_0x16105f){_0xced432['push'](_0xced432['shift']());}};_0x74b51c(++_0x3e8a0d);}(_0x723c,0x168));var _0xc723=function(_0x2fe7e4,_0x22ce17){_0x2fe7e4=_0x2fe7e4-0x0;var _0x5ba7c9=_0x723c[_0x2fe7e4];return _0x5ba7c9;};'use strict';var Sequelize=require(_0xc723('0x0'));var moment=require(_0xc723('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xc723('0x2'),_0xc723('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc723('0x4')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc723('0x5')]},'endDate':{'type':Sequelize[_0xc723('0x5')]},'status':{'type':Sequelize[_0xc723('0x4')],'defaultValue':_0xc723('0x6')},'type':{'type':Sequelize[_0xc723('0x7')](_0xc723('0x8'),_0xc723('0x9')),'allowNull':![],'defaultValue':_0xc723('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc723('0xa')]},'reportType':{'type':Sequelize[_0xc723('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2075c5e..998e033 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9475=['then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','output','existsSync','join','root','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9475,0xa2));var _0x5947=function(_0x190c87,_0x18b7cf){_0x190c87=_0x190c87-0x0;var _0x4c847a=_0x9475[_0x190c87];return _0x4c847a;};'use strict';var emlformat=require(_0x5947('0x0'));var rimraf=require(_0x5947('0x1'));var zipdir=require(_0x5947('0x2'));var jsonpatch=require(_0x5947('0x3'));var rp=require(_0x5947('0x4'));var moment=require(_0x5947('0x5'));var BPromise=require(_0x5947('0x6'));var Mustache=require(_0x5947('0x7'));var util=require(_0x5947('0x8'));var path=require(_0x5947('0x9'));var sox=require(_0x5947('0xa'));var csv=require(_0x5947('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5947('0xc'));var _=require(_0x5947('0xd'));var squel=require(_0x5947('0xe'));var crypto=require(_0x5947('0xf'));var jsforce=require(_0x5947('0x10'));var deskjs=require(_0x5947('0x11'));var toCsv=require(_0x5947('0xb'));var querystring=require('querystring');var Papa=require(_0x5947('0x12'));var Redis=require(_0x5947('0x13'));var authService=require(_0x5947('0x14'));var qs=require(_0x5947('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5947('0x16'));var logger=require(_0x5947('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5947('0x18'));var db=require(_0x5947('0x19'))['db'];function respondWithStatusCode(_0x28588b,_0x5ace6f){_0x5ace6f=_0x5ace6f||0xcc;return function(_0x2351b8){if(_0x2351b8){return _0x28588b[_0x5947('0x1a')](_0x5ace6f);}return _0x28588b[_0x5947('0x1b')](_0x5ace6f)[_0x5947('0x1c')]();};}function respondWithResult(_0x5a94c6,_0x5d8b93){_0x5d8b93=_0x5d8b93||0xc8;return function(_0x38e9bb){if(_0x38e9bb){return _0x5a94c6[_0x5947('0x1b')](_0x5d8b93)[_0x5947('0x1d')](_0x38e9bb);}};}function respondWithFilteredResult(_0x55678e,_0x17b51d){return function(_0x71e3eb){if(_0x71e3eb){var _0x4f9bab=typeof _0x17b51d['offset']===_0x5947('0x1e')&&typeof _0x17b51d[_0x5947('0x1f')]==='undefined';var _0x3f48a8=_0x71e3eb[_0x5947('0x20')];var _0x5b1b6a=_0x4f9bab?0x0:_0x17b51d['offset'];var _0x566ffb=_0x4f9bab?_0x71e3eb[_0x5947('0x20')]:_0x17b51d[_0x5947('0x21')]+_0x17b51d[_0x5947('0x1f')];var _0x396459;if(_0x566ffb>=_0x3f48a8){_0x566ffb=_0x3f48a8;_0x396459=0xc8;}else{_0x396459=0xce;}_0x55678e[_0x5947('0x1b')](_0x396459);return _0x55678e['set'](_0x5947('0x22'),_0x5b1b6a+'-'+_0x566ffb+'/'+_0x3f48a8)['json'](_0x71e3eb);}return null;};}function patchUpdates(_0x2efe27){return function(_0x38d04f){try{jsonpatch['apply'](_0x38d04f,_0x2efe27,!![]);}catch(_0x49ae08){return BPromise[_0x5947('0x23')](_0x49ae08);}return _0x38d04f[_0x5947('0x24')]();};}function saveUpdates(_0x358428,_0x5460e6){return function(_0x4eb5ed){if(_0x4eb5ed){return _0x4eb5ed[_0x5947('0x25')](_0x358428)[_0x5947('0x26')](function(_0x3862bc){return _0x3862bc;});}return null;};}function removeEntity(_0x2db96f,_0x3f9ff5){return function(_0x3f1862){if(_0x3f1862){return _0x3f1862[_0x5947('0x27')]()['then'](function(){var _0x11ea38=_0x3f1862[_0x5947('0x28')]({'plain':!![]});var _0x5398b6=_0x5947('0x29');return db[_0x5947('0x2a')]['destroy']({'where':{'type':_0x5398b6,'resourceId':_0x11ea38['id']}})[_0x5947('0x26')](function(){return _0x3f1862;});})[_0x5947('0x26')](function(){_0x2db96f[_0x5947('0x1b')](0xcc)[_0x5947('0x1c')]();});}};}function handleEntityNotFound(_0x3a2d24,_0x49cbdf){return function(_0x1dfa66){if(!_0x1dfa66){_0x3a2d24[_0x5947('0x1a')](0x194);}return _0x1dfa66;};}function handleError(_0x29dd85,_0x13bdb4){_0x13bdb4=_0x13bdb4||0x1f4;return function(_0x516561){logger[_0x5947('0x2b')](_0x516561[_0x5947('0x2c')]);if(_0x516561['name']){delete _0x516561[_0x5947('0x2d')];}_0x29dd85[_0x5947('0x1b')](_0x13bdb4)[_0x5947('0x2e')](_0x516561);};}exports[_0x5947('0x2f')]=function(_0x4babf0,_0x3e9876){var _0x55c199={},_0x2741a9={},_0xa20aad={'count':0x0,'rows':[]};var _0x16b1b5=_[_0x5947('0x30')](db['AnalyticExtractedReport'][_0x5947('0x31')],function(_0x105210){return{'name':_0x105210[_0x5947('0x32')],'type':_0x105210[_0x5947('0x33')][_0x5947('0x34')]};});_0x2741a9[_0x5947('0x35')]=_[_0x5947('0x30')](_0x16b1b5,_0x5947('0x2d'));_0x2741a9[_0x5947('0x36')]=_[_0x5947('0x37')](_0x4babf0['query']);_0x2741a9['filters']=_['intersection'](_0x2741a9['model'],_0x2741a9[_0x5947('0x36')]);_0x55c199[_0x5947('0x38')]=_[_0x5947('0x39')](_0x2741a9[_0x5947('0x35')],qs['fields'](_0x4babf0[_0x5947('0x36')][_0x5947('0x3a')]));_0x55c199['attributes']=_0x55c199[_0x5947('0x38')][_0x5947('0x3b')]?_0x55c199[_0x5947('0x38')]:_0x2741a9['model'];if(!_0x4babf0[_0x5947('0x36')][_0x5947('0x3c')](_0x5947('0x3d'))){_0x55c199[_0x5947('0x1f')]=qs[_0x5947('0x1f')](_0x4babf0[_0x5947('0x36')]['limit']);_0x55c199[_0x5947('0x21')]=qs[_0x5947('0x21')](_0x4babf0['query']['offset']);}_0x55c199[_0x5947('0x3e')]=qs[_0x5947('0x3f')](_0x4babf0[_0x5947('0x36')][_0x5947('0x3f')]);_0x55c199[_0x5947('0x40')]=qs[_0x5947('0x41')](_[_0x5947('0x42')](_0x4babf0['query'],_0x2741a9[_0x5947('0x41')]),_0x16b1b5);if(_0x4babf0[_0x5947('0x36')]['filter']){_0x55c199[_0x5947('0x40')]=_[_0x5947('0x43')](_0x55c199[_0x5947('0x40')],{'$or':_[_0x5947('0x30')](_0x16b1b5,function(_0x2a9560){if(_0x2a9560[_0x5947('0x33')]!==_0x5947('0x44')){var _0x1c57a5={};_0x1c57a5[_0x2a9560[_0x5947('0x2d')]]={'$like':'%'+_0x4babf0[_0x5947('0x36')][_0x5947('0x45')]+'%'};return _0x1c57a5;}})});}_0x55c199=_[_0x5947('0x43')]({},_0x55c199,_0x4babf0[_0x5947('0x46')]);var _0x890197={'where':_0x55c199[_0x5947('0x40')]};return db[_0x5947('0x47')][_0x5947('0x20')](_0x890197)[_0x5947('0x26')](function(_0x6ca44e){_0xa20aad[_0x5947('0x20')]=_0x6ca44e;if(_0x4babf0[_0x5947('0x36')][_0x5947('0x48')]){_0x55c199['include']=[{'all':!![]}];}return db[_0x5947('0x47')][_0x5947('0x49')](_0x55c199);})['then'](function(_0x544059){_0xa20aad[_0x5947('0x4a')]=_0x544059;return _0xa20aad;})[_0x5947('0x26')](respondWithFilteredResult(_0x3e9876,_0x55c199))[_0x5947('0x4b')](handleError(_0x3e9876,null));};exports['show']=function(_0x1966d5,_0xa922b8){var _0x314ad7={'raw':!![],'where':{'id':_0x1966d5[_0x5947('0x4c')]['id']}},_0x2fd480={};_0x2fd480[_0x5947('0x35')]=_[_0x5947('0x37')](db[_0x5947('0x47')][_0x5947('0x31')]);_0x2fd480['query']=_[_0x5947('0x37')](_0x1966d5['query']);_0x2fd480['filters']=_[_0x5947('0x39')](_0x2fd480[_0x5947('0x35')],_0x2fd480['query']);_0x314ad7[_0x5947('0x38')]=_[_0x5947('0x39')](_0x2fd480[_0x5947('0x35')],qs[_0x5947('0x3a')](_0x1966d5[_0x5947('0x36')][_0x5947('0x3a')]));_0x314ad7[_0x5947('0x38')]=_0x314ad7['attributes']['length']?_0x314ad7['attributes']:_0x2fd480[_0x5947('0x35')];if(_0x1966d5[_0x5947('0x36')][_0x5947('0x48')]){_0x314ad7[_0x5947('0x4d')]=[{'all':!![]}];}_0x314ad7=_[_0x5947('0x43')]({},_0x314ad7,_0x1966d5[_0x5947('0x46')]);return db['AnalyticExtractedReport'][_0x5947('0x4e')](_0x314ad7)[_0x5947('0x26')](handleEntityNotFound(_0xa922b8,null))['then'](respondWithResult(_0xa922b8,null))[_0x5947('0x4b')](handleError(_0xa922b8,null));};exports[_0x5947('0x4f')]=function(_0x1b1135,_0x42b5f9){return db['AnalyticExtractedReport'][_0x5947('0x4f')](_0x1b1135['body'],{})[_0x5947('0x26')](function(_0x52c025){var _0x30eac3=_0x1b1135[_0x5947('0x50')][_0x5947('0x28')]({'plain':!![]});if(!_0x30eac3)throw new Error(_0x5947('0x51'));if(_0x30eac3[_0x5947('0x52')]===_0x5947('0x50')){var _0x369dbd=_0x52c025['get']({'plain':!![]});var _0x488654=_0x5947('0x29');return db[_0x5947('0x53')]['find']({'where':{'name':_0x488654,'userProfileId':_0x30eac3[_0x5947('0x54')]},'raw':!![]})[_0x5947('0x26')](function(_0x478370){if(_0x478370&&_0x478370['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x369dbd[_0x5947('0x2d')],'resourceId':_0x369dbd['id'],'type':_0x478370[_0x5947('0x2d')],'sectionId':_0x478370['id']},{})[_0x5947('0x26')](function(){return _0x52c025;});}else{return _0x52c025;}})[_0x5947('0x4b')](function(_0x257630){logger['error'](_0x5947('0x55'),_0x257630);throw _0x257630;});}return _0x52c025;})[_0x5947('0x26')](respondWithResult(_0x42b5f9,0xc9))['catch'](handleError(_0x42b5f9,null));};exports['update']=function(_0x352bfb,_0x12a83a){if(_0x352bfb[_0x5947('0x56')]['id']){delete _0x352bfb[_0x5947('0x56')]['id'];}return db[_0x5947('0x47')][_0x5947('0x4e')]({'where':{'id':_0x352bfb[_0x5947('0x4c')]['id']}})[_0x5947('0x26')](handleEntityNotFound(_0x12a83a,null))[_0x5947('0x26')](saveUpdates(_0x352bfb[_0x5947('0x56')],null))[_0x5947('0x26')](respondWithResult(_0x12a83a,null))[_0x5947('0x4b')](handleError(_0x12a83a,null));};exports['destroy']=function(_0x503e2d,_0x1cad4e){return db[_0x5947('0x47')][_0x5947('0x4e')]({'where':{'id':_0x503e2d[_0x5947('0x4c')]['id']}})[_0x5947('0x26')](handleEntityNotFound(_0x1cad4e,null))[_0x5947('0x26')](removeEntity(_0x1cad4e,null))[_0x5947('0x4b')](handleError(_0x1cad4e,null));};exports[_0x5947('0x57')]=function(_0x3f4089,_0x19ca84,_0xdb0a92){return db[_0x5947('0x47')][_0x5947('0x4e')]({'where':{'id':_0x3f4089[_0x5947('0x4c')]['id']},'attributes':[_0x5947('0x2d'),_0x5947('0x58'),'savename',_0x5947('0x59')],'raw':!![]})[_0x5947('0x26')](handleEntityNotFound(_0x19ca84,null))[_0x5947('0x26')](function(_0x48c5f9){if(_0x48c5f9){if(!fs[_0x5947('0x5a')](path[_0x5947('0x5b')](config[_0x5947('0x5c')],'server/files/reports',_0x48c5f9[_0x5947('0x5d')]))){throw new db[(_0x5947('0x5e'))][(_0x5947('0x5f'))](_0x5947('0x60'));}if(_0x3f4089[_0x5947('0x36')]['exists']){return _0x19ca84[_0x5947('0x1a')](0xc8);}return _0x19ca84[_0x5947('0x57')](path['join'](config['root'],_0x5947('0x61'),_0x48c5f9[_0x5947('0x5d')]),util[_0x5947('0x62')](_0x5947('0x63'),_0x48c5f9[_0x5947('0x58')]||_0x48c5f9[_0x5947('0x2d')],_0x48c5f9[_0x5947('0x59')]['toLowerCase']()));}})[_0x5947('0x4b')](handleError(_0x19ca84,null));};
\ No newline at end of file
+var _0x0d7f=['params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','format','toLowerCase','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','reject','save','destroy','then','get','ExtractedReports','UserProfileResource','error','stack','send','index','AnalyticExtractedReport','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0d7f,0x115));var _0xf0d7=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x0d7f[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0d7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0d7('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0d7('0x2'));var Mustache=require(_0xf0d7('0x3'));var util=require('util');var path=require(_0xf0d7('0x4'));var sox=require(_0xf0d7('0x5'));var csv=require(_0xf0d7('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf0d7('0x7'));var crypto=require(_0xf0d7('0x8'));var jsforce=require(_0xf0d7('0x9'));var deskjs=require(_0xf0d7('0xa'));var toCsv=require(_0xf0d7('0x6'));var querystring=require(_0xf0d7('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0d7('0xc'));var qs=require(_0xf0d7('0xd'));var as=require(_0xf0d7('0xe'));var hardwareService=require(_0xf0d7('0xf'));var logger=require(_0xf0d7('0x10'))(_0xf0d7('0x11'));var utils=require(_0xf0d7('0x12'));var config=require(_0xf0d7('0x13'));var licenseUtil=require(_0xf0d7('0x14'));var db=require(_0xf0d7('0x15'))['db'];function respondWithStatusCode(_0x5409ce,_0x5a3527){_0x5a3527=_0x5a3527||0xcc;return function(_0xea9cbd){if(_0xea9cbd){return _0x5409ce[_0xf0d7('0x16')](_0x5a3527);}return _0x5409ce[_0xf0d7('0x17')](_0x5a3527)['end']();};}function respondWithResult(_0x5d38de,_0xa54fc2){_0xa54fc2=_0xa54fc2||0xc8;return function(_0x4fe834){if(_0x4fe834){return _0x5d38de[_0xf0d7('0x17')](_0xa54fc2)[_0xf0d7('0x18')](_0x4fe834);}};}function respondWithFilteredResult(_0x354fed,_0x2940ed){return function(_0x2112a9){if(_0x2112a9){var _0x42c791=typeof _0x2940ed[_0xf0d7('0x19')]===_0xf0d7('0x1a')&&typeof _0x2940ed['limit']==='undefined';var _0x412772=_0x2112a9[_0xf0d7('0x1b')];var _0x5375e9=_0x42c791?0x0:_0x2940ed[_0xf0d7('0x19')];var _0x395132=_0x42c791?_0x2112a9[_0xf0d7('0x1b')]:_0x2940ed['offset']+_0x2940ed[_0xf0d7('0x1c')];var _0x25a11c;if(_0x395132>=_0x412772){_0x395132=_0x412772;_0x25a11c=0xc8;}else{_0x25a11c=0xce;}_0x354fed[_0xf0d7('0x17')](_0x25a11c);return _0x354fed['set']('Content-Range',_0x5375e9+'-'+_0x395132+'/'+_0x412772)[_0xf0d7('0x18')](_0x2112a9);}return null;};}function patchUpdates(_0x58e000){return function(_0xa8ca06){try{jsonpatch['apply'](_0xa8ca06,_0x58e000,!![]);}catch(_0x56cc9a){return BPromise[_0xf0d7('0x1d')](_0x56cc9a);}return _0xa8ca06[_0xf0d7('0x1e')]();};}function saveUpdates(_0x2315f0,_0x159fdd){return function(_0x5c2e8c){if(_0x5c2e8c){return _0x5c2e8c['update'](_0x2315f0)['then'](function(_0x4e16f3){return _0x4e16f3;});}return null;};}function removeEntity(_0x502130,_0x4ece9e){return function(_0x40ebaa){if(_0x40ebaa){return _0x40ebaa[_0xf0d7('0x1f')]()[_0xf0d7('0x20')](function(){var _0x4eaf7c=_0x40ebaa[_0xf0d7('0x21')]({'plain':!![]});var _0x1aad6d=_0xf0d7('0x22');return db[_0xf0d7('0x23')]['destroy']({'where':{'type':_0x1aad6d,'resourceId':_0x4eaf7c['id']}})['then'](function(){return _0x40ebaa;});})[_0xf0d7('0x20')](function(){_0x502130[_0xf0d7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6988a,_0x15b727){return function(_0x155156){if(!_0x155156){_0x6988a['sendStatus'](0x194);}return _0x155156;};}function handleError(_0x3345c3,_0x4e0e2f){_0x4e0e2f=_0x4e0e2f||0x1f4;return function(_0x8e88c6){logger[_0xf0d7('0x24')](_0x8e88c6[_0xf0d7('0x25')]);if(_0x8e88c6['name']){delete _0x8e88c6['name'];}_0x3345c3[_0xf0d7('0x17')](_0x4e0e2f)[_0xf0d7('0x26')](_0x8e88c6);};}exports[_0xf0d7('0x27')]=function(_0x16633a,_0xa542f){var _0x1358c4={},_0x54ecbf={},_0x3fa939={'count':0x0,'rows':[]};var _0x129f42=_['map'](db[_0xf0d7('0x28')]['rawAttributes'],function(_0x41478d){return{'name':_0x41478d[_0xf0d7('0x29')],'type':_0x41478d[_0xf0d7('0x2a')]['key']};});_0x54ecbf[_0xf0d7('0x2b')]=_[_0xf0d7('0x2c')](_0x129f42,_0xf0d7('0x2d'));_0x54ecbf[_0xf0d7('0x2e')]=_[_0xf0d7('0x2f')](_0x16633a['query']);_0x54ecbf['filters']=_[_0xf0d7('0x30')](_0x54ecbf['model'],_0x54ecbf[_0xf0d7('0x2e')]);_0x1358c4[_0xf0d7('0x31')]=_[_0xf0d7('0x30')](_0x54ecbf[_0xf0d7('0x2b')],qs[_0xf0d7('0x32')](_0x16633a[_0xf0d7('0x2e')][_0xf0d7('0x32')]));_0x1358c4[_0xf0d7('0x31')]=_0x1358c4[_0xf0d7('0x31')]['length']?_0x1358c4[_0xf0d7('0x31')]:_0x54ecbf[_0xf0d7('0x2b')];if(!_0x16633a['query'][_0xf0d7('0x33')](_0xf0d7('0x34'))){_0x1358c4['limit']=qs['limit'](_0x16633a[_0xf0d7('0x2e')][_0xf0d7('0x1c')]);_0x1358c4['offset']=qs['offset'](_0x16633a[_0xf0d7('0x2e')][_0xf0d7('0x19')]);}_0x1358c4[_0xf0d7('0x35')]=qs['sort'](_0x16633a['query']['sort']);_0x1358c4['where']=qs[_0xf0d7('0x36')](_[_0xf0d7('0x37')](_0x16633a[_0xf0d7('0x2e')],_0x54ecbf['filters']),_0x129f42);if(_0x16633a[_0xf0d7('0x2e')][_0xf0d7('0x38')]){_0x1358c4[_0xf0d7('0x39')]=_[_0xf0d7('0x3a')](_0x1358c4['where'],{'$or':_[_0xf0d7('0x2c')](_0x129f42,function(_0x5040d2){if(_0x5040d2[_0xf0d7('0x2a')]!==_0xf0d7('0x3b')){var _0x351aa9={};_0x351aa9[_0x5040d2['name']]={'$like':'%'+_0x16633a['query'][_0xf0d7('0x38')]+'%'};return _0x351aa9;}})});}_0x1358c4=_['merge']({},_0x1358c4,_0x16633a['options']);var _0x3952c2={'where':_0x1358c4[_0xf0d7('0x39')]};return db[_0xf0d7('0x28')][_0xf0d7('0x1b')](_0x3952c2)[_0xf0d7('0x20')](function(_0x339ca0){_0x3fa939[_0xf0d7('0x1b')]=_0x339ca0;if(_0x16633a[_0xf0d7('0x2e')][_0xf0d7('0x3c')]){_0x1358c4[_0xf0d7('0x3d')]=[{'all':!![]}];}return db[_0xf0d7('0x28')][_0xf0d7('0x3e')](_0x1358c4);})[_0xf0d7('0x20')](function(_0x3791a1){_0x3fa939['rows']=_0x3791a1;return _0x3fa939;})[_0xf0d7('0x20')](respondWithFilteredResult(_0xa542f,_0x1358c4))['catch'](handleError(_0xa542f,null));};exports['show']=function(_0x520418,_0x279b67){var _0x3526d9={'raw':!![],'where':{'id':_0x520418[_0xf0d7('0x3f')]['id']}},_0x5ec169={};_0x5ec169['model']=_[_0xf0d7('0x2f')](db[_0xf0d7('0x28')]['rawAttributes']);_0x5ec169[_0xf0d7('0x2e')]=_['keys'](_0x520418[_0xf0d7('0x2e')]);_0x5ec169[_0xf0d7('0x36')]=_[_0xf0d7('0x30')](_0x5ec169[_0xf0d7('0x2b')],_0x5ec169['query']);_0x3526d9[_0xf0d7('0x31')]=_['intersection'](_0x5ec169[_0xf0d7('0x2b')],qs['fields'](_0x520418['query']['fields']));_0x3526d9[_0xf0d7('0x31')]=_0x3526d9[_0xf0d7('0x31')]['length']?_0x3526d9[_0xf0d7('0x31')]:_0x5ec169['model'];if(_0x520418['query'][_0xf0d7('0x3c')]){_0x3526d9['include']=[{'all':!![]}];}_0x3526d9=_['merge']({},_0x3526d9,_0x520418[_0xf0d7('0x40')]);return db[_0xf0d7('0x28')][_0xf0d7('0x41')](_0x3526d9)['then'](handleEntityNotFound(_0x279b67,null))[_0xf0d7('0x20')](respondWithResult(_0x279b67,null))[_0xf0d7('0x42')](handleError(_0x279b67,null));};exports[_0xf0d7('0x43')]=function(_0xc4b7c,_0x57ccf1){return db[_0xf0d7('0x28')][_0xf0d7('0x43')](_0xc4b7c[_0xf0d7('0x44')],{})['then'](function(_0x10a8ec){var _0x2471cd=_0xc4b7c[_0xf0d7('0x45')][_0xf0d7('0x21')]({'plain':!![]});if(!_0x2471cd)throw new Error(_0xf0d7('0x46'));if(_0x2471cd['role']==='user'){var _0x48ea84=_0x10a8ec[_0xf0d7('0x21')]({'plain':!![]});var _0x5ee102='ExtractedReports';return db[_0xf0d7('0x47')]['find']({'where':{'name':_0x5ee102,'userProfileId':_0x2471cd['userProfileId']},'raw':!![]})[_0xf0d7('0x20')](function(_0x4a155b){if(_0x4a155b&&_0x4a155b[_0xf0d7('0x48')]===0x0){return db[_0xf0d7('0x23')][_0xf0d7('0x43')]({'name':_0x48ea84[_0xf0d7('0x2d')],'resourceId':_0x48ea84['id'],'type':_0x4a155b[_0xf0d7('0x2d')],'sectionId':_0x4a155b['id']},{})['then'](function(){return _0x10a8ec;});}else{return _0x10a8ec;}})['catch'](function(_0x16f632){logger[_0xf0d7('0x24')](_0xf0d7('0x49'),_0x16f632);throw _0x16f632;});}return _0x10a8ec;})[_0xf0d7('0x20')](respondWithResult(_0x57ccf1,0xc9))[_0xf0d7('0x42')](handleError(_0x57ccf1,null));};exports['update']=function(_0x32d784,_0x151907){if(_0x32d784[_0xf0d7('0x44')]['id']){delete _0x32d784['body']['id'];}return db[_0xf0d7('0x28')][_0xf0d7('0x41')]({'where':{'id':_0x32d784[_0xf0d7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x151907,null))[_0xf0d7('0x20')](saveUpdates(_0x32d784[_0xf0d7('0x44')],null))[_0xf0d7('0x20')](respondWithResult(_0x151907,null))[_0xf0d7('0x42')](handleError(_0x151907,null));};exports[_0xf0d7('0x1f')]=function(_0x15c678,_0x491076){return db['AnalyticExtractedReport'][_0xf0d7('0x41')]({'where':{'id':_0x15c678[_0xf0d7('0x3f')]['id']}})[_0xf0d7('0x20')](handleEntityNotFound(_0x491076,null))[_0xf0d7('0x20')](removeEntity(_0x491076,null))[_0xf0d7('0x42')](handleError(_0x491076,null));};exports[_0xf0d7('0x4a')]=function(_0x5a06aa,_0x276c61,_0x17489a){return db['AnalyticExtractedReport'][_0xf0d7('0x41')]({'where':{'id':_0x5a06aa[_0xf0d7('0x3f')]['id']},'attributes':['name',_0xf0d7('0x4b'),_0xf0d7('0x4c'),_0xf0d7('0x4d')],'raw':!![]})[_0xf0d7('0x20')](handleEntityNotFound(_0x276c61,null))['then'](function(_0x349cc1){if(_0x349cc1){if(!fs[_0xf0d7('0x4e')](path[_0xf0d7('0x4f')](config[_0xf0d7('0x50')],_0xf0d7('0x51'),_0x349cc1[_0xf0d7('0x4c')]))){throw new db['Sequelize'][(_0xf0d7('0x52'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5a06aa[_0xf0d7('0x2e')]['exists']){return _0x276c61[_0xf0d7('0x16')](0xc8);}return _0x276c61[_0xf0d7('0x4a')](path[_0xf0d7('0x4f')](config[_0xf0d7('0x50')],_0xf0d7('0x51'),_0x349cc1[_0xf0d7('0x4c')]),util[_0xf0d7('0x53')]('%s.%s',_0x349cc1[_0xf0d7('0x4b')]||_0x349cc1[_0xf0d7('0x2d')],_0x349cc1[_0xf0d7('0x4d')][_0xf0d7('0x54')]()));}})[_0xf0d7('0x42')](handleError(_0x276c61,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 877ddf1..f0c4422 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c74=['rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3c74,0x11a));var _0x43c7=function(_0x1b85fd,_0x55e123){_0x1b85fd=_0x1b85fd-0x0;var _0x1e7406=_0x3c74[_0x1b85fd];return _0x1e7406;};'use strict';var _=require(_0x43c7('0x0'));var util=require(_0x43c7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x43c7('0x2'));var BPromise=require(_0x43c7('0x3'));var rp=require(_0x43c7('0x4'));var fs=require('fs');var path=require(_0x43c7('0x5'));var rimraf=require(_0x43c7('0x6'));var config=require('../../config/environment');var attributes=require(_0x43c7('0x7'));module[_0x43c7('0x8')]=function(_0x636899,_0x1825a6){return _0x636899[_0x43c7('0x9')](_0x43c7('0xa'),attributes,{'tableName':_0x43c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc135=['AnalyticExtractedReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3f8b5c,_0x2b215d){var _0x2a1384=function(_0x43d9c8){while(--_0x43d9c8){_0x3f8b5c['push'](_0x3f8b5c['shift']());}};_0x2a1384(++_0x2b215d);}(_0xc135,0x156));var _0x5c13=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc135[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5c13('0x0'));var util=require(_0x5c13('0x1'));var logger=require(_0x5c13('0x2'))('api');var moment=require(_0x5c13('0x3'));var BPromise=require(_0x5c13('0x4'));var rp=require(_0x5c13('0x5'));var fs=require('fs');var path=require(_0x5c13('0x6'));var rimraf=require(_0x5c13('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x5c13('0x8')]=function(_0x263033,_0x16cfbe){return _0x263033[_0x5c13('0x9')](_0x5c13('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 3c377f5..0dced63 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2fe6=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3562a2,_0x4a766f){var _0x3e9c5f=function(_0x5047d8){while(--_0x5047d8){_0x3562a2['push'](_0x3562a2['shift']());}};_0x3e9c5f(++_0x4a766f);}(_0x2fe6,0x1cb));var _0x62fe=function(_0x4115b5,_0x2dd24d){_0x4115b5=_0x4115b5-0x0;var _0x358b2b=_0x2fe6[_0x4115b5];return _0x358b2b;};'use strict';var _=require(_0x62fe('0x0'));var util=require(_0x62fe('0x1'));var moment=require(_0x62fe('0x2'));var BPromise=require(_0x62fe('0x3'));var rs=require(_0x62fe('0x4'));var fs=require('fs');var Redis=require(_0x62fe('0x5'));var db=require(_0x62fe('0x6'))['db'];var utils=require(_0x62fe('0x7'));var logger=require(_0x62fe('0x8'))(_0x62fe('0x9'));var config=require(_0x62fe('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x62fe('0xb')][_0x62fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x207771,_0x1184f6,_0x5a1e46){return new BPromise(function(_0x5f51a8,_0x180c90){return client[_0x62fe('0xd')](_0x207771,_0x5a1e46)[_0x62fe('0xe')](function(_0xdacf42){logger['info'](_0x62fe('0xf'),_0x1184f6,_0x62fe('0x10'));logger[_0x62fe('0x11')](_0x62fe('0x12'),_0x1184f6,_0x62fe('0x10'),JSON[_0x62fe('0x13')](_0xdacf42));if(_0xdacf42['error']){if(_0xdacf42[_0x62fe('0x14')]['code']===0x1f4){logger[_0x62fe('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1184f6,_0xdacf42[_0x62fe('0x14')][_0x62fe('0x15')]);return _0x180c90(_0xdacf42['error'][_0x62fe('0x15')]);}logger[_0x62fe('0x14')](_0x62fe('0xf'),_0x1184f6,_0xdacf42[_0x62fe('0x14')][_0x62fe('0x15')]);return _0x5f51a8(_0xdacf42[_0x62fe('0x14')]['message']);}else{logger[_0x62fe('0x16')](_0x62fe('0xf'),_0x1184f6,_0x62fe('0x10'));_0x5f51a8(_0xdacf42[_0x62fe('0x17')][_0x62fe('0x15')]);}})['catch'](function(_0x1f8ee6){logger[_0x62fe('0x14')](_0x62fe('0xf'),_0x1184f6,_0x1f8ee6);_0x180c90(_0x1f8ee6);});});}
\ No newline at end of file
+var _0xc986=['http','then','info','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x3644ee,_0x267f61){var _0x68cc12=function(_0x150047){while(--_0x150047){_0x3644ee['push'](_0x3644ee['shift']());}};_0x68cc12(++_0x267f61);}(_0xc986,0xef));var _0x6c98=function(_0x180e21,_0x3d0829){_0x180e21=_0x180e21-0x0;var _0x7f194d=_0xc986[_0x180e21];return _0x7f194d;};'use strict';var _=require('lodash');var util=require(_0x6c98('0x0'));var moment=require(_0x6c98('0x1'));var BPromise=require(_0x6c98('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c98('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c98('0x4'))(_0x6c98('0x5'));var config=require(_0x6c98('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c98('0x7')][_0x6c98('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf13a,_0x26426c,_0xdab696){return new BPromise(function(_0x346670,_0x22af0b){return client['request'](_0x1bf13a,_0xdab696)[_0x6c98('0x9')](function(_0x3c22a9){logger[_0x6c98('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x26426c,_0x6c98('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x26426c,_0x6c98('0xb'),JSON[_0x6c98('0xc')](_0x3c22a9));if(_0x3c22a9[_0x6c98('0xd')]){if(_0x3c22a9[_0x6c98('0xd')][_0x6c98('0xe')]===0x1f4){logger[_0x6c98('0xd')](_0x6c98('0xf'),_0x26426c,_0x3c22a9[_0x6c98('0xd')]['message']);return _0x22af0b(_0x3c22a9[_0x6c98('0xd')][_0x6c98('0x10')]);}logger[_0x6c98('0xd')](_0x6c98('0xf'),_0x26426c,_0x3c22a9[_0x6c98('0xd')][_0x6c98('0x10')]);return _0x346670(_0x3c22a9[_0x6c98('0xd')]['message']);}else{logger['info'](_0x6c98('0xf'),_0x26426c,_0x6c98('0xb'));_0x346670(_0x3c22a9[_0x6c98('0x11')][_0x6c98('0x10')]);}})[_0x6c98('0x12')](function(_0x2a11ff){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x26426c,_0x2a11ff);_0x22af0b(_0x2a11ff);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 81307f4..5a8e481 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b45=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b45,0x180));var _0x56b4=function(_0x480843,_0x8121e6){_0x480843=_0x480843-0x0;var _0x1d5cd9=_0x6b45[_0x480843];return _0x1d5cd9;};'use strict';var multer=require('multer');var util=require(_0x56b4('0x0'));var path=require(_0x56b4('0x1'));var timeout=require(_0x56b4('0x2'));var express=require('express');var router=express[_0x56b4('0x3')]();var fs_extra=require(_0x56b4('0x4'));var auth=require(_0x56b4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x56b4('0x6'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x56b4('0x7')](_0x56b4('0x8'),auth[_0x56b4('0x9')](),controller[_0x56b4('0xa')]);router[_0x56b4('0x7')]('/:id/download',auth[_0x56b4('0x9')](),controller['download']);router[_0x56b4('0xb')]('/',auth[_0x56b4('0x9')](),controller[_0x56b4('0xc')]);router[_0x56b4('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x56b4('0xe')]);router[_0x56b4('0xf')](_0x56b4('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x56b4('0x10')]=router;
\ No newline at end of file
+var _0x3a61=['isAuthenticated','index','/:id','show','get','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a61,0x157));var _0x13a6=function(_0x347ea8,_0x2ac098){_0x347ea8=_0x347ea8-0x0;var _0x2e83f4=_0x3a61[_0x347ea8];return _0x2e83f4;};'use strict';var multer=require(_0x13a6('0x0'));var util=require(_0x13a6('0x1'));var path=require(_0x13a6('0x2'));var timeout=require(_0x13a6('0x3'));var express=require(_0x13a6('0x4'));var router=express[_0x13a6('0x5')]();var fs_extra=require(_0x13a6('0x6'));var auth=require(_0x13a6('0x7'));var interaction=require(_0x13a6('0x8'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x13a6('0x9')](),controller[_0x13a6('0xa')]);router['get'](_0x13a6('0xb'),auth[_0x13a6('0x9')](),controller[_0x13a6('0xc')]);router[_0x13a6('0xd')]('/:id/download',auth[_0x13a6('0x9')](),controller[_0x13a6('0xe')]);router[_0x13a6('0xf')]('/',auth[_0x13a6('0x9')](),controller[_0x13a6('0x10')]);router[_0x13a6('0x11')](_0x13a6('0xb'),auth['isAuthenticated'](),controller[_0x13a6('0x12')]);router[_0x13a6('0x13')](_0x13a6('0xb'),auth[_0x13a6('0x9')](),controller[_0x13a6('0x14')]);module[_0x13a6('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c4c0031..a0a4e50 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ae5=['exports','STRING','BOOLEAN'];(function(_0x58ac9b,_0x35dc04){var _0x12a47d=function(_0x2af5ce){while(--_0x2af5ce){_0x58ac9b['push'](_0x58ac9b['shift']());}};_0x12a47d(++_0x35dc04);}(_0x4ae5,0x102));var _0x54ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ae5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x54ae('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x54ae('0x1')]},'function':{'type':Sequelize[_0x54ae('0x1')]},'format':{'type':Sequelize[_0x54ae('0x1')]},'groupBy':{'type':Sequelize[_0x54ae('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xde1f=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x42accd,_0x4da84e){var _0x1a76ac=function(_0x2f2cb1){while(--_0x2f2cb1){_0x42accd['push'](_0x42accd['shift']());}};_0x1a76ac(++_0x4da84e);}(_0xde1f,0x125));var _0xfde1=function(_0x10639d,_0x1fad09){_0x10639d=_0x10639d-0x0;var _0x206332=_0xde1f[_0x10639d];return _0x206332;};'use strict';var Sequelize=require(_0xfde1('0x0'));module['exports']={'field':{'type':Sequelize[_0xfde1('0x1')]},'alias':{'type':Sequelize[_0xfde1('0x2')]},'function':{'type':Sequelize[_0xfde1('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xfde1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 93e633f..28e3c38 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec5f=['merge','find','create','body','bulkCreate','bulkDestroy','ids','addFields','map','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','destroy','then','error','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x41936a,_0x26e929){var _0x212240=function(_0x1c0554){while(--_0x1c0554){_0x41936a['push'](_0x41936a['shift']());}};_0x212240(++_0x26e929);}(_0xec5f,0x1d8));var _0xfec5=function(_0x29fad9,_0x573b38){_0x29fad9=_0x29fad9-0x0;var _0x1bfd87=_0xec5f[_0x29fad9];return _0x1bfd87;};'use strict';var emlformat=require(_0xfec5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfec5('0x1'));var jsonpatch=require(_0xfec5('0x2'));var rp=require(_0xfec5('0x3'));var moment=require(_0xfec5('0x4'));var BPromise=require(_0xfec5('0x5'));var Mustache=require(_0xfec5('0x6'));var util=require(_0xfec5('0x7'));var path=require(_0xfec5('0x8'));var sox=require(_0xfec5('0x9'));var csv=require('to-csv');var ejs=require(_0xfec5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfec5('0xb'));var squel=require(_0xfec5('0xc'));var crypto=require(_0xfec5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfec5('0xe'));var Redis=require(_0xfec5('0xf'));var authService=require(_0xfec5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfec5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfec5('0x12'))(_0xfec5('0x13'));var utils=require(_0xfec5('0x14'));var config=require(_0xfec5('0x15'));var licenseUtil=require(_0xfec5('0x16'));var db=require(_0xfec5('0x17'))['db'];function respondWithStatusCode(_0x5bfe9f,_0x3bed29){_0x3bed29=_0x3bed29||0xcc;return function(_0x336833){if(_0x336833){return _0x5bfe9f[_0xfec5('0x18')](_0x3bed29);}return _0x5bfe9f[_0xfec5('0x19')](_0x3bed29)[_0xfec5('0x1a')]();};}function respondWithResult(_0x5231ff,_0x182394){_0x182394=_0x182394||0xc8;return function(_0x385749){if(_0x385749){return _0x5231ff[_0xfec5('0x19')](_0x182394)['json'](_0x385749);}};}function respondWithFilteredResult(_0x2e1add,_0x7461be){return function(_0x129f4c){if(_0x129f4c){var _0xb6c8dd=typeof _0x7461be[_0xfec5('0x1b')]===_0xfec5('0x1c')&&typeof _0x7461be[_0xfec5('0x1d')]==='undefined';var _0x368a63=_0x129f4c[_0xfec5('0x1e')];var _0x257f67=_0xb6c8dd?0x0:_0x7461be[_0xfec5('0x1b')];var _0x21a721=_0xb6c8dd?_0x129f4c[_0xfec5('0x1e')]:_0x7461be[_0xfec5('0x1b')]+_0x7461be[_0xfec5('0x1d')];var _0x4fc6ba;if(_0x21a721>=_0x368a63){_0x21a721=_0x368a63;_0x4fc6ba=0xc8;}else{_0x4fc6ba=0xce;}_0x2e1add[_0xfec5('0x19')](_0x4fc6ba);return _0x2e1add[_0xfec5('0x1f')]('Content-Range',_0x257f67+'-'+_0x21a721+'/'+_0x368a63)[_0xfec5('0x20')](_0x129f4c);}return null;};}function patchUpdates(_0x4ac366){return function(_0x52e311){try{jsonpatch['apply'](_0x52e311,_0x4ac366,!![]);}catch(_0x7efe74){return BPromise['reject'](_0x7efe74);}return _0x52e311[_0xfec5('0x21')]();};}function saveUpdates(_0x2ff665,_0x37bf7b){return function(_0x114c66){if(_0x114c66){return _0x114c66[_0xfec5('0x22')](_0x2ff665)['then'](function(_0x3cc5c4){return _0x3cc5c4;});}return null;};}function removeEntity(_0x551629,_0x37ec7f){return function(_0x185689){if(_0x185689){return _0x185689[_0xfec5('0x23')]()[_0xfec5('0x24')](function(){_0x551629['status'](0xcc)[_0xfec5('0x1a')]();});}};}function handleEntityNotFound(_0x436682,_0x4887d6){return function(_0x47b117){if(!_0x47b117){_0x436682['sendStatus'](0x194);}return _0x47b117;};}function handleError(_0x502c26,_0x16cd4e){_0x16cd4e=_0x16cd4e||0x1f4;return function(_0x25432d){logger[_0xfec5('0x25')](_0x25432d['stack']);if(_0x25432d['name']){delete _0x25432d['name'];}_0x502c26['status'](_0x16cd4e)[_0xfec5('0x26')](_0x25432d);};}exports[_0xfec5('0x27')]=function(_0x34266a,_0x588b3c){var _0x18ae4d={},_0x4fc03c={},_0x155812={'count':0x0,'rows':[]};var _0xe06850=_['map'](db[_0xfec5('0x28')][_0xfec5('0x29')],function(_0x5a9d82){return{'name':_0x5a9d82[_0xfec5('0x2a')],'type':_0x5a9d82['type'][_0xfec5('0x2b')]};});_0x4fc03c[_0xfec5('0x2c')]=_['map'](_0xe06850,_0xfec5('0x2d'));_0x4fc03c[_0xfec5('0x2e')]=_['keys'](_0x34266a[_0xfec5('0x2e')]);_0x4fc03c[_0xfec5('0x2f')]=_[_0xfec5('0x30')](_0x4fc03c[_0xfec5('0x2c')],_0x4fc03c['query']);_0x18ae4d[_0xfec5('0x31')]=_[_0xfec5('0x30')](_0x4fc03c[_0xfec5('0x2c')],qs['fields'](_0x34266a[_0xfec5('0x2e')][_0xfec5('0x32')]));_0x18ae4d[_0xfec5('0x31')]=_0x18ae4d['attributes'][_0xfec5('0x33')]?_0x18ae4d[_0xfec5('0x31')]:_0x4fc03c[_0xfec5('0x2c')];if(!_0x34266a[_0xfec5('0x2e')][_0xfec5('0x34')](_0xfec5('0x35'))){_0x18ae4d[_0xfec5('0x1d')]=qs[_0xfec5('0x1d')](_0x34266a[_0xfec5('0x2e')][_0xfec5('0x1d')]);_0x18ae4d[_0xfec5('0x1b')]=qs[_0xfec5('0x1b')](_0x34266a[_0xfec5('0x2e')][_0xfec5('0x1b')]);}_0x18ae4d['order']=qs[_0xfec5('0x36')](_0x34266a[_0xfec5('0x2e')]['sort']);_0x18ae4d['where']=qs['filters'](_[_0xfec5('0x37')](_0x34266a[_0xfec5('0x2e')],_0x4fc03c[_0xfec5('0x2f')]),_0xe06850);if(_0x34266a[_0xfec5('0x2e')][_0xfec5('0x38')]){_0x18ae4d[_0xfec5('0x39')]=_['merge'](_0x18ae4d[_0xfec5('0x39')],{'$or':_['map'](_0xe06850,function(_0x207ef9){if(_0x207ef9['type']!=='VIRTUAL'){var _0x249437={};_0x249437[_0x207ef9[_0xfec5('0x2d')]]={'$like':'%'+_0x34266a['query'][_0xfec5('0x38')]+'%'};return _0x249437;}})});}_0x18ae4d=_['merge']({},_0x18ae4d,_0x34266a[_0xfec5('0x3a')]);var _0x50beb6={'where':_0x18ae4d['where']};return db[_0xfec5('0x28')]['count'](_0x50beb6)['then'](function(_0x15a98b){_0x155812[_0xfec5('0x1e')]=_0x15a98b;if(_0x34266a[_0xfec5('0x2e')][_0xfec5('0x3b')]){_0x18ae4d[_0xfec5('0x3c')]=[{'all':!![]}];}return db[_0xfec5('0x28')][_0xfec5('0x3d')](_0x18ae4d);})[_0xfec5('0x24')](function(_0x5aa2dc){_0x155812[_0xfec5('0x3e')]=_0x5aa2dc;return _0x155812;})['then'](respondWithFilteredResult(_0x588b3c,_0x18ae4d))[_0xfec5('0x3f')](handleError(_0x588b3c,null));};exports[_0xfec5('0x40')]=function(_0x50a22f,_0x5ee6c4){var _0x1967a5={'raw':![],'where':{'id':_0x50a22f[_0xfec5('0x41')]['id']}},_0x4b9722={};_0x4b9722[_0xfec5('0x2c')]=_['keys'](db[_0xfec5('0x28')][_0xfec5('0x29')]);_0x4b9722[_0xfec5('0x2e')]=_[_0xfec5('0x42')](_0x50a22f[_0xfec5('0x2e')]);_0x4b9722['filters']=_[_0xfec5('0x30')](_0x4b9722[_0xfec5('0x2c')],_0x4b9722[_0xfec5('0x2e')]);_0x1967a5['attributes']=_['intersection'](_0x4b9722[_0xfec5('0x2c')],qs[_0xfec5('0x32')](_0x50a22f['query'][_0xfec5('0x32')]));_0x1967a5['attributes']=_0x1967a5[_0xfec5('0x31')][_0xfec5('0x33')]?_0x1967a5[_0xfec5('0x31')]:_0x4b9722[_0xfec5('0x2c')];if(_0x50a22f[_0xfec5('0x2e')][_0xfec5('0x3b')]){_0x1967a5[_0xfec5('0x3c')]=[{'all':!![]}];}_0x1967a5=_[_0xfec5('0x43')]({},_0x1967a5,_0x50a22f[_0xfec5('0x3a')]);return db['AnalyticFieldReport'][_0xfec5('0x44')](_0x1967a5)[_0xfec5('0x24')](handleEntityNotFound(_0x5ee6c4,null))[_0xfec5('0x24')](respondWithResult(_0x5ee6c4,null))[_0xfec5('0x3f')](handleError(_0x5ee6c4,null));};exports[_0xfec5('0x45')]=function(_0x529198,_0x3ec083){return db[_0xfec5('0x28')][_0xfec5('0x45')](_0x529198[_0xfec5('0x46')],{})[_0xfec5('0x24')](respondWithResult(_0x3ec083,0xc9))[_0xfec5('0x3f')](handleError(_0x3ec083,null));};exports[_0xfec5('0x47')]=function(_0x35e2fe,_0x39fe19){return db[_0xfec5('0x28')][_0xfec5('0x47')](_0x35e2fe[_0xfec5('0x46')],{'raw':![],'individualHooks':!![]})[_0xfec5('0x24')](respondWithResult(_0x39fe19,0xc9))[_0xfec5('0x3f')](handleError(_0x39fe19,null));};exports[_0xfec5('0x22')]=function(_0x45347c,_0x425cd6){if(_0x45347c['body']['id']){delete _0x45347c[_0xfec5('0x46')]['id'];}return db[_0xfec5('0x28')][_0xfec5('0x44')]({'where':{'id':_0x45347c['params']['id']}})[_0xfec5('0x24')](handleEntityNotFound(_0x425cd6,null))['then'](saveUpdates(_0x45347c['body'],null))[_0xfec5('0x24')](respondWithResult(_0x425cd6,null))[_0xfec5('0x3f')](handleError(_0x425cd6,null));};exports['destroy']=function(_0x40871d,_0x386755){return db[_0xfec5('0x28')][_0xfec5('0x44')]({'where':{'id':_0x40871d[_0xfec5('0x41')]['id']}})[_0xfec5('0x24')](handleEntityNotFound(_0x386755,null))[_0xfec5('0x24')](removeEntity(_0x386755,null))[_0xfec5('0x3f')](handleError(_0x386755,null));};exports[_0xfec5('0x48')]=function(_0x46d81c,_0x210c3d){return db[_0xfec5('0x28')]['destroy']({'where':{'id':_0x46d81c[_0xfec5('0x2e')][_0xfec5('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xfec5('0x24')](respondWithResult(_0x210c3d,0xcc))[_0xfec5('0x3f')](handleError(_0x210c3d,null));};exports[_0xfec5('0x4a')]=function(_0x3897e1,_0x3656c8,_0x221e2a){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x3897e1['params']['id']}})[_0xfec5('0x24')](handleEntityNotFound(_0x3656c8,null))['then'](function(_0x5c49c1){if(_0x5c49c1){return db['sequelize']['transaction'](function(_0xd3dbac){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x3897e1[_0xfec5('0x41')]['id']},'transaction':_0xd3dbac})['then'](function(_0x206ec4){var _0x202c31=_[_0xfec5('0x4b')](_0x3897e1[_0xfec5('0x46')],function(_0xd344ab){delete _0xd344ab['id'];_0xd344ab[_0xfec5('0x4c')]=_0x3897e1['params']['id'];return _0xd344ab;});return db[_0xfec5('0x28')][_0xfec5('0x47')](_0x202c31,{'transaction':_0xd3dbac});});})[_0xfec5('0x24')](function(){return db['AnalyticFieldReport'][_0xfec5('0x3d')]({'where':{'CustomReportId':_0x3897e1['params']['id']}});});}})[_0xfec5('0x24')](respondWithResult(_0x3656c8,null))[_0xfec5('0x3f')](handleError(_0x3656c8,null));};
\ No newline at end of file
+var _0xf159=['catch','fields','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','findOne','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf159,0x151));var _0x9f15=function(_0x2a3552,_0x33a2e2){_0x2a3552=_0x2a3552-0x0;var _0x2c8540=_0xf159[_0x2a3552];return _0x2c8540;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f15('0x0'));var zipdir=require(_0x9f15('0x1'));var jsonpatch=require(_0x9f15('0x2'));var rp=require(_0x9f15('0x3'));var moment=require(_0x9f15('0x4'));var BPromise=require(_0x9f15('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9f15('0x6'));var csv=require(_0x9f15('0x7'));var ejs=require(_0x9f15('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f15('0x9'));var squel=require(_0x9f15('0xa'));var crypto=require(_0x9f15('0xb'));var jsforce=require(_0x9f15('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9f15('0xd'));var Papa=require(_0x9f15('0xe'));var Redis=require(_0x9f15('0xf'));var authService=require(_0x9f15('0x10'));var qs=require(_0x9f15('0x11'));var as=require(_0x9f15('0x12'));var hardwareService=require(_0x9f15('0x13'));var logger=require(_0x9f15('0x14'))(_0x9f15('0x15'));var utils=require(_0x9f15('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9f15('0x17'));var db=require(_0x9f15('0x18'))['db'];function respondWithStatusCode(_0x21709a,_0x2bebb6){_0x2bebb6=_0x2bebb6||0xcc;return function(_0x115cbb){if(_0x115cbb){return _0x21709a[_0x9f15('0x19')](_0x2bebb6);}return _0x21709a[_0x9f15('0x1a')](_0x2bebb6)['end']();};}function respondWithResult(_0x470a37,_0xfb9317){_0xfb9317=_0xfb9317||0xc8;return function(_0x4766ee){if(_0x4766ee){return _0x470a37[_0x9f15('0x1a')](_0xfb9317)[_0x9f15('0x1b')](_0x4766ee);}};}function respondWithFilteredResult(_0x51671c,_0x443c64){return function(_0x40ca24){if(_0x40ca24){var _0x28c07b=typeof _0x443c64[_0x9f15('0x1c')]===_0x9f15('0x1d')&&typeof _0x443c64[_0x9f15('0x1e')]===_0x9f15('0x1d');var _0x58f682=_0x40ca24[_0x9f15('0x1f')];var _0x57fa6d=_0x28c07b?0x0:_0x443c64['offset'];var _0x498435=_0x28c07b?_0x40ca24[_0x9f15('0x1f')]:_0x443c64[_0x9f15('0x1c')]+_0x443c64[_0x9f15('0x1e')];var _0x46fd00;if(_0x498435>=_0x58f682){_0x498435=_0x58f682;_0x46fd00=0xc8;}else{_0x46fd00=0xce;}_0x51671c[_0x9f15('0x1a')](_0x46fd00);return _0x51671c[_0x9f15('0x20')](_0x9f15('0x21'),_0x57fa6d+'-'+_0x498435+'/'+_0x58f682)[_0x9f15('0x1b')](_0x40ca24);}return null;};}function patchUpdates(_0x4c39b8){return function(_0x32dbaa){try{jsonpatch[_0x9f15('0x22')](_0x32dbaa,_0x4c39b8,!![]);}catch(_0x169fb3){return BPromise['reject'](_0x169fb3);}return _0x32dbaa['save']();};}function saveUpdates(_0x32b730,_0x46207f){return function(_0x393c18){if(_0x393c18){return _0x393c18[_0x9f15('0x23')](_0x32b730)[_0x9f15('0x24')](function(_0x423e7a){return _0x423e7a;});}return null;};}function removeEntity(_0x50ecf6,_0x3564db){return function(_0x17272b){if(_0x17272b){return _0x17272b[_0x9f15('0x25')]()[_0x9f15('0x24')](function(){_0x50ecf6[_0x9f15('0x1a')](0xcc)[_0x9f15('0x26')]();});}};}function handleEntityNotFound(_0x4e9064,_0x2dc4cf){return function(_0x16925e){if(!_0x16925e){_0x4e9064['sendStatus'](0x194);}return _0x16925e;};}function handleError(_0x9c3fe9,_0x5aace7){_0x5aace7=_0x5aace7||0x1f4;return function(_0x286506){logger[_0x9f15('0x27')](_0x286506['stack']);if(_0x286506[_0x9f15('0x28')]){delete _0x286506['name'];}_0x9c3fe9['status'](_0x5aace7)[_0x9f15('0x29')](_0x286506);};}exports[_0x9f15('0x2a')]=function(_0x15c010,_0x2d6993){var _0x4257a0={},_0x78db76={},_0x410452={'count':0x0,'rows':[]};var _0x281b48=_[_0x9f15('0x2b')](db[_0x9f15('0x2c')]['rawAttributes'],function(_0x505bfd){return{'name':_0x505bfd[_0x9f15('0x2d')],'type':_0x505bfd[_0x9f15('0x2e')][_0x9f15('0x2f')]};});_0x78db76[_0x9f15('0x30')]=_['map'](_0x281b48,_0x9f15('0x28'));_0x78db76[_0x9f15('0x31')]=_[_0x9f15('0x32')](_0x15c010[_0x9f15('0x31')]);_0x78db76[_0x9f15('0x33')]=_[_0x9f15('0x34')](_0x78db76['model'],_0x78db76[_0x9f15('0x31')]);_0x4257a0[_0x9f15('0x35')]=_[_0x9f15('0x34')](_0x78db76['model'],qs['fields'](_0x15c010[_0x9f15('0x31')]['fields']));_0x4257a0[_0x9f15('0x35')]=_0x4257a0[_0x9f15('0x35')][_0x9f15('0x36')]?_0x4257a0[_0x9f15('0x35')]:_0x78db76['model'];if(!_0x15c010[_0x9f15('0x31')][_0x9f15('0x37')](_0x9f15('0x38'))){_0x4257a0['limit']=qs['limit'](_0x15c010[_0x9f15('0x31')]['limit']);_0x4257a0[_0x9f15('0x1c')]=qs[_0x9f15('0x1c')](_0x15c010[_0x9f15('0x31')]['offset']);}_0x4257a0[_0x9f15('0x39')]=qs[_0x9f15('0x3a')](_0x15c010[_0x9f15('0x31')][_0x9f15('0x3a')]);_0x4257a0[_0x9f15('0x3b')]=qs[_0x9f15('0x33')](_[_0x9f15('0x3c')](_0x15c010[_0x9f15('0x31')],_0x78db76[_0x9f15('0x33')]),_0x281b48);if(_0x15c010[_0x9f15('0x31')][_0x9f15('0x3d')]){_0x4257a0['where']=_[_0x9f15('0x3e')](_0x4257a0['where'],{'$or':_[_0x9f15('0x2b')](_0x281b48,function(_0xb5a215){if(_0xb5a215[_0x9f15('0x2e')]!==_0x9f15('0x3f')){var _0x555690={};_0x555690[_0xb5a215[_0x9f15('0x28')]]={'$like':'%'+_0x15c010[_0x9f15('0x31')][_0x9f15('0x3d')]+'%'};return _0x555690;}})});}_0x4257a0=_[_0x9f15('0x3e')]({},_0x4257a0,_0x15c010[_0x9f15('0x40')]);var _0x4e9db0={'where':_0x4257a0[_0x9f15('0x3b')]};return db[_0x9f15('0x2c')][_0x9f15('0x1f')](_0x4e9db0)[_0x9f15('0x24')](function(_0x3aaaca){_0x410452['count']=_0x3aaaca;if(_0x15c010[_0x9f15('0x31')][_0x9f15('0x41')]){_0x4257a0[_0x9f15('0x42')]=[{'all':!![]}];}return db[_0x9f15('0x2c')][_0x9f15('0x43')](_0x4257a0);})[_0x9f15('0x24')](function(_0x51b3db){_0x410452['rows']=_0x51b3db;return _0x410452;})['then'](respondWithFilteredResult(_0x2d6993,_0x4257a0))[_0x9f15('0x44')](handleError(_0x2d6993,null));};exports['show']=function(_0x29e232,_0x40b2f3){var _0x338326={'raw':![],'where':{'id':_0x29e232['params']['id']}},_0x434338={};_0x434338[_0x9f15('0x30')]=_[_0x9f15('0x32')](db['AnalyticFieldReport']['rawAttributes']);_0x434338[_0x9f15('0x31')]=_['keys'](_0x29e232[_0x9f15('0x31')]);_0x434338['filters']=_['intersection'](_0x434338['model'],_0x434338[_0x9f15('0x31')]);_0x338326[_0x9f15('0x35')]=_['intersection'](_0x434338[_0x9f15('0x30')],qs[_0x9f15('0x45')](_0x29e232[_0x9f15('0x31')][_0x9f15('0x45')]));_0x338326[_0x9f15('0x35')]=_0x338326[_0x9f15('0x35')][_0x9f15('0x36')]?_0x338326[_0x9f15('0x35')]:_0x434338['model'];if(_0x29e232[_0x9f15('0x31')][_0x9f15('0x41')]){_0x338326[_0x9f15('0x42')]=[{'all':!![]}];}_0x338326=_[_0x9f15('0x3e')]({},_0x338326,_0x29e232[_0x9f15('0x40')]);return db[_0x9f15('0x2c')][_0x9f15('0x46')](_0x338326)['then'](handleEntityNotFound(_0x40b2f3,null))[_0x9f15('0x24')](respondWithResult(_0x40b2f3,null))['catch'](handleError(_0x40b2f3,null));};exports[_0x9f15('0x47')]=function(_0x2e8c99,_0x222bc4){return db['AnalyticFieldReport']['create'](_0x2e8c99[_0x9f15('0x48')],{})['then'](respondWithResult(_0x222bc4,0xc9))[_0x9f15('0x44')](handleError(_0x222bc4,null));};exports[_0x9f15('0x49')]=function(_0x5a6683,_0x489f67){return db[_0x9f15('0x2c')][_0x9f15('0x49')](_0x5a6683[_0x9f15('0x48')],{'raw':![],'individualHooks':!![]})[_0x9f15('0x24')](respondWithResult(_0x489f67,0xc9))['catch'](handleError(_0x489f67,null));};exports[_0x9f15('0x23')]=function(_0x26ba99,_0x2aa147){if(_0x26ba99['body']['id']){delete _0x26ba99['body']['id'];}return db[_0x9f15('0x2c')][_0x9f15('0x46')]({'where':{'id':_0x26ba99['params']['id']}})[_0x9f15('0x24')](handleEntityNotFound(_0x2aa147,null))[_0x9f15('0x24')](saveUpdates(_0x26ba99[_0x9f15('0x48')],null))[_0x9f15('0x24')](respondWithResult(_0x2aa147,null))[_0x9f15('0x44')](handleError(_0x2aa147,null));};exports[_0x9f15('0x25')]=function(_0x3e2bcd,_0x5a3ab6){return db[_0x9f15('0x2c')][_0x9f15('0x46')]({'where':{'id':_0x3e2bcd[_0x9f15('0x4a')]['id']}})[_0x9f15('0x24')](handleEntityNotFound(_0x5a3ab6,null))[_0x9f15('0x24')](removeEntity(_0x5a3ab6,null))[_0x9f15('0x44')](handleError(_0x5a3ab6,null));};exports[_0x9f15('0x4b')]=function(_0x4c0db0,_0x50da71){return db[_0x9f15('0x2c')][_0x9f15('0x25')]({'where':{'id':_0x4c0db0['query'][_0x9f15('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x50da71,0xcc))[_0x9f15('0x44')](handleError(_0x50da71,null));};exports[_0x9f15('0x4d')]=function(_0x2ebee3,_0x2c0780,_0x4c80ee){return db['AnalyticCustomReport'][_0x9f15('0x4e')]({'where':{'id':_0x2ebee3[_0x9f15('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c0780,null))[_0x9f15('0x24')](function(_0xaa72bc){if(_0xaa72bc){return db[_0x9f15('0x4f')][_0x9f15('0x50')](function(_0x56295a){return db['AnalyticFieldReport'][_0x9f15('0x25')]({'where':{'CustomReportId':_0x2ebee3['params']['id']},'transaction':_0x56295a})[_0x9f15('0x24')](function(_0x3376a6){var _0x27d713=_[_0x9f15('0x2b')](_0x2ebee3['body'],function(_0x2685f3){delete _0x2685f3['id'];_0x2685f3['CustomReportId']=_0x2ebee3['params']['id'];return _0x2685f3;});return db[_0x9f15('0x2c')][_0x9f15('0x49')](_0x27d713,{'transaction':_0x56295a});});})[_0x9f15('0x24')](function(){return db[_0x9f15('0x2c')][_0x9f15('0x43')]({'where':{'CustomReportId':_0x2ebee3[_0x9f15('0x4a')]['id']}});});}})['then'](respondWithResult(_0x2c0780,null))[_0x9f15('0x44')](handleError(_0x2c0780,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 055156d..3f62a4d 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x944f=['path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2f143f,_0x4d35ec){var _0x533487=function(_0x33b046){while(--_0x33b046){_0x2f143f['push'](_0x2f143f['shift']());}};_0x533487(++_0x4d35ec);}(_0x944f,0x1b2));var _0xf944=function(_0x5162ed,_0x386cb7){_0x5162ed=_0x5162ed-0x0;var _0x4c579b=_0x944f[_0x5162ed];return _0x4c579b;};'use strict';var _=require(_0xf944('0x0'));var util=require(_0xf944('0x1'));var logger=require(_0xf944('0x2'))(_0xf944('0x3'));var moment=require(_0xf944('0x4'));var BPromise=require('bluebird');var rp=require(_0xf944('0x5'));var fs=require('fs');var path=require(_0xf944('0x6'));var rimraf=require('rimraf');var config=require(_0xf944('0x7'));var attributes=require(_0xf944('0x8'));module['exports']=function(_0x41c5f7,_0x59735e){return _0x41c5f7['define'](_0xf944('0x9'),attributes,{'tableName':_0xf944('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4dde=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x4dde,0xee));var _0xe4dd=function(_0x11cbfd,_0x1c0e80){_0x11cbfd=_0x11cbfd-0x0;var _0x1802de=_0x4dde[_0x11cbfd];return _0x1802de;};'use strict';var _=require(_0xe4dd('0x0'));var util=require(_0xe4dd('0x1'));var logger=require(_0xe4dd('0x2'))(_0xe4dd('0x3'));var moment=require(_0xe4dd('0x4'));var BPromise=require(_0xe4dd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4dd('0x6'));var rimraf=require(_0xe4dd('0x7'));var config=require(_0xe4dd('0x8'));var attributes=require(_0xe4dd('0x9'));module[_0xe4dd('0xa')]=function(_0x3f7c28,_0x5a831e){return _0x3f7c28[_0xe4dd('0xb')](_0xe4dd('0xc'),attributes,{'tableName':_0xe4dd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 2dfa13c..935acec 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4aae=['../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0xe06a66,_0x482fbb){var _0xe78c4=function(_0x45d5b1){while(--_0x45d5b1){_0xe06a66['push'](_0xe06a66['shift']());}};_0xe78c4(++_0x482fbb);}(_0x4aae,0x173));var _0xe4aa=function(_0x1a60ff,_0x496f1f){_0x1a60ff=_0x1a60ff-0x0;var _0x149ec1=_0x4aae[_0x1a60ff];return _0x149ec1;};'use strict';var _=require(_0xe4aa('0x0'));var util=require(_0xe4aa('0x1'));var moment=require('moment');var BPromise=require(_0xe4aa('0x2'));var rs=require(_0xe4aa('0x3'));var fs=require('fs');var Redis=require(_0xe4aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4aa('0x5'));var logger=require('../../config/logger')(_0xe4aa('0x6'));var config=require(_0xe4aa('0x7'));var jayson=require(_0xe4aa('0x8'));var client=jayson[_0xe4aa('0x9')][_0xe4aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11cd15,_0x494a27,_0x165a60){return new BPromise(function(_0x2ea58a,_0x597aff){return client['request'](_0x11cd15,_0x165a60)[_0xe4aa('0xb')](function(_0x566c8a){logger[_0xe4aa('0xc')](_0xe4aa('0xd'),_0x494a27,'request\x20sent');logger['debug'](_0xe4aa('0xe'),_0x494a27,_0xe4aa('0xf'),JSON['stringify'](_0x566c8a));if(_0x566c8a[_0xe4aa('0x10')]){if(_0x566c8a[_0xe4aa('0x10')][_0xe4aa('0x11')]===0x1f4){logger[_0xe4aa('0x10')](_0xe4aa('0xd'),_0x494a27,_0x566c8a[_0xe4aa('0x10')][_0xe4aa('0x12')]);return _0x597aff(_0x566c8a[_0xe4aa('0x10')]['message']);}logger['error'](_0xe4aa('0xd'),_0x494a27,_0x566c8a[_0xe4aa('0x10')][_0xe4aa('0x12')]);return _0x2ea58a(_0x566c8a['error'][_0xe4aa('0x12')]);}else{logger[_0xe4aa('0xc')](_0xe4aa('0xd'),_0x494a27,_0xe4aa('0xf'));_0x2ea58a(_0x566c8a[_0xe4aa('0x13')][_0xe4aa('0x12')]);}})[_0xe4aa('0x14')](function(_0x3a5ea6){logger[_0xe4aa('0x10')](_0xe4aa('0xd'),_0x494a27,_0x3a5ea6);_0x597aff(_0x3a5ea6);});});}
\ No newline at end of file
+var _0x4fe5=['request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x7355ac,_0x14b0d7){var _0x493020=function(_0x468a5d){while(--_0x468a5d){_0x7355ac['push'](_0x7355ac['shift']());}};_0x493020(++_0x14b0d7);}(_0x4fe5,0x1bc));var _0x54fe=function(_0x437672,_0x39f4ca){_0x437672=_0x437672-0x0;var _0x2d7325=_0x4fe5[_0x437672];return _0x2d7325;};'use strict';var _=require(_0x54fe('0x0'));var util=require(_0x54fe('0x1'));var moment=require('moment');var BPromise=require(_0x54fe('0x2'));var rs=require(_0x54fe('0x3'));var fs=require('fs');var Redis=require(_0x54fe('0x4'));var db=require(_0x54fe('0x5'))['db'];var utils=require(_0x54fe('0x6'));var logger=require(_0x54fe('0x7'))(_0x54fe('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x54fe('0x9')][_0x54fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x502966,_0x5a2d65,_0x5a5c85){return new BPromise(function(_0x195c38,_0x2accae){return client['request'](_0x502966,_0x5a5c85)['then'](function(_0x49840e){logger[_0x54fe('0xb')](_0x54fe('0xc'),_0x5a2d65,'request\x20sent');logger[_0x54fe('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5a2d65,'request\x20sent',JSON[_0x54fe('0xe')](_0x49840e));if(_0x49840e[_0x54fe('0xf')]){if(_0x49840e[_0x54fe('0xf')][_0x54fe('0x10')]===0x1f4){logger[_0x54fe('0xf')](_0x54fe('0xc'),_0x5a2d65,_0x49840e[_0x54fe('0xf')][_0x54fe('0x11')]);return _0x2accae(_0x49840e['error'][_0x54fe('0x11')]);}logger['error'](_0x54fe('0xc'),_0x5a2d65,_0x49840e[_0x54fe('0xf')]['message']);return _0x195c38(_0x49840e[_0x54fe('0xf')]['message']);}else{logger[_0x54fe('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a2d65,_0x54fe('0x12'));_0x195c38(_0x49840e[_0x54fe('0x13')][_0x54fe('0x11')]);}})[_0x54fe('0x14')](function(_0x2a844c){logger['error'](_0x54fe('0xc'),_0x5a2d65,_0x2a844c);_0x2accae(_0x2a844c);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index d503997..bda27ed 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x318e4c,_0x5b3136){var _0x3ef92d=function(_0x37b0b0){while(--_0x37b0b0){_0x318e4c['push'](_0x318e4c['shift']());}};_0x3ef92d(++_0x5b3136);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x261197,_0x192ff4){var _0x215d5d=function(_0x292f95){while(--_0x292f95){_0x261197['push'](_0x261197['shift']());}};_0x215d5d(++_0x192ff4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 5ccb4d5..f5a0e61 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5106=['STRING','TEXT','sequelize'];(function(_0xfd800a,_0x31d879){var _0x2e2e5d=function(_0x1cc38d){while(--_0x1cc38d){_0xfd800a['push'](_0xfd800a['shift']());}};_0x2e2e5d(++_0x31d879);}(_0x5106,0x116));var _0x6510=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5106[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x6510('0x0'));module['exports']={'name':{'type':Sequelize[_0x6510('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6510('0x1')]},'metric':{'type':Sequelize[_0x6510('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbfa6=['sequelize','exports','TEXT','STRING'];(function(_0x344af9,_0x585b64){var _0x3409eb=function(_0x4695c2){while(--_0x4695c2){_0x344af9['push'](_0x344af9['shift']());}};_0x3409eb(++_0x585b64);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0x6bbc50,_0x26b8e9){_0x6bbc50=_0x6bbc50-0x0;var _0x5e8e93=_0xbfa6[_0x6bbc50];return _0x5e8e93;};'use strict';var Sequelize=require(_0x6bfa('0x0'));module[_0x6bfa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x6bfa('0x2')]},'description':{'type':Sequelize[_0x6bfa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index e1bb516..c742890 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0xdec228,_0x495d2f){_0xdec228=_0xdec228-0x0;var _0x207ec8=_0x1cb9[_0xdec228];return _0x207ec8;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x36c5f9,_0x12724d){var _0x1962d6=function(_0x55ce5a){while(--_0x55ce5a){_0x36c5f9['push'](_0x36c5f9['shift']());}};_0x1962d6(++_0x12724d);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0xf2ca[_0x4697fa];return _0x390950;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index b113e16..4b4e4b4 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5162=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash'];(function(_0x56a04c,_0xdfd206){var _0x1c8adb=function(_0x107ede){while(--_0x107ede){_0x56a04c['push'](_0x56a04c['shift']());}};_0x1c8adb(++_0xdfd206);}(_0x5162,0x103));var _0x2516=function(_0x40e5e7,_0x5de9fb){_0x40e5e7=_0x40e5e7-0x0;var _0x305d7b=_0x5162[_0x40e5e7];return _0x305d7b;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2516('0x1'));var rp=require(_0x2516('0x2'));var fs=require('fs');var path=require(_0x2516('0x3'));var rimraf=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var attributes=require(_0x2516('0x6'));module[_0x2516('0x7')]=function(_0x5b71b5,_0x48f411){return _0x5b71b5['define'](_0x2516('0x8'),attributes,{'tableName':_0x2516('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2070=['../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','../../config/logger','api','moment','request-promise','path'];(function(_0x14984c,_0xcea18e){var _0x50656e=function(_0x3164e2){while(--_0x3164e2){_0x14984c['push'](_0x14984c['shift']());}};_0x50656e(++_0xcea18e);}(_0x2070,0x1a2));var _0x0207=function(_0x3935da,_0x5b0174){_0x3935da=_0x3935da-0x0;var _0x540bfb=_0x2070[_0x3935da];return _0x540bfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0207('0x0'))(_0x0207('0x1'));var moment=require(_0x0207('0x2'));var BPromise=require('bluebird');var rp=require(_0x0207('0x3'));var fs=require('fs');var path=require(_0x0207('0x4'));var rimraf=require('rimraf');var config=require(_0x0207('0x5'));var attributes=require(_0x0207('0x6'));module['exports']=function(_0x5573e8,_0x5cf734){return _0x5573e8['define'](_0x0207('0x7'),attributes,{'tableName':_0x0207('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index caced7d..90afe1b 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc951=['AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x38254d,_0x19592c){var _0x5ba060=function(_0x51235b){while(--_0x51235b){_0x38254d['push'](_0x38254d['shift']());}};_0x5ba060(++_0x19592c);}(_0xc951,0x16a));var _0x1c95=function(_0xd68469,_0x484c14){_0xd68469=_0xd68469-0x0;var _0x40a9ec=_0xc951[_0xd68469];return _0x40a9ec;};'use strict';var _=require(_0x1c95('0x0'));var util=require(_0x1c95('0x1'));var moment=require(_0x1c95('0x2'));var BPromise=require(_0x1c95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c95('0x5'));var logger=require(_0x1c95('0x6'))(_0x1c95('0x7'));var config=require(_0x1c95('0x8'));var jayson=require(_0x1c95('0x9'));var client=jayson[_0x1c95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17debe,_0x23fe7f,_0xcfeab0){return new BPromise(function(_0x43fd23,_0x4fe4bc){return client[_0x1c95('0xb')](_0x17debe,_0xcfeab0)[_0x1c95('0xc')](function(_0x2daa55){logger[_0x1c95('0xd')](_0x1c95('0xe'),_0x23fe7f,_0x1c95('0xf'));logger['debug'](_0x1c95('0x10'),_0x23fe7f,_0x1c95('0xf'),JSON['stringify'](_0x2daa55));if(_0x2daa55[_0x1c95('0x11')]){if(_0x2daa55[_0x1c95('0x11')][_0x1c95('0x12')]===0x1f4){logger[_0x1c95('0x11')](_0x1c95('0xe'),_0x23fe7f,_0x2daa55['error'][_0x1c95('0x13')]);return _0x4fe4bc(_0x2daa55['error'][_0x1c95('0x13')]);}logger[_0x1c95('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x23fe7f,_0x2daa55[_0x1c95('0x11')][_0x1c95('0x13')]);return _0x43fd23(_0x2daa55[_0x1c95('0x11')][_0x1c95('0x13')]);}else{logger[_0x1c95('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x23fe7f,_0x1c95('0xf'));_0x43fd23(_0x2daa55['result'][_0x1c95('0x13')]);}})[_0x1c95('0x14')](function(_0x4fd66c){logger[_0x1c95('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x23fe7f,_0x4fd66c);_0x4fe4bc(_0x4fd66c);});});}
\ No newline at end of file
+var _0x20a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','AnalyticMetric,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1e9be6,_0x4cee7d){var _0x17d777=function(_0x3245cb){while(--_0x3245cb){_0x1e9be6['push'](_0x1e9be6['shift']());}};_0x17d777(++_0x4cee7d);}(_0x20a7,0x136));var _0x720a=function(_0x8468aa,_0x3303bc){_0x8468aa=_0x8468aa-0x0;var _0x4e15b6=_0x20a7[_0x8468aa];return _0x4e15b6;};'use strict';var _=require(_0x720a('0x0'));var util=require(_0x720a('0x1'));var moment=require('moment');var BPromise=require(_0x720a('0x2'));var rs=require(_0x720a('0x3'));var fs=require('fs');var Redis=require(_0x720a('0x4'));var db=require(_0x720a('0x5'))['db'];var utils=require(_0x720a('0x6'));var logger=require(_0x720a('0x7'))(_0x720a('0x8'));var config=require(_0x720a('0x9'));var jayson=require(_0x720a('0xa'));var client=jayson[_0x720a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x317d23,_0x3c9890,_0xb37d19){return new BPromise(function(_0x4142c3,_0x5370f1){return client[_0x720a('0xc')](_0x317d23,_0xb37d19)['then'](function(_0x3ec02b){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x3c9890,'request\x20sent');logger[_0x720a('0xd')](_0x720a('0xe'),_0x3c9890,_0x720a('0xf'),JSON['stringify'](_0x3ec02b));if(_0x3ec02b[_0x720a('0x10')]){if(_0x3ec02b['error']['code']===0x1f4){logger[_0x720a('0x10')](_0x720a('0x11'),_0x3c9890,_0x3ec02b[_0x720a('0x10')][_0x720a('0x12')]);return _0x5370f1(_0x3ec02b[_0x720a('0x10')][_0x720a('0x12')]);}logger[_0x720a('0x10')](_0x720a('0x11'),_0x3c9890,_0x3ec02b[_0x720a('0x10')][_0x720a('0x12')]);return _0x4142c3(_0x3ec02b[_0x720a('0x10')][_0x720a('0x12')]);}else{logger[_0x720a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3c9890,_0x720a('0xf'));_0x4142c3(_0x3ec02b['result'][_0x720a('0x12')]);}})[_0x720a('0x14')](function(_0x1818c6){logger[_0x720a('0x10')](_0x720a('0x11'),_0x3c9890,_0x1818c6);_0x5370f1(_0x1818c6);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 1a9a2a8..71e17f3 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa48=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xaa48,0x15a));var _0x8aa4=function(_0x3308a9,_0x5a3634){_0x3308a9=_0x3308a9-0x0;var _0x43bb1c=_0xaa48[_0x3308a9];return _0x43bb1c;};'use strict';var multer=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var path=require(_0x8aa4('0x2'));var timeout=require(_0x8aa4('0x3'));var express=require(_0x8aa4('0x4'));var router=express[_0x8aa4('0x5')]();var fs_extra=require(_0x8aa4('0x6'));var auth=require(_0x8aa4('0x7'));var interaction=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var controller=require(_0x8aa4('0xa'));router[_0x8aa4('0xb')]('/',auth[_0x8aa4('0xc')](),controller[_0x8aa4('0xd')]);router[_0x8aa4('0xb')](_0x8aa4('0xe'),auth[_0x8aa4('0xc')](),controller[_0x8aa4('0xf')]);router[_0x8aa4('0x10')]('/',auth['isAuthenticated'](),controller[_0x8aa4('0x11')]);router[_0x8aa4('0x12')]('/:id',auth[_0x8aa4('0xc')](),controller[_0x8aa4('0x13')]);router['delete'](_0x8aa4('0xe'),auth[_0x8aa4('0xc')](),controller[_0x8aa4('0x14')]);module[_0x8aa4('0x15')]=router;
\ No newline at end of file
+var _0xeedf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xeedf,0x12c));var _0xfeed=function(_0x3b8235,_0x481f77){_0x3b8235=_0x3b8235-0x0;var _0x2e8dbc=_0xeedf[_0x3b8235];return _0x2e8dbc;};'use strict';var multer=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var path=require(_0xfeed('0x2'));var timeout=require('connect-timeout');var express=require(_0xfeed('0x3'));var router=express['Router']();var fs_extra=require(_0xfeed('0x4'));var auth=require(_0xfeed('0x5'));var interaction=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var controller=require('./analyticMetric.controller');router[_0xfeed('0x8')]('/',auth[_0xfeed('0x9')](),controller['index']);router[_0xfeed('0x8')]('/:id',auth[_0xfeed('0x9')](),controller['show']);router[_0xfeed('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfeed('0xb'),auth[_0xfeed('0x9')](),controller[_0xfeed('0xc')]);router[_0xfeed('0xd')]('/:id',auth[_0xfeed('0x9')](),controller[_0xfeed('0xe')]);module[_0xfeed('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 519d433..6923dd4 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0216=['exports','TEXT','sequelize'];(function(_0x2ae095,_0x2b9531){var _0x54fee4=function(_0x18e26b){while(--_0x18e26b){_0x2ae095['push'](_0x2ae095['shift']());}};_0x54fee4(++_0x2b9531);}(_0x0216,0x1c4));var _0x6021=function(_0x594f3b,_0x3fe00d){_0x594f3b=_0x594f3b-0x0;var _0x28c2fc=_0x0216[_0x594f3b];return _0x28c2fc;};'use strict';var Sequelize=require(_0x6021('0x0'));module[_0x6021('0x1')]={'tree':{'type':Sequelize[_0x6021('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xca4a=['TEXT','sequelize'];(function(_0x27817b,_0x2f7e80){var _0x11692c=function(_0x30798c){while(--_0x30798c){_0x27817b['push'](_0x27817b['shift']());}};_0x11692c(++_0x2f7e80);}(_0xca4a,0x1cb));var _0xaca4=function(_0xbf5545,_0x2eef97){_0xbf5545=_0xbf5545-0x0;var _0x3e94ce=_0xca4a[_0xbf5545];return _0x3e94ce;};'use strict';var Sequelize=require(_0xaca4('0x0'));module['exports']={'tree':{'type':Sequelize[_0xaca4('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index b29ccfc..1f1fbe8 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf918=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','create','body','update','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xf918,0x119));var _0x8f91=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xf918[_0x31e5cb];return _0x4170df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f91('0x0'));var zipdir=require(_0x8f91('0x1'));var jsonpatch=require(_0x8f91('0x2'));var rp=require(_0x8f91('0x3'));var moment=require(_0x8f91('0x4'));var BPromise=require(_0x8f91('0x5'));var Mustache=require(_0x8f91('0x6'));var util=require(_0x8f91('0x7'));var path=require('path');var sox=require(_0x8f91('0x8'));var csv=require(_0x8f91('0x9'));var ejs=require(_0x8f91('0xa'));var fs=require('fs');var fs_extra=require(_0x8f91('0xb'));var _=require(_0x8f91('0xc'));var squel=require(_0x8f91('0xd'));var crypto=require(_0x8f91('0xe'));var jsforce=require(_0x8f91('0xf'));var deskjs=require(_0x8f91('0x10'));var toCsv=require(_0x8f91('0x9'));var querystring=require(_0x8f91('0x11'));var Papa=require(_0x8f91('0x12'));var Redis=require(_0x8f91('0x13'));var authService=require(_0x8f91('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8f91('0x15'));var hardwareService=require(_0x8f91('0x16'));var logger=require('../../config/logger')(_0x8f91('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8f91('0x18'));var db=require(_0x8f91('0x19'))['db'];function respondWithStatusCode(_0x516484,_0x26b037){_0x26b037=_0x26b037||0xcc;return function(_0x2df993){if(_0x2df993){return _0x516484[_0x8f91('0x1a')](_0x26b037);}return _0x516484[_0x8f91('0x1b')](_0x26b037)[_0x8f91('0x1c')]();};}function respondWithResult(_0x538ffd,_0x20a5c0){_0x20a5c0=_0x20a5c0||0xc8;return function(_0x5252e4){if(_0x5252e4){return _0x538ffd[_0x8f91('0x1b')](_0x20a5c0)[_0x8f91('0x1d')](_0x5252e4);}};}function respondWithFilteredResult(_0x95d58f,_0x183a4c){return function(_0x33b681){if(_0x33b681){var _0x1aea15=typeof _0x183a4c[_0x8f91('0x1e')]===_0x8f91('0x1f')&&typeof _0x183a4c[_0x8f91('0x20')]===_0x8f91('0x1f');var _0x5ae1c5=_0x33b681['count'];var _0x54a8a1=_0x1aea15?0x0:_0x183a4c[_0x8f91('0x1e')];var _0x1084ce=_0x1aea15?_0x33b681[_0x8f91('0x21')]:_0x183a4c[_0x8f91('0x1e')]+_0x183a4c[_0x8f91('0x20')];var _0x5490af;if(_0x1084ce>=_0x5ae1c5){_0x1084ce=_0x5ae1c5;_0x5490af=0xc8;}else{_0x5490af=0xce;}_0x95d58f['status'](_0x5490af);return _0x95d58f[_0x8f91('0x22')](_0x8f91('0x23'),_0x54a8a1+'-'+_0x1084ce+'/'+_0x5ae1c5)[_0x8f91('0x1d')](_0x33b681);}return null;};}function patchUpdates(_0x1cd27b){return function(_0x44defe){try{jsonpatch[_0x8f91('0x24')](_0x44defe,_0x1cd27b,!![]);}catch(_0x2f57bc){return BPromise[_0x8f91('0x25')](_0x2f57bc);}return _0x44defe['save']();};}function saveUpdates(_0x3b8583,_0x3a2d48){return function(_0x33563b){if(_0x33563b){return _0x33563b['update'](_0x3b8583)['then'](function(_0x1383f2){return _0x1383f2;});}return null;};}function removeEntity(_0x269c74,_0x93d39){return function(_0x21a368){if(_0x21a368){return _0x21a368['destroy']()[_0x8f91('0x26')](function(){_0x269c74['status'](0xcc)[_0x8f91('0x1c')]();});}};}function handleEntityNotFound(_0x35a0ca,_0x369640){return function(_0xc124ee){if(!_0xc124ee){_0x35a0ca['sendStatus'](0x194);}return _0xc124ee;};}function handleError(_0xa40ce5,_0x419410){_0x419410=_0x419410||0x1f4;return function(_0x273574){logger['error'](_0x273574[_0x8f91('0x27')]);if(_0x273574[_0x8f91('0x28')]){delete _0x273574['name'];}_0xa40ce5[_0x8f91('0x1b')](_0x419410)['send'](_0x273574);};}exports[_0x8f91('0x29')]=function(_0xbcd02f,_0x3d7c2c){var _0x196a5f={},_0x564ddb={},_0x1b9886={'count':0x0,'rows':[]};var _0x2770f8=_[_0x8f91('0x2a')](db[_0x8f91('0x2b')][_0x8f91('0x2c')],function(_0x3f15c4){return{'name':_0x3f15c4[_0x8f91('0x2d')],'type':_0x3f15c4[_0x8f91('0x2e')][_0x8f91('0x2f')]};});_0x564ddb['model']=_[_0x8f91('0x2a')](_0x2770f8,_0x8f91('0x28'));_0x564ddb[_0x8f91('0x30')]=_[_0x8f91('0x31')](_0xbcd02f[_0x8f91('0x30')]);_0x564ddb[_0x8f91('0x32')]=_[_0x8f91('0x33')](_0x564ddb[_0x8f91('0x34')],_0x564ddb[_0x8f91('0x30')]);_0x196a5f['attributes']=_[_0x8f91('0x33')](_0x564ddb['model'],qs['fields'](_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x35')]));_0x196a5f['attributes']=_0x196a5f['attributes'][_0x8f91('0x36')]?_0x196a5f[_0x8f91('0x37')]:_0x564ddb[_0x8f91('0x34')];if(!_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x38')](_0x8f91('0x39'))){_0x196a5f['limit']=qs[_0x8f91('0x20')](_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x20')]);_0x196a5f[_0x8f91('0x1e')]=qs['offset'](_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x1e')]);}_0x196a5f[_0x8f91('0x3a')]=qs[_0x8f91('0x3b')](_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x3b')]);_0x196a5f[_0x8f91('0x3c')]=qs[_0x8f91('0x32')](_[_0x8f91('0x3d')](_0xbcd02f[_0x8f91('0x30')],_0x564ddb[_0x8f91('0x32')]),_0x2770f8);if(_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x3e')]){_0x196a5f[_0x8f91('0x3c')]=_[_0x8f91('0x3f')](_0x196a5f[_0x8f91('0x3c')],{'$or':_['map'](_0x2770f8,function(_0x16a923){if(_0x16a923[_0x8f91('0x2e')]!==_0x8f91('0x40')){var _0x2eabc4={};_0x2eabc4[_0x16a923[_0x8f91('0x28')]]={'$like':'%'+_0xbcd02f[_0x8f91('0x30')][_0x8f91('0x3e')]+'%'};return _0x2eabc4;}})});}_0x196a5f=_[_0x8f91('0x3f')]({},_0x196a5f,_0xbcd02f['options']);var _0x587d83={'where':_0x196a5f['where']};return db[_0x8f91('0x2b')]['count'](_0x587d83)[_0x8f91('0x26')](function(_0x362715){_0x1b9886[_0x8f91('0x21')]=_0x362715;if(_0xbcd02f['query'][_0x8f91('0x41')]){_0x196a5f['include']=[{'all':!![]}];}return db[_0x8f91('0x2b')][_0x8f91('0x42')](_0x196a5f);})[_0x8f91('0x26')](function(_0x46cff6){_0x1b9886[_0x8f91('0x43')]=_0x46cff6;return _0x1b9886;})[_0x8f91('0x26')](respondWithFilteredResult(_0x3d7c2c,_0x196a5f))[_0x8f91('0x44')](handleError(_0x3d7c2c,null));};exports[_0x8f91('0x45')]=function(_0x52af07,_0x53322a){var _0x3f35e3={'raw':!![],'where':{'id':_0x52af07[_0x8f91('0x46')]['id']}},_0x2dedbc={};_0x2dedbc[_0x8f91('0x34')]=_[_0x8f91('0x31')](db['AnalyticTreeReport'][_0x8f91('0x2c')]);_0x2dedbc['query']=_[_0x8f91('0x31')](_0x52af07[_0x8f91('0x30')]);_0x2dedbc[_0x8f91('0x32')]=_[_0x8f91('0x33')](_0x2dedbc['model'],_0x2dedbc[_0x8f91('0x30')]);_0x3f35e3['attributes']=_[_0x8f91('0x33')](_0x2dedbc[_0x8f91('0x34')],qs[_0x8f91('0x35')](_0x52af07[_0x8f91('0x30')][_0x8f91('0x35')]));_0x3f35e3[_0x8f91('0x37')]=_0x3f35e3[_0x8f91('0x37')][_0x8f91('0x36')]?_0x3f35e3[_0x8f91('0x37')]:_0x2dedbc[_0x8f91('0x34')];if(_0x52af07[_0x8f91('0x30')][_0x8f91('0x41')]){_0x3f35e3[_0x8f91('0x47')]=[{'all':!![]}];}_0x3f35e3=_[_0x8f91('0x3f')]({},_0x3f35e3,_0x52af07['options']);return db[_0x8f91('0x2b')]['find'](_0x3f35e3)['then'](handleEntityNotFound(_0x53322a,null))['then'](respondWithResult(_0x53322a,null))[_0x8f91('0x44')](handleError(_0x53322a,null));};exports['create']=function(_0x3992bd,_0x4d9eda){return db[_0x8f91('0x2b')][_0x8f91('0x48')](_0x3992bd[_0x8f91('0x49')],{})[_0x8f91('0x26')](respondWithResult(_0x4d9eda,0xc9))['catch'](handleError(_0x4d9eda,null));};exports[_0x8f91('0x4a')]=function(_0x2af80e,_0x1135e9){if(_0x2af80e[_0x8f91('0x49')]['id']){delete _0x2af80e[_0x8f91('0x49')]['id'];}return db[_0x8f91('0x2b')]['find']({'where':{'id':_0x2af80e['params']['id']}})['then'](handleEntityNotFound(_0x1135e9,null))[_0x8f91('0x26')](saveUpdates(_0x2af80e[_0x8f91('0x49')],null))[_0x8f91('0x26')](respondWithResult(_0x1135e9,null))['catch'](handleError(_0x1135e9,null));};exports[_0x8f91('0x4b')]=function(_0x43a8b2,_0x3abafd){return db[_0x8f91('0x2b')][_0x8f91('0x4c')]({'where':{'id':_0x43a8b2[_0x8f91('0x46')]['id']}})['then'](handleEntityNotFound(_0x3abafd,null))['then'](removeEntity(_0x3abafd,null))[_0x8f91('0x44')](handleError(_0x3abafd,null));};
\ No newline at end of file
+var _0x3be1=['map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','AnalyticTreeReport','findAll','show','find','create','body','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x3be1,0x1ec));var _0x13be=function(_0x2bed02,_0x4ff3b5){_0x2bed02=_0x2bed02-0x0;var _0x4ec29f=_0x3be1[_0x2bed02];return _0x4ec29f;};'use strict';var emlformat=require(_0x13be('0x0'));var rimraf=require(_0x13be('0x1'));var zipdir=require(_0x13be('0x2'));var jsonpatch=require(_0x13be('0x3'));var rp=require(_0x13be('0x4'));var moment=require(_0x13be('0x5'));var BPromise=require(_0x13be('0x6'));var Mustache=require(_0x13be('0x7'));var util=require(_0x13be('0x8'));var path=require('path');var sox=require(_0x13be('0x9'));var csv=require(_0x13be('0xa'));var ejs=require(_0x13be('0xb'));var fs=require('fs');var fs_extra=require(_0x13be('0xc'));var _=require('lodash');var squel=require(_0x13be('0xd'));var crypto=require(_0x13be('0xe'));var jsforce=require(_0x13be('0xf'));var deskjs=require(_0x13be('0x10'));var toCsv=require(_0x13be('0xa'));var querystring=require(_0x13be('0x11'));var Papa=require('papaparse');var Redis=require(_0x13be('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13be('0x13'));var logger=require(_0x13be('0x14'))('api');var utils=require(_0x13be('0x15'));var config=require(_0x13be('0x16'));var licenseUtil=require(_0x13be('0x17'));var db=require(_0x13be('0x18'))['db'];function respondWithStatusCode(_0x3de531,_0x1996c6){_0x1996c6=_0x1996c6||0xcc;return function(_0x53819b){if(_0x53819b){return _0x3de531['sendStatus'](_0x1996c6);}return _0x3de531[_0x13be('0x19')](_0x1996c6)['end']();};}function respondWithResult(_0x335c61,_0xc27516){_0xc27516=_0xc27516||0xc8;return function(_0x20da7b){if(_0x20da7b){return _0x335c61[_0x13be('0x19')](_0xc27516)['json'](_0x20da7b);}};}function respondWithFilteredResult(_0x860b10,_0x270f5c){return function(_0x56e087){if(_0x56e087){var _0x69ad10=typeof _0x270f5c[_0x13be('0x1a')]===_0x13be('0x1b')&&typeof _0x270f5c[_0x13be('0x1c')]===_0x13be('0x1b');var _0x6ca761=_0x56e087['count'];var _0x274849=_0x69ad10?0x0:_0x270f5c[_0x13be('0x1a')];var _0x7a72d4=_0x69ad10?_0x56e087[_0x13be('0x1d')]:_0x270f5c[_0x13be('0x1a')]+_0x270f5c[_0x13be('0x1c')];var _0x4e160b;if(_0x7a72d4>=_0x6ca761){_0x7a72d4=_0x6ca761;_0x4e160b=0xc8;}else{_0x4e160b=0xce;}_0x860b10['status'](_0x4e160b);return _0x860b10[_0x13be('0x1e')]('Content-Range',_0x274849+'-'+_0x7a72d4+'/'+_0x6ca761)[_0x13be('0x1f')](_0x56e087);}return null;};}function patchUpdates(_0x18c60e){return function(_0x4027f0){try{jsonpatch[_0x13be('0x20')](_0x4027f0,_0x18c60e,!![]);}catch(_0x24ec10){return BPromise[_0x13be('0x21')](_0x24ec10);}return _0x4027f0[_0x13be('0x22')]();};}function saveUpdates(_0x1a9375,_0x51118a){return function(_0x495e57){if(_0x495e57){return _0x495e57[_0x13be('0x23')](_0x1a9375)[_0x13be('0x24')](function(_0x25be50){return _0x25be50;});}return null;};}function removeEntity(_0x1209a6,_0x43bed3){return function(_0x36f2cb){if(_0x36f2cb){return _0x36f2cb['destroy']()[_0x13be('0x24')](function(){_0x1209a6['status'](0xcc)[_0x13be('0x25')]();});}};}function handleEntityNotFound(_0x1f64d5,_0x13ccba){return function(_0x3e8747){if(!_0x3e8747){_0x1f64d5[_0x13be('0x26')](0x194);}return _0x3e8747;};}function handleError(_0x52162d,_0x230200){_0x230200=_0x230200||0x1f4;return function(_0x4e6381){logger['error'](_0x4e6381[_0x13be('0x27')]);if(_0x4e6381[_0x13be('0x28')]){delete _0x4e6381['name'];}_0x52162d[_0x13be('0x19')](_0x230200)[_0x13be('0x29')](_0x4e6381);};}exports[_0x13be('0x2a')]=function(_0x18ac07,_0x5591a5){var _0x6dd257={},_0x4c84da={},_0x4f2d63={'count':0x0,'rows':[]};var _0x385f11=_['map'](db['AnalyticTreeReport'][_0x13be('0x2b')],function(_0x2d66ad){return{'name':_0x2d66ad[_0x13be('0x2c')],'type':_0x2d66ad[_0x13be('0x2d')][_0x13be('0x2e')]};});_0x4c84da['model']=_[_0x13be('0x2f')](_0x385f11,'name');_0x4c84da['query']=_[_0x13be('0x30')](_0x18ac07[_0x13be('0x31')]);_0x4c84da['filters']=_[_0x13be('0x32')](_0x4c84da[_0x13be('0x33')],_0x4c84da[_0x13be('0x31')]);_0x6dd257[_0x13be('0x34')]=_[_0x13be('0x32')](_0x4c84da['model'],qs[_0x13be('0x35')](_0x18ac07[_0x13be('0x31')][_0x13be('0x35')]));_0x6dd257[_0x13be('0x34')]=_0x6dd257[_0x13be('0x34')][_0x13be('0x36')]?_0x6dd257[_0x13be('0x34')]:_0x4c84da[_0x13be('0x33')];if(!_0x18ac07[_0x13be('0x31')][_0x13be('0x37')](_0x13be('0x38'))){_0x6dd257[_0x13be('0x1c')]=qs['limit'](_0x18ac07[_0x13be('0x31')][_0x13be('0x1c')]);_0x6dd257[_0x13be('0x1a')]=qs['offset'](_0x18ac07[_0x13be('0x31')][_0x13be('0x1a')]);}_0x6dd257[_0x13be('0x39')]=qs[_0x13be('0x3a')](_0x18ac07[_0x13be('0x31')][_0x13be('0x3a')]);_0x6dd257[_0x13be('0x3b')]=qs[_0x13be('0x3c')](_[_0x13be('0x3d')](_0x18ac07[_0x13be('0x31')],_0x4c84da[_0x13be('0x3c')]),_0x385f11);if(_0x18ac07[_0x13be('0x31')][_0x13be('0x3e')]){_0x6dd257[_0x13be('0x3b')]=_['merge'](_0x6dd257[_0x13be('0x3b')],{'$or':_[_0x13be('0x2f')](_0x385f11,function(_0x186514){if(_0x186514['type']!==_0x13be('0x3f')){var _0x5919b3={};_0x5919b3[_0x186514[_0x13be('0x28')]]={'$like':'%'+_0x18ac07[_0x13be('0x31')][_0x13be('0x3e')]+'%'};return _0x5919b3;}})});}_0x6dd257=_[_0x13be('0x40')]({},_0x6dd257,_0x18ac07[_0x13be('0x41')]);var _0x113dd6={'where':_0x6dd257[_0x13be('0x3b')]};return db['AnalyticTreeReport']['count'](_0x113dd6)[_0x13be('0x24')](function(_0x22b970){_0x4f2d63[_0x13be('0x1d')]=_0x22b970;if(_0x18ac07[_0x13be('0x31')][_0x13be('0x42')]){_0x6dd257[_0x13be('0x43')]=[{'all':!![]}];}return db[_0x13be('0x44')][_0x13be('0x45')](_0x6dd257);})['then'](function(_0x5afa1d){_0x4f2d63['rows']=_0x5afa1d;return _0x4f2d63;})[_0x13be('0x24')](respondWithFilteredResult(_0x5591a5,_0x6dd257))['catch'](handleError(_0x5591a5,null));};exports[_0x13be('0x46')]=function(_0x594973,_0x4f31e0){var _0x29ad5b={'raw':!![],'where':{'id':_0x594973['params']['id']}},_0x1c239a={};_0x1c239a[_0x13be('0x33')]=_[_0x13be('0x30')](db[_0x13be('0x44')]['rawAttributes']);_0x1c239a[_0x13be('0x31')]=_['keys'](_0x594973[_0x13be('0x31')]);_0x1c239a[_0x13be('0x3c')]=_[_0x13be('0x32')](_0x1c239a['model'],_0x1c239a[_0x13be('0x31')]);_0x29ad5b[_0x13be('0x34')]=_['intersection'](_0x1c239a['model'],qs[_0x13be('0x35')](_0x594973[_0x13be('0x31')][_0x13be('0x35')]));_0x29ad5b[_0x13be('0x34')]=_0x29ad5b[_0x13be('0x34')][_0x13be('0x36')]?_0x29ad5b[_0x13be('0x34')]:_0x1c239a[_0x13be('0x33')];if(_0x594973[_0x13be('0x31')][_0x13be('0x42')]){_0x29ad5b[_0x13be('0x43')]=[{'all':!![]}];}_0x29ad5b=_[_0x13be('0x40')]({},_0x29ad5b,_0x594973['options']);return db[_0x13be('0x44')][_0x13be('0x47')](_0x29ad5b)[_0x13be('0x24')](handleEntityNotFound(_0x4f31e0,null))['then'](respondWithResult(_0x4f31e0,null))['catch'](handleError(_0x4f31e0,null));};exports[_0x13be('0x48')]=function(_0x1c38fd,_0x339926){return db[_0x13be('0x44')][_0x13be('0x48')](_0x1c38fd[_0x13be('0x49')],{})[_0x13be('0x24')](respondWithResult(_0x339926,0xc9))['catch'](handleError(_0x339926,null));};exports['update']=function(_0x506615,_0x1b47df){if(_0x506615[_0x13be('0x49')]['id']){delete _0x506615[_0x13be('0x49')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x506615[_0x13be('0x4a')]['id']}})[_0x13be('0x24')](handleEntityNotFound(_0x1b47df,null))[_0x13be('0x24')](saveUpdates(_0x506615[_0x13be('0x49')],null))['then'](respondWithResult(_0x1b47df,null))[_0x13be('0x4b')](handleError(_0x1b47df,null));};exports[_0x13be('0x4c')]=function(_0x3b8fee,_0x2d90db){return db[_0x13be('0x44')]['find']({'where':{'id':_0x3b8fee[_0x13be('0x4a')]['id']}})[_0x13be('0x24')](handleEntityNotFound(_0x2d90db,null))[_0x13be('0x24')](removeEntity(_0x2d90db,null))[_0x13be('0x4b')](handleError(_0x2d90db,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6bbe673..0711d7a 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1389=['moment','bluebird','request-promise','path','rimraf','exports','define','analytics_report_trees','lodash','util','api'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x1389,0x15d));var _0x9138=function(_0x5f4f70,_0x2d43da){_0x5f4f70=_0x5f4f70-0x0;var _0x41eb21=_0x1389[_0x5f4f70];return _0x41eb21;};'use strict';var _=require(_0x9138('0x0'));var util=require(_0x9138('0x1'));var logger=require('../../config/logger')(_0x9138('0x2'));var moment=require(_0x9138('0x3'));var BPromise=require(_0x9138('0x4'));var rp=require(_0x9138('0x5'));var fs=require('fs');var path=require(_0x9138('0x6'));var rimraf=require(_0x9138('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x9138('0x8')]=function(_0x523b17,_0xfc4b7b){return _0x523b17[_0x9138('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x9138('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x031d=['request-promise','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird'];(function(_0x22052d,_0x3dd47b){var _0x2eee04=function(_0x15a86a){while(--_0x15a86a){_0x22052d['push'](_0x22052d['shift']());}};_0x2eee04(++_0x3dd47b);}(_0x031d,0x7f));var _0xd031=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x031d[_0x349148];return _0x2f2b0f;};'use strict';var _=require(_0xd031('0x0'));var util=require('util');var logger=require(_0xd031('0x1'))(_0xd031('0x2'));var moment=require(_0xd031('0x3'));var BPromise=require(_0xd031('0x4'));var rp=require(_0xd031('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd031('0x6'));var config=require(_0xd031('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xd031('0x8')]=function(_0x24b9fc,_0x311f3a){return _0x24b9fc[_0xd031('0x9')](_0xd031('0xa'),attributes,{'tableName':_0xd031('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 933a739..ccb89ec 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x29d68f,_0x59da10){var _0x262d38=function(_0xfd78b6){while(--_0xfd78b6){_0x29d68f['push'](_0x29d68f['shift']());}};_0x262d38(++_0x59da10);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ef502,_0x1bdce1){_0x3ef502=_0x3ef502-0x0;var _0x2aed15=_0x5f2f[_0x3ef502];return _0x2aed15;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3e9f1b,_0x2d060){var _0x20f0c2=function(_0x4649b0){while(--_0x4649b0){_0x3e9f1b['push'](_0x3e9f1b['shift']());}};_0x20f0c2(++_0x2d060);}(_0xdb28,0x106));var _0x8db2=function(_0x42059d,_0x3a7ad9){_0x42059d=_0x42059d-0x0;var _0x3b6e13=_0xdb28[_0x42059d];return _0x3b6e13;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 362c7ec..85bc528 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e5e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','update','delete','destroy'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x9e5e,0x1f4));var _0xe9e5=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x9e5e[_0x59d89e];return _0x554e93;};'use strict';var multer=require(_0xe9e5('0x0'));var util=require(_0xe9e5('0x1'));var path=require(_0xe9e5('0x2'));var timeout=require(_0xe9e5('0x3'));var express=require(_0xe9e5('0x4'));var router=express[_0xe9e5('0x5')]();var fs_extra=require(_0xe9e5('0x6'));var auth=require(_0xe9e5('0x7'));var interaction=require(_0xe9e5('0x8'));var config=require('../../config/environment');var controller=require(_0xe9e5('0x9'));router[_0xe9e5('0xa')]('/',auth[_0xe9e5('0xb')](),controller[_0xe9e5('0xc')]);router['get']('/:id',auth[_0xe9e5('0xb')](),controller[_0xe9e5('0xd')]);router[_0xe9e5('0xe')]('/',auth['isAuthenticated'](),controller[_0xe9e5('0xf')]);router[_0xe9e5('0x10')]('/:id',auth[_0xe9e5('0xb')](),controller[_0xe9e5('0x11')]);router[_0xe9e5('0x12')]('/:id',auth[_0xe9e5('0xb')](),controller[_0xe9e5('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x152f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','path','express'];(function(_0x184747,_0x18425e){var _0x36277d=function(_0x54b207){while(--_0x54b207){_0x184747['push'](_0x184747['shift']());}};_0x36277d(++_0x18425e);}(_0x152f,0x13f));var _0xf152=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x152f[_0x1eda20];return _0x31b953;};'use strict';var multer=require(_0xf152('0x0'));var util=require(_0xf152('0x1'));var path=require(_0xf152('0x2'));var timeout=require('connect-timeout');var express=require(_0xf152('0x3'));var router=express[_0xf152('0x4')]();var fs_extra=require(_0xf152('0x5'));var auth=require(_0xf152('0x6'));var interaction=require(_0xf152('0x7'));var config=require(_0xf152('0x8'));var controller=require(_0xf152('0x9'));router[_0xf152('0xa')]('/',auth[_0xf152('0xb')](),controller['index']);router['get'](_0xf152('0xc'),auth['isAuthenticated'](),controller[_0xf152('0xd')]);router[_0xf152('0xe')]('/',auth[_0xf152('0xb')](),controller[_0xf152('0xf')]);router[_0xf152('0x10')](_0xf152('0xc'),auth[_0xf152('0xb')](),controller['update']);router['delete'](_0xf152('0xc'),auth[_0xf152('0xb')](),controller[_0xf152('0x11')]);module[_0xf152('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 1373fb3..e08cf87 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x90ae=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90ae,0x195));var _0xe90a=function(_0x45fe84,_0x35f6cf){_0x45fe84=_0x45fe84-0x0;var _0x333f98=_0x90ae[_0x45fe84];return _0x333f98;};'use strict';var Sequelize=require(_0xe90a('0x0'));module[_0xe90a('0x1')]={'name':{'type':Sequelize[_0xe90a('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe90a('0x2')]}};
\ No newline at end of file
+var _0x01d3=['STRING'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x01d3,0xdb));var _0x301d=function(_0x2f2ea6,_0x1b3c35){_0x2f2ea6=_0x2f2ea6-0x0;var _0xc8ec68=_0x01d3[_0x2f2ea6];return _0xc8ec68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x301d('0x0')]},'basename':{'type':Sequelize[_0x301d('0x0')]},'type':{'type':Sequelize[_0x301d('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9192c36..3698093 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdb2=['filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','Attachment','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','catch','clone','get','omit','createdAt','body','updatedAt','create','file','originalname','basename'];(function(_0x4694c3,_0x296f2d){var _0x2ef3c1=function(_0x54cadb){while(--_0x54cadb){_0x4694c3['push'](_0x4694c3['shift']());}};_0x2ef3c1(++_0x296f2d);}(_0xbdb2,0x11d));var _0x2bdb=function(_0x105d3a,_0x3fd40b){_0x105d3a=_0x105d3a-0x0;var _0x2bd5df=_0xbdb2[_0x105d3a];return _0x2bd5df;};'use strict';var emlformat=require(_0x2bdb('0x0'));var rimraf=require(_0x2bdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2bdb('0x2'));var rp=require(_0x2bdb('0x3'));var moment=require(_0x2bdb('0x4'));var BPromise=require(_0x2bdb('0x5'));var Mustache=require(_0x2bdb('0x6'));var util=require(_0x2bdb('0x7'));var path=require(_0x2bdb('0x8'));var sox=require('sox');var csv=require(_0x2bdb('0x9'));var ejs=require(_0x2bdb('0xa'));var fs=require('fs');var fs_extra=require(_0x2bdb('0xb'));var _=require(_0x2bdb('0xc'));var squel=require('squel');var crypto=require(_0x2bdb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2bdb('0xe'));var toCsv=require(_0x2bdb('0x9'));var querystring=require(_0x2bdb('0xf'));var Papa=require(_0x2bdb('0x10'));var Redis=require(_0x2bdb('0x11'));var authService=require(_0x2bdb('0x12'));var qs=require(_0x2bdb('0x13'));var as=require(_0x2bdb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bdb('0x15'))(_0x2bdb('0x16'));var utils=require(_0x2bdb('0x17'));var config=require(_0x2bdb('0x18'));var licenseUtil=require(_0x2bdb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x456735,_0x7fb652){_0x7fb652=_0x7fb652||0xcc;return function(_0x59fab6){if(_0x59fab6){return _0x456735['sendStatus'](_0x7fb652);}return _0x456735['status'](_0x7fb652)[_0x2bdb('0x1a')]();};}function respondWithResult(_0x42bd62,_0x2aa5fc){_0x2aa5fc=_0x2aa5fc||0xc8;return function(_0x2b6238){if(_0x2b6238){return _0x42bd62[_0x2bdb('0x1b')](_0x2aa5fc)[_0x2bdb('0x1c')](_0x2b6238);}};}function respondWithFilteredResult(_0xcef8bc,_0x1bdd48){return function(_0x58363b){if(_0x58363b){var _0x4dfea6=typeof _0x1bdd48[_0x2bdb('0x1d')]==='undefined'&&typeof _0x1bdd48[_0x2bdb('0x1e')]==='undefined';var _0x20100a=_0x58363b[_0x2bdb('0x1f')];var _0x2748ac=_0x4dfea6?0x0:_0x1bdd48[_0x2bdb('0x1d')];var _0x106284=_0x4dfea6?_0x58363b[_0x2bdb('0x1f')]:_0x1bdd48[_0x2bdb('0x1d')]+_0x1bdd48[_0x2bdb('0x1e')];var _0x174b96;if(_0x106284>=_0x20100a){_0x106284=_0x20100a;_0x174b96=0xc8;}else{_0x174b96=0xce;}_0xcef8bc[_0x2bdb('0x1b')](_0x174b96);return _0xcef8bc['set']('Content-Range',_0x2748ac+'-'+_0x106284+'/'+_0x20100a)[_0x2bdb('0x1c')](_0x58363b);}return null;};}function patchUpdates(_0x3856dd){return function(_0x28db7c){try{jsonpatch[_0x2bdb('0x20')](_0x28db7c,_0x3856dd,!![]);}catch(_0x3f146e){return BPromise[_0x2bdb('0x21')](_0x3f146e);}return _0x28db7c[_0x2bdb('0x22')]();};}function saveUpdates(_0x2053ad,_0x5eb2ed){return function(_0xe48575){if(_0xe48575){return _0xe48575[_0x2bdb('0x23')](_0x2053ad)[_0x2bdb('0x24')](function(_0x508699){return _0x508699;});}return null;};}function removeEntity(_0xbb9adb,_0x5b278c){return function(_0x1d267d){if(_0x1d267d){return _0x1d267d[_0x2bdb('0x25')]()[_0x2bdb('0x24')](function(){_0xbb9adb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a17e7,_0x8700a7){return function(_0x13d7dd){if(!_0x13d7dd){_0x1a17e7[_0x2bdb('0x26')](0x194);}return _0x13d7dd;};}function handleError(_0x378f05,_0x1722a1){_0x1722a1=_0x1722a1||0x1f4;return function(_0x193a32){logger[_0x2bdb('0x27')](_0x193a32['stack']);if(_0x193a32[_0x2bdb('0x28')]){delete _0x193a32['name'];}_0x378f05['status'](_0x1722a1)[_0x2bdb('0x29')](_0x193a32);};}exports[_0x2bdb('0x2a')]=function(_0x42eabd,_0x2a5af7){var _0x4ee088={},_0x13f09d={},_0x5dffeb={'count':0x0,'rows':[]};var _0x732882=_[_0x2bdb('0x2b')](db['Attachment']['rawAttributes'],function(_0x3cbe90){return{'name':_0x3cbe90[_0x2bdb('0x2c')],'type':_0x3cbe90[_0x2bdb('0x2d')]['key']};});_0x13f09d[_0x2bdb('0x2e')]=_['map'](_0x732882,'name');_0x13f09d[_0x2bdb('0x2f')]=_['keys'](_0x42eabd['query']);_0x13f09d[_0x2bdb('0x30')]=_['intersection'](_0x13f09d['model'],_0x13f09d[_0x2bdb('0x2f')]);_0x4ee088[_0x2bdb('0x31')]=_[_0x2bdb('0x32')](_0x13f09d[_0x2bdb('0x2e')],qs[_0x2bdb('0x33')](_0x42eabd['query']['fields']));_0x4ee088['attributes']=_0x4ee088[_0x2bdb('0x31')][_0x2bdb('0x34')]?_0x4ee088[_0x2bdb('0x31')]:_0x13f09d[_0x2bdb('0x2e')];if(!_0x42eabd['query'][_0x2bdb('0x35')]('nolimit')){_0x4ee088[_0x2bdb('0x1e')]=qs[_0x2bdb('0x1e')](_0x42eabd['query']['limit']);_0x4ee088[_0x2bdb('0x1d')]=qs[_0x2bdb('0x1d')](_0x42eabd[_0x2bdb('0x2f')][_0x2bdb('0x1d')]);}_0x4ee088[_0x2bdb('0x36')]=qs[_0x2bdb('0x37')](_0x42eabd['query'][_0x2bdb('0x37')]);_0x4ee088[_0x2bdb('0x38')]=qs[_0x2bdb('0x30')](_[_0x2bdb('0x39')](_0x42eabd['query'],_0x13f09d[_0x2bdb('0x30')]),_0x732882);if(_0x42eabd['query'][_0x2bdb('0x3a')]){_0x4ee088[_0x2bdb('0x38')]=_[_0x2bdb('0x3b')](_0x4ee088['where'],{'$or':_[_0x2bdb('0x2b')](_0x732882,function(_0x51314a){if(_0x51314a['type']!==_0x2bdb('0x3c')){var _0x4b48a5={};_0x4b48a5[_0x51314a[_0x2bdb('0x28')]]={'$like':'%'+_0x42eabd[_0x2bdb('0x2f')][_0x2bdb('0x3a')]+'%'};return _0x4b48a5;}})});}_0x4ee088=_[_0x2bdb('0x3b')]({},_0x4ee088,_0x42eabd['options']);var _0x4c73af={'where':_0x4ee088[_0x2bdb('0x38')]};return db[_0x2bdb('0x3d')][_0x2bdb('0x1f')](_0x4c73af)[_0x2bdb('0x24')](function(_0xd2b2ea){_0x5dffeb[_0x2bdb('0x1f')]=_0xd2b2ea;if(_0x42eabd[_0x2bdb('0x2f')][_0x2bdb('0x3e')]){_0x4ee088[_0x2bdb('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x2bdb('0x40')](_0x4ee088);})[_0x2bdb('0x24')](function(_0x1cb503){_0x5dffeb[_0x2bdb('0x41')]=_0x1cb503;return _0x5dffeb;})[_0x2bdb('0x24')](respondWithFilteredResult(_0x2a5af7,_0x4ee088))['catch'](handleError(_0x2a5af7,null));};exports[_0x2bdb('0x42')]=function(_0x3e5013,_0x293a94){var _0x34e785={'raw':!![],'where':{'id':_0x3e5013[_0x2bdb('0x43')]['id']}},_0x244039={};_0x244039[_0x2bdb('0x2e')]=_[_0x2bdb('0x44')](db[_0x2bdb('0x3d')][_0x2bdb('0x45')]);_0x244039['query']=_['keys'](_0x3e5013[_0x2bdb('0x2f')]);_0x244039[_0x2bdb('0x30')]=_[_0x2bdb('0x32')](_0x244039[_0x2bdb('0x2e')],_0x244039[_0x2bdb('0x2f')]);_0x34e785[_0x2bdb('0x31')]=_[_0x2bdb('0x32')](_0x244039['model'],qs[_0x2bdb('0x33')](_0x3e5013['query']['fields']));_0x34e785[_0x2bdb('0x31')]=_0x34e785[_0x2bdb('0x31')][_0x2bdb('0x34')]?_0x34e785[_0x2bdb('0x31')]:_0x244039['model'];if(_0x3e5013[_0x2bdb('0x2f')]['includeAll']){_0x34e785['include']=[{'all':!![]}];}_0x34e785=_[_0x2bdb('0x3b')]({},_0x34e785,_0x3e5013[_0x2bdb('0x46')]);return db[_0x2bdb('0x3d')][_0x2bdb('0x47')](_0x34e785)[_0x2bdb('0x24')](handleEntityNotFound(_0x293a94,null))[_0x2bdb('0x24')](respondWithResult(_0x293a94,null))[_0x2bdb('0x48')](handleError(_0x293a94,null));};exports[_0x2bdb('0x49')]=function(_0x3efd24,_0x12911f){var _0x20833d={'where':{'id':_0x3efd24[_0x2bdb('0x43')]['id']}},_0x21e356={};_0x21e356['model']=_[_0x2bdb('0x44')](db[_0x2bdb('0x3d')][_0x2bdb('0x45')]);_0x20833d[_0x2bdb('0x31')]=_[_0x2bdb('0x32')](_0x21e356['model'],qs[_0x2bdb('0x33')](_0x3efd24[_0x2bdb('0x2f')][_0x2bdb('0x33')]));_0x20833d[_0x2bdb('0x31')]=_0x20833d[_0x2bdb('0x31')][_0x2bdb('0x34')]?_0x20833d[_0x2bdb('0x31')]:_0x21e356[_0x2bdb('0x2e')];if(_0x3efd24['query'][_0x2bdb('0x3e')]){_0x20833d[_0x2bdb('0x3f')]=[{'all':!![]}];}_0x20833d=_[_0x2bdb('0x3b')]({},_0x20833d,_0x3efd24[_0x2bdb('0x46')]);return db['Attachment']['find'](_0x20833d)['then'](handleEntityNotFound(_0x12911f,null))[_0x2bdb('0x24')](function(_0x235185){if(_0x235185){var _0x5479fb=_0x235185[_0x2bdb('0x4a')]({'plain':!![]});_0x5479fb=qs[_0x2bdb('0x4b')](_0x5479fb,['id',_0x2bdb('0x4c'),'updatedAt']);_0x3efd24[_0x2bdb('0x4d')]=_[_0x2bdb('0x4b')](_0x3efd24['body'],['id',_0x2bdb('0x4c'),_0x2bdb('0x4e')]);return db['Attachment'][_0x2bdb('0x4f')](_[_0x2bdb('0x3b')](_0x5479fb,_0x3efd24['body']),{'include':_0x3efd24[_0x2bdb('0x2f')][_0x2bdb('0x3e')]?[{'all':!![]}]:undefined});}})[_0x2bdb('0x24')](respondWithResult(_0x12911f,0xc9))[_0x2bdb('0x48')](handleError(_0x12911f,null));};exports['update']=function(_0x10c1bb,_0xb1b6ce){if(_0x10c1bb['body']['id']){delete _0x10c1bb[_0x2bdb('0x4d')]['id'];}return db[_0x2bdb('0x3d')][_0x2bdb('0x47')]({'where':{'id':_0x10c1bb[_0x2bdb('0x43')]['id']}})['then'](handleEntityNotFound(_0xb1b6ce,null))[_0x2bdb('0x24')](saveUpdates(_0x10c1bb[_0x2bdb('0x4d')],null))[_0x2bdb('0x24')](respondWithResult(_0xb1b6ce,null))[_0x2bdb('0x48')](handleError(_0xb1b6ce,null));};exports[_0x2bdb('0x25')]=function(_0x1e8341,_0x4a84f7){return db['Attachment']['find']({'where':{'id':_0x1e8341[_0x2bdb('0x43')]['id']}})[_0x2bdb('0x24')](handleEntityNotFound(_0x4a84f7,null))[_0x2bdb('0x24')](removeEntity(_0x4a84f7,null))[_0x2bdb('0x48')](handleError(_0x4a84f7,null));};exports[_0x2bdb('0x4f')]=function(_0xa3ccf8,_0x131b30,_0x31f2e8){_0xa3ccf8[_0x2bdb('0x4d')][_0x2bdb('0x28')]=_0xa3ccf8[_0x2bdb('0x50')][_0x2bdb('0x51')];_0xa3ccf8[_0x2bdb('0x4d')][_0x2bdb('0x52')]=_0xa3ccf8[_0x2bdb('0x50')][_0x2bdb('0x53')];_0xa3ccf8['body'][_0x2bdb('0x2d')]=_0xa3ccf8['file'][_0x2bdb('0x54')];return db[_0x2bdb('0x3d')]['create'](_0xa3ccf8[_0x2bdb('0x4d')])[_0x2bdb('0x24')](respondWithResult(_0x131b30,0xc9))[_0x2bdb('0x48')](handleError(_0x131b30,null));};exports[_0x2bdb('0x55')]=function(_0x3698f0,_0x33c36e,_0x7cfa41){return db[_0x2bdb('0x3d')][_0x2bdb('0x56')]({'where':{'id':_0x3698f0[_0x2bdb('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33c36e,null))[_0x2bdb('0x24')](function(_0x1a5a42){if(_0x1a5a42){var _0x251552=_0x1a5a42[_0x2bdb('0x57')]!==null;var _0x34d905=path[_0x2bdb('0x58')](config[_0x2bdb('0x59')],_0x2bdb('0x5a'));if(_0x251552){_0x34d905=path[_0x2bdb('0x58')](_0x34d905,_0x2bdb('0x5b'));}var _0x3f7dda=path['join'](_0x34d905,_0x1a5a42[_0x2bdb('0x52')]);return _0x33c36e[_0x2bdb('0x55')](_0x3f7dda);}})[_0x2bdb('0x48')](handleError(_0x33c36e,null));};
\ No newline at end of file
+var _0x6f7b=['order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','clone','find','omit','createdAt','updatedAt','body','create','update','params','destroy','file','filename','mimetype','findOne','root','join','offline-chat/','basename','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','name','index','map','Attachment','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f7b,0x7b));var _0xb6f7=function(_0x27df38,_0x32161b){_0x27df38=_0x27df38-0x0;var _0x29c174=_0x6f7b[_0x27df38];return _0x29c174;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6f7('0x0'));var zipdir=require(_0xb6f7('0x1'));var jsonpatch=require(_0xb6f7('0x2'));var rp=require(_0xb6f7('0x3'));var moment=require(_0xb6f7('0x4'));var BPromise=require(_0xb6f7('0x5'));var Mustache=require(_0xb6f7('0x6'));var util=require(_0xb6f7('0x7'));var path=require(_0xb6f7('0x8'));var sox=require(_0xb6f7('0x9'));var csv=require('to-csv');var ejs=require(_0xb6f7('0xa'));var fs=require('fs');var fs_extra=require(_0xb6f7('0xb'));var _=require(_0xb6f7('0xc'));var squel=require(_0xb6f7('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6f7('0xe'));var deskjs=require(_0xb6f7('0xf'));var toCsv=require(_0xb6f7('0x10'));var querystring=require('querystring');var Papa=require(_0xb6f7('0x11'));var Redis=require(_0xb6f7('0x12'));var authService=require(_0xb6f7('0x13'));var qs=require(_0xb6f7('0x14'));var as=require(_0xb6f7('0x15'));var hardwareService=require(_0xb6f7('0x16'));var logger=require('../../config/logger')(_0xb6f7('0x17'));var utils=require(_0xb6f7('0x18'));var config=require(_0xb6f7('0x19'));var licenseUtil=require(_0xb6f7('0x1a'));var db=require(_0xb6f7('0x1b'))['db'];function respondWithStatusCode(_0x1f92a2,_0x5470b8){_0x5470b8=_0x5470b8||0xcc;return function(_0x577bd6){if(_0x577bd6){return _0x1f92a2[_0xb6f7('0x1c')](_0x5470b8);}return _0x1f92a2[_0xb6f7('0x1d')](_0x5470b8)[_0xb6f7('0x1e')]();};}function respondWithResult(_0x185bb4,_0x5baee4){_0x5baee4=_0x5baee4||0xc8;return function(_0x214aa5){if(_0x214aa5){return _0x185bb4[_0xb6f7('0x1d')](_0x5baee4)[_0xb6f7('0x1f')](_0x214aa5);}};}function respondWithFilteredResult(_0x23970e,_0x306830){return function(_0x5a1ce9){if(_0x5a1ce9){var _0x468e1e=typeof _0x306830[_0xb6f7('0x20')]===_0xb6f7('0x21')&&typeof _0x306830[_0xb6f7('0x22')]==='undefined';var _0x10670f=_0x5a1ce9['count'];var _0xbf9760=_0x468e1e?0x0:_0x306830[_0xb6f7('0x20')];var _0x1d5d4b=_0x468e1e?_0x5a1ce9[_0xb6f7('0x23')]:_0x306830['offset']+_0x306830[_0xb6f7('0x22')];var _0x56180a;if(_0x1d5d4b>=_0x10670f){_0x1d5d4b=_0x10670f;_0x56180a=0xc8;}else{_0x56180a=0xce;}_0x23970e[_0xb6f7('0x1d')](_0x56180a);return _0x23970e[_0xb6f7('0x24')]('Content-Range',_0xbf9760+'-'+_0x1d5d4b+'/'+_0x10670f)[_0xb6f7('0x1f')](_0x5a1ce9);}return null;};}function patchUpdates(_0x5989fd){return function(_0x5f1237){try{jsonpatch[_0xb6f7('0x25')](_0x5f1237,_0x5989fd,!![]);}catch(_0x29ab80){return BPromise[_0xb6f7('0x26')](_0x29ab80);}return _0x5f1237['save']();};}function saveUpdates(_0x71d340,_0x1fe83d){return function(_0x2979a9){if(_0x2979a9){return _0x2979a9['update'](_0x71d340)[_0xb6f7('0x27')](function(_0x8426ed){return _0x8426ed;});}return null;};}function removeEntity(_0x5d92d1,_0x94f8c2){return function(_0x3f552f){if(_0x3f552f){return _0x3f552f['destroy']()[_0xb6f7('0x27')](function(){_0x5d92d1[_0xb6f7('0x1d')](0xcc)[_0xb6f7('0x1e')]();});}};}function handleEntityNotFound(_0xe4a346,_0x478722){return function(_0x3f35d3){if(!_0x3f35d3){_0xe4a346[_0xb6f7('0x1c')](0x194);}return _0x3f35d3;};}function handleError(_0x11de09,_0x15cc4a){_0x15cc4a=_0x15cc4a||0x1f4;return function(_0x331c9b){logger[_0xb6f7('0x28')](_0x331c9b['stack']);if(_0x331c9b[_0xb6f7('0x29')]){delete _0x331c9b['name'];}_0x11de09['status'](_0x15cc4a)['send'](_0x331c9b);};}exports[_0xb6f7('0x2a')]=function(_0x34a53a,_0x5e7805){var _0xc78103={},_0x4df1db={},_0x461947={'count':0x0,'rows':[]};var _0x1a19ee=_[_0xb6f7('0x2b')](db[_0xb6f7('0x2c')]['rawAttributes'],function(_0x48a381){return{'name':_0x48a381[_0xb6f7('0x2d')],'type':_0x48a381[_0xb6f7('0x2e')][_0xb6f7('0x2f')]};});_0x4df1db[_0xb6f7('0x30')]=_['map'](_0x1a19ee,_0xb6f7('0x29'));_0x4df1db[_0xb6f7('0x31')]=_['keys'](_0x34a53a[_0xb6f7('0x31')]);_0x4df1db[_0xb6f7('0x32')]=_['intersection'](_0x4df1db['model'],_0x4df1db['query']);_0xc78103[_0xb6f7('0x33')]=_[_0xb6f7('0x34')](_0x4df1db[_0xb6f7('0x30')],qs[_0xb6f7('0x35')](_0x34a53a[_0xb6f7('0x31')]['fields']));_0xc78103['attributes']=_0xc78103[_0xb6f7('0x33')][_0xb6f7('0x36')]?_0xc78103['attributes']:_0x4df1db[_0xb6f7('0x30')];if(!_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x37')](_0xb6f7('0x38'))){_0xc78103[_0xb6f7('0x22')]=qs[_0xb6f7('0x22')](_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x22')]);_0xc78103['offset']=qs[_0xb6f7('0x20')](_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x20')]);}_0xc78103[_0xb6f7('0x39')]=qs['sort'](_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x3a')]);_0xc78103[_0xb6f7('0x3b')]=qs[_0xb6f7('0x32')](_['pick'](_0x34a53a[_0xb6f7('0x31')],_0x4df1db[_0xb6f7('0x32')]),_0x1a19ee);if(_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x3c')]){_0xc78103[_0xb6f7('0x3b')]=_['merge'](_0xc78103[_0xb6f7('0x3b')],{'$or':_[_0xb6f7('0x2b')](_0x1a19ee,function(_0x90b57c){if(_0x90b57c[_0xb6f7('0x2e')]!=='VIRTUAL'){var _0x5a36a9={};_0x5a36a9[_0x90b57c[_0xb6f7('0x29')]]={'$like':'%'+_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x3c')]+'%'};return _0x5a36a9;}})});}_0xc78103=_[_0xb6f7('0x3d')]({},_0xc78103,_0x34a53a[_0xb6f7('0x3e')]);var _0xa20088={'where':_0xc78103[_0xb6f7('0x3b')]};return db[_0xb6f7('0x2c')][_0xb6f7('0x23')](_0xa20088)['then'](function(_0x47ebd1){_0x461947[_0xb6f7('0x23')]=_0x47ebd1;if(_0x34a53a[_0xb6f7('0x31')][_0xb6f7('0x3f')]){_0xc78103[_0xb6f7('0x40')]=[{'all':!![]}];}return db[_0xb6f7('0x2c')][_0xb6f7('0x41')](_0xc78103);})[_0xb6f7('0x27')](function(_0x2ae781){_0x461947[_0xb6f7('0x42')]=_0x2ae781;return _0x461947;})[_0xb6f7('0x27')](respondWithFilteredResult(_0x5e7805,_0xc78103))[_0xb6f7('0x43')](handleError(_0x5e7805,null));};exports[_0xb6f7('0x44')]=function(_0x477e12,_0xc6d3a4){var _0x1b152b={'raw':!![],'where':{'id':_0x477e12['params']['id']}},_0x158a07={};_0x158a07[_0xb6f7('0x30')]=_[_0xb6f7('0x45')](db['Attachment'][_0xb6f7('0x46')]);_0x158a07[_0xb6f7('0x31')]=_['keys'](_0x477e12[_0xb6f7('0x31')]);_0x158a07['filters']=_[_0xb6f7('0x34')](_0x158a07[_0xb6f7('0x30')],_0x158a07['query']);_0x1b152b[_0xb6f7('0x33')]=_[_0xb6f7('0x34')](_0x158a07[_0xb6f7('0x30')],qs[_0xb6f7('0x35')](_0x477e12[_0xb6f7('0x31')][_0xb6f7('0x35')]));_0x1b152b[_0xb6f7('0x33')]=_0x1b152b[_0xb6f7('0x33')]['length']?_0x1b152b[_0xb6f7('0x33')]:_0x158a07[_0xb6f7('0x30')];if(_0x477e12[_0xb6f7('0x31')]['includeAll']){_0x1b152b[_0xb6f7('0x40')]=[{'all':!![]}];}_0x1b152b=_[_0xb6f7('0x3d')]({},_0x1b152b,_0x477e12['options']);return db[_0xb6f7('0x2c')]['find'](_0x1b152b)[_0xb6f7('0x27')](handleEntityNotFound(_0xc6d3a4,null))[_0xb6f7('0x27')](respondWithResult(_0xc6d3a4,null))[_0xb6f7('0x43')](handleError(_0xc6d3a4,null));};exports[_0xb6f7('0x47')]=function(_0x3086bc,_0x285f2d){var _0x2c3965={'where':{'id':_0x3086bc['params']['id']}},_0x476c80={};_0x476c80[_0xb6f7('0x30')]=_[_0xb6f7('0x45')](db[_0xb6f7('0x2c')][_0xb6f7('0x46')]);_0x2c3965[_0xb6f7('0x33')]=_['intersection'](_0x476c80[_0xb6f7('0x30')],qs[_0xb6f7('0x35')](_0x3086bc['query'][_0xb6f7('0x35')]));_0x2c3965[_0xb6f7('0x33')]=_0x2c3965[_0xb6f7('0x33')][_0xb6f7('0x36')]?_0x2c3965[_0xb6f7('0x33')]:_0x476c80[_0xb6f7('0x30')];if(_0x3086bc[_0xb6f7('0x31')]['includeAll']){_0x2c3965[_0xb6f7('0x40')]=[{'all':!![]}];}_0x2c3965=_[_0xb6f7('0x3d')]({},_0x2c3965,_0x3086bc['options']);return db[_0xb6f7('0x2c')][_0xb6f7('0x48')](_0x2c3965)[_0xb6f7('0x27')](handleEntityNotFound(_0x285f2d,null))[_0xb6f7('0x27')](function(_0x8b0a7b){if(_0x8b0a7b){var _0x3e69ae=_0x8b0a7b['get']({'plain':!![]});_0x3e69ae=qs[_0xb6f7('0x49')](_0x3e69ae,['id',_0xb6f7('0x4a'),_0xb6f7('0x4b')]);_0x3086bc[_0xb6f7('0x4c')]=_[_0xb6f7('0x49')](_0x3086bc[_0xb6f7('0x4c')],['id',_0xb6f7('0x4a'),'updatedAt']);return db['Attachment'][_0xb6f7('0x4d')](_[_0xb6f7('0x3d')](_0x3e69ae,_0x3086bc[_0xb6f7('0x4c')]),{'include':_0x3086bc[_0xb6f7('0x31')][_0xb6f7('0x3f')]?[{'all':!![]}]:undefined});}})[_0xb6f7('0x27')](respondWithResult(_0x285f2d,0xc9))[_0xb6f7('0x43')](handleError(_0x285f2d,null));};exports[_0xb6f7('0x4e')]=function(_0x309a84,_0x597997){if(_0x309a84[_0xb6f7('0x4c')]['id']){delete _0x309a84[_0xb6f7('0x4c')]['id'];}return db[_0xb6f7('0x2c')][_0xb6f7('0x48')]({'where':{'id':_0x309a84[_0xb6f7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x597997,null))[_0xb6f7('0x27')](saveUpdates(_0x309a84[_0xb6f7('0x4c')],null))[_0xb6f7('0x27')](respondWithResult(_0x597997,null))[_0xb6f7('0x43')](handleError(_0x597997,null));};exports[_0xb6f7('0x50')]=function(_0x3b9279,_0x14d5ca){return db['Attachment'][_0xb6f7('0x48')]({'where':{'id':_0x3b9279[_0xb6f7('0x4f')]['id']}})[_0xb6f7('0x27')](handleEntityNotFound(_0x14d5ca,null))[_0xb6f7('0x27')](removeEntity(_0x14d5ca,null))[_0xb6f7('0x43')](handleError(_0x14d5ca,null));};exports[_0xb6f7('0x4d')]=function(_0x5c13b1,_0x52fc60,_0x253582){_0x5c13b1[_0xb6f7('0x4c')][_0xb6f7('0x29')]=_0x5c13b1['file']['originalname'];_0x5c13b1[_0xb6f7('0x4c')]['basename']=_0x5c13b1[_0xb6f7('0x51')][_0xb6f7('0x52')];_0x5c13b1[_0xb6f7('0x4c')][_0xb6f7('0x2e')]=_0x5c13b1[_0xb6f7('0x51')][_0xb6f7('0x53')];return db[_0xb6f7('0x2c')]['create'](_0x5c13b1[_0xb6f7('0x4c')])['then'](respondWithResult(_0x52fc60,0xc9))[_0xb6f7('0x43')](handleError(_0x52fc60,null));};exports['download']=function(_0xc6efef,_0x5c0189,_0x15817c){return db[_0xb6f7('0x2c')][_0xb6f7('0x54')]({'where':{'id':_0xc6efef[_0xb6f7('0x4f')]['id']},'raw':!![]})[_0xb6f7('0x27')](handleEntityNotFound(_0x5c0189,null))[_0xb6f7('0x27')](function(_0x55b789){if(_0x55b789){var _0x165723=_0x55b789['ChatOfflineMessageId']!==null;var _0x1a9964=path['join'](config[_0xb6f7('0x55')],'server/files/attachments/');if(_0x165723){_0x1a9964=path[_0xb6f7('0x56')](_0x1a9964,_0xb6f7('0x57'));}var _0x438e4d=path[_0xb6f7('0x56')](_0x1a9964,_0x55b789[_0xb6f7('0x58')]);return _0x5c0189[_0xb6f7('0x59')](_0x438e4d);}})['catch'](handleError(_0x5c0189,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 551c1ca..60b01e5 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc30e=['exports','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./attachment.attributes'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0xc30e,0x153));var _0xec30=function(_0x12b23e,_0x1fa40a){_0x12b23e=_0x12b23e-0x0;var _0x5247ff=_0xc30e[_0x12b23e];return _0x5247ff;};'use strict';var _=require(_0xec30('0x0'));var util=require(_0xec30('0x1'));var logger=require(_0xec30('0x2'))(_0xec30('0x3'));var moment=require(_0xec30('0x4'));var BPromise=require(_0xec30('0x5'));var rp=require(_0xec30('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec30('0x7'));var config=require('../../config/environment');var attributes=require(_0xec30('0x8'));module[_0xec30('0x9')]=function(_0xc7f4bc,_0x169cb6){return _0xc7f4bc['define'](_0xec30('0xa'),attributes,{'tableName':_0xec30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4236=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments'];(function(_0x59b533,_0x59fdcc){var _0x2beced=function(_0xd3aaf3){while(--_0xd3aaf3){_0x59b533['push'](_0x59b533['shift']());}};_0x2beced(++_0x59fdcc);}(_0x4236,0xd1));var _0x6423=function(_0x1125e6,_0xa2323d){_0x1125e6=_0x1125e6-0x0;var _0x19a466=_0x4236[_0x1125e6];return _0x19a466;};'use strict';var _=require(_0x6423('0x0'));var util=require(_0x6423('0x1'));var logger=require(_0x6423('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6423('0x3'));var rp=require(_0x6423('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6423('0x5'));var config=require(_0x6423('0x6'));var attributes=require(_0x6423('0x7'));module[_0x6423('0x8')]=function(_0xde0c6b,_0x1053db){return _0xde0c6b['define'](_0x6423('0x9'),attributes,{'tableName':_0x6423('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 28982d8..b86274f 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4bc3=['then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1f4370,_0x419f8a){var _0x1196a4=function(_0x234ee1){while(--_0x234ee1){_0x1f4370['push'](_0x1f4370['shift']());}};_0x1196a4(++_0x419f8a);}(_0x4bc3,0x16e));var _0x34bc=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x4bc3[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('Attachment,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('Attachment,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});}exports[_0x34bc('0x17')]=function(_0x3eaedf){var _0x30282b=this;return new Promise(function(_0x239e6c,_0x567eee){return db[_0x34bc('0x18')][_0x34bc('0x19')](_0x3eaedf['body'],{'raw':_0x3eaedf[_0x34bc('0x1a')]?_0x3eaedf[_0x34bc('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x34bc('0xc')](function(_0x26cdec){logger[_0x34bc('0xd')](_0x34bc('0x17'),_0x3eaedf);logger[_0x34bc('0xe')](_0x34bc('0x17'),_0x3eaedf,JSON['stringify'](_0x26cdec));_0x239e6c(_0x26cdec);})[_0x34bc('0x16')](function(_0x3c9939){logger[_0x34bc('0x11')]('CreateAttachment',_0x3c9939['message'],_0x3eaedf);_0x567eee(_0x30282b[_0x34bc('0x11')](0x1f4,_0x3c9939[_0x34bc('0x14')]));});});};
\ No newline at end of file
+var _0xaf1d=['jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Attachment','create','body','raw','CreateAttachment','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x34c5cb,_0x4d2a3a){var _0x411dba=function(_0x1d1e7b){while(--_0x1d1e7b){_0x34c5cb['push'](_0x34c5cb['shift']());}};_0x411dba(++_0x4d2a3a);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x5835fd,_0x464612){_0x5835fd=_0x5835fd-0x0;var _0x5bc6fe=_0xaf1d[_0x5835fd];return _0x5bc6fe;};'use strict';var _=require(_0xdaf1('0x0'));var util=require(_0xdaf1('0x1'));var moment=require(_0xdaf1('0x2'));var BPromise=require(_0xdaf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaf1('0x4'));var db=require(_0xdaf1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaf1('0x6'))(_0xdaf1('0x7'));var config=require(_0xdaf1('0x8'));var jayson=require(_0xdaf1('0x9'));var client=jayson[_0xdaf1('0xa')][_0xdaf1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d6c50,_0x54dc7a,_0x5ed9cd){return new BPromise(function(_0xfb18fc,_0x51a7e9){return client['request'](_0x4d6c50,_0x5ed9cd)[_0xdaf1('0xc')](function(_0x3219da){logger[_0xdaf1('0xd')](_0xdaf1('0xe'),_0x54dc7a,'request\x20sent');logger[_0xdaf1('0xf')](_0xdaf1('0x10'),_0x54dc7a,_0xdaf1('0x11'),JSON[_0xdaf1('0x12')](_0x3219da));if(_0x3219da[_0xdaf1('0x13')]){if(_0x3219da['error'][_0xdaf1('0x14')]===0x1f4){logger[_0xdaf1('0x13')](_0xdaf1('0xe'),_0x54dc7a,_0x3219da[_0xdaf1('0x13')][_0xdaf1('0x15')]);return _0x51a7e9(_0x3219da[_0xdaf1('0x13')][_0xdaf1('0x15')]);}logger[_0xdaf1('0x13')](_0xdaf1('0xe'),_0x54dc7a,_0x3219da[_0xdaf1('0x13')][_0xdaf1('0x15')]);return _0xfb18fc(_0x3219da[_0xdaf1('0x13')][_0xdaf1('0x15')]);}else{logger['info'](_0xdaf1('0xe'),_0x54dc7a,_0xdaf1('0x11'));_0xfb18fc(_0x3219da['result'][_0xdaf1('0x15')]);}})['catch'](function(_0x39d34b){logger[_0xdaf1('0x13')](_0xdaf1('0xe'),_0x54dc7a,_0x39d34b);_0x51a7e9(_0x39d34b);});});}exports['CreateAttachment']=function(_0x1dd985){var _0x5a9101=this;return new Promise(function(_0x4896c1,_0x921cd7){return db[_0xdaf1('0x16')][_0xdaf1('0x17')](_0x1dd985[_0xdaf1('0x18')],{'raw':_0x1dd985['options']?_0x1dd985['options'][_0xdaf1('0x19')]===undefined?!![]:![]:!![]})[_0xdaf1('0xc')](function(_0x37b377){logger['info'](_0xdaf1('0x1a'),_0x1dd985);logger[_0xdaf1('0xf')](_0xdaf1('0x1a'),_0x1dd985,JSON[_0xdaf1('0x12')](_0x37b377));_0x4896c1(_0x37b377);})[_0xdaf1('0x1b')](function(_0x110e33){logger[_0xdaf1('0x13')](_0xdaf1('0x1a'),_0x110e33[_0xdaf1('0x15')],_0x1dd985);_0x921cd7(_0x5a9101[_0xdaf1('0x13')](0x1f4,_0x110e33['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index c563eae..f6676fe 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x5aa762,_0x1cefb7){_0x5aa762=_0x5aa762-0x0;var _0x1762e6=_0xdb28[_0x5aa762];return _0x1762e6;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 5397790..0ed3cc4 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x987d=['activedirectory','undefined','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','user','agent','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x987d,0x1df));var _0xd987=function(_0x32e091,_0x4c88db){_0x32e091=_0x32e091-0x0;var _0xeb8c03=_0x987d[_0x32e091];return _0xeb8c03;};'use strict';var passport=require(_0xd987('0x0'));var LocalStrategy=require('passport-local')[_0xd987('0x1')];var moment=require(_0xd987('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xd987('0x3'));var util=require(_0xd987('0x4'));var db=require(_0xd987('0x5'))['db'];var authService=require(_0xd987('0x6'));var utils=require(_0xd987('0x7'));var config=require(_0xd987('0x8'));var logger=require(_0xd987('0x9'))(_0xd987('0xa'));function isActiveDirectoryConfigured(_0x44b90a){var _0x2fba3d=![];if(typeof _0x44b90a[_0xd987('0xb')]!==_0xd987('0xc')){_0x2fba3d=_0x44b90a[_0xd987('0xb')]['baseDN']&&_0x44b90a['activedirectory'][_0xd987('0xd')]&&_0x44b90a[_0xd987('0xb')][_0xd987('0xe')];}return _0x2fba3d;}function adAuthenticate(_0x1fca0d,_0x520794,_0x590dc7){return new BPromise(function(_0x54d9dc,_0x4919f0){try{var _0x2a3c2a=new ActiveDirectory(_0x1fca0d);_0x2a3c2a['authenticate'](_0x520794,_0x590dc7,function(_0x309e39,_0x4858a){if(_0x309e39){logger['error'](_0xd987('0xf'),_0x520794,util[_0xd987('0x10')](_0x309e39,{'showHidden':![],'depth':null}));_0x4919f0(_0xd987('0x11'));}else if(!_0x4858a){logger[_0xd987('0x12')](_0xd987('0x13'),_0x520794);_0x4919f0(_0xd987('0x11'));}else{_0x54d9dc(_0x4858a);}});}catch(_0x4ddfac){_0x4919f0(_0x4ddfac);}});}function ActiveDirectoryAuthenticate(_0x2000ae,_0x580183,_0x50ccb2,_0x5ab0b5){var _0x17c9de,_0x53bc43;if(!isActiveDirectoryConfigured(config)){logger[_0xd987('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x580183);return _0x5ab0b5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xd987('0x14')][_0xd987('0x15')]({'where':{'id':0x1},'attributes':[_0xd987('0x16'),_0xd987('0x17')],'raw':!![]})[_0xd987('0x18')](function(_0x30c81d){_0x17c9de=_0x30c81d;if(!_0x17c9de[_0xd987('0x16')]){logger['error'](_0xd987('0x19'),_0x580183);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2000ae['findOne']({'attributes':['id',_0xd987('0x1a'),_0xd987('0x1b'),_0xd987('0x1c'),_0xd987('0x1d'),_0xd987('0x1e'),'blocked','blockedAt','online'],'where':{'name':_0x580183,'role':{'$or':['admin',_0xd987('0x1f'),_0xd987('0x20')]},'adSsoEnabled':!![]}});})[_0xd987('0x18')](function(_0x4a781d){if(!_0x4a781d||_0x4a781d&&_0x4a781d[_0xd987('0x1a')]!==_0x580183){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x53bc43=_0x4a781d;var _0x256e92=_0x53bc43[_0xd987('0x1a')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xd987('0xb')],_0x256e92,_0x50ccb2);})[_0xd987('0x18')](function(_0x4c53bc){if(_0x53bc43[_0xd987('0x1e')]){throw new Error(_0xd987('0x11'));}if(_0x17c9de[_0xd987('0x17')]>0x0){if(_0x53bc43[_0xd987('0x21')]){if(moment(_0x53bc43[_0xd987('0x22')])[_0xd987('0x23')](_0x17c9de[_0xd987('0x17')],_0xd987('0x24'))>moment()){throw new Error(_0xd987('0x11'));}return utils[_0xd987('0x25')](_0x53bc43,0x0,![],null)[_0xd987('0x18')](function(){return utils[_0xd987('0x26')](_0x53bc43);})[_0xd987('0x18')](function(){return _0x5ab0b5(null,_0x53bc43);});}else{return utils[_0xd987('0x26')](_0x53bc43)[_0xd987('0x18')](function(){return _0x5ab0b5(null,_0x53bc43);});}}else{return utils[_0xd987('0x26')](_0x53bc43)[_0xd987('0x18')](function(){return _0x5ab0b5(null,_0x53bc43);});}})[_0xd987('0x27')](function(_0x39ec49){return _0x5ab0b5(null,![],_0x39ec49);});}function handleError(_0x451ac5,_0x4ff3c7,_0x32fb1f){return _0x451ac5['status'](_0x4ff3c7||0x1f4)[_0xd987('0x28')]({'message':_0x32fb1f?_0x32fb1f[_0xd987('0x29')]||_0x32fb1f:''});}exports[_0xd987('0x2a')]=function(_0x35196a,_0x29705e,_0x305e5b){passport['authenticate'](_0xd987('0x2b'),function(_0x23a22d,_0x4e5847,_0x1629c6){var _0x983968=_0x23a22d||_0x1629c6;if(_0x983968){return handleError(_0x29705e,0x191,_0x983968);}if(!_0x4e5847){return handleError(_0x29705e,0x194,{'message':_0xd987('0x2c')});}else{var _0x4e10e4={'payload':{'id':_0x4e5847['id'],'role':_0x4e5847['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4e10e4)[_0xd987('0x18')](function(_0x1d62a0){_0x29705e[_0xd987('0x2d')]({'id':_0x4e5847['id'],'token':_0x1d62a0,'statusCall':'','isAlreadyLogged':_0x4e5847[_0xd987('0x2e')]});});}})(_0x35196a,_0x29705e,_0x305e5b);};passport[_0xd987('0x2f')]('ad-login',new LocalStrategy({'usernameField':_0xd987('0x1a'),'passwordField':_0xd987('0x1b')},function(_0x2768de,_0xfdb08f,_0x2b3781){return ActiveDirectoryAuthenticate(db[_0xd987('0x30')],_0x2768de,_0xfdb08f,_0x2b3781);}));
\ No newline at end of file
+var _0x739c=['../../config/environment','../../config/logger','api','activedirectory','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt','online','admin','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','role','signToken','User','passport','passport-local','Strategy','moment','util','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x5f009e,_0x2e2468){var _0x583d04=function(_0x2a7960){while(--_0x2a7960){_0x5f009e['push'](_0x5f009e['shift']());}};_0x583d04(++_0x2e2468);}(_0x739c,0x1c4));var _0xc739=function(_0x2b085f,_0x41d231){_0x2b085f=_0x2b085f-0x0;var _0x35e504=_0x739c[_0x2b085f];return _0x35e504;};'use strict';var passport=require(_0xc739('0x0'));var LocalStrategy=require(_0xc739('0x1'))[_0xc739('0x2')];var moment=require(_0xc739('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xc739('0x4'));var db=require(_0xc739('0x5'))['db'];var authService=require(_0xc739('0x6'));var utils=require(_0xc739('0x7'));var config=require(_0xc739('0x8'));var logger=require(_0xc739('0x9'))(_0xc739('0xa'));function isActiveDirectoryConfigured(_0x54064f){var _0x3a0a66=![];if(typeof _0x54064f['activedirectory']!=='undefined'){_0x3a0a66=_0x54064f[_0xc739('0xb')]['baseDN']&&_0x54064f[_0xc739('0xb')][_0xc739('0xc')]&&_0x54064f['activedirectory'][_0xc739('0xd')];}return _0x3a0a66;}function adAuthenticate(_0x2d868a,_0x48b4ec,_0x20405b){return new BPromise(function(_0x1fce64,_0x3f6726){try{var _0x359b02=new ActiveDirectory(_0x2d868a);_0x359b02['authenticate'](_0x48b4ec,_0x20405b,function(_0x222119,_0x35d6a0){if(_0x222119){logger[_0xc739('0xe')](_0xc739('0xf'),_0x48b4ec,util[_0xc739('0x10')](_0x222119,{'showHidden':![],'depth':null}));_0x3f6726('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x35d6a0){logger[_0xc739('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x48b4ec);_0x3f6726(_0xc739('0x11'));}else{_0x1fce64(_0x35d6a0);}});}catch(_0x1157f5){_0x3f6726(_0x1157f5);}});}function ActiveDirectoryAuthenticate(_0x50c1a6,_0x998dc9,_0x59c0bb,_0x3ccc09){var _0x5b4396,_0xac3bd8;if(!isActiveDirectoryConfigured(config)){logger[_0xc739('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x998dc9);return _0x3ccc09(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xc739('0x12')][_0xc739('0x13')]({'where':{'id':0x1},'attributes':[_0xc739('0x14'),_0xc739('0x15')],'raw':!![]})[_0xc739('0x16')](function(_0xfd88e2){_0x5b4396=_0xfd88e2;if(!_0x5b4396[_0xc739('0x14')]){logger[_0xc739('0xe')](_0xc739('0x17'),_0x998dc9);throw new Error(_0xc739('0x11'));}return _0x50c1a6['findOne']({'attributes':['id',_0xc739('0x18'),_0xc739('0x19'),_0xc739('0x1a'),'role',_0xc739('0x1b'),_0xc739('0x1c'),_0xc739('0x1d'),_0xc739('0x1e')],'where':{'name':_0x998dc9,'role':{'$or':[_0xc739('0x1f'),'user',_0xc739('0x20')]},'adSsoEnabled':!![]}});})[_0xc739('0x16')](function(_0x4d0b71){if(!_0x4d0b71||_0x4d0b71&&_0x4d0b71[_0xc739('0x18')]!==_0x998dc9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xac3bd8=_0x4d0b71;var _0x5f8b5d=_0xac3bd8[_0xc739('0x18')]+'@'+config[_0xc739('0xb')][_0xc739('0xd')];return adAuthenticate(config['activedirectory'],_0x5f8b5d,_0x59c0bb);})[_0xc739('0x16')](function(_0x1ff684){if(_0xac3bd8[_0xc739('0x1b')]){throw new Error(_0xc739('0x11'));}if(_0x5b4396[_0xc739('0x15')]>0x0){if(_0xac3bd8[_0xc739('0x1c')]){if(moment(_0xac3bd8[_0xc739('0x1d')])[_0xc739('0x21')](_0x5b4396['blockDuration'],_0xc739('0x22'))>moment()){throw new Error(_0xc739('0x11'));}return utils[_0xc739('0x23')](_0xac3bd8,0x0,![],null)[_0xc739('0x16')](function(){return utils[_0xc739('0x24')](_0xac3bd8);})['then'](function(){return _0x3ccc09(null,_0xac3bd8);});}else{return utils[_0xc739('0x24')](_0xac3bd8)[_0xc739('0x16')](function(){return _0x3ccc09(null,_0xac3bd8);});}}else{return utils[_0xc739('0x24')](_0xac3bd8)['then'](function(){return _0x3ccc09(null,_0xac3bd8);});}})[_0xc739('0x25')](function(_0x22fe52){return _0x3ccc09(null,![],_0x22fe52);});}function handleError(_0x5c74cc,_0x4c8172,_0x5305a8){return _0x5c74cc[_0xc739('0x26')](_0x4c8172||0x1f4)[_0xc739('0x27')]({'message':_0x5305a8?_0x5305a8[_0xc739('0x28')]||_0x5305a8:''});}exports[_0xc739('0x29')]=function(_0xd66f49,_0x713d9d,_0x5425bd){passport[_0xc739('0x2a')]('ad-login',function(_0x5d7985,_0x31e398,_0x2a1188){var _0x1aba35=_0x5d7985||_0x2a1188;if(_0x1aba35){return handleError(_0x713d9d,0x191,_0x1aba35);}if(!_0x31e398){return handleError(_0x713d9d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x318872={'payload':{'id':_0x31e398['id'],'role':_0x31e398[_0xc739('0x2b')]},'options':{'expiresIn':0x15180}};return authService[_0xc739('0x2c')](_0x318872)[_0xc739('0x16')](function(_0x28e79f){_0x713d9d['json']({'id':_0x31e398['id'],'token':_0x28e79f,'statusCall':'','isAlreadyLogged':_0x31e398[_0xc739('0x1e')]});});}})(_0xd66f49,_0x713d9d,_0x5425bd);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xc739('0x18'),'passwordField':'password'},function(_0x1181d5,_0x28f8dc,_0x25c676){return ActiveDirectoryAuthenticate(db[_0xc739('0x2d')],_0x1181d5,_0x28f8dc,_0x25c676);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 89dedda..197984e 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x045e=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x19e15e,_0x49a659){var _0x3129f0=function(_0xea529){while(--_0xea529){_0x19e15e['push'](_0x19e15e['shift']());}};_0x3129f0(++_0x49a659);}(_0x045e,0x93));var _0xe045=function(_0x2e6e12,_0x238fc4){_0x2e6e12=_0x2e6e12-0x0;var _0x4bebf6=_0x045e[_0x2e6e12];return _0x4bebf6;};'use strict';var express=require(_0xe045('0x0'));var router=express[_0xe045('0x1')]();var controller=require(_0xe045('0x2'));router[_0xe045('0x3')]('/',controller[_0xe045('0x4')]);module[_0xe045('0x5')]=router;
\ No newline at end of file
+var _0xc052=['login','express','Router','./authActiveDirectory.controller','post'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc052,0xa6));var _0x2c05=function(_0x255e61,_0x50eaff){_0x255e61=_0x255e61-0x0;var _0x113d17=_0xc052[_0x255e61];return _0x113d17;};'use strict';var express=require(_0x2c05('0x0'));var router=express[_0x2c05('0x1')]();var controller=require(_0x2c05('0x2'));router[_0x2c05('0x3')]('/',controller[_0x2c05('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 4701530..2b6a62d 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x7a54,0x106));var _0x47a5=function(_0x1b7b98,_0xa66d0c){_0x1b7b98=_0x1b7b98-0x0;var _0xae46c6=_0x7a54[_0x1b7b98];return _0xae46c6;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x48f584,_0x303860){var _0x1e99c2=function(_0x1ec99d){while(--_0x1ec99d){_0x48f584['push'](_0x48f584['shift']());}};_0x1e99c2(++_0x303860);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 22941d8..9925fd4 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64c8=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','passport'];(function(_0x2fcddf,_0x2a5c30){var _0xcd6d76=function(_0x6a8702){while(--_0x6a8702){_0x2fcddf['push'](_0x2fcddf['shift']());}};_0xcd6d76(++_0x2a5c30);}(_0x64c8,0xb2));var _0x864c=function(_0x5aa9f8,_0x441aed){_0x5aa9f8=_0x5aa9f8-0x0;var _0x256b6f=_0x64c8[_0x5aa9f8];return _0x256b6f;};'use strict';var express=require(_0x864c('0x0'));var passport=require(_0x864c('0x1'));var router=express[_0x864c('0x2')]();var controller=require(_0x864c('0x3'));var userController=require(_0x864c('0x4'));var authService=require(_0x864c('0x5'));router[_0x864c('0x6')]('/',controller[_0x864c('0x7')]);router[_0x864c('0x6')](_0x864c('0x8'),controller[_0x864c('0x9')],authService[_0x864c('0xa')],userController[_0x864c('0x7')],authService[_0x864c('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xbc3a=['login','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xbc3a,0xb4));var _0xabc3=function(_0x2a98cd,_0x4a7a0d){_0x2a98cd=_0x2a98cd-0x0;var _0x4769da=_0xbc3a[_0x2a98cd];return _0x4769da;};'use strict';var express=require(_0xabc3('0x0'));var passport=require(_0xabc3('0x1'));var router=express[_0xabc3('0x2')]();var controller=require(_0xabc3('0x3'));var userController=require(_0xabc3('0x4'));var authService=require(_0xabc3('0x5'));router[_0xabc3('0x6')]('/',controller[_0xabc3('0x7')]);router['get']('/callback',controller[_0xabc3('0x8')],authService[_0xabc3('0x9')],userController[_0xabc3('0x7')],authService[_0xabc3('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 896f49a..e1b1a71 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdacf=['blocked','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','client','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4b527e,_0x4c85fe){var _0x1a1189=function(_0x21c560){while(--_0x21c560){_0x4b527e['push'](_0x4b527e['shift']());}};_0x1a1189(++_0x4c85fe);}(_0xdacf,0x90));var _0xfdac=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdacf[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xfdac('0x0'));var passport=require('passport');var LocalStrategy=require(_0xfdac('0x1'))[_0xfdac('0x2')];var jayson=require(_0xfdac('0x3'));var _=require(_0xfdac('0x4'));var rs=require(_0xfdac('0x5'));var moment=require(_0xfdac('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xfdac('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x5372b4,_0xd77bb7,_0x35cab2,_0x27e85a){var _0x26648b,_0xbdf5c4;return db['Setting'][_0xfdac('0x8')]({'where':{'id':0x1},'attributes':[_0xfdac('0x9'),_0xfdac('0xa')],'raw':!![]})['then'](function(_0x48a29b){_0x26648b=_0x48a29b;return _0x5372b4[_0xfdac('0x8')]({'attributes':['id',_0xfdac('0xb'),_0xfdac('0xc'),_0xfdac('0xd'),_0xfdac('0xe'),_0xfdac('0xf'),'blocked',_0xfdac('0x10'),_0xfdac('0x11')],'where':{'name':_0xd77bb7,'role':{'$or':[_0xfdac('0x12'),_0xfdac('0x13'),_0xfdac('0x14')]}}});})[_0xfdac('0x15')](function(_0x5d8d36){if(!_0x5d8d36||_0x5d8d36&&_0x5d8d36[_0xfdac('0xb')]!==_0xd77bb7){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xbdf5c4=_0x5d8d36;return _0xbdf5c4;}})['then'](function(){_0xbdf5c4[_0xfdac('0x16')](_0x35cab2,function(_0x5c1195,_0x197e00){var _0x396b35=_0xbdf5c4[_0xfdac('0x11')]+0x1;if(_0x5c1195){return _0x27e85a(_0x5c1195);}else if(!_0x197e00){if(_0xbdf5c4[_0xfdac('0xf')]){return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}else if(_0x26648b[_0xfdac('0x9')]>0x0){if(_0xbdf5c4[_0xfdac('0x18')]){if(_0x26648b['blockDuration']>0x0){if(moment(_0xbdf5c4['blockedAt'])['add'](_0x26648b[_0xfdac('0xa')],_0xfdac('0x19'))>moment()){return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}else{return utils['clearBlockUser'](_0xbdf5c4,_0x396b35,![],null)['then'](function(){return _0x27e85a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}}else{if(_0x396b35>=_0x26648b[_0xfdac('0x9')]){return utils[_0xfdac('0x1a')](_0xbdf5c4,0x0,!![],moment())[_0xfdac('0x15')](function(){return _0x27e85a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xfdac('0x1a')](_0xbdf5c4,_0x396b35,![],null)[_0xfdac('0x15')](function(){return _0x27e85a(null,![],{'message':_0xfdac('0x17')});});}}}else{return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}}else{if(_0xbdf5c4[_0xfdac('0xf')]){return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}else if(_0x26648b[_0xfdac('0x9')]>0x0){if(_0xbdf5c4[_0xfdac('0x18')]){if(_0x26648b[_0xfdac('0xa')]>0x0){if(moment(_0xbdf5c4[_0xfdac('0x10')])['add'](_0x26648b['blockDuration'],_0xfdac('0x19'))>moment()){return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}else{return utils[_0xfdac('0x1a')](_0xbdf5c4,0x0,![],null)[_0xfdac('0x15')](function(){return utils[_0xfdac('0x1b')](_0xbdf5c4);})[_0xfdac('0x15')](function(){return _0x27e85a(null,_0xbdf5c4);});}}else{return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}}else{return utils[_0xfdac('0x1a')](_0xbdf5c4,0x0,![],null)['then'](function(){return utils['getLicense'](_0xbdf5c4);})['then'](function(){return _0x27e85a(null,_0xbdf5c4);})['catch'](function(_0x3a5853){return _0x27e85a(null,![],_0x3a5853);});}}else{if(_0xbdf5c4[_0xfdac('0x18')]){return _0x27e85a(null,![],{'message':_0xfdac('0x17')});}else{return utils['getLicense'](_0xbdf5c4)[_0xfdac('0x15')](function(){return _0x27e85a(null,_0xbdf5c4);});}}}});})[_0xfdac('0x1c')](function(_0x56baac){return _0x27e85a(null,![],_0x56baac);});}function sendServiceMail(_0x356bea){return db[_0xfdac('0x1d')][_0xfdac('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0xfdac('0x1f')],'include':[{'model':db[_0xfdac('0x20')],'as':'Smtp','include':[{'model':db[_0xfdac('0x21')],'as':_0xfdac('0x21')}]}]})[_0xfdac('0x15')](function(_0x6c2d17){if(!_0x6c2d17){throw new Error(_0xfdac('0x22'));}var _0x3d9415=_0x6c2d17[_0xfdac('0x23')]();var _0x1511f8={'account':_0x3d9415,'message':_[_0xfdac('0x24')]({'from':util[_0xfdac('0x25')](_0xfdac('0x26'),_0x6c2d17[_0xfdac('0xb')],_0x6c2d17[_0xfdac('0x1f')]||_0x6c2d17['Smtp'][_0xfdac('0x13')])},_0x356bea)};return client[_0xfdac('0x27')](_0xfdac('0x28'),_0x1511f8);})['then'](function(_0x44e163){if(_0x44e163[_0xfdac('0x29')]){throw new Error(util[_0xfdac('0x25')](_0xfdac('0x2a'),_0x44e163[_0xfdac('0x29')][_0xfdac('0x2b')]||JSON[_0xfdac('0x2c')](_0x44e163[_0xfdac('0x29')])));}return!![];});}function handleError(_0x356c24,_0x22c7a9,_0x2a0882){return _0x356c24[_0xfdac('0x2d')](_0x22c7a9||0x1f4)[_0xfdac('0x2e')]({'message':_0x2a0882?_0x2a0882['message']||_0x2a0882:''});}exports[_0xfdac('0x2f')]=function(_0x1e0474,_0x42ed27,_0x50af8d){passport[_0xfdac('0x16')](_0xfdac('0x30'),function(_0x77dc05,_0x157a06,_0x5b3ef9){var _0x205f2b=_0x77dc05||_0x5b3ef9;if(_0x205f2b){return handleError(_0x42ed27,0x191,_0x205f2b);}if(!_0x157a06){return handleError(_0x42ed27,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3359ba={'payload':{'id':_0x157a06['id'],'role':_0x157a06[_0xfdac('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xfdac('0x31')](_0x3359ba)[_0xfdac('0x15')](function(_0x48ee78){_0x42ed27[_0xfdac('0x32')]({'id':_0x157a06['id'],'token':_0x48ee78,'statusCall':'','isAlreadyLogged':_0x157a06[_0xfdac('0x33')]});});}})(_0x1e0474,_0x42ed27,_0x50af8d);};exports[_0xfdac('0x34')]=function(_0x5cf7ba,_0x2b37b8){if(!_0x5cf7ba[_0xfdac('0x35')][_0xfdac('0x1f')]){return handleError(_0x2b37b8,0x1f4,{'message':_0xfdac('0x36')});}var _0x3a70c1=rs[_0xfdac('0x37')]();_0x5cf7ba[_0xfdac('0x35')][_0xfdac('0x1f')]=_0x5cf7ba[_0xfdac('0x35')][_0xfdac('0x1f')][_0xfdac('0x38')]()[_0xfdac('0x39')]();var _0xd18ea4;return db[_0xfdac('0x3a')][_0xfdac('0x8')]({'where':{'id':0x1},'attributes':[_0xfdac('0x9'),'blockDuration'],'raw':!![]})[_0xfdac('0x15')](function(_0x59792d){_0xd18ea4=_0x59792d;return db[_0xfdac('0x3b')]['find']({'where':{'email':_0x5cf7ba[_0xfdac('0x35')]['email']}});})['then'](function(_0xaf7d8){if(!_0xaf7d8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xaf7d8['disabled']){throw new Error(_0xfdac('0x3c'));}if(_0xaf7d8[_0xfdac('0x18')]){if(moment(_0xaf7d8[_0xfdac('0x10')])[_0xfdac('0x3d')](_0xd18ea4[_0xfdac('0xa')],_0xfdac('0x19'))>moment()){throw new Error(_0xfdac('0x3e'));}else{_0xaf7d8['blocked']=![];_0xaf7d8[_0xfdac('0x10')]=null;}}_0xaf7d8[_0xfdac('0x3f')]=_0x3a70c1;_0xaf7d8[_0xfdac('0x40')]=Date['now']()+0x36ee80;return _0xaf7d8[_0xfdac('0x41')]();})[_0xfdac('0x15')](function(){return sendServiceMail({'to':_0x5cf7ba[_0xfdac('0x35')][_0xfdac('0x1f')],'subject':_0xfdac('0x42'),'text':_0xfdac('0x43')+_0xfdac('0x44')+_0xfdac('0x45')+_0x5cf7ba[_0xfdac('0x46')][_0xfdac('0x47')]+_0xfdac('0x48')+_0x3a70c1+'\x0a\x0a'+_0xfdac('0x49')});})[_0xfdac('0x15')](function(){_0x2b37b8[_0xfdac('0x2d')](0xc8)['send']({'message':_0xfdac('0x4a')});})[_0xfdac('0x1c')](function(_0x3e42e7){return handleError(_0x2b37b8,0x1f4,_0x3e42e7);});};exports['reset']=function(_0x24fc82,_0x3e18ae){return db[_0xfdac('0x3b')][_0xfdac('0x1e')]({'where':{'resetPasswordToken':_0x24fc82[_0xfdac('0x4b')][_0xfdac('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xfdac('0x4d')]()}}})[_0xfdac('0x15')](function(_0x4e4936){if(!_0x4e4936){throw new Error(_0xfdac('0x4e'));}return db[_0xfdac('0x3a')]['findOne']({'attributes':['id',_0xfdac('0x4f'),_0xfdac('0x50'),_0xfdac('0x51')]})[_0xfdac('0x15')](function(_0x2a3379){if(_0x2a3379[_0xfdac('0x4f')])authService['validatePasswordPattern'](_0x24fc82[_0xfdac('0x35')]['password']);if(!_0x2a3379[_0xfdac('0x50')]||!_0x4e4936[_0xfdac('0x52')])return _0x4e4936;authService['validatePasswordHistory'](_0x24fc82[_0xfdac('0x35')][_0xfdac('0xc')],_0x4e4936[_0xfdac('0x52')],_0x2a3379[_0xfdac('0x51')]);return _0x4e4936;})[_0xfdac('0x15')](function(){_0x4e4936[_0xfdac('0xc')]=_0x24fc82[_0xfdac('0x35')]['password'];_0x4e4936[_0xfdac('0x3f')]=null;_0x4e4936['resetPasswordExpires']=null;return _0x4e4936[_0xfdac('0x41')]();});})[_0xfdac('0x15')](function(){_0x3e18ae[_0xfdac('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xfdac('0x1c')](function(_0x5098a1){return handleError(_0x3e18ae,0x1f4,_0x5098a1);});};passport[_0xfdac('0x53')]('local-login',new LocalStrategy({'usernameField':_0xfdac('0xb'),'passwordField':_0xfdac('0xc')},function(_0x5aff30,_0x17362b,_0x5272c9){return localAuthenticate(db[_0xfdac('0x3b')],_0x5aff30,_0x17362b,_0x5272c9);}));
\ No newline at end of file
+var _0x8af2=['status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','minutes','clearBlockUser','add','getLicense','catch','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify'];(function(_0x1ad790,_0x2ac345){var _0x2f3f9b=function(_0x222e8d){while(--_0x222e8d){_0x1ad790['push'](_0x1ad790['shift']());}};_0x2f3f9b(++_0x2ac345);}(_0x8af2,0x120));var _0x28af=function(_0x2425e9,_0x5bbd2d){_0x2425e9=_0x2425e9-0x0;var _0x1dea52=_0x8af2[_0x2425e9];return _0x1dea52;};'use strict';var util=require('util');var passport=require(_0x28af('0x0'));var LocalStrategy=require('passport-local')[_0x28af('0x1')];var jayson=require(_0x28af('0x2'));var _=require(_0x28af('0x3'));var rs=require('randomstring');var moment=require(_0x28af('0x4'));var db=require(_0x28af('0x5'))['db'];var authService=require(_0x28af('0x6'));var utils=require(_0x28af('0x7'));var client=jayson['client'][_0x28af('0x8')]({'port':0x232b});function localAuthenticate(_0xdc3428,_0x4ab638,_0x181037,_0x420f24){var _0x48c775,_0x5e434d;return db['Setting'][_0x28af('0x9')]({'where':{'id':0x1},'attributes':[_0x28af('0xa'),_0x28af('0xb')],'raw':!![]})[_0x28af('0xc')](function(_0x2911d7){_0x48c775=_0x2911d7;return _0xdc3428[_0x28af('0x9')]({'attributes':['id',_0x28af('0xd'),_0x28af('0xe'),_0x28af('0xf'),_0x28af('0x10'),_0x28af('0x11'),_0x28af('0x12'),_0x28af('0x13'),'loginAttempts'],'where':{'name':_0x4ab638,'role':{'$or':[_0x28af('0x14'),_0x28af('0x15'),'agent']}}});})[_0x28af('0xc')](function(_0x383a7d){if(!_0x383a7d||_0x383a7d&&_0x383a7d[_0x28af('0xd')]!==_0x4ab638){throw new Error(_0x28af('0x16'));}else{_0x5e434d=_0x383a7d;return _0x5e434d;}})[_0x28af('0xc')](function(){_0x5e434d[_0x28af('0x17')](_0x181037,function(_0x162c64,_0x4eda9d){var _0x34150b=_0x5e434d[_0x28af('0x18')]+0x1;if(_0x162c64){return _0x420f24(_0x162c64);}else if(!_0x4eda9d){if(_0x5e434d[_0x28af('0x11')]){return _0x420f24(null,![],{'message':_0x28af('0x16')});}else if(_0x48c775[_0x28af('0xa')]>0x0){if(_0x5e434d[_0x28af('0x12')]){if(_0x48c775[_0x28af('0xb')]>0x0){if(moment(_0x5e434d['blockedAt'])['add'](_0x48c775[_0x28af('0xb')],_0x28af('0x19'))>moment()){return _0x420f24(null,![],{'message':_0x28af('0x16')});}else{return utils[_0x28af('0x1a')](_0x5e434d,_0x34150b,![],null)[_0x28af('0xc')](function(){return _0x420f24(null,![],{'message':_0x28af('0x16')});});}}else{return _0x420f24(null,![],{'message':_0x28af('0x16')});}}else{if(_0x34150b>=_0x48c775['allowedLoginAttempts']){return utils[_0x28af('0x1a')](_0x5e434d,0x0,!![],moment())[_0x28af('0xc')](function(){return _0x420f24(null,![],{'message':_0x28af('0x16')});});}else{return utils[_0x28af('0x1a')](_0x5e434d,_0x34150b,![],null)[_0x28af('0xc')](function(){return _0x420f24(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x420f24(null,![],{'message':_0x28af('0x16')});}}else{if(_0x5e434d[_0x28af('0x11')]){return _0x420f24(null,![],{'message':_0x28af('0x16')});}else if(_0x48c775[_0x28af('0xa')]>0x0){if(_0x5e434d[_0x28af('0x12')]){if(_0x48c775[_0x28af('0xb')]>0x0){if(moment(_0x5e434d[_0x28af('0x13')])[_0x28af('0x1b')](_0x48c775[_0x28af('0xb')],_0x28af('0x19'))>moment()){return _0x420f24(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x28af('0x1a')](_0x5e434d,0x0,![],null)[_0x28af('0xc')](function(){return utils[_0x28af('0x1c')](_0x5e434d);})['then'](function(){return _0x420f24(null,_0x5e434d);});}}else{return _0x420f24(null,![],{'message':_0x28af('0x16')});}}else{return utils['clearBlockUser'](_0x5e434d,0x0,![],null)[_0x28af('0xc')](function(){return utils[_0x28af('0x1c')](_0x5e434d);})[_0x28af('0xc')](function(){return _0x420f24(null,_0x5e434d);})['catch'](function(_0x5ece3e){return _0x420f24(null,![],_0x5ece3e);});}}else{if(_0x5e434d['blocked']){return _0x420f24(null,![],{'message':_0x28af('0x16')});}else{return utils['getLicense'](_0x5e434d)[_0x28af('0xc')](function(){return _0x420f24(null,_0x5e434d);});}}}});})[_0x28af('0x1d')](function(_0x92d2f8){return _0x420f24(null,![],_0x92d2f8);});}function sendServiceMail(_0x22248c){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0x28af('0x1e')],'include':[{'model':db[_0x28af('0x1f')],'as':_0x28af('0x20'),'include':[{'model':db['CloudProvider'],'as':_0x28af('0x21')}]}]})[_0x28af('0xc')](function(_0x6c5fd6){if(!_0x6c5fd6){throw new Error(_0x28af('0x22'));}var _0x4da382=_0x6c5fd6[_0x28af('0x23')]();var _0x3854ae={'account':_0x4da382,'message':_[_0x28af('0x24')]({'from':util[_0x28af('0x25')](_0x28af('0x26'),_0x6c5fd6[_0x28af('0xd')],_0x6c5fd6[_0x28af('0x1e')]||_0x6c5fd6['Smtp'][_0x28af('0x15')])},_0x22248c)};return client['request'](_0x28af('0x27'),_0x3854ae);})[_0x28af('0xc')](function(_0x3117ab){if(_0x3117ab[_0x28af('0x28')]){throw new Error(util[_0x28af('0x25')](_0x28af('0x29'),_0x3117ab[_0x28af('0x28')][_0x28af('0x2a')]||JSON[_0x28af('0x2b')](_0x3117ab[_0x28af('0x28')])));}return!![];});}function handleError(_0x5eaec5,_0x4dbba5,_0x3ceb91){return _0x5eaec5[_0x28af('0x2c')](_0x4dbba5||0x1f4)[_0x28af('0x2d')]({'message':_0x3ceb91?_0x3ceb91[_0x28af('0x2a')]||_0x3ceb91:''});}exports['login']=function(_0x34563f,_0x30bdcd,_0x53053a){passport[_0x28af('0x17')](_0x28af('0x2e'),function(_0x59c1a8,_0x313663,_0x13c0b4){var _0x5c5008=_0x59c1a8||_0x13c0b4;if(_0x5c5008){return handleError(_0x30bdcd,0x191,_0x5c5008);}if(!_0x313663){return handleError(_0x30bdcd,0x194,{'message':_0x28af('0x2f')});}else{var _0x1895fa={'payload':{'id':_0x313663['id'],'role':_0x313663[_0x28af('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x28af('0x30')](_0x1895fa)[_0x28af('0xc')](function(_0x9b458){_0x30bdcd[_0x28af('0x31')]({'id':_0x313663['id'],'token':_0x9b458,'statusCall':'','isAlreadyLogged':_0x313663[_0x28af('0x32')]});});}})(_0x34563f,_0x30bdcd,_0x53053a);};exports[_0x28af('0x33')]=function(_0xb09185,_0x97149e){if(!_0xb09185[_0x28af('0x34')][_0x28af('0x1e')]){return handleError(_0x97149e,0x1f4,{'message':_0x28af('0x35')});}var _0x49f73b=rs[_0x28af('0x36')]();_0xb09185['body'][_0x28af('0x1e')]=_0xb09185[_0x28af('0x34')][_0x28af('0x1e')][_0x28af('0x37')]()[_0x28af('0x38')]();var _0xee3935;return db[_0x28af('0x39')]['findOne']({'where':{'id':0x1},'attributes':[_0x28af('0xa'),_0x28af('0xb')],'raw':!![]})[_0x28af('0xc')](function(_0x396795){_0xee3935=_0x396795;return db['User'][_0x28af('0x3a')]({'where':{'email':_0xb09185[_0x28af('0x34')][_0x28af('0x1e')]}});})[_0x28af('0xc')](function(_0x3dda4c){if(!_0x3dda4c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3dda4c[_0x28af('0x11')]){throw new Error(_0x28af('0x3b'));}if(_0x3dda4c['blocked']){if(moment(_0x3dda4c[_0x28af('0x13')])['add'](_0xee3935['blockDuration'],_0x28af('0x19'))>moment()){throw new Error(_0x28af('0x3c'));}else{_0x3dda4c['blocked']=![];_0x3dda4c['blockedAt']=null;}}_0x3dda4c[_0x28af('0x3d')]=_0x49f73b;_0x3dda4c['resetPasswordExpires']=Date[_0x28af('0x3e')]()+0x36ee80;return _0x3dda4c[_0x28af('0x3f')]();})[_0x28af('0xc')](function(){return sendServiceMail({'to':_0xb09185['body']['email'],'subject':_0x28af('0x40'),'text':_0x28af('0x41')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x28af('0x42')+_0xb09185[_0x28af('0x43')][_0x28af('0x44')]+'/reset/'+_0x49f73b+'\x0a\x0a'+_0x28af('0x45')});})[_0x28af('0xc')](function(){_0x97149e[_0x28af('0x2c')](0xc8)[_0x28af('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0x28af('0x1d')](function(_0x4019f0){return handleError(_0x97149e,0x1f4,_0x4019f0);});};exports[_0x28af('0x46')]=function(_0x48a1c7,_0x5cfe4a){return db[_0x28af('0x47')][_0x28af('0x3a')]({'where':{'resetPasswordToken':_0x48a1c7[_0x28af('0x48')][_0x28af('0x49')],'resetPasswordExpires':{'$gt':Date[_0x28af('0x3e')]()}}})[_0x28af('0xc')](function(_0x40ea31){if(!_0x40ea31){throw new Error(_0x28af('0x4a'));}return db['Setting'][_0x28af('0x9')]({'attributes':['id',_0x28af('0x4b'),_0x28af('0x4c'),'passwordHistoryLimit']})[_0x28af('0xc')](function(_0x1859e0){if(_0x1859e0['securePassword'])authService[_0x28af('0x4d')](_0x48a1c7['body'][_0x28af('0xe')]);if(!_0x1859e0[_0x28af('0x4c')]||!_0x40ea31['previousPasswords'])return _0x40ea31;authService[_0x28af('0x4e')](_0x48a1c7[_0x28af('0x34')][_0x28af('0xe')],_0x40ea31[_0x28af('0x4f')],_0x1859e0[_0x28af('0x50')]);return _0x40ea31;})[_0x28af('0xc')](function(){_0x40ea31[_0x28af('0xe')]=_0x48a1c7[_0x28af('0x34')][_0x28af('0xe')];_0x40ea31[_0x28af('0x3d')]=null;_0x40ea31['resetPasswordExpires']=null;return _0x40ea31[_0x28af('0x3f')]();});})[_0x28af('0xc')](function(){_0x5cfe4a[_0x28af('0x2c')](0xc8)[_0x28af('0x2d')]({'message':_0x28af('0x51')});})[_0x28af('0x1d')](function(_0x18f37a){return handleError(_0x5cfe4a,0x1f4,_0x18f37a);});};passport[_0x28af('0x52')](_0x28af('0x2e'),new LocalStrategy({'usernameField':_0x28af('0xd'),'passwordField':_0x28af('0xe')},function(_0x4ddac5,_0x25730e,_0x549896){return localAuthenticate(db['User'],_0x4ddac5,_0x25730e,_0x549896);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8520a85..5eac1c4 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c3c=['express','Router','./authLocal.controller','login','forgot','post','reset','exports'];(function(_0xf8d473,_0x5e7c9d){var _0x24482e=function(_0x26e956){while(--_0x26e956){_0xf8d473['push'](_0xf8d473['shift']());}};_0x24482e(++_0x5e7c9d);}(_0x8c3c,0xf0));var _0xc8c3=function(_0x1f261e,_0x435698){_0x1f261e=_0x1f261e-0x0;var _0x14fd33=_0x8c3c[_0x1f261e];return _0x14fd33;};'use strict';var express=require(_0xc8c3('0x0'));var router=express[_0xc8c3('0x1')]();var controller=require(_0xc8c3('0x2'));router['post']('/',controller[_0xc8c3('0x3')]);router['post']('/forgot',controller[_0xc8c3('0x4')]);router[_0xc8c3('0x5')]('/reset/:token',controller[_0xc8c3('0x6')]);module[_0xc8c3('0x7')]=router;
\ No newline at end of file
+var _0x9e30=['/forgot','forgot','reset','exports','express','Router','./authLocal.controller','post','login'];(function(_0x1e9483,_0x1a4949){var _0x4b7e09=function(_0x3aa731){while(--_0x3aa731){_0x1e9483['push'](_0x1e9483['shift']());}};_0x4b7e09(++_0x1a4949);}(_0x9e30,0x70));var _0x09e3=function(_0x53ba51,_0x2f2321){_0x53ba51=_0x53ba51-0x0;var _0x2e776e=_0x9e30[_0x53ba51];return _0x2e776e;};'use strict';var express=require(_0x09e3('0x0'));var router=express[_0x09e3('0x1')]();var controller=require(_0x09e3('0x2'));router[_0x09e3('0x3')]('/',controller[_0x09e3('0x4')]);router[_0x09e3('0x3')](_0x09e3('0x5'),controller[_0x09e3('0x6')]);router[_0x09e3('0x3')]('/reset/:token',controller[_0x09e3('0x7')]);module[_0x09e3('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6d0a85c..e295830 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x164c=['INTEGER','sequelize','exports','STRING'];(function(_0x3eecd2,_0x2d39d0){var _0x31c001=function(_0x51a9ac){while(--_0x51a9ac){_0x3eecd2['push'](_0x3eecd2['shift']());}};_0x31c001(++_0x2d39d0);}(_0x164c,0xc5));var _0xc164=function(_0x18b2ba,_0x9375f6){_0x18b2ba=_0x18b2ba-0x0;var _0x11f941=_0x164c[_0x18b2ba];return _0x11f941;};'use strict';var Sequelize=require(_0xc164('0x0'));module[_0xc164('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc164('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc164('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8ede=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1055a9,_0x223227){var _0x782f61=function(_0xcc9e30){while(--_0xcc9e30){_0x1055a9['push'](_0x1055a9['shift']());}};_0x782f61(++_0x223227);}(_0x8ede,0x1f0));var _0xe8ed=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ede[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe8ed('0x0'));module[_0xe8ed('0x1')]={'name':{'type':Sequelize[_0xe8ed('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe8ed('0x2')]},'description':{'type':Sequelize[_0xe8ed('0x2')]},'status':{'type':Sequelize[_0xe8ed('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe8ed('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 78454fb..a062eed 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa992=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','options','Automation','count','includeAll','include','rows','show','params','keys','find','create','body','catch','addConditions','Condition','ids','getConditions','addActions','Action','omit','getActions','findOne','eml-format','rimraf','request-promise','moment','util','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','key','model','query','intersection'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa992,0x15a));var _0x2a99=function(_0x236abc,_0x40db12){_0x236abc=_0x236abc-0x0;var _0x3e82f5=_0xa992[_0x236abc];return _0x3e82f5;};'use strict';var emlformat=require(_0x2a99('0x0'));var rimraf=require(_0x2a99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2a99('0x2'));var moment=require(_0x2a99('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a99('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2a99('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a99('0x6'));var squel=require('squel');var crypto=require(_0x2a99('0x7'));var jsforce=require(_0x2a99('0x8'));var deskjs=require(_0x2a99('0x9'));var toCsv=require(_0x2a99('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2a99('0xa'));var authService=require(_0x2a99('0xb'));var qs=require(_0x2a99('0xc'));var as=require(_0x2a99('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a99('0xe'))(_0x2a99('0xf'));var utils=require(_0x2a99('0x10'));var config=require(_0x2a99('0x11'));var licenseUtil=require(_0x2a99('0x12'));var db=require(_0x2a99('0x13'))['db'];function respondWithStatusCode(_0xc77e78,_0x3f67a7){_0x3f67a7=_0x3f67a7||0xcc;return function(_0x1263f4){if(_0x1263f4){return _0xc77e78[_0x2a99('0x14')](_0x3f67a7);}return _0xc77e78[_0x2a99('0x15')](_0x3f67a7)[_0x2a99('0x16')]();};}function respondWithResult(_0x39c5f9,_0x52a6e7){_0x52a6e7=_0x52a6e7||0xc8;return function(_0x2d2202){if(_0x2d2202){return _0x39c5f9[_0x2a99('0x15')](_0x52a6e7)['json'](_0x2d2202);}};}function respondWithFilteredResult(_0xfe9379,_0xd7c212){return function(_0x2d44d5){if(_0x2d44d5){var _0x49123b=typeof _0xd7c212[_0x2a99('0x17')]===_0x2a99('0x18')&&typeof _0xd7c212['limit']==='undefined';var _0x4f5ec0=_0x2d44d5['count'];var _0x5432eb=_0x49123b?0x0:_0xd7c212[_0x2a99('0x17')];var _0x3e1234=_0x49123b?_0x2d44d5['count']:_0xd7c212[_0x2a99('0x17')]+_0xd7c212[_0x2a99('0x19')];var _0x4ea8de;if(_0x3e1234>=_0x4f5ec0){_0x3e1234=_0x4f5ec0;_0x4ea8de=0xc8;}else{_0x4ea8de=0xce;}_0xfe9379[_0x2a99('0x15')](_0x4ea8de);return _0xfe9379[_0x2a99('0x1a')]('Content-Range',_0x5432eb+'-'+_0x3e1234+'/'+_0x4f5ec0)[_0x2a99('0x1b')](_0x2d44d5);}return null;};}function patchUpdates(_0x474f45){return function(_0x2fc1d8){try{jsonpatch[_0x2a99('0x1c')](_0x2fc1d8,_0x474f45,!![]);}catch(_0x52c91c){return BPromise[_0x2a99('0x1d')](_0x52c91c);}return _0x2fc1d8[_0x2a99('0x1e')]();};}function saveUpdates(_0x3c9ab4,_0x32a28d){return function(_0x2d19d9){if(_0x2d19d9){return _0x2d19d9[_0x2a99('0x1f')](_0x3c9ab4)[_0x2a99('0x20')](function(_0x5642e7){return _0x5642e7;});}return null;};}function removeEntity(_0x3495ec,_0x5c8be7){return function(_0x1398f3){if(_0x1398f3){return _0x1398f3[_0x2a99('0x21')]()[_0x2a99('0x20')](function(){_0x3495ec[_0x2a99('0x15')](0xcc)[_0x2a99('0x16')]();});}};}function handleEntityNotFound(_0x2fd9b3,_0x1ffb89){return function(_0x289bcc){if(!_0x289bcc){_0x2fd9b3[_0x2a99('0x14')](0x194);}return _0x289bcc;};}function handleError(_0x960dc6,_0x3e8828){_0x3e8828=_0x3e8828||0x1f4;return function(_0x32355a){logger[_0x2a99('0x22')](_0x32355a[_0x2a99('0x23')]);if(_0x32355a[_0x2a99('0x24')]){delete _0x32355a['name'];}_0x960dc6[_0x2a99('0x15')](_0x3e8828)[_0x2a99('0x25')](_0x32355a);};}exports['index']=function(_0x291353,_0x1d88ae){var _0x52c212={},_0x105ad1={},_0x525932={'count':0x0,'rows':[]};var _0x2a8f5e=_[_0x2a99('0x26')](db['Automation'][_0x2a99('0x27')],function(_0x356661){return{'name':_0x356661['fieldName'],'type':_0x356661['type'][_0x2a99('0x28')]};});_0x105ad1[_0x2a99('0x29')]=_[_0x2a99('0x26')](_0x2a8f5e,'name');_0x105ad1['query']=_['keys'](_0x291353[_0x2a99('0x2a')]);_0x105ad1['filters']=_[_0x2a99('0x2b')](_0x105ad1[_0x2a99('0x29')],_0x105ad1[_0x2a99('0x2a')]);_0x52c212[_0x2a99('0x2c')]=_[_0x2a99('0x2b')](_0x105ad1[_0x2a99('0x29')],qs[_0x2a99('0x2d')](_0x291353[_0x2a99('0x2a')][_0x2a99('0x2d')]));_0x52c212[_0x2a99('0x2c')]=_0x52c212[_0x2a99('0x2c')][_0x2a99('0x2e')]?_0x52c212['attributes']:_0x105ad1[_0x2a99('0x29')];if(!_0x291353[_0x2a99('0x2a')][_0x2a99('0x2f')](_0x2a99('0x30'))){_0x52c212[_0x2a99('0x19')]=qs[_0x2a99('0x19')](_0x291353[_0x2a99('0x2a')][_0x2a99('0x19')]);_0x52c212[_0x2a99('0x17')]=qs['offset'](_0x291353[_0x2a99('0x2a')][_0x2a99('0x17')]);}_0x52c212[_0x2a99('0x31')]=qs[_0x2a99('0x32')](_0x291353[_0x2a99('0x2a')][_0x2a99('0x32')]);_0x52c212['where']=qs[_0x2a99('0x33')](_['pick'](_0x291353[_0x2a99('0x2a')],_0x105ad1[_0x2a99('0x33')]),_0x2a8f5e);if(_0x291353[_0x2a99('0x2a')][_0x2a99('0x34')]){_0x52c212[_0x2a99('0x35')]=_[_0x2a99('0x36')](_0x52c212[_0x2a99('0x35')],{'$or':_['map'](_0x2a8f5e,function(_0x5c0329){if(_0x5c0329[_0x2a99('0x37')]!=='VIRTUAL'){var _0x26b079={};_0x26b079[_0x5c0329[_0x2a99('0x24')]]={'$like':'%'+_0x291353[_0x2a99('0x2a')]['filter']+'%'};return _0x26b079;}})});}_0x52c212=_['merge']({},_0x52c212,_0x291353[_0x2a99('0x38')]);var _0x446938={'where':_0x52c212[_0x2a99('0x35')]};return db[_0x2a99('0x39')][_0x2a99('0x3a')](_0x446938)['then'](function(_0x38a6e9){_0x525932[_0x2a99('0x3a')]=_0x38a6e9;if(_0x291353[_0x2a99('0x2a')][_0x2a99('0x3b')]){_0x52c212[_0x2a99('0x3c')]=[{'all':!![]}];}return db[_0x2a99('0x39')]['findAll'](_0x52c212);})[_0x2a99('0x20')](function(_0x4dd1b9){_0x525932[_0x2a99('0x3d')]=_0x4dd1b9;return _0x525932;})['then'](respondWithFilteredResult(_0x1d88ae,_0x52c212))['catch'](handleError(_0x1d88ae,null));};exports[_0x2a99('0x3e')]=function(_0x4619a8,_0x401996){var _0x16d5b5={'raw':![],'where':{'id':_0x4619a8[_0x2a99('0x3f')]['id']}},_0x1577f0={};_0x1577f0['model']=_['keys'](db['Automation'][_0x2a99('0x27')]);_0x1577f0[_0x2a99('0x2a')]=_[_0x2a99('0x40')](_0x4619a8[_0x2a99('0x2a')]);_0x1577f0[_0x2a99('0x33')]=_[_0x2a99('0x2b')](_0x1577f0['model'],_0x1577f0[_0x2a99('0x2a')]);_0x16d5b5[_0x2a99('0x2c')]=_[_0x2a99('0x2b')](_0x1577f0[_0x2a99('0x29')],qs[_0x2a99('0x2d')](_0x4619a8[_0x2a99('0x2a')][_0x2a99('0x2d')]));_0x16d5b5['attributes']=_0x16d5b5[_0x2a99('0x2c')][_0x2a99('0x2e')]?_0x16d5b5[_0x2a99('0x2c')]:_0x1577f0[_0x2a99('0x29')];if(_0x4619a8[_0x2a99('0x2a')][_0x2a99('0x3b')]){_0x16d5b5[_0x2a99('0x3c')]=[{'all':!![]}];}_0x16d5b5=_[_0x2a99('0x36')]({},_0x16d5b5,_0x4619a8['options']);return db[_0x2a99('0x39')][_0x2a99('0x41')](_0x16d5b5)[_0x2a99('0x20')](handleEntityNotFound(_0x401996,null))['then'](respondWithResult(_0x401996,null))['catch'](handleError(_0x401996,null));};exports[_0x2a99('0x42')]=function(_0xd25cf9,_0x56a045){return db[_0x2a99('0x39')][_0x2a99('0x42')](_0xd25cf9[_0x2a99('0x43')],{})[_0x2a99('0x20')](respondWithResult(_0x56a045,0xc9))['catch'](handleError(_0x56a045,null));};exports[_0x2a99('0x1f')]=function(_0x40366e,_0x2ae688){if(_0x40366e[_0x2a99('0x43')]['id']){delete _0x40366e[_0x2a99('0x43')]['id'];}return db['Automation'][_0x2a99('0x41')]({'where':{'id':_0x40366e['params']['id']}})[_0x2a99('0x20')](handleEntityNotFound(_0x2ae688,null))['then'](saveUpdates(_0x40366e[_0x2a99('0x43')],null))[_0x2a99('0x20')](respondWithResult(_0x2ae688,null))[_0x2a99('0x44')](handleError(_0x2ae688,null));};exports['destroy']=function(_0x3caa5f,_0x54005b){return db[_0x2a99('0x39')]['find']({'where':{'id':_0x3caa5f['params']['id']}})[_0x2a99('0x20')](handleEntityNotFound(_0x54005b,null))[_0x2a99('0x20')](removeEntity(_0x54005b,null))['catch'](handleError(_0x54005b,null));};exports[_0x2a99('0x45')]=function(_0x22e243,_0x1f9ec9,_0x1114c3){return db[_0x2a99('0x46')][_0x2a99('0x41')]({'where':{'id':_0x22e243['params']['id']}})[_0x2a99('0x20')](handleEntityNotFound(_0x1f9ec9,null))[_0x2a99('0x20')](function(_0x5b2527){if(_0x5b2527){return _0x5b2527[_0x2a99('0x45')](_0x22e243[_0x2a99('0x43')]['ids'],_['omit'](_0x22e243[_0x2a99('0x43')],[_0x2a99('0x47'),'id'])||{});}})['then'](respondWithResult(_0x1f9ec9,null))[_0x2a99('0x44')](handleError(_0x1f9ec9,null));};exports[_0x2a99('0x48')]=function(_0x4f52aa,_0x465da8,_0x3dc4db){var _0x2ceb89={};var _0x2baf05={};var _0x3b88a2;var _0x89719b;return db[_0x2a99('0x39')]['findOne']({'where':{'id':_0x4f52aa['params']['id']}})['then'](handleEntityNotFound(_0x465da8,null))[_0x2a99('0x20')](function(_0x2fd93c){if(_0x2fd93c){_0x3b88a2=_0x2fd93c;_0x2baf05[_0x2a99('0x29')]=_['keys'](db[_0x2a99('0x46')][_0x2a99('0x27')]);_0x2baf05[_0x2a99('0x2a')]=_[_0x2a99('0x40')](_0x4f52aa[_0x2a99('0x2a')]);_0x2baf05[_0x2a99('0x33')]=_['intersection'](_0x2baf05[_0x2a99('0x29')],_0x2baf05[_0x2a99('0x2a')]);_0x2ceb89['attributes']=_['intersection'](_0x2baf05['model'],qs[_0x2a99('0x2d')](_0x4f52aa['query'][_0x2a99('0x2d')]));_0x2ceb89[_0x2a99('0x2c')]=_0x2ceb89['attributes'][_0x2a99('0x2e')]?_0x2ceb89[_0x2a99('0x2c')]:_0x2baf05['model'];_0x2ceb89['order']=qs[_0x2a99('0x32')](_0x4f52aa[_0x2a99('0x2a')][_0x2a99('0x32')]);_0x2ceb89[_0x2a99('0x35')]=qs['filters'](_['pick'](_0x4f52aa[_0x2a99('0x2a')],_0x2baf05['filters']));if(_0x4f52aa['query'][_0x2a99('0x34')]){_0x2ceb89[_0x2a99('0x35')]=_[_0x2a99('0x36')](_0x2ceb89[_0x2a99('0x35')],{'$or':_[_0x2a99('0x26')](_0x2ceb89['attributes'],function(_0xe2b3ad){var _0xb867ea={};_0xb867ea[_0xe2b3ad]={'$like':'%'+_0x4f52aa[_0x2a99('0x2a')][_0x2a99('0x34')]+'%'};return _0xb867ea;})});}_0x2ceb89=_['merge']({},_0x2ceb89,_0x4f52aa[_0x2a99('0x38')]);return _0x3b88a2[_0x2a99('0x48')](_0x2ceb89);}})['then'](function(_0x11267b){if(_0x11267b){_0x89719b=_0x11267b[_0x2a99('0x2e')];if(!_0x4f52aa[_0x2a99('0x2a')][_0x2a99('0x2f')](_0x2a99('0x30'))){_0x2ceb89[_0x2a99('0x19')]=qs[_0x2a99('0x19')](_0x4f52aa[_0x2a99('0x2a')]['limit']);_0x2ceb89[_0x2a99('0x17')]=qs[_0x2a99('0x17')](_0x4f52aa[_0x2a99('0x2a')]['offset']);}return _0x3b88a2[_0x2a99('0x48')](_0x2ceb89);}})['then'](function(_0x24de3f){if(_0x24de3f){return _0x24de3f?{'count':_0x89719b,'rows':_0x24de3f}:null;}})['then'](respondWithResult(_0x465da8,null))[_0x2a99('0x44')](handleError(_0x465da8,null));};exports[_0x2a99('0x49')]=function(_0xcc6584,_0x290859,_0x3c1661){return db[_0x2a99('0x4a')][_0x2a99('0x41')]({'where':{'id':_0xcc6584[_0x2a99('0x3f')]['id']}})[_0x2a99('0x20')](handleEntityNotFound(_0x290859,null))['then'](function(_0x69501a){if(_0x69501a){return _0x69501a[_0x2a99('0x49')](_0xcc6584[_0x2a99('0x43')][_0x2a99('0x47')],_[_0x2a99('0x4b')](_0xcc6584[_0x2a99('0x43')],[_0x2a99('0x47'),'id'])||{});}})['then'](respondWithResult(_0x290859,null))[_0x2a99('0x44')](handleError(_0x290859,null));};exports[_0x2a99('0x4c')]=function(_0x2112f,_0x326e47,_0x59e1ea){var _0x26991a={};var _0x327ae9={};var _0x56aab9;var _0x36c950;return db[_0x2a99('0x39')][_0x2a99('0x4d')]({'where':{'id':_0x2112f[_0x2a99('0x3f')]['id']}})[_0x2a99('0x20')](handleEntityNotFound(_0x326e47,null))[_0x2a99('0x20')](function(_0x4838ba){if(_0x4838ba){_0x56aab9=_0x4838ba;_0x327ae9[_0x2a99('0x29')]=_[_0x2a99('0x40')](db[_0x2a99('0x4a')]['rawAttributes']);_0x327ae9['query']=_[_0x2a99('0x40')](_0x2112f[_0x2a99('0x2a')]);_0x327ae9[_0x2a99('0x33')]=_[_0x2a99('0x2b')](_0x327ae9[_0x2a99('0x29')],_0x327ae9['query']);_0x26991a[_0x2a99('0x2c')]=_['intersection'](_0x327ae9['model'],qs[_0x2a99('0x2d')](_0x2112f[_0x2a99('0x2a')]['fields']));_0x26991a['attributes']=_0x26991a[_0x2a99('0x2c')][_0x2a99('0x2e')]?_0x26991a['attributes']:_0x327ae9[_0x2a99('0x29')];_0x26991a['order']=qs['sort'](_0x2112f[_0x2a99('0x2a')][_0x2a99('0x32')]);_0x26991a[_0x2a99('0x35')]=qs[_0x2a99('0x33')](_['pick'](_0x2112f[_0x2a99('0x2a')],_0x327ae9[_0x2a99('0x33')]));if(_0x2112f[_0x2a99('0x2a')][_0x2a99('0x34')]){_0x26991a[_0x2a99('0x35')]=_[_0x2a99('0x36')](_0x26991a['where'],{'$or':_[_0x2a99('0x26')](_0x26991a[_0x2a99('0x2c')],function(_0x2c687c){var _0x55aa36={};_0x55aa36[_0x2c687c]={'$like':'%'+_0x2112f[_0x2a99('0x2a')]['filter']+'%'};return _0x55aa36;})});}_0x26991a=_[_0x2a99('0x36')]({},_0x26991a,_0x2112f[_0x2a99('0x38')]);return _0x56aab9[_0x2a99('0x4c')](_0x26991a);}})[_0x2a99('0x20')](function(_0x36a2d0){if(_0x36a2d0){_0x36c950=_0x36a2d0['length'];if(!_0x2112f[_0x2a99('0x2a')]['hasOwnProperty'](_0x2a99('0x30'))){_0x26991a['limit']=qs[_0x2a99('0x19')](_0x2112f[_0x2a99('0x2a')][_0x2a99('0x19')]);_0x26991a[_0x2a99('0x17')]=qs[_0x2a99('0x17')](_0x2112f[_0x2a99('0x2a')][_0x2a99('0x17')]);}return _0x56aab9[_0x2a99('0x4c')](_0x26991a);}})[_0x2a99('0x20')](function(_0x1a2c07){if(_0x1a2c07){return _0x1a2c07?{'count':_0x36c950,'rows':_0x1a2c07}:null;}})[_0x2a99('0x20')](respondWithResult(_0x326e47,null))[_0x2a99('0x44')](handleError(_0x326e47,null));};
\ No newline at end of file
+var _0xf3aa=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','Automation','includeAll','include','findAll','rows','show','params','merge','options','find','catch','create','body','Condition','addConditions','ids','getConditions','findOne','Action','addActions','omit','getActions','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','sendStatus','stack','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0xffb34f,_0x565dd1){var _0x1ab8d7=function(_0x8feda9){while(--_0x8feda9){_0xffb34f['push'](_0xffb34f['shift']());}};_0x1ab8d7(++_0x565dd1);}(_0xf3aa,0x70));var _0xaf3a=function(_0x5bb818,_0x57780a){_0x5bb818=_0x5bb818-0x0;var _0xc56b13=_0xf3aa[_0x5bb818];return _0xc56b13;};'use strict';var emlformat=require(_0xaf3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf3a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf3a('0x2'));var moment=require('moment');var BPromise=require(_0xaf3a('0x3'));var Mustache=require('mustache');var util=require(_0xaf3a('0x4'));var path=require(_0xaf3a('0x5'));var sox=require(_0xaf3a('0x6'));var csv=require(_0xaf3a('0x7'));var ejs=require(_0xaf3a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf3a('0x9'));var squel=require(_0xaf3a('0xa'));var crypto=require(_0xaf3a('0xb'));var jsforce=require(_0xaf3a('0xc'));var deskjs=require(_0xaf3a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaf3a('0xe'));var Papa=require(_0xaf3a('0xf'));var Redis=require(_0xaf3a('0x10'));var authService=require(_0xaf3a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf3a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf3a('0x13'))('api');var utils=require(_0xaf3a('0x14'));var config=require(_0xaf3a('0x15'));var licenseUtil=require(_0xaf3a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124675,_0x162b1d){_0x162b1d=_0x162b1d||0xcc;return function(_0x39fd1f){if(_0x39fd1f){return _0x124675['sendStatus'](_0x162b1d);}return _0x124675['status'](_0x162b1d)[_0xaf3a('0x17')]();};}function respondWithResult(_0x1ccc03,_0x4480e6){_0x4480e6=_0x4480e6||0xc8;return function(_0x27899d){if(_0x27899d){return _0x1ccc03[_0xaf3a('0x18')](_0x4480e6)['json'](_0x27899d);}};}function respondWithFilteredResult(_0x510729,_0xc9e695){return function(_0x470ef9){if(_0x470ef9){var _0x27b645=typeof _0xc9e695['offset']===_0xaf3a('0x19')&&typeof _0xc9e695[_0xaf3a('0x1a')]===_0xaf3a('0x19');var _0x2fa3f5=_0x470ef9[_0xaf3a('0x1b')];var _0x5e1885=_0x27b645?0x0:_0xc9e695[_0xaf3a('0x1c')];var _0x28a106=_0x27b645?_0x470ef9['count']:_0xc9e695[_0xaf3a('0x1c')]+_0xc9e695[_0xaf3a('0x1a')];var _0x5cb5cb;if(_0x28a106>=_0x2fa3f5){_0x28a106=_0x2fa3f5;_0x5cb5cb=0xc8;}else{_0x5cb5cb=0xce;}_0x510729[_0xaf3a('0x18')](_0x5cb5cb);return _0x510729[_0xaf3a('0x1d')](_0xaf3a('0x1e'),_0x5e1885+'-'+_0x28a106+'/'+_0x2fa3f5)[_0xaf3a('0x1f')](_0x470ef9);}return null;};}function patchUpdates(_0x1158cc){return function(_0xdb5d1a){try{jsonpatch[_0xaf3a('0x20')](_0xdb5d1a,_0x1158cc,!![]);}catch(_0x42dba0){return BPromise['reject'](_0x42dba0);}return _0xdb5d1a[_0xaf3a('0x21')]();};}function saveUpdates(_0x59346f,_0x5c0b4f){return function(_0x2e83c5){if(_0x2e83c5){return _0x2e83c5['update'](_0x59346f)[_0xaf3a('0x22')](function(_0xf42f29){return _0xf42f29;});}return null;};}function removeEntity(_0x511eb5,_0x21875b){return function(_0x3e613f){if(_0x3e613f){return _0x3e613f[_0xaf3a('0x23')]()[_0xaf3a('0x22')](function(){_0x511eb5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f03d,_0x16c56c){return function(_0x4ab44b){if(!_0x4ab44b){_0x54f03d[_0xaf3a('0x24')](0x194);}return _0x4ab44b;};}function handleError(_0xe1fa30,_0x26b1f7){_0x26b1f7=_0x26b1f7||0x1f4;return function(_0x2bc57){logger['error'](_0x2bc57[_0xaf3a('0x25')]);if(_0x2bc57['name']){delete _0x2bc57['name'];}_0xe1fa30['status'](_0x26b1f7)[_0xaf3a('0x26')](_0x2bc57);};}exports[_0xaf3a('0x27')]=function(_0xed5ec8,_0x58bf11){var _0x44db31={},_0x3d2d9a={},_0x75cbba={'count':0x0,'rows':[]};var _0x264ad1=_['map'](db['Automation'][_0xaf3a('0x28')],function(_0x31f981){return{'name':_0x31f981[_0xaf3a('0x29')],'type':_0x31f981[_0xaf3a('0x2a')]['key']};});_0x3d2d9a['model']=_[_0xaf3a('0x2b')](_0x264ad1,'name');_0x3d2d9a[_0xaf3a('0x2c')]=_[_0xaf3a('0x2d')](_0xed5ec8[_0xaf3a('0x2c')]);_0x3d2d9a[_0xaf3a('0x2e')]=_[_0xaf3a('0x2f')](_0x3d2d9a[_0xaf3a('0x30')],_0x3d2d9a[_0xaf3a('0x2c')]);_0x44db31[_0xaf3a('0x31')]=_['intersection'](_0x3d2d9a[_0xaf3a('0x30')],qs['fields'](_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x32')]));_0x44db31[_0xaf3a('0x31')]=_0x44db31[_0xaf3a('0x31')][_0xaf3a('0x33')]?_0x44db31[_0xaf3a('0x31')]:_0x3d2d9a[_0xaf3a('0x30')];if(!_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x34')](_0xaf3a('0x35'))){_0x44db31[_0xaf3a('0x1a')]=qs[_0xaf3a('0x1a')](_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x1a')]);_0x44db31[_0xaf3a('0x1c')]=qs[_0xaf3a('0x1c')](_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x1c')]);}_0x44db31[_0xaf3a('0x36')]=qs[_0xaf3a('0x37')](_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x37')]);_0x44db31['where']=qs[_0xaf3a('0x2e')](_[_0xaf3a('0x38')](_0xed5ec8[_0xaf3a('0x2c')],_0x3d2d9a[_0xaf3a('0x2e')]),_0x264ad1);if(_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x39')]){_0x44db31[_0xaf3a('0x3a')]=_['merge'](_0x44db31[_0xaf3a('0x3a')],{'$or':_[_0xaf3a('0x2b')](_0x264ad1,function(_0x551416){if(_0x551416['type']!==_0xaf3a('0x3b')){var _0x21320c={};_0x21320c[_0x551416['name']]={'$like':'%'+_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x39')]+'%'};return _0x21320c;}})});}_0x44db31=_['merge']({},_0x44db31,_0xed5ec8['options']);var _0x2bb2cf={'where':_0x44db31[_0xaf3a('0x3a')]};return db[_0xaf3a('0x3c')]['count'](_0x2bb2cf)[_0xaf3a('0x22')](function(_0x18b56d){_0x75cbba[_0xaf3a('0x1b')]=_0x18b56d;if(_0xed5ec8[_0xaf3a('0x2c')][_0xaf3a('0x3d')]){_0x44db31[_0xaf3a('0x3e')]=[{'all':!![]}];}return db[_0xaf3a('0x3c')][_0xaf3a('0x3f')](_0x44db31);})['then'](function(_0xed0ec5){_0x75cbba[_0xaf3a('0x40')]=_0xed0ec5;return _0x75cbba;})[_0xaf3a('0x22')](respondWithFilteredResult(_0x58bf11,_0x44db31))['catch'](handleError(_0x58bf11,null));};exports[_0xaf3a('0x41')]=function(_0x7344b1,_0x78789e){var _0x1e2d81={'raw':![],'where':{'id':_0x7344b1[_0xaf3a('0x42')]['id']}},_0x2cea40={};_0x2cea40[_0xaf3a('0x30')]=_['keys'](db[_0xaf3a('0x3c')]['rawAttributes']);_0x2cea40[_0xaf3a('0x2c')]=_['keys'](_0x7344b1[_0xaf3a('0x2c')]);_0x2cea40['filters']=_[_0xaf3a('0x2f')](_0x2cea40[_0xaf3a('0x30')],_0x2cea40[_0xaf3a('0x2c')]);_0x1e2d81[_0xaf3a('0x31')]=_[_0xaf3a('0x2f')](_0x2cea40[_0xaf3a('0x30')],qs[_0xaf3a('0x32')](_0x7344b1['query']['fields']));_0x1e2d81['attributes']=_0x1e2d81[_0xaf3a('0x31')]['length']?_0x1e2d81[_0xaf3a('0x31')]:_0x2cea40['model'];if(_0x7344b1['query'][_0xaf3a('0x3d')]){_0x1e2d81[_0xaf3a('0x3e')]=[{'all':!![]}];}_0x1e2d81=_[_0xaf3a('0x43')]({},_0x1e2d81,_0x7344b1[_0xaf3a('0x44')]);return db[_0xaf3a('0x3c')][_0xaf3a('0x45')](_0x1e2d81)[_0xaf3a('0x22')](handleEntityNotFound(_0x78789e,null))[_0xaf3a('0x22')](respondWithResult(_0x78789e,null))[_0xaf3a('0x46')](handleError(_0x78789e,null));};exports[_0xaf3a('0x47')]=function(_0x86c60d,_0x1b2041){return db[_0xaf3a('0x3c')][_0xaf3a('0x47')](_0x86c60d['body'],{})[_0xaf3a('0x22')](respondWithResult(_0x1b2041,0xc9))[_0xaf3a('0x46')](handleError(_0x1b2041,null));};exports['update']=function(_0xa8f85e,_0x4280a4){if(_0xa8f85e[_0xaf3a('0x48')]['id']){delete _0xa8f85e['body']['id'];}return db[_0xaf3a('0x3c')]['find']({'where':{'id':_0xa8f85e[_0xaf3a('0x42')]['id']}})[_0xaf3a('0x22')](handleEntityNotFound(_0x4280a4,null))[_0xaf3a('0x22')](saveUpdates(_0xa8f85e[_0xaf3a('0x48')],null))['then'](respondWithResult(_0x4280a4,null))['catch'](handleError(_0x4280a4,null));};exports[_0xaf3a('0x23')]=function(_0x58afa4,_0xf0738c){return db[_0xaf3a('0x3c')][_0xaf3a('0x45')]({'where':{'id':_0x58afa4[_0xaf3a('0x42')]['id']}})[_0xaf3a('0x22')](handleEntityNotFound(_0xf0738c,null))[_0xaf3a('0x22')](removeEntity(_0xf0738c,null))[_0xaf3a('0x46')](handleError(_0xf0738c,null));};exports['addConditions']=function(_0x4c3e28,_0x634776,_0x2c586f){return db[_0xaf3a('0x49')][_0xaf3a('0x45')]({'where':{'id':_0x4c3e28[_0xaf3a('0x42')]['id']}})[_0xaf3a('0x22')](handleEntityNotFound(_0x634776,null))['then'](function(_0x3a7517){if(_0x3a7517){return _0x3a7517[_0xaf3a('0x4a')](_0x4c3e28[_0xaf3a('0x48')][_0xaf3a('0x4b')],_['omit'](_0x4c3e28[_0xaf3a('0x48')],['ids','id'])||{});}})[_0xaf3a('0x22')](respondWithResult(_0x634776,null))[_0xaf3a('0x46')](handleError(_0x634776,null));};exports[_0xaf3a('0x4c')]=function(_0x420190,_0x279ee4,_0x136f06){var _0x41ff24={};var _0x689939={};var _0x50114c;var _0xc83d0f;return db[_0xaf3a('0x3c')][_0xaf3a('0x4d')]({'where':{'id':_0x420190[_0xaf3a('0x42')]['id']}})[_0xaf3a('0x22')](handleEntityNotFound(_0x279ee4,null))[_0xaf3a('0x22')](function(_0x43578d){if(_0x43578d){_0x50114c=_0x43578d;_0x689939['model']=_[_0xaf3a('0x2d')](db[_0xaf3a('0x49')]['rawAttributes']);_0x689939[_0xaf3a('0x2c')]=_[_0xaf3a('0x2d')](_0x420190[_0xaf3a('0x2c')]);_0x689939['filters']=_['intersection'](_0x689939['model'],_0x689939[_0xaf3a('0x2c')]);_0x41ff24['attributes']=_[_0xaf3a('0x2f')](_0x689939[_0xaf3a('0x30')],qs[_0xaf3a('0x32')](_0x420190[_0xaf3a('0x2c')][_0xaf3a('0x32')]));_0x41ff24[_0xaf3a('0x31')]=_0x41ff24[_0xaf3a('0x31')][_0xaf3a('0x33')]?_0x41ff24[_0xaf3a('0x31')]:_0x689939[_0xaf3a('0x30')];_0x41ff24[_0xaf3a('0x36')]=qs[_0xaf3a('0x37')](_0x420190['query'][_0xaf3a('0x37')]);_0x41ff24['where']=qs['filters'](_['pick'](_0x420190[_0xaf3a('0x2c')],_0x689939['filters']));if(_0x420190[_0xaf3a('0x2c')][_0xaf3a('0x39')]){_0x41ff24[_0xaf3a('0x3a')]=_[_0xaf3a('0x43')](_0x41ff24[_0xaf3a('0x3a')],{'$or':_[_0xaf3a('0x2b')](_0x41ff24[_0xaf3a('0x31')],function(_0xacf0be){var _0x52c5da={};_0x52c5da[_0xacf0be]={'$like':'%'+_0x420190[_0xaf3a('0x2c')]['filter']+'%'};return _0x52c5da;})});}_0x41ff24=_[_0xaf3a('0x43')]({},_0x41ff24,_0x420190['options']);return _0x50114c['getConditions'](_0x41ff24);}})[_0xaf3a('0x22')](function(_0x4598df){if(_0x4598df){_0xc83d0f=_0x4598df['length'];if(!_0x420190[_0xaf3a('0x2c')][_0xaf3a('0x34')](_0xaf3a('0x35'))){_0x41ff24['limit']=qs[_0xaf3a('0x1a')](_0x420190[_0xaf3a('0x2c')][_0xaf3a('0x1a')]);_0x41ff24[_0xaf3a('0x1c')]=qs[_0xaf3a('0x1c')](_0x420190[_0xaf3a('0x2c')][_0xaf3a('0x1c')]);}return _0x50114c['getConditions'](_0x41ff24);}})[_0xaf3a('0x22')](function(_0x59c05d){if(_0x59c05d){return _0x59c05d?{'count':_0xc83d0f,'rows':_0x59c05d}:null;}})[_0xaf3a('0x22')](respondWithResult(_0x279ee4,null))['catch'](handleError(_0x279ee4,null));};exports['addActions']=function(_0x1feacb,_0x216114,_0x17827b){return db[_0xaf3a('0x4e')][_0xaf3a('0x45')]({'where':{'id':_0x1feacb[_0xaf3a('0x42')]['id']}})[_0xaf3a('0x22')](handleEntityNotFound(_0x216114,null))[_0xaf3a('0x22')](function(_0x1cc844){if(_0x1cc844){return _0x1cc844[_0xaf3a('0x4f')](_0x1feacb['body'][_0xaf3a('0x4b')],_[_0xaf3a('0x50')](_0x1feacb[_0xaf3a('0x48')],['ids','id'])||{});}})[_0xaf3a('0x22')](respondWithResult(_0x216114,null))[_0xaf3a('0x46')](handleError(_0x216114,null));};exports[_0xaf3a('0x51')]=function(_0x43bc8d,_0x1b6171,_0x4ce387){var _0xfb96e2={};var _0x54026c={};var _0x53e081;var _0x1e0e26;return db[_0xaf3a('0x3c')][_0xaf3a('0x4d')]({'where':{'id':_0x43bc8d[_0xaf3a('0x42')]['id']}})[_0xaf3a('0x22')](handleEntityNotFound(_0x1b6171,null))[_0xaf3a('0x22')](function(_0x1572fa){if(_0x1572fa){_0x53e081=_0x1572fa;_0x54026c[_0xaf3a('0x30')]=_[_0xaf3a('0x2d')](db[_0xaf3a('0x4e')]['rawAttributes']);_0x54026c[_0xaf3a('0x2c')]=_[_0xaf3a('0x2d')](_0x43bc8d[_0xaf3a('0x2c')]);_0x54026c['filters']=_[_0xaf3a('0x2f')](_0x54026c[_0xaf3a('0x30')],_0x54026c['query']);_0xfb96e2[_0xaf3a('0x31')]=_[_0xaf3a('0x2f')](_0x54026c[_0xaf3a('0x30')],qs[_0xaf3a('0x32')](_0x43bc8d[_0xaf3a('0x2c')][_0xaf3a('0x32')]));_0xfb96e2[_0xaf3a('0x31')]=_0xfb96e2[_0xaf3a('0x31')][_0xaf3a('0x33')]?_0xfb96e2[_0xaf3a('0x31')]:_0x54026c['model'];_0xfb96e2['order']=qs[_0xaf3a('0x37')](_0x43bc8d[_0xaf3a('0x2c')]['sort']);_0xfb96e2['where']=qs[_0xaf3a('0x2e')](_['pick'](_0x43bc8d['query'],_0x54026c[_0xaf3a('0x2e')]));if(_0x43bc8d[_0xaf3a('0x2c')]['filter']){_0xfb96e2[_0xaf3a('0x3a')]=_['merge'](_0xfb96e2[_0xaf3a('0x3a')],{'$or':_[_0xaf3a('0x2b')](_0xfb96e2[_0xaf3a('0x31')],function(_0x14f3f2){var _0x276736={};_0x276736[_0x14f3f2]={'$like':'%'+_0x43bc8d[_0xaf3a('0x2c')][_0xaf3a('0x39')]+'%'};return _0x276736;})});}_0xfb96e2=_[_0xaf3a('0x43')]({},_0xfb96e2,_0x43bc8d[_0xaf3a('0x44')]);return _0x53e081['getActions'](_0xfb96e2);}})['then'](function(_0xe61747){if(_0xe61747){_0x1e0e26=_0xe61747[_0xaf3a('0x33')];if(!_0x43bc8d['query'][_0xaf3a('0x34')](_0xaf3a('0x35'))){_0xfb96e2['limit']=qs[_0xaf3a('0x1a')](_0x43bc8d[_0xaf3a('0x2c')][_0xaf3a('0x1a')]);_0xfb96e2['offset']=qs['offset'](_0x43bc8d['query'][_0xaf3a('0x1c')]);}return _0x53e081['getActions'](_0xfb96e2);}})[_0xaf3a('0x22')](function(_0x50d1d5){if(_0x50d1d5){return _0x50d1d5?{'count':_0x1e0e26,'rows':_0x50d1d5}:null;}})[_0xaf3a('0x22')](respondWithResult(_0x1b6171,null))[_0xaf3a('0x46')](handleError(_0x1b6171,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2492067..12101d5 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8073=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes'];(function(_0x9eb158,_0x5747d9){var _0x3a15d6=function(_0x52af48){while(--_0x52af48){_0x9eb158['push'](_0x9eb158['shift']());}};_0x3a15d6(++_0x5747d9);}(_0x8073,0xdd));var _0x3807=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x8073[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x3807('0x0'));var util=require(_0x3807('0x1'));var logger=require(_0x3807('0x2'))(_0x3807('0x3'));var moment=require(_0x3807('0x4'));var BPromise=require(_0x3807('0x5'));var rp=require(_0x3807('0x6'));var fs=require('fs');var path=require(_0x3807('0x7'));var rimraf=require(_0x3807('0x8'));var config=require('../../config/environment');var attributes=require(_0x3807('0x9'));module[_0x3807('0xa')]=function(_0x4896e6,_0xf7919a){return _0x4896e6['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06c9=['Automation','tools_automations','lodash','../../config/logger','api','bluebird','../../config/environment','./automation.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06c9,0x14c));var _0x906c=function(_0x523c36,_0x2bfd8f){_0x523c36=_0x523c36-0x0;var _0x163013=_0x06c9[_0x523c36];return _0x163013;};'use strict';var _=require(_0x906c('0x0'));var util=require('util');var logger=require(_0x906c('0x1'))(_0x906c('0x2'));var moment=require('moment');var BPromise=require(_0x906c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x906c('0x4'));var attributes=require(_0x906c('0x5'));module[_0x906c('0x6')]=function(_0xef8934,_0x1a9219){return _0xef8934[_0x906c('0x7')](_0x906c('0x8'),attributes,{'tableName':_0x906c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index ac18ebc..cbd6d8d 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c16=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x10ec12,_0x59f2af){var _0x37f0da=function(_0x22e830){while(--_0x22e830){_0x10ec12['push'](_0x10ec12['shift']());}};_0x37f0da(++_0x59f2af);}(_0x2c16,0xf0));var _0x62c1=function(_0x580d78,_0x2879e6){_0x580d78=_0x580d78-0x0;var _0x413402=_0x2c16[_0x580d78];return _0x413402;};'use strict';var _=require(_0x62c1('0x0'));var util=require(_0x62c1('0x1'));var moment=require(_0x62c1('0x2'));var BPromise=require('bluebird');var rs=require(_0x62c1('0x3'));var fs=require('fs');var Redis=require(_0x62c1('0x4'));var db=require(_0x62c1('0x5'))['db'];var utils=require(_0x62c1('0x6'));var logger=require(_0x62c1('0x7'))(_0x62c1('0x8'));var config=require(_0x62c1('0x9'));var jayson=require(_0x62c1('0xa'));var client=jayson[_0x62c1('0xb')][_0x62c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x527671,_0x113a32,_0x4bcc7b){return new BPromise(function(_0x236518,_0x4af828){return client[_0x62c1('0xd')](_0x527671,_0x4bcc7b)['then'](function(_0x153420){logger[_0x62c1('0xe')]('Automation,\x20%s,\x20%s',_0x113a32,_0x62c1('0xf'));logger['debug'](_0x62c1('0x10'),_0x113a32,_0x62c1('0xf'),JSON[_0x62c1('0x11')](_0x153420));if(_0x153420[_0x62c1('0x12')]){if(_0x153420[_0x62c1('0x12')]['code']===0x1f4){logger['error'](_0x62c1('0x13'),_0x113a32,_0x153420[_0x62c1('0x12')]['message']);return _0x4af828(_0x153420['error'][_0x62c1('0x14')]);}logger[_0x62c1('0x12')]('Automation,\x20%s,\x20%s',_0x113a32,_0x153420[_0x62c1('0x12')][_0x62c1('0x14')]);return _0x236518(_0x153420[_0x62c1('0x12')][_0x62c1('0x14')]);}else{logger[_0x62c1('0xe')]('Automation,\x20%s,\x20%s',_0x113a32,_0x62c1('0xf'));_0x236518(_0x153420['result'][_0x62c1('0x14')]);}})[_0x62c1('0x15')](function(_0x969e09){logger[_0x62c1('0x12')](_0x62c1('0x13'),_0x113a32,_0x969e09);_0x4af828(_0x969e09);});});}
\ No newline at end of file
+var _0xd481=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x252609,_0x24a2ba){var _0x33dca3=function(_0x12aeb6){while(--_0x12aeb6){_0x252609['push'](_0x252609['shift']());}};_0x33dca3(++_0x24a2ba);}(_0xd481,0x1e4));var _0x1d48=function(_0x4f19ef,_0x29d1e0){_0x4f19ef=_0x4f19ef-0x0;var _0x3d7a5f=_0xd481[_0x4f19ef];return _0x3d7a5f;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var moment=require(_0x1d48('0x1'));var BPromise=require(_0x1d48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d48('0x3'));var db=require(_0x1d48('0x4'))['db'];var utils=require(_0x1d48('0x5'));var logger=require('../../config/logger')(_0x1d48('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d48('0x7'));var client=jayson[_0x1d48('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472584,_0x3099cc,_0x3b8bd4){return new BPromise(function(_0x27c383,_0x1fc969){return client[_0x1d48('0x9')](_0x472584,_0x3b8bd4)[_0x1d48('0xa')](function(_0x303dce){logger[_0x1d48('0xb')](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));logger[_0x1d48('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x3099cc,_0x1d48('0xd'),JSON[_0x1d48('0xf')](_0x303dce));if(_0x303dce[_0x1d48('0x10')]){if(_0x303dce[_0x1d48('0x10')][_0x1d48('0x11')]===0x1f4){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x1fc969(_0x303dce[_0x1d48('0x10')]['message']);}logger[_0x1d48('0x10')]('Automation,\x20%s,\x20%s',_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x27c383(_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);}else{logger['info'](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));_0x27c383(_0x303dce[_0x1d48('0x13')]['message']);}})[_0x1d48('0x14')](function(_0x433c92){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x433c92);_0x1fc969(_0x433c92);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 6ee65db..e5cca08 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dd6=['isAuthenticated','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6dd6,0xcc));var _0x66dd=function(_0x4fde83,_0x2d9011){_0x4fde83=_0x4fde83-0x0;var _0x3b33e3=_0x6dd6[_0x4fde83];return _0x3b33e3;};'use strict';var multer=require('multer');var util=require(_0x66dd('0x0'));var path=require(_0x66dd('0x1'));var timeout=require(_0x66dd('0x2'));var express=require(_0x66dd('0x3'));var router=express[_0x66dd('0x4')]();var fs_extra=require(_0x66dd('0x5'));var auth=require(_0x66dd('0x6'));var interaction=require(_0x66dd('0x7'));var config=require(_0x66dd('0x8'));var controller=require('./automation.controller');router[_0x66dd('0x9')]('/',auth['isAuthenticated'](),controller[_0x66dd('0xa')]);router['get'](_0x66dd('0xb'),auth[_0x66dd('0xc')](),controller[_0x66dd('0xd')]);router[_0x66dd('0x9')](_0x66dd('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0x66dd('0x9')](_0x66dd('0xf'),auth[_0x66dd('0xc')](),controller[_0x66dd('0x10')]);router[_0x66dd('0x11')]('/',auth[_0x66dd('0xc')](),controller[_0x66dd('0x12')]);router[_0x66dd('0x11')](_0x66dd('0xe'),auth[_0x66dd('0xc')](),controller[_0x66dd('0x13')]);router[_0x66dd('0x11')](_0x66dd('0xf'),auth[_0x66dd('0xc')](),controller[_0x66dd('0x14')]);router[_0x66dd('0x15')](_0x66dd('0xb'),auth['isAuthenticated'](),controller[_0x66dd('0x16')]);router[_0x66dd('0x17')]('/:id',auth[_0x66dd('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x919d=['post','/:id/actions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','./automation.controller','get','/:id','isAuthenticated','/:id/conditions','getConditions','getActions','create'];(function(_0x34aafa,_0x1b99a9){var _0x491f40=function(_0x5f211b){while(--_0x5f211b){_0x34aafa['push'](_0x34aafa['shift']());}};_0x491f40(++_0x1b99a9);}(_0x919d,0x1c0));var _0xd919=function(_0x13efc0,_0x1db695){_0x13efc0=_0x13efc0-0x0;var _0xf86e92=_0x919d[_0x13efc0];return _0xf86e92;};'use strict';var multer=require(_0xd919('0x0'));var util=require(_0xd919('0x1'));var path=require(_0xd919('0x2'));var timeout=require(_0xd919('0x3'));var express=require('express');var router=express[_0xd919('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd919('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd919('0x6'));router[_0xd919('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd919('0x7')](_0xd919('0x8'),auth[_0xd919('0x9')](),controller['show']);router[_0xd919('0x7')](_0xd919('0xa'),auth[_0xd919('0x9')](),controller[_0xd919('0xb')]);router[_0xd919('0x7')]('/:id/actions',auth[_0xd919('0x9')](),controller[_0xd919('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd919('0xd')]);router[_0xd919('0xe')](_0xd919('0xa'),auth[_0xd919('0x9')](),controller['addConditions']);router['post'](_0xd919('0xf'),auth['isAuthenticated'](),controller[_0xd919('0x10')]);router[_0xd919('0x11')](_0xd919('0x8'),auth[_0xd919('0x9')](),controller[_0xd919('0x12')]);router[_0xd919('0x13')](_0xd919('0x8'),auth[_0xd919('0x9')](),controller[_0xd919('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 825dbfb..c5fb8f6 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7bf=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC'];(function(_0x2f637a,_0x4d4bf4){var _0x2e179e=function(_0x252456){while(--_0x252456){_0x2f637a['push'](_0x2f637a['shift']());}};_0x2e179e(++_0x4d4bf4);}(_0xd7bf,0x72));var _0xfd7b=function(_0x292082,_0x268019){_0x292082=_0x292082-0x0;var _0x716341=_0xd7bf[_0x292082];return _0x716341;};'use strict';var Sequelize=require('sequelize');module[_0xfd7b('0x0')]={'name':{'type':Sequelize[_0xfd7b('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfd7b('0x2')](_0xfd7b('0x3')),'allowNull':![],'defaultValue':_0xfd7b('0x3')},'description':{'type':Sequelize[_0xfd7b('0x1')]},'active':{'type':Sequelize[_0xfd7b('0x4')],'defaultValue':0x0,'comment':_0xfd7b('0x5')},'limitCalls':{'type':Sequelize[_0xfd7b('0x6')](0x4)[_0xfd7b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfd7b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfd7b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfd7b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfd7b('0xe')},'dialTimezone':{'type':Sequelize[_0xfd7b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xfd7b('0x2')](_0xfd7b('0xf'),_0xfd7b('0x10'),_0xfd7b('0x11')),'defaultValue':_0xfd7b('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfd7b('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfd7b('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfd7b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd7b('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfd7b('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfd7b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfd7b('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xfd7b('0x2')]('DESC',_0xfd7b('0x18')),'defaultValue':_0xfd7b('0x19')},'dialPrefix':{'type':Sequelize[_0xfd7b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xfd7b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd7b('0x1a')},'dialCutDigit':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd7b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)[_0xfd7b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x22')}};
\ No newline at end of file
+var _0xbd49=['Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED'];(function(_0xdf8932,_0x2eeca9){var _0x23549b=function(_0x23c1ca){while(--_0x23c1ca){_0xdf8932['push'](_0xdf8932['shift']());}};_0x23549b(++_0x2eeca9);}(_0xbd49,0x86));var _0x9bd4=function(_0x4d5ca9,_0x1e58b1){_0x4d5ca9=_0x4d5ca9-0x0;var _0x523c32=_0xbd49[_0x4d5ca9];return _0x523c32;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9bd4('0x0')],'unique':_0x9bd4('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9bd4('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x9bd4('0x0')]},'active':{'type':Sequelize[_0x9bd4('0x3')],'defaultValue':0x0,'comment':_0x9bd4('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x9bd4('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9bd4('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9bd4('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9bd4('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x9bd4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd4('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd4('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd4('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'defaultValue':0x3,'comment':_0x9bd4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x9bd4('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9bd4('0x0')],'defaultValue':_0x9bd4('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9bd4('0x10'),_0x9bd4('0x11'),_0x9bd4('0x12')),'defaultValue':_0x9bd4('0x10')},'dialAMDActive':{'type':Sequelize[_0x9bd4('0x3')],'defaultValue':0x0,'comment':_0x9bd4('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9bd4('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9bd4('0x7')](0x9)[_0x9bd4('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9bd4('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9bd4('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9bd4('0x7')](0x9)[_0x9bd4('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9bd4('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x9bd4('0x7')](0x9)[_0x9bd4('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9bd4('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9bd4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9bd4('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9bd4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9bd4('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9bd4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9bd4('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9bd4('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9bd4('0x2')](_0x9bd4('0x1a'),_0x9bd4('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x9bd4('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x9bd4('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd4('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd4('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9bd4('0x7')](0x3)[_0x9bd4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd4('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9bd4('0x7')](0x5)[_0x9bd4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd4('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d8a0b78..924fbe1 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdd4=['CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','onlyIfOpen','updatedAt','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','into','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','removeBlackLists','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Campaign','rawAttributes','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','type','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','getHoppers','findOne','CmHopper','order','CampaignId','rows','getHopperHistories','hasOwnProperty'];(function(_0x5e8e25,_0x38682c){var _0x2e8ffb=function(_0x356a15){while(--_0x356a15){_0x5e8e25['push'](_0x5e8e25['shift']());}};_0x2e8ffb(++_0x38682c);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xbdd4[_0x481bf7];return _0x461787;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4bdd('0x0'));var jsonpatch=require(_0x4bdd('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4bdd('0x2'));var Mustache=require(_0x4bdd('0x3'));var util=require('util');var path=require(_0x4bdd('0x4'));var sox=require(_0x4bdd('0x5'));var csv=require(_0x4bdd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bdd('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4bdd('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x4bdd('0x6'));var querystring=require(_0x4bdd('0x9'));var Papa=require('papaparse');var Redis=require(_0x4bdd('0xa'));var authService=require(_0x4bdd('0xb'));var qs=require(_0x4bdd('0xc'));var as=require(_0x4bdd('0xd'));var hardwareService=require(_0x4bdd('0xe'));var logger=require('../../config/logger')(_0x4bdd('0xf'));var utils=require(_0x4bdd('0x10'));var config=require(_0x4bdd('0x11'));var licenseUtil=require(_0x4bdd('0x12'));var db=require(_0x4bdd('0x13'))['db'];function respondWithStatusCode(_0x4ec3e0,_0x2b8cd8){_0x2b8cd8=_0x2b8cd8||0xcc;return function(_0x387573){if(_0x387573){return _0x4ec3e0[_0x4bdd('0x14')](_0x2b8cd8);}return _0x4ec3e0[_0x4bdd('0x15')](_0x2b8cd8)[_0x4bdd('0x16')]();};}function respondWithResult(_0x40a4a0,_0x39bff4){_0x39bff4=_0x39bff4||0xc8;return function(_0x428353){if(_0x428353){return _0x40a4a0[_0x4bdd('0x15')](_0x39bff4)['json'](_0x428353);}};}function respondWithFilteredResult(_0x4ed860,_0x46d9f9){return function(_0x381b97){if(_0x381b97){var _0x2d0726=typeof _0x46d9f9[_0x4bdd('0x17')]===_0x4bdd('0x18')&&typeof _0x46d9f9[_0x4bdd('0x19')]===_0x4bdd('0x18');var _0x440c54=_0x381b97['count'];var _0xf6c6ba=_0x2d0726?0x0:_0x46d9f9[_0x4bdd('0x17')];var _0x41bb61=_0x2d0726?_0x381b97[_0x4bdd('0x1a')]:_0x46d9f9[_0x4bdd('0x17')]+_0x46d9f9['limit'];var _0x2d1cac;if(_0x41bb61>=_0x440c54){_0x41bb61=_0x440c54;_0x2d1cac=0xc8;}else{_0x2d1cac=0xce;}_0x4ed860['status'](_0x2d1cac);return _0x4ed860[_0x4bdd('0x1b')]('Content-Range',_0xf6c6ba+'-'+_0x41bb61+'/'+_0x440c54)[_0x4bdd('0x1c')](_0x381b97);}return null;};}function patchUpdates(_0xa67e10){return function(_0x3018e3){try{jsonpatch['apply'](_0x3018e3,_0xa67e10,!![]);}catch(_0x26e35c){return BPromise[_0x4bdd('0x1d')](_0x26e35c);}return _0x3018e3[_0x4bdd('0x1e')]();};}function saveUpdates(_0x57480b,_0x5ee2fd){return function(_0x34c9f5){if(_0x34c9f5){return _0x34c9f5[_0x4bdd('0x1f')](_0x57480b)[_0x4bdd('0x20')](function(_0x57005f){return _0x57005f;});}return null;};}function removeEntity(_0x384bc7,_0x2cfdb7){return function(_0x4c7953){if(_0x4c7953){return _0x4c7953[_0x4bdd('0x21')]()[_0x4bdd('0x20')](function(){var _0x228424=_0x4c7953[_0x4bdd('0x22')]({'plain':!![]});var _0x62a34f='IvrCampaigns';return db[_0x4bdd('0x23')]['destroy']({'where':{'type':_0x62a34f,'resourceId':_0x228424['id']}})[_0x4bdd('0x20')](function(){return _0x4c7953;});})[_0x4bdd('0x20')](function(){_0x384bc7[_0x4bdd('0x15')](0xcc)[_0x4bdd('0x16')]();});}};}function handleEntityNotFound(_0x2fdbbf,_0x2c0214){return function(_0xcb953c){if(!_0xcb953c){_0x2fdbbf[_0x4bdd('0x14')](0x194);}return _0xcb953c;};}function handleError(_0x19ab9b,_0x2e5700){_0x2e5700=_0x2e5700||0x1f4;return function(_0x2d9fff){logger[_0x4bdd('0x24')](_0x2d9fff['stack']);if(_0x2d9fff[_0x4bdd('0x25')]){delete _0x2d9fff['name'];}_0x19ab9b[_0x4bdd('0x15')](_0x2e5700)['send'](_0x2d9fff);};}exports[_0x4bdd('0x26')]=function(_0x5be1c7,_0x33feb6){var _0x2fba35={},_0x18bb46={},_0x332d11={'count':0x0,'rows':[]};var _0x3a5ba4=_[_0x4bdd('0x27')](db[_0x4bdd('0x28')][_0x4bdd('0x29')],function(_0x5d1d5b){return{'name':_0x5d1d5b['fieldName'],'type':_0x5d1d5b['type'][_0x4bdd('0x2a')]};});_0x18bb46[_0x4bdd('0x2b')]=_['map'](_0x3a5ba4,_0x4bdd('0x25'));_0x18bb46[_0x4bdd('0x2c')]=_[_0x4bdd('0x2d')](_0x5be1c7['query']);_0x18bb46['filters']=_[_0x4bdd('0x2e')](_0x18bb46['model'],_0x18bb46[_0x4bdd('0x2c')]);_0x2fba35[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x18bb46['model'],qs[_0x4bdd('0x30')](_0x5be1c7[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x2fba35['attributes']=_0x2fba35[_0x4bdd('0x2f')]['length']?_0x2fba35[_0x4bdd('0x2f')]:_0x18bb46[_0x4bdd('0x2b')];if(!_0x5be1c7['query']['hasOwnProperty'](_0x4bdd('0x31'))){_0x2fba35[_0x4bdd('0x19')]=qs[_0x4bdd('0x19')](_0x5be1c7[_0x4bdd('0x2c')][_0x4bdd('0x19')]);_0x2fba35[_0x4bdd('0x17')]=qs[_0x4bdd('0x17')](_0x5be1c7[_0x4bdd('0x2c')][_0x4bdd('0x17')]);}_0x2fba35['order']=qs[_0x4bdd('0x32')](_0x5be1c7[_0x4bdd('0x2c')][_0x4bdd('0x32')]);_0x2fba35[_0x4bdd('0x33')]=qs[_0x4bdd('0x34')](_[_0x4bdd('0x35')](_0x5be1c7['query'],_0x18bb46['filters']),_0x3a5ba4);if(_0x5be1c7[_0x4bdd('0x2c')][_0x4bdd('0x36')]){_0x2fba35[_0x4bdd('0x33')]=_[_0x4bdd('0x37')](_0x2fba35[_0x4bdd('0x33')],{'$or':_[_0x4bdd('0x27')](_0x3a5ba4,function(_0xdbe854){if(_0xdbe854[_0x4bdd('0x38')]!=='VIRTUAL'){var _0x271766={};_0x271766[_0xdbe854[_0x4bdd('0x25')]]={'$like':'%'+_0x5be1c7[_0x4bdd('0x2c')]['filter']+'%'};return _0x271766;}})});}_0x2fba35=_[_0x4bdd('0x37')]({},_0x2fba35,_0x5be1c7[_0x4bdd('0x39')]);var _0x46b45e={'where':_0x2fba35['where']};return db[_0x4bdd('0x28')][_0x4bdd('0x1a')](_0x46b45e)[_0x4bdd('0x20')](function(_0xbdece6){_0x332d11['count']=_0xbdece6;if(_0x5be1c7[_0x4bdd('0x2c')]['includeAll']){_0x2fba35[_0x4bdd('0x3a')]=[{'all':!![]}];}return db[_0x4bdd('0x28')][_0x4bdd('0x3b')](_0x2fba35);})[_0x4bdd('0x20')](function(_0x202c12){_0x332d11['rows']=_0x202c12;return _0x332d11;})[_0x4bdd('0x20')](respondWithFilteredResult(_0x33feb6,_0x2fba35))[_0x4bdd('0x3c')](handleError(_0x33feb6,null));};exports[_0x4bdd('0x3d')]=function(_0x36cbd3,_0x17f4f3){var _0x1f6c38={'raw':![],'where':{'id':_0x36cbd3[_0x4bdd('0x3e')]['id']}},_0x144b75={};_0x144b75[_0x4bdd('0x2b')]=_['keys'](db[_0x4bdd('0x28')][_0x4bdd('0x29')]);_0x144b75[_0x4bdd('0x2c')]=_[_0x4bdd('0x2d')](_0x36cbd3[_0x4bdd('0x2c')]);_0x144b75['filters']=_[_0x4bdd('0x2e')](_0x144b75[_0x4bdd('0x2b')],_0x144b75[_0x4bdd('0x2c')]);_0x1f6c38[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x144b75['model'],qs[_0x4bdd('0x30')](_0x36cbd3[_0x4bdd('0x2c')]['fields']));_0x1f6c38['attributes']=_0x1f6c38[_0x4bdd('0x2f')][_0x4bdd('0x3f')]?_0x1f6c38[_0x4bdd('0x2f')]:_0x144b75[_0x4bdd('0x2b')];if(_0x36cbd3[_0x4bdd('0x2c')][_0x4bdd('0x40')]){_0x1f6c38[_0x4bdd('0x3a')]=[{'all':!![]}];}_0x1f6c38=_[_0x4bdd('0x37')]({},_0x1f6c38,_0x36cbd3[_0x4bdd('0x39')]);return db[_0x4bdd('0x28')][_0x4bdd('0x41')](_0x1f6c38)['then'](handleEntityNotFound(_0x17f4f3,null))[_0x4bdd('0x20')](respondWithResult(_0x17f4f3,null))[_0x4bdd('0x3c')](handleError(_0x17f4f3,null));};exports['create']=function(_0x4428cd,_0xd0c2b){return db[_0x4bdd('0x28')][_0x4bdd('0x42')](_0x4428cd[_0x4bdd('0x43')],{})[_0x4bdd('0x20')](function(_0x3980fd){var _0x1db3ae=_0x4428cd[_0x4bdd('0x44')][_0x4bdd('0x22')]({'plain':!![]});if(!_0x1db3ae)throw new Error(_0x4bdd('0x45'));if(_0x1db3ae['role']===_0x4bdd('0x44')){var _0xcd248d=_0x3980fd[_0x4bdd('0x22')]({'plain':!![]});var _0x30413a=_0x4bdd('0x46');return db[_0x4bdd('0x47')]['find']({'where':{'name':_0x30413a,'userProfileId':_0x1db3ae[_0x4bdd('0x48')]},'raw':!![]})['then'](function(_0x5304ca){if(_0x5304ca&&_0x5304ca[_0x4bdd('0x49')]===0x0){return db[_0x4bdd('0x23')][_0x4bdd('0x42')]({'name':_0xcd248d[_0x4bdd('0x25')],'resourceId':_0xcd248d['id'],'type':_0x5304ca[_0x4bdd('0x25')],'sectionId':_0x5304ca['id']},{})[_0x4bdd('0x20')](function(){return _0x3980fd;});}else{return _0x3980fd;}})[_0x4bdd('0x3c')](function(_0x4073d3){logger['error'](_0x4bdd('0x4a'),_0x4073d3);throw _0x4073d3;});}return _0x3980fd;})['then'](respondWithResult(_0xd0c2b,0xc9))['catch'](handleError(_0xd0c2b,null));};exports[_0x4bdd('0x4b')]=function(_0x1aa85d,_0x22905a){var _0x5b6d45={'where':{'id':_0x1aa85d[_0x4bdd('0x3e')]['id']}},_0x4d8a5c={};_0x4d8a5c[_0x4bdd('0x2b')]=_[_0x4bdd('0x2d')](db[_0x4bdd('0x28')]['rawAttributes']);_0x5b6d45['attributes']=_[_0x4bdd('0x2e')](_0x4d8a5c['model'],qs[_0x4bdd('0x30')](_0x1aa85d[_0x4bdd('0x2c')]['fields']));_0x5b6d45['attributes']=_0x5b6d45['attributes'][_0x4bdd('0x3f')]?_0x5b6d45[_0x4bdd('0x2f')]:_0x4d8a5c[_0x4bdd('0x2b')];if(_0x1aa85d[_0x4bdd('0x2c')][_0x4bdd('0x40')]){_0x5b6d45['include']=[{'all':!![]}];}_0x5b6d45=_[_0x4bdd('0x37')]({},_0x5b6d45,_0x1aa85d['options']);return db[_0x4bdd('0x28')][_0x4bdd('0x41')](_0x5b6d45)[_0x4bdd('0x20')](handleEntityNotFound(_0x22905a,null))['then'](function(_0x538707){if(_0x538707){var _0x51c85a=_0x538707[_0x4bdd('0x22')]({'plain':!![]});_0x51c85a=qs[_0x4bdd('0x4c')](_0x51c85a,['id',_0x4bdd('0x4d'),'updatedAt']);_0x1aa85d[_0x4bdd('0x43')]=_['omit'](_0x1aa85d[_0x4bdd('0x43')],['id',_0x4bdd('0x4d'),'updatedAt']);return db['Campaign'][_0x4bdd('0x42')](_[_0x4bdd('0x37')](_0x51c85a,_0x1aa85d[_0x4bdd('0x43')]),{'include':_0x1aa85d[_0x4bdd('0x2c')][_0x4bdd('0x40')]?[{'all':!![]}]:undefined})[_0x4bdd('0x20')](function(_0x4e742c){var _0x4ec81f=_0x1aa85d[_0x4bdd('0x44')][_0x4bdd('0x22')]({'plain':!![]});if(!_0x4ec81f)throw new Error(_0x4bdd('0x45'));if(_0x4ec81f['role']==='user'){var _0x316e4f=_0x4e742c[_0x4bdd('0x22')]({'plain':!![]});var _0x161132=_0x4bdd('0x46');return db[_0x4bdd('0x47')]['find']({'where':{'name':_0x161132,'userProfileId':_0x4ec81f[_0x4bdd('0x48')]},'raw':!![]})['then'](function(_0x2ef5a8){if(_0x2ef5a8&&_0x2ef5a8['autoAssociation']===0x0){return db[_0x4bdd('0x23')][_0x4bdd('0x42')]({'name':_0x316e4f[_0x4bdd('0x25')],'resourceId':_0x316e4f['id'],'type':_0x2ef5a8['name'],'sectionId':_0x2ef5a8['id']},{})[_0x4bdd('0x20')](function(){return _0x4e742c;});}else{return _0x4e742c;}})['catch'](function(_0x51c039){logger[_0x4bdd('0x24')](_0x4bdd('0x4a'),_0x51c039);throw _0x51c039;});}return _0x4e742c;});}})[_0x4bdd('0x20')](respondWithResult(_0x22905a,0xc9))[_0x4bdd('0x3c')](handleError(_0x22905a,null));};exports[_0x4bdd('0x1f')]=function(_0x28940c,_0x20871b){if(_0x28940c['body']['id']){delete _0x28940c['body']['id'];}return db['Campaign'][_0x4bdd('0x41')]({'where':{'id':_0x28940c[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x20871b,null))[_0x4bdd('0x20')](saveUpdates(_0x28940c[_0x4bdd('0x43')],null))['then'](respondWithResult(_0x20871b,null))['catch'](handleError(_0x20871b,null));};exports[_0x4bdd('0x21')]=function(_0x1567b3,_0x30a2fe){return db['Campaign'][_0x4bdd('0x41')]({'where':{'id':_0x1567b3[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x30a2fe,null))['then'](removeEntity(_0x30a2fe,null))['catch'](handleError(_0x30a2fe,null));};exports[_0x4bdd('0x4e')]=function(_0x138644,_0x5696b4,_0x2ddcb1){var _0x42d17c={'raw':!![],'where':{}};var _0x560814={};var _0x398a7d={'count':0x0,'rows':[]};return db[_0x4bdd('0x28')][_0x4bdd('0x4f')]({'where':{'id':_0x138644[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x5696b4,null))[_0x4bdd('0x20')](function(_0x4a48f9){if(_0x4a48f9){_0x560814[_0x4bdd('0x2b')]=_[_0x4bdd('0x2d')](db[_0x4bdd('0x50')][_0x4bdd('0x29')]);_0x560814[_0x4bdd('0x2c')]=_['keys'](_0x138644[_0x4bdd('0x2c')]);_0x560814[_0x4bdd('0x34')]=_[_0x4bdd('0x2e')](_0x560814[_0x4bdd('0x2b')],_0x560814[_0x4bdd('0x2c')]);_0x42d17c[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x560814[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x138644['query'][_0x4bdd('0x30')]));_0x42d17c['attributes']=_0x42d17c[_0x4bdd('0x2f')][_0x4bdd('0x3f')]?_0x42d17c[_0x4bdd('0x2f')]:_0x560814[_0x4bdd('0x2b')];if(!_0x138644[_0x4bdd('0x2c')]['hasOwnProperty'](_0x4bdd('0x31'))){_0x42d17c[_0x4bdd('0x19')]=qs[_0x4bdd('0x19')](_0x138644[_0x4bdd('0x2c')]['limit']);_0x42d17c[_0x4bdd('0x17')]=qs[_0x4bdd('0x17')](_0x138644['query'][_0x4bdd('0x17')]);}_0x42d17c[_0x4bdd('0x51')]=qs['sort'](_0x138644[_0x4bdd('0x2c')][_0x4bdd('0x32')]);_0x42d17c[_0x4bdd('0x33')]=qs[_0x4bdd('0x34')](_[_0x4bdd('0x35')](_0x138644[_0x4bdd('0x2c')],_0x560814['filters']));_0x42d17c['where'][_0x4bdd('0x52')]=_0x4a48f9['id'];if(_0x138644[_0x4bdd('0x2c')][_0x4bdd('0x36')]){_0x42d17c[_0x4bdd('0x33')]=_[_0x4bdd('0x37')](_0x42d17c['where'],{'$or':_[_0x4bdd('0x27')](_0x42d17c['attributes'],function(_0x5b5a08){var _0x5edfc2={};_0x5edfc2[_0x5b5a08]={'$like':'%'+_0x138644['query'][_0x4bdd('0x36')]+'%'};return _0x5edfc2;})});}_0x42d17c=_[_0x4bdd('0x37')]({},_0x42d17c,_0x138644['options']);return db[_0x4bdd('0x50')][_0x4bdd('0x1a')]({'where':_0x42d17c['where']})[_0x4bdd('0x20')](function(_0x16daa0){_0x398a7d[_0x4bdd('0x1a')]=_0x16daa0;if(_0x138644[_0x4bdd('0x2c')][_0x4bdd('0x40')]){_0x42d17c[_0x4bdd('0x3a')]=[{'all':!![]}];}return db[_0x4bdd('0x50')][_0x4bdd('0x3b')](_0x42d17c);})[_0x4bdd('0x20')](function(_0x13b36a){_0x398a7d[_0x4bdd('0x53')]=_0x13b36a;return _0x398a7d;});}})['then'](respondWithFilteredResult(_0x5696b4,_0x42d17c))[_0x4bdd('0x3c')](handleError(_0x5696b4,null));};exports[_0x4bdd('0x54')]=function(_0x2a1f51,_0x90a3a2,_0x3cc479){var _0x491e3e={'raw':!![],'where':{}};var _0x1197a9={};var _0x31a19a={'count':0x0,'rows':[]};return db[_0x4bdd('0x28')][_0x4bdd('0x4f')]({'where':{'id':_0x2a1f51['params']['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x90a3a2,null))[_0x4bdd('0x20')](function(_0x313017){if(_0x313017){_0x1197a9[_0x4bdd('0x2b')]=_[_0x4bdd('0x2d')](db['CmHopperHistory'][_0x4bdd('0x29')]);_0x1197a9[_0x4bdd('0x2c')]=_['keys'](_0x2a1f51['query']);_0x1197a9[_0x4bdd('0x34')]=_['intersection'](_0x1197a9['model'],_0x1197a9[_0x4bdd('0x2c')]);_0x491e3e[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x1197a9[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x2a1f51[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x491e3e['attributes']=_0x491e3e[_0x4bdd('0x2f')][_0x4bdd('0x3f')]?_0x491e3e[_0x4bdd('0x2f')]:_0x1197a9[_0x4bdd('0x2b')];if(!_0x2a1f51[_0x4bdd('0x2c')][_0x4bdd('0x55')](_0x4bdd('0x31'))){_0x491e3e['limit']=qs[_0x4bdd('0x19')](_0x2a1f51['query'][_0x4bdd('0x19')]);_0x491e3e[_0x4bdd('0x17')]=qs[_0x4bdd('0x17')](_0x2a1f51[_0x4bdd('0x2c')]['offset']);}_0x491e3e[_0x4bdd('0x51')]=qs[_0x4bdd('0x32')](_0x2a1f51[_0x4bdd('0x2c')][_0x4bdd('0x32')]);_0x491e3e[_0x4bdd('0x33')]=qs[_0x4bdd('0x34')](_['pick'](_0x2a1f51[_0x4bdd('0x2c')],_0x1197a9['filters']));_0x491e3e[_0x4bdd('0x33')][_0x4bdd('0x52')]=_0x313017['id'];if(_0x2a1f51[_0x4bdd('0x2c')]['filter']){_0x491e3e['where']=_[_0x4bdd('0x37')](_0x491e3e['where'],{'$or':_['map'](_0x491e3e[_0x4bdd('0x2f')],function(_0x2491e7){var _0x43caad={};_0x43caad[_0x2491e7]={'$like':'%'+_0x2a1f51[_0x4bdd('0x2c')][_0x4bdd('0x36')]+'%'};return _0x43caad;})});}_0x491e3e=_[_0x4bdd('0x37')]({},_0x491e3e,_0x2a1f51[_0x4bdd('0x39')]);return db['CmHopperHistory']['count']({'where':_0x491e3e[_0x4bdd('0x33')]})[_0x4bdd('0x20')](function(_0x403773){_0x31a19a[_0x4bdd('0x1a')]=_0x403773;if(_0x2a1f51[_0x4bdd('0x2c')][_0x4bdd('0x40')]){_0x491e3e[_0x4bdd('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4bdd('0x3b')](_0x491e3e);})['then'](function(_0xcfc4b7){_0x31a19a[_0x4bdd('0x53')]=_0xcfc4b7;return _0x31a19a;});}})[_0x4bdd('0x20')](respondWithFilteredResult(_0x90a3a2,_0x491e3e))[_0x4bdd('0x3c')](handleError(_0x90a3a2,null));};exports['getHopperFinals']=function(_0x2b17a7,_0x223b4a,_0x4080f0){var _0x2c6471={'raw':!![],'where':{}};var _0x21d719={};var _0x14c523={'count':0x0,'rows':[]};return db[_0x4bdd('0x28')]['findOne']({'where':{'id':_0x2b17a7['params']['id']}})['then'](handleEntityNotFound(_0x223b4a,null))['then'](function(_0x43e2c6){if(_0x43e2c6){_0x21d719['model']=_[_0x4bdd('0x2d')](db[_0x4bdd('0x56')][_0x4bdd('0x29')]);_0x21d719['query']=_[_0x4bdd('0x2d')](_0x2b17a7[_0x4bdd('0x2c')]);_0x21d719[_0x4bdd('0x34')]=_[_0x4bdd('0x2e')](_0x21d719[_0x4bdd('0x2b')],_0x21d719[_0x4bdd('0x2c')]);_0x2c6471[_0x4bdd('0x2f')]=_['intersection'](_0x21d719[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x2b17a7[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x2c6471[_0x4bdd('0x2f')]=_0x2c6471[_0x4bdd('0x2f')][_0x4bdd('0x3f')]?_0x2c6471[_0x4bdd('0x2f')]:_0x21d719[_0x4bdd('0x2b')];if(!_0x2b17a7['query'][_0x4bdd('0x55')]('nolimit')){_0x2c6471['limit']=qs[_0x4bdd('0x19')](_0x2b17a7['query'][_0x4bdd('0x19')]);_0x2c6471[_0x4bdd('0x17')]=qs['offset'](_0x2b17a7[_0x4bdd('0x2c')][_0x4bdd('0x17')]);}_0x2c6471[_0x4bdd('0x51')]=qs[_0x4bdd('0x32')](_0x2b17a7['query'][_0x4bdd('0x32')]);_0x2c6471[_0x4bdd('0x33')]=qs[_0x4bdd('0x34')](_[_0x4bdd('0x35')](_0x2b17a7[_0x4bdd('0x2c')],_0x21d719[_0x4bdd('0x34')]));_0x2c6471[_0x4bdd('0x33')][_0x4bdd('0x52')]=_0x43e2c6['id'];if(_0x2b17a7['query'][_0x4bdd('0x36')]){_0x2c6471[_0x4bdd('0x33')]=_[_0x4bdd('0x37')](_0x2c6471['where'],{'$or':_[_0x4bdd('0x27')](_0x2c6471[_0x4bdd('0x2f')],function(_0xbd3bd0){var _0x4a279a={};_0x4a279a[_0xbd3bd0]={'$like':'%'+_0x2b17a7['query']['filter']+'%'};return _0x4a279a;})});}_0x2c6471=_[_0x4bdd('0x37')]({},_0x2c6471,_0x2b17a7[_0x4bdd('0x39')]);return db['CmHopperFinal'][_0x4bdd('0x1a')]({'where':_0x2c6471[_0x4bdd('0x33')]})[_0x4bdd('0x20')](function(_0x3ba20e){_0x14c523['count']=_0x3ba20e;if(_0x2b17a7['query'][_0x4bdd('0x40')]){_0x2c6471['include']=[{'all':!![]}];}return db[_0x4bdd('0x56')][_0x4bdd('0x3b')](_0x2c6471);})[_0x4bdd('0x20')](function(_0x2bc588){_0x14c523['rows']=_0x2bc588;return _0x14c523;});}})[_0x4bdd('0x20')](respondWithFilteredResult(_0x223b4a,_0x2c6471))[_0x4bdd('0x3c')](handleError(_0x223b4a,null));};exports[_0x4bdd('0x57')]=function(_0x3ac58b,_0x2ce7b5,_0x365a3f){var _0xf4724d={'raw':!![],'where':{}};var _0x2aa590={};var _0x5e4cdf={'count':0x0,'rows':[]};return db['Campaign'][_0x4bdd('0x4f')]({'where':{'id':_0x3ac58b[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x2ce7b5,null))[_0x4bdd('0x20')](function(_0x41e362){if(_0x41e362){_0x2aa590[_0x4bdd('0x2b')]=_['keys'](db[_0x4bdd('0x58')]['rawAttributes']);_0x2aa590[_0x4bdd('0x2c')]=_[_0x4bdd('0x2d')](_0x3ac58b[_0x4bdd('0x2c')]);_0x2aa590[_0x4bdd('0x34')]=_['intersection'](_0x2aa590[_0x4bdd('0x2b')],_0x2aa590['query']);_0xf4724d['attributes']=_[_0x4bdd('0x2e')](_0x2aa590[_0x4bdd('0x2b')],qs['fields'](_0x3ac58b[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0xf4724d[_0x4bdd('0x2f')]=_0xf4724d[_0x4bdd('0x2f')]['length']?_0xf4724d[_0x4bdd('0x2f')]:_0x2aa590[_0x4bdd('0x2b')];if(!_0x3ac58b[_0x4bdd('0x2c')][_0x4bdd('0x55')]('nolimit')){_0xf4724d[_0x4bdd('0x19')]=qs[_0x4bdd('0x19')](_0x3ac58b['query'][_0x4bdd('0x19')]);_0xf4724d[_0x4bdd('0x17')]=qs[_0x4bdd('0x17')](_0x3ac58b[_0x4bdd('0x2c')][_0x4bdd('0x17')]);}_0xf4724d['order']=qs[_0x4bdd('0x32')](_0x3ac58b[_0x4bdd('0x2c')][_0x4bdd('0x32')]);_0xf4724d[_0x4bdd('0x33')]=qs['filters'](_[_0x4bdd('0x35')](_0x3ac58b[_0x4bdd('0x2c')],_0x2aa590[_0x4bdd('0x34')]));_0xf4724d[_0x4bdd('0x33')][_0x4bdd('0x52')]=_0x41e362['id'];if(_0x3ac58b[_0x4bdd('0x2c')][_0x4bdd('0x36')]){_0xf4724d['where']=_[_0x4bdd('0x37')](_0xf4724d[_0x4bdd('0x33')],{'$or':_[_0x4bdd('0x27')](_0xf4724d[_0x4bdd('0x2f')],function(_0x4b155d){var _0x58b281={};_0x58b281[_0x4b155d]={'$like':'%'+_0x3ac58b['query'][_0x4bdd('0x36')]+'%'};return _0x58b281;})});}_0xf4724d=_[_0x4bdd('0x37')]({},_0xf4724d,_0x3ac58b['options']);return db['CmHopperBlack']['count']({'where':_0xf4724d[_0x4bdd('0x33')]})[_0x4bdd('0x20')](function(_0x1f943e){_0x5e4cdf[_0x4bdd('0x1a')]=_0x1f943e;if(_0x3ac58b[_0x4bdd('0x2c')][_0x4bdd('0x40')]){_0xf4724d['include']=[{'all':!![]}];}return db[_0x4bdd('0x58')][_0x4bdd('0x3b')](_0xf4724d);})[_0x4bdd('0x20')](function(_0x42c960){_0x5e4cdf[_0x4bdd('0x53')]=_0x42c960;return _0x5e4cdf;});}})[_0x4bdd('0x20')](respondWithFilteredResult(_0x2ce7b5,_0xf4724d))[_0x4bdd('0x3c')](handleError(_0x2ce7b5,null));};exports[_0x4bdd('0x59')]=function(_0x4007a8,_0x3c1f17,_0x11c78a){var _0x2dc4aa={};var _0x2c7c70={};var _0x30d6b0;var _0x206b07;return db['Campaign'][_0x4bdd('0x4f')]({'where':{'id':_0x4007a8[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x3c1f17,null))['then'](function(_0x419fc2){if(_0x419fc2){_0x30d6b0=_0x419fc2;_0x2c7c70[_0x4bdd('0x2b')]=_[_0x4bdd('0x2d')](db[_0x4bdd('0x5a')]['rawAttributes']);_0x2c7c70[_0x4bdd('0x2c')]=_['keys'](_0x4007a8[_0x4bdd('0x2c')]);_0x2c7c70['filters']=_[_0x4bdd('0x2e')](_0x2c7c70['model'],_0x2c7c70[_0x4bdd('0x2c')]);_0x2dc4aa[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x2c7c70[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x4007a8[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x2dc4aa['attributes']=_0x2dc4aa['attributes']['length']?_0x2dc4aa[_0x4bdd('0x2f')]:_0x2c7c70[_0x4bdd('0x2b')];_0x2dc4aa[_0x4bdd('0x51')]=qs[_0x4bdd('0x32')](_0x4007a8[_0x4bdd('0x2c')][_0x4bdd('0x32')]);_0x2dc4aa[_0x4bdd('0x33')]=qs[_0x4bdd('0x34')](_[_0x4bdd('0x35')](_0x4007a8[_0x4bdd('0x2c')],_0x2c7c70[_0x4bdd('0x34')]));if(_0x4007a8[_0x4bdd('0x2c')][_0x4bdd('0x36')]){_0x2dc4aa[_0x4bdd('0x33')]=_[_0x4bdd('0x37')](_0x2dc4aa[_0x4bdd('0x33')],{'$or':_[_0x4bdd('0x27')](_0x2dc4aa[_0x4bdd('0x2f')],function(_0x5cd80b){var _0x383654={};_0x383654[_0x5cd80b]={'$like':'%'+_0x4007a8['query']['filter']+'%'};return _0x383654;})});}_0x2dc4aa=_['merge']({},_0x2dc4aa,_0x4007a8[_0x4bdd('0x39')]);return _0x30d6b0[_0x4bdd('0x59')](_0x2dc4aa);}})['then'](function(_0x1d0c74){if(_0x1d0c74){_0x206b07=_0x1d0c74[_0x4bdd('0x3f')];if(!_0x4007a8['query'][_0x4bdd('0x55')](_0x4bdd('0x31'))){_0x2dc4aa['limit']=qs['limit'](_0x4007a8['query']['limit']);_0x2dc4aa['offset']=qs['offset'](_0x4007a8[_0x4bdd('0x2c')]['offset']);}return _0x30d6b0[_0x4bdd('0x59')](_0x2dc4aa);}})['then'](function(_0x53209f){if(_0x53209f){return _0x53209f?{'count':_0x206b07,'rows':_0x53209f}:null;}})[_0x4bdd('0x20')](respondWithResult(_0x3c1f17,null))[_0x4bdd('0x3c')](handleError(_0x3c1f17,null));};exports[_0x4bdd('0x5b')]=function(_0x973771,_0x45eed1,_0x4bd4c3){var _0x48267c,_0xfe2e2f;var _0xc1a9bb=[];var _0x566d32=moment()['format'](_0x4bdd('0x5c'));return db[_0x4bdd('0x28')][_0x4bdd('0x41')]({'where':{'id':_0x973771[_0x4bdd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x45eed1,null))[_0x4bdd('0x20')](function(_0x32abfa){if(_0x32abfa){_0xfe2e2f=_0x32abfa;return _0x32abfa[_0x4bdd('0x5b')](_0x973771[_0x4bdd('0x43')][_0x4bdd('0x5d')],_[_0x4bdd('0x4c')](_0x973771[_0x4bdd('0x43')],[_0x4bdd('0x5d'),'id'])||{});}return null;})[_0x4bdd('0x5e')](function(_0x5ad60e){var _0x4ce4ee;var _0x269c20;_0x48267c=_0x5ad60e||[];var _0x508978=[];if(_0x5ad60e){for(var _0x46c357=0x0;_0x46c357<_0x5ad60e[_0x4bdd('0x3f')];_0x46c357+=0x1){var _0x1335ce=_0x5ad60e[_0x46c357][_0x4bdd('0x22')]({'plain':!![]});_0xfe2e2f[_0x4bdd('0x5f')]=_0x973771[_0x4bdd('0x43')][_0x4bdd('0x5f')]?_0x973771[_0x4bdd('0x43')][_0x4bdd('0x5f')]:_0xfe2e2f[_0x4bdd('0x5f')];switch(_0xfe2e2f['dialCheckDuplicateType']){case _0x4bdd('0x60'):_0x4ce4ee=squel[_0x4bdd('0x61')]()['into'](_0x4bdd('0x62'))[_0x4bdd('0x63')](['phone',_0x4bdd('0x64'),_0x4bdd('0x65'),_0x4bdd('0x66'),_0x4bdd('0x52'),_0x4bdd('0x4d'),'updatedAt'],squel[_0x4bdd('0x67')]()['field'](_0x4bdd('0x68'),_0x4bdd('0x68'))[_0x4bdd('0x69')](_0x4bdd('0x6a'),_0x4bdd('0x64'))[_0x4bdd('0x69')]('id',_0x4bdd('0x65'))['field'](_0x1335ce[_0x4bdd('0x6b')]['toString'](),_0x4bdd('0x66'))[_0x4bdd('0x69')](_0x973771[_0x4bdd('0x3e')]['id'][_0x4bdd('0x6c')](),_0x4bdd('0x52'))[_0x4bdd('0x69')]('\x27'+_0x566d32+'\x27',_0x4bdd('0x4d'))[_0x4bdd('0x69')]('\x27'+_0x566d32+'\x27','updatedAt')[_0x4bdd('0x6d')](_0x4bdd('0x6e'))['where'](_0x4bdd('0x6f'))['where'](_0x4bdd('0x70'),_0x1335ce['CmListId'][_0x4bdd('0x6c')]())[_0x4bdd('0x33')]('phone\x20IS\x20NOT\x20NULL')[_0x4bdd('0x33')](_0x4bdd('0x71'),squel[_0x4bdd('0x67')]()[_0x4bdd('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0x4bdd('0x6d')](_0x4bdd('0x72'))['where']('CampaignId\x20=\x20?',_0x973771[_0x4bdd('0x3e')]['id']['toString']()))[_0x4bdd('0x33')](_0x4bdd('0x71'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x4bdd('0x6d')](_0x4bdd('0x62'))['where']('CampaignId\x20=\x20?',_0x973771[_0x4bdd('0x3e')]['id'][_0x4bdd('0x6c')]())))[_0x4bdd('0x6c')]();break;case _0x4bdd('0x73'):_0x4ce4ee=squel['insert']()['into'](_0x4bdd('0x62'))[_0x4bdd('0x63')](['phone',_0x4bdd('0x64'),_0x4bdd('0x65'),'ListId','CampaignId',_0x4bdd('0x4d'),_0x4bdd('0x74')],squel[_0x4bdd('0x67')]()['field'](_0x4bdd('0x68'),_0x4bdd('0x68'))[_0x4bdd('0x69')](_0x4bdd('0x6a'),_0x4bdd('0x64'))[_0x4bdd('0x69')]('id',_0x4bdd('0x65'))[_0x4bdd('0x69')](_0x1335ce[_0x4bdd('0x6b')][_0x4bdd('0x6c')](),_0x4bdd('0x66'))[_0x4bdd('0x69')](_0x973771[_0x4bdd('0x3e')]['id']['toString'](),'CampaignId')[_0x4bdd('0x69')]('\x27'+_0x566d32+'\x27',_0x4bdd('0x4d'))['field']('\x27'+_0x566d32+'\x27',_0x4bdd('0x74'))[_0x4bdd('0x6d')](_0x4bdd('0x6e'))[_0x4bdd('0x33')](_0x4bdd('0x6f'))[_0x4bdd('0x33')](_0x4bdd('0x70'),_0x1335ce[_0x4bdd('0x6b')]['toString']())[_0x4bdd('0x33')](_0x4bdd('0x75'))[_0x4bdd('0x33')](_0x4bdd('0x71'),squel[_0x4bdd('0x67')]()[_0x4bdd('0x69')](_0x4bdd('0x76'))[_0x4bdd('0x6d')]('cm_hopper')[_0x4bdd('0x33')](_0x4bdd('0x77'),_0x973771[_0x4bdd('0x3e')]['id'][_0x4bdd('0x6c')]())))[_0x4bdd('0x6c')]();break;default:_0x4ce4ee=squel[_0x4bdd('0x61')]()[_0x4bdd('0x78')]('cm_hopper')['fromQuery']([_0x4bdd('0x68'),_0x4bdd('0x64'),_0x4bdd('0x65'),_0x4bdd('0x66'),_0x4bdd('0x52'),'createdAt',_0x4bdd('0x74')],squel[_0x4bdd('0x67')]()[_0x4bdd('0x69')](_0x4bdd('0x68'),_0x4bdd('0x68'))['field']('NOW()','scheduledAt')['field']('id',_0x4bdd('0x65'))[_0x4bdd('0x69')](_0x1335ce['CmListId'][_0x4bdd('0x6c')](),'ListId')[_0x4bdd('0x69')](_0x973771[_0x4bdd('0x3e')]['id'][_0x4bdd('0x6c')](),'CampaignId')[_0x4bdd('0x69')]('\x27'+_0x566d32+'\x27',_0x4bdd('0x4d'))['field']('\x27'+_0x566d32+'\x27',_0x4bdd('0x74'))['from']('cm_contacts')[_0x4bdd('0x33')]('deletedAt\x20IS\x20NULL')[_0x4bdd('0x33')]('ListId\x20=\x20?',_0x1335ce[_0x4bdd('0x6b')][_0x4bdd('0x6c')]())[_0x4bdd('0x33')](_0x4bdd('0x75')))[_0x4bdd('0x6c')]();}_0x269c20=squel['insert']()[_0x4bdd('0x78')](_0x4bdd('0x79'))[_0x4bdd('0x63')]([_0x4bdd('0x7a'),'scheduledAt','phone',_0x4bdd('0x7b'),_0x4bdd('0x4d'),_0x4bdd('0x74')],squel['select']()['field'](_0x4bdd('0x7c'),'id')[_0x4bdd('0x69')]('NOW()',_0x4bdd('0x64'))[_0x4bdd('0x69')](_0x4bdd('0x7d'),_0x4bdd('0x68'))[_0x4bdd('0x69')](_0x4bdd('0x7e'),'OrderBy')[_0x4bdd('0x69')]('\x27'+_0x566d32+'\x27','createdAt')['field']('\x27'+_0x566d32+'\x27',_0x4bdd('0x74'))[_0x4bdd('0x6d')](_0x4bdd('0x7f'),'ci')[_0x4bdd('0x80')](_0x4bdd('0x62'),'h',_0x4bdd('0x81'))[_0x4bdd('0x33')](_0x4bdd('0x82'),_0x1335ce[_0x4bdd('0x6b')]['toString']())[_0x4bdd('0x33')]('h.CampaignId=?',_0x973771[_0x4bdd('0x3e')]['id'][_0x4bdd('0x6c')]())[_0x4bdd('0x33')](_0x4bdd('0x83'),_0x566d32))[_0x4bdd('0x6c')]();_0x508978[_0x4bdd('0x84')](db[_0x4bdd('0x85')][_0x4bdd('0x2c')](_0x4ce4ee));_0xc1a9bb[_0x4bdd('0x84')](db[_0x4bdd('0x85')][_0x4bdd('0x2c')](_0x269c20));}return BPromise[_0x4bdd('0x86')](_0x508978);}})[_0x4bdd('0x20')](function(){return BPromise[_0x4bdd('0x86')](_0xc1a9bb);})[_0x4bdd('0x20')](function(){return _0x48267c;})[_0x4bdd('0x20')](respondWithResult(_0x45eed1,null))[_0x4bdd('0x3c')](handleError(_0x45eed1,null));};exports[_0x4bdd('0x87')]=function(_0x314673,_0x50c178,_0x33e5f1){return db[_0x4bdd('0x28')]['find']({'where':{'id':_0x314673[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x50c178,null))['then'](function(_0x2a0ca8){if(_0x2a0ca8){return _0x2a0ca8[_0x4bdd('0x87')](_0x314673[_0x4bdd('0x2c')][_0x4bdd('0x5d')]);}})[_0x4bdd('0x20')](function(_0x3b3c9d){if(_0x3b3c9d){return db['CmHopper'][_0x4bdd('0x21')]({'where':{'ListId':_0x314673[_0x4bdd('0x2c')]['ids'],'CampaignId':_0x314673['params']['id']}})['then'](function(){return _0x3b3c9d;});}})[_0x4bdd('0x20')](respondWithStatusCode(_0x50c178,null))[_0x4bdd('0x3c')](handleError(_0x50c178,null));};exports[_0x4bdd('0x88')]=function(_0x1315c6,_0x49777c,_0x2b2989){var _0x579e9b={};var _0x1ae6d6={};var _0x370dfe;var _0x11ecf2;return db[_0x4bdd('0x28')][_0x4bdd('0x4f')]({'where':{'id':_0x1315c6['params']['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x49777c,null))['then'](function(_0x40e826){if(_0x40e826){_0x370dfe=_0x40e826;_0x1ae6d6['model']=_[_0x4bdd('0x2d')](db[_0x4bdd('0x5a')][_0x4bdd('0x29')]);_0x1ae6d6['query']=_[_0x4bdd('0x2d')](_0x1315c6[_0x4bdd('0x2c')]);_0x1ae6d6[_0x4bdd('0x34')]=_[_0x4bdd('0x2e')](_0x1ae6d6[_0x4bdd('0x2b')],_0x1ae6d6[_0x4bdd('0x2c')]);_0x579e9b[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x1ae6d6[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x1315c6['query'][_0x4bdd('0x30')]));_0x579e9b[_0x4bdd('0x2f')]=_0x579e9b[_0x4bdd('0x2f')][_0x4bdd('0x3f')]?_0x579e9b[_0x4bdd('0x2f')]:_0x1ae6d6['model'];_0x579e9b[_0x4bdd('0x51')]=qs['sort'](_0x1315c6[_0x4bdd('0x2c')][_0x4bdd('0x32')]);_0x579e9b[_0x4bdd('0x33')]=qs[_0x4bdd('0x34')](_['pick'](_0x1315c6[_0x4bdd('0x2c')],_0x1ae6d6[_0x4bdd('0x34')]));if(_0x1315c6[_0x4bdd('0x2c')][_0x4bdd('0x36')]){_0x579e9b['where']=_[_0x4bdd('0x37')](_0x579e9b[_0x4bdd('0x33')],{'$or':_['map'](_0x579e9b[_0x4bdd('0x2f')],function(_0x122716){var _0x43c445={};_0x43c445[_0x122716]={'$like':'%'+_0x1315c6[_0x4bdd('0x2c')][_0x4bdd('0x36')]+'%'};return _0x43c445;})});}_0x579e9b=_[_0x4bdd('0x37')]({},_0x579e9b,_0x1315c6[_0x4bdd('0x39')]);return _0x370dfe['getBlackLists'](_0x579e9b);}})[_0x4bdd('0x20')](function(_0x34cbc5){if(_0x34cbc5){_0x11ecf2=_0x34cbc5[_0x4bdd('0x3f')];if(!_0x1315c6[_0x4bdd('0x2c')]['hasOwnProperty'](_0x4bdd('0x31'))){_0x579e9b['limit']=qs[_0x4bdd('0x19')](_0x1315c6[_0x4bdd('0x2c')][_0x4bdd('0x19')]);_0x579e9b['offset']=qs['offset'](_0x1315c6[_0x4bdd('0x2c')][_0x4bdd('0x17')]);}return _0x370dfe[_0x4bdd('0x88')](_0x579e9b);}})[_0x4bdd('0x20')](function(_0xd44331){if(_0xd44331){return _0xd44331?{'count':_0x11ecf2,'rows':_0xd44331}:null;}})[_0x4bdd('0x20')](respondWithResult(_0x49777c,null))[_0x4bdd('0x3c')](handleError(_0x49777c,null));};exports[_0x4bdd('0x89')]=function(_0x5c69af,_0x5bcdd0,_0xee493c){var _0x5351ac,_0x45848a;var _0x59d37f=[];var _0x21fea7=moment()[_0x4bdd('0x8a')](_0x4bdd('0x5c'));return db[_0x4bdd('0x28')]['find']({'where':{'id':_0x5c69af[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x5bcdd0,null))[_0x4bdd('0x20')](function(_0x3a6928){if(_0x3a6928){_0x45848a=_0x3a6928;return _0x3a6928[_0x4bdd('0x89')](_0x5c69af[_0x4bdd('0x43')][_0x4bdd('0x5d')],_[_0x4bdd('0x4c')](_0x5c69af[_0x4bdd('0x43')],[_0x4bdd('0x5d'),'id'])||{});}return null;})[_0x4bdd('0x5e')](function(_0xbab814){var _0x12da8f;var _0x3bcf53;_0x5351ac=_0xbab814||[];var _0xacc05=[];if(_0xbab814){for(var _0xc2e5e5=0x0;_0xc2e5e5<_0xbab814[_0x4bdd('0x3f')];_0xc2e5e5+=0x1){var _0x299197=_0xbab814[_0xc2e5e5]['get']({'plain':!![]});_0x12da8f=squel['insert']()[_0x4bdd('0x78')]('cm_hopper_black')[_0x4bdd('0x63')](['phone',_0x4bdd('0x65'),_0x4bdd('0x66'),_0x4bdd('0x52'),_0x4bdd('0x4d'),_0x4bdd('0x74')],squel[_0x4bdd('0x67')]()['field'](_0x4bdd('0x68'),_0x4bdd('0x68'))[_0x4bdd('0x69')]('id',_0x4bdd('0x65'))[_0x4bdd('0x69')](_0x299197[_0x4bdd('0x6b')][_0x4bdd('0x6c')](),_0x4bdd('0x66'))['field'](_0x5c69af[_0x4bdd('0x3e')]['id'][_0x4bdd('0x6c')](),_0x4bdd('0x52'))[_0x4bdd('0x69')](_0x4bdd('0x6a'),'createdAt')[_0x4bdd('0x69')](_0x4bdd('0x6a'),'updatedAt')[_0x4bdd('0x6d')](_0x4bdd('0x6e'))[_0x4bdd('0x33')]('deletedAt\x20IS\x20NULL')[_0x4bdd('0x33')](_0x4bdd('0x70'),_0x299197['CmListId'][_0x4bdd('0x6c')]())[_0x4bdd('0x33')](_0x4bdd('0x75')))['toString']();_0xacc05[_0x4bdd('0x84')](db[_0x4bdd('0x85')]['query'](_0x12da8f));}return BPromise[_0x4bdd('0x86')](_0xacc05);}})[_0x4bdd('0x20')](function(){return _0x5351ac;})['then'](respondWithResult(_0x5bcdd0,null))[_0x4bdd('0x3c')](handleError(_0x5bcdd0,null));};exports[_0x4bdd('0x8b')]=function(_0x5829af,_0x34b4e4,_0x30005c){return db[_0x4bdd('0x28')][_0x4bdd('0x41')]({'where':{'id':_0x5829af[_0x4bdd('0x3e')]['id']}})[_0x4bdd('0x20')](handleEntityNotFound(_0x34b4e4,null))[_0x4bdd('0x20')](function(_0x4a050e){if(_0x4a050e){return _0x4a050e[_0x4bdd('0x8b')](_0x5829af['query']['ids']);}})['then'](function(_0x13449f){if(_0x13449f){return db['CmHopperBlack'][_0x4bdd('0x21')]({'where':{'ListId':_0x5829af[_0x4bdd('0x2c')]['ids'],'CampaignId':_0x5829af[_0x4bdd('0x3e')]['id']}})['then'](function(){return _0x13449f;});}})[_0x4bdd('0x20')](respondWithStatusCode(_0x34b4e4,null))[_0x4bdd('0x3c')](handleError(_0x34b4e4,null));};
\ No newline at end of file
+var _0xda66=['../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','get','IvrCampaigns','destroy','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x3f8a3b,_0x4385ca){var _0x1cd2e2=function(_0x334706){while(--_0x334706){_0x3f8a3b['push'](_0x3f8a3b['shift']());}};_0x1cd2e2(++_0x4385ca);}(_0xda66,0x7f));var _0x6da6=function(_0x584789,_0x1f4b10){_0x584789=_0x584789-0x0;var _0x57c028=_0xda66[_0x584789];return _0x57c028;};'use strict';var emlformat=require(_0x6da6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6da6('0x1'));var jsonpatch=require(_0x6da6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6da6('0x3'));var util=require(_0x6da6('0x4'));var path=require(_0x6da6('0x5'));var sox=require(_0x6da6('0x6'));var csv=require(_0x6da6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6da6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6da6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6da6('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6da6('0xb'));var Redis=require(_0x6da6('0xc'));var authService=require(_0x6da6('0xd'));var qs=require(_0x6da6('0xe'));var as=require(_0x6da6('0xf'));var hardwareService=require(_0x6da6('0x10'));var logger=require(_0x6da6('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6da6('0x12'));var licenseUtil=require(_0x6da6('0x13'));var db=require(_0x6da6('0x14'))['db'];function respondWithStatusCode(_0xa7da31,_0x57d6ad){_0x57d6ad=_0x57d6ad||0xcc;return function(_0x118ac9){if(_0x118ac9){return _0xa7da31['sendStatus'](_0x57d6ad);}return _0xa7da31[_0x6da6('0x15')](_0x57d6ad)[_0x6da6('0x16')]();};}function respondWithResult(_0x173238,_0x44290c){_0x44290c=_0x44290c||0xc8;return function(_0x18a255){if(_0x18a255){return _0x173238[_0x6da6('0x15')](_0x44290c)[_0x6da6('0x17')](_0x18a255);}};}function respondWithFilteredResult(_0x58d817,_0x557e72){return function(_0x50393e){if(_0x50393e){var _0x57348f=typeof _0x557e72['offset']==='undefined'&&typeof _0x557e72[_0x6da6('0x18')]===_0x6da6('0x19');var _0x321c67=_0x50393e[_0x6da6('0x1a')];var _0x2fd36d=_0x57348f?0x0:_0x557e72['offset'];var _0x2bf7d9=_0x57348f?_0x50393e[_0x6da6('0x1a')]:_0x557e72[_0x6da6('0x1b')]+_0x557e72['limit'];var _0x10f673;if(_0x2bf7d9>=_0x321c67){_0x2bf7d9=_0x321c67;_0x10f673=0xc8;}else{_0x10f673=0xce;}_0x58d817['status'](_0x10f673);return _0x58d817[_0x6da6('0x1c')](_0x6da6('0x1d'),_0x2fd36d+'-'+_0x2bf7d9+'/'+_0x321c67)[_0x6da6('0x17')](_0x50393e);}return null;};}function patchUpdates(_0xd63d5b){return function(_0x59b347){try{jsonpatch[_0x6da6('0x1e')](_0x59b347,_0xd63d5b,!![]);}catch(_0x37f406){return BPromise['reject'](_0x37f406);}return _0x59b347[_0x6da6('0x1f')]();};}function saveUpdates(_0x17f731,_0x3ff78b){return function(_0x2366e7){if(_0x2366e7){return _0x2366e7['update'](_0x17f731)[_0x6da6('0x20')](function(_0x34bf25){return _0x34bf25;});}return null;};}function removeEntity(_0x3b7340,_0xe1d27e){return function(_0x48ff63){if(_0x48ff63){return _0x48ff63['destroy']()[_0x6da6('0x20')](function(){var _0x39fb46=_0x48ff63[_0x6da6('0x21')]({'plain':!![]});var _0x30269f=_0x6da6('0x22');return db['UserProfileResource'][_0x6da6('0x23')]({'where':{'type':_0x30269f,'resourceId':_0x39fb46['id']}})[_0x6da6('0x20')](function(){return _0x48ff63;});})[_0x6da6('0x20')](function(){_0x3b7340[_0x6da6('0x15')](0xcc)[_0x6da6('0x16')]();});}};}function handleEntityNotFound(_0x3a3903,_0x15262a){return function(_0x575f7d){if(!_0x575f7d){_0x3a3903[_0x6da6('0x24')](0x194);}return _0x575f7d;};}function handleError(_0x263989,_0x2274ad){_0x2274ad=_0x2274ad||0x1f4;return function(_0x1cd1a4){logger[_0x6da6('0x25')](_0x1cd1a4[_0x6da6('0x26')]);if(_0x1cd1a4[_0x6da6('0x27')]){delete _0x1cd1a4[_0x6da6('0x27')];}_0x263989[_0x6da6('0x15')](_0x2274ad)[_0x6da6('0x28')](_0x1cd1a4);};}exports[_0x6da6('0x29')]=function(_0x5c380b,_0x3d4572){var _0x4b7e10={},_0x945988={},_0x414d68={'count':0x0,'rows':[]};var _0x357b2d=_[_0x6da6('0x2a')](db[_0x6da6('0x2b')][_0x6da6('0x2c')],function(_0x53fad5){return{'name':_0x53fad5[_0x6da6('0x2d')],'type':_0x53fad5[_0x6da6('0x2e')][_0x6da6('0x2f')]};});_0x945988['model']=_[_0x6da6('0x2a')](_0x357b2d,'name');_0x945988[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x5c380b[_0x6da6('0x30')]);_0x945988[_0x6da6('0x32')]=_['intersection'](_0x945988[_0x6da6('0x33')],_0x945988[_0x6da6('0x30')]);_0x4b7e10[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x945988['model'],qs['fields'](_0x5c380b[_0x6da6('0x30')]['fields']));_0x4b7e10[_0x6da6('0x34')]=_0x4b7e10[_0x6da6('0x34')]['length']?_0x4b7e10[_0x6da6('0x34')]:_0x945988['model'];if(!_0x5c380b[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x4b7e10[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x5c380b[_0x6da6('0x30')][_0x6da6('0x18')]);_0x4b7e10['offset']=qs['offset'](_0x5c380b['query']['offset']);}_0x4b7e10['order']=qs[_0x6da6('0x38')](_0x5c380b[_0x6da6('0x30')][_0x6da6('0x38')]);_0x4b7e10[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_['pick'](_0x5c380b[_0x6da6('0x30')],_0x945988[_0x6da6('0x32')]),_0x357b2d);if(_0x5c380b[_0x6da6('0x30')]['filter']){_0x4b7e10[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x4b7e10[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x357b2d,function(_0x19ae4c){if(_0x19ae4c[_0x6da6('0x2e')]!=='VIRTUAL'){var _0x22cd85={};_0x22cd85[_0x19ae4c[_0x6da6('0x27')]]={'$like':'%'+_0x5c380b[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x22cd85;}})});}_0x4b7e10=_[_0x6da6('0x3a')]({},_0x4b7e10,_0x5c380b[_0x6da6('0x3c')]);var _0x3733d4={'where':_0x4b7e10[_0x6da6('0x39')]};return db[_0x6da6('0x2b')][_0x6da6('0x1a')](_0x3733d4)[_0x6da6('0x20')](function(_0x14ede3){_0x414d68['count']=_0x14ede3;if(_0x5c380b[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x4b7e10[_0x6da6('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0x6da6('0x3f')](_0x4b7e10);})['then'](function(_0x40bd0e){_0x414d68[_0x6da6('0x40')]=_0x40bd0e;return _0x414d68;})['then'](respondWithFilteredResult(_0x3d4572,_0x4b7e10))[_0x6da6('0x41')](handleError(_0x3d4572,null));};exports['show']=function(_0x588175,_0x9601e2){var _0x13e970={'raw':![],'where':{'id':_0x588175[_0x6da6('0x42')]['id']}},_0x1611df={};_0x1611df[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x2b')][_0x6da6('0x2c')]);_0x1611df[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x588175[_0x6da6('0x30')]);_0x1611df[_0x6da6('0x32')]=_['intersection'](_0x1611df[_0x6da6('0x33')],_0x1611df[_0x6da6('0x30')]);_0x13e970[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x1611df['model'],qs[_0x6da6('0x43')](_0x588175['query'][_0x6da6('0x43')]));_0x13e970['attributes']=_0x13e970[_0x6da6('0x34')][_0x6da6('0x44')]?_0x13e970[_0x6da6('0x34')]:_0x1611df[_0x6da6('0x33')];if(_0x588175[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x13e970['include']=[{'all':!![]}];}_0x13e970=_['merge']({},_0x13e970,_0x588175[_0x6da6('0x3c')]);return db[_0x6da6('0x2b')][_0x6da6('0x45')](_0x13e970)['then'](handleEntityNotFound(_0x9601e2,null))[_0x6da6('0x20')](respondWithResult(_0x9601e2,null))[_0x6da6('0x41')](handleError(_0x9601e2,null));};exports[_0x6da6('0x46')]=function(_0x22e236,_0xc54684){return db[_0x6da6('0x2b')][_0x6da6('0x46')](_0x22e236[_0x6da6('0x47')],{})[_0x6da6('0x20')](function(_0x21f968){var _0x2076be=_0x22e236[_0x6da6('0x48')][_0x6da6('0x21')]({'plain':!![]});if(!_0x2076be)throw new Error(_0x6da6('0x49'));if(_0x2076be[_0x6da6('0x4a')]===_0x6da6('0x48')){var _0x2a6761=_0x21f968[_0x6da6('0x21')]({'plain':!![]});var _0x4121fd=_0x6da6('0x22');return db[_0x6da6('0x4b')][_0x6da6('0x45')]({'where':{'name':_0x4121fd,'userProfileId':_0x2076be[_0x6da6('0x4c')]},'raw':!![]})[_0x6da6('0x20')](function(_0x20bc74){if(_0x20bc74&&_0x20bc74[_0x6da6('0x4d')]===0x0){return db[_0x6da6('0x4e')][_0x6da6('0x46')]({'name':_0x2a6761[_0x6da6('0x27')],'resourceId':_0x2a6761['id'],'type':_0x20bc74[_0x6da6('0x27')],'sectionId':_0x20bc74['id']},{})[_0x6da6('0x20')](function(){return _0x21f968;});}else{return _0x21f968;}})[_0x6da6('0x41')](function(_0x3e468c){logger[_0x6da6('0x25')](_0x6da6('0x4f'),_0x3e468c);throw _0x3e468c;});}return _0x21f968;})[_0x6da6('0x20')](respondWithResult(_0xc54684,0xc9))[_0x6da6('0x41')](handleError(_0xc54684,null));};exports['clone']=function(_0x177a4e,_0x46cb75){var _0x401f57={'where':{'id':_0x177a4e[_0x6da6('0x42')]['id']}},_0x51f0f9={};_0x51f0f9[_0x6da6('0x33')]=_['keys'](db[_0x6da6('0x2b')][_0x6da6('0x2c')]);_0x401f57[_0x6da6('0x34')]=_['intersection'](_0x51f0f9[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x177a4e[_0x6da6('0x30')][_0x6da6('0x43')]));_0x401f57[_0x6da6('0x34')]=_0x401f57[_0x6da6('0x34')]['length']?_0x401f57[_0x6da6('0x34')]:_0x51f0f9[_0x6da6('0x33')];if(_0x177a4e[_0x6da6('0x30')]['includeAll']){_0x401f57['include']=[{'all':!![]}];}_0x401f57=_['merge']({},_0x401f57,_0x177a4e['options']);return db[_0x6da6('0x2b')][_0x6da6('0x45')](_0x401f57)[_0x6da6('0x20')](handleEntityNotFound(_0x46cb75,null))[_0x6da6('0x20')](function(_0x2de317){if(_0x2de317){var _0x25925b=_0x2de317[_0x6da6('0x21')]({'plain':!![]});_0x25925b=qs[_0x6da6('0x50')](_0x25925b,['id',_0x6da6('0x51'),'updatedAt']);_0x177a4e[_0x6da6('0x47')]=_[_0x6da6('0x50')](_0x177a4e[_0x6da6('0x47')],['id',_0x6da6('0x51'),_0x6da6('0x52')]);return db[_0x6da6('0x2b')][_0x6da6('0x46')](_[_0x6da6('0x3a')](_0x25925b,_0x177a4e[_0x6da6('0x47')]),{'include':_0x177a4e['query'][_0x6da6('0x3d')]?[{'all':!![]}]:undefined})[_0x6da6('0x20')](function(_0xd76a95){var _0x3826f4=_0x177a4e[_0x6da6('0x48')][_0x6da6('0x21')]({'plain':!![]});if(!_0x3826f4)throw new Error(_0x6da6('0x49'));if(_0x3826f4[_0x6da6('0x4a')]===_0x6da6('0x48')){var _0x30e35c=_0xd76a95[_0x6da6('0x21')]({'plain':!![]});var _0x57c710=_0x6da6('0x22');return db['UserProfileSection'][_0x6da6('0x45')]({'where':{'name':_0x57c710,'userProfileId':_0x3826f4[_0x6da6('0x4c')]},'raw':!![]})[_0x6da6('0x20')](function(_0x1c3dbc){if(_0x1c3dbc&&_0x1c3dbc[_0x6da6('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x30e35c[_0x6da6('0x27')],'resourceId':_0x30e35c['id'],'type':_0x1c3dbc['name'],'sectionId':_0x1c3dbc['id']},{})['then'](function(){return _0xd76a95;});}else{return _0xd76a95;}})[_0x6da6('0x41')](function(_0x416483){logger['error'](_0x6da6('0x4f'),_0x416483);throw _0x416483;});}return _0xd76a95;});}})['then'](respondWithResult(_0x46cb75,0xc9))[_0x6da6('0x41')](handleError(_0x46cb75,null));};exports['update']=function(_0x36a671,_0x1620e7){if(_0x36a671['body']['id']){delete _0x36a671[_0x6da6('0x47')]['id'];}return db[_0x6da6('0x2b')]['find']({'where':{'id':_0x36a671[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x1620e7,null))['then'](saveUpdates(_0x36a671['body'],null))[_0x6da6('0x20')](respondWithResult(_0x1620e7,null))[_0x6da6('0x41')](handleError(_0x1620e7,null));};exports[_0x6da6('0x23')]=function(_0x10f976,_0x4b0e98){return db[_0x6da6('0x2b')]['find']({'where':{'id':_0x10f976[_0x6da6('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b0e98,null))[_0x6da6('0x20')](removeEntity(_0x4b0e98,null))[_0x6da6('0x41')](handleError(_0x4b0e98,null));};exports[_0x6da6('0x53')]=function(_0x380ab7,_0xe5277c,_0x42fc41){var _0xc6505c={'raw':!![],'where':{}};var _0x5dfbcf={};var _0x58764f={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x380ab7[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0xe5277c,null))[_0x6da6('0x20')](function(_0x3667e3){if(_0x3667e3){_0x5dfbcf['model']=_[_0x6da6('0x31')](db[_0x6da6('0x55')][_0x6da6('0x2c')]);_0x5dfbcf[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x380ab7['query']);_0x5dfbcf[_0x6da6('0x32')]=_[_0x6da6('0x35')](_0x5dfbcf['model'],_0x5dfbcf[_0x6da6('0x30')]);_0xc6505c['attributes']=_[_0x6da6('0x35')](_0x5dfbcf[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x380ab7[_0x6da6('0x30')][_0x6da6('0x43')]));_0xc6505c['attributes']=_0xc6505c[_0x6da6('0x34')]['length']?_0xc6505c[_0x6da6('0x34')]:_0x5dfbcf[_0x6da6('0x33')];if(!_0x380ab7[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0xc6505c[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x380ab7['query']['limit']);_0xc6505c[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x380ab7[_0x6da6('0x30')][_0x6da6('0x1b')]);}_0xc6505c[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x380ab7[_0x6da6('0x30')][_0x6da6('0x38')]);_0xc6505c['where']=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x380ab7[_0x6da6('0x30')],_0x5dfbcf[_0x6da6('0x32')]));_0xc6505c[_0x6da6('0x39')][_0x6da6('0x58')]=_0x3667e3['id'];if(_0x380ab7[_0x6da6('0x30')][_0x6da6('0x3b')]){_0xc6505c[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0xc6505c['where'],{'$or':_[_0x6da6('0x2a')](_0xc6505c[_0x6da6('0x34')],function(_0x2773ad){var _0x3b12e2={};_0x3b12e2[_0x2773ad]={'$like':'%'+_0x380ab7[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x3b12e2;})});}_0xc6505c=_[_0x6da6('0x3a')]({},_0xc6505c,_0x380ab7[_0x6da6('0x3c')]);return db[_0x6da6('0x55')][_0x6da6('0x1a')]({'where':_0xc6505c['where']})['then'](function(_0x320fab){_0x58764f['count']=_0x320fab;if(_0x380ab7['query'][_0x6da6('0x3d')]){_0xc6505c[_0x6da6('0x3e')]=[{'all':!![]}];}return db[_0x6da6('0x55')]['findAll'](_0xc6505c);})[_0x6da6('0x20')](function(_0x2b8a4c){_0x58764f[_0x6da6('0x40')]=_0x2b8a4c;return _0x58764f;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0xe5277c,_0xc6505c))['catch'](handleError(_0xe5277c,null));};exports[_0x6da6('0x59')]=function(_0x48bb49,_0x46648d,_0x4487ad){var _0x287042={'raw':!![],'where':{}};var _0x4848e8={};var _0x2658e3={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')]['findOne']({'where':{'id':_0x48bb49[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x46648d,null))[_0x6da6('0x20')](function(_0x4b11a8){if(_0x4b11a8){_0x4848e8[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5a')][_0x6da6('0x2c')]);_0x4848e8[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x48bb49[_0x6da6('0x30')]);_0x4848e8['filters']=_[_0x6da6('0x35')](_0x4848e8[_0x6da6('0x33')],_0x4848e8[_0x6da6('0x30')]);_0x287042['attributes']=_['intersection'](_0x4848e8[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x48bb49[_0x6da6('0x30')][_0x6da6('0x43')]));_0x287042[_0x6da6('0x34')]=_0x287042['attributes'][_0x6da6('0x44')]?_0x287042['attributes']:_0x4848e8[_0x6da6('0x33')];if(!_0x48bb49[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x287042[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x48bb49[_0x6da6('0x30')]['limit']);_0x287042['offset']=qs['offset'](_0x48bb49[_0x6da6('0x30')][_0x6da6('0x1b')]);}_0x287042['order']=qs[_0x6da6('0x38')](_0x48bb49[_0x6da6('0x30')]['sort']);_0x287042[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x48bb49[_0x6da6('0x30')],_0x4848e8[_0x6da6('0x32')]));_0x287042[_0x6da6('0x39')][_0x6da6('0x58')]=_0x4b11a8['id'];if(_0x48bb49[_0x6da6('0x30')][_0x6da6('0x3b')]){_0x287042['where']=_['merge'](_0x287042[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x287042[_0x6da6('0x34')],function(_0x140d6d){var _0x1fef4d={};_0x1fef4d[_0x140d6d]={'$like':'%'+_0x48bb49[_0x6da6('0x30')]['filter']+'%'};return _0x1fef4d;})});}_0x287042=_[_0x6da6('0x3a')]({},_0x287042,_0x48bb49[_0x6da6('0x3c')]);return db['CmHopperHistory'][_0x6da6('0x1a')]({'where':_0x287042[_0x6da6('0x39')]})[_0x6da6('0x20')](function(_0x4c7492){_0x2658e3[_0x6da6('0x1a')]=_0x4c7492;if(_0x48bb49[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x287042[_0x6da6('0x3e')]=[{'all':!![]}];}return db[_0x6da6('0x5a')][_0x6da6('0x3f')](_0x287042);})[_0x6da6('0x20')](function(_0x25db84){_0x2658e3[_0x6da6('0x40')]=_0x25db84;return _0x2658e3;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0x46648d,_0x287042))[_0x6da6('0x41')](handleError(_0x46648d,null));};exports[_0x6da6('0x5b')]=function(_0x483f72,_0x169e82,_0x3f50ee){var _0x273626={'raw':!![],'where':{}};var _0x3f4407={};var _0x57dc3c={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x483f72['params']['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x169e82,null))[_0x6da6('0x20')](function(_0x4cc9dd){if(_0x4cc9dd){_0x3f4407[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5c')]['rawAttributes']);_0x3f4407[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x483f72[_0x6da6('0x30')]);_0x3f4407[_0x6da6('0x32')]=_[_0x6da6('0x35')](_0x3f4407['model'],_0x3f4407[_0x6da6('0x30')]);_0x273626[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x3f4407[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x483f72[_0x6da6('0x30')][_0x6da6('0x43')]));_0x273626[_0x6da6('0x34')]=_0x273626[_0x6da6('0x34')]['length']?_0x273626[_0x6da6('0x34')]:_0x3f4407[_0x6da6('0x33')];if(!_0x483f72['query']['hasOwnProperty'](_0x6da6('0x37'))){_0x273626[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x483f72['query'][_0x6da6('0x18')]);_0x273626[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x483f72['query']['offset']);}_0x273626[_0x6da6('0x56')]=qs['sort'](_0x483f72[_0x6da6('0x30')][_0x6da6('0x38')]);_0x273626['where']=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x483f72[_0x6da6('0x30')],_0x3f4407[_0x6da6('0x32')]));_0x273626[_0x6da6('0x39')][_0x6da6('0x58')]=_0x4cc9dd['id'];if(_0x483f72['query'][_0x6da6('0x3b')]){_0x273626['where']=_[_0x6da6('0x3a')](_0x273626[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x273626['attributes'],function(_0x3d267f){var _0xaba7d7={};_0xaba7d7[_0x3d267f]={'$like':'%'+_0x483f72['query'][_0x6da6('0x3b')]+'%'};return _0xaba7d7;})});}_0x273626=_['merge']({},_0x273626,_0x483f72['options']);return db[_0x6da6('0x5c')]['count']({'where':_0x273626[_0x6da6('0x39')]})['then'](function(_0x3bae7c){_0x57dc3c['count']=_0x3bae7c;if(_0x483f72[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x273626['include']=[{'all':!![]}];}return db[_0x6da6('0x5c')][_0x6da6('0x3f')](_0x273626);})[_0x6da6('0x20')](function(_0x2e74c9){_0x57dc3c[_0x6da6('0x40')]=_0x2e74c9;return _0x57dc3c;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0x169e82,_0x273626))[_0x6da6('0x41')](handleError(_0x169e82,null));};exports[_0x6da6('0x5d')]=function(_0x281b11,_0x5547e9,_0x2f270c){var _0x7b9951={'raw':!![],'where':{}};var _0x2c824c={};var _0x4987be={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x281b11[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x5547e9,null))[_0x6da6('0x20')](function(_0x359066){if(_0x359066){_0x2c824c[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5e')]['rawAttributes']);_0x2c824c[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x281b11[_0x6da6('0x30')]);_0x2c824c[_0x6da6('0x32')]=_['intersection'](_0x2c824c['model'],_0x2c824c[_0x6da6('0x30')]);_0x7b9951[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x2c824c['model'],qs[_0x6da6('0x43')](_0x281b11[_0x6da6('0x30')][_0x6da6('0x43')]));_0x7b9951['attributes']=_0x7b9951[_0x6da6('0x34')]['length']?_0x7b9951[_0x6da6('0x34')]:_0x2c824c[_0x6da6('0x33')];if(!_0x281b11[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x7b9951[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x281b11[_0x6da6('0x30')][_0x6da6('0x18')]);_0x7b9951[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x281b11[_0x6da6('0x30')]['offset']);}_0x7b9951[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x281b11['query']['sort']);_0x7b9951[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x281b11['query'],_0x2c824c[_0x6da6('0x32')]));_0x7b9951[_0x6da6('0x39')][_0x6da6('0x58')]=_0x359066['id'];if(_0x281b11[_0x6da6('0x30')][_0x6da6('0x3b')]){_0x7b9951[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x7b9951[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x7b9951[_0x6da6('0x34')],function(_0x23192d){var _0x13a0ff={};_0x13a0ff[_0x23192d]={'$like':'%'+_0x281b11['query'][_0x6da6('0x3b')]+'%'};return _0x13a0ff;})});}_0x7b9951=_[_0x6da6('0x3a')]({},_0x7b9951,_0x281b11[_0x6da6('0x3c')]);return db[_0x6da6('0x5e')]['count']({'where':_0x7b9951[_0x6da6('0x39')]})[_0x6da6('0x20')](function(_0x4aac02){_0x4987be[_0x6da6('0x1a')]=_0x4aac02;if(_0x281b11['query']['includeAll']){_0x7b9951[_0x6da6('0x3e')]=[{'all':!![]}];}return db[_0x6da6('0x5e')][_0x6da6('0x3f')](_0x7b9951);})['then'](function(_0xba036d){_0x4987be[_0x6da6('0x40')]=_0xba036d;return _0x4987be;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0x5547e9,_0x7b9951))['catch'](handleError(_0x5547e9,null));};exports['getLists']=function(_0x2ad2f8,_0x410cb2,_0x4cc417){var _0x189ac2={};var _0x2c7407={};var _0x406990;var _0x4cad70;return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x2ad2f8[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x410cb2,null))[_0x6da6('0x20')](function(_0x4ebb94){if(_0x4ebb94){_0x406990=_0x4ebb94;_0x2c7407['model']=_[_0x6da6('0x31')](db[_0x6da6('0x5f')][_0x6da6('0x2c')]);_0x2c7407['query']=_['keys'](_0x2ad2f8[_0x6da6('0x30')]);_0x2c7407['filters']=_['intersection'](_0x2c7407[_0x6da6('0x33')],_0x2c7407[_0x6da6('0x30')]);_0x189ac2[_0x6da6('0x34')]=_['intersection'](_0x2c7407['model'],qs[_0x6da6('0x43')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x43')]));_0x189ac2[_0x6da6('0x34')]=_0x189ac2[_0x6da6('0x34')][_0x6da6('0x44')]?_0x189ac2[_0x6da6('0x34')]:_0x2c7407[_0x6da6('0x33')];_0x189ac2[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x38')]);_0x189ac2[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x2ad2f8[_0x6da6('0x30')],_0x2c7407[_0x6da6('0x32')]));if(_0x2ad2f8['query'][_0x6da6('0x3b')]){_0x189ac2[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x189ac2['where'],{'$or':_[_0x6da6('0x2a')](_0x189ac2[_0x6da6('0x34')],function(_0x1658f7){var _0x368ca7={};_0x368ca7[_0x1658f7]={'$like':'%'+_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x368ca7;})});}_0x189ac2=_[_0x6da6('0x3a')]({},_0x189ac2,_0x2ad2f8[_0x6da6('0x3c')]);return _0x406990[_0x6da6('0x60')](_0x189ac2);}})[_0x6da6('0x20')](function(_0x915306){if(_0x915306){_0x4cad70=_0x915306['length'];if(!_0x2ad2f8['query'][_0x6da6('0x36')](_0x6da6('0x37'))){_0x189ac2['limit']=qs[_0x6da6('0x18')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x18')]);_0x189ac2[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x1b')]);}return _0x406990[_0x6da6('0x60')](_0x189ac2);}})['then'](function(_0x3e9997){if(_0x3e9997){return _0x3e9997?{'count':_0x4cad70,'rows':_0x3e9997}:null;}})[_0x6da6('0x20')](respondWithResult(_0x410cb2,null))[_0x6da6('0x41')](handleError(_0x410cb2,null));};exports[_0x6da6('0x61')]=function(_0x5f10fd,_0x2c7e8e,_0x218110){var _0x40ba25,_0x59c435;var _0x18e81c=[];var _0x657eea=moment()[_0x6da6('0x62')](_0x6da6('0x63'));return db['Campaign']['find']({'where':{'id':_0x5f10fd[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x2c7e8e,null))[_0x6da6('0x20')](function(_0x215c02){if(_0x215c02){_0x59c435=_0x215c02;return _0x215c02[_0x6da6('0x61')](_0x5f10fd[_0x6da6('0x47')][_0x6da6('0x64')],_[_0x6da6('0x50')](_0x5f10fd[_0x6da6('0x47')],['ids','id'])||{});}return null;})['spread'](function(_0x4097ca){var _0x49b13d;var _0x2af6d9;_0x40ba25=_0x4097ca||[];var _0x15710e=[];if(_0x4097ca){for(var _0x553198=0x0;_0x553198<_0x4097ca[_0x6da6('0x44')];_0x553198+=0x1){var _0x265a50=_0x4097ca[_0x553198][_0x6da6('0x21')]({'plain':!![]});_0x59c435['dialCheckDuplicateType']=_0x5f10fd['body'][_0x6da6('0x65')]?_0x5f10fd[_0x6da6('0x47')][_0x6da6('0x65')]:_0x59c435['dialCheckDuplicateType'];switch(_0x59c435[_0x6da6('0x65')]){case _0x6da6('0x66'):_0x49b13d=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x69'))[_0x6da6('0x6a')]([_0x6da6('0x6b'),_0x6da6('0x6c'),_0x6da6('0x6d'),'ListId',_0x6da6('0x58'),_0x6da6('0x51'),_0x6da6('0x52')],squel[_0x6da6('0x6e')]()[_0x6da6('0x6f')](_0x6da6('0x6b'),_0x6da6('0x6b'))[_0x6da6('0x6f')](_0x6da6('0x70'),_0x6da6('0x6c'))[_0x6da6('0x6f')]('id',_0x6da6('0x6d'))['field'](_0x265a50['CmListId']['toString'](),'ListId')['field'](_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')](),_0x6da6('0x58'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x51'))['field']('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))['from'](_0x6da6('0x72'))['where'](_0x6da6('0x73'))['where'](_0x6da6('0x74'),_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')]())[_0x6da6('0x39')](_0x6da6('0x76'))[_0x6da6('0x39')](_0x6da6('0x77'),squel['select']()[_0x6da6('0x6f')](_0x6da6('0x78'))[_0x6da6('0x79')](_0x6da6('0x7a'))[_0x6da6('0x39')](_0x6da6('0x7b'),_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')]()))[_0x6da6('0x39')](_0x6da6('0x77'),squel['select']()[_0x6da6('0x6f')](_0x6da6('0x7c'))[_0x6da6('0x79')](_0x6da6('0x69'))[_0x6da6('0x39')](_0x6da6('0x7b'),_0x5f10fd[_0x6da6('0x42')]['id']['toString']())))[_0x6da6('0x71')]();break;case _0x6da6('0x7d'):_0x49b13d=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x69'))['fromQuery']([_0x6da6('0x6b'),_0x6da6('0x6c'),_0x6da6('0x6d'),_0x6da6('0x7e'),'CampaignId',_0x6da6('0x51'),'updatedAt'],squel[_0x6da6('0x6e')]()[_0x6da6('0x6f')](_0x6da6('0x6b'),'phone')[_0x6da6('0x6f')](_0x6da6('0x70'),_0x6da6('0x6c'))['field']('id','ContactId')[_0x6da6('0x6f')](_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')](),_0x6da6('0x7e'))[_0x6da6('0x6f')](_0x5f10fd[_0x6da6('0x42')]['id']['toString'](),_0x6da6('0x58'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27','createdAt')[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))[_0x6da6('0x79')]('cm_contacts')[_0x6da6('0x39')]('deletedAt\x20IS\x20NULL')[_0x6da6('0x39')]('ListId\x20=\x20?',_0x265a50[_0x6da6('0x75')]['toString']())[_0x6da6('0x39')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x6da6('0x77'),squel[_0x6da6('0x6e')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x6da6('0x69'))[_0x6da6('0x39')](_0x6da6('0x7b'),_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')]())))[_0x6da6('0x71')]();break;default:_0x49b13d=squel['insert']()[_0x6da6('0x68')]('cm_hopper')[_0x6da6('0x6a')]([_0x6da6('0x6b'),'scheduledAt',_0x6da6('0x6d'),'ListId',_0x6da6('0x58'),_0x6da6('0x51'),_0x6da6('0x52')],squel['select']()[_0x6da6('0x6f')](_0x6da6('0x6b'),'phone')[_0x6da6('0x6f')]('NOW()',_0x6da6('0x6c'))['field']('id',_0x6da6('0x6d'))['field'](_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')](),'ListId')[_0x6da6('0x6f')](_0x5f10fd[_0x6da6('0x42')]['id']['toString'](),_0x6da6('0x58'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x51'))['field']('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))[_0x6da6('0x79')]('cm_contacts')[_0x6da6('0x39')](_0x6da6('0x73'))[_0x6da6('0x39')](_0x6da6('0x74'),_0x265a50[_0x6da6('0x75')]['toString']())[_0x6da6('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x6da6('0x71')]();}_0x2af6d9=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x7f'))[_0x6da6('0x6a')](['cmHopperId',_0x6da6('0x6c'),_0x6da6('0x6b'),_0x6da6('0x80'),_0x6da6('0x51'),_0x6da6('0x52')],squel[_0x6da6('0x6e')]()['field'](_0x6da6('0x81'),'id')['field'](_0x6da6('0x70'),'scheduledAt')['field'](_0x6da6('0x82'),'phone')[_0x6da6('0x6f')](_0x6da6('0x83'),_0x6da6('0x80'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x51'))['field']('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))[_0x6da6('0x79')](_0x6da6('0x84'),'ci')[_0x6da6('0x85')](_0x6da6('0x69'),'h',_0x6da6('0x86'))['where']('h.ListId\x20=\x20?',_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')]())['where'](_0x6da6('0x87'),_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')]())['where'](_0x6da6('0x88'),_0x657eea))[_0x6da6('0x71')]();_0x15710e[_0x6da6('0x89')](db[_0x6da6('0x8a')][_0x6da6('0x30')](_0x49b13d));_0x18e81c['push'](db[_0x6da6('0x8a')]['query'](_0x2af6d9));}return BPromise[_0x6da6('0x8b')](_0x15710e);}})['then'](function(){return BPromise[_0x6da6('0x8b')](_0x18e81c);})[_0x6da6('0x20')](function(){return _0x40ba25;})['then'](respondWithResult(_0x2c7e8e,null))[_0x6da6('0x41')](handleError(_0x2c7e8e,null));};exports[_0x6da6('0x8c')]=function(_0xfa1e50,_0x36835e,_0x41c904){return db[_0x6da6('0x2b')][_0x6da6('0x45')]({'where':{'id':_0xfa1e50[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x36835e,null))[_0x6da6('0x20')](function(_0x104f4f){if(_0x104f4f){return _0x104f4f[_0x6da6('0x8c')](_0xfa1e50['query'][_0x6da6('0x64')]);}})[_0x6da6('0x20')](function(_0x1fcf7c){if(_0x1fcf7c){return db['CmHopper'][_0x6da6('0x23')]({'where':{'ListId':_0xfa1e50['query'][_0x6da6('0x64')],'CampaignId':_0xfa1e50[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](function(){return _0x1fcf7c;});}})['then'](respondWithStatusCode(_0x36835e,null))[_0x6da6('0x41')](handleError(_0x36835e,null));};exports[_0x6da6('0x8d')]=function(_0x2495bc,_0x184e1d,_0x5ec7d4){var _0x33eb6e={};var _0x47a9a5={};var _0x105c80;var _0x355141;return db[_0x6da6('0x2b')]['findOne']({'where':{'id':_0x2495bc['params']['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x184e1d,null))[_0x6da6('0x20')](function(_0xb8d491){if(_0xb8d491){_0x105c80=_0xb8d491;_0x47a9a5[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5f')][_0x6da6('0x2c')]);_0x47a9a5[_0x6da6('0x30')]=_['keys'](_0x2495bc['query']);_0x47a9a5[_0x6da6('0x32')]=_['intersection'](_0x47a9a5[_0x6da6('0x33')],_0x47a9a5[_0x6da6('0x30')]);_0x33eb6e[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x47a9a5[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x2495bc[_0x6da6('0x30')][_0x6da6('0x43')]));_0x33eb6e['attributes']=_0x33eb6e[_0x6da6('0x34')][_0x6da6('0x44')]?_0x33eb6e[_0x6da6('0x34')]:_0x47a9a5[_0x6da6('0x33')];_0x33eb6e[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x2495bc[_0x6da6('0x30')]['sort']);_0x33eb6e[_0x6da6('0x39')]=qs['filters'](_[_0x6da6('0x57')](_0x2495bc['query'],_0x47a9a5['filters']));if(_0x2495bc[_0x6da6('0x30')][_0x6da6('0x3b')]){_0x33eb6e[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x33eb6e[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x33eb6e[_0x6da6('0x34')],function(_0x57ae45){var _0x118826={};_0x118826[_0x57ae45]={'$like':'%'+_0x2495bc[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x118826;})});}_0x33eb6e=_[_0x6da6('0x3a')]({},_0x33eb6e,_0x2495bc[_0x6da6('0x3c')]);return _0x105c80[_0x6da6('0x8d')](_0x33eb6e);}})[_0x6da6('0x20')](function(_0x4f91cd){if(_0x4f91cd){_0x355141=_0x4f91cd[_0x6da6('0x44')];if(!_0x2495bc[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x33eb6e[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x2495bc['query'][_0x6da6('0x18')]);_0x33eb6e[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x2495bc['query'][_0x6da6('0x1b')]);}return _0x105c80[_0x6da6('0x8d')](_0x33eb6e);}})[_0x6da6('0x20')](function(_0x52d5db){if(_0x52d5db){return _0x52d5db?{'count':_0x355141,'rows':_0x52d5db}:null;}})[_0x6da6('0x20')](respondWithResult(_0x184e1d,null))[_0x6da6('0x41')](handleError(_0x184e1d,null));};exports[_0x6da6('0x8e')]=function(_0x1af412,_0x48e581,_0x56e2b8){var _0x21e4f7,_0x24052e;var _0x20ee4d=[];var _0x5af63b=moment()[_0x6da6('0x62')](_0x6da6('0x63'));return db[_0x6da6('0x2b')][_0x6da6('0x45')]({'where':{'id':_0x1af412['params']['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x48e581,null))['then'](function(_0xf18937){if(_0xf18937){_0x24052e=_0xf18937;return _0xf18937['addBlackLists'](_0x1af412[_0x6da6('0x47')]['ids'],_[_0x6da6('0x50')](_0x1af412[_0x6da6('0x47')],[_0x6da6('0x64'),'id'])||{});}return null;})[_0x6da6('0x8f')](function(_0x3f7e65){var _0x52ec7e;var _0x462f7b;_0x21e4f7=_0x3f7e65||[];var _0xe76ff9=[];if(_0x3f7e65){for(var _0x142e7e=0x0;_0x142e7e<_0x3f7e65[_0x6da6('0x44')];_0x142e7e+=0x1){var _0x5f544d=_0x3f7e65[_0x142e7e][_0x6da6('0x21')]({'plain':!![]});_0x52ec7e=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x90'))[_0x6da6('0x6a')]([_0x6da6('0x6b'),_0x6da6('0x6d'),'ListId','CampaignId',_0x6da6('0x51'),_0x6da6('0x52')],squel[_0x6da6('0x6e')]()['field'](_0x6da6('0x6b'),_0x6da6('0x6b'))[_0x6da6('0x6f')]('id',_0x6da6('0x6d'))['field'](_0x5f544d['CmListId'][_0x6da6('0x71')](),'ListId')[_0x6da6('0x6f')](_0x1af412[_0x6da6('0x42')]['id'][_0x6da6('0x71')](),_0x6da6('0x58'))[_0x6da6('0x6f')](_0x6da6('0x70'),'createdAt')[_0x6da6('0x6f')](_0x6da6('0x70'),_0x6da6('0x52'))[_0x6da6('0x79')]('cm_contacts')[_0x6da6('0x39')](_0x6da6('0x73'))[_0x6da6('0x39')](_0x6da6('0x74'),_0x5f544d['CmListId']['toString']())['where'](_0x6da6('0x76')))[_0x6da6('0x71')]();_0xe76ff9[_0x6da6('0x89')](db[_0x6da6('0x8a')][_0x6da6('0x30')](_0x52ec7e));}return BPromise[_0x6da6('0x8b')](_0xe76ff9);}})['then'](function(){return _0x21e4f7;})[_0x6da6('0x20')](respondWithResult(_0x48e581,null))['catch'](handleError(_0x48e581,null));};exports[_0x6da6('0x91')]=function(_0x369109,_0x1b7113,_0x39d7df){return db[_0x6da6('0x2b')][_0x6da6('0x45')]({'where':{'id':_0x369109[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x1b7113,null))['then'](function(_0x478689){if(_0x478689){return _0x478689['removeBlackLists'](_0x369109[_0x6da6('0x30')]['ids']);}})['then'](function(_0x4203f5){if(_0x4203f5){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x369109[_0x6da6('0x30')]['ids'],'CampaignId':_0x369109[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](function(){return _0x4203f5;});}})['then'](respondWithStatusCode(_0x1b7113,null))[_0x6da6('0x41')](handleError(_0x1b7113,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 044f8b9..f5ec12e 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4d8b94,_0x2621c8){var _0x32696f=function(_0xb8ef6a){while(--_0xb8ef6a){_0x4d8b94['push'](_0x4d8b94['shift']());}};_0x32696f(++_0x2621c8);}(_0x7a54,0x106));var _0x47a5=function(_0x48c472,_0xfdc372){_0x48c472=_0x48c472-0x0;var _0x78f305=_0x7a54[_0x48c472];return _0x78f305;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x34827d,_0x216e99){var _0x7a060a=function(_0x5b466a){while(--_0x5b466a){_0x34827d['push'](_0x34827d['shift']());}};_0x7a060a(++_0x216e99);}(_0x7a54,0x106));var _0x47a5=function(_0x21a2b7,_0x1242c4){_0x21a2b7=_0x21a2b7-0x0;var _0x135bc4=_0x7a54[_0x21a2b7];return _0x135bc4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 4b21cec..ee7a6ac 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x238f=['client','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xf3c504,_0x4d5a57){var _0x30c191=function(_0x1fbac1){while(--_0x1fbac1){_0xf3c504['push'](_0xf3c504['shift']());}};_0x30c191(++_0x4d5a57);}(_0x238f,0xa5));var _0xf238=function(_0x159529,_0x49c810){_0x159529=_0x159529-0x0;var _0xa948b3=_0x238f[_0x159529];return _0xa948b3;};'use strict';var _=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var moment=require(_0xf238('0x2'));var BPromise=require('bluebird');var rs=require(_0xf238('0x3'));var fs=require('fs');var Redis=require(_0xf238('0x4'));var db=require(_0xf238('0x5'))['db'];var utils=require(_0xf238('0x6'));var logger=require(_0xf238('0x7'))(_0xf238('0x8'));var config=require('../../config/environment');var jayson=require(_0xf238('0x9'));var client=jayson[_0xf238('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549a61,_0x355a13,_0x5432d0){return new BPromise(function(_0x430297,_0x2d59db){return client[_0xf238('0xb')](_0x549a61,_0x5432d0)[_0xf238('0xc')](function(_0x5a88c2){logger[_0xf238('0xd')]('Campaign,\x20%s,\x20%s',_0x355a13,_0xf238('0xe'));logger[_0xf238('0xf')](_0xf238('0x10'),_0x355a13,_0xf238('0xe'),JSON[_0xf238('0x11')](_0x5a88c2));if(_0x5a88c2[_0xf238('0x12')]){if(_0x5a88c2[_0xf238('0x12')][_0xf238('0x13')]===0x1f4){logger['error'](_0xf238('0x14'),_0x355a13,_0x5a88c2[_0xf238('0x12')][_0xf238('0x15')]);return _0x2d59db(_0x5a88c2['error'][_0xf238('0x15')]);}logger[_0xf238('0x12')](_0xf238('0x14'),_0x355a13,_0x5a88c2[_0xf238('0x12')][_0xf238('0x15')]);return _0x430297(_0x5a88c2['error'][_0xf238('0x15')]);}else{logger['info'](_0xf238('0x14'),_0x355a13,_0xf238('0xe'));_0x430297(_0x5a88c2[_0xf238('0x16')][_0xf238('0x15')]);}})[_0xf238('0x17')](function(_0xdcf24e){logger[_0xf238('0x12')]('Campaign,\x20%s,\x20%s',_0x355a13,_0xdcf24e);_0x2d59db(_0xdcf24e);});});}exports[_0xf238('0x18')]=function(_0x34053b){var _0x42f740=this;return new Promise(function(_0x11ad75,_0x4d913a){return db[_0xf238('0x19')][_0xf238('0x1a')]({'raw':_0x34053b[_0xf238('0x1b')]?_0x34053b[_0xf238('0x1b')][_0xf238('0x1c')]===undefined?!![]:![]:!![],'where':_0x34053b[_0xf238('0x1b')]?_0x34053b[_0xf238('0x1b')][_0xf238('0x1d')]||null:null,'attributes':_0x34053b[_0xf238('0x1b')]?_0x34053b[_0xf238('0x1b')][_0xf238('0x1e')]||null:null,'limit':_0x34053b[_0xf238('0x1b')]?_0x34053b[_0xf238('0x1b')][_0xf238('0x1f')]||null:null,'include':_0x34053b[_0xf238('0x1b')]?_0x34053b[_0xf238('0x1b')][_0xf238('0x20')]?_[_0xf238('0x21')](_0x34053b[_0xf238('0x1b')][_0xf238('0x20')],function(_0xbb1c0c){return{'model':db[_0xbb1c0c[_0xf238('0x22')]],'as':_0xbb1c0c['as'],'attributes':_0xbb1c0c[_0xf238('0x1e')],'include':_0xbb1c0c[_0xf238('0x20')]?_[_0xf238('0x21')](_0xbb1c0c[_0xf238('0x20')],function(_0x235ce9){return{'model':db[_0x235ce9[_0xf238('0x22')]],'as':_0x235ce9['as'],'attributes':_0x235ce9['attributes'],'include':_0x235ce9[_0xf238('0x20')]?_[_0xf238('0x21')](_0x235ce9[_0xf238('0x20')],function(_0x5c6952){return{'model':db[_0x5c6952[_0xf238('0x22')]],'as':_0x5c6952['as'],'attributes':_0x5c6952[_0xf238('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf238('0xc')](function(_0x3491c0){logger[_0xf238('0xd')](_0xf238('0x18'),_0x34053b);logger[_0xf238('0xf')](_0xf238('0x18'),_0x34053b,JSON[_0xf238('0x11')](_0x3491c0));_0x11ad75(_0x3491c0);})[_0xf238('0x17')](function(_0x3738a9){logger['error']('GetCampaign',_0x3738a9['message'],_0x34053b);_0x4d913a(_0x42f740[_0xf238('0x12')](0x1f4,_0x3738a9[_0xf238('0x15')]));});});};
\ No newline at end of file
+var _0x885e=['limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0x885e,0xe4));var _0xe885=function(_0x4f0526,_0x9d60d0){_0x4f0526=_0x4f0526-0x0;var _0xe9031b=_0x885e[_0x4f0526];return _0xe9031b;};'use strict';var _=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var moment=require('moment');var BPromise=require(_0xe885('0x2'));var rs=require(_0xe885('0x3'));var fs=require('fs');var Redis=require(_0xe885('0x4'));var db=require(_0xe885('0x5'))['db'];var utils=require(_0xe885('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe885('0x7'));var jayson=require(_0xe885('0x8'));var client=jayson[_0xe885('0x9')][_0xe885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d2b2,_0x37778a,_0x597bdc){return new BPromise(function(_0x2e8fe0,_0x3c5cc7){return client[_0xe885('0xb')](_0x55d2b2,_0x597bdc)[_0xe885('0xc')](function(_0x231f2f){logger[_0xe885('0xd')]('Campaign,\x20%s,\x20%s',_0x37778a,_0xe885('0xe'));logger[_0xe885('0xf')](_0xe885('0x10'),_0x37778a,_0xe885('0xe'),JSON[_0xe885('0x11')](_0x231f2f));if(_0x231f2f[_0xe885('0x12')]){if(_0x231f2f[_0xe885('0x12')]['code']===0x1f4){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);return _0x3c5cc7(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}logger[_0xe885('0x12')]('Campaign,\x20%s,\x20%s',_0x37778a,_0x231f2f['error']['message']);return _0x2e8fe0(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}else{logger[_0xe885('0xd')](_0xe885('0x13'),_0x37778a,'request\x20sent');_0x2e8fe0(_0x231f2f['result'][_0xe885('0x14')]);}})['catch'](function(_0x36b9e7){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x36b9e7);_0x3c5cc7(_0x36b9e7);});});}exports[_0xe885('0x15')]=function(_0x25a002){var _0x365eab=this;return new Promise(function(_0x4f5045,_0x39f07c){return db[_0xe885('0x16')][_0xe885('0x17')]({'raw':_0x25a002[_0xe885('0x18')]?_0x25a002[_0xe885('0x18')][_0xe885('0x19')]===undefined?!![]:![]:!![],'where':_0x25a002[_0xe885('0x18')]?_0x25a002['options'][_0xe885('0x1a')]||null:null,'attributes':_0x25a002[_0xe885('0x18')]?_0x25a002[_0xe885('0x18')][_0xe885('0x1b')]||null:null,'limit':_0x25a002[_0xe885('0x18')]?_0x25a002[_0xe885('0x18')][_0xe885('0x1c')]||null:null,'include':_0x25a002[_0xe885('0x18')]?_0x25a002[_0xe885('0x18')][_0xe885('0x1d')]?_[_0xe885('0x1e')](_0x25a002[_0xe885('0x18')]['include'],function(_0x5b7f07){return{'model':db[_0x5b7f07[_0xe885('0x1f')]],'as':_0x5b7f07['as'],'attributes':_0x5b7f07[_0xe885('0x1b')],'include':_0x5b7f07[_0xe885('0x1d')]?_[_0xe885('0x1e')](_0x5b7f07[_0xe885('0x1d')],function(_0x50dd42){return{'model':db[_0x50dd42[_0xe885('0x1f')]],'as':_0x50dd42['as'],'attributes':_0x50dd42[_0xe885('0x1b')],'include':_0x50dd42[_0xe885('0x1d')]?_['map'](_0x50dd42['include'],function(_0x2ba36e){return{'model':db[_0x2ba36e[_0xe885('0x1f')]],'as':_0x2ba36e['as'],'attributes':_0x2ba36e[_0xe885('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe885('0xc')](function(_0x34b23c){logger['info']('GetCampaign',_0x25a002);logger[_0xe885('0xf')](_0xe885('0x15'),_0x25a002,JSON[_0xe885('0x11')](_0x34b23c));_0x4f5045(_0x34b23c);})['catch'](function(_0x370a10){logger[_0xe885('0x12')](_0xe885('0x15'),_0x370a10[_0xe885('0x14')],_0x25a002);_0x39f07c(_0x365eab[_0xe885('0x12')](0x1f4,_0x370a10[_0xe885('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b7f2d49..5460078 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x209f=['removeBlackLists','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','/:id/lists','removeLists'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x209f,0x199));var _0xf209=function(_0x28ac84,_0x2a75fa){_0x28ac84=_0x28ac84-0x0;var _0x10c42a=_0x209f[_0x28ac84];return _0x10c42a;};'use strict';var multer=require(_0xf209('0x0'));var util=require('util');var path=require(_0xf209('0x1'));var timeout=require(_0xf209('0x2'));var express=require('express');var router=express[_0xf209('0x3')]();var fs_extra=require(_0xf209('0x4'));var auth=require(_0xf209('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf209('0x6'));var controller=require(_0xf209('0x7'));router[_0xf209('0x8')]('/',auth[_0xf209('0x9')](),controller[_0xf209('0xa')]);router['get'](_0xf209('0xb'),auth[_0xf209('0x9')](),controller[_0xf209('0xc')]);router[_0xf209('0x8')](_0xf209('0xd'),auth[_0xf209('0x9')](),controller['getHoppers']);router[_0xf209('0x8')](_0xf209('0xe'),auth[_0xf209('0x9')](),controller[_0xf209('0xf')]);router['get'](_0xf209('0x10'),auth[_0xf209('0x9')](),controller[_0xf209('0x11')]);router[_0xf209('0x8')](_0xf209('0x12'),auth[_0xf209('0x9')](),controller[_0xf209('0x13')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xf209('0x14')]);router[_0xf209('0x8')](_0xf209('0x15'),auth['isAuthenticated'](),controller[_0xf209('0x16')]);router[_0xf209('0x17')]('/',auth[_0xf209('0x9')](),controller['create']);router['post'](_0xf209('0x18'),auth['isAuthenticated'](),controller[_0xf209('0x19')]);router[_0xf209('0x17')]('/:id/lists',auth['isAuthenticated'](),controller[_0xf209('0x1a')]);router[_0xf209('0x17')](_0xf209('0x15'),auth[_0xf209('0x9')](),controller[_0xf209('0x1b')]);router[_0xf209('0x1c')](_0xf209('0xb'),auth[_0xf209('0x9')](),controller['update']);router[_0xf209('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xf209('0x1e')]);router[_0xf209('0x1d')](_0xf209('0x1f'),auth['isAuthenticated'](),controller[_0xf209('0x20')]);router[_0xf209('0x1d')](_0xf209('0x15'),auth[_0xf209('0x9')](),controller[_0xf209('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0xbe45=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','delete','removeBlackLists','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe45,0xf0));var _0x5be4=function(_0x1af52c,_0x11d083){_0x1af52c=_0x1af52c-0x0;var _0x130621=_0xbe45[_0x1af52c];return _0x130621;};'use strict';var multer=require(_0x5be4('0x0'));var util=require(_0x5be4('0x1'));var path=require('path');var timeout=require(_0x5be4('0x2'));var express=require(_0x5be4('0x3'));var router=express[_0x5be4('0x4')]();var fs_extra=require(_0x5be4('0x5'));var auth=require(_0x5be4('0x6'));var interaction=require(_0x5be4('0x7'));var config=require('../../config/environment');var controller=require(_0x5be4('0x8'));router[_0x5be4('0x9')]('/',auth[_0x5be4('0xa')](),controller[_0x5be4('0xb')]);router[_0x5be4('0x9')](_0x5be4('0xc'),auth[_0x5be4('0xa')](),controller[_0x5be4('0xd')]);router[_0x5be4('0x9')](_0x5be4('0xe'),auth[_0x5be4('0xa')](),controller[_0x5be4('0xf')]);router[_0x5be4('0x9')]('/:id/hopper_histories',auth[_0x5be4('0xa')](),controller['getHopperHistories']);router['get'](_0x5be4('0x10'),auth['isAuthenticated'](),controller[_0x5be4('0x11')]);router[_0x5be4('0x9')]('/:id/hopper_black',auth[_0x5be4('0xa')](),controller[_0x5be4('0x12')]);router[_0x5be4('0x9')]('/:id/lists',auth[_0x5be4('0xa')](),controller['getLists']);router[_0x5be4('0x9')](_0x5be4('0x13'),auth[_0x5be4('0xa')](),controller[_0x5be4('0x14')]);router[_0x5be4('0x15')]('/',auth[_0x5be4('0xa')](),controller[_0x5be4('0x16')]);router['post'](_0x5be4('0x17'),auth[_0x5be4('0xa')](),controller[_0x5be4('0x18')]);router[_0x5be4('0x15')](_0x5be4('0x19'),auth[_0x5be4('0xa')](),controller[_0x5be4('0x1a')]);router[_0x5be4('0x15')]('/:id/blacklists',auth[_0x5be4('0xa')](),controller['addBlackLists']);router['put'](_0x5be4('0xc'),auth[_0x5be4('0xa')](),controller['update']);router[_0x5be4('0x1b')](_0x5be4('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x5be4('0x1b')](_0x5be4('0x19'),auth['isAuthenticated'](),controller['removeLists']);router[_0x5be4('0x1b')](_0x5be4('0x13'),auth[_0x5be4('0xa')](),controller[_0x5be4('0x1c')]);module[_0x5be4('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index d2ea088..099f0be 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x23a7=['exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x4206cc,_0x4c353d){var _0x2e6f04=function(_0x867289){while(--_0x867289){_0x4206cc['push'](_0x4206cc['shift']());}};_0x2e6f04(++_0x4c353d);}(_0x23a7,0xae));var _0x723a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x23a7[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x723a('0x0')]={'key':{'type':Sequelize[_0x723a('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x723a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x723a('0x1')]},'name':{'type':Sequelize[_0x723a('0x3')],'get':function(){return this[_0x723a('0x4')](_0x723a('0x5'));}}};
\ No newline at end of file
+var _0x2dce=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x41cc3f,_0x2678a2){var _0x47ff58=function(_0x190d53){while(--_0x190d53){_0x41cc3f['push'](_0x41cc3f['shift']());}};_0x47ff58(++_0x2678a2);}(_0x2dce,0x68));var _0xe2dc=function(_0x14308b,_0x20093d){_0x14308b=_0x14308b-0x0;var _0x2f54bb=_0x2dce[_0x14308b];return _0x2f54bb;};'use strict';var Sequelize=require('sequelize');module[_0xe2dc('0x0')]={'key':{'type':Sequelize[_0xe2dc('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xe2dc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe2dc('0x1')]},'name':{'type':Sequelize[_0xe2dc('0x3')],'get':function(){return this[_0xe2dc('0x4')](_0xe2dc('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index eea4ee6..c861aa8 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6e3=['crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','get','CannedAnswers','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','CannedAnswer','includeAll','findAll','rows','catch','show','include','options','update','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x3c0117,_0x2cfa34){var _0x266665=function(_0x3a2aa5){while(--_0x3a2aa5){_0x3c0117['push'](_0x3c0117['shift']());}};_0x266665(++_0x2cfa34);}(_0xa6e3,0x15c));var _0x3a6e=function(_0x5e75ef,_0x4ce765){_0x5e75ef=_0x5e75ef-0x0;var _0x3c28b2=_0xa6e3[_0x5e75ef];return _0x3c28b2;};'use strict';var emlformat=require(_0x3a6e('0x0'));var rimraf=require(_0x3a6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a6e('0x2'));var rp=require('request-promise');var moment=require(_0x3a6e('0x3'));var BPromise=require(_0x3a6e('0x4'));var Mustache=require(_0x3a6e('0x5'));var util=require('util');var path=require(_0x3a6e('0x6'));var sox=require(_0x3a6e('0x7'));var csv=require(_0x3a6e('0x8'));var ejs=require(_0x3a6e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a6e('0xa'));var squel=require(_0x3a6e('0xb'));var crypto=require(_0x3a6e('0xc'));var jsforce=require(_0x3a6e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a6e('0x8'));var querystring=require('querystring');var Papa=require(_0x3a6e('0xe'));var Redis=require(_0x3a6e('0xf'));var authService=require(_0x3a6e('0x10'));var qs=require(_0x3a6e('0x11'));var as=require(_0x3a6e('0x12'));var hardwareService=require(_0x3a6e('0x13'));var logger=require(_0x3a6e('0x14'))(_0x3a6e('0x15'));var utils=require(_0x3a6e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3a6e('0x17'));var db=require(_0x3a6e('0x18'))['db'];function respondWithStatusCode(_0x53b074,_0xd7879b){_0xd7879b=_0xd7879b||0xcc;return function(_0x4e6b45){if(_0x4e6b45){return _0x53b074[_0x3a6e('0x19')](_0xd7879b);}return _0x53b074[_0x3a6e('0x1a')](_0xd7879b)[_0x3a6e('0x1b')]();};}function respondWithResult(_0x2a1410,_0x4338a4){_0x4338a4=_0x4338a4||0xc8;return function(_0x4b7ea3){if(_0x4b7ea3){return _0x2a1410[_0x3a6e('0x1a')](_0x4338a4)[_0x3a6e('0x1c')](_0x4b7ea3);}};}function respondWithFilteredResult(_0x489820,_0x3b4cee){return function(_0x58b8f0){if(_0x58b8f0){var _0x4e4bac=typeof _0x3b4cee[_0x3a6e('0x1d')]===_0x3a6e('0x1e')&&typeof _0x3b4cee[_0x3a6e('0x1f')]===_0x3a6e('0x1e');var _0x3faa4d=_0x58b8f0[_0x3a6e('0x20')];var _0x459f4e=_0x4e4bac?0x0:_0x3b4cee[_0x3a6e('0x1d')];var _0x24c2d4=_0x4e4bac?_0x58b8f0['count']:_0x3b4cee[_0x3a6e('0x1d')]+_0x3b4cee['limit'];var _0x5671a6;if(_0x24c2d4>=_0x3faa4d){_0x24c2d4=_0x3faa4d;_0x5671a6=0xc8;}else{_0x5671a6=0xce;}_0x489820['status'](_0x5671a6);return _0x489820['set']('Content-Range',_0x459f4e+'-'+_0x24c2d4+'/'+_0x3faa4d)[_0x3a6e('0x1c')](_0x58b8f0);}return null;};}function patchUpdates(_0x2adfd2){return function(_0x13c52d){try{jsonpatch[_0x3a6e('0x21')](_0x13c52d,_0x2adfd2,!![]);}catch(_0x35f331){return BPromise[_0x3a6e('0x22')](_0x35f331);}return _0x13c52d[_0x3a6e('0x23')]();};}function saveUpdates(_0x31bc38,_0x15a890){return function(_0xcfd600){if(_0xcfd600){return _0xcfd600['update'](_0x31bc38)[_0x3a6e('0x24')](function(_0x1c1837){return _0x1c1837;});}return null;};}function removeEntity(_0x1fce44,_0x161dec){return function(_0x6dcaa5){if(_0x6dcaa5){return _0x6dcaa5['destroy']()[_0x3a6e('0x24')](function(){var _0x8036da=_0x6dcaa5[_0x3a6e('0x25')]({'plain':!![]});var _0x55de75=_0x3a6e('0x26');return db['UserProfileResource'][_0x3a6e('0x27')]({'where':{'type':_0x55de75,'resourceId':_0x8036da['id']}})['then'](function(){return _0x6dcaa5;});})['then'](function(){_0x1fce44[_0x3a6e('0x1a')](0xcc)[_0x3a6e('0x1b')]();});}};}function handleEntityNotFound(_0x288940,_0x1bf097){return function(_0x878c3e){if(!_0x878c3e){_0x288940[_0x3a6e('0x19')](0x194);}return _0x878c3e;};}function handleError(_0x2d412c,_0x4083fc){_0x4083fc=_0x4083fc||0x1f4;return function(_0x187d02){logger[_0x3a6e('0x28')](_0x187d02[_0x3a6e('0x29')]);if(_0x187d02[_0x3a6e('0x2a')]){delete _0x187d02['name'];}_0x2d412c[_0x3a6e('0x1a')](_0x4083fc)[_0x3a6e('0x2b')](_0x187d02);};}exports[_0x3a6e('0x2c')]=function(_0x358ae2,_0x4255b0){var _0x39c41b={},_0x52c291={},_0x12799f={'count':0x0,'rows':[]};var _0x1463cc=_[_0x3a6e('0x2d')](db['CannedAnswer'][_0x3a6e('0x2e')],function(_0xd1ac27){return{'name':_0xd1ac27[_0x3a6e('0x2f')],'type':_0xd1ac27[_0x3a6e('0x30')][_0x3a6e('0x31')]};});_0x52c291[_0x3a6e('0x32')]=_[_0x3a6e('0x2d')](_0x1463cc,'name');_0x52c291[_0x3a6e('0x33')]=_[_0x3a6e('0x34')](_0x358ae2[_0x3a6e('0x33')]);_0x52c291[_0x3a6e('0x35')]=_[_0x3a6e('0x36')](_0x52c291[_0x3a6e('0x32')],_0x52c291[_0x3a6e('0x33')]);_0x39c41b[_0x3a6e('0x37')]=_[_0x3a6e('0x36')](_0x52c291[_0x3a6e('0x32')],qs['fields'](_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x38')]));_0x39c41b[_0x3a6e('0x37')]=_0x39c41b['attributes'][_0x3a6e('0x39')]?_0x39c41b[_0x3a6e('0x37')]:_0x52c291[_0x3a6e('0x32')];if(!_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x3a')](_0x3a6e('0x3b'))){_0x39c41b['limit']=qs['limit'](_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x1f')]);_0x39c41b[_0x3a6e('0x1d')]=qs['offset'](_0x358ae2['query'][_0x3a6e('0x1d')]);}_0x39c41b['order']=qs[_0x3a6e('0x3c')](_0x358ae2['query'][_0x3a6e('0x3c')]);_0x39c41b[_0x3a6e('0x3d')]=qs[_0x3a6e('0x35')](_['pick'](_0x358ae2[_0x3a6e('0x33')],_0x52c291[_0x3a6e('0x35')]),_0x1463cc);if(_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x3e')]){_0x39c41b[_0x3a6e('0x3d')]=_[_0x3a6e('0x3f')](_0x39c41b['where'],{'$or':[{'key':{'$like':'%'+_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x3e')]+'%'}},{'value':{'$like':'%'+_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x3e')]+'%'}}]});}_0x39c41b=_[_0x3a6e('0x3f')]({},_0x39c41b,_0x358ae2['options']);var _0x20dca6={'where':_0x39c41b[_0x3a6e('0x3d')]};return db[_0x3a6e('0x40')][_0x3a6e('0x20')](_0x20dca6)[_0x3a6e('0x24')](function(_0x34bf65){_0x12799f[_0x3a6e('0x20')]=_0x34bf65;if(_0x358ae2[_0x3a6e('0x33')][_0x3a6e('0x41')]){_0x39c41b['include']=[{'all':!![]}];}return db[_0x3a6e('0x40')][_0x3a6e('0x42')](_0x39c41b);})[_0x3a6e('0x24')](function(_0x3f899e){_0x12799f[_0x3a6e('0x43')]=_0x3f899e;return _0x12799f;})[_0x3a6e('0x24')](respondWithFilteredResult(_0x4255b0,_0x39c41b))[_0x3a6e('0x44')](handleError(_0x4255b0,null));};exports[_0x3a6e('0x45')]=function(_0x878568,_0x39572c){var _0x48bb8f={'raw':!![],'where':{'id':_0x878568['params']['id']}},_0x5cf30a={};_0x5cf30a[_0x3a6e('0x32')]=_[_0x3a6e('0x34')](db[_0x3a6e('0x40')]['rawAttributes']);_0x5cf30a[_0x3a6e('0x33')]=_[_0x3a6e('0x34')](_0x878568[_0x3a6e('0x33')]);_0x5cf30a[_0x3a6e('0x35')]=_[_0x3a6e('0x36')](_0x5cf30a[_0x3a6e('0x32')],_0x5cf30a[_0x3a6e('0x33')]);_0x48bb8f[_0x3a6e('0x37')]=_[_0x3a6e('0x36')](_0x5cf30a['model'],qs[_0x3a6e('0x38')](_0x878568[_0x3a6e('0x33')]['fields']));_0x48bb8f[_0x3a6e('0x37')]=_0x48bb8f[_0x3a6e('0x37')][_0x3a6e('0x39')]?_0x48bb8f[_0x3a6e('0x37')]:_0x5cf30a[_0x3a6e('0x32')];if(_0x878568[_0x3a6e('0x33')][_0x3a6e('0x41')]){_0x48bb8f[_0x3a6e('0x46')]=[{'all':!![]}];}_0x48bb8f=_[_0x3a6e('0x3f')]({},_0x48bb8f,_0x878568[_0x3a6e('0x47')]);return db[_0x3a6e('0x40')]['find'](_0x48bb8f)[_0x3a6e('0x24')](handleEntityNotFound(_0x39572c,null))['then'](respondWithResult(_0x39572c,null))[_0x3a6e('0x44')](handleError(_0x39572c,null));};exports[_0x3a6e('0x48')]=function(_0x25bbe1,_0x100fc4){if(_0x25bbe1[_0x3a6e('0x49')]['id']){delete _0x25bbe1['body']['id'];}return db[_0x3a6e('0x40')][_0x3a6e('0x4a')]({'where':{'id':_0x25bbe1[_0x3a6e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x100fc4,null))[_0x3a6e('0x24')](saveUpdates(_0x25bbe1[_0x3a6e('0x49')],null))[_0x3a6e('0x24')](respondWithResult(_0x100fc4,null))['catch'](handleError(_0x100fc4,null));};exports[_0x3a6e('0x27')]=function(_0xe4e069,_0xb8b7c0){return db[_0x3a6e('0x40')]['find']({'where':{'id':_0xe4e069['params']['id']}})[_0x3a6e('0x24')](handleEntityNotFound(_0xb8b7c0,null))[_0x3a6e('0x24')](removeEntity(_0xb8b7c0,null))[_0x3a6e('0x44')](handleError(_0xb8b7c0,null));};exports[_0x3a6e('0x4c')]=function(_0x175c58,_0x4302fd){var _0xea67fe={'key':_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x31')]};if(_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x4d')]){_0xea67fe[_0x3a6e('0x4d')]=_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x4d')];}else if(_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x4e')]){_0xea67fe[_0x3a6e('0x4e')]=_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x4e')];}else if(_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x4f')]){_0xea67fe[_0x3a6e('0x4f')]=_0x175c58['body'][_0x3a6e('0x4f')];}else if(_0x175c58[_0x3a6e('0x49')]['ChatWebsiteId']){_0xea67fe['ChatWebsiteId']=_0x175c58[_0x3a6e('0x49')][_0x3a6e('0x50')];}return db[_0x3a6e('0x40')][_0x3a6e('0x4a')]({'where':_0xea67fe})[_0x3a6e('0x24')](function(_0x30f00b){if(_0x30f00b){throw new db[(_0x3a6e('0x51'))][(_0x3a6e('0x52'))](_0x3a6e('0x53'));}return db[_0x3a6e('0x40')][_0x3a6e('0x4c')](_0x175c58['body']);})[_0x3a6e('0x24')](function(_0x470a57){var _0x260e22=_0x175c58[_0x3a6e('0x54')][_0x3a6e('0x25')]({'plain':!![]});if(!_0x260e22)throw new Error(_0x3a6e('0x55'));if(_0x260e22[_0x3a6e('0x56')]===_0x3a6e('0x54')){var _0x450cff=_0x470a57[_0x3a6e('0x25')]({'plain':!![]});return db[_0x3a6e('0x57')][_0x3a6e('0x4a')]({'where':{'name':'CannedAnswers','userProfileId':_0x260e22['userProfileId']},'raw':!![]})[_0x3a6e('0x24')](function(_0xe9f606){if(_0xe9f606&&_0xe9f606[_0x3a6e('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x450cff['name'],'resourceId':_0x450cff['id'],'type':_0xe9f606[_0x3a6e('0x2a')],'sectionId':_0xe9f606['id']},{})['then'](function(){return _0x470a57;});}else{return _0x470a57;}})['catch'](function(_0x2e19e0){logger[_0x3a6e('0x28')](_0x3a6e('0x59'),_0x2e19e0);throw _0x2e19e0;});}return _0x470a57;})[_0x3a6e('0x24')](respondWithResult(_0x4302fd,0xc9))[_0x3a6e('0x44')](handleError(_0x4302fd,null));};
\ No newline at end of file
+var _0x3882=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','then','name','send','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','merge','where','filter','options','CannedAnswer','include','findAll','rows','catch','show','keys','includeAll','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3882,0x164));var _0x2388=function(_0x26e312,_0x4c0fed){_0x26e312=_0x26e312-0x0;var _0x3d73ce=_0x3882[_0x26e312];return _0x3d73ce;};'use strict';var emlformat=require(_0x2388('0x0'));var rimraf=require(_0x2388('0x1'));var zipdir=require(_0x2388('0x2'));var jsonpatch=require(_0x2388('0x3'));var rp=require('request-promise');var moment=require(_0x2388('0x4'));var BPromise=require(_0x2388('0x5'));var Mustache=require(_0x2388('0x6'));var util=require('util');var path=require(_0x2388('0x7'));var sox=require(_0x2388('0x8'));var csv=require(_0x2388('0x9'));var ejs=require(_0x2388('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2388('0xb'));var crypto=require(_0x2388('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2388('0xd'));var Papa=require('papaparse');var Redis=require(_0x2388('0xe'));var authService=require(_0x2388('0xf'));var qs=require(_0x2388('0x10'));var as=require(_0x2388('0x11'));var hardwareService=require(_0x2388('0x12'));var logger=require('../../config/logger')(_0x2388('0x13'));var utils=require(_0x2388('0x14'));var config=require(_0x2388('0x15'));var licenseUtil=require(_0x2388('0x16'));var db=require(_0x2388('0x17'))['db'];function respondWithStatusCode(_0x3f4735,_0x5686cb){_0x5686cb=_0x5686cb||0xcc;return function(_0x2bb636){if(_0x2bb636){return _0x3f4735[_0x2388('0x18')](_0x5686cb);}return _0x3f4735[_0x2388('0x19')](_0x5686cb)[_0x2388('0x1a')]();};}function respondWithResult(_0xde2cfa,_0x426475){_0x426475=_0x426475||0xc8;return function(_0x214044){if(_0x214044){return _0xde2cfa[_0x2388('0x19')](_0x426475)[_0x2388('0x1b')](_0x214044);}};}function respondWithFilteredResult(_0x4e8076,_0x317134){return function(_0x9f70a6){if(_0x9f70a6){var _0x15040c=typeof _0x317134[_0x2388('0x1c')]==='undefined'&&typeof _0x317134[_0x2388('0x1d')]===_0x2388('0x1e');var _0x23dd84=_0x9f70a6[_0x2388('0x1f')];var _0x452451=_0x15040c?0x0:_0x317134[_0x2388('0x1c')];var _0x508b53=_0x15040c?_0x9f70a6[_0x2388('0x1f')]:_0x317134[_0x2388('0x1c')]+_0x317134[_0x2388('0x1d')];var _0xd402e2;if(_0x508b53>=_0x23dd84){_0x508b53=_0x23dd84;_0xd402e2=0xc8;}else{_0xd402e2=0xce;}_0x4e8076[_0x2388('0x19')](_0xd402e2);return _0x4e8076['set']('Content-Range',_0x452451+'-'+_0x508b53+'/'+_0x23dd84)[_0x2388('0x1b')](_0x9f70a6);}return null;};}function patchUpdates(_0x20bf7c){return function(_0x551140){try{jsonpatch[_0x2388('0x20')](_0x551140,_0x20bf7c,!![]);}catch(_0x2a7d9a){return BPromise[_0x2388('0x21')](_0x2a7d9a);}return _0x551140[_0x2388('0x22')]();};}function saveUpdates(_0x317eb7,_0x5707ed){return function(_0x175681){if(_0x175681){return _0x175681[_0x2388('0x23')](_0x317eb7)['then'](function(_0x3e1467){return _0x3e1467;});}return null;};}function removeEntity(_0x599133,_0xfa3865){return function(_0x179f9c){if(_0x179f9c){return _0x179f9c[_0x2388('0x24')]()['then'](function(){var _0x4cc254=_0x179f9c[_0x2388('0x25')]({'plain':!![]});var _0x2e6722=_0x2388('0x26');return db[_0x2388('0x27')]['destroy']({'where':{'type':_0x2e6722,'resourceId':_0x4cc254['id']}})[_0x2388('0x28')](function(){return _0x179f9c;});})[_0x2388('0x28')](function(){_0x599133[_0x2388('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f690f,_0x26c68c){return function(_0x4bf932){if(!_0x4bf932){_0x9f690f[_0x2388('0x18')](0x194);}return _0x4bf932;};}function handleError(_0x55c640,_0x4f6bd6){_0x4f6bd6=_0x4f6bd6||0x1f4;return function(_0xe17c91){logger['error'](_0xe17c91['stack']);if(_0xe17c91[_0x2388('0x29')]){delete _0xe17c91[_0x2388('0x29')];}_0x55c640[_0x2388('0x19')](_0x4f6bd6)[_0x2388('0x2a')](_0xe17c91);};}exports['index']=function(_0x11c172,_0x3b262a){var _0x3329b3={},_0x3dbe69={},_0x515ac0={'count':0x0,'rows':[]};var _0x4f8883=_[_0x2388('0x2b')](db['CannedAnswer'][_0x2388('0x2c')],function(_0x399ec8){return{'name':_0x399ec8['fieldName'],'type':_0x399ec8[_0x2388('0x2d')]['key']};});_0x3dbe69[_0x2388('0x2e')]=_[_0x2388('0x2b')](_0x4f8883,_0x2388('0x29'));_0x3dbe69[_0x2388('0x2f')]=_['keys'](_0x11c172[_0x2388('0x2f')]);_0x3dbe69[_0x2388('0x30')]=_[_0x2388('0x31')](_0x3dbe69[_0x2388('0x2e')],_0x3dbe69[_0x2388('0x2f')]);_0x3329b3[_0x2388('0x32')]=_['intersection'](_0x3dbe69['model'],qs[_0x2388('0x33')](_0x11c172['query'][_0x2388('0x33')]));_0x3329b3[_0x2388('0x32')]=_0x3329b3[_0x2388('0x32')][_0x2388('0x34')]?_0x3329b3[_0x2388('0x32')]:_0x3dbe69[_0x2388('0x2e')];if(!_0x11c172['query'][_0x2388('0x35')]('nolimit')){_0x3329b3[_0x2388('0x1d')]=qs[_0x2388('0x1d')](_0x11c172['query'][_0x2388('0x1d')]);_0x3329b3[_0x2388('0x1c')]=qs['offset'](_0x11c172[_0x2388('0x2f')][_0x2388('0x1c')]);}_0x3329b3['order']=qs[_0x2388('0x36')](_0x11c172[_0x2388('0x2f')][_0x2388('0x36')]);_0x3329b3['where']=qs[_0x2388('0x30')](_[_0x2388('0x37')](_0x11c172[_0x2388('0x2f')],_0x3dbe69[_0x2388('0x30')]),_0x4f8883);if(_0x11c172[_0x2388('0x2f')]['filter']){_0x3329b3['where']=_[_0x2388('0x38')](_0x3329b3[_0x2388('0x39')],{'$or':[{'key':{'$like':'%'+_0x11c172['query'][_0x2388('0x3a')]+'%'}},{'value':{'$like':'%'+_0x11c172[_0x2388('0x2f')][_0x2388('0x3a')]+'%'}}]});}_0x3329b3=_[_0x2388('0x38')]({},_0x3329b3,_0x11c172[_0x2388('0x3b')]);var _0x20e64a={'where':_0x3329b3[_0x2388('0x39')]};return db[_0x2388('0x3c')][_0x2388('0x1f')](_0x20e64a)['then'](function(_0x1118a9){_0x515ac0[_0x2388('0x1f')]=_0x1118a9;if(_0x11c172[_0x2388('0x2f')]['includeAll']){_0x3329b3[_0x2388('0x3d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2388('0x3e')](_0x3329b3);})['then'](function(_0x14e169){_0x515ac0[_0x2388('0x3f')]=_0x14e169;return _0x515ac0;})[_0x2388('0x28')](respondWithFilteredResult(_0x3b262a,_0x3329b3))[_0x2388('0x40')](handleError(_0x3b262a,null));};exports[_0x2388('0x41')]=function(_0x538d98,_0x28ec17){var _0x3beb38={'raw':!![],'where':{'id':_0x538d98['params']['id']}},_0x4f2f63={};_0x4f2f63[_0x2388('0x2e')]=_['keys'](db['CannedAnswer'][_0x2388('0x2c')]);_0x4f2f63[_0x2388('0x2f')]=_[_0x2388('0x42')](_0x538d98[_0x2388('0x2f')]);_0x4f2f63[_0x2388('0x30')]=_[_0x2388('0x31')](_0x4f2f63[_0x2388('0x2e')],_0x4f2f63[_0x2388('0x2f')]);_0x3beb38[_0x2388('0x32')]=_[_0x2388('0x31')](_0x4f2f63[_0x2388('0x2e')],qs['fields'](_0x538d98[_0x2388('0x2f')][_0x2388('0x33')]));_0x3beb38[_0x2388('0x32')]=_0x3beb38[_0x2388('0x32')][_0x2388('0x34')]?_0x3beb38[_0x2388('0x32')]:_0x4f2f63[_0x2388('0x2e')];if(_0x538d98['query'][_0x2388('0x43')]){_0x3beb38[_0x2388('0x3d')]=[{'all':!![]}];}_0x3beb38=_['merge']({},_0x3beb38,_0x538d98[_0x2388('0x3b')]);return db[_0x2388('0x3c')][_0x2388('0x44')](_0x3beb38)[_0x2388('0x28')](handleEntityNotFound(_0x28ec17,null))[_0x2388('0x28')](respondWithResult(_0x28ec17,null))['catch'](handleError(_0x28ec17,null));};exports[_0x2388('0x23')]=function(_0x5a7d45,_0x1841f8){if(_0x5a7d45['body']['id']){delete _0x5a7d45[_0x2388('0x45')]['id'];}return db['CannedAnswer'][_0x2388('0x44')]({'where':{'id':_0x5a7d45[_0x2388('0x46')]['id']}})[_0x2388('0x28')](handleEntityNotFound(_0x1841f8,null))[_0x2388('0x28')](saveUpdates(_0x5a7d45['body'],null))[_0x2388('0x28')](respondWithResult(_0x1841f8,null))[_0x2388('0x40')](handleError(_0x1841f8,null));};exports[_0x2388('0x24')]=function(_0x362dff,_0xe47e42){return db['CannedAnswer'][_0x2388('0x44')]({'where':{'id':_0x362dff[_0x2388('0x46')]['id']}})[_0x2388('0x28')](handleEntityNotFound(_0xe47e42,null))['then'](removeEntity(_0xe47e42,null))[_0x2388('0x40')](handleError(_0xe47e42,null));};exports[_0x2388('0x47')]=function(_0x279a90,_0x57eead){var _0xf8f59={'key':_0x279a90[_0x2388('0x45')][_0x2388('0x48')]};if(_0x279a90[_0x2388('0x45')]['MailAccountId']){_0xf8f59[_0x2388('0x49')]=_0x279a90[_0x2388('0x45')][_0x2388('0x49')];}else if(_0x279a90['body'][_0x2388('0x4a')]){_0xf8f59['SmsAccountId']=_0x279a90[_0x2388('0x45')][_0x2388('0x4a')];}else if(_0x279a90[_0x2388('0x45')][_0x2388('0x4b')]){_0xf8f59[_0x2388('0x4b')]=_0x279a90[_0x2388('0x45')]['OpenchannelAccountId'];}else if(_0x279a90['body'][_0x2388('0x4c')]){_0xf8f59[_0x2388('0x4c')]=_0x279a90[_0x2388('0x45')][_0x2388('0x4c')];}return db['CannedAnswer'][_0x2388('0x44')]({'where':_0xf8f59})[_0x2388('0x28')](function(_0x4bfda7){if(_0x4bfda7){throw new db[(_0x2388('0x4d'))][(_0x2388('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x2388('0x3c')][_0x2388('0x47')](_0x279a90[_0x2388('0x45')]);})['then'](function(_0x30a28f){var _0x27eeff=_0x279a90[_0x2388('0x4f')][_0x2388('0x25')]({'plain':!![]});if(!_0x27eeff)throw new Error(_0x2388('0x50'));if(_0x27eeff[_0x2388('0x51')]===_0x2388('0x4f')){var _0x4a3166=_0x30a28f[_0x2388('0x25')]({'plain':!![]});return db[_0x2388('0x52')][_0x2388('0x44')]({'where':{'name':_0x2388('0x26'),'userProfileId':_0x27eeff[_0x2388('0x53')]},'raw':!![]})[_0x2388('0x28')](function(_0x1efc14){if(_0x1efc14&&_0x1efc14[_0x2388('0x54')]===0x0){return db[_0x2388('0x27')]['create']({'name':_0x4a3166['name'],'resourceId':_0x4a3166['id'],'type':_0x1efc14[_0x2388('0x29')],'sectionId':_0x1efc14['id']},{})[_0x2388('0x28')](function(){return _0x30a28f;});}else{return _0x30a28f;}})[_0x2388('0x40')](function(_0x1ecd50){logger[_0x2388('0x55')](_0x2388('0x56'),_0x1ecd50);throw _0x1ecd50;});}return _0x30a28f;})[_0x2388('0x28')](respondWithResult(_0x57eead,0xc9))[_0x2388('0x40')](handleError(_0x57eead,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4385ed9..3b81c26 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e01=['exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','rimraf'];(function(_0x5f1805,_0x3b4c95){var _0x12a8b0=function(_0xc56f3f){while(--_0xc56f3f){_0x5f1805['push'](_0x5f1805['shift']());}};_0x12a8b0(++_0x3b4c95);}(_0x0e01,0x87));var _0x10e0=function(_0x96cfa1,_0x566794){_0x96cfa1=_0x96cfa1-0x0;var _0x163e4a=_0x0e01[_0x96cfa1];return _0x163e4a;};'use strict';var _=require(_0x10e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x10e0('0x1'));var moment=require(_0x10e0('0x2'));var BPromise=require(_0x10e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x10e0('0x4'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x10e0('0x5')]=function(_0x4a9f5f,_0x684dac){return _0x4a9f5f[_0x10e0('0x6')]('CannedAnswer',attributes,{'tableName':_0x10e0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10e0('0x8'),'collate':_0x10e0('0x9')});};
\ No newline at end of file
+var _0x62d5=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x62d5,0xbc));var _0x562d=function(_0x4f46e6,_0x1e71d1){_0x4f46e6=_0x4f46e6-0x0;var _0x2f1799=_0x62d5[_0x4f46e6];return _0x2f1799;};'use strict';var _=require(_0x562d('0x0'));var util=require(_0x562d('0x1'));var logger=require(_0x562d('0x2'))(_0x562d('0x3'));var moment=require('moment');var BPromise=require(_0x562d('0x4'));var rp=require(_0x562d('0x5'));var fs=require('fs');var path=require(_0x562d('0x6'));var rimraf=require('rimraf');var config=require(_0x562d('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x562d('0x8')]=function(_0x28d7c6,_0x505f16){return _0x28d7c6[_0x562d('0x9')](_0x562d('0xa'),attributes,{'tableName':_0x562d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x562d('0xc'),'collate':_0x562d('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 0b285e1..9933f6c 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x44d004,_0x3b8eae){var _0x332d58=function(_0x27916a){while(--_0x27916a){_0x44d004['push'](_0x44d004['shift']());}};_0x332d58(++_0x3b8eae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c0d8e,_0x3b795b){var _0x43b982=function(_0x8b3dff){while(--_0x8b3dff){_0x5c0d8e['push'](_0x5c0d8e['shift']());}};_0x43b982(++_0x3b795b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index ef534e3..0298526 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xffed=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','path'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xffed,0x1c1));var _0xdffe=function(_0x4ab012,_0x9e211e){_0x4ab012=_0x4ab012-0x0;var _0x573fa7=_0xffed[_0x4ab012];return _0x573fa7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdffe('0x0'));var timeout=require(_0xdffe('0x1'));var express=require(_0xdffe('0x2'));var router=express[_0xdffe('0x3')]();var fs_extra=require(_0xdffe('0x4'));var auth=require(_0xdffe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdffe('0x6'));var controller=require(_0xdffe('0x7'));router[_0xdffe('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdffe('0x8')](_0xdffe('0x9'),auth[_0xdffe('0xa')](),controller[_0xdffe('0xb')]);router[_0xdffe('0xc')]('/',auth[_0xdffe('0xa')](),controller[_0xdffe('0xd')]);router['put']('/:id',auth[_0xdffe('0xa')](),controller[_0xdffe('0xe')]);router[_0xdffe('0xf')](_0xdffe('0x9'),auth[_0xdffe('0xa')](),controller[_0xdffe('0x10')]);module[_0xdffe('0x11')]=router;
\ No newline at end of file
+var _0x7103=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id'];(function(_0x4eb645,_0x2819b4){var _0x1602c1=function(_0x195426){while(--_0x195426){_0x4eb645['push'](_0x4eb645['shift']());}};_0x1602c1(++_0x2819b4);}(_0x7103,0x126));var _0x3710=function(_0xf210cd,_0x3f4f86){_0xf210cd=_0xf210cd-0x0;var _0x571220=_0x7103[_0xf210cd];return _0x571220;};'use strict';var multer=require(_0x3710('0x0'));var util=require(_0x3710('0x1'));var path=require(_0x3710('0x2'));var timeout=require(_0x3710('0x3'));var express=require(_0x3710('0x4'));var router=express[_0x3710('0x5')]();var fs_extra=require(_0x3710('0x6'));var auth=require(_0x3710('0x7'));var interaction=require(_0x3710('0x8'));var config=require(_0x3710('0x9'));var controller=require(_0x3710('0xa'));router[_0x3710('0xb')]('/',auth[_0x3710('0xc')](),controller['index']);router['get'](_0x3710('0xd'),auth[_0x3710('0xc')](),controller[_0x3710('0xe')]);router[_0x3710('0xf')]('/',auth[_0x3710('0xc')](),controller[_0x3710('0x10')]);router[_0x3710('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3710('0x12')]);router[_0x3710('0x13')]('/:id',auth[_0x3710('0xc')](),controller[_0x3710('0x14')]);module[_0x3710('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 563d8b8..6346dc7 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71c8=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x71c8,0x149));var _0x871c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x71c8[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x871c('0x0'));module[_0x871c('0x1')]={'calldate':{'type':Sequelize[_0x871c('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x871c('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x871c('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x871c('0x3')]},'lastapp':{'type':Sequelize[_0x871c('0x3')]},'lastdata':{'type':Sequelize[_0x871c('0x3')]},'duration':{'type':Sequelize[_0x871c('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x871c('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x871c('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x871c('0x3')]},'uniqueid':{'type':Sequelize[_0x871c('0x3')]},'linkedid':{'type':Sequelize[_0x871c('0x3')]},'sequence':{'type':Sequelize[_0x871c('0x3')]},'peeraccount':{'type':Sequelize[_0x871c('0x3')]},'type':{'type':Sequelize[_0x871c('0x3')]},'tag':{'type':Sequelize[_0x871c('0x3')]}};
\ No newline at end of file
+var _0x04b8=['INTEGER','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x51e6fb,_0x1c0b7e){var _0x4e30a7=function(_0x2446c2){while(--_0x2446c2){_0x51e6fb['push'](_0x51e6fb['shift']());}};_0x4e30a7(++_0x1c0b7e);}(_0x04b8,0x159));var _0x804b=function(_0x585276,_0x553f5a){_0x585276=_0x585276-0x0;var _0x4a7181=_0x04b8[_0x585276];return _0x4a7181;};'use strict';var Sequelize=require('sequelize');module[_0x804b('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x804b('0x1')},'clid':{'type':Sequelize[_0x804b('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x804b('0x2')]},'dcontext':{'type':Sequelize[_0x804b('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x804b('0x2')]},'lastapp':{'type':Sequelize[_0x804b('0x2')]},'lastdata':{'type':Sequelize[_0x804b('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x804b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x804b('0x2')]},'amaflags':{'type':Sequelize[_0x804b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x804b('0x2')]},'uniqueid':{'type':Sequelize[_0x804b('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x804b('0x2')]},'peeraccount':{'type':Sequelize[_0x804b('0x2')]},'type':{'type':Sequelize[_0x804b('0x2')]},'tag':{'type':Sequelize[_0x804b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index eab0398..9176e2b 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb66c=['catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Cdr','include'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0xb66c,0x175));var _0xcb66=function(_0x25a9d8,_0x34ee82){_0x25a9d8=_0x25a9d8-0x0;var _0x245dfe=_0xb66c[_0x25a9d8];return _0x245dfe;};'use strict';var emlformat=require(_0xcb66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb66('0x2'));var moment=require(_0xcb66('0x3'));var BPromise=require(_0xcb66('0x4'));var Mustache=require('mustache');var util=require(_0xcb66('0x5'));var path=require(_0xcb66('0x6'));var sox=require(_0xcb66('0x7'));var csv=require(_0xcb66('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb66('0x9'));var squel=require(_0xcb66('0xa'));var crypto=require(_0xcb66('0xb'));var jsforce=require(_0xcb66('0xc'));var deskjs=require(_0xcb66('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb66('0xe'));var Papa=require(_0xcb66('0xf'));var Redis=require(_0xcb66('0x10'));var authService=require(_0xcb66('0x11'));var qs=require(_0xcb66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb66('0x13'));var logger=require(_0xcb66('0x14'))(_0xcb66('0x15'));var utils=require(_0xcb66('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcb66('0x17'));var db=require(_0xcb66('0x18'))['db'];function respondWithStatusCode(_0x4105d2,_0x2339bb){_0x2339bb=_0x2339bb||0xcc;return function(_0x582523){if(_0x582523){return _0x4105d2[_0xcb66('0x19')](_0x2339bb);}return _0x4105d2[_0xcb66('0x1a')](_0x2339bb)[_0xcb66('0x1b')]();};}function respondWithResult(_0x401bc9,_0x58fb9e){_0x58fb9e=_0x58fb9e||0xc8;return function(_0x19072b){if(_0x19072b){return _0x401bc9['status'](_0x58fb9e)[_0xcb66('0x1c')](_0x19072b);}};}function respondWithFilteredResult(_0x52b058,_0x27442d){return function(_0x573dc7){if(_0x573dc7){var _0x4bef09=typeof _0x27442d[_0xcb66('0x1d')]===_0xcb66('0x1e')&&typeof _0x27442d[_0xcb66('0x1f')]===_0xcb66('0x1e');var _0x4d99c0=_0x573dc7[_0xcb66('0x20')];var _0x42ad03=_0x4bef09?0x0:_0x27442d[_0xcb66('0x1d')];var _0x58bca0=_0x4bef09?_0x573dc7[_0xcb66('0x20')]:_0x27442d['offset']+_0x27442d[_0xcb66('0x1f')];var _0x41edae;if(_0x58bca0>=_0x4d99c0){_0x58bca0=_0x4d99c0;_0x41edae=0xc8;}else{_0x41edae=0xce;}_0x52b058[_0xcb66('0x1a')](_0x41edae);return _0x52b058[_0xcb66('0x21')]('Content-Range',_0x42ad03+'-'+_0x58bca0+'/'+_0x4d99c0)['json'](_0x573dc7);}return null;};}function patchUpdates(_0x4d9690){return function(_0xb39b87){try{jsonpatch['apply'](_0xb39b87,_0x4d9690,!![]);}catch(_0x5e07e8){return BPromise[_0xcb66('0x22')](_0x5e07e8);}return _0xb39b87['save']();};}function saveUpdates(_0x1c1219,_0x12e2bc){return function(_0x602b44){if(_0x602b44){return _0x602b44[_0xcb66('0x23')](_0x1c1219)[_0xcb66('0x24')](function(_0x204f15){return _0x204f15;});}return null;};}function removeEntity(_0x3391a0,_0x5977e1){return function(_0x36faba){if(_0x36faba){return _0x36faba['destroy']()['then'](function(){_0x3391a0[_0xcb66('0x1a')](0xcc)[_0xcb66('0x1b')]();});}};}function handleEntityNotFound(_0x19da3b,_0x5f389f){return function(_0x341554){if(!_0x341554){_0x19da3b[_0xcb66('0x19')](0x194);}return _0x341554;};}function handleError(_0x43cd8f,_0x40e3de){_0x40e3de=_0x40e3de||0x1f4;return function(_0x5affdb){logger[_0xcb66('0x25')](_0x5affdb[_0xcb66('0x26')]);if(_0x5affdb[_0xcb66('0x27')]){delete _0x5affdb[_0xcb66('0x27')];}_0x43cd8f[_0xcb66('0x1a')](_0x40e3de)[_0xcb66('0x28')](_0x5affdb);};}exports[_0xcb66('0x29')]=function(_0x967710,_0x28fc0b){var _0x178a06={},_0x516194={},_0x2152dc={'count':0x0,'rows':[]};var _0x5b7cf2=_['map'](db['Cdr'][_0xcb66('0x2a')],function(_0x4ca8b4){return{'name':_0x4ca8b4[_0xcb66('0x2b')],'type':_0x4ca8b4[_0xcb66('0x2c')][_0xcb66('0x2d')]};});_0x516194['model']=_[_0xcb66('0x2e')](_0x5b7cf2,_0xcb66('0x27'));_0x516194[_0xcb66('0x2f')]=_[_0xcb66('0x30')](_0x967710[_0xcb66('0x2f')]);_0x516194[_0xcb66('0x31')]=_[_0xcb66('0x32')](_0x516194[_0xcb66('0x33')],_0x516194[_0xcb66('0x2f')]);_0x178a06[_0xcb66('0x34')]=_['intersection'](_0x516194[_0xcb66('0x33')],qs[_0xcb66('0x35')](_0x967710[_0xcb66('0x2f')][_0xcb66('0x35')]));_0x178a06[_0xcb66('0x34')]=_0x178a06[_0xcb66('0x34')][_0xcb66('0x36')]?_0x178a06['attributes']:_0x516194[_0xcb66('0x33')];if(!_0x967710[_0xcb66('0x2f')][_0xcb66('0x37')](_0xcb66('0x38'))){_0x178a06['limit']=qs[_0xcb66('0x1f')](_0x967710[_0xcb66('0x2f')][_0xcb66('0x1f')]);_0x178a06[_0xcb66('0x1d')]=qs[_0xcb66('0x1d')](_0x967710[_0xcb66('0x2f')][_0xcb66('0x1d')]);}_0x178a06[_0xcb66('0x39')]=qs[_0xcb66('0x3a')](_0x967710[_0xcb66('0x2f')][_0xcb66('0x3a')]);_0x178a06[_0xcb66('0x3b')]=qs['filters'](_['pick'](_0x967710['query'],_0x516194[_0xcb66('0x31')]),_0x5b7cf2);if(_0x967710[_0xcb66('0x2f')][_0xcb66('0x3c')]){_0x178a06[_0xcb66('0x3b')]=_[_0xcb66('0x3d')](_0x178a06[_0xcb66('0x3b')],{'$or':_['map'](_0x5b7cf2,function(_0x13865f){if(_0x13865f['type']!=='VIRTUAL'){var _0x5af5d4={};_0x5af5d4[_0x13865f[_0xcb66('0x27')]]={'$like':'%'+_0x967710[_0xcb66('0x2f')][_0xcb66('0x3c')]+'%'};return _0x5af5d4;}})});}_0x178a06=_[_0xcb66('0x3d')]({},_0x178a06,_0x967710[_0xcb66('0x3e')]);var _0x3e71a7={'where':_0x178a06[_0xcb66('0x3b')]};return db[_0xcb66('0x3f')][_0xcb66('0x20')](_0x3e71a7)['then'](function(_0xe45331){_0x2152dc[_0xcb66('0x20')]=_0xe45331;if(_0x967710[_0xcb66('0x2f')]['includeAll']){_0x178a06[_0xcb66('0x40')]=[{'all':!![]}];}return db[_0xcb66('0x3f')]['findAll'](_0x178a06);})['then'](function(_0x277838){_0x2152dc['rows']=_0x277838;return _0x2152dc;})['then'](respondWithFilteredResult(_0x28fc0b,_0x178a06))[_0xcb66('0x41')](handleError(_0x28fc0b,null));};exports[_0xcb66('0x42')]=function(_0x3a260b,_0x165bcc){var _0x99229={'raw':!![],'where':{'id':_0x3a260b[_0xcb66('0x43')]['id']}},_0x235862={};_0x235862[_0xcb66('0x33')]=_[_0xcb66('0x30')](db['Cdr']['rawAttributes']);_0x235862['query']=_[_0xcb66('0x30')](_0x3a260b['query']);_0x235862[_0xcb66('0x31')]=_['intersection'](_0x235862[_0xcb66('0x33')],_0x235862[_0xcb66('0x2f')]);_0x99229[_0xcb66('0x34')]=_[_0xcb66('0x32')](_0x235862[_0xcb66('0x33')],qs[_0xcb66('0x35')](_0x3a260b['query']['fields']));_0x99229[_0xcb66('0x34')]=_0x99229[_0xcb66('0x34')][_0xcb66('0x36')]?_0x99229[_0xcb66('0x34')]:_0x235862[_0xcb66('0x33')];if(_0x3a260b[_0xcb66('0x2f')][_0xcb66('0x44')]){_0x99229[_0xcb66('0x40')]=[{'all':!![]}];}_0x99229=_[_0xcb66('0x3d')]({},_0x99229,_0x3a260b['options']);return db[_0xcb66('0x3f')][_0xcb66('0x45')](_0x99229)[_0xcb66('0x24')](handleEntityNotFound(_0x165bcc,null))[_0xcb66('0x24')](respondWithResult(_0x165bcc,null))['catch'](handleError(_0x165bcc,null));};exports[_0xcb66('0x46')]=function(_0x2f9fb5,_0x1aab4e){return db['Cdr'][_0xcb66('0x46')](_0x2f9fb5[_0xcb66('0x47')],{})[_0xcb66('0x24')](respondWithResult(_0x1aab4e,0xc9))[_0xcb66('0x41')](handleError(_0x1aab4e,null));};exports['update']=function(_0x43e0e0,_0xb0854f){if(_0x43e0e0[_0xcb66('0x47')]['id']){delete _0x43e0e0['body']['id'];}return db['Cdr'][_0xcb66('0x45')]({'where':{'id':_0x43e0e0['params']['id']}})[_0xcb66('0x24')](handleEntityNotFound(_0xb0854f,null))['then'](saveUpdates(_0x43e0e0[_0xcb66('0x47')],null))[_0xcb66('0x24')](respondWithResult(_0xb0854f,null))[_0xcb66('0x41')](handleError(_0xb0854f,null));};exports['destroy']=function(_0x2071d5,_0x5f01a2){return db[_0xcb66('0x3f')][_0xcb66('0x45')]({'where':{'id':_0x2071d5[_0xcb66('0x43')]['id']}})[_0xcb66('0x24')](handleEntityNotFound(_0x5f01a2,null))[_0xcb66('0x24')](removeEntity(_0x5f01a2,null))['catch'](handleError(_0x5f01a2,null));};exports[_0xcb66('0x48')]=function(_0x5b04ad,_0xd68e76){return db[_0xcb66('0x3f')][_0xcb66('0x48')]()['then'](respondWithResult(_0xd68e76,null))['catch'](handleError(_0xd68e76,null));};
\ No newline at end of file
+var _0xc3b5=['destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then'];(function(_0x14ad88,_0x12e51d){var _0x1aff58=function(_0x3af632){while(--_0x3af632){_0x14ad88['push'](_0x14ad88['shift']());}};_0x1aff58(++_0x12e51d);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x572729,_0x4ac0a7){_0x572729=_0x572729-0x0;var _0x3340a9=_0xc3b5[_0x572729];return _0x3340a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x0'));var jsonpatch=require(_0x5c3b('0x1'));var rp=require(_0x5c3b('0x2'));var moment=require(_0x5c3b('0x3'));var BPromise=require(_0x5c3b('0x4'));var Mustache=require(_0x5c3b('0x5'));var util=require(_0x5c3b('0x6'));var path=require(_0x5c3b('0x7'));var sox=require('sox');var csv=require(_0x5c3b('0x8'));var ejs=require(_0x5c3b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c3b('0xa'));var squel=require(_0x5c3b('0xb'));var crypto=require(_0x5c3b('0xc'));var jsforce=require(_0x5c3b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c3b('0x8'));var querystring=require(_0x5c3b('0xe'));var Papa=require(_0x5c3b('0xf'));var Redis=require(_0x5c3b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c3b('0x11'));var as=require(_0x5c3b('0x12'));var hardwareService=require(_0x5c3b('0x13'));var logger=require(_0x5c3b('0x14'))(_0x5c3b('0x15'));var utils=require('../../config/utils');var config=require(_0x5c3b('0x16'));var licenseUtil=require(_0x5c3b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b2815,_0x3b953d){_0x3b953d=_0x3b953d||0xcc;return function(_0x507c2e){if(_0x507c2e){return _0x1b2815[_0x5c3b('0x18')](_0x3b953d);}return _0x1b2815[_0x5c3b('0x19')](_0x3b953d)[_0x5c3b('0x1a')]();};}function respondWithResult(_0x2384b9,_0x315e68){_0x315e68=_0x315e68||0xc8;return function(_0x3fef28){if(_0x3fef28){return _0x2384b9[_0x5c3b('0x19')](_0x315e68)['json'](_0x3fef28);}};}function respondWithFilteredResult(_0x2f7ab2,_0x5b55be){return function(_0x4cf80d){if(_0x4cf80d){var _0x195c1e=typeof _0x5b55be[_0x5c3b('0x1b')]===_0x5c3b('0x1c')&&typeof _0x5b55be['limit']===_0x5c3b('0x1c');var _0x229e28=_0x4cf80d[_0x5c3b('0x1d')];var _0x59f71b=_0x195c1e?0x0:_0x5b55be[_0x5c3b('0x1b')];var _0x34144d=_0x195c1e?_0x4cf80d['count']:_0x5b55be[_0x5c3b('0x1b')]+_0x5b55be[_0x5c3b('0x1e')];var _0x2b2307;if(_0x34144d>=_0x229e28){_0x34144d=_0x229e28;_0x2b2307=0xc8;}else{_0x2b2307=0xce;}_0x2f7ab2[_0x5c3b('0x19')](_0x2b2307);return _0x2f7ab2[_0x5c3b('0x1f')](_0x5c3b('0x20'),_0x59f71b+'-'+_0x34144d+'/'+_0x229e28)[_0x5c3b('0x21')](_0x4cf80d);}return null;};}function patchUpdates(_0x1af39c){return function(_0xc63307){try{jsonpatch[_0x5c3b('0x22')](_0xc63307,_0x1af39c,!![]);}catch(_0x4ec8c1){return BPromise['reject'](_0x4ec8c1);}return _0xc63307[_0x5c3b('0x23')]();};}function saveUpdates(_0x143022,_0x5942f1){return function(_0x439d8e){if(_0x439d8e){return _0x439d8e['update'](_0x143022)[_0x5c3b('0x24')](function(_0xb8006){return _0xb8006;});}return null;};}function removeEntity(_0x2bb9dc,_0xe9261d){return function(_0x529c39){if(_0x529c39){return _0x529c39[_0x5c3b('0x25')]()[_0x5c3b('0x24')](function(){_0x2bb9dc['status'](0xcc)[_0x5c3b('0x1a')]();});}};}function handleEntityNotFound(_0x2c8682,_0x3a8141){return function(_0x3c3991){if(!_0x3c3991){_0x2c8682['sendStatus'](0x194);}return _0x3c3991;};}function handleError(_0x15ae38,_0x20469d){_0x20469d=_0x20469d||0x1f4;return function(_0x2099dc){logger[_0x5c3b('0x26')](_0x2099dc[_0x5c3b('0x27')]);if(_0x2099dc[_0x5c3b('0x28')]){delete _0x2099dc['name'];}_0x15ae38['status'](_0x20469d)['send'](_0x2099dc);};}exports[_0x5c3b('0x29')]=function(_0x3e6832,_0x59b640){var _0xd93418={},_0x15044e={},_0x421d96={'count':0x0,'rows':[]};var _0x2a26df=_[_0x5c3b('0x2a')](db[_0x5c3b('0x2b')][_0x5c3b('0x2c')],function(_0x292266){return{'name':_0x292266[_0x5c3b('0x2d')],'type':_0x292266[_0x5c3b('0x2e')][_0x5c3b('0x2f')]};});_0x15044e[_0x5c3b('0x30')]=_['map'](_0x2a26df,_0x5c3b('0x28'));_0x15044e[_0x5c3b('0x31')]=_[_0x5c3b('0x32')](_0x3e6832[_0x5c3b('0x31')]);_0x15044e[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x15044e[_0x5c3b('0x30')],_0x15044e[_0x5c3b('0x31')]);_0xd93418[_0x5c3b('0x35')]=_[_0x5c3b('0x34')](_0x15044e[_0x5c3b('0x30')],qs[_0x5c3b('0x36')](_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x36')]));_0xd93418[_0x5c3b('0x35')]=_0xd93418[_0x5c3b('0x35')][_0x5c3b('0x37')]?_0xd93418['attributes']:_0x15044e[_0x5c3b('0x30')];if(!_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x38')](_0x5c3b('0x39'))){_0xd93418['limit']=qs[_0x5c3b('0x1e')](_0x3e6832[_0x5c3b('0x31')]['limit']);_0xd93418[_0x5c3b('0x1b')]=qs[_0x5c3b('0x1b')](_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x1b')]);}_0xd93418[_0x5c3b('0x3a')]=qs[_0x5c3b('0x3b')](_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x3b')]);_0xd93418[_0x5c3b('0x3c')]=qs['filters'](_[_0x5c3b('0x3d')](_0x3e6832[_0x5c3b('0x31')],_0x15044e['filters']),_0x2a26df);if(_0x3e6832['query'][_0x5c3b('0x3e')]){_0xd93418[_0x5c3b('0x3c')]=_[_0x5c3b('0x3f')](_0xd93418[_0x5c3b('0x3c')],{'$or':_[_0x5c3b('0x2a')](_0x2a26df,function(_0x406bf9){if(_0x406bf9[_0x5c3b('0x2e')]!=='VIRTUAL'){var _0x499335={};_0x499335[_0x406bf9[_0x5c3b('0x28')]]={'$like':'%'+_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x3e')]+'%'};return _0x499335;}})});}_0xd93418=_[_0x5c3b('0x3f')]({},_0xd93418,_0x3e6832['options']);var _0x16400b={'where':_0xd93418['where']};return db[_0x5c3b('0x2b')][_0x5c3b('0x1d')](_0x16400b)[_0x5c3b('0x24')](function(_0xea3ae1){_0x421d96[_0x5c3b('0x1d')]=_0xea3ae1;if(_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x40')]){_0xd93418[_0x5c3b('0x41')]=[{'all':!![]}];}return db[_0x5c3b('0x2b')]['findAll'](_0xd93418);})['then'](function(_0x345149){_0x421d96[_0x5c3b('0x42')]=_0x345149;return _0x421d96;})[_0x5c3b('0x24')](respondWithFilteredResult(_0x59b640,_0xd93418))[_0x5c3b('0x43')](handleError(_0x59b640,null));};exports[_0x5c3b('0x44')]=function(_0x22fd28,_0x2cec5d){var _0x1d9427={'raw':!![],'where':{'id':_0x22fd28['params']['id']}},_0x29ffdc={};_0x29ffdc[_0x5c3b('0x30')]=_[_0x5c3b('0x32')](db[_0x5c3b('0x2b')]['rawAttributes']);_0x29ffdc[_0x5c3b('0x31')]=_[_0x5c3b('0x32')](_0x22fd28[_0x5c3b('0x31')]);_0x29ffdc[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x29ffdc[_0x5c3b('0x30')],_0x29ffdc[_0x5c3b('0x31')]);_0x1d9427[_0x5c3b('0x35')]=_[_0x5c3b('0x34')](_0x29ffdc[_0x5c3b('0x30')],qs[_0x5c3b('0x36')](_0x22fd28['query'][_0x5c3b('0x36')]));_0x1d9427['attributes']=_0x1d9427[_0x5c3b('0x35')][_0x5c3b('0x37')]?_0x1d9427['attributes']:_0x29ffdc[_0x5c3b('0x30')];if(_0x22fd28[_0x5c3b('0x31')][_0x5c3b('0x40')]){_0x1d9427['include']=[{'all':!![]}];}_0x1d9427=_[_0x5c3b('0x3f')]({},_0x1d9427,_0x22fd28['options']);return db[_0x5c3b('0x2b')][_0x5c3b('0x45')](_0x1d9427)[_0x5c3b('0x24')](handleEntityNotFound(_0x2cec5d,null))[_0x5c3b('0x24')](respondWithResult(_0x2cec5d,null))[_0x5c3b('0x43')](handleError(_0x2cec5d,null));};exports[_0x5c3b('0x46')]=function(_0x2dd72c,_0x3d6034){return db[_0x5c3b('0x2b')][_0x5c3b('0x46')](_0x2dd72c[_0x5c3b('0x47')],{})['then'](respondWithResult(_0x3d6034,0xc9))[_0x5c3b('0x43')](handleError(_0x3d6034,null));};exports['update']=function(_0x155b22,_0x11bf0a){if(_0x155b22[_0x5c3b('0x47')]['id']){delete _0x155b22['body']['id'];}return db[_0x5c3b('0x2b')][_0x5c3b('0x45')]({'where':{'id':_0x155b22['params']['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x11bf0a,null))[_0x5c3b('0x24')](saveUpdates(_0x155b22[_0x5c3b('0x47')],null))[_0x5c3b('0x24')](respondWithResult(_0x11bf0a,null))[_0x5c3b('0x43')](handleError(_0x11bf0a,null));};exports[_0x5c3b('0x25')]=function(_0x37870f,_0x21e430){return db[_0x5c3b('0x2b')][_0x5c3b('0x45')]({'where':{'id':_0x37870f[_0x5c3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x21e430,null))['then'](removeEntity(_0x21e430,null))['catch'](handleError(_0x21e430,null));};exports[_0x5c3b('0x49')]=function(_0x203ae2,_0x5f14fa){return db[_0x5c3b('0x2b')][_0x5c3b('0x49')]()[_0x5c3b('0x24')](respondWithResult(_0x5f14fa,null))[_0x5c3b('0x43')](handleError(_0x5f14fa,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 0f6fd99..a0364bd 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x389ba4,_0x4aad50){var _0x565839=function(_0x12f127){while(--_0x12f127){_0x389ba4['push'](_0x389ba4['shift']());}};_0x565839(++_0x4aad50);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1182c4,_0x15749d){var _0x4950e7=function(_0x16521d){while(--_0x16521d){_0x1182c4['push'](_0x1182c4['shift']());}};_0x4950e7(++_0x15749d);}(_0x7a54,0x106));var _0x47a5=function(_0xe51edf,_0x538cb0){_0xe51edf=_0xe51edf-0x0;var _0x5149c7=_0x7a54[_0xe51edf];return _0x5149c7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index cec1b50..ce36f1a 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecb6=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug'];(function(_0xf8886b,_0x504891){var _0x321bd5=function(_0x3c116b){while(--_0x3c116b){_0xf8886b['push'](_0xf8886b['shift']());}};_0x321bd5(++_0x504891);}(_0xecb6,0xcf));var _0x6ecb=function(_0x578ce2,_0x250370){_0x578ce2=_0x578ce2-0x0;var _0x49546f=_0xecb6[_0x578ce2];return _0x49546f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ecb('0x0'));var BPromise=require(_0x6ecb('0x1'));var rs=require(_0x6ecb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ecb('0x3'))['db'];var utils=require(_0x6ecb('0x4'));var logger=require(_0x6ecb('0x5'))(_0x6ecb('0x6'));var config=require(_0x6ecb('0x7'));var jayson=require(_0x6ecb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ccb91,_0x55af16,_0x1a4172){return new BPromise(function(_0x220cf4,_0x2a66a4){return client[_0x6ecb('0x9')](_0x5ccb91,_0x1a4172)['then'](function(_0x419179){logger[_0x6ecb('0xa')]('Cdr,\x20%s,\x20%s',_0x55af16,_0x6ecb('0xb'));logger[_0x6ecb('0xc')](_0x6ecb('0xd'),_0x55af16,_0x6ecb('0xb'),JSON[_0x6ecb('0xe')](_0x419179));if(_0x419179['error']){if(_0x419179[_0x6ecb('0xf')][_0x6ecb('0x10')]===0x1f4){logger['error'](_0x6ecb('0x11'),_0x55af16,_0x419179[_0x6ecb('0xf')][_0x6ecb('0x12')]);return _0x2a66a4(_0x419179['error'][_0x6ecb('0x12')]);}logger[_0x6ecb('0xf')](_0x6ecb('0x11'),_0x55af16,_0x419179[_0x6ecb('0xf')][_0x6ecb('0x12')]);return _0x220cf4(_0x419179['error'][_0x6ecb('0x12')]);}else{logger[_0x6ecb('0xa')](_0x6ecb('0x11'),_0x55af16,'request\x20sent');_0x220cf4(_0x419179['result'][_0x6ecb('0x12')]);}})[_0x6ecb('0x13')](function(_0xf21eb5){logger[_0x6ecb('0xf')]('Cdr,\x20%s,\x20%s',_0x55af16,_0xf21eb5);_0x2a66a4(_0xf21eb5);});});}
\ No newline at end of file
+var _0xa903=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x26282e,_0x1e0224){var _0x337112=function(_0x3a7a8b){while(--_0x3a7a8b){_0x26282e['push'](_0x26282e['shift']());}};_0x337112(++_0x1e0224);}(_0xa903,0xc2));var _0x3a90=function(_0x1a0028,_0x489eac){_0x1a0028=_0x1a0028-0x0;var _0x177eaf=_0xa903[_0x1a0028];return _0x177eaf;};'use strict';var _=require(_0x3a90('0x0'));var util=require(_0x3a90('0x1'));var moment=require(_0x3a90('0x2'));var BPromise=require(_0x3a90('0x3'));var rs=require(_0x3a90('0x4'));var fs=require('fs');var Redis=require(_0x3a90('0x5'));var db=require(_0x3a90('0x6'))['db'];var utils=require(_0x3a90('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a90('0x8'));var jayson=require(_0x3a90('0x9'));var client=jayson[_0x3a90('0xa')][_0x3a90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x246b80,_0x559bd6,_0x330149){return new BPromise(function(_0x3cf1d6,_0x19f5de){return client[_0x3a90('0xc')](_0x246b80,_0x330149)[_0x3a90('0xd')](function(_0x2fb686){logger[_0x3a90('0xe')](_0x3a90('0xf'),_0x559bd6,_0x3a90('0x10'));logger[_0x3a90('0x11')](_0x3a90('0x12'),_0x559bd6,_0x3a90('0x10'),JSON[_0x3a90('0x13')](_0x2fb686));if(_0x2fb686[_0x3a90('0x14')]){if(_0x2fb686[_0x3a90('0x14')][_0x3a90('0x15')]===0x1f4){logger[_0x3a90('0x14')](_0x3a90('0xf'),_0x559bd6,_0x2fb686[_0x3a90('0x14')]['message']);return _0x19f5de(_0x2fb686[_0x3a90('0x14')][_0x3a90('0x16')]);}logger[_0x3a90('0x14')](_0x3a90('0xf'),_0x559bd6,_0x2fb686[_0x3a90('0x14')][_0x3a90('0x16')]);return _0x3cf1d6(_0x2fb686[_0x3a90('0x14')][_0x3a90('0x16')]);}else{logger[_0x3a90('0xe')](_0x3a90('0xf'),_0x559bd6,_0x3a90('0x10'));_0x3cf1d6(_0x2fb686[_0x3a90('0x17')][_0x3a90('0x16')]);}})['catch'](function(_0x442c0d){logger[_0x3a90('0x14')](_0x3a90('0xf'),_0x559bd6,_0x442c0d);_0x19f5de(_0x442c0d);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e8c34f1..85b3196 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2a24ce2..51975af 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f5a=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f5a,0x6f));var _0xa8f5=function(_0x22645d,_0x47dd1b){_0x22645d=_0x22645d-0x0;var _0x810e1e=_0x8f5a[_0x22645d];return _0x810e1e;};'use strict';var Sequelize=require(_0xa8f5('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa8f5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa8f5('0x2')],'allowNull':![],'defaultValue':_0xa8f5('0x3')},'appdata':{'type':Sequelize[_0xa8f5('0x4')]()},'description':{'type':Sequelize[_0xa8f5('0x2')]},'interval':{'type':Sequelize[_0xa8f5('0x2')],'defaultValue':_0xa8f5('0x5')}};
\ No newline at end of file
+var _0x6e0d=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x4c0750,_0x34cfc9){var _0x27cbcc=function(_0x52edad){while(--_0x52edad){_0x4c0750['push'](_0x4c0750['shift']());}};_0x27cbcc(++_0x34cfc9);}(_0x6e0d,0x73));var _0xd6e0=function(_0x42340a,_0x2a09f9){_0x42340a=_0x42340a-0x0;var _0x102286=_0x6e0d[_0x42340a];return _0x102286;};'use strict';var Sequelize=require(_0xd6e0('0x0'));module[_0xd6e0('0x1')]={'priority':{'type':Sequelize[_0xd6e0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd6e0('0x3')],'allowNull':![],'defaultValue':_0xd6e0('0x4')},'appdata':{'type':Sequelize[_0xd6e0('0x5')]()},'description':{'type':Sequelize[_0xd6e0('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd6e0('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 7a1315d..411ad06 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbefe=['sendStatus','error','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy'];(function(_0x38db77,_0x18239f){var _0x916e60=function(_0x1bdf37){while(--_0x1bdf37){_0x38db77['push'](_0x38db77['shift']());}};_0x916e60(++_0x18239f);}(_0xbefe,0x168));var _0xebef=function(_0x75ad68,_0xc75b2a){_0x75ad68=_0x75ad68-0x0;var _0x469c7d=_0xbefe[_0x75ad68];return _0x469c7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];function respondWithStatusCode(_0x1dcae4,_0x566dbe){_0x566dbe=_0x566dbe||0xcc;return function(_0x584ac2){if(_0x584ac2){return _0x1dcae4['sendStatus'](_0x566dbe);}return _0x1dcae4['status'](_0x566dbe)[_0xebef('0x1a')]();};}function respondWithResult(_0x124634,_0x31772a){_0x31772a=_0x31772a||0xc8;return function(_0x35cd7a){if(_0x35cd7a){return _0x124634[_0xebef('0x1b')](_0x31772a)[_0xebef('0x1c')](_0x35cd7a);}};}function respondWithFilteredResult(_0x5813eb,_0x32ec37){return function(_0x9411d4){if(_0x9411d4){var _0x1921aa=typeof _0x32ec37[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x32ec37[_0xebef('0x1f')]===_0xebef('0x1e');var _0x1e4ddf=_0x9411d4[_0xebef('0x20')];var _0x16856f=_0x1921aa?0x0:_0x32ec37[_0xebef('0x1d')];var _0x5161f1=_0x1921aa?_0x9411d4[_0xebef('0x20')]:_0x32ec37[_0xebef('0x1d')]+_0x32ec37[_0xebef('0x1f')];var _0x502c1e;if(_0x5161f1>=_0x1e4ddf){_0x5161f1=_0x1e4ddf;_0x502c1e=0xc8;}else{_0x502c1e=0xce;}_0x5813eb[_0xebef('0x1b')](_0x502c1e);return _0x5813eb[_0xebef('0x21')](_0xebef('0x22'),_0x16856f+'-'+_0x5161f1+'/'+_0x1e4ddf)[_0xebef('0x1c')](_0x9411d4);}return null;};}function patchUpdates(_0x7ca0cc){return function(_0x138760){try{jsonpatch[_0xebef('0x23')](_0x138760,_0x7ca0cc,!![]);}catch(_0x4cc18e){return BPromise['reject'](_0x4cc18e);}return _0x138760['save']();};}function saveUpdates(_0x59e078,_0x2f1193){return function(_0x38f0b8){if(_0x38f0b8){return _0x38f0b8[_0xebef('0x24')](_0x59e078)[_0xebef('0x25')](function(_0x1ee3b){return _0x1ee3b;});}return null;};}function removeEntity(_0xe8dcbf,_0x5c5091){return function(_0x460104){if(_0x460104){return _0x460104[_0xebef('0x26')]()[_0xebef('0x25')](function(){_0xe8dcbf[_0xebef('0x1b')](0xcc)[_0xebef('0x1a')]();});}};}function handleEntityNotFound(_0x27f212,_0x36ca6b){return function(_0x42d2af){if(!_0x42d2af){_0x27f212[_0xebef('0x27')](0x194);}return _0x42d2af;};}function handleError(_0x2d63a8,_0x456a81){_0x456a81=_0x456a81||0x1f4;return function(_0x4fb77f){logger[_0xebef('0x28')](_0x4fb77f['stack']);if(_0x4fb77f['name']){delete _0x4fb77f['name'];}_0x2d63a8['status'](_0x456a81)['send'](_0x4fb77f);};}exports['show']=function(_0x55732a,_0x5703fc){var _0x506e64={'raw':!![],'where':{'id':_0x55732a['params']['id']}},_0x5a9249={};_0x5a9249[_0xebef('0x29')]=_['keys'](db[_0xebef('0x2a')]['rawAttributes']);_0x5a9249[_0xebef('0x2b')]=_[_0xebef('0x2c')](_0x55732a['query']);_0x5a9249[_0xebef('0x2d')]=_['intersection'](_0x5a9249[_0xebef('0x29')],_0x5a9249[_0xebef('0x2b')]);_0x506e64[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5a9249[_0xebef('0x29')],qs[_0xebef('0x30')](_0x55732a['query'][_0xebef('0x30')]));_0x506e64['attributes']=_0x506e64[_0xebef('0x2e')][_0xebef('0x31')]?_0x506e64[_0xebef('0x2e')]:_0x5a9249[_0xebef('0x29')];if(_0x55732a[_0xebef('0x2b')][_0xebef('0x32')]){_0x506e64[_0xebef('0x33')]=[{'all':!![]}];}_0x506e64=_['merge']({},_0x506e64,_0x55732a[_0xebef('0x34')]);return db[_0xebef('0x2a')][_0xebef('0x35')](_0x506e64)[_0xebef('0x25')](handleEntityNotFound(_0x5703fc,null))[_0xebef('0x25')](respondWithResult(_0x5703fc,null))[_0xebef('0x36')](handleError(_0x5703fc,null));};exports[_0xebef('0x24')]=function(_0x48aa2f,_0x53ad2b){if(_0x48aa2f[_0xebef('0x37')]['id']){delete _0x48aa2f['body']['id'];}return db[_0xebef('0x2a')][_0xebef('0x35')]({'where':{'id':_0x48aa2f[_0xebef('0x38')]['id']}})[_0xebef('0x25')](handleEntityNotFound(_0x53ad2b,null))[_0xebef('0x25')](saveUpdates(_0x48aa2f['body'],null))[_0xebef('0x25')](respondWithResult(_0x53ad2b,null))[_0xebef('0x36')](handleError(_0x53ad2b,null));};exports['destroy']=function(_0x5a4750,_0x890f2f){return db['ChatApplication']['find']({'where':{'id':_0x5a4750['params']['id']}})[_0xebef('0x25')](handleEntityNotFound(_0x890f2f,null))['then'](removeEntity(_0x890f2f,null))['catch'](handleError(_0x890f2f,null));};
\ No newline at end of file
+var _0xd403=['options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','error','name','show','params','model','keys','query','filters','attributes','intersection','fields','length'];(function(_0x4dffcd,_0x19b96c){var _0x411783=function(_0x47ca50){while(--_0x47ca50){_0x4dffcd['push'](_0x4dffcd['shift']());}};_0x411783(++_0x19b96c);}(_0xd403,0x1d5));var _0x3d40=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xd403[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x3d40('0x0'));var rimraf=require(_0x3d40('0x1'));var zipdir=require(_0x3d40('0x2'));var jsonpatch=require(_0x3d40('0x3'));var rp=require('request-promise');var moment=require(_0x3d40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d40('0x5'));var util=require(_0x3d40('0x6'));var path=require(_0x3d40('0x7'));var sox=require(_0x3d40('0x8'));var csv=require(_0x3d40('0x9'));var ejs=require(_0x3d40('0xa'));var fs=require('fs');var fs_extra=require(_0x3d40('0xb'));var _=require(_0x3d40('0xc'));var squel=require(_0x3d40('0xd'));var crypto=require(_0x3d40('0xe'));var jsforce=require(_0x3d40('0xf'));var deskjs=require(_0x3d40('0x10'));var toCsv=require(_0x3d40('0x9'));var querystring=require(_0x3d40('0x11'));var Papa=require(_0x3d40('0x12'));var Redis=require(_0x3d40('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3d40('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d40('0x15'));var logger=require(_0x3d40('0x16'))(_0x3d40('0x17'));var utils=require('../../config/utils');var config=require(_0x3d40('0x18'));var licenseUtil=require(_0x3d40('0x19'));var db=require(_0x3d40('0x1a'))['db'];function respondWithStatusCode(_0x49ea7c,_0x31c199){_0x31c199=_0x31c199||0xcc;return function(_0x405625){if(_0x405625){return _0x49ea7c['sendStatus'](_0x31c199);}return _0x49ea7c['status'](_0x31c199)[_0x3d40('0x1b')]();};}function respondWithResult(_0x24d2c0,_0x3e6d19){_0x3e6d19=_0x3e6d19||0xc8;return function(_0x5062ec){if(_0x5062ec){return _0x24d2c0[_0x3d40('0x1c')](_0x3e6d19)[_0x3d40('0x1d')](_0x5062ec);}};}function respondWithFilteredResult(_0x311d57,_0x3e6e71){return function(_0x2b5e2d){if(_0x2b5e2d){var _0x359e9d=typeof _0x3e6e71[_0x3d40('0x1e')]==='undefined'&&typeof _0x3e6e71['limit']===_0x3d40('0x1f');var _0x2f38e1=_0x2b5e2d[_0x3d40('0x20')];var _0x75437e=_0x359e9d?0x0:_0x3e6e71[_0x3d40('0x1e')];var _0x2f3663=_0x359e9d?_0x2b5e2d[_0x3d40('0x20')]:_0x3e6e71[_0x3d40('0x1e')]+_0x3e6e71[_0x3d40('0x21')];var _0x402b4e;if(_0x2f3663>=_0x2f38e1){_0x2f3663=_0x2f38e1;_0x402b4e=0xc8;}else{_0x402b4e=0xce;}_0x311d57[_0x3d40('0x1c')](_0x402b4e);return _0x311d57['set']('Content-Range',_0x75437e+'-'+_0x2f3663+'/'+_0x2f38e1)[_0x3d40('0x1d')](_0x2b5e2d);}return null;};}function patchUpdates(_0x41608f){return function(_0x2fc0e2){try{jsonpatch[_0x3d40('0x22')](_0x2fc0e2,_0x41608f,!![]);}catch(_0x28b1c0){return BPromise[_0x3d40('0x23')](_0x28b1c0);}return _0x2fc0e2[_0x3d40('0x24')]();};}function saveUpdates(_0xbd7298,_0x3df1f9){return function(_0x321bc2){if(_0x321bc2){return _0x321bc2[_0x3d40('0x25')](_0xbd7298)[_0x3d40('0x26')](function(_0x181688){return _0x181688;});}return null;};}function removeEntity(_0x5314c5,_0x1a2d0f){return function(_0x14cad3){if(_0x14cad3){return _0x14cad3[_0x3d40('0x27')]()[_0x3d40('0x26')](function(){_0x5314c5[_0x3d40('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45aa46,_0x28c438){return function(_0x3cc4df){if(!_0x3cc4df){_0x45aa46[_0x3d40('0x28')](0x194);}return _0x3cc4df;};}function handleError(_0x15b25f,_0x504c72){_0x504c72=_0x504c72||0x1f4;return function(_0x26844b){logger[_0x3d40('0x29')](_0x26844b['stack']);if(_0x26844b[_0x3d40('0x2a')]){delete _0x26844b[_0x3d40('0x2a')];}_0x15b25f[_0x3d40('0x1c')](_0x504c72)['send'](_0x26844b);};}exports[_0x3d40('0x2b')]=function(_0x265c2c,_0x336f0d){var _0x23b7d2={'raw':!![],'where':{'id':_0x265c2c[_0x3d40('0x2c')]['id']}},_0x30d626={};_0x30d626[_0x3d40('0x2d')]=_[_0x3d40('0x2e')](db['ChatApplication']['rawAttributes']);_0x30d626[_0x3d40('0x2f')]=_[_0x3d40('0x2e')](_0x265c2c['query']);_0x30d626[_0x3d40('0x30')]=_['intersection'](_0x30d626[_0x3d40('0x2d')],_0x30d626['query']);_0x23b7d2[_0x3d40('0x31')]=_[_0x3d40('0x32')](_0x30d626[_0x3d40('0x2d')],qs[_0x3d40('0x33')](_0x265c2c[_0x3d40('0x2f')]['fields']));_0x23b7d2['attributes']=_0x23b7d2[_0x3d40('0x31')][_0x3d40('0x34')]?_0x23b7d2[_0x3d40('0x31')]:_0x30d626['model'];if(_0x265c2c[_0x3d40('0x2f')]['includeAll']){_0x23b7d2['include']=[{'all':!![]}];}_0x23b7d2=_['merge']({},_0x23b7d2,_0x265c2c[_0x3d40('0x35')]);return db[_0x3d40('0x36')][_0x3d40('0x37')](_0x23b7d2)[_0x3d40('0x26')](handleEntityNotFound(_0x336f0d,null))[_0x3d40('0x26')](respondWithResult(_0x336f0d,null))[_0x3d40('0x38')](handleError(_0x336f0d,null));};exports[_0x3d40('0x25')]=function(_0x3ad5cc,_0x13ab5a){if(_0x3ad5cc['body']['id']){delete _0x3ad5cc['body']['id'];}return db[_0x3d40('0x36')][_0x3d40('0x37')]({'where':{'id':_0x3ad5cc[_0x3d40('0x2c')]['id']}})[_0x3d40('0x26')](handleEntityNotFound(_0x13ab5a,null))[_0x3d40('0x26')](saveUpdates(_0x3ad5cc[_0x3d40('0x39')],null))['then'](respondWithResult(_0x13ab5a,null))[_0x3d40('0x38')](handleError(_0x13ab5a,null));};exports[_0x3d40('0x27')]=function(_0x3a7f39,_0x5d40c3){return db[_0x3d40('0x36')]['find']({'where':{'id':_0x3a7f39[_0x3d40('0x2c')]['id']}})[_0x3d40('0x26')](handleEntityNotFound(_0x5d40c3,null))['then'](removeEntity(_0x5d40c3,null))[_0x3d40('0x38')](handleError(_0x5d40c3,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 27d5c11..8a8037d 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43d3=['path','rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59de15,_0x13c0c3){var _0x400c71=function(_0xe80b8f){while(--_0xe80b8f){_0x59de15['push'](_0x59de15['shift']());}};_0x400c71(++_0x13c0c3);}(_0x43d3,0x182));var _0x343d=function(_0x12a512,_0x8065db){_0x12a512=_0x12a512-0x0;var _0x582402=_0x43d3[_0x12a512];return _0x582402;};'use strict';var _=require('lodash');var util=require(_0x343d('0x0'));var logger=require(_0x343d('0x1'))(_0x343d('0x2'));var moment=require(_0x343d('0x3'));var BPromise=require(_0x343d('0x4'));var rp=require(_0x343d('0x5'));var fs=require('fs');var path=require(_0x343d('0x6'));var rimraf=require(_0x343d('0x7'));var config=require('../../config/environment');var attributes=require(_0x343d('0x8'));module['exports']=function(_0x117216,_0x3aa08a){return _0x117216[_0x343d('0x9')](_0x343d('0xa'),attributes,{'tableName':_0x343d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x343d('0xc'),'collate':_0x343d('0xd')});};
\ No newline at end of file
+var _0xa251=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x35f991,_0x56604b){var _0x98d55a=function(_0x2c7712){while(--_0x2c7712){_0x35f991['push'](_0x35f991['shift']());}};_0x98d55a(++_0x56604b);}(_0xa251,0x1de));var _0x1a25=function(_0x2d3df2,_0x2f9498){_0x2d3df2=_0x2d3df2-0x0;var _0x347bda=_0xa251[_0x2d3df2];return _0x347bda;};'use strict';var _=require(_0x1a25('0x0'));var util=require(_0x1a25('0x1'));var logger=require(_0x1a25('0x2'))(_0x1a25('0x3'));var moment=require('moment');var BPromise=require(_0x1a25('0x4'));var rp=require(_0x1a25('0x5'));var fs=require('fs');var path=require(_0x1a25('0x6'));var rimraf=require(_0x1a25('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a25('0x8'));module[_0x1a25('0x9')]=function(_0x106d02,_0x1c2a7a){return _0x106d02['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a25('0xa'),'collate':_0x1a25('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index cb8f382..69ae7a5 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x51ac=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x1fb039,_0x50a6c4){var _0x192ab7=function(_0x218136){while(--_0x218136){_0x1fb039['push'](_0x1fb039['shift']());}};_0x192ab7(++_0x50a6c4);}(_0x51ac,0x11b));var _0xc51a=function(_0x30814c,_0x305670){_0x30814c=_0x30814c-0x0;var _0x25e13b=_0x51ac[_0x30814c];return _0x25e13b;};'use strict';var _=require(_0xc51a('0x0'));var util=require(_0xc51a('0x1'));var moment=require(_0xc51a('0x2'));var BPromise=require(_0xc51a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc51a('0x4'))['db'];var utils=require(_0xc51a('0x5'));var logger=require(_0xc51a('0x6'))(_0xc51a('0x7'));var config=require(_0xc51a('0x8'));var jayson=require(_0xc51a('0x9'));var client=jayson[_0xc51a('0xa')][_0xc51a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28bbc0,_0xe4dbc5,_0x1db38e){return new BPromise(function(_0x315d5c,_0x4fb335){return client['request'](_0x28bbc0,_0x1db38e)[_0xc51a('0xc')](function(_0x7e922d){logger[_0xc51a('0xd')](_0xc51a('0xe'),_0xe4dbc5,_0xc51a('0xf'));logger['debug'](_0xc51a('0x10'),_0xe4dbc5,'request\x20sent',JSON[_0xc51a('0x11')](_0x7e922d));if(_0x7e922d['error']){if(_0x7e922d['error']['code']===0x1f4){logger[_0xc51a('0x12')](_0xc51a('0xe'),_0xe4dbc5,_0x7e922d[_0xc51a('0x12')][_0xc51a('0x13')]);return _0x4fb335(_0x7e922d[_0xc51a('0x12')][_0xc51a('0x13')]);}logger[_0xc51a('0x12')](_0xc51a('0xe'),_0xe4dbc5,_0x7e922d[_0xc51a('0x12')][_0xc51a('0x13')]);return _0x315d5c(_0x7e922d[_0xc51a('0x12')][_0xc51a('0x13')]);}else{logger[_0xc51a('0xd')](_0xc51a('0xe'),_0xe4dbc5,_0xc51a('0xf'));_0x315d5c(_0x7e922d[_0xc51a('0x14')]['message']);}})[_0xc51a('0x15')](function(_0x2bfd1b){logger[_0xc51a('0x12')](_0xc51a('0xe'),_0xe4dbc5,_0x2bfd1b);_0x4fb335(_0x2bfd1b);});});}
\ No newline at end of file
+var _0x59ed=['../../config/logger','rpc','jayson/promise','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x59ed,0x73));var _0xd59e=function(_0x54a28a,_0x1ba1fe){_0x54a28a=_0x54a28a-0x0;var _0x3da1f1=_0x59ed[_0x54a28a];return _0x3da1f1;};'use strict';var _=require('lodash');var util=require(_0xd59e('0x0'));var moment=require('moment');var BPromise=require(_0xd59e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd59e('0x2'));var db=require(_0xd59e('0x3'))['db'];var utils=require(_0xd59e('0x4'));var logger=require(_0xd59e('0x5'))(_0xd59e('0x6'));var config=require('../../config/environment');var jayson=require(_0xd59e('0x7'));var client=jayson['client'][_0xd59e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f628e,_0x42fb03,_0x5da5e5){return new BPromise(function(_0x3ec564,_0x4b1b6c){return client['request'](_0x3f628e,_0x5da5e5)[_0xd59e('0x9')](function(_0x91b6a7){logger[_0xd59e('0xa')](_0xd59e('0xb'),_0x42fb03,_0xd59e('0xc'));logger[_0xd59e('0xd')](_0xd59e('0xe'),_0x42fb03,_0xd59e('0xc'),JSON[_0xd59e('0xf')](_0x91b6a7));if(_0x91b6a7[_0xd59e('0x10')]){if(_0x91b6a7[_0xd59e('0x10')][_0xd59e('0x11')]===0x1f4){logger[_0xd59e('0x10')](_0xd59e('0xb'),_0x42fb03,_0x91b6a7[_0xd59e('0x10')][_0xd59e('0x12')]);return _0x4b1b6c(_0x91b6a7[_0xd59e('0x10')][_0xd59e('0x12')]);}logger[_0xd59e('0x10')](_0xd59e('0xb'),_0x42fb03,_0x91b6a7['error'][_0xd59e('0x12')]);return _0x3ec564(_0x91b6a7[_0xd59e('0x10')][_0xd59e('0x12')]);}else{logger[_0xd59e('0xa')](_0xd59e('0xb'),_0x42fb03,_0xd59e('0xc'));_0x3ec564(_0x91b6a7['result'][_0xd59e('0x12')]);}})[_0xd59e('0x13')](function(_0x2fe522){logger[_0xd59e('0x10')](_0xd59e('0xb'),_0x42fb03,_0x2fe522);_0x4b1b6c(_0x2fe522);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1892b05..d9b479e 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf66=['util','path','express','Router','fs-extra','../../config/environment','./chatApplication.controller','/:id','show','put','isAuthenticated','destroy','exports','multer'];(function(_0x29a86c,_0x50f14a){var _0x42f78c=function(_0x1535b1){while(--_0x1535b1){_0x29a86c['push'](_0x29a86c['shift']());}};_0x42f78c(++_0x50f14a);}(_0xcf66,0x99));var _0x6cf6=function(_0x42be0f,_0x4c14cb){_0x42be0f=_0x42be0f-0x0;var _0x40ef79=_0xcf66[_0x42be0f];return _0x40ef79;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var fs_extra=require(_0x6cf6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6cf6('0x6'));var controller=require(_0x6cf6('0x7'));router['get'](_0x6cf6('0x8'),auth['isAuthenticated'](),controller[_0x6cf6('0x9')]);router[_0x6cf6('0xa')](_0x6cf6('0x8'),auth[_0x6cf6('0xb')](),controller['update']);router['delete']('/:id',auth[_0x6cf6('0xb')](),controller[_0x6cf6('0xc')]);module[_0x6cf6('0xd')]=router;
\ No newline at end of file
+var _0xb686=['/:id','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xb686,0x1a5));var _0x6b68=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb686[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x6b68('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6b68('0x1'));var express=require('express');var router=express[_0x6b68('0x2')]();var fs_extra=require(_0x6b68('0x3'));var auth=require(_0x6b68('0x4'));var interaction=require(_0x6b68('0x5'));var config=require(_0x6b68('0x6'));var controller=require(_0x6b68('0x7'));router[_0x6b68('0x8')]('/:id',auth[_0x6b68('0x9')](),controller[_0x6b68('0xa')]);router['put'](_0x6b68('0xb'),auth[_0x6b68('0x9')](),controller['update']);router['delete'](_0x6b68('0xb'),auth[_0x6b68('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f53fc66..16bb23c 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a0b=['BOOLEAN','sequelize','exports','STRING'];(function(_0xd4669d,_0x4ef2b2){var _0x5e5002=function(_0x43aeab){while(--_0x43aeab){_0xd4669d['push'](_0xd4669d['shift']());}};_0x5e5002(++_0x4ef2b2);}(_0x7a0b,0x85));var _0xb7a0=function(_0x39c3a5,_0x55f37b){_0x39c3a5=_0x39c3a5-0x0;var _0x293f27=_0x7a0b[_0x39c3a5];return _0x293f27;};'use strict';var Sequelize=require(_0xb7a0('0x0'));module[_0xb7a0('0x1')]={'name':{'type':Sequelize[_0xb7a0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb7a0('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2dc3=['BOOLEAN','exports','STRING'];(function(_0x47e6d7,_0x232b87){var _0x80f038=function(_0x4db0b9){while(--_0x4db0b9){_0x47e6d7['push'](_0x47e6d7['shift']());}};_0x80f038(++_0x232b87);}(_0x2dc3,0x127));var _0x32dc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2dc3[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x32dc('0x0')]={'name':{'type':Sequelize[_0x32dc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x32dc('0x1')]},'write':{'type':Sequelize[_0x32dc('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 940fda7..893a016 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb13=['error','stack','name','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','User','getMembers','removeMembers','addMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xdb13,0x93));var _0x3db1=function(_0xea9fdf,_0x40a92f){_0xea9fdf=_0xea9fdf-0x0;var _0x508d63=_0xdb13[_0xea9fdf];return _0x508d63;};'use strict';var emlformat=require(_0x3db1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3db1('0x1'));var jsonpatch=require(_0x3db1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3db1('0x3'));var Mustache=require(_0x3db1('0x4'));var util=require(_0x3db1('0x5'));var path=require(_0x3db1('0x6'));var sox=require(_0x3db1('0x7'));var csv=require(_0x3db1('0x8'));var ejs=require(_0x3db1('0x9'));var fs=require('fs');var fs_extra=require(_0x3db1('0xa'));var _=require(_0x3db1('0xb'));var squel=require(_0x3db1('0xc'));var crypto=require(_0x3db1('0xd'));var jsforce=require(_0x3db1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3db1('0x8'));var querystring=require(_0x3db1('0xf'));var Papa=require('papaparse');var Redis=require(_0x3db1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3db1('0x11'));var config=require(_0x3db1('0x12'));var licenseUtil=require(_0x3db1('0x13'));var db=require(_0x3db1('0x14'))['db'];config[_0x3db1('0x15')]=_[_0x3db1('0x16')](config[_0x3db1('0x15')],{'host':_0x3db1('0x17'),'port':0x18eb});var socket=require(_0x3db1('0x18'))(new Redis(config['redis']));require(_0x3db1('0x19'))['register'](socket);function respondWithStatusCode(_0x3c3a7c,_0x298c9d){_0x298c9d=_0x298c9d||0xcc;return function(_0x10ac4a){if(_0x10ac4a){return _0x3c3a7c[_0x3db1('0x1a')](_0x298c9d);}return _0x3c3a7c[_0x3db1('0x1b')](_0x298c9d)[_0x3db1('0x1c')]();};}function respondWithResult(_0x1d4ab1,_0x29223a){_0x29223a=_0x29223a||0xc8;return function(_0x53e0cb){if(_0x53e0cb){return _0x1d4ab1['status'](_0x29223a)[_0x3db1('0x1d')](_0x53e0cb);}};}function respondWithFilteredResult(_0xbead32,_0x531619){return function(_0x12208a){if(_0x12208a){var _0x2aee49=typeof _0x531619['offset']==='undefined'&&typeof _0x531619[_0x3db1('0x1e')]===_0x3db1('0x1f');var _0xb91c8c=_0x12208a[_0x3db1('0x20')];var _0x4f52e8=_0x2aee49?0x0:_0x531619[_0x3db1('0x21')];var _0x3b8112=_0x2aee49?_0x12208a[_0x3db1('0x20')]:_0x531619['offset']+_0x531619[_0x3db1('0x1e')];var _0x5855d7;if(_0x3b8112>=_0xb91c8c){_0x3b8112=_0xb91c8c;_0x5855d7=0xc8;}else{_0x5855d7=0xce;}_0xbead32[_0x3db1('0x1b')](_0x5855d7);return _0xbead32[_0x3db1('0x22')](_0x3db1('0x23'),_0x4f52e8+'-'+_0x3b8112+'/'+_0xb91c8c)['json'](_0x12208a);}return null;};}function patchUpdates(_0x5356ca){return function(_0x125caa){try{jsonpatch['apply'](_0x125caa,_0x5356ca,!![]);}catch(_0x5da720){return BPromise[_0x3db1('0x24')](_0x5da720);}return _0x125caa[_0x3db1('0x25')]();};}function saveUpdates(_0x45d6f0,_0x2fe649){return function(_0x451cfa){if(_0x451cfa){return _0x451cfa[_0x3db1('0x26')](_0x45d6f0)[_0x3db1('0x27')](function(_0x1f388b){return _0x1f388b;});}return null;};}function removeEntity(_0x3e4de7,_0x1467ae){return function(_0x5b0caa){if(_0x5b0caa){return _0x5b0caa[_0x3db1('0x28')]()[_0x3db1('0x27')](function(){_0x3e4de7[_0x3db1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32fe71,_0x33c557){return function(_0x24fef5){if(!_0x24fef5){_0x32fe71['sendStatus'](0x194);}return _0x24fef5;};}function handleError(_0x4a3b82,_0x339271){_0x339271=_0x339271||0x1f4;return function(_0x1d8285){logger[_0x3db1('0x29')](_0x1d8285[_0x3db1('0x2a')]);if(_0x1d8285[_0x3db1('0x2b')]){delete _0x1d8285['name'];}_0x4a3b82[_0x3db1('0x1b')](_0x339271)['send'](_0x1d8285);};}exports[_0x3db1('0x2c')]=function(_0x443067,_0x50f2a9){var _0x1af7ec={},_0x1a79f8={},_0x1fb8f0={'count':0x0,'rows':[]};var _0x53111e=_[_0x3db1('0x2d')](db['ChatGroup'][_0x3db1('0x2e')],function(_0x47bc64){return{'name':_0x47bc64['fieldName'],'type':_0x47bc64[_0x3db1('0x2f')][_0x3db1('0x30')]};});_0x1a79f8['model']=_[_0x3db1('0x2d')](_0x53111e,_0x3db1('0x2b'));_0x1a79f8['query']=_['keys'](_0x443067[_0x3db1('0x31')]);_0x1a79f8[_0x3db1('0x32')]=_[_0x3db1('0x33')](_0x1a79f8[_0x3db1('0x34')],_0x1a79f8[_0x3db1('0x31')]);_0x1af7ec[_0x3db1('0x35')]=_['intersection'](_0x1a79f8[_0x3db1('0x34')],qs[_0x3db1('0x36')](_0x443067[_0x3db1('0x31')][_0x3db1('0x36')]));_0x1af7ec[_0x3db1('0x35')]=_0x1af7ec[_0x3db1('0x35')][_0x3db1('0x37')]?_0x1af7ec['attributes']:_0x1a79f8[_0x3db1('0x34')];if(!_0x443067[_0x3db1('0x31')][_0x3db1('0x38')](_0x3db1('0x39'))){_0x1af7ec['limit']=qs[_0x3db1('0x1e')](_0x443067[_0x3db1('0x31')][_0x3db1('0x1e')]);_0x1af7ec[_0x3db1('0x21')]=qs[_0x3db1('0x21')](_0x443067['query'][_0x3db1('0x21')]);}_0x1af7ec[_0x3db1('0x3a')]=qs[_0x3db1('0x3b')](_0x443067[_0x3db1('0x31')][_0x3db1('0x3b')]);_0x1af7ec[_0x3db1('0x3c')]=qs[_0x3db1('0x32')](_[_0x3db1('0x3d')](_0x443067[_0x3db1('0x31')],_0x1a79f8['filters']),_0x53111e);if(_0x443067['query'][_0x3db1('0x3e')]){_0x1af7ec[_0x3db1('0x3c')]=_[_0x3db1('0x3f')](_0x1af7ec['where'],{'$or':_[_0x3db1('0x2d')](_0x53111e,function(_0x38cb5f){if(_0x38cb5f[_0x3db1('0x2f')]!==_0x3db1('0x40')){var _0x151c5d={};_0x151c5d[_0x38cb5f[_0x3db1('0x2b')]]={'$like':'%'+_0x443067[_0x3db1('0x31')][_0x3db1('0x3e')]+'%'};return _0x151c5d;}})});}_0x1af7ec=_[_0x3db1('0x3f')]({},_0x1af7ec,_0x443067['options']);var _0xf4649b={'where':_0x1af7ec[_0x3db1('0x3c')]};return db[_0x3db1('0x41')][_0x3db1('0x20')](_0xf4649b)[_0x3db1('0x27')](function(_0x4b20d1){_0x1fb8f0[_0x3db1('0x20')]=_0x4b20d1;if(_0x443067['query'][_0x3db1('0x42')]){_0x1af7ec[_0x3db1('0x43')]=[{'all':!![]}];}return db[_0x3db1('0x41')][_0x3db1('0x44')](_0x1af7ec);})[_0x3db1('0x27')](function(_0x1c10b6){_0x1fb8f0['rows']=_0x1c10b6;return _0x1fb8f0;})[_0x3db1('0x27')](respondWithFilteredResult(_0x50f2a9,_0x1af7ec))[_0x3db1('0x45')](handleError(_0x50f2a9,null));};exports[_0x3db1('0x46')]=function(_0x52f43a,_0x153f41){var _0xb2c96f={'raw':!![],'where':{'id':_0x52f43a[_0x3db1('0x47')]['id']}},_0x4b26d4={};_0x4b26d4['model']=_[_0x3db1('0x48')](db[_0x3db1('0x41')]['rawAttributes']);_0x4b26d4['query']=_[_0x3db1('0x48')](_0x52f43a[_0x3db1('0x31')]);_0x4b26d4[_0x3db1('0x32')]=_[_0x3db1('0x33')](_0x4b26d4[_0x3db1('0x34')],_0x4b26d4[_0x3db1('0x31')]);_0xb2c96f[_0x3db1('0x35')]=_[_0x3db1('0x33')](_0x4b26d4[_0x3db1('0x34')],qs[_0x3db1('0x36')](_0x52f43a[_0x3db1('0x31')][_0x3db1('0x36')]));_0xb2c96f[_0x3db1('0x35')]=_0xb2c96f[_0x3db1('0x35')][_0x3db1('0x37')]?_0xb2c96f['attributes']:_0x4b26d4['model'];if(_0x52f43a[_0x3db1('0x31')]['includeAll']){_0xb2c96f[_0x3db1('0x43')]=[{'all':!![]}];}_0xb2c96f=_['merge']({},_0xb2c96f,_0x52f43a['options']);return db[_0x3db1('0x41')][_0x3db1('0x49')](_0xb2c96f)['then'](handleEntityNotFound(_0x153f41,null))[_0x3db1('0x27')](respondWithResult(_0x153f41,null))[_0x3db1('0x45')](handleError(_0x153f41,null));};exports[_0x3db1('0x4a')]=function(_0x2324fd,_0x1e18da){return db['ChatGroup'][_0x3db1('0x4a')](_0x2324fd[_0x3db1('0x4b')],{})[_0x3db1('0x27')](respondWithResult(_0x1e18da,0xc9))['catch'](handleError(_0x1e18da,null));};exports[_0x3db1('0x26')]=function(_0x7c0464,_0xdd33a8){if(_0x7c0464[_0x3db1('0x4b')]['id']){delete _0x7c0464[_0x3db1('0x4b')]['id'];}return db['ChatGroup'][_0x3db1('0x49')]({'where':{'id':_0x7c0464[_0x3db1('0x47')]['id']}})['then'](handleEntityNotFound(_0xdd33a8,null))[_0x3db1('0x27')](saveUpdates(_0x7c0464['body'],null))[_0x3db1('0x27')](respondWithResult(_0xdd33a8,null))[_0x3db1('0x45')](handleError(_0xdd33a8,null));};exports[_0x3db1('0x28')]=function(_0x141304,_0x5e0e69){return db[_0x3db1('0x41')]['find']({'where':{'id':_0x141304[_0x3db1('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e0e69,null))[_0x3db1('0x27')](removeEntity(_0x5e0e69,null))[_0x3db1('0x45')](handleError(_0x5e0e69,null));};exports[_0x3db1('0x4c')]=function(_0x553397,_0x22ffa3){return db[_0x3db1('0x41')][_0x3db1('0x4c')]()[_0x3db1('0x27')](respondWithResult(_0x22ffa3,null))[_0x3db1('0x45')](handleError(_0x22ffa3,null));};exports[_0x3db1('0x4d')]=function(_0xcc4e6c,_0x26157b,_0x11ea95){return db[_0x3db1('0x4e')]['count']({'where':{'ChatGroupId':_0xcc4e6c[_0x3db1('0x47')]['id'],'ToId':_0xcc4e6c['user']['id'],'read':![]}})[_0x3db1('0x27')](function(_0x560495){return{'id':_[_0x3db1('0x4f')](_0xcc4e6c['params']['id']),'count':_0x560495};})[_0x3db1('0x27')](respondWithResult(_0x26157b,null))['catch'](handleError(_0x26157b,null));};exports['addMembers']=function(_0x545eae,_0xff2326,_0x1e2f5f){return db[_0x3db1('0x41')]['find']({'where':{'id':_0x545eae[_0x3db1('0x47')]['id']}})['then'](handleEntityNotFound(_0xff2326,null))[_0x3db1('0x27')](function(_0x388de4){if(_0x388de4){return _0x388de4[_0x3db1('0x50')](_0x545eae['body']['ids'],_[_0x3db1('0x51')](_0x545eae[_0x3db1('0x4b')],[_0x3db1('0x52'),'id'])||{});}})[_0x3db1('0x27')](respondWithResult(_0xff2326,null))[_0x3db1('0x45')](handleError(_0xff2326,null));};exports['getMembers']=function(_0x455995,_0x17ec38,_0x3c1ca3){var _0x3462fc={};var _0x470d91={};var _0x7712dd;var _0x71507a;return db[_0x3db1('0x41')]['findOne']({'where':{'id':_0x455995[_0x3db1('0x47')]['id']}})[_0x3db1('0x27')](handleEntityNotFound(_0x17ec38,null))[_0x3db1('0x27')](function(_0x23be78){if(_0x23be78){_0x7712dd=_0x23be78;_0x470d91[_0x3db1('0x34')]=_[_0x3db1('0x48')](db[_0x3db1('0x53')][_0x3db1('0x2e')]);_0x470d91['query']=_['keys'](_0x455995['query']);_0x470d91[_0x3db1('0x32')]=_['intersection'](_0x470d91[_0x3db1('0x34')],_0x470d91['query']);_0x3462fc[_0x3db1('0x35')]=_[_0x3db1('0x33')](_0x470d91[_0x3db1('0x34')],qs['fields'](_0x455995['query'][_0x3db1('0x36')]));_0x3462fc[_0x3db1('0x35')]=_0x3462fc['attributes'][_0x3db1('0x37')]?_0x3462fc[_0x3db1('0x35')]:_0x470d91['model'];_0x3462fc[_0x3db1('0x3a')]=qs[_0x3db1('0x3b')](_0x455995[_0x3db1('0x31')][_0x3db1('0x3b')]);_0x3462fc['where']=qs[_0x3db1('0x32')](_['pick'](_0x455995['query'],_0x470d91[_0x3db1('0x32')]));if(_0x455995[_0x3db1('0x31')][_0x3db1('0x3e')]){_0x3462fc['where']=_[_0x3db1('0x3f')](_0x3462fc[_0x3db1('0x3c')],{'$or':_[_0x3db1('0x2d')](_0x3462fc['attributes'],function(_0x75fa6b){var _0x43b5e7={};_0x43b5e7[_0x75fa6b]={'$like':'%'+_0x455995[_0x3db1('0x31')][_0x3db1('0x3e')]+'%'};return _0x43b5e7;})});}_0x3462fc=_[_0x3db1('0x3f')]({},_0x3462fc,_0x455995['options']);return _0x7712dd['getMembers'](_0x3462fc);}})[_0x3db1('0x27')](function(_0x6e6571){if(_0x6e6571){_0x71507a=_0x6e6571['length'];if(!_0x455995['query'][_0x3db1('0x38')]('nolimit')){_0x3462fc['limit']=qs[_0x3db1('0x1e')](_0x455995[_0x3db1('0x31')][_0x3db1('0x1e')]);_0x3462fc['offset']=qs[_0x3db1('0x21')](_0x455995[_0x3db1('0x31')][_0x3db1('0x21')]);}return _0x7712dd[_0x3db1('0x54')](_0x3462fc);}})['then'](function(_0x1a7b1d){if(_0x1a7b1d){return _0x1a7b1d?{'count':_0x71507a,'rows':_0x1a7b1d}:null;}})[_0x3db1('0x27')](respondWithResult(_0x17ec38,null))[_0x3db1('0x45')](handleError(_0x17ec38,null));};exports[_0x3db1('0x55')]=function(_0x359a17,_0x1f13e9,_0x20b2c4){return db[_0x3db1('0x41')][_0x3db1('0x49')]({'where':{'id':_0x359a17[_0x3db1('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f13e9,null))[_0x3db1('0x27')](function(_0x486c16){if(_0x486c16){return _0x486c16[_0x3db1('0x55')](_0x359a17[_0x3db1('0x31')][_0x3db1('0x52')]);}})[_0x3db1('0x27')](respondWithStatusCode(_0x1f13e9,null))[_0x3db1('0x45')](handleError(_0x1f13e9,null));};exports[_0x3db1('0x56')]=function(_0x20ef00,_0x4f9d41,_0x3fa19c){if(_0x20ef00['body']['id']){delete _0x20ef00['body']['id'];}return db[_0x3db1('0x41')][_0x3db1('0x49')]({'where':{'id':_0x20ef00[_0x3db1('0x47')]['id']}})[_0x3db1('0x27')](handleEntityNotFound(_0x4f9d41,null))[_0x3db1('0x27')](function(_0x4b7e95){if(_0x4b7e95){_0x20ef00[_0x3db1('0x4b')]['ChatGroupId']=_0x4b7e95['id'];return db[_0x3db1('0x4e')][_0x3db1('0x4a')](_0x20ef00[_0x3db1('0x4b')]);}})[_0x3db1('0x27')](respondWithResult(_0x4f9d41,null))['catch'](handleError(_0x4f9d41,null));};exports[_0x3db1('0x57')]=function(_0x26346f,_0x2d2ce7,_0x11fe4d){var _0x575e62={};var _0x3d51b4={};var _0x231a8c;var _0x174bb4;return db[_0x3db1('0x41')][_0x3db1('0x58')]({'where':{'id':_0x26346f[_0x3db1('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d2ce7,null))[_0x3db1('0x27')](function(_0x359827){if(_0x359827){_0x231a8c=_0x359827;_0x3d51b4[_0x3db1('0x34')]=_[_0x3db1('0x48')](db[_0x3db1('0x4e')][_0x3db1('0x2e')]);_0x3d51b4[_0x3db1('0x31')]=_['keys'](_0x26346f[_0x3db1('0x31')]);_0x3d51b4[_0x3db1('0x32')]=_['intersection'](_0x3d51b4[_0x3db1('0x34')],_0x3d51b4[_0x3db1('0x31')]);_0x575e62[_0x3db1('0x35')]=_[_0x3db1('0x33')](_0x3d51b4[_0x3db1('0x34')],qs[_0x3db1('0x36')](_0x26346f[_0x3db1('0x31')][_0x3db1('0x36')]));_0x575e62[_0x3db1('0x35')]=_0x575e62[_0x3db1('0x35')]['length']?_0x575e62[_0x3db1('0x35')]:_0x3d51b4[_0x3db1('0x34')];_0x575e62[_0x3db1('0x3a')]=qs[_0x3db1('0x3b')](_0x26346f['query'][_0x3db1('0x3b')]);_0x575e62[_0x3db1('0x3c')]=qs[_0x3db1('0x32')](_['pick'](_0x26346f[_0x3db1('0x31')],_0x3d51b4[_0x3db1('0x32')]));if(_0x26346f[_0x3db1('0x31')][_0x3db1('0x3e')]){_0x575e62[_0x3db1('0x3c')]=_[_0x3db1('0x3f')](_0x575e62[_0x3db1('0x3c')],{'$or':_[_0x3db1('0x2d')](_0x575e62[_0x3db1('0x35')],function(_0x3a6554){var _0x2ea790={};_0x2ea790[_0x3a6554]={'$like':'%'+_0x26346f[_0x3db1('0x31')][_0x3db1('0x3e')]+'%'};return _0x2ea790;})});}if(_0x26346f['query'][_0x3db1('0x59')]){var _0x3d4211=_0x26346f['query'][_0x3db1('0x59')][_0x3db1('0x5a')](',');var _0x54eb6a={};_0x54eb6a[_0x3d4211[0x0]]={'$gte':moment(_0x3d4211[0x1])[_0x3db1('0x5b')](_0x3db1('0x5c'))};_0x575e62['where']=_[_0x3db1('0x3f')](_0x575e62[_0x3db1('0x3c')],_0x54eb6a);}_0x575e62=_[_0x3db1('0x3f')]({},_0x575e62,_0x26346f[_0x3db1('0x5d')]);return _0x231a8c[_0x3db1('0x57')](_0x575e62);}})[_0x3db1('0x27')](function(_0x5942df){if(_0x5942df){_0x174bb4=_0x5942df[_0x3db1('0x37')];if(!_0x26346f[_0x3db1('0x31')][_0x3db1('0x38')](_0x3db1('0x39'))){_0x575e62[_0x3db1('0x1e')]=qs[_0x3db1('0x1e')](_0x26346f[_0x3db1('0x31')]['limit']);_0x575e62[_0x3db1('0x21')]=qs['offset'](_0x26346f[_0x3db1('0x31')]['offset']);}return _0x231a8c[_0x3db1('0x57')](_0x575e62);}})['then'](function(_0x521c7a){if(_0x521c7a){return _0x521c7a?{'count':_0x174bb4,'rows':_0x521c7a}:null;}})[_0x3db1('0x27')](respondWithResult(_0x2d2ce7,null))[_0x3db1('0x45')](handleError(_0x2d2ce7,null));};
\ No newline at end of file
+var _0x75cc=['order','filter','map','nolimit','getMembers','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','index','ChatGroup','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','describe','user','toInteger','addMembers','ids','omit','findOne','User'];(function(_0x31d344,_0x1527c4){var _0x460050=function(_0x10c336){while(--_0x10c336){_0x31d344['push'](_0x31d344['shift']());}};_0x460050(++_0x1527c4);}(_0x75cc,0x122));var _0xc75c=function(_0x2a629f,_0x9f9eda){_0x2a629f=_0x2a629f-0x0;var _0x148e48=_0x75cc[_0x2a629f];return _0x148e48;};'use strict';var emlformat=require(_0xc75c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc75c('0x1'));var jsonpatch=require(_0xc75c('0x2'));var rp=require(_0xc75c('0x3'));var moment=require(_0xc75c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc75c('0x5'));var util=require('util');var path=require(_0xc75c('0x6'));var sox=require(_0xc75c('0x7'));var csv=require(_0xc75c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc75c('0x9'));var _=require(_0xc75c('0xa'));var squel=require('squel');var crypto=require(_0xc75c('0xb'));var jsforce=require(_0xc75c('0xc'));var deskjs=require(_0xc75c('0xd'));var toCsv=require(_0xc75c('0x8'));var querystring=require('querystring');var Papa=require(_0xc75c('0xe'));var Redis=require(_0xc75c('0xf'));var authService=require(_0xc75c('0x10'));var qs=require(_0xc75c('0x11'));var as=require(_0xc75c('0x12'));var hardwareService=require(_0xc75c('0x13'));var logger=require('../../config/logger')(_0xc75c('0x14'));var utils=require(_0xc75c('0x15'));var config=require(_0xc75c('0x16'));var licenseUtil=require(_0xc75c('0x17'));var db=require(_0xc75c('0x18'))['db'];config[_0xc75c('0x19')]=_[_0xc75c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc75c('0x19')]));require(_0xc75c('0x1b'))['register'](socket);function respondWithStatusCode(_0x574ca5,_0x48b81f){_0x48b81f=_0x48b81f||0xcc;return function(_0x3eed2b){if(_0x3eed2b){return _0x574ca5[_0xc75c('0x1c')](_0x48b81f);}return _0x574ca5[_0xc75c('0x1d')](_0x48b81f)[_0xc75c('0x1e')]();};}function respondWithResult(_0x294045,_0x52a77a){_0x52a77a=_0x52a77a||0xc8;return function(_0x3e89e4){if(_0x3e89e4){return _0x294045[_0xc75c('0x1d')](_0x52a77a)[_0xc75c('0x1f')](_0x3e89e4);}};}function respondWithFilteredResult(_0x2dfa11,_0x12acbc){return function(_0x52af52){if(_0x52af52){var _0x2a556d=typeof _0x12acbc[_0xc75c('0x20')]==='undefined'&&typeof _0x12acbc[_0xc75c('0x21')]===_0xc75c('0x22');var _0x295123=_0x52af52[_0xc75c('0x23')];var _0x1b4405=_0x2a556d?0x0:_0x12acbc['offset'];var _0x2b95aa=_0x2a556d?_0x52af52[_0xc75c('0x23')]:_0x12acbc[_0xc75c('0x20')]+_0x12acbc[_0xc75c('0x21')];var _0x3db6d0;if(_0x2b95aa>=_0x295123){_0x2b95aa=_0x295123;_0x3db6d0=0xc8;}else{_0x3db6d0=0xce;}_0x2dfa11[_0xc75c('0x1d')](_0x3db6d0);return _0x2dfa11[_0xc75c('0x24')](_0xc75c('0x25'),_0x1b4405+'-'+_0x2b95aa+'/'+_0x295123)[_0xc75c('0x1f')](_0x52af52);}return null;};}function patchUpdates(_0x2241eb){return function(_0x2b0bf0){try{jsonpatch['apply'](_0x2b0bf0,_0x2241eb,!![]);}catch(_0x5ad810){return BPromise['reject'](_0x5ad810);}return _0x2b0bf0['save']();};}function saveUpdates(_0xdd763c,_0x52bda8){return function(_0x1588d4){if(_0x1588d4){return _0x1588d4[_0xc75c('0x26')](_0xdd763c)[_0xc75c('0x27')](function(_0x551107){return _0x551107;});}return null;};}function removeEntity(_0xfd9c41,_0x52b1ea){return function(_0x26f2e1){if(_0x26f2e1){return _0x26f2e1['destroy']()[_0xc75c('0x27')](function(){_0xfd9c41[_0xc75c('0x1d')](0xcc)[_0xc75c('0x1e')]();});}};}function handleEntityNotFound(_0x126e5b,_0x404570){return function(_0x39ea9e){if(!_0x39ea9e){_0x126e5b[_0xc75c('0x1c')](0x194);}return _0x39ea9e;};}function handleError(_0x5c9d24,_0x953e48){_0x953e48=_0x953e48||0x1f4;return function(_0x4f48b4){logger[_0xc75c('0x28')](_0x4f48b4[_0xc75c('0x29')]);if(_0x4f48b4[_0xc75c('0x2a')]){delete _0x4f48b4[_0xc75c('0x2a')];}_0x5c9d24[_0xc75c('0x1d')](_0x953e48)[_0xc75c('0x2b')](_0x4f48b4);};}exports[_0xc75c('0x2c')]=function(_0x5cb391,_0x4ce154){var _0x2182b6={},_0x3d32ab={},_0x33d014={'count':0x0,'rows':[]};var _0x76851f=_['map'](db[_0xc75c('0x2d')][_0xc75c('0x2e')],function(_0x2da2a6){return{'name':_0x2da2a6['fieldName'],'type':_0x2da2a6[_0xc75c('0x2f')][_0xc75c('0x30')]};});_0x3d32ab['model']=_['map'](_0x76851f,_0xc75c('0x2a'));_0x3d32ab['query']=_['keys'](_0x5cb391[_0xc75c('0x31')]);_0x3d32ab[_0xc75c('0x32')]=_['intersection'](_0x3d32ab[_0xc75c('0x33')],_0x3d32ab[_0xc75c('0x31')]);_0x2182b6['attributes']=_[_0xc75c('0x34')](_0x3d32ab['model'],qs['fields'](_0x5cb391[_0xc75c('0x31')][_0xc75c('0x35')]));_0x2182b6[_0xc75c('0x36')]=_0x2182b6[_0xc75c('0x36')][_0xc75c('0x37')]?_0x2182b6[_0xc75c('0x36')]:_0x3d32ab[_0xc75c('0x33')];if(!_0x5cb391[_0xc75c('0x31')][_0xc75c('0x38')]('nolimit')){_0x2182b6[_0xc75c('0x21')]=qs[_0xc75c('0x21')](_0x5cb391[_0xc75c('0x31')][_0xc75c('0x21')]);_0x2182b6[_0xc75c('0x20')]=qs[_0xc75c('0x20')](_0x5cb391[_0xc75c('0x31')]['offset']);}_0x2182b6['order']=qs[_0xc75c('0x39')](_0x5cb391[_0xc75c('0x31')][_0xc75c('0x39')]);_0x2182b6[_0xc75c('0x3a')]=qs['filters'](_[_0xc75c('0x3b')](_0x5cb391['query'],_0x3d32ab['filters']),_0x76851f);if(_0x5cb391[_0xc75c('0x31')]['filter']){_0x2182b6['where']=_[_0xc75c('0x3c')](_0x2182b6[_0xc75c('0x3a')],{'$or':_['map'](_0x76851f,function(_0x1543a7){if(_0x1543a7[_0xc75c('0x2f')]!==_0xc75c('0x3d')){var _0x554b35={};_0x554b35[_0x1543a7['name']]={'$like':'%'+_0x5cb391[_0xc75c('0x31')]['filter']+'%'};return _0x554b35;}})});}_0x2182b6=_[_0xc75c('0x3c')]({},_0x2182b6,_0x5cb391['options']);var _0xe0fdb4={'where':_0x2182b6[_0xc75c('0x3a')]};return db[_0xc75c('0x2d')][_0xc75c('0x23')](_0xe0fdb4)[_0xc75c('0x27')](function(_0x56bedf){_0x33d014[_0xc75c('0x23')]=_0x56bedf;if(_0x5cb391[_0xc75c('0x31')][_0xc75c('0x3e')]){_0x2182b6[_0xc75c('0x3f')]=[{'all':!![]}];}return db[_0xc75c('0x2d')][_0xc75c('0x40')](_0x2182b6);})[_0xc75c('0x27')](function(_0x4d3e52){_0x33d014[_0xc75c('0x41')]=_0x4d3e52;return _0x33d014;})['then'](respondWithFilteredResult(_0x4ce154,_0x2182b6))['catch'](handleError(_0x4ce154,null));};exports[_0xc75c('0x42')]=function(_0x5ba0cc,_0x3b94fc){var _0x2bb279={'raw':!![],'where':{'id':_0x5ba0cc[_0xc75c('0x43')]['id']}},_0x4f5bce={};_0x4f5bce[_0xc75c('0x33')]=_['keys'](db[_0xc75c('0x2d')]['rawAttributes']);_0x4f5bce[_0xc75c('0x31')]=_[_0xc75c('0x44')](_0x5ba0cc[_0xc75c('0x31')]);_0x4f5bce['filters']=_[_0xc75c('0x34')](_0x4f5bce[_0xc75c('0x33')],_0x4f5bce[_0xc75c('0x31')]);_0x2bb279[_0xc75c('0x36')]=_[_0xc75c('0x34')](_0x4f5bce[_0xc75c('0x33')],qs[_0xc75c('0x35')](_0x5ba0cc[_0xc75c('0x31')]['fields']));_0x2bb279[_0xc75c('0x36')]=_0x2bb279[_0xc75c('0x36')][_0xc75c('0x37')]?_0x2bb279['attributes']:_0x4f5bce['model'];if(_0x5ba0cc['query'][_0xc75c('0x3e')]){_0x2bb279[_0xc75c('0x3f')]=[{'all':!![]}];}_0x2bb279=_[_0xc75c('0x3c')]({},_0x2bb279,_0x5ba0cc[_0xc75c('0x45')]);return db[_0xc75c('0x2d')][_0xc75c('0x46')](_0x2bb279)[_0xc75c('0x27')](handleEntityNotFound(_0x3b94fc,null))[_0xc75c('0x27')](respondWithResult(_0x3b94fc,null))[_0xc75c('0x47')](handleError(_0x3b94fc,null));};exports[_0xc75c('0x48')]=function(_0x271b05,_0x4c533a){return db[_0xc75c('0x2d')][_0xc75c('0x48')](_0x271b05['body'],{})[_0xc75c('0x27')](respondWithResult(_0x4c533a,0xc9))[_0xc75c('0x47')](handleError(_0x4c533a,null));};exports[_0xc75c('0x26')]=function(_0x30f133,_0x36428b){if(_0x30f133[_0xc75c('0x49')]['id']){delete _0x30f133[_0xc75c('0x49')]['id'];}return db[_0xc75c('0x2d')]['find']({'where':{'id':_0x30f133[_0xc75c('0x43')]['id']}})['then'](handleEntityNotFound(_0x36428b,null))[_0xc75c('0x27')](saveUpdates(_0x30f133[_0xc75c('0x49')],null))[_0xc75c('0x27')](respondWithResult(_0x36428b,null))[_0xc75c('0x47')](handleError(_0x36428b,null));};exports['destroy']=function(_0x4c7a7b,_0x3f9ff9){return db['ChatGroup'][_0xc75c('0x46')]({'where':{'id':_0x4c7a7b[_0xc75c('0x43')]['id']}})[_0xc75c('0x27')](handleEntityNotFound(_0x3f9ff9,null))[_0xc75c('0x27')](removeEntity(_0x3f9ff9,null))[_0xc75c('0x47')](handleError(_0x3f9ff9,null));};exports['describe']=function(_0x6f582c,_0x219ecf){return db[_0xc75c('0x2d')][_0xc75c('0x4a')]()[_0xc75c('0x27')](respondWithResult(_0x219ecf,null))['catch'](handleError(_0x219ecf,null));};exports['getUnread']=function(_0x1c6607,_0x584b0d,_0xb433e0){return db['ChatInternalMessage'][_0xc75c('0x23')]({'where':{'ChatGroupId':_0x1c6607[_0xc75c('0x43')]['id'],'ToId':_0x1c6607[_0xc75c('0x4b')]['id'],'read':![]}})[_0xc75c('0x27')](function(_0xf37ada){return{'id':_[_0xc75c('0x4c')](_0x1c6607[_0xc75c('0x43')]['id']),'count':_0xf37ada};})['then'](respondWithResult(_0x584b0d,null))[_0xc75c('0x47')](handleError(_0x584b0d,null));};exports[_0xc75c('0x4d')]=function(_0x4f28d4,_0x17969b,_0x2c9da4){return db[_0xc75c('0x2d')][_0xc75c('0x46')]({'where':{'id':_0x4f28d4[_0xc75c('0x43')]['id']}})[_0xc75c('0x27')](handleEntityNotFound(_0x17969b,null))[_0xc75c('0x27')](function(_0x280b09){if(_0x280b09){return _0x280b09['addMembers'](_0x4f28d4[_0xc75c('0x49')][_0xc75c('0x4e')],_[_0xc75c('0x4f')](_0x4f28d4[_0xc75c('0x49')],[_0xc75c('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x17969b,null))[_0xc75c('0x47')](handleError(_0x17969b,null));};exports['getMembers']=function(_0x3219a2,_0x238ed5,_0x5a6f5e){var _0x599671={};var _0x14bcb9={};var _0x304387;var _0x224a96;return db['ChatGroup'][_0xc75c('0x50')]({'where':{'id':_0x3219a2[_0xc75c('0x43')]['id']}})['then'](handleEntityNotFound(_0x238ed5,null))['then'](function(_0x34280b){if(_0x34280b){_0x304387=_0x34280b;_0x14bcb9[_0xc75c('0x33')]=_[_0xc75c('0x44')](db[_0xc75c('0x51')][_0xc75c('0x2e')]);_0x14bcb9[_0xc75c('0x31')]=_[_0xc75c('0x44')](_0x3219a2['query']);_0x14bcb9[_0xc75c('0x32')]=_[_0xc75c('0x34')](_0x14bcb9[_0xc75c('0x33')],_0x14bcb9[_0xc75c('0x31')]);_0x599671[_0xc75c('0x36')]=_[_0xc75c('0x34')](_0x14bcb9['model'],qs['fields'](_0x3219a2[_0xc75c('0x31')]['fields']));_0x599671[_0xc75c('0x36')]=_0x599671[_0xc75c('0x36')][_0xc75c('0x37')]?_0x599671[_0xc75c('0x36')]:_0x14bcb9[_0xc75c('0x33')];_0x599671[_0xc75c('0x52')]=qs['sort'](_0x3219a2[_0xc75c('0x31')][_0xc75c('0x39')]);_0x599671[_0xc75c('0x3a')]=qs['filters'](_[_0xc75c('0x3b')](_0x3219a2[_0xc75c('0x31')],_0x14bcb9[_0xc75c('0x32')]));if(_0x3219a2[_0xc75c('0x31')][_0xc75c('0x53')]){_0x599671[_0xc75c('0x3a')]=_['merge'](_0x599671[_0xc75c('0x3a')],{'$or':_[_0xc75c('0x54')](_0x599671[_0xc75c('0x36')],function(_0x33e1af){var _0x277708={};_0x277708[_0x33e1af]={'$like':'%'+_0x3219a2[_0xc75c('0x31')][_0xc75c('0x53')]+'%'};return _0x277708;})});}_0x599671=_[_0xc75c('0x3c')]({},_0x599671,_0x3219a2[_0xc75c('0x45')]);return _0x304387['getMembers'](_0x599671);}})['then'](function(_0x16402b){if(_0x16402b){_0x224a96=_0x16402b[_0xc75c('0x37')];if(!_0x3219a2[_0xc75c('0x31')][_0xc75c('0x38')](_0xc75c('0x55'))){_0x599671[_0xc75c('0x21')]=qs[_0xc75c('0x21')](_0x3219a2['query'][_0xc75c('0x21')]);_0x599671[_0xc75c('0x20')]=qs[_0xc75c('0x20')](_0x3219a2[_0xc75c('0x31')]['offset']);}return _0x304387[_0xc75c('0x56')](_0x599671);}})[_0xc75c('0x27')](function(_0x22a620){if(_0x22a620){return _0x22a620?{'count':_0x224a96,'rows':_0x22a620}:null;}})[_0xc75c('0x27')](respondWithResult(_0x238ed5,null))['catch'](handleError(_0x238ed5,null));};exports[_0xc75c('0x57')]=function(_0xc73ecc,_0x3e2170,_0x31c9ec){return db['ChatGroup']['find']({'where':{'id':_0xc73ecc[_0xc75c('0x43')]['id']}})[_0xc75c('0x27')](handleEntityNotFound(_0x3e2170,null))[_0xc75c('0x27')](function(_0x4fcb1e){if(_0x4fcb1e){return _0x4fcb1e['removeMembers'](_0xc73ecc[_0xc75c('0x31')][_0xc75c('0x4e')]);}})[_0xc75c('0x27')](respondWithStatusCode(_0x3e2170,null))[_0xc75c('0x47')](handleError(_0x3e2170,null));};exports[_0xc75c('0x58')]=function(_0x203df8,_0x123022,_0x445663){if(_0x203df8[_0xc75c('0x49')]['id']){delete _0x203df8[_0xc75c('0x49')]['id'];}return db[_0xc75c('0x2d')][_0xc75c('0x46')]({'where':{'id':_0x203df8['params']['id']}})['then'](handleEntityNotFound(_0x123022,null))[_0xc75c('0x27')](function(_0x361340){if(_0x361340){_0x203df8[_0xc75c('0x49')]['ChatGroupId']=_0x361340['id'];return db[_0xc75c('0x59')][_0xc75c('0x48')](_0x203df8[_0xc75c('0x49')]);}})['then'](respondWithResult(_0x123022,null))[_0xc75c('0x47')](handleError(_0x123022,null));};exports[_0xc75c('0x5a')]=function(_0x2cd00a,_0x44f7e1,_0x3d6c5d){var _0x2da80f={};var _0x2e70aa={};var _0x38b3bd;var _0x535f97;return db[_0xc75c('0x2d')][_0xc75c('0x50')]({'where':{'id':_0x2cd00a[_0xc75c('0x43')]['id']}})[_0xc75c('0x27')](handleEntityNotFound(_0x44f7e1,null))['then'](function(_0x3ecbcc){if(_0x3ecbcc){_0x38b3bd=_0x3ecbcc;_0x2e70aa[_0xc75c('0x33')]=_['keys'](db[_0xc75c('0x59')][_0xc75c('0x2e')]);_0x2e70aa['query']=_['keys'](_0x2cd00a[_0xc75c('0x31')]);_0x2e70aa[_0xc75c('0x32')]=_['intersection'](_0x2e70aa[_0xc75c('0x33')],_0x2e70aa[_0xc75c('0x31')]);_0x2da80f['attributes']=_[_0xc75c('0x34')](_0x2e70aa['model'],qs['fields'](_0x2cd00a['query']['fields']));_0x2da80f['attributes']=_0x2da80f[_0xc75c('0x36')]['length']?_0x2da80f[_0xc75c('0x36')]:_0x2e70aa[_0xc75c('0x33')];_0x2da80f[_0xc75c('0x52')]=qs[_0xc75c('0x39')](_0x2cd00a[_0xc75c('0x31')][_0xc75c('0x39')]);_0x2da80f['where']=qs[_0xc75c('0x32')](_[_0xc75c('0x3b')](_0x2cd00a[_0xc75c('0x31')],_0x2e70aa[_0xc75c('0x32')]));if(_0x2cd00a['query'][_0xc75c('0x53')]){_0x2da80f[_0xc75c('0x3a')]=_[_0xc75c('0x3c')](_0x2da80f[_0xc75c('0x3a')],{'$or':_[_0xc75c('0x54')](_0x2da80f['attributes'],function(_0x2b045c){var _0x86699a={};_0x86699a[_0x2b045c]={'$like':'%'+_0x2cd00a[_0xc75c('0x31')][_0xc75c('0x53')]+'%'};return _0x86699a;})});}if(_0x2cd00a[_0xc75c('0x31')][_0xc75c('0x5b')]){var _0x5ca44d=_0x2cd00a[_0xc75c('0x31')][_0xc75c('0x5b')][_0xc75c('0x5c')](',');var _0x1b6314={};_0x1b6314[_0x5ca44d[0x0]]={'$gte':moment(_0x5ca44d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2da80f['where']=_[_0xc75c('0x3c')](_0x2da80f[_0xc75c('0x3a')],_0x1b6314);}_0x2da80f=_[_0xc75c('0x3c')]({},_0x2da80f,_0x2cd00a['options']);return _0x38b3bd['getMessages'](_0x2da80f);}})['then'](function(_0xf95d4f){if(_0xf95d4f){_0x535f97=_0xf95d4f[_0xc75c('0x37')];if(!_0x2cd00a[_0xc75c('0x31')]['hasOwnProperty'](_0xc75c('0x55'))){_0x2da80f[_0xc75c('0x21')]=qs[_0xc75c('0x21')](_0x2cd00a[_0xc75c('0x31')]['limit']);_0x2da80f[_0xc75c('0x20')]=qs[_0xc75c('0x20')](_0x2cd00a['query'][_0xc75c('0x20')]);}return _0x38b3bd['getMessages'](_0x2da80f);}})['then'](function(_0x59be8f){if(_0x59be8f){return _0x59be8f?{'count':_0x535f97,'rows':_0x59be8f}:null;}})[_0xc75c('0x27')](respondWithResult(_0x44f7e1,null))[_0xc75c('0x47')](handleError(_0x44f7e1,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index cdb1098..c6b7f32 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe6e9=['../../mysqldb','ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xe6e9,0x182));var _0x9e6e=function(_0x1139d9,_0x491c72){_0x1139d9=_0x1139d9-0x0;var _0x4b3e83=_0xe6e9[_0x1139d9];return _0x4b3e83;};'use strict';var EventEmitter=require(_0x9e6e('0x0'));var ChatGroup=require(_0x9e6e('0x1'))['db'][_0x9e6e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e6e('0x3'),'afterUpdate':_0x9e6e('0x4'),'afterDestroy':_0x9e6e('0x5')};function emitEvent(_0x3313dc){return function(_0x1f6d79,_0x5f4c0b,_0x1f64e8){ChatGroupEvents[_0x9e6e('0x6')](_0x3313dc+':'+_0x1f6d79['id'],_0x1f6d79);ChatGroupEvents[_0x9e6e('0x6')](_0x3313dc,_0x1f6d79);_0x1f64e8(null);};}for(var e in events){if(events[_0x9e6e('0x7')](e)){var event=events[e];ChatGroup[_0x9e6e('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xa1c4=['../../mysqldb','ChatGroup','update','remove','emit','hook','exports','events'];(function(_0x156f94,_0x30a889){var _0x1c99f6=function(_0x11bc81){while(--_0x11bc81){_0x156f94['push'](_0x156f94['shift']());}};_0x1c99f6(++_0x30a889);}(_0xa1c4,0xdf));var _0x4a1c=function(_0x9166ea,_0x1f21b0){_0x9166ea=_0x9166ea-0x0;var _0xdceec9=_0xa1c4[_0x9166ea];return _0xdceec9;};'use strict';var EventEmitter=require(_0x4a1c('0x0'));var ChatGroup=require(_0x4a1c('0x1'))['db'][_0x4a1c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a1c('0x3'),'afterDestroy':_0x4a1c('0x4')};function emitEvent(_0x15e86e){return function(_0x384234,_0xb3069f,_0x3f5c46){ChatGroupEvents[_0x4a1c('0x5')](_0x15e86e+':'+_0x384234['id'],_0x384234);ChatGroupEvents[_0x4a1c('0x5')](_0x15e86e,_0x384234);_0x3f5c46(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4a1c('0x6')](e,emitEvent(event));}}module[_0x4a1c('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 2bc0bda..7810f4c 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b42=['ChatGroup','chat_groups','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x12d0a3,_0x6081a3){var _0x49350b=function(_0x198567){while(--_0x198567){_0x12d0a3['push'](_0x12d0a3['shift']());}};_0x49350b(++_0x6081a3);}(_0x8b42,0x162));var _0x28b4=function(_0x43b56e,_0x3627c0){_0x43b56e=_0x43b56e-0x0;var _0x1d5881=_0x8b42[_0x43b56e];return _0x1d5881;};'use strict';var _=require(_0x28b4('0x0'));var util=require('util');var logger=require(_0x28b4('0x1'))(_0x28b4('0x2'));var moment=require(_0x28b4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x28b4('0x4'));var rimraf=require(_0x28b4('0x5'));var config=require(_0x28b4('0x6'));var attributes=require(_0x28b4('0x7'));module[_0x28b4('0x8')]=function(_0xf0e7d5,_0x417e86){return _0xf0e7d5['define'](_0x28b4('0x9'),attributes,{'tableName':_0x28b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcae3=['bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0xcae3,0x16f));var _0x3cae=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcae3[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x3cae('0x0'));var util=require(_0x3cae('0x1'));var logger=require(_0x3cae('0x2'))(_0x3cae('0x3'));var moment=require(_0x3cae('0x4'));var BPromise=require(_0x3cae('0x5'));var rp=require(_0x3cae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cae('0x7'));var config=require(_0x3cae('0x8'));var attributes=require(_0x3cae('0x9'));module['exports']=function(_0x398a7b,_0x17b983){return _0x398a7b['define'](_0x3cae('0xa'),attributes,{'tableName':_0x3cae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index c7122a1..4da71af 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe50e=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xe50e,0xf9));var _0xee50=function(_0xa542fd,_0x4a66cb){_0xa542fd=_0xa542fd-0x0;var _0x42d1dc=_0xe50e[_0xa542fd];return _0x42d1dc;};'use strict';var _=require(_0xee50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee50('0x1'));var fs=require('fs');var Redis=require(_0xee50('0x2'));var db=require(_0xee50('0x3'))['db'];var utils=require(_0xee50('0x4'));var logger=require(_0xee50('0x5'))(_0xee50('0x6'));var config=require(_0xee50('0x7'));var jayson=require(_0xee50('0x8'));var client=jayson[_0xee50('0x9')][_0xee50('0xa')]({'port':0x232a});config[_0xee50('0xb')]=_[_0xee50('0xc')](config[_0xee50('0xb')],{'host':_0xee50('0xd'),'port':0x18eb});var socket=require(_0xee50('0xe'))(new Redis(config[_0xee50('0xb')]));require(_0xee50('0xf'))[_0xee50('0x10')](socket);function respondWithRpcPromise(_0x2cd326,_0x385e89,_0x5c7734){return new BPromise(function(_0x527d89,_0xff8ad7){return client[_0xee50('0x11')](_0x2cd326,_0x5c7734)[_0xee50('0x12')](function(_0x32c855){logger[_0xee50('0x13')]('ChatGroup,\x20%s,\x20%s',_0x385e89,_0xee50('0x14'));logger[_0xee50('0x15')](_0xee50('0x16'),_0x385e89,_0xee50('0x14'),JSON[_0xee50('0x17')](_0x32c855));if(_0x32c855[_0xee50('0x18')]){if(_0x32c855[_0xee50('0x18')][_0xee50('0x19')]===0x1f4){logger['error'](_0xee50('0x1a'),_0x385e89,_0x32c855[_0xee50('0x18')][_0xee50('0x1b')]);return _0xff8ad7(_0x32c855[_0xee50('0x18')]['message']);}logger[_0xee50('0x18')](_0xee50('0x1a'),_0x385e89,_0x32c855[_0xee50('0x18')][_0xee50('0x1b')]);return _0x527d89(_0x32c855['error'][_0xee50('0x1b')]);}else{logger[_0xee50('0x13')](_0xee50('0x1a'),_0x385e89,_0xee50('0x14'));_0x527d89(_0x32c855[_0xee50('0x1c')][_0xee50('0x1b')]);}})['catch'](function(_0x4080ba){logger[_0xee50('0x18')](_0xee50('0x1a'),_0x385e89,_0x4080ba);_0xff8ad7(_0x4080ba);});});}
\ No newline at end of file
+var _0x761e=['request','ChatGroup,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0x2af277,_0x115d8b){var _0x45db57=function(_0x2d6c4a){while(--_0x2d6c4a){_0x2af277['push'](_0x2af277['shift']());}};_0x45db57(++_0x115d8b);}(_0x761e,0x14e));var _0xe761=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x761e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe761('0x0'));var util=require(_0xe761('0x1'));var moment=require(_0xe761('0x2'));var BPromise=require(_0xe761('0x3'));var rs=require(_0xe761('0x4'));var fs=require('fs');var Redis=require(_0xe761('0x5'));var db=require(_0xe761('0x6'))['db'];var utils=require(_0xe761('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe761('0x8'));var jayson=require(_0xe761('0x9'));var client=jayson['client'][_0xe761('0xa')]({'port':0x232a});config[_0xe761('0xb')]=_[_0xe761('0xc')](config[_0xe761('0xb')],{'host':_0xe761('0xd'),'port':0x18eb});var socket=require(_0xe761('0xe'))(new Redis(config['redis']));require(_0xe761('0xf'))[_0xe761('0x10')](socket);function respondWithRpcPromise(_0x4c70f8,_0x273e08,_0x356c8e){return new BPromise(function(_0xa686fb,_0x2a35be){return client[_0xe761('0x11')](_0x4c70f8,_0x356c8e)['then'](function(_0x11b63f){logger['info'](_0xe761('0x12'),_0x273e08,'request\x20sent');logger[_0xe761('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x273e08,'request\x20sent',JSON[_0xe761('0x14')](_0x11b63f));if(_0x11b63f[_0xe761('0x15')]){if(_0x11b63f[_0xe761('0x15')][_0xe761('0x16')]===0x1f4){logger[_0xe761('0x15')](_0xe761('0x12'),_0x273e08,_0x11b63f[_0xe761('0x15')][_0xe761('0x17')]);return _0x2a35be(_0x11b63f['error']['message']);}logger[_0xe761('0x15')](_0xe761('0x12'),_0x273e08,_0x11b63f['error'][_0xe761('0x17')]);return _0xa686fb(_0x11b63f[_0xe761('0x15')][_0xe761('0x17')]);}else{logger['info'](_0xe761('0x12'),_0x273e08,_0xe761('0x18'));_0xa686fb(_0x11b63f[_0xe761('0x19')][_0xe761('0x17')]);}})[_0xe761('0x1a')](function(_0x3ff6c9){logger['error'](_0xe761('0x12'),_0x273e08,_0x3ff6c9);_0x2a35be(_0x3ff6c9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 634deca..a11f921 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc35c=['chatGroup:','./chatGroup.events','save','remove','update','emit','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc35c,0x12e));var _0xcc35=function(_0x119e0f,_0x1317fb){_0x119e0f=_0x119e0f-0x0;var _0x30e8d0=_0xc35c[_0x119e0f];return _0x30e8d0;};'use strict';var ChatGroupEvents=require(_0xcc35('0x0'));var events=[_0xcc35('0x1'),_0xcc35('0x2'),_0xcc35('0x3')];function createListener(_0xf30d28,_0x5a11cf){return function(_0x46aa6a){_0x5a11cf[_0xcc35('0x4')](_0xf30d28,_0x46aa6a);};}function removeListener(_0xeeaa3d,_0x3ef413){return function(){ChatGroupEvents['removeListener'](_0xeeaa3d,_0x3ef413);};}exports['register']=function(_0x2f0840){for(var _0x450a73=0x0,_0x964e26=events[_0xcc35('0x5')];_0x450a73<_0x964e26;_0x450a73++){var _0x266041=events[_0x450a73];var _0x43500d=createListener(_0xcc35('0x6')+_0x266041,_0x2f0840);ChatGroupEvents['on'](_0x266041,_0x43500d);}};
\ No newline at end of file
+var _0xe420=['./chatGroup.events','remove','update','emit','removeListener','length','chatGroup:'];(function(_0x3607cc,_0x4f7201){var _0x582eea=function(_0x23e4f8){while(--_0x23e4f8){_0x3607cc['push'](_0x3607cc['shift']());}};_0x582eea(++_0x4f7201);}(_0xe420,0x149));var _0x0e42=function(_0x32c369,_0x4677bc){_0x32c369=_0x32c369-0x0;var _0x44c4d6=_0xe420[_0x32c369];return _0x44c4d6;};'use strict';var ChatGroupEvents=require(_0x0e42('0x0'));var events=['save',_0x0e42('0x1'),_0x0e42('0x2')];function createListener(_0x49ed93,_0x11835c){return function(_0x1a28b7){_0x11835c[_0x0e42('0x3')](_0x49ed93,_0x1a28b7);};}function removeListener(_0x4eb45c,_0x232019){return function(){ChatGroupEvents[_0x0e42('0x4')](_0x4eb45c,_0x232019);};}exports['register']=function(_0x4305c3){for(var _0x5afb6a=0x0,_0x236587=events[_0x0e42('0x5')];_0x5afb6a<_0x236587;_0x5afb6a++){var _0x31297e=events[_0x5afb6a];var _0x268093=createListener(_0x0e42('0x6')+_0x31297e,_0x4305c3);ChatGroupEvents['on'](_0x31297e,_0x268093);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 9ee6239..b4143a1 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c9e=['put','update','delete','destroy','removeMembers','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers'];(function(_0x41a521,_0x28ed87){var _0x381b21=function(_0x12addc){while(--_0x12addc){_0x41a521['push'](_0x41a521['shift']());}};_0x381b21(++_0x28ed87);}(_0x5c9e,0x1c5));var _0xe5c9=function(_0x3cc160,_0x2f7c34){_0x3cc160=_0x3cc160-0x0;var _0x283080=_0x5c9e[_0x3cc160];return _0x283080;};'use strict';var multer=require('multer');var util=require(_0xe5c9('0x0'));var path=require(_0xe5c9('0x1'));var timeout=require(_0xe5c9('0x2'));var express=require('express');var router=express[_0xe5c9('0x3')]();var fs_extra=require(_0xe5c9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe5c9('0x5'));var config=require(_0xe5c9('0x6'));var controller=require(_0xe5c9('0x7'));router[_0xe5c9('0x8')]('/',auth[_0xe5c9('0x9')](),controller[_0xe5c9('0xa')]);router[_0xe5c9('0x8')](_0xe5c9('0xb'),auth[_0xe5c9('0x9')](),controller[_0xe5c9('0xc')]);router[_0xe5c9('0x8')](_0xe5c9('0xd'),auth[_0xe5c9('0x9')](),controller[_0xe5c9('0xe')]);router['get'](_0xe5c9('0xf'),auth['isAuthenticated'](),controller[_0xe5c9('0x10')]);router[_0xe5c9('0x8')](_0xe5c9('0x11'),auth[_0xe5c9('0x9')](),controller[_0xe5c9('0x12')]);router[_0xe5c9('0x8')](_0xe5c9('0x13'),auth[_0xe5c9('0x9')](),controller['getMessages']);router[_0xe5c9('0x14')]('/',auth[_0xe5c9('0x9')](),controller[_0xe5c9('0x15')]);router[_0xe5c9('0x14')](_0xe5c9('0x11'),auth[_0xe5c9('0x9')](),controller[_0xe5c9('0x16')]);router[_0xe5c9('0x14')](_0xe5c9('0x13'),auth[_0xe5c9('0x9')](),controller['addMessage']);router[_0xe5c9('0x17')]('/:id',auth[_0xe5c9('0x9')](),controller[_0xe5c9('0x18')]);router[_0xe5c9('0x19')](_0xe5c9('0xd'),auth['isAuthenticated'](),controller[_0xe5c9('0x1a')]);router[_0xe5c9('0x19')]('/:id/members',auth['isAuthenticated'](),controller[_0xe5c9('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xfe80=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put'];(function(_0x255e37,_0x2e88c1){var _0x3db766=function(_0x254339){while(--_0x254339){_0x255e37['push'](_0x255e37['shift']());}};_0x3db766(++_0x2e88c1);}(_0xfe80,0x19a));var _0x0fe8=function(_0x15b420,_0x5c9e68){_0x15b420=_0x15b420-0x0;var _0x2c1a30=_0xfe80[_0x15b420];return _0x2c1a30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0fe8('0x0'));var timeout=require(_0x0fe8('0x1'));var express=require(_0x0fe8('0x2'));var router=express[_0x0fe8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0fe8('0x4'));var interaction=require(_0x0fe8('0x5'));var config=require(_0x0fe8('0x6'));var controller=require(_0x0fe8('0x7'));router[_0x0fe8('0x8')]('/',auth[_0x0fe8('0x9')](),controller[_0x0fe8('0xa')]);router[_0x0fe8('0x8')](_0x0fe8('0xb'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0xc')]);router[_0x0fe8('0x8')](_0x0fe8('0xd'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0xe')]);router['get'](_0x0fe8('0xf'),auth['isAuthenticated'](),controller[_0x0fe8('0x10')]);router[_0x0fe8('0x8')](_0x0fe8('0x11'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0x12')]);router[_0x0fe8('0x8')](_0x0fe8('0x13'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0x14')]);router[_0x0fe8('0x15')]('/',auth[_0x0fe8('0x9')](),controller['create']);router[_0x0fe8('0x15')](_0x0fe8('0x11'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0x16')]);router[_0x0fe8('0x15')](_0x0fe8('0x13'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0x17')]);router[_0x0fe8('0x18')](_0x0fe8('0xd'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0x19')]);router[_0x0fe8('0x1a')](_0x0fe8('0xd'),auth[_0x0fe8('0x9')](),controller[_0x0fe8('0x1b')]);router[_0x0fe8('0x1a')](_0x0fe8('0x11'),auth[_0x0fe8('0x9')](),controller['removeMembers']);module[_0x0fe8('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e1dd325..93d1cea 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fd9=['long','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE'];(function(_0x324d02,_0x6d9c0b){var _0x3d4f59=function(_0x279f6b){while(--_0x279f6b){_0x324d02['push'](_0x324d02['shift']());}};_0x3d4f59(++_0x6d9c0b);}(_0x0fd9,0xa3));var _0x90fd=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0fd9[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'closed':{'type':Sequelize[_0x90fd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x90fd('0x2')]},'ratingType':{'type':Sequelize[_0x90fd('0x3')]('star','thumb'),'defaultValue':_0x90fd('0x4')},'ratingMessage':{'type':Sequelize[_0x90fd('0x5')]},'pathTranscript':{'type':Sequelize[_0x90fd('0x5')]},'mailTranscript':{'type':Sequelize[_0x90fd('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x90fd('0x7')]},'disposition':{'type':Sequelize[_0x90fd('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x90fd('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x90fd('0x6')]},'osVersion':{'type':Sequelize[_0x90fd('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x90fd('0x6')]},'deviceType':{'type':Sequelize[_0x90fd('0x6')]},'referer':{'type':Sequelize[_0x90fd('0x5')]},'customerIp':{'type':Sequelize[_0x90fd('0x6')]},'formData':{'type':Sequelize[_0x90fd('0x5')](_0x90fd('0x8'))},'read1stAt':{'type':Sequelize[_0x90fd('0x7')]},'lastMsgAt':{'type':Sequelize[_0x90fd('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x90fd('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x90fd('0x6')]},'customerPort':{'type':Sequelize[_0x90fd('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x90fd('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x757a=['thumb','star','TEXT','STRING','DATE','long','exports','BOOLEAN'];(function(_0x3c139d,_0x3144fe){var _0x4eb03d=function(_0x76936b){while(--_0x76936b){_0x3c139d['push'](_0x3c139d['shift']());}};_0x4eb03d(++_0x3144fe);}(_0x757a,0xde));var _0xa757=function(_0x236f07,_0x5cbe2f){_0x236f07=_0x236f07-0x0;var _0x1d5b5c=_0x757a[_0x236f07];return _0x1d5b5c;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'closed':{'type':Sequelize[_0xa757('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0xa757('0x2')),'defaultValue':_0xa757('0x3')},'ratingMessage':{'type':Sequelize[_0xa757('0x4')]},'pathTranscript':{'type':Sequelize[_0xa757('0x4')]},'mailTranscript':{'type':Sequelize[_0xa757('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa757('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa757('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa757('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa757('0x5')]},'browserVersion':{'type':Sequelize[_0xa757('0x5')]},'osName':{'type':Sequelize[_0xa757('0x5')]},'osVersion':{'type':Sequelize[_0xa757('0x5')]},'deviceModel':{'type':Sequelize[_0xa757('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa757('0x5')]},'referer':{'type':Sequelize[_0xa757('0x4')]},'customerIp':{'type':Sequelize[_0xa757('0x5')]},'formData':{'type':Sequelize[_0xa757('0x4')](_0xa757('0x7'))},'read1stAt':{'type':Sequelize[_0xa757('0x6')]},'lastMsgAt':{'type':Sequelize[_0xa757('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa757('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 827fcf8..e929fde 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f0d=['CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','createdAt','direction','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','squel','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','send','render','body','agent','interaction','account','Users','TagIds','Tags','forEach','waiting','talking','answered','abandoned','total','closed','UserId','disposition','map','rawAttributes','key','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','select','field','from','u.fullname','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','length','unreadMessages','having','`\x20=\x200','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','ChatInteraction','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','include','merge','options','find','create','params','describe','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','fullname','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages'];(function(_0x5e8573,_0x401ee1){var _0x3a744a=function(_0x31f4d7){while(--_0x31f4d7){_0x5e8573['push'](_0x5e8573['shift']());}};_0x3a744a(++_0x401ee1);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x45b402,_0x42f7ff){_0x45b402=_0x45b402-0x0;var _0x5a816f=_0x6f0d[_0x45b402];return _0x5a816f;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd6f0('0x0'));var rp=require(_0xd6f0('0x1'));var moment=require(_0xd6f0('0x2'));var BPromise=require(_0xd6f0('0x3'));var Mustache=require('mustache');var util=require(_0xd6f0('0x4'));var path=require(_0xd6f0('0x5'));var ejs=require(_0xd6f0('0x6'));var fs=require('fs');var _=require(_0xd6f0('0x7'));var squel=require(_0xd6f0('0x8'));var Redis=require('ioredis');var qs=require(_0xd6f0('0x9'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xd6f0('0xa'));var logger=require(_0xd6f0('0xb'))(_0xd6f0('0xc'));var config=require(_0xd6f0('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd6f0('0xe')](config[_0xd6f0('0xf')],{'host':_0xd6f0('0x10'),'port':0x18eb});var socket=require(_0xd6f0('0x11'))(new Redis(config[_0xd6f0('0xf')]));require('./chatInteraction.socket')[_0xd6f0('0x12')](socket);var jayson=require(_0xd6f0('0x13'));var client=jayson[_0xd6f0('0x14')][_0xd6f0('0x15')]({'port':0x232b});var client9004=jayson['client'][_0xd6f0('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2f0459,_0x306aad,_0x45973d,_0x109655){return new BPromise(function(_0x409549,_0x2bf5b8){var _0x250999=_0x109655||client;return _0x250999[_0xd6f0('0x16')](_0x2f0459,_0x45973d)['then'](function(_0x2b3f32){logger[_0xd6f0('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x306aad,_0xd6f0('0x18'));logger['debug'](_0xd6f0('0x19'),_0x306aad,_0xd6f0('0x18'),JSON[_0xd6f0('0x1a')](_0x2b3f32));if(_0x2b3f32[_0xd6f0('0x1b')]){if(_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1c')]===0x1f4){logger[_0xd6f0('0x1b')](_0xd6f0('0x1d'),_0x306aad,_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1e')]);return _0x2bf5b8(_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1e')]);}logger[_0xd6f0('0x1b')](_0xd6f0('0x1d'),_0x306aad,_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1e')]);return _0x409549(_0x2b3f32['error']['message']);}else{logger[_0xd6f0('0x17')](_0xd6f0('0x1d'),_0x306aad,_0xd6f0('0x18'));_0x409549(_0x2b3f32['result'][_0xd6f0('0x1e')]);}})[_0xd6f0('0x1f')](function(_0x557c9b){logger[_0xd6f0('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x306aad,_0x557c9b);_0x2bf5b8(_0x557c9b);});});}function respondWithStatusCode(_0x1ee584,_0x1c9d90){_0x1c9d90=_0x1c9d90||0xcc;return function(_0x5dbe1c){if(_0x5dbe1c){return _0x1ee584[_0xd6f0('0x20')](_0x1c9d90);}return _0x1ee584[_0xd6f0('0x21')](_0x1c9d90)['end']();};}function respondWithResult(_0x3dbdc3,_0x402070){_0x402070=_0x402070||0xc8;return function(_0x283a07){if(_0x283a07){return _0x3dbdc3['status'](_0x402070)[_0xd6f0('0x22')](_0x283a07);}};}function respondWithFilteredResult(_0x3dc166,_0x5ecb16){return function(_0xcea0ae){if(_0xcea0ae){var _0x551be8=typeof _0x5ecb16[_0xd6f0('0x23')]===_0xd6f0('0x24')&&typeof _0x5ecb16[_0xd6f0('0x25')]===_0xd6f0('0x24');var _0x4101bd=_0xcea0ae[_0xd6f0('0x26')];var _0x12d6ec=_0x551be8?0x0:_0x5ecb16[_0xd6f0('0x23')];var _0x48975d=_0x551be8?_0xcea0ae[_0xd6f0('0x26')]:_0x5ecb16[_0xd6f0('0x23')]+_0x5ecb16['limit'];var _0x38a3e9;if(_0x48975d>=_0x4101bd){_0x48975d=_0x4101bd;_0x38a3e9=0xc8;}else{_0x38a3e9=0xce;}_0x3dc166[_0xd6f0('0x21')](_0x38a3e9);return _0x3dc166[_0xd6f0('0x27')](_0xd6f0('0x28'),_0x12d6ec+'-'+_0x48975d+'/'+_0x4101bd)[_0xd6f0('0x22')](_0xcea0ae);}return null;};}function saveUpdates(_0x39e96a){return function(_0x351fda){if(_0x351fda){return _0x351fda[_0xd6f0('0x29')](_0x39e96a)[_0xd6f0('0x2a')](function(_0x43f72f){return _0x43f72f;});}return null;};}function removeEntity(_0x1dff9b){return function(_0x3e913a){if(_0x3e913a){return _0x3e913a[_0xd6f0('0x2b')]()[_0xd6f0('0x2a')](function(){_0x1dff9b[_0xd6f0('0x21')](0xcc)[_0xd6f0('0x2c')]();});}};}function handleEntityNotFound(_0x31c493){return function(_0x376890){if(!_0x376890){_0x31c493[_0xd6f0('0x20')](0x194);}return _0x376890;};}function handleError(_0x180e5f,_0x3906ca){_0x3906ca=_0x3906ca||0x1f4;return function(_0x26ab29){logger['error'](_0x26ab29[_0xd6f0('0x2d')]);if(_0x26ab29['name']){delete _0x26ab29['name'];}_0x180e5f[_0xd6f0('0x21')](_0x3906ca)[_0xd6f0('0x2e')](_0x26ab29);};}function getMustacheRender(_0x12a6fa,_0x27ad7e){return Mustache[_0xd6f0('0x2f')](_0x12a6fa,_['merge'](_0x27ad7e[_0xd6f0('0x30')],{'contact':_0x27ad7e['contact'],'message':_0x27ad7e[_0xd6f0('0x1e')],'agent':_0x27ad7e[_0xd6f0('0x31')],'interaction':_0x27ad7e[_0xd6f0('0x32')],'account':_0x27ad7e[_0xd6f0('0x33')]}))||'';}function getInteractionUsers(_0x518751,_0x5c3132){return new BPromise(function(_0x47b33d,_0x3b6463){try{if(_0x5c3132[_0x518751['id']]){_0x518751[_0xd6f0('0x34')]=_['map'](_0x5c3132[_0x518751['id']],function(_0x1d200a){return{'id':_0x1d200a['id'],'fullname':_0x1d200a['fullname']};});}}catch(_0x507f66){_0x3b6463(_0x507f66);}_0x47b33d(_0x518751);});}function getInteractionTags(_0x2fd7b8,_0x28659e){return new BPromise(function(_0x1852dd,_0x451834){try{if(_0x2fd7b8[_0xd6f0('0x35')]){_0x2fd7b8[_0xd6f0('0x36')]=[];_0x2fd7b8['TagIds']['split'](',')[_0xd6f0('0x37')](function(_0xf879a6){_0x2fd7b8[_0xd6f0('0x36')]['push'](_0x28659e[_0xf879a6]);});}delete _0x2fd7b8['TagIds'];}catch(_0x13b41d){_0x451834(_0x13b41d);}_0x1852dd(_0x2fd7b8);});}function updateChatInteraction(_0x2def01,_0x39fd07,_0x38d06f){return new BPromise(function(_0x2e3225,_0x2b5df5){return getInteractionUsers(_0x2def01,_0x38d06f)[_0xd6f0('0x2a')](function(_0x64359c){return getInteractionTags(_0x64359c,_0x39fd07);})['then'](function(_0x1af620){return getStateInteraction(_0x1af620);})[_0xd6f0('0x2a')](function(_0x1e3c8a){_0x2e3225(_0x1e3c8a);})[_0xd6f0('0x1f')](function(_0x57b83e){_0x2b5df5(_0x57b83e);});});}function getStateInteraction(_0x1981bd){return new BPromise(function(_0x94ec6d){_0x1981bd[_0xd6f0('0x38')]=0x0;_0x1981bd[_0xd6f0('0x39')]=0x0;_0x1981bd[_0xd6f0('0x3a')]=0x0;_0x1981bd['unmanaged']=0x0;_0x1981bd[_0xd6f0('0x3b')]=0x0;_0x1981bd[_0xd6f0('0x3c')]=0x0;if(!_0x1981bd[_0xd6f0('0x3d')]&&!_0x1981bd['UserId']){_0x1981bd[_0xd6f0('0x38')]+=0x1;}if(!_0x1981bd[_0xd6f0('0x3d')]&&_0x1981bd['UserId']){_0x1981bd['talking']+=0x1;if(_0x1981bd[_0xd6f0('0x38')]){_0x1981bd[_0xd6f0('0x38')]-=0x1;}}if(_0x1981bd[_0xd6f0('0x3d')]&&_0x1981bd['disposition']===_0xd6f0('0x3b')){_0x1981bd[_0xd6f0('0x3b')]+=0x1;if(_0x1981bd['waiting']){_0x1981bd[_0xd6f0('0x38')]-=0x1;}}else if(_0x1981bd[_0xd6f0('0x3d')]&&!_0x1981bd[_0xd6f0('0x3e')]&&_0x1981bd[_0xd6f0('0x3f')]){_0x1981bd['unmanaged']+=0x1;if(_0x1981bd[_0xd6f0('0x38')]){_0x1981bd[_0xd6f0('0x38')]-=0x1;}}else if(_0x1981bd[_0xd6f0('0x3d')]&&_0x1981bd[_0xd6f0('0x3e')]){_0x1981bd[_0xd6f0('0x3a')]+=0x1;if(_0x1981bd[_0xd6f0('0x39')]){_0x1981bd[_0xd6f0('0x39')]-=0x1;}}_0x1981bd[_0xd6f0('0x3c')]+=0x1;_0x94ec6d(_0x1981bd);});}exports['index']=function(_0x909f20,_0x3d42ca){var _0x55e93b={},_0x268772={},_0x39ca69={'count':0x0,'rows':[]};var _0x1bcb36=_[_0xd6f0('0x40')](db['ChatInteraction'][_0xd6f0('0x41')],function(_0xe5fd11){return{'name':_0xe5fd11['fieldName'],'type':_0xe5fd11['type'][_0xd6f0('0x42')]};});_0x268772['model']=_[_0xd6f0('0x40')](_0x1bcb36,_0xd6f0('0x43'));_0x268772[_0xd6f0('0x44')]=_['keys'](_0x909f20[_0xd6f0('0x44')]);_0x268772[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x268772[_0xd6f0('0x47')],_0x268772[_0xd6f0('0x44')]);_0x55e93b['attributes']=_[_0xd6f0('0x46')](_0x268772['model'],qs[_0xd6f0('0x48')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x48')]));_0x55e93b[_0xd6f0('0x49')]=_0x55e93b['attributes']['length']?_0x55e93b[_0xd6f0('0x49')]:_0x268772[_0xd6f0('0x47')];if(!_0x909f20['query'][_0xd6f0('0x4a')]('nolimit')){_0x55e93b[_0xd6f0('0x25')]=qs[_0xd6f0('0x25')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x25')]);_0x55e93b[_0xd6f0('0x23')]=qs['offset'](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x23')]);}_0x55e93b[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x4c')]);_0x55e93b[_0xd6f0('0x4d')]=qs[_0xd6f0('0x45')](_['pick'](_0x909f20[_0xd6f0('0x44')],_0x268772[_0xd6f0('0x45')]),_0x1bcb36);var _0x469e92=[];var _0x29509e=squel[_0xd6f0('0x4e')]()[_0xd6f0('0x4f')]('id')[_0xd6f0('0x4f')](_0xd6f0('0x43'))[_0xd6f0('0x4f')]('color')[_0xd6f0('0x50')]('tools_tags');var _0x5505fd=squel[_0xd6f0('0x4e')]()['field']('u.id')[_0xd6f0('0x4f')](_0xd6f0('0x51'))[_0xd6f0('0x4f')]('ui.ChatInteractionId')[_0xd6f0('0x50')](_0xd6f0('0x52'),'ui')[_0xd6f0('0x53')]('users','u',_0xd6f0('0x54'));var _0x357193=squel['select']()[_0xd6f0('0x50')](_0xd6f0('0x55'),'i')['left_join'](_0xd6f0('0x56'),'c',_0xd6f0('0x57'))[_0xd6f0('0x53')](_0xd6f0('0x58'),'o',_0xd6f0('0x59'))['left_join'](_0xd6f0('0x5a'),'a',_0xd6f0('0x5b'))['left_join'](_0xd6f0('0x5c'),'me',_0xd6f0('0x5d'))[_0xd6f0('0x53')]('chat_interaction_has_tags','it',_0xd6f0('0x5e'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5c5aa4=squel[_0xd6f0('0x5f')]();var _0x2876a6=[];var _0x1a8984=squel[_0xd6f0('0x5f')]();var _0x530bcc;if(_0x909f20[_0xd6f0('0x44')]['search']){_0x530bcc=as[_0xd6f0('0x60')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x61')]);var _0x50d93a=_0x530bcc[_0xd6f0('0x62')];for(var _0x31b055=0x0;_0x31b055<_0x530bcc[_0xd6f0('0x63')][_0xd6f0('0x64')];_0x31b055++){var _0x5ce01c=_0x530bcc[_0xd6f0('0x63')][_0x31b055];var _0xf673bb='i';var _0x30ae43=_['find'](_0x1bcb36,[_0xd6f0('0x43'),_0x5ce01c[_0xd6f0('0x4f')]]);if(!_0x30ae43){switch(_0x5ce01c[_0xd6f0('0x4f')]){case _0xd6f0('0x65'):if(_0x5ce01c['value']==0x1){_0x357193[_0xd6f0('0x66')]('`'+_0x5ce01c[_0xd6f0('0x4f')]+_0xd6f0('0x67'));}else{_0x357193[_0xd6f0('0x66')]('`'+_0x5ce01c['field']+'`\x20>\x200');}break;case'Contact':if(_0x5ce01c['operator']===_0xd6f0('0x68')){if(_0x5ce01c[_0xd6f0('0x69')][_0xd6f0('0x6a')]('\x20')[_0xd6f0('0x64')]>0x1){_0x5c5aa4[_0x50d93a](_0xd6f0('0x6b'),qs[_0xd6f0('0x6c')](_0x5ce01c[_0xd6f0('0x69')]),null);}else{var _0x1b298a='%'+_0x5ce01c[_0xd6f0('0x69')]+'%';_0x5c5aa4[_0x50d93a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1b298a,_0x1b298a,_0x1b298a);}}else{_0x30ae43=_['find'](_0x1bcb36,[_0xd6f0('0x43'),'ContactId']);_0x5ce01c[_0xd6f0('0x4f')]=_0xd6f0('0x6d');_0x1dc77c=as[_0xd6f0('0x6e')](_0xf673bb,_0x30ae43[_0xd6f0('0x6f')],_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x71')],_0x1dc77c['value'][_0xd6f0('0x2c')]);}break;case _0xd6f0('0x72'):var _0x40cdae=_0x5ce01c['value'][_0xd6f0('0x6a')](',')[_0xd6f0('0x40')](function(_0x4f3dd9){return Number(_0x4f3dd9);});_0x40cdae[_0xd6f0('0x37')](function(_0x80f21c){_0x1a8984['or'](_0xd6f0('0x73'),'%,'+_0x80f21c+',%');});_0x2876a6=_[_0xd6f0('0x74')](_0x2876a6,_0x40cdae);break;case _0xd6f0('0x75'):if(_0x5ce01c[_0xd6f0('0x76')]===_0xd6f0('0x68')){_0x5c5aa4[_0x50d93a](_0xd6f0('0x77'),'%'+_0x5ce01c[_0xd6f0('0x69')]+'%',null);}else{_0x30ae43=_['find'](_0x1bcb36,[_0xd6f0('0x43'),_0xd6f0('0x3e')]);_0x5ce01c[_0xd6f0('0x4f')]=_0xd6f0('0x3e');_0x1dc77c=as['buildExpression'](_0xf673bb,_0x30ae43[_0xd6f0('0x6f')],_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x71')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x2c')]);}break;case _0xd6f0('0x30'):_0x1dc77c=as[_0xd6f0('0x6e')]('me',null,_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')]['start'],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x2c')]);break;}}else{var _0x1dc77c=as['buildExpression'](_0xf673bb,_0x30ae43[_0xd6f0('0x6f')],_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x71')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x2c')]);}}}else{var _0x1c7f08=_(_0x909f20[_0xd6f0('0x44')])[_0xd6f0('0x78')]()[_0xd6f0('0x40')](function(_0x27ad68){return _['some'](_0x1bcb36,['name',_0x27ad68])?_0x27ad68:undefined;})[_0xd6f0('0x79')]()[_0xd6f0('0x69')]();if(!_[_0xd6f0('0x7a')](_0x1c7f08)){_0x1c7f08[_0xd6f0('0x37')](function(_0x1da442){if(_0x1da442==='ChatWebsiteId'){_0x357193[_0xd6f0('0x4d')](_0xd6f0('0x7b'),[]['concat'](_0x909f20[_0xd6f0('0x44')][_0x1da442]));}else if(_0x1da442==='createdAt'){var _0x458f66=JSON[_0xd6f0('0x7c')](_0x909f20[_0xd6f0('0x44')][_0x1da442])[_0xd6f0('0x7d')];var _0x391c2a=JSON['parse'](_0x909f20['query'][_0x1da442])[_0xd6f0('0x7e')];_0x357193[_0xd6f0('0x4d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x458f66,_0x391c2a);}else{if(_0x909f20[_0xd6f0('0x44')][_0x1da442]==='null'){_0x357193['where']('i.'+_0x1da442+_0xd6f0('0x7f'));}else{_0x357193['where']('i.'+_0x1da442+'\x20=\x20?',_0x909f20['query'][_0x1da442]);}}});}if(_0x909f20['query'][_0xd6f0('0x80')]){if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x80')]==0x1){_0x357193[_0xd6f0('0x66')](_0xd6f0('0x81'));}else{_0x357193[_0xd6f0('0x66')](_0xd6f0('0x82'));}}if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x83')]){_0x2876a6=_['isArray'](_0x909f20[_0xd6f0('0x44')]['tag'])?_0x909f20['query'][_0xd6f0('0x83')]:new Array(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x83')]);_0x2876a6['forEach'](function(_0x12e166){_0x1a8984['or'](_0xd6f0('0x73'),'%,'+_0x12e166+',%');});}if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x84')]){var _0x41e738=_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x84')][_0xd6f0('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd6f0('0x86')](_0x41e738)){_0x5c5aa4['or'](_0xd6f0('0x87'),_0x41e738+'%');}else{_0x5c5aa4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd6f0('0x6c')](_0x41e738))['or'](_0xd6f0('0x88'),_0x41e738+'%');}}}_0x357193[_0xd6f0('0x4d')](_0x5c5aa4);_0x357193[_0xd6f0('0x89')](_0xd6f0('0x8a'));var _0x96fc03={'type':db[_0xd6f0('0x8b')]['QueryTypes'][_0xd6f0('0x8c')],'raw':!![]};var _0x24c31d=_0x357193[_0xd6f0('0x8d')]();_0x24c31d['field']('i.id');_0x24c31d['field'](_0xd6f0('0x8e'),_0xd6f0('0x65'));if(_0x55e93b[_0xd6f0('0x4b')]){_0x55e93b[_0xd6f0('0x4b')][_0xd6f0('0x37')](function(_0x48d87d){var _0x4b5139=_0x48d87d[0x0]===_0xd6f0('0x8f')?_0x48d87d[0x0]:'i.'+_0x48d87d[0x0];_0x357193[_0xd6f0('0x4b')](_0x4b5139,_0x48d87d[0x1]===_0xd6f0('0x90')?![]:!![]);});}if(!_[_0xd6f0('0x7a')](_0x2876a6)){_0x357193['having'](_0x1a8984);_0x24c31d[_0xd6f0('0x4d')]('t.id\x20IN\x20?',_0x2876a6);}BPromise[_0xd6f0('0x91')]()['then'](function(){if(!_0x530bcc){if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x92')])return;_0x24c31d['where'](_0xd6f0('0x93'));_0x357193[_0xd6f0('0x4d')](_0xd6f0('0x93'));return;}if(_0x909f20[_0xd6f0('0x94')][_0xd6f0('0x95')]!==_0xd6f0('0x31'))return;return _0x909f20[_0xd6f0('0x94')][_0xd6f0('0x96')]({'attributes':['id'],'raw':!![]})[_0xd6f0('0x2a')](function(_0x2c277f){if(_[_0xd6f0('0x7a')](_0x2c277f)){_0x24c31d[_0xd6f0('0x4d')](_0xd6f0('0x97'));_0x357193[_0xd6f0('0x4d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24c31d[_0xd6f0('0x4d')](_0xd6f0('0x7b'),_[_0xd6f0('0x40')](_0x2c277f,'id'));_0x357193[_0xd6f0('0x4d')](_0xd6f0('0x7b'),_[_0xd6f0('0x40')](_0x2c277f,'id'));}});})[_0xd6f0('0x2a')](function(){if(_0x909f20[_0xd6f0('0x94')][_0xd6f0('0x95')]===_0xd6f0('0x31')&&!_0x530bcc&&!_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x92')])return[];return db[_0xd6f0('0x98')][_0xd6f0('0x44')](_0x24c31d['toString'](),_0x96fc03);})['then'](function(_0x2638c3){_0x39ca69[_0xd6f0('0x26')]=_0x2638c3[_0xd6f0('0x64')];if(_0x39ca69[_0xd6f0('0x26')]===0x0)return[];return db[_0xd6f0('0x98')]['query'](_0x29509e[_0xd6f0('0x99')](),_0x96fc03)[_0xd6f0('0x2a')](function(_0x2d0d8a){_0x469e92=_[_0xd6f0('0x9a')](_0x2d0d8a,'id');_0x96fc03=_['merge'](_0x96fc03,{'model':db[_0xd6f0('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x48')]){_0x55e93b[_0xd6f0('0x49')][_0xd6f0('0x37')](function(_0x229631){_0x357193['field']('i.'+_0x229631);});}else{_0x357193['field'](_0xd6f0('0x8e'),'unreadMessages');_0x357193[_0xd6f0('0x4f')]('a.key',_0xd6f0('0x9c'));_0x357193[_0xd6f0('0x4f')]('a.mandatoryDisposition',_0xd6f0('0x9d'));_0x357193['field'](_0xd6f0('0x9e'),_0xd6f0('0x8f'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0x9f'));_0x357193['field'](_0xd6f0('0xa0'),_0xd6f0('0xa1'));_0x357193[_0xd6f0('0x4f')]('c.lastName',_0xd6f0('0xa2'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xa3'),'Contact.email');_0x357193['field'](_0xd6f0('0xa4'),_0xd6f0('0xa5'));_0x357193[_0xd6f0('0x4f')]('c.mobile',_0xd6f0('0xa6'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xa7'),_0xd6f0('0xa8'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xa9'),_0xd6f0('0xaa'));_0x357193['field'](_0xd6f0('0xab'),'Owner.internal');_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xac'),_0xd6f0('0x35'));}if(_0x55e93b['limit'])_0x357193[_0xd6f0('0x25')](_0x55e93b['limit']);if(_0x55e93b['offset'])_0x357193[_0xd6f0('0x23')](_0x55e93b[_0xd6f0('0x23')]);return db[_0xd6f0('0x98')]['query'](_0x357193[_0xd6f0('0x99')](),_0x96fc03);})['then'](function(_0x51e28a){if(_0x51e28a[_0xd6f0('0x64')]>0x0)_0x5505fd[_0xd6f0('0x4d')](_0xd6f0('0xad'),_[_0xd6f0('0x40')](_0x51e28a,'id'));return db[_0xd6f0('0x98')][_0xd6f0('0x44')](_0x5505fd['toString'](),_0x96fc03)[_0xd6f0('0x2a')](function(_0x5b8770){var _0x1c07b8=_['groupBy'](_0x5b8770,_0xd6f0('0xae'));var _0x1dce9c=[];_0x51e28a['forEach'](function(_0x212920){_0x1dce9c[_0xd6f0('0xaf')](updateChatInteraction(_0x212920,_0x469e92,_0x1c07b8));});return BPromise[_0xd6f0('0xb0')](_0x1dce9c);});});})[_0xd6f0('0x2a')](function(_0x1fff48){_0x39ca69[_0xd6f0('0xb1')]=_0x1fff48;return _0x39ca69;})[_0xd6f0('0x2a')](respondWithFilteredResult(_0x3d42ca,_0x55e93b))[_0xd6f0('0x1f')](handleError(_0x3d42ca,null));};exports['show']=function(_0x25c9a8,_0x1a2390){var _0x529c3d={'raw':![],'where':{'id':_0x25c9a8['params']['id']}},_0x282736={};_0x282736[_0xd6f0('0x47')]=_[_0xd6f0('0x78')](db[_0xd6f0('0x9b')][_0xd6f0('0x41')]);_0x282736['query']=_['keys'](_0x25c9a8[_0xd6f0('0x44')]);_0x282736[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x282736[_0xd6f0('0x47')],_0x282736[_0xd6f0('0x44')]);_0x529c3d[_0xd6f0('0x49')]=_[_0xd6f0('0x46')](_0x282736['model'],qs[_0xd6f0('0x48')](_0x25c9a8[_0xd6f0('0x44')][_0xd6f0('0x48')]));_0x529c3d[_0xd6f0('0x49')]=_0x529c3d['attributes'][_0xd6f0('0x64')]?_0x529c3d['attributes']:_0x282736['model'];if(_0x25c9a8[_0xd6f0('0x44')]['includeAll']){_0x529c3d[_0xd6f0('0xb2')]=[{'all':!![]}];}_0x529c3d=_[_0xd6f0('0xb3')]({},_0x529c3d,_0x25c9a8[_0xd6f0('0xb4')]);return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')](_0x529c3d)[_0xd6f0('0x2a')](handleEntityNotFound(_0x1a2390,null))[_0xd6f0('0x2a')](respondWithResult(_0x1a2390,null))['catch'](handleError(_0x1a2390,null));};exports[_0xd6f0('0xb6')]=function(_0x11437d,_0x410185){return db['ChatInteraction'][_0xd6f0('0xb6')](_0x11437d[_0xd6f0('0x30')],{})[_0xd6f0('0x2a')](respondWithResult(_0x410185,0xc9))[_0xd6f0('0x1f')](handleError(_0x410185,null));};exports['update']=function(_0x308306,_0x4e5bb8){if(_0x308306[_0xd6f0('0x30')]['id']){delete _0x308306['body']['id'];}return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x308306[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x4e5bb8,null))[_0xd6f0('0x2a')](saveUpdates(_0x308306[_0xd6f0('0x30')],null))[_0xd6f0('0x2a')](respondWithResult(_0x4e5bb8,null))['catch'](handleError(_0x4e5bb8,null));};exports['destroy']=function(_0x12d982,_0x574ca9){return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x12d982[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x574ca9,null))[_0xd6f0('0x2a')](removeEntity(_0x574ca9,null))[_0xd6f0('0x1f')](handleError(_0x574ca9,null));};exports[_0xd6f0('0xb8')]=function(_0x83b80a,_0xb726d0){return db[_0xd6f0('0x9b')][_0xd6f0('0xb8')]()['then'](respondWithResult(_0xb726d0,null))[_0xd6f0('0x1f')](handleError(_0xb726d0,null));};exports['createVidaooSession']=function(_0x28d7e9,_0x210946){var _0x4ed3f0=_0x28d7e9[_0xd6f0('0xb7')]['id'];var _0x5b85c3;var _0x3704e6;var _0xcc9d50;return db[_0xd6f0('0x9b')][_0xd6f0('0xb9')]({'where':{'id':_0x4ed3f0}})[_0xd6f0('0x2a')](function(_0x3b4c53){_0x5b85c3=_0x3b4c53;return db[_0xd6f0('0xba')]['findOne']({'where':{'id':_0x3b4c53[_0xd6f0('0x92')]},'attributes':['id',_0xd6f0('0xbb'),'vidaooEscalation',_0xd6f0('0xbc'),'vidaooNote','vidaooMetadata'],'raw':!![]});})['then'](function(_0x461f29){if(_0x461f29&&_0x461f29[_0xd6f0('0xbb')]&&_0x461f29['vidaooEscalation']){_0x3704e6=_0x461f29;var _0x18e364={'interaction':{'id':_0x4ed3f0},'agent':{'id':_0x28d7e9[_0xd6f0('0x94')]['id'],'name':_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0x43')],'fullname':_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0xbd')],'email':_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0xbe')]},'contact':_0x28d7e9['body'][_0xd6f0('0xbf')],'account':_0x28d7e9[_0xd6f0('0x30')]['account']};var _0x360ec0={'rejectUnauthorized':![],'method':'POST','url':_0xd6f0('0xc0'),'headers':{'X-APIKEY':_0x461f29[_0xd6f0('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0xbe')]],'buttons':null,'topic':_0x3704e6['vidaooTopic'],'note':_[_0xd6f0('0xc1')](_0x3704e6['vidaooNote'])?null:getMustacheRender(_0x3704e6['vidaooNote'],_0x18e364),'metadata':null},'redirect':_0xd6f0('0xc2'),'json':!![]};try{if(!_[_0xd6f0('0xc1')](_0x3704e6[_0xd6f0('0xc3')])){var _0x5ede6b=getMustacheRender(_0x3704e6[_0xd6f0('0xc3')],_0x18e364);var _0x45283d=JSON[_0xd6f0('0x7c')](_0x5ede6b);_0x360ec0[_0xd6f0('0x30')][_0xd6f0('0xc4')]=_0x45283d;}}catch(_0x5cbab7){throw new db[(_0xd6f0('0x8b'))][(_0xd6f0('0xc5'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x360ec0);}else{throw new db[(_0xd6f0('0x8b'))]['ValidationError'](_0xd6f0('0xc6'));}})[_0xd6f0('0x2a')](function(_0x46f385){_0xcc9d50=_0x46f385;if(_0xcc9d50['id']){var _0x30f693={'body':_0xcc9d50[_0xd6f0('0xc7')],'ChatWebsiteId':_0x3704e6['id'],'ChatInteractionId':_0x5b85c3['id'],'direction':_0xd6f0('0xc8'),'UserId':_0x28d7e9[_0xd6f0('0x94')]['id']};return db['ChatMessage']['create'](_0x30f693,{});}else{throw new db[(_0xd6f0('0x8b'))]['ValidationError'](_0xd6f0('0xc9'));}})[_0xd6f0('0x2a')](function(){return _0x5b85c3[_0xd6f0('0xca')]({'vidaooSessionId':_0xcc9d50['id']});})['then'](respondWithResult(_0x210946,null))[_0xd6f0('0x1f')](handleError(_0x210946,null));};exports['customUpdate']=function(_0x39f781,_0x2e2fc5){if(_0x39f781['body']['id']){delete _0x39f781[_0xd6f0('0x30')]['id'];}return db[_0xd6f0('0x9b')]['find']({'where':{'id':_0x39f781['params']['id']},'include':[{'model':db['CmContact'],'as':_0xd6f0('0xcb')}]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x2e2fc5,null))[_0xd6f0('0x2a')](saveUpdates(_0x39f781[_0xd6f0('0x30')],null))[_0xd6f0('0x2a')](respondWithResult(_0x2e2fc5,null))['catch'](handleError(_0x2e2fc5,null));};exports[_0xd6f0('0xcc')]=function(_0xf4ecc,_0x1e908d){if(_0xf4ecc[_0xd6f0('0x30')]['id']){delete _0xf4ecc[_0xd6f0('0x30')]['id'];}return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0xf4ecc[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](function(_0x62d0ef){if(!_0x62d0ef){logger[_0xd6f0('0x1b')](_0xd6f0('0xcd'),_0xd6f0('0xcc'),0x194,_0xd6f0('0xce'));_0x1e908d['sendStatus'](0x194);}else{if(_0x62d0ef['UserId']){throw new db[(_0xd6f0('0x8b'))][(_0xd6f0('0xc5'))]('Interaction\x20already\x20assigned');}}return _0x62d0ef;})[_0xd6f0('0x2a')](function(_0x2f7e8f){if(_0x2f7e8f){return _0x2f7e8f[_0xd6f0('0x29')]({'closed':_0xf4ecc[_0xd6f0('0x30')][_0xd6f0('0x3d')],'disposition':_0xf4ecc[_0xd6f0('0x30')][_0xd6f0('0x3f')]})['then'](function(_0x2879b5){return _0x2879b5;});}})[_0xd6f0('0x2a')](function(){return respondWithRpcPromise(_0xd6f0('0xcf'),_0xd6f0('0xcc'),_0xf4ecc['body'],client9004);})[_0xd6f0('0x2a')](respondWithResult(_0x1e908d,null))[_0xd6f0('0x1f')](handleError(_0x1e908d,null));};exports[_0xd6f0('0xd0')]=function(_0x516f59,_0x178d6b){_0x516f59['body'][_0xd6f0('0x43')]=_0x516f59[_0xd6f0('0xd1')][_0xd6f0('0xd2')];_0x516f59[_0xd6f0('0x30')][_0xd6f0('0xd3')]=_0x516f59[_0xd6f0('0xd1')][_0xd6f0('0xd4')];_0x516f59[_0xd6f0('0x30')][_0xd6f0('0x6f')]=_0x516f59[_0xd6f0('0xd1')][_0xd6f0('0xd5')];return db[_0xd6f0('0xd6')][_0xd6f0('0xb6')](_0x516f59[_0xd6f0('0x30')])[_0xd6f0('0x2a')](respondWithResult(_0x178d6b,0xc9))[_0xd6f0('0x1f')](handleError(_0x178d6b,null));};exports['attachmentDownload']=function(_0x198eec,_0x3d1d95){return db[_0xd6f0('0x9b')][_0xd6f0('0xb9')]({'where':{'id':_0x198eec['params']['id']},'raw':!![]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x3d1d95,null))['then'](function(_0x5a8d88){if(_0x5a8d88){if(_0x5a8d88[_0xd6f0('0x3d')]){return _0x3d1d95['status'](0x193)[_0xd6f0('0x22')]({'status':0x193,'message':_0xd6f0('0xd7')});}return db[_0xd6f0('0xd6')]['findOne']({'where':{'id':_0x198eec[_0xd6f0('0x44')]['attachId']},'raw':!![]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x3d1d95,null));}})[_0xd6f0('0x2a')](function(_0xe4e7f9){if(_0xe4e7f9){var _0x51bf52=_0xe4e7f9[_0xd6f0('0xd8')]!==null;var _0x33f54e=path[_0xd6f0('0xd9')](config[_0xd6f0('0xda')],_0xd6f0('0xdb'));if(_0x51bf52){_0x33f54e=path[_0xd6f0('0xd9')](_0x33f54e,'offline-chat/');}var _0x17c5b6=path[_0xd6f0('0xd9')](_0x33f54e,_0xe4e7f9[_0xd6f0('0xd3')]);return _0x3d1d95[_0xd6f0('0xdc')](_0x17c5b6);}})['catch'](handleError(_0x3d1d95,null));};exports[_0xd6f0('0xdd')]=function(_0x55fb13,_0x2e5f31){var _0x59d38a=null;var _0x5db326=null;var _0x2df291=null;if(_0x55fb13[_0xd6f0('0x30')]['id']){delete _0x55fb13[_0xd6f0('0x30')]['id'];}if(_0x55fb13['body'][_0xd6f0('0xde')]){_0x2df291=path['join'](config[_0xd6f0('0xda')],_0xd6f0('0xdf'),util[_0xd6f0('0xe0')](_0xd6f0('0xe1'),Date[_0xd6f0('0xe2')]()));_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xe3')]=_0x2df291;}return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x55fb13[_0xd6f0('0xb7')]['id']},'include':[{'model':db[_0xd6f0('0xe4')],'as':_0xd6f0('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x2e5f31,null))[_0xd6f0('0x2a')](saveUpdates(_0x55fb13[_0xd6f0('0x30')],null))[_0xd6f0('0x2a')](function(_0x5ae946){if(_0x5ae946){_0x59d38a=_0x5ae946;return db[_0xd6f0('0xba')]['find']({'where':{'id':_0x59d38a[_0xd6f0('0x92')]}});}})[_0xd6f0('0x2a')](function(_0x3f32e6){if(_0x3f32e6){_0x5db326=_0x3f32e6;return db[_0xd6f0('0xe6')][_0xd6f0('0xb5')]({'where':{'id':_0x59d38a['ContactId']}});}})[_0xd6f0('0x2a')](function(_0x174f35){if(_0x174f35){if(_0x2df291){var _0x4c3b1d=null;for(var _0x88b850=0x1;_0x88b850<_0x59d38a[_0xd6f0('0xe5')][_0xd6f0('0x64')];++_0x88b850){_0x4c3b1d=_0x59d38a[_0xd6f0('0xe5')][_0x88b850];var _0x55bb74=_0x4c3b1d['UserId']?util[_0xd6f0('0xe0')](_0xd6f0('0xe7'),_0x5db326[_0xd6f0('0xe8')],_0x4c3b1d[_0xd6f0('0x3e')]):_0xd6f0('0xe9');var _0x3eb403=_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xea')]||util['format'](_0xd6f0('0xe7'),_0xd6f0('0xeb'),_0x4c3b1d[_0xd6f0('0x6d')]);switch(_0x5db326[_0xd6f0('0xec')]){case _0xd6f0('0xed'):_0x55bb74=_0x4c3b1d[_0xd6f0('0x3e')]?util[_0xd6f0('0xe0')](_0xd6f0('0xe7'),_0x5db326[_0xd6f0('0xe8')],_0x4c3b1d[_0xd6f0('0x3e')]):_0xd6f0('0xe9');break;case'agent_alias':_0x55bb74=_0x4c3b1d['UserId']?_0x4c3b1d[_0xd6f0('0x75')]['alias']||_0x4c3b1d[_0xd6f0('0x75')][_0xd6f0('0xbd')]:_0xd6f0('0xe9');break;case _0xd6f0('0xee'):_0x55bb74=_0x4c3b1d[_0xd6f0('0x3e')]?_0x4c3b1d[_0xd6f0('0x75')][_0xd6f0('0xbd')]:'System';break;default:_0x55bb74=_0x4c3b1d[_0xd6f0('0x3e')]?util[_0xd6f0('0xe0')](_0xd6f0('0xe7'),_0x5db326['agentAlias'],_0x4c3b1d['UserId']):_0xd6f0('0xe9');}var _0x156d8c=util[_0xd6f0('0xe0')](_0xd6f0('0xef'),moment(_0x4c3b1d['createdAt'])[_0xd6f0('0xe0')](_0xd6f0('0xf0')),_0x4c3b1d['direction']==='in'?_0x3eb403:_0x55bb74,_0x4c3b1d[_0xd6f0('0x30')]);if(!_0x4c3b1d[_0xd6f0('0xf1')]){fs[_0xd6f0('0xf2')](_0x2df291,_0x156d8c);}}return db[_0xd6f0('0xf3')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xd6f0('0xf4')],'as':_0xd6f0('0xf5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xd6f0('0x2a')](function(_0x24800d){if(!_0x24800d||!_0x24800d[_0xd6f0('0xf5')]||!_0x55fb13[_0xd6f0('0x30')])return _0x59d38a;var _0x1acefc=_0x24800d[_0xd6f0('0xf6')]();return respondWithRpcPromise(_0xd6f0('0xf7'),_0xd6f0('0xf8'),{'account':_0x1acefc,'message':{'from':util[_0xd6f0('0xe0')](_0xd6f0('0xf9'),_0x24800d['name'],_0x24800d[_0xd6f0('0xbe')]||_0x24800d[_0xd6f0('0xf5')][_0xd6f0('0x94')]),'to':_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xde')],'subject':_0xd6f0('0xfa'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xde')]),'attachments':[{'path':_0x2df291}]}})[_0xd6f0('0x2a')](function(){return _0x59d38a;})[_0xd6f0('0x1f')](function(_0x53d6fd){logger[_0xd6f0('0x1b')](_0x53d6fd);});})[_0xd6f0('0x2a')](respondWithStatusCode(_0x2e5f31,0xc8))[_0xd6f0('0x1f')](handleError(_0x2e5f31,null));};exports[_0xd6f0('0xfb')]=function(_0x3ce855,_0x56fbcb){return db[_0xd6f0('0xe4')][_0xd6f0('0xb5')]({'where':{'id':_0x3ce855['params']['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x56fbcb,null))[_0xd6f0('0x2a')](function(_0x4ae09a){if(_0x4ae09a){return _0x4ae09a[_0xd6f0('0xfb')](_0x3ce855[_0xd6f0('0x30')][_0xd6f0('0xfc')],_[_0xd6f0('0xfd')](_0x3ce855[_0xd6f0('0x30')],[_0xd6f0('0xfc'),'id'])||{});}})[_0xd6f0('0x2a')](respondWithResult(_0x56fbcb,null))[_0xd6f0('0x1f')](handleError(_0x56fbcb,null));};exports[_0xd6f0('0xfe')]=function(_0x430b18,_0x22ec51){var _0x578789={'raw':![],'where':{}};var _0xdd080f={};var _0x4a1165={'count':0x0,'rows':[]};return db[_0xd6f0('0x9b')][_0xd6f0('0xb9')]({'where':{'id':_0x430b18[_0xd6f0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22ec51,null))[_0xd6f0('0x2a')](function(_0x2e64be){if(_0x2e64be){_0xdd080f[_0xd6f0('0x47')]=_[_0xd6f0('0x78')](db[_0xd6f0('0xe4')]['rawAttributes']);_0xdd080f['query']=_[_0xd6f0('0x78')](_0x430b18[_0xd6f0('0x44')]);_0xdd080f[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0xdd080f[_0xd6f0('0x47')],_0xdd080f[_0xd6f0('0x44')]);_0x578789[_0xd6f0('0x49')]=_[_0xd6f0('0x46')](_0xdd080f['model'],qs['fields'](_0x430b18['query'][_0xd6f0('0x48')]));_0x578789['attributes']=_0x578789[_0xd6f0('0x49')][_0xd6f0('0x64')]?_0x578789[_0xd6f0('0x49')]:_0xdd080f[_0xd6f0('0x47')];if(!_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x4a')](_0xd6f0('0xff'))){_0x578789[_0xd6f0('0x25')]=qs[_0xd6f0('0x25')](_0x430b18[_0xd6f0('0x44')]['limit']);_0x578789[_0xd6f0('0x23')]=qs['offset'](_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x23')]);}_0x578789['order']=qs[_0xd6f0('0x4c')](_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x4c')]);_0x578789[_0xd6f0('0x4d')]=qs[_0xd6f0('0x45')](_['pick'](_0x430b18['query'],_0xdd080f['filters']));_0x578789['where'][_0xd6f0('0xae')]=_0x2e64be['id'];if(_0x430b18['query'][_0xd6f0('0x84')]){_0x578789[_0xd6f0('0x4d')]=_[_0xd6f0('0xb3')](_0x578789[_0xd6f0('0x4d')],{'$or':_[_0xd6f0('0x40')](_0x578789[_0xd6f0('0x49')],function(_0x55f274){var _0x1d461f={};_0x1d461f[_0x55f274]={'$like':'%'+_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x84')]+'%'};return _0x1d461f;})});}if(_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x7d')]){var _0x32af02=_0x430b18['query']['$gte'][_0xd6f0('0x6a')](',');var _0x69694c={};_0x69694c[_0x32af02[0x0]]={'$gte':moment(_0x32af02[0x1])['format'](_0xd6f0('0x100'))};_0x578789[_0xd6f0('0x4d')]=_['merge'](_0x578789[_0xd6f0('0x4d')],_0x69694c);}_0x578789=_[_0xd6f0('0xb3')]({},_0x578789,_0x430b18[_0xd6f0('0xb4')]);return db['ChatMessage'][_0xd6f0('0x26')]({'where':_0x578789[_0xd6f0('0x4d')]})[_0xd6f0('0x2a')](function(_0x2d6902){_0x4a1165[_0xd6f0('0x26')]=_0x2d6902;if(_0x430b18['query'][_0xd6f0('0x101')]){_0x578789[_0xd6f0('0xb2')]=[{'all':!![]}];}return db[_0xd6f0('0xe4')][_0xd6f0('0x102')](_0x578789);})[_0xd6f0('0x2a')](function(_0x2ace80){_0x4a1165[_0xd6f0('0xb1')]=_0x2ace80;return _0x4a1165;});}})[_0xd6f0('0x2a')](respondWithFilteredResult(_0x22ec51,_0x578789))[_0xd6f0('0x1f')](handleError(_0x22ec51,null));};exports[_0xd6f0('0x103')]=function(_0x46dedb,_0x5887ab){var _0x240207={'where':{}},_0x3a32b3={},_0x55c3da={'count':0x0,'rows':[]};return db[_0xd6f0('0x9b')]['findOne']({'where':{'id':_0x46dedb[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x5887ab,null))['then'](function(_0x2c9e1a){if(_0x2c9e1a){_0x3a32b3['model']=_[_0xd6f0('0x78')](db['ChatMessage'][_0xd6f0('0x41')]);_0x3a32b3[_0xd6f0('0x44')]=_['keys'](_0x46dedb['query']);_0x3a32b3[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x3a32b3[_0xd6f0('0x47')],_0x3a32b3['query']);_0x240207[_0xd6f0('0x49')]=_[_0xd6f0('0x46')](_0x3a32b3[_0xd6f0('0x47')],qs[_0xd6f0('0x48')](_0x46dedb[_0xd6f0('0x44')]['fields']));_0x240207[_0xd6f0('0x49')]=_0x240207[_0xd6f0('0x49')][_0xd6f0('0x64')]?_0x240207[_0xd6f0('0x49')]:_0x3a32b3[_0xd6f0('0x47')];if(!_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x4a')]('nolimit')){_0x240207[_0xd6f0('0x25')]=qs[_0xd6f0('0x25')](_0x46dedb['query'][_0xd6f0('0x25')]);_0x240207[_0xd6f0('0x23')]=qs['offset'](_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x23')]);}_0x240207[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x4c')]);_0x240207[_0xd6f0('0x4d')]=qs[_0xd6f0('0x45')](_['pick'](_0x46dedb[_0xd6f0('0x44')],_0x3a32b3[_0xd6f0('0x45')]));_0x240207['where'][_0xd6f0('0xae')]=_0x2c9e1a['id'];if(_0x46dedb['query'][_0xd6f0('0x84')]){_0x240207[_0xd6f0('0x4d')]=_[_0xd6f0('0xb3')](_0x240207[_0xd6f0('0x4d')],{'$or':_[_0xd6f0('0x40')](_0x240207[_0xd6f0('0x49')],function(_0x44cead){var _0x5e1062={};_0x5e1062[_0x44cead]={'$like':'%'+_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x84')]+'%'};return _0x5e1062;})});}_0x240207[_0xd6f0('0x4d')][_0xd6f0('0xf1')]=![];if(_0x46dedb[_0xd6f0('0x44')]['id']){_0x240207['where']['id']={'$gt':_0x46dedb[_0xd6f0('0x44')]['id']};}_0x240207=_['merge']({},_0x240207,_0x46dedb[_0xd6f0('0xb4')]);return db['ChatMessage'][_0xd6f0('0x26')]({'where':_0x240207[_0xd6f0('0x4d')]})['then'](function(_0x27887e){_0x55c3da['count']=_0x27887e;_0x240207['include']=[];if(_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x104')]){_0x240207[_0xd6f0('0xb2')][_0xd6f0('0xaf')]({'model':db[_0xd6f0('0x75')],'as':_0xd6f0('0x75'),'attributes':['id',_0xd6f0('0xbd'),_0xd6f0('0x105')]});}if(_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x101')]){_0x240207[_0xd6f0('0xb2')]=[{'all':!![]}];}return db[_0xd6f0('0xe4')][_0xd6f0('0x102')](_0x240207);})[_0xd6f0('0x2a')](function(_0x2ea0c4){_0x55c3da['rows']=_0x2ea0c4;return _0x55c3da;});}})[_0xd6f0('0x2a')](respondWithFilteredResult(_0x5887ab,_0x240207))[_0xd6f0('0x1f')](handleError(_0x5887ab,null));};exports['addTags']=function(_0x2e9eca,_0x1814a9){return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x2e9eca[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x1814a9,null))[_0xd6f0('0x2a')](function(_0x54f0f0){if(_0x54f0f0){return _0x54f0f0[_0xd6f0('0x106')](_0x2e9eca[_0xd6f0('0x30')][_0xd6f0('0xfc')],_[_0xd6f0('0xfd')](_0x2e9eca[_0xd6f0('0x30')],['ids','id'])||{})[_0xd6f0('0x107')](function(){return db[_0xd6f0('0x72')][_0xd6f0('0x102')]({'attributes':['id','name',_0xd6f0('0x108')],'where':{'id':_0x2e9eca[_0xd6f0('0x30')][_0xd6f0('0xfc')]}});})[_0xd6f0('0x2a')](function(_0x486a3e){socket[_0xd6f0('0x109')](_0xd6f0('0x10a'),{'id':Number(_0x2e9eca[_0xd6f0('0xb7')]['id']),'tags':_0x486a3e||[]});return{'id':Number(_0x2e9eca[_0xd6f0('0xb7')]['id']),'tags':_0x486a3e||[]};});}})[_0xd6f0('0x2a')](respondWithResult(_0x1814a9,null))[_0xd6f0('0x1f')](handleError(_0x1814a9,null));};exports[_0xd6f0('0x10b')]=function(_0x1033e1,_0x3d1c1e){return db[_0xd6f0('0x9b')]['find']({'where':{'id':_0x1033e1['params']['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x3d1c1e,null))[_0xd6f0('0x2a')](function(_0x547615){if(_0x547615){return _0x547615[_0xd6f0('0x10b')](_0x1033e1[_0xd6f0('0x44')][_0xd6f0('0xfc')]);}})[_0xd6f0('0x2a')](respondWithStatusCode(_0x3d1c1e,null))[_0xd6f0('0x1f')](handleError(_0x3d1c1e,null));};exports[_0xd6f0('0xdc')]=function(_0x920605,_0x280343){var _0xdeebce=moment()[_0xd6f0('0x10c')]()[_0xd6f0('0x99')]();var _0x2ac49c=path['join'](config[_0xd6f0('0xda')],_0xd6f0('0x10d'),'files',_0xd6f0('0x10e'));var _0x5327b3=path[_0xd6f0('0xd9')](config[_0xd6f0('0xda')],_0xd6f0('0x10d'),'files',_0xd6f0('0x10f'));var _0x245c62=path[_0xd6f0('0xd9')](_0x2ac49c,_0xdeebce);var _0x1a4ad0=util['format'](_0xd6f0('0x110'),_0x920605[_0xd6f0('0xb7')]['id'],_0xdeebce);var _0x4e7e89=path[_0xd6f0('0xd9')](_0x2ac49c,_0x1a4ad0);var _0x1151d0=[];_0x1151d0[_0xd6f0('0xaf')]({'model':db[_0xd6f0('0x75')],'as':'User','attributes':['id',_0xd6f0('0xbd')],'raw':!![]});_0x1151d0[_0xd6f0('0xaf')]({'model':db['CmContact'],'as':_0xd6f0('0xcb'),'attributes':['id',_0xd6f0('0x111'),'lastName'],'raw':!![]});if(_0x920605[_0xd6f0('0x44')][_0xd6f0('0x10f')]){_0x1151d0[_0xd6f0('0xaf')]({'model':db[_0xd6f0('0xd6')],'as':_0xd6f0('0xd6'),'raw':!![]});}var _0x46ee50=[{'model':db[_0xd6f0('0xe4')],'as':_0xd6f0('0xe5'),'attributes':['id',_0xd6f0('0x30'),_0xd6f0('0x112'),_0xd6f0('0x113'),'secret',_0xd6f0('0x80')],'include':_0x1151d0}];_0x46ee50['push']({'model':db[_0xd6f0('0xba')],'as':_0xd6f0('0x114'),'attributes':['id',_0xd6f0('0x43')]});_0x46ee50[_0xd6f0('0xaf')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd6f0('0xbd')]});return db['ChatInteraction'][_0xd6f0('0xb5')]({'where':{'id':_0x920605[_0xd6f0('0xb7')]['id']},'include':_0x46ee50})[_0xd6f0('0x2a')](handleEntityNotFound(_0x280343,null))['then'](function(_0x519500){if(_0x519500){var _0x1fce58=_0x519500['get']({'plain':!![]});fs[_0xd6f0('0x115')](_0x245c62);var _0x3e89c2={'channel':_0xd6f0('0x116'),'account':_0x1fce58[_0xd6f0('0x114')][_0xd6f0('0x43')],'agent':_0x1fce58[_0xd6f0('0x117')]?_0x1fce58['Owner'][_0xd6f0('0xbd')]:_0xd6f0('0x118'),'createdAt':moment(_0x1fce58['createdAt'])[_0xd6f0('0xe0')](_0xd6f0('0x100'))[_0xd6f0('0x99')](),'closedAt':_0x1fce58[_0xd6f0('0x3d')]?moment(_0x1fce58[_0xd6f0('0x119')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd6f0('0x99')]():'','disposition':_0x1fce58['disposition'],'chatInfo':{'browser':_0x1fce58[_0xd6f0('0x11a')],'os':_0x1fce58[_0xd6f0('0x11b')],'referer':_0x1fce58[_0xd6f0('0x11c')],'customerIp':_0x1fce58['customerIp'],'customerPort':_0x1fce58['customerPort']?_0x1fce58[_0xd6f0('0x11d')]:_0xd6f0('0x118')},'messages':_(_0x1fce58[_0xd6f0('0xe5')])[_0xd6f0('0x11e')]()['filter']({'secret':![]})[_0xd6f0('0x40')](function(_0x37107f){if(_0x37107f['Attachment']){var _0x318972=path[_0xd6f0('0xd9')](_0x5327b3,_0x37107f[_0xd6f0('0xd6')][_0xd6f0('0xd3')]);if(fs[_0xd6f0('0x11f')](_0x318972)){fs['createReadStream'](_0x318972)['pipe'](fs[_0xd6f0('0x120')](path[_0xd6f0('0xd9')](_0x245c62,_0x37107f['Attachment'][_0xd6f0('0xd3')])));}}return{'date':moment(_0x37107f[_0xd6f0('0x112')])[_0xd6f0('0xe0')](_0xd6f0('0x100'))[_0xd6f0('0x99')](),'sender':_0x37107f[_0xd6f0('0x113')]===_0xd6f0('0xc8')?_0x37107f[_0xd6f0('0x75')]?_0x37107f[_0xd6f0('0x75')][_0xd6f0('0xbd')]:_0xd6f0('0xe9'):_0x37107f['Contact']['firstName']+(_0x37107f[_0xd6f0('0xcb')]['lastName']?'\x20'+_0x37107f[_0xd6f0('0xcb')][_0xd6f0('0x121')]:''),'body':_0x37107f[_0xd6f0('0xd6')]?_0x37107f['Attachment']['basename']:_0x37107f['body'],'direction':_0x37107f[_0xd6f0('0x113')]===_0xd6f0('0xc8')?'A':'C','secret':_0x37107f['secret'],'read':_0x37107f['read'],'attachment':_0x37107f[_0xd6f0('0xd6')]};})[_0xd6f0('0x69')]()};return ejs[_0xd6f0('0x122')](path['join'](config['root'],_0xd6f0('0x10d'),_0xd6f0('0x123'),_0xd6f0('0x124')),{'interaction':_0x3e89c2})['then'](function(_0xa4ae76){var _0x1478ce=path['join'](_0x245c62,_0xd6f0('0x125')+_0x1fce58['id']+'-'+_0xdeebce+_0xd6f0('0x126'));var _0x264d69={'path':_0x1478ce,'channel':_0xd6f0('0x116'),'interactionId':_0x1fce58['id']};return pdf[_0xd6f0('0x127')](_0xa4ae76,_0x264d69);})[_0xd6f0('0x2a')](function(){return new Promise(function(_0x300b64,_0x16ef7b){zipdir(_0x245c62,{'saveTo':_0x4e7e89},function(_0x526978,_0x552cd5){if(_0x526978)return _0x16ef7b(_0x526978);return _0x300b64(_0x552cd5);});})[_0xd6f0('0x2a')](function(){return new BPromise(function(_0x5e505d,_0x5d0e6e){rimraf(_0x245c62,function(_0x44e0ca){if(_0x44e0ca)_0x5d0e6e(_0x44e0ca);return _0x5e505d();});});})[_0xd6f0('0x2a')](function(){return _0x280343[_0xd6f0('0xdc')](_0x4e7e89,_0x1a4ad0,function(_0x4fc550){if(_0x4fc550){logger['error']('err',_0x4fc550);}else{fs[_0xd6f0('0x128')](_0x4e7e89);}});});});}else{return _0x280343[_0xd6f0('0x20')](0xc8);}})[_0xd6f0('0x1f')](handleError(_0x280343,null));};
\ No newline at end of file
+var _0xe5b3=['closedAt','browserName','osName','referer','customerIp','existsSync','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','end','stack','name','send','render','merge','body','contact','interaction','account','Users','map','fullname','TagIds','split','forEach','Tags','push','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','disposition','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','buildExpression','type','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','include','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','Messages','ChatWebsite','CmContact','ContactId','format','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','addMessage','ids','omit','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','includeAgent','addTags','spread','color','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','Chat'];(function(_0x3f1478,_0xb54c58){var _0x5b84f2=function(_0x11d08f){while(--_0x11d08f){_0x3f1478['push'](_0x3f1478['shift']());}};_0x5b84f2(++_0xb54c58);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5bc65c,_0x292169){_0x5bc65c=_0x5bc65c-0x0;var _0x4c9971=_0xe5b3[_0x5bc65c];return _0x4c9971;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x3e5b('0x0'));var rp=require(_0x3e5b('0x1'));var moment=require(_0x3e5b('0x2'));var BPromise=require(_0x3e5b('0x3'));var Mustache=require(_0x3e5b('0x4'));var util=require(_0x3e5b('0x5'));var path=require(_0x3e5b('0x6'));var ejs=require(_0x3e5b('0x7'));var fs=require('fs');var _=require(_0x3e5b('0x8'));var squel=require(_0x3e5b('0x9'));var Redis=require(_0x3e5b('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x3e5b('0xb'));var pdf=require(_0x3e5b('0xc'));var logger=require('../../config/logger')(_0x3e5b('0xd'));var config=require(_0x3e5b('0xe'));var db=require(_0x3e5b('0xf'))['db'];config[_0x3e5b('0x10')]=_['defaults'](config['redis'],{'host':_0x3e5b('0x11'),'port':0x18eb});var socket=require(_0x3e5b('0x12'))(new Redis(config[_0x3e5b('0x10')]));require(_0x3e5b('0x13'))[_0x3e5b('0x14')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3e5b('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x3e5b('0x15')][_0x3e5b('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x4d69dd,_0x374068,_0x20b97b,_0x3c4eb1){return new BPromise(function(_0x405e70,_0x560010){var _0x39a2a1=_0x3c4eb1||client;return _0x39a2a1['request'](_0x4d69dd,_0x20b97b)['then'](function(_0x4d71a3){logger[_0x3e5b('0x17')](_0x3e5b('0x18'),_0x374068,_0x3e5b('0x19'));logger['debug'](_0x3e5b('0x1a'),_0x374068,'request\x20sent',JSON['stringify'](_0x4d71a3));if(_0x4d71a3[_0x3e5b('0x1b')]){if(_0x4d71a3[_0x3e5b('0x1b')]['code']===0x1f4){logger[_0x3e5b('0x1b')](_0x3e5b('0x18'),_0x374068,_0x4d71a3['error'][_0x3e5b('0x1c')]);return _0x560010(_0x4d71a3[_0x3e5b('0x1b')]['message']);}logger['error'](_0x3e5b('0x18'),_0x374068,_0x4d71a3[_0x3e5b('0x1b')][_0x3e5b('0x1c')]);return _0x405e70(_0x4d71a3[_0x3e5b('0x1b')][_0x3e5b('0x1c')]);}else{logger[_0x3e5b('0x17')](_0x3e5b('0x18'),_0x374068,_0x3e5b('0x19'));_0x405e70(_0x4d71a3[_0x3e5b('0x1d')][_0x3e5b('0x1c')]);}})[_0x3e5b('0x1e')](function(_0x11e5cf){logger[_0x3e5b('0x1b')](_0x3e5b('0x18'),_0x374068,_0x11e5cf);_0x560010(_0x11e5cf);});});}function respondWithStatusCode(_0x5b46d4,_0x433f9c){_0x433f9c=_0x433f9c||0xcc;return function(_0x86f19c){if(_0x86f19c){return _0x5b46d4[_0x3e5b('0x1f')](_0x433f9c);}return _0x5b46d4[_0x3e5b('0x20')](_0x433f9c)['end']();};}function respondWithResult(_0x1eb80f,_0x5b33bb){_0x5b33bb=_0x5b33bb||0xc8;return function(_0x2f9e42){if(_0x2f9e42){return _0x1eb80f[_0x3e5b('0x20')](_0x5b33bb)['json'](_0x2f9e42);}};}function respondWithFilteredResult(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(_0x42d7e9){var _0x3c8965=typeof _0x2f6368[_0x3e5b('0x21')]===_0x3e5b('0x22')&&typeof _0x2f6368[_0x3e5b('0x23')]===_0x3e5b('0x22');var _0x4c4b89=_0x42d7e9[_0x3e5b('0x24')];var _0x505f40=_0x3c8965?0x0:_0x2f6368[_0x3e5b('0x21')];var _0x4fd64b=_0x3c8965?_0x42d7e9[_0x3e5b('0x24')]:_0x2f6368[_0x3e5b('0x21')]+_0x2f6368[_0x3e5b('0x23')];var _0x475b39;if(_0x4fd64b>=_0x4c4b89){_0x4fd64b=_0x4c4b89;_0x475b39=0xc8;}else{_0x475b39=0xce;}_0x41b684[_0x3e5b('0x20')](_0x475b39);return _0x41b684[_0x3e5b('0x25')](_0x3e5b('0x26'),_0x505f40+'-'+_0x4fd64b+'/'+_0x4c4b89)[_0x3e5b('0x27')](_0x42d7e9);}return null;};}function saveUpdates(_0x221718){return function(_0x112dc0){if(_0x112dc0){return _0x112dc0[_0x3e5b('0x28')](_0x221718)['then'](function(_0x21bc10){return _0x21bc10;});}return null;};}function removeEntity(_0x1882aa){return function(_0xa8760b){if(_0xa8760b){return _0xa8760b[_0x3e5b('0x29')]()[_0x3e5b('0x2a')](function(){_0x1882aa[_0x3e5b('0x20')](0xcc)[_0x3e5b('0x2b')]();});}};}function handleEntityNotFound(_0x4c4e01){return function(_0x33f089){if(!_0x33f089){_0x4c4e01['sendStatus'](0x194);}return _0x33f089;};}function handleError(_0x5b9ba3,_0x32c6b0){_0x32c6b0=_0x32c6b0||0x1f4;return function(_0x78d68a){logger['error'](_0x78d68a[_0x3e5b('0x2c')]);if(_0x78d68a[_0x3e5b('0x2d')]){delete _0x78d68a[_0x3e5b('0x2d')];}_0x5b9ba3[_0x3e5b('0x20')](_0x32c6b0)[_0x3e5b('0x2e')](_0x78d68a);};}function getMustacheRender(_0x26f842,_0x3b3046){return Mustache[_0x3e5b('0x2f')](_0x26f842,_[_0x3e5b('0x30')](_0x3b3046[_0x3e5b('0x31')],{'contact':_0x3b3046[_0x3e5b('0x32')],'message':_0x3b3046[_0x3e5b('0x1c')],'agent':_0x3b3046['agent'],'interaction':_0x3b3046[_0x3e5b('0x33')],'account':_0x3b3046[_0x3e5b('0x34')]}))||'';}function getInteractionUsers(_0x53caa2,_0x4edf59){return new BPromise(function(_0x471196,_0x56d7ef){try{if(_0x4edf59[_0x53caa2['id']]){_0x53caa2[_0x3e5b('0x35')]=_[_0x3e5b('0x36')](_0x4edf59[_0x53caa2['id']],function(_0xb2349c){return{'id':_0xb2349c['id'],'fullname':_0xb2349c[_0x3e5b('0x37')]};});}}catch(_0x5389e3){_0x56d7ef(_0x5389e3);}_0x471196(_0x53caa2);});}function getInteractionTags(_0x18b07f,_0x4cdcb1){return new BPromise(function(_0x42b970,_0x5ec841){try{if(_0x18b07f['TagIds']){_0x18b07f['Tags']=[];_0x18b07f[_0x3e5b('0x38')][_0x3e5b('0x39')](',')[_0x3e5b('0x3a')](function(_0x35cfcd){_0x18b07f[_0x3e5b('0x3b')][_0x3e5b('0x3c')](_0x4cdcb1[_0x35cfcd]);});}delete _0x18b07f['TagIds'];}catch(_0x5d0c59){_0x5ec841(_0x5d0c59);}_0x42b970(_0x18b07f);});}function updateChatInteraction(_0x5ee6dc,_0x565319,_0x5f0271){return new BPromise(function(_0x47ea59,_0x5aad1d){return getInteractionUsers(_0x5ee6dc,_0x5f0271)[_0x3e5b('0x2a')](function(_0x349de0){return getInteractionTags(_0x349de0,_0x565319);})[_0x3e5b('0x2a')](function(_0x1aafd5){return getStateInteraction(_0x1aafd5);})[_0x3e5b('0x2a')](function(_0x2506a6){_0x47ea59(_0x2506a6);})[_0x3e5b('0x1e')](function(_0x423be2){_0x5aad1d(_0x423be2);});});}function getStateInteraction(_0x222d0f){return new BPromise(function(_0xbbc6b){_0x222d0f[_0x3e5b('0x3d')]=0x0;_0x222d0f['talking']=0x0;_0x222d0f[_0x3e5b('0x3e')]=0x0;_0x222d0f[_0x3e5b('0x3f')]=0x0;_0x222d0f[_0x3e5b('0x40')]=0x0;_0x222d0f[_0x3e5b('0x41')]=0x0;if(!_0x222d0f[_0x3e5b('0x42')]&&!_0x222d0f[_0x3e5b('0x43')]){_0x222d0f[_0x3e5b('0x3d')]+=0x1;}if(!_0x222d0f[_0x3e5b('0x42')]&&_0x222d0f[_0x3e5b('0x43')]){_0x222d0f[_0x3e5b('0x44')]+=0x1;if(_0x222d0f[_0x3e5b('0x3d')]){_0x222d0f['waiting']-=0x1;}}if(_0x222d0f['closed']&&_0x222d0f['disposition']==='abandoned'){_0x222d0f[_0x3e5b('0x40')]+=0x1;if(_0x222d0f[_0x3e5b('0x3d')]){_0x222d0f[_0x3e5b('0x3d')]-=0x1;}}else if(_0x222d0f[_0x3e5b('0x42')]&&!_0x222d0f[_0x3e5b('0x43')]&&_0x222d0f[_0x3e5b('0x45')]){_0x222d0f[_0x3e5b('0x3f')]+=0x1;if(_0x222d0f[_0x3e5b('0x3d')]){_0x222d0f[_0x3e5b('0x3d')]-=0x1;}}else if(_0x222d0f[_0x3e5b('0x42')]&&_0x222d0f['UserId']){_0x222d0f[_0x3e5b('0x3e')]+=0x1;if(_0x222d0f[_0x3e5b('0x44')]){_0x222d0f[_0x3e5b('0x44')]-=0x1;}}_0x222d0f[_0x3e5b('0x41')]+=0x1;_0xbbc6b(_0x222d0f);});}exports[_0x3e5b('0x46')]=function(_0x4f0c2c,_0x588ee7){var _0x495217={},_0x1fbd87={},_0x20af6a={'count':0x0,'rows':[]};var _0x3b2319=_['map'](db['ChatInteraction'][_0x3e5b('0x47')],function(_0x313c51){return{'name':_0x313c51[_0x3e5b('0x48')],'type':_0x313c51['type']['key']};});_0x1fbd87[_0x3e5b('0x49')]=_['map'](_0x3b2319,_0x3e5b('0x2d'));_0x1fbd87[_0x3e5b('0x4a')]=_[_0x3e5b('0x4b')](_0x4f0c2c[_0x3e5b('0x4a')]);_0x1fbd87[_0x3e5b('0x4c')]=_[_0x3e5b('0x4d')](_0x1fbd87[_0x3e5b('0x49')],_0x1fbd87[_0x3e5b('0x4a')]);_0x495217[_0x3e5b('0x4e')]=_['intersection'](_0x1fbd87[_0x3e5b('0x49')],qs['fields'](_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x4f')]));_0x495217[_0x3e5b('0x4e')]=_0x495217[_0x3e5b('0x4e')][_0x3e5b('0x50')]?_0x495217[_0x3e5b('0x4e')]:_0x1fbd87[_0x3e5b('0x49')];if(!_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x51')](_0x3e5b('0x52'))){_0x495217[_0x3e5b('0x23')]=qs[_0x3e5b('0x23')](_0x4f0c2c[_0x3e5b('0x4a')]['limit']);_0x495217[_0x3e5b('0x21')]=qs[_0x3e5b('0x21')](_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x21')]);}_0x495217[_0x3e5b('0x53')]=qs[_0x3e5b('0x54')](_0x4f0c2c['query'][_0x3e5b('0x54')]);_0x495217[_0x3e5b('0x55')]=qs[_0x3e5b('0x4c')](_[_0x3e5b('0x56')](_0x4f0c2c[_0x3e5b('0x4a')],_0x1fbd87[_0x3e5b('0x4c')]),_0x3b2319);var _0x216600=[];var _0x437430=squel['select']()[_0x3e5b('0x57')]('id')['field']('name')[_0x3e5b('0x57')]('color')[_0x3e5b('0x58')](_0x3e5b('0x59'));var _0xf52ebd=squel[_0x3e5b('0x5a')]()['field']('u.id')['field']('u.fullname')[_0x3e5b('0x57')](_0x3e5b('0x5b'))[_0x3e5b('0x58')](_0x3e5b('0x5c'),'ui')[_0x3e5b('0x5d')]('users','u','u.id\x20=\x20ui.UserId');var _0xa0a18d=squel[_0x3e5b('0x5a')]()[_0x3e5b('0x58')](_0x3e5b('0x5e'),'i')[_0x3e5b('0x5d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x3e5b('0x5f'))[_0x3e5b('0x5d')](_0x3e5b('0x60'),'a',_0x3e5b('0x61'))[_0x3e5b('0x5d')](_0x3e5b('0x62'),'me',_0x3e5b('0x63'))[_0x3e5b('0x5d')]('chat_interaction_has_tags','it',_0x3e5b('0x64'))[_0x3e5b('0x5d')](_0x3e5b('0x59'),'t',_0x3e5b('0x65'));var _0x2d2c1e=squel['expr']();var _0xd45159=[];var _0x57ac70=squel[_0x3e5b('0x66')]();var _0x1fd40c;if(_0x4f0c2c['query']['search']){_0x1fd40c=as['parseSearch'](_0x4f0c2c[_0x3e5b('0x4a')]['search']);var _0x1ab942=_0x1fd40c[_0x3e5b('0x67')];for(var _0x1af190=0x0;_0x1af190<_0x1fd40c[_0x3e5b('0x68')][_0x3e5b('0x50')];_0x1af190++){var _0x4de129=_0x1fd40c['conditions'][_0x1af190];var _0x226f61='i';var _0x13bc3b=_[_0x3e5b('0x69')](_0x3b2319,['name',_0x4de129[_0x3e5b('0x57')]]);if(!_0x13bc3b){switch(_0x4de129[_0x3e5b('0x57')]){case _0x3e5b('0x6a'):if(_0x4de129[_0x3e5b('0x6b')]==0x1){_0xa0a18d[_0x3e5b('0x6c')]('`'+_0x4de129[_0x3e5b('0x57')]+_0x3e5b('0x6d'));}else{_0xa0a18d[_0x3e5b('0x6c')]('`'+_0x4de129[_0x3e5b('0x57')]+_0x3e5b('0x6e'));}break;case _0x3e5b('0x6f'):if(_0x4de129[_0x3e5b('0x70')]===_0x3e5b('0x71')){if(_0x4de129[_0x3e5b('0x6b')][_0x3e5b('0x39')]('\x20')[_0x3e5b('0x50')]>0x1){_0x2d2c1e[_0x1ab942](_0x3e5b('0x72'),qs[_0x3e5b('0x73')](_0x4de129['value']),null);}else{var _0xe5d4c5='%'+_0x4de129[_0x3e5b('0x6b')]+'%';_0x2d2c1e[_0x1ab942]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xe5d4c5,_0xe5d4c5,_0xe5d4c5);}}else{_0x13bc3b=_[_0x3e5b('0x69')](_0x3b2319,[_0x3e5b('0x2d'),'ContactId']);_0x4de129['field']='ContactId';_0x8d164e=as[_0x3e5b('0x74')](_0x226f61,_0x13bc3b[_0x3e5b('0x75')],_0x4de129);_0x2d2c1e[_0x1ab942](_0x8d164e['text'],_0x8d164e[_0x3e5b('0x6b')][_0x3e5b('0x76')],_0x8d164e['value'][_0x3e5b('0x2b')]);}break;case _0x3e5b('0x77'):var _0x43f28f=_0x4de129[_0x3e5b('0x6b')][_0x3e5b('0x39')](',')[_0x3e5b('0x36')](function(_0x5891fe){return Number(_0x5891fe);});_0x43f28f[_0x3e5b('0x3a')](function(_0x3f2c6c){_0x57ac70['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f2c6c+',%');});_0xd45159=_[_0x3e5b('0x78')](_0xd45159,_0x43f28f);break;case _0x3e5b('0x79'):if(_0x4de129[_0x3e5b('0x70')]===_0x3e5b('0x71')){_0x2d2c1e[_0x1ab942](_0x3e5b('0x7a'),'%'+_0x4de129[_0x3e5b('0x6b')]+'%',null);}else{_0x13bc3b=_[_0x3e5b('0x69')](_0x3b2319,['name','UserId']);_0x4de129[_0x3e5b('0x57')]=_0x3e5b('0x43');_0x8d164e=as['buildExpression'](_0x226f61,_0x13bc3b[_0x3e5b('0x75')],_0x4de129);_0x2d2c1e[_0x1ab942](_0x8d164e[_0x3e5b('0x7b')],_0x8d164e[_0x3e5b('0x6b')][_0x3e5b('0x76')],_0x8d164e[_0x3e5b('0x6b')][_0x3e5b('0x2b')]);}break;case _0x3e5b('0x31'):_0x8d164e=as['buildExpression']('me',null,_0x4de129);_0x2d2c1e[_0x1ab942](_0x8d164e[_0x3e5b('0x7b')],_0x8d164e[_0x3e5b('0x6b')]['start'],_0x8d164e['value']['end']);break;}}else{var _0x8d164e=as[_0x3e5b('0x74')](_0x226f61,_0x13bc3b[_0x3e5b('0x75')],_0x4de129);_0x2d2c1e[_0x1ab942](_0x8d164e[_0x3e5b('0x7b')],_0x8d164e[_0x3e5b('0x6b')][_0x3e5b('0x76')],_0x8d164e['value'][_0x3e5b('0x2b')]);}}}else{var _0x48e1c=_(_0x4f0c2c['query'])[_0x3e5b('0x4b')]()['map'](function(_0x4f62fb){return _[_0x3e5b('0x7c')](_0x3b2319,[_0x3e5b('0x2d'),_0x4f62fb])?_0x4f62fb:undefined;})['compact']()[_0x3e5b('0x6b')]();if(!_[_0x3e5b('0x7d')](_0x48e1c)){_0x48e1c['forEach'](function(_0x2e36af){if(_0x2e36af===_0x3e5b('0x7e')){_0xa0a18d[_0x3e5b('0x55')](_0x3e5b('0x7f'),[][_0x3e5b('0x80')](_0x4f0c2c[_0x3e5b('0x4a')][_0x2e36af]));}else if(_0x2e36af==='createdAt'){var _0x4fc232=JSON[_0x3e5b('0x81')](_0x4f0c2c['query'][_0x2e36af])['$gte'];var _0x25d3d8=JSON[_0x3e5b('0x81')](_0x4f0c2c[_0x3e5b('0x4a')][_0x2e36af])['$lte'];_0xa0a18d[_0x3e5b('0x55')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4fc232,_0x25d3d8);}else{if(_0x4f0c2c[_0x3e5b('0x4a')][_0x2e36af]==='null'){_0xa0a18d[_0x3e5b('0x55')]('i.'+_0x2e36af+_0x3e5b('0x82'));}else{_0xa0a18d[_0x3e5b('0x55')]('i.'+_0x2e36af+_0x3e5b('0x83'),_0x4f0c2c['query'][_0x2e36af]);}}});}if(_0x4f0c2c[_0x3e5b('0x4a')]['read']){if(_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x84')]==0x1){_0xa0a18d['having'](_0x3e5b('0x85'));}else{_0xa0a18d[_0x3e5b('0x6c')](_0x3e5b('0x86'));}}if(_0x4f0c2c['query'][_0x3e5b('0x87')]){_0xd45159=_[_0x3e5b('0x88')](_0x4f0c2c[_0x3e5b('0x4a')]['tag'])?_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x87')]:new Array(_0x4f0c2c['query'][_0x3e5b('0x87')]);_0xd45159[_0x3e5b('0x3a')](function(_0x1ddf2d){_0x57ac70['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1ddf2d+',%');});}if(_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x89')]){var _0x352f7e=_0x4f0c2c[_0x3e5b('0x4a')]['filter'][_0x3e5b('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3e5b('0x8b')](_0x352f7e)){_0x2d2c1e['or']('i.id\x20LIKE\x20?',_0x352f7e+'%');}else{_0x2d2c1e['or'](_0x3e5b('0x8c'),qs[_0x3e5b('0x73')](_0x352f7e))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x352f7e+'%');}}}_0xa0a18d[_0x3e5b('0x55')](_0x2d2c1e);_0xa0a18d[_0x3e5b('0x8d')]('i.id');var _0x1f734a={'type':db[_0x3e5b('0x8e')][_0x3e5b('0x8f')][_0x3e5b('0x90')],'raw':!![]};var _0x53aa30=_0xa0a18d['clone']();_0x53aa30[_0x3e5b('0x57')](_0x3e5b('0x91'));_0x53aa30[_0x3e5b('0x57')](_0x3e5b('0x92'),_0x3e5b('0x6a'));if(_0x495217[_0x3e5b('0x53')]){_0x495217['order']['forEach'](function(_0x19e93f){var _0x203279=_0x19e93f[0x0]===_0x3e5b('0x93')?_0x19e93f[0x0]:'i.'+_0x19e93f[0x0];_0xa0a18d[_0x3e5b('0x53')](_0x203279,_0x19e93f[0x1]===_0x3e5b('0x94')?![]:!![]);});}if(!_[_0x3e5b('0x7d')](_0xd45159)){_0xa0a18d[_0x3e5b('0x6c')](_0x57ac70);_0x53aa30[_0x3e5b('0x55')]('t.id\x20IN\x20?',_0xd45159);}BPromise['resolve']()[_0x3e5b('0x2a')](function(){if(!_0x1fd40c){if(_0x4f0c2c['query'][_0x3e5b('0x7e')])return;_0x53aa30[_0x3e5b('0x55')](_0x3e5b('0x95'));_0xa0a18d[_0x3e5b('0x55')](_0x3e5b('0x95'));return;}if(_0x4f0c2c[_0x3e5b('0x96')][_0x3e5b('0x97')]!==_0x3e5b('0x98'))return;return _0x4f0c2c[_0x3e5b('0x96')][_0x3e5b('0x99')]({'attributes':['id'],'raw':!![]})[_0x3e5b('0x2a')](function(_0x199fa4){if(_[_0x3e5b('0x7d')](_0x199fa4)){_0x53aa30['where']('i.ChatWebsiteId\x20IS\x20NULL');_0xa0a18d[_0x3e5b('0x55')](_0x3e5b('0x9a'));}else{_0x53aa30[_0x3e5b('0x55')](_0x3e5b('0x7f'),_['map'](_0x199fa4,'id'));_0xa0a18d[_0x3e5b('0x55')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3e5b('0x36')](_0x199fa4,'id'));}});})['then'](function(){if(_0x4f0c2c[_0x3e5b('0x96')][_0x3e5b('0x97')]===_0x3e5b('0x98')&&!_0x1fd40c&&!_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x7e')])return[];return db[_0x3e5b('0x9b')][_0x3e5b('0x4a')](_0x53aa30[_0x3e5b('0x9c')](),_0x1f734a);})[_0x3e5b('0x2a')](function(_0x5198f9){_0x20af6a[_0x3e5b('0x24')]=_0x5198f9[_0x3e5b('0x50')];if(_0x20af6a['count']===0x0)return[];return db[_0x3e5b('0x9b')][_0x3e5b('0x4a')](_0x437430[_0x3e5b('0x9c')](),_0x1f734a)[_0x3e5b('0x2a')](function(_0x41de83){_0x216600=_[_0x3e5b('0x9d')](_0x41de83,'id');_0x1f734a=_[_0x3e5b('0x30')](_0x1f734a,{'model':db[_0x3e5b('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f0c2c[_0x3e5b('0x4a')][_0x3e5b('0x4f')]){_0x495217[_0x3e5b('0x4e')][_0x3e5b('0x3a')](function(_0x499287){_0xa0a18d[_0x3e5b('0x57')]('i.'+_0x499287);});}else{_0xa0a18d[_0x3e5b('0x57')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0x9f'),_0x3e5b('0xa0'));_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xa1'),'Account.mandatoryDisposition');_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xa2'),'contactName');_0xa0a18d['field'](_0x3e5b('0xa3'));_0xa0a18d[_0x3e5b('0x57')]('c.firstName','Contact.firstName');_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xa4'),'Contact.lastName');_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xa5'),_0x3e5b('0xa6'));_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xa7'),'Contact.phone');_0xa0a18d['field'](_0x3e5b('0xa8'),_0x3e5b('0xa9'));_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xaa'),_0x3e5b('0xab'));_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xac'),_0x3e5b('0xad'));_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xae'),_0x3e5b('0xaf'));_0xa0a18d[_0x3e5b('0x57')](_0x3e5b('0xb0'),_0x3e5b('0x38'));}if(_0x495217[_0x3e5b('0x23')])_0xa0a18d[_0x3e5b('0x23')](_0x495217[_0x3e5b('0x23')]);if(_0x495217[_0x3e5b('0x21')])_0xa0a18d[_0x3e5b('0x21')](_0x495217[_0x3e5b('0x21')]);return db[_0x3e5b('0x9b')][_0x3e5b('0x4a')](_0xa0a18d[_0x3e5b('0x9c')](),_0x1f734a);})[_0x3e5b('0x2a')](function(_0x408070){if(_0x408070['length']>0x0)_0xf52ebd['where'](_0x3e5b('0xb1'),_[_0x3e5b('0x36')](_0x408070,'id'));return db[_0x3e5b('0x9b')][_0x3e5b('0x4a')](_0xf52ebd['toString'](),_0x1f734a)[_0x3e5b('0x2a')](function(_0x494adc){var _0x1f1062=_[_0x3e5b('0xb2')](_0x494adc,_0x3e5b('0xb3'));var _0x2c08fd=[];_0x408070[_0x3e5b('0x3a')](function(_0x4e49ae){_0x2c08fd[_0x3e5b('0x3c')](updateChatInteraction(_0x4e49ae,_0x216600,_0x1f1062));});return BPromise[_0x3e5b('0xb4')](_0x2c08fd);});});})[_0x3e5b('0x2a')](function(_0x2cedeb){_0x20af6a[_0x3e5b('0xb5')]=_0x2cedeb;return _0x20af6a;})[_0x3e5b('0x2a')](respondWithFilteredResult(_0x588ee7,_0x495217))['catch'](handleError(_0x588ee7,null));};exports['show']=function(_0x3687e0,_0x48ac2f){var _0x54b166={'raw':![],'where':{'id':_0x3687e0[_0x3e5b('0xb6')]['id']}},_0x2cf2f2={};_0x2cf2f2[_0x3e5b('0x49')]=_['keys'](db['ChatInteraction'][_0x3e5b('0x47')]);_0x2cf2f2[_0x3e5b('0x4a')]=_[_0x3e5b('0x4b')](_0x3687e0[_0x3e5b('0x4a')]);_0x2cf2f2[_0x3e5b('0x4c')]=_[_0x3e5b('0x4d')](_0x2cf2f2['model'],_0x2cf2f2['query']);_0x54b166[_0x3e5b('0x4e')]=_[_0x3e5b('0x4d')](_0x2cf2f2[_0x3e5b('0x49')],qs[_0x3e5b('0x4f')](_0x3687e0[_0x3e5b('0x4a')][_0x3e5b('0x4f')]));_0x54b166[_0x3e5b('0x4e')]=_0x54b166[_0x3e5b('0x4e')][_0x3e5b('0x50')]?_0x54b166[_0x3e5b('0x4e')]:_0x2cf2f2[_0x3e5b('0x49')];if(_0x3687e0[_0x3e5b('0x4a')][_0x3e5b('0xb7')]){_0x54b166[_0x3e5b('0xb8')]=[{'all':!![]}];}_0x54b166=_[_0x3e5b('0x30')]({},_0x54b166,_0x3687e0['options']);return db[_0x3e5b('0x9e')][_0x3e5b('0x69')](_0x54b166)[_0x3e5b('0x2a')](handleEntityNotFound(_0x48ac2f,null))[_0x3e5b('0x2a')](respondWithResult(_0x48ac2f,null))[_0x3e5b('0x1e')](handleError(_0x48ac2f,null));};exports[_0x3e5b('0xb9')]=function(_0x99f91b,_0x5456f6){return db[_0x3e5b('0x9e')][_0x3e5b('0xb9')](_0x99f91b[_0x3e5b('0x31')],{})[_0x3e5b('0x2a')](respondWithResult(_0x5456f6,0xc9))['catch'](handleError(_0x5456f6,null));};exports[_0x3e5b('0x28')]=function(_0x25caed,_0x253b17){if(_0x25caed[_0x3e5b('0x31')]['id']){delete _0x25caed[_0x3e5b('0x31')]['id'];}return db[_0x3e5b('0x9e')][_0x3e5b('0x69')]({'where':{'id':_0x25caed[_0x3e5b('0xb6')]['id']}})[_0x3e5b('0x2a')](handleEntityNotFound(_0x253b17,null))[_0x3e5b('0x2a')](saveUpdates(_0x25caed[_0x3e5b('0x31')],null))[_0x3e5b('0x2a')](respondWithResult(_0x253b17,null))['catch'](handleError(_0x253b17,null));};exports[_0x3e5b('0x29')]=function(_0x2231f2,_0x2d0e8a){return db[_0x3e5b('0x9e')][_0x3e5b('0x69')]({'where':{'id':_0x2231f2[_0x3e5b('0xb6')]['id']}})[_0x3e5b('0x2a')](handleEntityNotFound(_0x2d0e8a,null))[_0x3e5b('0x2a')](removeEntity(_0x2d0e8a,null))[_0x3e5b('0x1e')](handleError(_0x2d0e8a,null));};exports['describe']=function(_0x5df21b,_0x3b0192){return db[_0x3e5b('0x9e')][_0x3e5b('0xba')]()['then'](respondWithResult(_0x3b0192,null))[_0x3e5b('0x1e')](handleError(_0x3b0192,null));};exports[_0x3e5b('0xbb')]=function(_0x534729,_0x3f518e){var _0x36c589=_0x534729[_0x3e5b('0xb6')]['id'];var _0x30cf58;var _0x129e7c;var _0x129ba4;return db[_0x3e5b('0x9e')][_0x3e5b('0xbc')]({'where':{'id':_0x36c589}})[_0x3e5b('0x2a')](function(_0x8c2eb2){_0x30cf58=_0x8c2eb2;return db['ChatWebsite'][_0x3e5b('0xbc')]({'where':{'id':_0x8c2eb2['ChatWebsiteId']},'attributes':['id',_0x3e5b('0xbd'),_0x3e5b('0xbe'),_0x3e5b('0xbf'),_0x3e5b('0xc0'),_0x3e5b('0xc1')],'raw':!![]});})['then'](function(_0x169db3){if(_0x169db3&&_0x169db3[_0x3e5b('0xbd')]&&_0x169db3[_0x3e5b('0xbe')]){_0x129e7c=_0x169db3;var _0xe07809={'interaction':{'id':_0x36c589},'agent':{'id':_0x534729[_0x3e5b('0x96')]['id'],'name':_0x534729[_0x3e5b('0x96')][_0x3e5b('0x2d')],'fullname':_0x534729['user'][_0x3e5b('0x37')],'email':_0x534729[_0x3e5b('0x96')]['email']},'contact':_0x534729[_0x3e5b('0x31')][_0x3e5b('0x32')],'account':_0x534729['body']['account']};var _0x5da532={'rejectUnauthorized':![],'method':_0x3e5b('0xc2'),'url':_0x3e5b('0xc3'),'headers':{'X-APIKEY':_0x169db3[_0x3e5b('0xbd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x534729['user']['email']],'buttons':null,'topic':_0x129e7c[_0x3e5b('0xbf')],'note':_[_0x3e5b('0xc4')](_0x129e7c['vidaooNote'])?null:getMustacheRender(_0x129e7c['vidaooNote'],_0xe07809),'metadata':null},'redirect':_0x3e5b('0xc5'),'json':!![]};try{if(!_[_0x3e5b('0xc4')](_0x129e7c[_0x3e5b('0xc1')])){var _0x2a86ac=getMustacheRender(_0x129e7c[_0x3e5b('0xc1')],_0xe07809);var _0x543d09=JSON[_0x3e5b('0x81')](_0x2a86ac);_0x5da532[_0x3e5b('0x31')][_0x3e5b('0xc6')]=_0x543d09;}}catch(_0x5c7523){throw new db[(_0x3e5b('0x8e'))][(_0x3e5b('0xc7'))](_0x3e5b('0xc8'));}return rp(_0x5da532);}else{throw new db['Sequelize']['ValidationError'](_0x3e5b('0xc9'));}})[_0x3e5b('0x2a')](function(_0x1d1f1c){_0x129ba4=_0x1d1f1c;if(_0x129ba4['id']){var _0x87364d={'body':_0x129ba4[_0x3e5b('0xca')],'ChatWebsiteId':_0x129e7c['id'],'ChatInteractionId':_0x30cf58['id'],'direction':'out','UserId':_0x534729[_0x3e5b('0x96')]['id']};return db[_0x3e5b('0xcb')][_0x3e5b('0xb9')](_0x87364d,{});}else{throw new db[(_0x3e5b('0x8e'))][(_0x3e5b('0xc7'))](_0x3e5b('0xcc'));}})['then'](function(){return _0x30cf58[_0x3e5b('0xcd')]({'vidaooSessionId':_0x129ba4['id']});})[_0x3e5b('0x2a')](respondWithResult(_0x3f518e,null))[_0x3e5b('0x1e')](handleError(_0x3f518e,null));};exports['customUpdate']=function(_0xad5598,_0x2dd452){if(_0xad5598[_0x3e5b('0x31')]['id']){delete _0xad5598[_0x3e5b('0x31')]['id'];}return db[_0x3e5b('0x9e')]['find']({'where':{'id':_0xad5598['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x2dd452,null))[_0x3e5b('0x2a')](saveUpdates(_0xad5598[_0x3e5b('0x31')],null))[_0x3e5b('0x2a')](respondWithResult(_0x2dd452,null))['catch'](handleError(_0x2dd452,null));};exports[_0x3e5b('0xce')]=function(_0x5548d3,_0x4b9257){if(_0x5548d3[_0x3e5b('0x31')]['id']){delete _0x5548d3[_0x3e5b('0x31')]['id'];}return db['ChatInteraction'][_0x3e5b('0x69')]({'where':{'id':_0x5548d3['params']['id']}})[_0x3e5b('0x2a')](function(_0x59d692){if(!_0x59d692){logger[_0x3e5b('0x1b')](_0x3e5b('0xcf'),_0x3e5b('0xce'),0x194,_0x3e5b('0xd0'));_0x4b9257['sendStatus'](0x194);}else{if(_0x59d692[_0x3e5b('0x43')]){throw new db[(_0x3e5b('0x8e'))][(_0x3e5b('0xc7'))](_0x3e5b('0xd1'));}}return _0x59d692;})[_0x3e5b('0x2a')](function(_0x59762c){if(_0x59762c){return _0x59762c[_0x3e5b('0x28')]({'closed':_0x5548d3[_0x3e5b('0x31')]['closed'],'disposition':_0x5548d3[_0x3e5b('0x31')]['disposition']})[_0x3e5b('0x2a')](function(_0x3436ad){return _0x3436ad;});}})[_0x3e5b('0x2a')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x5548d3['body'],client9004);})['then'](respondWithResult(_0x4b9257,null))[_0x3e5b('0x1e')](handleError(_0x4b9257,null));};exports[_0x3e5b('0xd2')]=function(_0x93aa1b,_0x5515d0){_0x93aa1b['body']['name']=_0x93aa1b['file'][_0x3e5b('0xd3')];_0x93aa1b[_0x3e5b('0x31')][_0x3e5b('0xd4')]=_0x93aa1b['file'][_0x3e5b('0xd5')];_0x93aa1b[_0x3e5b('0x31')][_0x3e5b('0x75')]=_0x93aa1b['file'][_0x3e5b('0xd6')];return db['Attachment'][_0x3e5b('0xb9')](_0x93aa1b['body'])[_0x3e5b('0x2a')](respondWithResult(_0x5515d0,0xc9))[_0x3e5b('0x1e')](handleError(_0x5515d0,null));};exports[_0x3e5b('0xd7')]=function(_0x414b50,_0x10fc88){return db[_0x3e5b('0x9e')][_0x3e5b('0xbc')]({'where':{'id':_0x414b50['params']['id']},'raw':!![]})[_0x3e5b('0x2a')](handleEntityNotFound(_0x10fc88,null))['then'](function(_0x259c6d){if(_0x259c6d){if(_0x259c6d['closed']){return _0x10fc88[_0x3e5b('0x20')](0x193)['json']({'status':0x193,'message':_0x3e5b('0xd8')});}return db[_0x3e5b('0xd9')][_0x3e5b('0xbc')]({'where':{'id':_0x414b50[_0x3e5b('0x4a')][_0x3e5b('0xda')]},'raw':!![]})[_0x3e5b('0x2a')](handleEntityNotFound(_0x10fc88,null));}})[_0x3e5b('0x2a')](function(_0x4a5c00){if(_0x4a5c00){var _0x48ae5b=_0x4a5c00[_0x3e5b('0xdb')]!==null;var _0xbac664=path[_0x3e5b('0xdc')](config['root'],'server/files/attachments/');if(_0x48ae5b){_0xbac664=path[_0x3e5b('0xdc')](_0xbac664,'offline-chat/');}var _0x2dc14d=path[_0x3e5b('0xdc')](_0xbac664,_0x4a5c00[_0x3e5b('0xd4')]);return _0x10fc88[_0x3e5b('0xdd')](_0x2dc14d);}})[_0x3e5b('0x1e')](handleError(_0x10fc88,null));};exports[_0x3e5b('0xde')]=function(_0x345969,_0x410b7f){var _0x2f5938=null;var _0x5cb09d=null;var _0xc09e4a=null;if(_0x345969[_0x3e5b('0x31')]['id']){delete _0x345969['body']['id'];}if(_0x345969[_0x3e5b('0x31')][_0x3e5b('0xdf')]){_0xc09e4a=path['join'](config[_0x3e5b('0xe0')],_0x3e5b('0xe1'),util['format'](_0x3e5b('0xe2'),Date['now']()));_0x345969[_0x3e5b('0x31')]['pathTranscript']=_0xc09e4a;}return db[_0x3e5b('0x9e')]['find']({'where':{'id':_0x345969[_0x3e5b('0xb6')]['id']},'include':[{'model':db[_0x3e5b('0xcb')],'as':_0x3e5b('0xe3'),'include':[{'model':db[_0x3e5b('0x79')],'as':_0x3e5b('0x79')}]}]})[_0x3e5b('0x2a')](handleEntityNotFound(_0x410b7f,null))[_0x3e5b('0x2a')](saveUpdates(_0x345969['body'],null))[_0x3e5b('0x2a')](function(_0x241517){if(_0x241517){_0x2f5938=_0x241517;return db[_0x3e5b('0xe4')][_0x3e5b('0x69')]({'where':{'id':_0x2f5938[_0x3e5b('0x7e')]}});}})[_0x3e5b('0x2a')](function(_0x2868d4){if(_0x2868d4){_0x5cb09d=_0x2868d4;return db[_0x3e5b('0xe5')][_0x3e5b('0x69')]({'where':{'id':_0x2f5938[_0x3e5b('0xe6')]}});}})[_0x3e5b('0x2a')](function(_0x14cdf0){if(_0x14cdf0){if(_0xc09e4a){var _0x34d587=null;for(var _0x553c84=0x1;_0x553c84<_0x2f5938[_0x3e5b('0xe3')][_0x3e5b('0x50')];++_0x553c84){_0x34d587=_0x2f5938[_0x3e5b('0xe3')][_0x553c84];var _0x3cb9a2=_0x34d587[_0x3e5b('0x43')]?util[_0x3e5b('0xe7')](_0x3e5b('0xe8'),_0x5cb09d[_0x3e5b('0xe9')],_0x34d587[_0x3e5b('0x43')]):_0x3e5b('0xea');var _0x18ddf0=_0x345969['body']['customer']||util['format'](_0x3e5b('0xe8'),_0x3e5b('0xeb'),_0x34d587[_0x3e5b('0xe6')]);switch(_0x5cb09d[_0x3e5b('0xec')]){case _0x3e5b('0xed'):_0x3cb9a2=_0x34d587[_0x3e5b('0x43')]?util[_0x3e5b('0xe7')](_0x3e5b('0xe8'),_0x5cb09d['agentAlias'],_0x34d587[_0x3e5b('0x43')]):_0x3e5b('0xea');break;case _0x3e5b('0xee'):_0x3cb9a2=_0x34d587[_0x3e5b('0x43')]?_0x34d587[_0x3e5b('0x79')][_0x3e5b('0xef')]||_0x34d587[_0x3e5b('0x79')][_0x3e5b('0x37')]:_0x3e5b('0xea');break;case _0x3e5b('0xf0'):_0x3cb9a2=_0x34d587[_0x3e5b('0x43')]?_0x34d587[_0x3e5b('0x79')][_0x3e5b('0x37')]:_0x3e5b('0xea');break;default:_0x3cb9a2=_0x34d587['UserId']?util[_0x3e5b('0xe7')](_0x3e5b('0xe8'),_0x5cb09d[_0x3e5b('0xe9')],_0x34d587[_0x3e5b('0x43')]):_0x3e5b('0xea');}var _0x2288e9=util[_0x3e5b('0xe7')]('[%s]\x20%s:\x20%s\x0a',moment(_0x34d587[_0x3e5b('0xf1')])[_0x3e5b('0xe7')]('MM/DD/YYYY\x20HH:mm:ss'),_0x34d587['direction']==='in'?_0x18ddf0:_0x3cb9a2,_0x34d587[_0x3e5b('0x31')]);if(!_0x34d587[_0x3e5b('0xf2')]){fs[_0x3e5b('0xf3')](_0xc09e4a,_0x2288e9);}}return db[_0x3e5b('0xf4')][_0x3e5b('0xbc')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x3e5b('0xf5'),'raw':!![],'include':[{'model':db[_0x3e5b('0xf6')],'as':_0x3e5b('0xf6'),'raw':!![]}]}]});}}})['then'](function(_0x5195e2){if(!_0x5195e2||!_0x5195e2[_0x3e5b('0xf5')]||!_0x345969[_0x3e5b('0x31')])return _0x2f5938;var _0x33e1ef=_0x5195e2['getSmtpOptions']();return respondWithRpcPromise(_0x3e5b('0xf7'),_0x3e5b('0xf8'),{'account':_0x33e1ef,'message':{'from':util['format'](_0x3e5b('0xf9'),_0x5195e2[_0x3e5b('0x2d')],_0x5195e2[_0x3e5b('0xfa')]||_0x5195e2[_0x3e5b('0xf5')][_0x3e5b('0x96')]),'to':_0x345969['body'][_0x3e5b('0xdf')],'subject':_0x3e5b('0xfb'),'text':util[_0x3e5b('0xe7')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x345969[_0x3e5b('0x31')][_0x3e5b('0xdf')]),'attachments':[{'path':_0xc09e4a}]}})['then'](function(){return _0x2f5938;})['catch'](function(_0x2f56d7){logger[_0x3e5b('0x1b')](_0x2f56d7);});})['then'](respondWithStatusCode(_0x410b7f,0xc8))[_0x3e5b('0x1e')](handleError(_0x410b7f,null));};exports['addMessage']=function(_0x5b07ce,_0x586935){return db[_0x3e5b('0xcb')][_0x3e5b('0x69')]({'where':{'id':_0x5b07ce[_0x3e5b('0xb6')]['id']}})[_0x3e5b('0x2a')](handleEntityNotFound(_0x586935,null))['then'](function(_0x596968){if(_0x596968){return _0x596968[_0x3e5b('0xfc')](_0x5b07ce[_0x3e5b('0x31')][_0x3e5b('0xfd')],_[_0x3e5b('0xfe')](_0x5b07ce['body'],[_0x3e5b('0xfd'),'id'])||{});}})['then'](respondWithResult(_0x586935,null))[_0x3e5b('0x1e')](handleError(_0x586935,null));};exports['getMessages']=function(_0x54d961,_0x63ecb){var _0x52dd5e={'raw':![],'where':{}};var _0x1cd6ed={};var _0x2d8e32={'count':0x0,'rows':[]};return db[_0x3e5b('0x9e')]['findOne']({'where':{'id':_0x54d961['params']['id']}})['then'](handleEntityNotFound(_0x63ecb,null))['then'](function(_0x5d655f){if(_0x5d655f){_0x1cd6ed[_0x3e5b('0x49')]=_[_0x3e5b('0x4b')](db[_0x3e5b('0xcb')][_0x3e5b('0x47')]);_0x1cd6ed['query']=_[_0x3e5b('0x4b')](_0x54d961[_0x3e5b('0x4a')]);_0x1cd6ed[_0x3e5b('0x4c')]=_[_0x3e5b('0x4d')](_0x1cd6ed[_0x3e5b('0x49')],_0x1cd6ed[_0x3e5b('0x4a')]);_0x52dd5e['attributes']=_[_0x3e5b('0x4d')](_0x1cd6ed[_0x3e5b('0x49')],qs[_0x3e5b('0x4f')](_0x54d961[_0x3e5b('0x4a')][_0x3e5b('0x4f')]));_0x52dd5e['attributes']=_0x52dd5e[_0x3e5b('0x4e')][_0x3e5b('0x50')]?_0x52dd5e['attributes']:_0x1cd6ed[_0x3e5b('0x49')];if(!_0x54d961[_0x3e5b('0x4a')][_0x3e5b('0x51')](_0x3e5b('0x52'))){_0x52dd5e['limit']=qs['limit'](_0x54d961[_0x3e5b('0x4a')][_0x3e5b('0x23')]);_0x52dd5e[_0x3e5b('0x21')]=qs['offset'](_0x54d961['query']['offset']);}_0x52dd5e[_0x3e5b('0x53')]=qs[_0x3e5b('0x54')](_0x54d961['query'][_0x3e5b('0x54')]);_0x52dd5e['where']=qs[_0x3e5b('0x4c')](_[_0x3e5b('0x56')](_0x54d961[_0x3e5b('0x4a')],_0x1cd6ed[_0x3e5b('0x4c')]));_0x52dd5e[_0x3e5b('0x55')]['ChatInteractionId']=_0x5d655f['id'];if(_0x54d961['query'][_0x3e5b('0x89')]){_0x52dd5e['where']=_[_0x3e5b('0x30')](_0x52dd5e[_0x3e5b('0x55')],{'$or':_[_0x3e5b('0x36')](_0x52dd5e['attributes'],function(_0x18621c){var _0x1d50f7={};_0x1d50f7[_0x18621c]={'$like':'%'+_0x54d961['query']['filter']+'%'};return _0x1d50f7;})});}if(_0x54d961[_0x3e5b('0x4a')]['$gte']){var _0x592a35=_0x54d961[_0x3e5b('0x4a')][_0x3e5b('0xff')][_0x3e5b('0x39')](',');var _0x26b692={};_0x26b692[_0x592a35[0x0]]={'$gte':moment(_0x592a35[0x1])[_0x3e5b('0xe7')](_0x3e5b('0x100'))};_0x52dd5e[_0x3e5b('0x55')]=_[_0x3e5b('0x30')](_0x52dd5e['where'],_0x26b692);}_0x52dd5e=_['merge']({},_0x52dd5e,_0x54d961[_0x3e5b('0x101')]);return db['ChatMessage']['count']({'where':_0x52dd5e[_0x3e5b('0x55')]})['then'](function(_0x1fe234){_0x2d8e32[_0x3e5b('0x24')]=_0x1fe234;if(_0x54d961[_0x3e5b('0x4a')][_0x3e5b('0xb7')]){_0x52dd5e[_0x3e5b('0xb8')]=[{'all':!![]}];}return db[_0x3e5b('0xcb')][_0x3e5b('0x102')](_0x52dd5e);})[_0x3e5b('0x2a')](function(_0x17d49a){_0x2d8e32[_0x3e5b('0xb5')]=_0x17d49a;return _0x2d8e32;});}})['then'](respondWithFilteredResult(_0x63ecb,_0x52dd5e))[_0x3e5b('0x1e')](handleError(_0x63ecb,null));};exports['getMyMessages']=function(_0x496569,_0x229231){var _0x2b6f7f={'where':{}},_0x55f441={},_0x1a95c2={'count':0x0,'rows':[]};return db[_0x3e5b('0x9e')][_0x3e5b('0xbc')]({'where':{'id':_0x496569[_0x3e5b('0xb6')]['id']}})['then'](handleEntityNotFound(_0x229231,null))[_0x3e5b('0x2a')](function(_0x5beb7b){if(_0x5beb7b){_0x55f441[_0x3e5b('0x49')]=_[_0x3e5b('0x4b')](db[_0x3e5b('0xcb')][_0x3e5b('0x47')]);_0x55f441['query']=_[_0x3e5b('0x4b')](_0x496569[_0x3e5b('0x4a')]);_0x55f441[_0x3e5b('0x4c')]=_[_0x3e5b('0x4d')](_0x55f441[_0x3e5b('0x49')],_0x55f441['query']);_0x2b6f7f[_0x3e5b('0x4e')]=_[_0x3e5b('0x4d')](_0x55f441[_0x3e5b('0x49')],qs[_0x3e5b('0x4f')](_0x496569['query']['fields']));_0x2b6f7f[_0x3e5b('0x4e')]=_0x2b6f7f[_0x3e5b('0x4e')][_0x3e5b('0x50')]?_0x2b6f7f[_0x3e5b('0x4e')]:_0x55f441['model'];if(!_0x496569[_0x3e5b('0x4a')]['hasOwnProperty'](_0x3e5b('0x52'))){_0x2b6f7f['limit']=qs[_0x3e5b('0x23')](_0x496569[_0x3e5b('0x4a')][_0x3e5b('0x23')]);_0x2b6f7f[_0x3e5b('0x21')]=qs[_0x3e5b('0x21')](_0x496569[_0x3e5b('0x4a')][_0x3e5b('0x21')]);}_0x2b6f7f[_0x3e5b('0x53')]=qs[_0x3e5b('0x54')](_0x496569[_0x3e5b('0x4a')][_0x3e5b('0x54')]);_0x2b6f7f[_0x3e5b('0x55')]=qs[_0x3e5b('0x4c')](_[_0x3e5b('0x56')](_0x496569[_0x3e5b('0x4a')],_0x55f441[_0x3e5b('0x4c')]));_0x2b6f7f['where']['ChatInteractionId']=_0x5beb7b['id'];if(_0x496569['query'][_0x3e5b('0x89')]){_0x2b6f7f[_0x3e5b('0x55')]=_[_0x3e5b('0x30')](_0x2b6f7f['where'],{'$or':_[_0x3e5b('0x36')](_0x2b6f7f[_0x3e5b('0x4e')],function(_0x452450){var _0x1f4ca7={};_0x1f4ca7[_0x452450]={'$like':'%'+_0x496569[_0x3e5b('0x4a')][_0x3e5b('0x89')]+'%'};return _0x1f4ca7;})});}_0x2b6f7f[_0x3e5b('0x55')][_0x3e5b('0xf2')]=![];if(_0x496569[_0x3e5b('0x4a')]['id']){_0x2b6f7f[_0x3e5b('0x55')]['id']={'$gt':_0x496569['query']['id']};}_0x2b6f7f=_[_0x3e5b('0x30')]({},_0x2b6f7f,_0x496569[_0x3e5b('0x101')]);return db['ChatMessage'][_0x3e5b('0x24')]({'where':_0x2b6f7f[_0x3e5b('0x55')]})[_0x3e5b('0x2a')](function(_0x3e7663){_0x1a95c2['count']=_0x3e7663;_0x2b6f7f[_0x3e5b('0xb8')]=[];if(_0x496569['query'][_0x3e5b('0x103')]){_0x2b6f7f[_0x3e5b('0xb8')]['push']({'model':db[_0x3e5b('0x79')],'as':_0x3e5b('0x79'),'attributes':['id','fullname','alias']});}if(_0x496569['query'][_0x3e5b('0xb7')]){_0x2b6f7f[_0x3e5b('0xb8')]=[{'all':!![]}];}return db[_0x3e5b('0xcb')][_0x3e5b('0x102')](_0x2b6f7f);})[_0x3e5b('0x2a')](function(_0xf026f){_0x1a95c2[_0x3e5b('0xb5')]=_0xf026f;return _0x1a95c2;});}})[_0x3e5b('0x2a')](respondWithFilteredResult(_0x229231,_0x2b6f7f))[_0x3e5b('0x1e')](handleError(_0x229231,null));};exports[_0x3e5b('0x104')]=function(_0x2127ca,_0x34d441){return db[_0x3e5b('0x9e')]['find']({'where':{'id':_0x2127ca[_0x3e5b('0xb6')]['id']}})[_0x3e5b('0x2a')](handleEntityNotFound(_0x34d441,null))['then'](function(_0x57e137){if(_0x57e137){return _0x57e137['setTags'](_0x2127ca[_0x3e5b('0x31')]['ids'],_[_0x3e5b('0xfe')](_0x2127ca[_0x3e5b('0x31')],[_0x3e5b('0xfd'),'id'])||{})[_0x3e5b('0x105')](function(){return db['Tag']['findAll']({'attributes':['id',_0x3e5b('0x2d'),_0x3e5b('0x106')],'where':{'id':_0x2127ca[_0x3e5b('0x31')][_0x3e5b('0xfd')]}});})[_0x3e5b('0x2a')](function(_0x123d9e){socket['emit']('chatInteractionTags:save',{'id':Number(_0x2127ca[_0x3e5b('0xb6')]['id']),'tags':_0x123d9e||[]});return{'id':Number(_0x2127ca[_0x3e5b('0xb6')]['id']),'tags':_0x123d9e||[]};});}})['then'](respondWithResult(_0x34d441,null))['catch'](handleError(_0x34d441,null));};exports[_0x3e5b('0x107')]=function(_0x38c7a8,_0x40e4bb){return db[_0x3e5b('0x9e')]['find']({'where':{'id':_0x38c7a8[_0x3e5b('0xb6')]['id']}})[_0x3e5b('0x2a')](handleEntityNotFound(_0x40e4bb,null))[_0x3e5b('0x2a')](function(_0x153d8f){if(_0x153d8f){return _0x153d8f[_0x3e5b('0x107')](_0x38c7a8[_0x3e5b('0x4a')][_0x3e5b('0xfd')]);}})[_0x3e5b('0x2a')](respondWithStatusCode(_0x40e4bb,null))[_0x3e5b('0x1e')](handleError(_0x40e4bb,null));};exports['download']=function(_0x5756f9,_0x584567){var _0xe0fa7e=moment()[_0x3e5b('0x108')]()[_0x3e5b('0x9c')]();var _0x43d8ed=path[_0x3e5b('0xdc')](config[_0x3e5b('0xe0')],'server','files',_0x3e5b('0x109'));var _0x38aac3=path[_0x3e5b('0xdc')](config[_0x3e5b('0xe0')],_0x3e5b('0x10a'),_0x3e5b('0x10b'),_0x3e5b('0x10c'));var _0x5c4b44=path[_0x3e5b('0xdc')](_0x43d8ed,_0xe0fa7e);var _0x35430b=util[_0x3e5b('0xe7')](_0x3e5b('0x10d'),_0x5756f9[_0x3e5b('0xb6')]['id'],_0xe0fa7e);var _0x434e78=path[_0x3e5b('0xdc')](_0x43d8ed,_0x35430b);var _0x1583d7=[];_0x1583d7[_0x3e5b('0x3c')]({'model':db[_0x3e5b('0x79')],'as':_0x3e5b('0x79'),'attributes':['id','fullname'],'raw':!![]});_0x1583d7[_0x3e5b('0x3c')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x3e5b('0x10e'),_0x3e5b('0x10f')],'raw':!![]});if(_0x5756f9[_0x3e5b('0x4a')][_0x3e5b('0x10c')]){_0x1583d7[_0x3e5b('0x3c')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a3e20=[{'model':db[_0x3e5b('0xcb')],'as':_0x3e5b('0xe3'),'attributes':['id','body',_0x3e5b('0xf1'),_0x3e5b('0x110'),_0x3e5b('0xf2'),'read'],'include':_0x1583d7}];_0x3a3e20[_0x3e5b('0x3c')]({'model':db[_0x3e5b('0xe4')],'as':_0x3e5b('0x111'),'attributes':['id',_0x3e5b('0x2d')]});_0x3a3e20[_0x3e5b('0x3c')]({'model':db[_0x3e5b('0x79')],'as':_0x3e5b('0x112'),'attributes':['id',_0x3e5b('0x37')]});return db[_0x3e5b('0x9e')][_0x3e5b('0x69')]({'where':{'id':_0x5756f9[_0x3e5b('0xb6')]['id']},'include':_0x3a3e20})[_0x3e5b('0x2a')](handleEntityNotFound(_0x584567,null))[_0x3e5b('0x2a')](function(_0x4fc4a4){if(_0x4fc4a4){var _0x2ccb39=_0x4fc4a4['get']({'plain':!![]});fs[_0x3e5b('0x113')](_0x5c4b44);var _0x2fb159={'channel':_0x3e5b('0x114'),'account':_0x2ccb39[_0x3e5b('0x111')]['name'],'agent':_0x2ccb39[_0x3e5b('0x112')]?_0x2ccb39[_0x3e5b('0x112')][_0x3e5b('0x37')]:'N.A.','createdAt':moment(_0x2ccb39[_0x3e5b('0xf1')])[_0x3e5b('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3e5b('0x9c')](),'closedAt':_0x2ccb39['closed']?moment(_0x2ccb39[_0x3e5b('0x115')])[_0x3e5b('0xe7')](_0x3e5b('0x100'))[_0x3e5b('0x9c')]():'','disposition':_0x2ccb39[_0x3e5b('0x45')],'chatInfo':{'browser':_0x2ccb39[_0x3e5b('0x116')],'os':_0x2ccb39[_0x3e5b('0x117')],'referer':_0x2ccb39[_0x3e5b('0x118')],'customerIp':_0x2ccb39[_0x3e5b('0x119')],'customerPort':_0x2ccb39['customerPort']?_0x2ccb39['customerPort']:'N.A.'},'messages':_(_0x2ccb39[_0x3e5b('0xe3')])['tail']()[_0x3e5b('0x89')]({'secret':![]})['map'](function(_0x2aef9e){if(_0x2aef9e[_0x3e5b('0xd9')]){var _0x126ec8=path[_0x3e5b('0xdc')](_0x38aac3,_0x2aef9e[_0x3e5b('0xd9')]['basename']);if(fs[_0x3e5b('0x11a')](_0x126ec8)){fs['createReadStream'](_0x126ec8)['pipe'](fs[_0x3e5b('0x11b')](path['join'](_0x5c4b44,_0x2aef9e[_0x3e5b('0xd9')]['basename'])));}}return{'date':moment(_0x2aef9e[_0x3e5b('0xf1')])[_0x3e5b('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3e5b('0x9c')](),'sender':_0x2aef9e[_0x3e5b('0x110')]===_0x3e5b('0x11c')?_0x2aef9e[_0x3e5b('0x79')]?_0x2aef9e[_0x3e5b('0x79')]['fullname']:'System':_0x2aef9e[_0x3e5b('0x6f')][_0x3e5b('0x10e')]+(_0x2aef9e[_0x3e5b('0x6f')][_0x3e5b('0x10f')]?'\x20'+_0x2aef9e['Contact']['lastName']:''),'body':_0x2aef9e['Attachment']?_0x2aef9e[_0x3e5b('0xd9')][_0x3e5b('0xd4')]:_0x2aef9e[_0x3e5b('0x31')],'direction':_0x2aef9e[_0x3e5b('0x110')]===_0x3e5b('0x11c')?'A':'C','secret':_0x2aef9e[_0x3e5b('0xf2')],'read':_0x2aef9e[_0x3e5b('0x84')],'attachment':_0x2aef9e[_0x3e5b('0xd9')]};})[_0x3e5b('0x6b')]()};return ejs[_0x3e5b('0x11d')](path[_0x3e5b('0xdc')](config[_0x3e5b('0xe0')],'server',_0x3e5b('0x11e'),_0x3e5b('0x11f')),{'interaction':_0x2fb159})['then'](function(_0xe34a63){var _0x34eb0c=path['join'](_0x5c4b44,_0x3e5b('0x120')+_0x2ccb39['id']+'-'+_0xe0fa7e+'.pdf');var _0x1b3662={'path':_0x34eb0c,'channel':'Chat','interactionId':_0x2ccb39['id']};return pdf[_0x3e5b('0x121')](_0xe34a63,_0x1b3662);})[_0x3e5b('0x2a')](function(){return new Promise(function(_0x42923b,_0x433fa3){zipdir(_0x5c4b44,{'saveTo':_0x434e78},function(_0x954e61,_0x344be2){if(_0x954e61)return _0x433fa3(_0x954e61);return _0x42923b(_0x344be2);});})[_0x3e5b('0x2a')](function(){return new BPromise(function(_0x4037a7,_0x41c956){rimraf(_0x5c4b44,function(_0x5f0004){if(_0x5f0004)_0x41c956(_0x5f0004);return _0x4037a7();});});})[_0x3e5b('0x2a')](function(){return _0x584567[_0x3e5b('0xdd')](_0x434e78,_0x35430b,function(_0x581db2){if(_0x581db2){logger[_0x3e5b('0x1b')](_0x3e5b('0x122'),_0x581db2);}else{fs[_0x3e5b('0x123')](_0x434e78);}});});});}else{return _0x584567['sendStatus'](0xc8);}})[_0x3e5b('0x1e')](handleError(_0x584567,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a1271b5..579a073 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9915=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users'];(function(_0xa5662e,_0x4f47b0){var _0x344dda=function(_0x106a04){while(--_0x106a04){_0xa5662e['push'](_0xa5662e['shift']());}};_0x344dda(++_0x4f47b0);}(_0x9915,0xd9));var _0x5991=function(_0x25faae,_0x15b88b){_0x25faae=_0x25faae-0x0;var _0x460ded=_0x9915[_0x25faae];return _0x460ded;};'use strict';var EventEmitter=require(_0x5991('0x0'));var ChatInteraction=require(_0x5991('0x1'))['db'][_0x5991('0x2')];var ChatMessage=require(_0x5991('0x1'))['db'][_0x5991('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5991('0x4')](0x0);var events={'afterCreate':_0x5991('0x5'),'afterUpdate':_0x5991('0x6'),'afterDestroy':_0x5991('0x7')};function emitEvent(_0x3b7f5b){return function(_0x3a4046,_0x1008b0,_0x43ea55){_0x3a4046['getUsers']({'attributes':['id'],'raw':!![]})[_0x5991('0x8')](function(_0x395353){_0x3a4046[_0x5991('0x9')](_0x5991('0xa'),_0x395353['map'](function(_0x18876d){return{'id':_0x18876d['id']};}));return ChatMessage[_0x5991('0xb')]({'where':{'ChatInteractionId':_0x3a4046['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5991('0x8')](function(_0x1bf748){_0x3a4046[_0x5991('0x9')](_0x5991('0xc'),_0x1bf748[_0x5991('0xd')]);ChatInteractionEvents[_0x5991('0xe')](_0x3b7f5b+':'+_0x3a4046['id'],_0x3a4046);ChatInteractionEvents['emit'](_0x3b7f5b,_0x3a4046);_0x43ea55(null);})[_0x5991('0xf')](_0x43ea55(null));};}for(var e in events){if(events[_0x5991('0x10')](e)){var event=events[e];ChatInteraction[_0x5991('0x11')](e,emitEvent(event));}}module[_0x5991('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x8819=['Users','map','findAll','then','unreadMessages','emit','catch','exports','events','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','setDataValue'];(function(_0x528676,_0x5c61ec){var _0x5e93fb=function(_0x131d12){while(--_0x131d12){_0x528676['push'](_0x528676['shift']());}};_0x5e93fb(++_0x5c61ec);}(_0x8819,0x1e8));var _0x9881=function(_0x274705,_0x21774b){_0x274705=_0x274705-0x0;var _0x4e83cd=_0x8819[_0x274705];return _0x4e83cd;};'use strict';var EventEmitter=require(_0x9881('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x9881('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x9881('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9881('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9881('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ec718){return function(_0x4718e5,_0x209616,_0xd4b1c1){_0x4718e5[_0x9881('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c0377){_0x4718e5[_0x9881('0x6')](_0x9881('0x7'),_0x5c0377[_0x9881('0x8')](function(_0x35df8a){return{'id':_0x35df8a['id']};}));return ChatMessage[_0x9881('0x9')]({'where':{'ChatInteractionId':_0x4718e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9881('0xa')](function(_0x4fb853){_0x4718e5[_0x9881('0x6')](_0x9881('0xb'),_0x4fb853['length']);ChatInteractionEvents[_0x9881('0xc')](_0x4ec718+':'+_0x4718e5['id'],_0x4718e5);ChatInteractionEvents[_0x9881('0xc')](_0x4ec718,_0x4718e5);_0xd4b1c1(null);})[_0x9881('0xd')](_0xd4b1c1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x9881('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 8292eeb..2f1b308 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32bf=['ChatInteraction','closed','closedAt','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x27cbf1,_0x54e403){var _0x399ee3=function(_0x533835){while(--_0x533835){_0x27cbf1['push'](_0x27cbf1['shift']());}};_0x399ee3(++_0x54e403);}(_0x32bf,0x154));var _0xf32b=function(_0x4fcc33,_0x37f357){_0x4fcc33=_0x4fcc33-0x0;var _0x35da2f=_0x32bf[_0x4fcc33];return _0x35da2f;};'use strict';var _=require(_0xf32b('0x0'));var util=require(_0xf32b('0x1'));var logger=require(_0xf32b('0x2'))(_0xf32b('0x3'));var moment=require(_0xf32b('0x4'));var BPromise=require(_0xf32b('0x5'));var rp=require(_0xf32b('0x6'));var fs=require('fs');var path=require(_0xf32b('0x7'));var rimraf=require('rimraf');var config=require(_0xf32b('0x8'));var attributes=require(_0xf32b('0x9'));module[_0xf32b('0xa')]=function(_0x5cac46,_0x448913){return _0x5cac46[_0xf32b('0xb')](_0xf32b('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x534e74,_0x4465b1,_0x3f0ca6){if(_0x534e74['changed'](_0xf32b('0xd'))){_0x534e74[_0xf32b('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3f0ca6(null,_0x534e74);}},'charset':'utf8mb4','collate':_0xf32b('0xf')});};
\ No newline at end of file
+var _0x1cae=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci'];(function(_0xf0af0c,_0x41b6aa){var _0x40aa5f=function(_0x48df97){while(--_0x48df97){_0xf0af0c['push'](_0xf0af0c['shift']());}};_0x40aa5f(++_0x41b6aa);}(_0x1cae,0x1e0));var _0xe1ca=function(_0x4621f1,_0x5f1cdb){_0x4621f1=_0x4621f1-0x0;var _0x48d3cb=_0x1cae[_0x4621f1];return _0x48d3cb;};'use strict';var _=require(_0xe1ca('0x0'));var util=require(_0xe1ca('0x1'));var logger=require(_0xe1ca('0x2'))(_0xe1ca('0x3'));var moment=require(_0xe1ca('0x4'));var BPromise=require(_0xe1ca('0x5'));var rp=require(_0xe1ca('0x6'));var fs=require('fs');var path=require(_0xe1ca('0x7'));var rimraf=require(_0xe1ca('0x8'));var config=require(_0xe1ca('0x9'));var attributes=require(_0xe1ca('0xa'));module[_0xe1ca('0xb')]=function(_0x4df2f6,_0x2b0f28){return _0x4df2f6[_0xe1ca('0xc')](_0xe1ca('0xd'),attributes,{'tableName':_0xe1ca('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x142c30,_0x1d9861,_0x4e3523){if(_0x142c30[_0xe1ca('0xf')](_0xe1ca('0x10'))){_0x142c30[_0xe1ca('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4e3523(null,_0x142c30);}},'charset':_0xe1ca('0x12'),'collate':_0xe1ca('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e1be1c6..c9aa55b 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd014=['then','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','info','result','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','register','request'];(function(_0x3cc0e2,_0xf41d9d){var _0x5a073f=function(_0x3614de){while(--_0x3614de){_0x3cc0e2['push'](_0x3cc0e2['shift']());}};_0x5a073f(++_0xf41d9d);}(_0xd014,0xfc));var _0x4d01=function(_0x4ebfb7,_0x4a44eb){_0x4ebfb7=_0x4ebfb7-0x0;var _0x5bf7bf=_0xd014[_0x4ebfb7];return _0x5bf7bf;};'use strict';var _=require(_0x4d01('0x0'));var util=require(_0x4d01('0x1'));var moment=require('moment');var BPromise=require(_0x4d01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d01('0x3'));var db=require(_0x4d01('0x4'))['db'];var utils=require(_0x4d01('0x5'));var logger=require(_0x4d01('0x6'))(_0x4d01('0x7'));var config=require(_0x4d01('0x8'));var jayson=require(_0x4d01('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x4d01('0xa')]=_[_0x4d01('0xb')](config[_0x4d01('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d01('0xa')]));require('./chatInteraction.socket')[_0x4d01('0xc')](socket);function respondWithRpcPromise(_0x4f1387,_0x44c357,_0xe3399e){return new BPromise(function(_0x31a1b0,_0x496d03){return client[_0x4d01('0xd')](_0x4f1387,_0xe3399e)[_0x4d01('0xe')](function(_0x49df08){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x44c357,_0x4d01('0xf'));logger[_0x4d01('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x44c357,_0x4d01('0xf'),JSON[_0x4d01('0x11')](_0x49df08));if(_0x49df08[_0x4d01('0x12')]){if(_0x49df08['error']['code']===0x1f4){logger[_0x4d01('0x12')](_0x4d01('0x13'),_0x44c357,_0x49df08[_0x4d01('0x12')][_0x4d01('0x14')]);return _0x496d03(_0x49df08[_0x4d01('0x12')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x44c357,_0x49df08['error'][_0x4d01('0x14')]);return _0x31a1b0(_0x49df08[_0x4d01('0x12')][_0x4d01('0x14')]);}else{logger[_0x4d01('0x15')](_0x4d01('0x13'),_0x44c357,_0x4d01('0xf'));_0x31a1b0(_0x49df08[_0x4d01('0x16')][_0x4d01('0x14')]);}})['catch'](function(_0x5ed0ac){logger[_0x4d01('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x44c357,_0x5ed0ac);_0x496d03(_0x5ed0ac);});});}exports['UpdateChatInteraction']=function(_0x1df810){var _0x3fc3ab=this;return new Promise(function(_0x179709,_0x4bbdab){return db[_0x4d01('0x17')][_0x4d01('0x18')](_0x1df810[_0x4d01('0x19')],{'raw':_0x1df810['options']?_0x1df810[_0x4d01('0x1a')][_0x4d01('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1df810[_0x4d01('0x1a')]?_0x1df810['options'][_0x4d01('0x1c')]||null:null,'attributes':_0x1df810[_0x4d01('0x1a')]?_0x1df810[_0x4d01('0x1a')][_0x4d01('0x1d')]||null:null,'limit':_0x1df810['options']?_0x1df810[_0x4d01('0x1a')][_0x4d01('0x1e')]||null:null})['then'](function(_0x386a30){logger[_0x4d01('0x15')](_0x4d01('0x1f'),_0x1df810);logger[_0x4d01('0x10')](_0x4d01('0x1f'),_0x1df810,JSON[_0x4d01('0x11')](_0x386a30));_0x179709(_0x386a30);})['catch'](function(_0x58f013){logger[_0x4d01('0x12')](_0x4d01('0x1f'),_0x58f013['message'],_0x1df810);_0x4bbdab(_0x3fc3ab[_0x4d01('0x12')](0x1f4,_0x58f013[_0x4d01('0x14')]));});});};exports[_0x4d01('0x20')]=function(_0x48c352){return new Promise(function(_0x51235a,_0x19243b){return db[_0x4d01('0x17')]['find']({'where':_0x48c352[_0x4d01('0x1a')]?_0x48c352[_0x4d01('0x1a')][_0x4d01('0x1c')]||null:null})['then'](function(_0x18dfaa){if(_0x18dfaa){return _0x18dfaa[_0x4d01('0x21')](_0x48c352[_0x4d01('0x19')][_0x4d01('0x22')],_[_0x4d01('0x23')](_0x48c352['body'],[_0x4d01('0x22'),'id'])||{});}})[_0x4d01('0x24')](function(_0x3a8d6e){logger[_0x4d01('0x15')](_0x4d01('0x25'),_0x48c352);logger[_0x4d01('0x10')](_0x4d01('0x25'),_0x48c352,JSON['stringify'](_0x3a8d6e));_0x51235a(_0x3a8d6e);})['catch'](function(_0x3e9667){logger[_0x4d01('0x12')]('AddTags',_0x3e9667[_0x4d01('0x14')],_0x48c352);_0x19243b(_this[_0x4d01('0x12')](0x1f4,_0x3e9667[_0x4d01('0x14')]));});});};
\ No newline at end of file
+var _0xb572=['catch','ChatInteraction','update','body','options','attributes','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','where','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xeab8e1,_0x496fd0){var _0xcad265=function(_0x9440f4){while(--_0x9440f4){_0xeab8e1['push'](_0xeab8e1['shift']());}};_0xcad265(++_0x496fd0);}(_0xb572,0xb3));var _0x2b57=function(_0x1c2eca,_0x3e9b0b){_0x1c2eca=_0x1c2eca-0x0;var _0x2c7c68=_0xb572[_0x1c2eca];return _0x2c7c68;};'use strict';var _=require('lodash');var util=require(_0x2b57('0x0'));var moment=require(_0x2b57('0x1'));var BPromise=require(_0x2b57('0x2'));var rs=require(_0x2b57('0x3'));var fs=require('fs');var Redis=require(_0x2b57('0x4'));var db=require(_0x2b57('0x5'))['db'];var utils=require(_0x2b57('0x6'));var logger=require(_0x2b57('0x7'))('rpc');var config=require(_0x2b57('0x8'));var jayson=require(_0x2b57('0x9'));var client=jayson[_0x2b57('0xa')]['http']({'port':0x232a});config[_0x2b57('0xb')]=_['defaults'](config[_0x2b57('0xb')],{'host':_0x2b57('0xc'),'port':0x18eb});var socket=require(_0x2b57('0xd'))(new Redis(config[_0x2b57('0xb')]));require(_0x2b57('0xe'))[_0x2b57('0xf')](socket);function respondWithRpcPromise(_0xd7d485,_0x5af70b,_0xcdd74d){return new BPromise(function(_0x4f7722,_0x58a799){return client['request'](_0xd7d485,_0xcdd74d)[_0x2b57('0x10')](function(_0x40eb3b){logger[_0x2b57('0x11')](_0x2b57('0x12'),_0x5af70b,_0x2b57('0x13'));logger[_0x2b57('0x14')](_0x2b57('0x15'),_0x5af70b,_0x2b57('0x13'),JSON['stringify'](_0x40eb3b));if(_0x40eb3b[_0x2b57('0x16')]){if(_0x40eb3b['error'][_0x2b57('0x17')]===0x1f4){logger[_0x2b57('0x16')](_0x2b57('0x12'),_0x5af70b,_0x40eb3b[_0x2b57('0x16')][_0x2b57('0x18')]);return _0x58a799(_0x40eb3b[_0x2b57('0x16')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5af70b,_0x40eb3b[_0x2b57('0x16')][_0x2b57('0x18')]);return _0x4f7722(_0x40eb3b[_0x2b57('0x16')][_0x2b57('0x18')]);}else{logger[_0x2b57('0x11')](_0x2b57('0x12'),_0x5af70b,'request\x20sent');_0x4f7722(_0x40eb3b[_0x2b57('0x19')][_0x2b57('0x18')]);}})[_0x2b57('0x1a')](function(_0x2ecb1a){logger[_0x2b57('0x16')](_0x2b57('0x12'),_0x5af70b,_0x2ecb1a);_0x58a799(_0x2ecb1a);});});}exports['UpdateChatInteraction']=function(_0x14a6e7){var _0x4f82c3=this;return new Promise(function(_0x142154,_0x38a23b){return db[_0x2b57('0x1b')][_0x2b57('0x1c')](_0x14a6e7[_0x2b57('0x1d')],{'raw':_0x14a6e7[_0x2b57('0x1e')]?_0x14a6e7[_0x2b57('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14a6e7[_0x2b57('0x1e')]?_0x14a6e7['options']['where']||null:null,'attributes':_0x14a6e7[_0x2b57('0x1e')]?_0x14a6e7[_0x2b57('0x1e')][_0x2b57('0x1f')]||null:null,'limit':_0x14a6e7[_0x2b57('0x1e')]?_0x14a6e7[_0x2b57('0x1e')]['limit']||null:null})[_0x2b57('0x10')](function(_0x28a846){logger['info'](_0x2b57('0x20'),_0x14a6e7);logger[_0x2b57('0x14')](_0x2b57('0x20'),_0x14a6e7,JSON[_0x2b57('0x21')](_0x28a846));_0x142154(_0x28a846);})[_0x2b57('0x1a')](function(_0x5284d0){logger[_0x2b57('0x16')](_0x2b57('0x20'),_0x5284d0[_0x2b57('0x18')],_0x14a6e7);_0x38a23b(_0x4f82c3[_0x2b57('0x16')](0x1f4,_0x5284d0[_0x2b57('0x18')]));});});};exports[_0x2b57('0x22')]=function(_0x2873d8){return new Promise(function(_0x2569a1,_0x26945a){return db[_0x2b57('0x1b')][_0x2b57('0x23')]({'where':_0x2873d8[_0x2b57('0x1e')]?_0x2873d8[_0x2b57('0x1e')][_0x2b57('0x24')]||null:null})[_0x2b57('0x10')](function(_0x489878){if(_0x489878){return _0x489878[_0x2b57('0x25')](_0x2873d8[_0x2b57('0x1d')][_0x2b57('0x26')],_[_0x2b57('0x27')](_0x2873d8['body'],[_0x2b57('0x26'),'id'])||{});}})['spread'](function(_0x3fe869){logger[_0x2b57('0x11')]('AddTags',_0x2873d8);logger[_0x2b57('0x14')](_0x2b57('0x28'),_0x2873d8,JSON['stringify'](_0x3fe869));_0x2569a1(_0x3fe869);})[_0x2b57('0x1a')](function(_0x233378){logger['error'](_0x2b57('0x28'),_0x233378[_0x2b57('0x18')],_0x2873d8);_0x26945a(_this[_0x2b57('0x16')](0x1f4,_0x233378['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 9bb74f1..c91e680 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa395=['save','remove','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x7dd36b,_0x1cdb4c){var _0x4b87e0=function(_0x464b4c){while(--_0x464b4c){_0x7dd36b['push'](_0x7dd36b['shift']());}};_0x4b87e0(++_0x1cdb4c);}(_0xa395,0x14f));var _0x5a39=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa395[_0x37bd26];return _0xe83dc4;};'use strict';var ChatInteractionEvents=require(_0x5a39('0x0'));var events=[_0x5a39('0x1'),_0x5a39('0x2'),'update'];function createListener(_0x25e2e0,_0x306e82){return function(_0x5885ea){_0x306e82[_0x5a39('0x3')](_0x25e2e0,_0x5885ea);};}function removeListener(_0x2ed55c,_0xaa6028){return function(){ChatInteractionEvents[_0x5a39('0x4')](_0x2ed55c,_0xaa6028);};}exports[_0x5a39('0x5')]=function(_0x178b5f){for(var _0x261187=0x0,_0x629632=events['length'];_0x261187<_0x629632;_0x261187++){var _0x5b2a15=events[_0x261187];var _0x5d28e5=createListener(_0x5a39('0x6')+_0x5b2a15,_0x178b5f);ChatInteractionEvents['on'](_0x5b2a15,_0x5d28e5);}};
\ No newline at end of file
+var _0xc230=['update','emit','removeListener','register','length','./chatInteraction.events','save'];(function(_0x19c4bd,_0x19a00d){var _0x2fc7b5=function(_0x24fdab){while(--_0x24fdab){_0x19c4bd['push'](_0x19c4bd['shift']());}};_0x2fc7b5(++_0x19a00d);}(_0xc230,0xf3));var _0x0c23=function(_0x190a56,_0x4e3ff8){_0x190a56=_0x190a56-0x0;var _0x27adbd=_0xc230[_0x190a56];return _0x27adbd;};'use strict';var ChatInteractionEvents=require(_0x0c23('0x0'));var events=[_0x0c23('0x1'),'remove',_0x0c23('0x2')];function createListener(_0x3b5826,_0x437a2e){return function(_0x1f6427){_0x437a2e[_0x0c23('0x3')](_0x3b5826,_0x1f6427);};}function removeListener(_0x5647ed,_0x38eee4){return function(){ChatInteractionEvents[_0x0c23('0x4')](_0x5647ed,_0x38eee4);};}exports[_0x0c23('0x5')]=function(_0x2dc25f){for(var _0x190626=0x0,_0x2fe7c2=events[_0x0c23('0x6')];_0x190626<_0x2fe7c2;_0x190626++){var _0x5bd698=events[_0x190626];var _0x15ff4e=createListener('chatInteraction:'+_0x5bd698,_0x2dc25f);ChatInteractionEvents['on'](_0x5bd698,_0x15ff4e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 24bd1e0..2f008fe 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa54e=['chatinteraction:addtags','/:id','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0xa54e,0xaa));var _0xea54=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0xa54e[_0x285824];return _0x311d7e;};'use strict';var multer=require(_0xea54('0x0'));var util=require(_0xea54('0x1'));var path=require('path');var timeout=require(_0xea54('0x2'));var express=require('express');var router=express[_0xea54('0x3')]();var fs_extra=require(_0xea54('0x4'));var auth=require(_0xea54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea54('0x6'));var controller=require(_0xea54('0x7'));router[_0xea54('0x8')]('/',auth['isAuthenticated'](),controller[_0xea54('0x9')]);router[_0xea54('0x8')](_0xea54('0xa'),auth[_0xea54('0xb')](),controller['describe']);router[_0xea54('0x8')]('/:id',auth[_0xea54('0xc')](),controller[_0xea54('0xd')]);router[_0xea54('0x8')](_0xea54('0xe'),auth[_0xea54('0xc')](),controller[_0xea54('0xf')]);router[_0xea54('0x8')](_0xea54('0x10'),auth[_0xea54('0xb')](),controller[_0xea54('0x11')]);router[_0xea54('0x8')](_0xea54('0x12'),auth[_0xea54('0xc')](),controller[_0xea54('0x13')]);router[_0xea54('0x8')](_0xea54('0x14'),auth[_0xea54('0xb')](),controller[_0xea54('0x15')]);router[_0xea54('0x16')]('/',auth['isAuthenticated'](),controller[_0xea54('0x17')]);router['post']('/:id/vidaoo',auth[_0xea54('0xb')](),controller[_0xea54('0x18')]);var upload=multer({'storage':multer[_0xea54('0x19')]({'destination':function(_0x2e54b5,_0x232c3c,_0x7a7788){_0x7a7788(null,path[_0xea54('0x1a')](config[_0xea54('0x1b')],_0xea54('0x1c')));},'filename':function(_0x3bdb32,_0x39a25e,_0x2d56d4){_0x2d56d4(null,util[_0xea54('0x1d')]('%s-%s',Date[_0xea54('0x1e')](),_0x39a25e[_0xea54('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xea54('0x16')](_0xea54('0x20'),upload[_0xea54('0x21')]('file'),controller['attachmentUpload']);router[_0xea54('0x16')]('/:id/messages',auth[_0xea54('0xc')](),controller[_0xea54('0x22')]);router['post'](_0xea54('0x23'),auth[_0xea54('0xb')](),interaction[_0xea54('0x24')](_0xea54('0x25'),_0xea54('0x26')),controller['addTags']);router['put'](_0xea54('0x27'),auth['isAuthenticated'](),interaction['tracked'](_0xea54('0x25'),'chatinteraction:update'),controller[_0xea54('0x28')]);router[_0xea54('0x29')](_0xea54('0x2a'),controller[_0xea54('0x2b')]);router[_0xea54('0x29')](_0xea54('0x2c'),auth[_0xea54('0xc')](),controller[_0xea54('0x2d')]);router[_0xea54('0x29')]('/:id/close',controller[_0xea54('0x2e')]);router[_0xea54('0x2f')](_0xea54('0x27'),auth[_0xea54('0xb')](),interaction[_0xea54('0x24')](_0xea54('0x25'),_0xea54('0x30')),controller[_0xea54('0x31')]);router[_0xea54('0x2f')]('/:id/tags',auth[_0xea54('0xb')](),controller[_0xea54('0x32')]);module[_0xea54('0x33')]=router;
\ No newline at end of file
+var _0x0740=['chat','chatinteraction:addtags','addTags','put','tracked','update','/:id/custom_update','customUpdate','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','/:id/tags'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0740,0x99));var _0x0074=function(_0x2d68cf,_0x2b5d44){_0x2d68cf=_0x2d68cf-0x0;var _0x9b3502=_0x0740[_0x2d68cf];return _0x9b3502;};'use strict';var multer=require(_0x0074('0x0'));var util=require(_0x0074('0x1'));var path=require(_0x0074('0x2'));var timeout=require('connect-timeout');var express=require(_0x0074('0x3'));var router=express[_0x0074('0x4')]();var fs_extra=require(_0x0074('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0074('0x6'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x0074('0x7')]('/',auth[_0x0074('0x8')](),controller[_0x0074('0x9')]);router[_0x0074('0x7')](_0x0074('0xa'),auth[_0x0074('0x8')](),controller[_0x0074('0xb')]);router[_0x0074('0x7')](_0x0074('0xc'),auth[_0x0074('0xd')](),controller[_0x0074('0xe')]);router[_0x0074('0x7')](_0x0074('0xf'),auth[_0x0074('0xd')](),controller['attachmentDownload']);router[_0x0074('0x7')](_0x0074('0x10'),auth[_0x0074('0x8')](),controller[_0x0074('0x11')]);router[_0x0074('0x7')](_0x0074('0x12'),auth[_0x0074('0xd')](),controller[_0x0074('0x13')]);router['get'](_0x0074('0x14'),auth['isAuthenticated'](),controller[_0x0074('0x15')]);router[_0x0074('0x16')]('/',auth[_0x0074('0x8')](),controller['create']);router['post'](_0x0074('0x17'),auth[_0x0074('0x8')](),controller[_0x0074('0x18')]);var upload=multer({'storage':multer[_0x0074('0x19')]({'destination':function(_0x37a149,_0x4bf594,_0x3f7781){_0x3f7781(null,path['join'](config['root'],_0x0074('0x1a')));},'filename':function(_0x14ffaa,_0x19ed94,_0x4d1253){_0x4d1253(null,util[_0x0074('0x1b')](_0x0074('0x1c'),Date[_0x0074('0x1d')](),_0x19ed94['originalname'][_0x0074('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0074('0x1f'),upload[_0x0074('0x20')](_0x0074('0x21')),controller['attachmentUpload']);router[_0x0074('0x16')]('/:id/messages',auth[_0x0074('0xd')](),controller['addMessage']);router['post'](_0x0074('0x22'),auth[_0x0074('0x8')](),interaction['tracked'](_0x0074('0x23'),_0x0074('0x24')),controller[_0x0074('0x25')]);router[_0x0074('0x26')]('/:id',auth[_0x0074('0x8')](),interaction[_0x0074('0x27')](_0x0074('0x23'),'chatinteraction:update'),controller[_0x0074('0x28')]);router['put'](_0x0074('0x29'),controller[_0x0074('0x2a')]);router[_0x0074('0x26')]('/:id/abandon',auth[_0x0074('0xd')](),controller['abandon']);router[_0x0074('0x26')]('/:id/close',controller['close']);router[_0x0074('0x2b')](_0x0074('0xc'),auth[_0x0074('0x8')](),interaction[_0x0074('0x27')](_0x0074('0x23'),_0x0074('0x2c')),controller['destroy']);router['delete']('/:id/tags',auth[_0x0074('0x8')](),controller[_0x0074('0x2d')]);module[_0x0074('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 6e4223f..d2d8eb1 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4298=['INTEGER','sequelize','exports','TEXT'];(function(_0x13f044,_0x4d2100){var _0x35841a=function(_0x4a9550){while(--_0x4a9550){_0x13f044['push'](_0x13f044['shift']());}};_0x35841a(++_0x4d2100);}(_0x4298,0x81));var _0x8429=function(_0x19bee2,_0x3cb24b){_0x19bee2=_0x19bee2-0x0;var _0x31d63d=_0x4298[_0x19bee2];return _0x31d63d;};'use strict';var Sequelize=require(_0x8429('0x0'));module[_0x8429('0x1')]={'body':{'type':Sequelize[_0x8429('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8429('0x3')]}};
\ No newline at end of file
+var _0xf521=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xf521,0x17a));var _0x1f52=function(_0x2c60d1,_0x5b778f){_0x2c60d1=_0x2c60d1-0x0;var _0xdf6e43=_0xf521[_0x2c60d1];return _0xdf6e43;};'use strict';var Sequelize=require('sequelize');module[_0x1f52('0x0')]={'body':{'type':Sequelize[_0x1f52('0x1')](_0x1f52('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1f52('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1f52('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 3665f7f..dfcce68 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeaaa=['sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','stack','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatInternalMessage','rows','catch','show','params','rawAttributes','include','find','create','body','update','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','eml-format','zip-dir','request-promise','moment','mustache','util'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0xeaaa,0x66));var _0xaeaa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeaaa[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xaeaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaeaa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaeaa('0x2'));var moment=require(_0xaeaa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaeaa('0x4'));var util=require(_0xaeaa('0x5'));var path=require('path');var sox=require(_0xaeaa('0x6'));var csv=require(_0xaeaa('0x7'));var ejs=require(_0xaeaa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaeaa('0x9'));var squel=require(_0xaeaa('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaeaa('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaeaa('0xc'));var Redis=require(_0xaeaa('0xd'));var authService=require(_0xaeaa('0xe'));var qs=require(_0xaeaa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaeaa('0x10'));var logger=require(_0xaeaa('0x11'))(_0xaeaa('0x12'));var utils=require(_0xaeaa('0x13'));var config=require(_0xaeaa('0x14'));var licenseUtil=require(_0xaeaa('0x15'));var db=require(_0xaeaa('0x16'))['db'];config[_0xaeaa('0x17')]=_[_0xaeaa('0x18')](config[_0xaeaa('0x17')],{'host':_0xaeaa('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaeaa('0x17')]));require(_0xaeaa('0x1a'))['register'](socket);function respondWithStatusCode(_0x179a07,_0x292604){_0x292604=_0x292604||0xcc;return function(_0x11405c){if(_0x11405c){return _0x179a07[_0xaeaa('0x1b')](_0x292604);}return _0x179a07[_0xaeaa('0x1c')](_0x292604)[_0xaeaa('0x1d')]();};}function respondWithResult(_0x3b5376,_0x210447){_0x210447=_0x210447||0xc8;return function(_0x14fa3f){if(_0x14fa3f){return _0x3b5376[_0xaeaa('0x1c')](_0x210447)[_0xaeaa('0x1e')](_0x14fa3f);}};}function respondWithFilteredResult(_0x591457,_0x4d31ee){return function(_0x15de87){if(_0x15de87){var _0x4c54b1=typeof _0x4d31ee['offset']===_0xaeaa('0x1f')&&typeof _0x4d31ee[_0xaeaa('0x20')]===_0xaeaa('0x1f');var _0x5c9ecf=_0x15de87[_0xaeaa('0x21')];var _0x48027c=_0x4c54b1?0x0:_0x4d31ee['offset'];var _0x5cd875=_0x4c54b1?_0x15de87[_0xaeaa('0x21')]:_0x4d31ee[_0xaeaa('0x22')]+_0x4d31ee[_0xaeaa('0x20')];var _0x4beaf1;if(_0x5cd875>=_0x5c9ecf){_0x5cd875=_0x5c9ecf;_0x4beaf1=0xc8;}else{_0x4beaf1=0xce;}_0x591457['status'](_0x4beaf1);return _0x591457['set'](_0xaeaa('0x23'),_0x48027c+'-'+_0x5cd875+'/'+_0x5c9ecf)[_0xaeaa('0x1e')](_0x15de87);}return null;};}function patchUpdates(_0x1361e8){return function(_0x2ed148){try{jsonpatch[_0xaeaa('0x24')](_0x2ed148,_0x1361e8,!![]);}catch(_0x59612a){return BPromise['reject'](_0x59612a);}return _0x2ed148[_0xaeaa('0x25')]();};}function saveUpdates(_0x30333e,_0x16334b){return function(_0x5fb847){if(_0x5fb847){return _0x5fb847['update'](_0x30333e)[_0xaeaa('0x26')](function(_0x1eb8c8){return _0x1eb8c8;});}return null;};}function removeEntity(_0x1a9b52,_0x4ce2a2){return function(_0x45cede){if(_0x45cede){return _0x45cede[_0xaeaa('0x27')]()['then'](function(){_0x1a9b52[_0xaeaa('0x1c')](0xcc)[_0xaeaa('0x1d')]();});}};}function handleEntityNotFound(_0x4c9c10,_0x23b663){return function(_0x1d9d9f){if(!_0x1d9d9f){_0x4c9c10['sendStatus'](0x194);}return _0x1d9d9f;};}function handleError(_0x1dd9cd,_0x39269e){_0x39269e=_0x39269e||0x1f4;return function(_0x4e36c5){logger['error'](_0x4e36c5[_0xaeaa('0x28')]);if(_0x4e36c5[_0xaeaa('0x29')]){delete _0x4e36c5[_0xaeaa('0x29')];}_0x1dd9cd['status'](_0x39269e)[_0xaeaa('0x2a')](_0x4e36c5);};}exports[_0xaeaa('0x2b')]=function(_0x375ea5,_0xdee91){var _0x2df3a4={},_0x17911c={},_0x24b415={'count':0x0,'rows':[]};var _0x5a98a1=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0xe08a4d){return{'name':_0xe08a4d[_0xaeaa('0x2c')],'type':_0xe08a4d[_0xaeaa('0x2d')][_0xaeaa('0x2e')]};});_0x17911c[_0xaeaa('0x2f')]=_[_0xaeaa('0x30')](_0x5a98a1,_0xaeaa('0x29'));_0x17911c['query']=_[_0xaeaa('0x31')](_0x375ea5['query']);_0x17911c[_0xaeaa('0x32')]=_[_0xaeaa('0x33')](_0x17911c['model'],_0x17911c['query']);_0x2df3a4[_0xaeaa('0x34')]=_[_0xaeaa('0x33')](_0x17911c['model'],qs[_0xaeaa('0x35')](_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x35')]));_0x2df3a4[_0xaeaa('0x34')]=_0x2df3a4[_0xaeaa('0x34')][_0xaeaa('0x37')]?_0x2df3a4[_0xaeaa('0x34')]:_0x17911c[_0xaeaa('0x2f')];if(!_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x38')]('nolimit')){_0x2df3a4[_0xaeaa('0x20')]=qs[_0xaeaa('0x20')](_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x20')]);_0x2df3a4['offset']=qs[_0xaeaa('0x22')](_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x22')]);}_0x2df3a4[_0xaeaa('0x39')]=qs[_0xaeaa('0x3a')](_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x3a')]);_0x2df3a4['where']=qs[_0xaeaa('0x32')](_[_0xaeaa('0x3b')](_0x375ea5[_0xaeaa('0x36')],_0x17911c[_0xaeaa('0x32')]),_0x5a98a1);if(_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x3c')]){_0x2df3a4[_0xaeaa('0x3d')]=_[_0xaeaa('0x3e')](_0x2df3a4[_0xaeaa('0x3d')],{'$or':_['map'](_0x5a98a1,function(_0x58128c){if(_0x58128c[_0xaeaa('0x2d')]!==_0xaeaa('0x3f')){var _0x951ecb={};_0x951ecb[_0x58128c[_0xaeaa('0x29')]]={'$like':'%'+_0x375ea5[_0xaeaa('0x36')][_0xaeaa('0x3c')]+'%'};return _0x951ecb;}})});}_0x2df3a4=_[_0xaeaa('0x3e')]({},_0x2df3a4,_0x375ea5[_0xaeaa('0x40')]);var _0x65828c={'where':_0x2df3a4[_0xaeaa('0x3d')]};return db['ChatInternalMessage'][_0xaeaa('0x21')](_0x65828c)[_0xaeaa('0x26')](function(_0x2a2352){_0x24b415[_0xaeaa('0x21')]=_0x2a2352;if(_0x375ea5['query']['includeAll']){_0x2df3a4['include']=[{'all':!![]}];}return db[_0xaeaa('0x41')]['findAll'](_0x2df3a4);})['then'](function(_0x1c074f){_0x24b415[_0xaeaa('0x42')]=_0x1c074f;return _0x24b415;})[_0xaeaa('0x26')](respondWithFilteredResult(_0xdee91,_0x2df3a4))[_0xaeaa('0x43')](handleError(_0xdee91,null));};exports[_0xaeaa('0x44')]=function(_0x307e22,_0x3f1a1e){var _0x2aed36={'raw':!![],'where':{'id':_0x307e22[_0xaeaa('0x45')]['id']}},_0x585193={};_0x585193['model']=_['keys'](db['ChatInternalMessage'][_0xaeaa('0x46')]);_0x585193[_0xaeaa('0x36')]=_[_0xaeaa('0x31')](_0x307e22[_0xaeaa('0x36')]);_0x585193[_0xaeaa('0x32')]=_['intersection'](_0x585193[_0xaeaa('0x2f')],_0x585193['query']);_0x2aed36[_0xaeaa('0x34')]=_[_0xaeaa('0x33')](_0x585193[_0xaeaa('0x2f')],qs[_0xaeaa('0x35')](_0x307e22[_0xaeaa('0x36')][_0xaeaa('0x35')]));_0x2aed36['attributes']=_0x2aed36[_0xaeaa('0x34')][_0xaeaa('0x37')]?_0x2aed36['attributes']:_0x585193[_0xaeaa('0x2f')];if(_0x307e22[_0xaeaa('0x36')]['includeAll']){_0x2aed36[_0xaeaa('0x47')]=[{'all':!![]}];}_0x2aed36=_[_0xaeaa('0x3e')]({},_0x2aed36,_0x307e22[_0xaeaa('0x40')]);return db[_0xaeaa('0x41')][_0xaeaa('0x48')](_0x2aed36)[_0xaeaa('0x26')](handleEntityNotFound(_0x3f1a1e,null))[_0xaeaa('0x26')](respondWithResult(_0x3f1a1e,null))['catch'](handleError(_0x3f1a1e,null));};exports[_0xaeaa('0x49')]=function(_0x310168,_0x24b451){return db[_0xaeaa('0x41')][_0xaeaa('0x49')](_0x310168[_0xaeaa('0x4a')],{})[_0xaeaa('0x26')](respondWithResult(_0x24b451,0xc9))[_0xaeaa('0x43')](handleError(_0x24b451,null));};exports[_0xaeaa('0x4b')]=function(_0x5214fa,_0x2cd5cc){if(_0x5214fa[_0xaeaa('0x4a')]['id']){delete _0x5214fa[_0xaeaa('0x4a')]['id'];}return db[_0xaeaa('0x41')][_0xaeaa('0x48')]({'where':{'id':_0x5214fa[_0xaeaa('0x45')]['id']}})[_0xaeaa('0x26')](handleEntityNotFound(_0x2cd5cc,null))[_0xaeaa('0x26')](saveUpdates(_0x5214fa['body'],null))['then'](respondWithResult(_0x2cd5cc,null))[_0xaeaa('0x43')](handleError(_0x2cd5cc,null));};exports['destroy']=function(_0x13634b,_0x41600b){return db[_0xaeaa('0x41')][_0xaeaa('0x48')]({'where':{'id':_0x13634b[_0xaeaa('0x45')]['id']}})[_0xaeaa('0x26')](handleEntityNotFound(_0x41600b,null))['then'](removeEntity(_0x41600b,null))[_0xaeaa('0x43')](handleError(_0x41600b,null));};exports[_0xaeaa('0x4c')]=function(_0x119fd4,_0x5dd612){return db['ChatInternalMessage']['describe']()[_0xaeaa('0x26')](respondWithResult(_0x5dd612,null))[_0xaeaa('0x43')](handleError(_0x5dd612,null));};function wrapUser(_0x73107d){return function(_0x1fd806){var _0x58b3e0=_0x73107d[_0xaeaa('0x4d')]({'plain':!![]});_0x58b3e0[_0xaeaa('0x4e')]=[];if(_0x1fd806){_0x58b3e0[_0xaeaa('0x4f')]=_0x1fd806[_0xaeaa('0x50')];_0x58b3e0[_0xaeaa('0x51')]=_0x1fd806;}else{_0x58b3e0[_0xaeaa('0x4f')]=moment(0x0)['format'](_0xaeaa('0x52'));_0x58b3e0[_0xaeaa('0x51')]={};}return _0x58b3e0;};}exports['getUsers']=function(_0x38ed82,_0x4a442d,_0x298493){var _0x5e666c=[];return db[_0xaeaa('0x53')][_0xaeaa('0x54')]({'where':{'role':[_0xaeaa('0x55'),'admin',_0xaeaa('0x56')]},'attributes':['id',_0xaeaa('0x57'),_0xaeaa('0x29'),_0xaeaa('0x58'),_0xaeaa('0x59'),_0xaeaa('0x5a'),_0xaeaa('0x5b'),'lastLoginAt',_0xaeaa('0x5c'),_0xaeaa('0x5d')],'order':qs[_0xaeaa('0x3a')](_0xaeaa('0x5e')),'include':[{'model':db[_0xaeaa('0x5f')],'as':_0xaeaa('0x60'),'attributes':['id','name',_0xaeaa('0x2d')],'through':{'attributes':[]}}]})[_0xaeaa('0x26')](function(_0x387295){if(_0x387295){var _0xdcc034=_0x38ed82[_0xaeaa('0x56')][_0xaeaa('0x4d')]({'plain':!![]});if(!_0xdcc034)throw new Error(_0xaeaa('0x61'));if(_0xdcc034[_0xaeaa('0x58')]===_0xaeaa('0x56')){return db[_0xaeaa('0x62')][_0xaeaa('0x48')]({'where':{'name':_0xaeaa('0x63'),'userProfileId':_0xdcc034[_0xaeaa('0x64')]},'raw':!![]})[_0xaeaa('0x26')](function(_0x3458f4){if(_0x3458f4){if(_0x3458f4[_0xaeaa('0x65')]===0x0){return db[_0xaeaa('0x66')]['findAll']({'where':{'sectionId':_0x3458f4['id']},'raw':!![]})[_0xaeaa('0x26')](function(_0x563c4d){var _0x211211=[];if(_[_0xaeaa('0x67')](_0x563c4d)){_0x211211=_[_0xaeaa('0x3c')](_0x387295,function(_0x3523fe){if(_0x3523fe[_0xaeaa('0x58')]!==_0xaeaa('0x55')){return _0x3523fe;}});return _0x211211;}else{for(var _0x1fd761=0x0;_0x1fd761<_0x387295[_0xaeaa('0x37')];_0x1fd761++){var _0x4ccd21=_0x387295[_0x1fd761];if(_0x4ccd21['role']===_0xaeaa('0x55')){var _0x4f125e=_['find'](_0x563c4d,function(_0x284b43){return _0x284b43[_0xaeaa('0x68')]===_0x4ccd21['id'];});if(_0x4f125e)_0x211211[_0xaeaa('0x69')](_0x4ccd21);}else{_0x211211[_0xaeaa('0x69')](_0x4ccd21);}}return _0x211211;}});}else{return _0x387295;}}else{var _0x654dcf=_['filter'](_0x387295,function(_0x261bf1){if(_0x261bf1[_0xaeaa('0x58')]!==_0xaeaa('0x55')){return _0x261bf1;}});return _0x654dcf;}});}else{return _0x387295;}}})[_0xaeaa('0x26')](function(_0x35617b){var _0x581620=[];if(_0x35617b){_0x5e666c=_0x35617b;for(var _0x23b37d=0x0;_0x23b37d<_0x35617b[_0xaeaa('0x37')];_0x23b37d+=0x1){_0x5e666c[_0x23b37d][_0xaeaa('0x4e')]=[];_0x581620[_0xaeaa('0x69')](db['ChatInternalMessage'][_0xaeaa('0x48')]({'where':{'FromId':[_0x38ed82['user']['id'],_0x35617b[_0x23b37d]['id']],'ToId':[_0x38ed82[_0xaeaa('0x56')]['id'],_0x35617b[_0x23b37d]['id']],'ChatGroupId':null},'attributes':['id',_0xaeaa('0x50'),_0xaeaa('0x6a'),'ToId',_0xaeaa('0x6b'),_0xaeaa('0x4a')],'order':qs[_0xaeaa('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaeaa('0x26')](wrapUser(_0x35617b[_0x23b37d])));}return BPromise['all'](_0x581620);}return[];})[_0xaeaa('0x26')](function(_0x6de5e3){return{'rows':_0x6de5e3,'count':_0x6de5e3[_0xaeaa('0x37')]};})[_0xaeaa('0x26')](respondWithResult(_0x4a442d,null))['catch'](handleError(_0x4a442d,null));};
\ No newline at end of file
+var _0xee3a=['fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','agent','admin','fullname','userpic','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','isEmpty','push','messages','FromId','ToId','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','localhost','socket.io-emitter','redis','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes'];(function(_0xebb784,_0x431f7c){var _0x24d1ba=function(_0x78096f){while(--_0x78096f){_0xebb784['push'](_0xebb784['shift']());}};_0x24d1ba(++_0x431f7c);}(_0xee3a,0x1b9));var _0xaee3=function(_0x377267,_0x5e21e7){_0x377267=_0x377267-0x0;var _0x3db86e=_0xee3a[_0x377267];return _0x3db86e;};'use strict';var emlformat=require(_0xaee3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaee3('0x1'));var jsonpatch=require(_0xaee3('0x2'));var rp=require(_0xaee3('0x3'));var moment=require(_0xaee3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaee3('0x5'));var path=require(_0xaee3('0x6'));var sox=require(_0xaee3('0x7'));var csv=require('to-csv');var ejs=require(_0xaee3('0x8'));var fs=require('fs');var fs_extra=require(_0xaee3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaee3('0xa'));var jsforce=require(_0xaee3('0xb'));var deskjs=require(_0xaee3('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaee3('0xd'));var Papa=require(_0xaee3('0xe'));var Redis=require(_0xaee3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaee3('0x10'));var as=require(_0xaee3('0x11'));var hardwareService=require(_0xaee3('0x12'));var logger=require(_0xaee3('0x13'))(_0xaee3('0x14'));var utils=require(_0xaee3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaee3('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xaee3('0x17'),'port':0x18eb});var socket=require(_0xaee3('0x18'))(new Redis(config[_0xaee3('0x19')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x56dbc8,_0x3335c8){_0x3335c8=_0x3335c8||0xcc;return function(_0x167c79){if(_0x167c79){return _0x56dbc8[_0xaee3('0x1a')](_0x3335c8);}return _0x56dbc8[_0xaee3('0x1b')](_0x3335c8)[_0xaee3('0x1c')]();};}function respondWithResult(_0xc00318,_0x4bb4f6){_0x4bb4f6=_0x4bb4f6||0xc8;return function(_0x35d360){if(_0x35d360){return _0xc00318[_0xaee3('0x1b')](_0x4bb4f6)[_0xaee3('0x1d')](_0x35d360);}};}function respondWithFilteredResult(_0x3ddf4c,_0xbf3703){return function(_0x3a0eaf){if(_0x3a0eaf){var _0x1e5a26=typeof _0xbf3703[_0xaee3('0x1e')]===_0xaee3('0x1f')&&typeof _0xbf3703['limit']===_0xaee3('0x1f');var _0x5efa8d=_0x3a0eaf[_0xaee3('0x20')];var _0x21f18e=_0x1e5a26?0x0:_0xbf3703[_0xaee3('0x1e')];var _0x5347c1=_0x1e5a26?_0x3a0eaf[_0xaee3('0x20')]:_0xbf3703[_0xaee3('0x1e')]+_0xbf3703['limit'];var _0x1ec998;if(_0x5347c1>=_0x5efa8d){_0x5347c1=_0x5efa8d;_0x1ec998=0xc8;}else{_0x1ec998=0xce;}_0x3ddf4c[_0xaee3('0x1b')](_0x1ec998);return _0x3ddf4c[_0xaee3('0x21')](_0xaee3('0x22'),_0x21f18e+'-'+_0x5347c1+'/'+_0x5efa8d)[_0xaee3('0x1d')](_0x3a0eaf);}return null;};}function patchUpdates(_0x3bb0c7){return function(_0x3ed50f){try{jsonpatch[_0xaee3('0x23')](_0x3ed50f,_0x3bb0c7,!![]);}catch(_0x5457ec){return BPromise['reject'](_0x5457ec);}return _0x3ed50f[_0xaee3('0x24')]();};}function saveUpdates(_0x2c03aa,_0x4e38b5){return function(_0x2216b6){if(_0x2216b6){return _0x2216b6[_0xaee3('0x25')](_0x2c03aa)['then'](function(_0x5a4fcd){return _0x5a4fcd;});}return null;};}function removeEntity(_0x251c74,_0x408956){return function(_0x228f94){if(_0x228f94){return _0x228f94[_0xaee3('0x26')]()[_0xaee3('0x27')](function(){_0x251c74[_0xaee3('0x1b')](0xcc)[_0xaee3('0x1c')]();});}};}function handleEntityNotFound(_0x5b1375,_0x51bf6b){return function(_0x3a4d78){if(!_0x3a4d78){_0x5b1375['sendStatus'](0x194);}return _0x3a4d78;};}function handleError(_0x3bff74,_0x3da37c){_0x3da37c=_0x3da37c||0x1f4;return function(_0x523c12){logger[_0xaee3('0x28')](_0x523c12[_0xaee3('0x29')]);if(_0x523c12[_0xaee3('0x2a')]){delete _0x523c12[_0xaee3('0x2a')];}_0x3bff74['status'](_0x3da37c)[_0xaee3('0x2b')](_0x523c12);};}exports[_0xaee3('0x2c')]=function(_0x57274c,_0x23b404){var _0xafa98a={},_0x17cf44={},_0x5e81f5={'count':0x0,'rows':[]};var _0x755652=_[_0xaee3('0x2d')](db[_0xaee3('0x2e')][_0xaee3('0x2f')],function(_0x4424fc){return{'name':_0x4424fc[_0xaee3('0x30')],'type':_0x4424fc['type']['key']};});_0x17cf44[_0xaee3('0x31')]=_['map'](_0x755652,_0xaee3('0x2a'));_0x17cf44['query']=_['keys'](_0x57274c[_0xaee3('0x32')]);_0x17cf44[_0xaee3('0x33')]=_[_0xaee3('0x34')](_0x17cf44[_0xaee3('0x31')],_0x17cf44[_0xaee3('0x32')]);_0xafa98a[_0xaee3('0x35')]=_[_0xaee3('0x34')](_0x17cf44[_0xaee3('0x31')],qs[_0xaee3('0x36')](_0x57274c[_0xaee3('0x32')][_0xaee3('0x36')]));_0xafa98a[_0xaee3('0x35')]=_0xafa98a[_0xaee3('0x35')][_0xaee3('0x37')]?_0xafa98a[_0xaee3('0x35')]:_0x17cf44[_0xaee3('0x31')];if(!_0x57274c[_0xaee3('0x32')]['hasOwnProperty']('nolimit')){_0xafa98a[_0xaee3('0x38')]=qs[_0xaee3('0x38')](_0x57274c[_0xaee3('0x32')][_0xaee3('0x38')]);_0xafa98a['offset']=qs[_0xaee3('0x1e')](_0x57274c[_0xaee3('0x32')][_0xaee3('0x1e')]);}_0xafa98a[_0xaee3('0x39')]=qs[_0xaee3('0x3a')](_0x57274c['query'][_0xaee3('0x3a')]);_0xafa98a[_0xaee3('0x3b')]=qs['filters'](_['pick'](_0x57274c[_0xaee3('0x32')],_0x17cf44[_0xaee3('0x33')]),_0x755652);if(_0x57274c['query'][_0xaee3('0x3c')]){_0xafa98a[_0xaee3('0x3b')]=_['merge'](_0xafa98a[_0xaee3('0x3b')],{'$or':_[_0xaee3('0x2d')](_0x755652,function(_0x5cf7ee){if(_0x5cf7ee[_0xaee3('0x3d')]!==_0xaee3('0x3e')){var _0x24671d={};_0x24671d[_0x5cf7ee['name']]={'$like':'%'+_0x57274c[_0xaee3('0x32')][_0xaee3('0x3c')]+'%'};return _0x24671d;}})});}_0xafa98a=_[_0xaee3('0x3f')]({},_0xafa98a,_0x57274c[_0xaee3('0x40')]);var _0x31d1a2={'where':_0xafa98a['where']};return db[_0xaee3('0x2e')][_0xaee3('0x20')](_0x31d1a2)[_0xaee3('0x27')](function(_0x1a3baf){_0x5e81f5[_0xaee3('0x20')]=_0x1a3baf;if(_0x57274c[_0xaee3('0x32')]['includeAll']){_0xafa98a[_0xaee3('0x41')]=[{'all':!![]}];}return db[_0xaee3('0x2e')][_0xaee3('0x42')](_0xafa98a);})[_0xaee3('0x27')](function(_0x1e777d){_0x5e81f5[_0xaee3('0x43')]=_0x1e777d;return _0x5e81f5;})[_0xaee3('0x27')](respondWithFilteredResult(_0x23b404,_0xafa98a))[_0xaee3('0x44')](handleError(_0x23b404,null));};exports[_0xaee3('0x45')]=function(_0x375828,_0x44a8f7){var _0x3c37a0={'raw':!![],'where':{'id':_0x375828[_0xaee3('0x46')]['id']}},_0x59ddb4={};_0x59ddb4[_0xaee3('0x31')]=_[_0xaee3('0x47')](db[_0xaee3('0x2e')]['rawAttributes']);_0x59ddb4[_0xaee3('0x32')]=_[_0xaee3('0x47')](_0x375828[_0xaee3('0x32')]);_0x59ddb4[_0xaee3('0x33')]=_[_0xaee3('0x34')](_0x59ddb4[_0xaee3('0x31')],_0x59ddb4[_0xaee3('0x32')]);_0x3c37a0[_0xaee3('0x35')]=_[_0xaee3('0x34')](_0x59ddb4[_0xaee3('0x31')],qs[_0xaee3('0x36')](_0x375828[_0xaee3('0x32')][_0xaee3('0x36')]));_0x3c37a0[_0xaee3('0x35')]=_0x3c37a0[_0xaee3('0x35')]['length']?_0x3c37a0[_0xaee3('0x35')]:_0x59ddb4[_0xaee3('0x31')];if(_0x375828[_0xaee3('0x32')]['includeAll']){_0x3c37a0['include']=[{'all':!![]}];}_0x3c37a0=_[_0xaee3('0x3f')]({},_0x3c37a0,_0x375828[_0xaee3('0x40')]);return db[_0xaee3('0x2e')][_0xaee3('0x48')](_0x3c37a0)[_0xaee3('0x27')](handleEntityNotFound(_0x44a8f7,null))[_0xaee3('0x27')](respondWithResult(_0x44a8f7,null))[_0xaee3('0x44')](handleError(_0x44a8f7,null));};exports['create']=function(_0x404104,_0x2d499a){return db[_0xaee3('0x2e')][_0xaee3('0x49')](_0x404104[_0xaee3('0x4a')],{})[_0xaee3('0x27')](respondWithResult(_0x2d499a,0xc9))[_0xaee3('0x44')](handleError(_0x2d499a,null));};exports[_0xaee3('0x25')]=function(_0x33e82c,_0x5c9c8c){if(_0x33e82c[_0xaee3('0x4a')]['id']){delete _0x33e82c[_0xaee3('0x4a')]['id'];}return db[_0xaee3('0x2e')][_0xaee3('0x48')]({'where':{'id':_0x33e82c[_0xaee3('0x46')]['id']}})[_0xaee3('0x27')](handleEntityNotFound(_0x5c9c8c,null))[_0xaee3('0x27')](saveUpdates(_0x33e82c[_0xaee3('0x4a')],null))['then'](respondWithResult(_0x5c9c8c,null))[_0xaee3('0x44')](handleError(_0x5c9c8c,null));};exports[_0xaee3('0x26')]=function(_0x49cdee,_0xdc6387){return db[_0xaee3('0x2e')]['find']({'where':{'id':_0x49cdee['params']['id']}})['then'](handleEntityNotFound(_0xdc6387,null))[_0xaee3('0x27')](removeEntity(_0xdc6387,null))[_0xaee3('0x44')](handleError(_0xdc6387,null));};exports[_0xaee3('0x4b')]=function(_0x156893,_0x1012d0){return db[_0xaee3('0x2e')][_0xaee3('0x4b')]()[_0xaee3('0x27')](respondWithResult(_0x1012d0,null))[_0xaee3('0x44')](handleError(_0x1012d0,null));};function wrapUser(_0x84ddf3){return function(_0x45ab32){var _0x1bca23=_0x84ddf3[_0xaee3('0x4c')]({'plain':!![]});_0x1bca23['messages']=[];if(_0x45ab32){_0x1bca23[_0xaee3('0x4d')]=_0x45ab32[_0xaee3('0x4e')];_0x1bca23[_0xaee3('0x4f')]=_0x45ab32;}else{_0x1bca23['lastMessageAt']=moment(0x0)[_0xaee3('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x1bca23[_0xaee3('0x4f')]={};}return _0x1bca23;};}exports[_0xaee3('0x51')]=function(_0x497d1c,_0x19aef4,_0x512f08){var _0x228246=[];return db['User'][_0xaee3('0x42')]({'where':{'role':[_0xaee3('0x52'),_0xaee3('0x53'),'user']},'attributes':['id',_0xaee3('0x54'),_0xaee3('0x2a'),'role',_0xaee3('0x55'),'internal','online','lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0xaee3('0x3a')](_0xaee3('0x56')),'include':[{'model':db['VoiceQueue'],'as':_0xaee3('0x57'),'attributes':['id',_0xaee3('0x2a'),'type'],'through':{'attributes':[]}}]})[_0xaee3('0x27')](function(_0x46cc5){if(_0x46cc5){var _0x5c0e15=_0x497d1c[_0xaee3('0x58')][_0xaee3('0x4c')]({'plain':!![]});if(!_0x5c0e15)throw new Error(_0xaee3('0x59'));if(_0x5c0e15[_0xaee3('0x5a')]===_0xaee3('0x58')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x5c0e15[_0xaee3('0x5b')]},'raw':!![]})[_0xaee3('0x27')](function(_0x1f7683){if(_0x1f7683){if(_0x1f7683['autoAssociation']===0x0){return db[_0xaee3('0x5c')][_0xaee3('0x42')]({'where':{'sectionId':_0x1f7683['id']},'raw':!![]})[_0xaee3('0x27')](function(_0x10732c){var _0x532c58=[];if(_[_0xaee3('0x5d')](_0x10732c)){_0x532c58=_[_0xaee3('0x3c')](_0x46cc5,function(_0x4fa451){if(_0x4fa451[_0xaee3('0x5a')]!==_0xaee3('0x52')){return _0x4fa451;}});return _0x532c58;}else{for(var _0x4034ad=0x0;_0x4034ad<_0x46cc5['length'];_0x4034ad++){var _0x2573a6=_0x46cc5[_0x4034ad];if(_0x2573a6[_0xaee3('0x5a')]===_0xaee3('0x52')){var _0x247289=_['find'](_0x10732c,function(_0x5bd044){return _0x5bd044['resourceId']===_0x2573a6['id'];});if(_0x247289)_0x532c58[_0xaee3('0x5e')](_0x2573a6);}else{_0x532c58[_0xaee3('0x5e')](_0x2573a6);}}return _0x532c58;}});}else{return _0x46cc5;}}else{var _0x2a9c76=_['filter'](_0x46cc5,function(_0x1c5ff0){if(_0x1c5ff0[_0xaee3('0x5a')]!==_0xaee3('0x52')){return _0x1c5ff0;}});return _0x2a9c76;}});}else{return _0x46cc5;}}})['then'](function(_0x141d51){var _0x85ae15=[];if(_0x141d51){_0x228246=_0x141d51;for(var _0x4e27d3=0x0;_0x4e27d3<_0x141d51[_0xaee3('0x37')];_0x4e27d3+=0x1){_0x228246[_0x4e27d3][_0xaee3('0x5f')]=[];_0x85ae15['push'](db['ChatInternalMessage'][_0xaee3('0x48')]({'where':{'FromId':[_0x497d1c[_0xaee3('0x58')]['id'],_0x141d51[_0x4e27d3]['id']],'ToId':[_0x497d1c[_0xaee3('0x58')]['id'],_0x141d51[_0x4e27d3]['id']],'ChatGroupId':null},'attributes':['id',_0xaee3('0x4e'),_0xaee3('0x60'),_0xaee3('0x61'),'read',_0xaee3('0x4a')],'order':qs[_0xaee3('0x3a')](_0xaee3('0x62')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x141d51[_0x4e27d3])));}return BPromise['all'](_0x85ae15);}return[];})[_0xaee3('0x27')](function(_0x118753){return{'rows':_0x118753,'count':_0x118753[_0xaee3('0x37')]};})[_0xaee3('0x27')](respondWithResult(_0x19aef4,null))['catch'](handleError(_0x19aef4,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b4aa15f..12a3a99 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5cf8=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage'];(function(_0xa6cb09,_0x39410f){var _0x12b437=function(_0x1813cc){while(--_0x1813cc){_0xa6cb09['push'](_0xa6cb09['shift']());}};_0x12b437(++_0x39410f);}(_0x5cf8,0xf9));var _0x85cf=function(_0x3ce233,_0x58abd8){_0x3ce233=_0x3ce233-0x0;var _0x48c0cc=_0x5cf8[_0x3ce233];return _0x48c0cc;};'use strict';var EventEmitter=require(_0x85cf('0x0'));var ChatInternalMessage=require(_0x85cf('0x1'))['db'][_0x85cf('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x85cf('0x3')](0x0);var events={'afterCreate':_0x85cf('0x4'),'afterUpdate':_0x85cf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4be9b7){return function(_0x21624b,_0x2437eb,_0x3f3360){ChatInternalMessageEvents[_0x85cf('0x6')](_0x4be9b7+':'+_0x21624b['id'],_0x21624b);ChatInternalMessageEvents[_0x85cf('0x6')](_0x4be9b7,_0x21624b);_0x3f3360(null);};}for(var e in events){if(events[_0x85cf('0x7')](e)){var event=events[e];ChatInternalMessage[_0x85cf('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xcfc0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x2c36b2,_0x288962){var _0x1ba740=function(_0x241ad3){while(--_0x241ad3){_0x2c36b2['push'](_0x2c36b2['shift']());}};_0x1ba740(++_0x288962);}(_0xcfc0,0x179));var _0x0cfc=function(_0xe10c3e,_0x336f40){_0xe10c3e=_0xe10c3e-0x0;var _0x5608e1=_0xcfc0[_0xe10c3e];return _0x5608e1;};'use strict';var EventEmitter=require(_0x0cfc('0x0'));var ChatInternalMessage=require(_0x0cfc('0x1'))['db'][_0x0cfc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0cfc('0x3')](0x0);var events={'afterCreate':_0x0cfc('0x4'),'afterUpdate':_0x0cfc('0x5'),'afterDestroy':_0x0cfc('0x6')};function emitEvent(_0x3c8b6a){return function(_0x53bb39,_0x38e418,_0x226120){ChatInternalMessageEvents[_0x0cfc('0x7')](_0x3c8b6a+':'+_0x53bb39['id'],_0x53bb39);ChatInternalMessageEvents[_0x0cfc('0x7')](_0x3c8b6a,_0x53bb39);_0x226120(null);};}for(var e in events){if(events[_0x0cfc('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x0cfc('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 33aad5c..119fd19 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x72c1=['../../config/environment','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x72c1,0x105));var _0x172c=function(_0x5c2824,_0x2df2af){_0x5c2824=_0x5c2824-0x0;var _0x3342fe=_0x72c1[_0x5c2824];return _0x3342fe;};'use strict';var _=require(_0x172c('0x0'));var util=require(_0x172c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x172c('0x2'));var config=require(_0x172c('0x3'));var attributes=require(_0x172c('0x4'));module[_0x172c('0x5')]=function(_0x2152d3,_0x3e4b5c){return _0x2152d3['define']('ChatInternalMessage',attributes,{'tableName':_0x172c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x172c('0x7')});};
\ No newline at end of file
+var _0xfa69=['./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1acb02,_0x1a8394){var _0x37dbbe=function(_0x41e06a){while(--_0x41e06a){_0x1acb02['push'](_0x1acb02['shift']());}};_0x37dbbe(++_0x1a8394);}(_0xfa69,0x1d8));var _0x9fa6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfa69[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x9fa6('0x0'));var util=require('util');var logger=require(_0x9fa6('0x1'))(_0x9fa6('0x2'));var moment=require(_0x9fa6('0x3'));var BPromise=require(_0x9fa6('0x4'));var rp=require(_0x9fa6('0x5'));var fs=require('fs');var path=require(_0x9fa6('0x6'));var rimraf=require(_0x9fa6('0x7'));var config=require(_0x9fa6('0x8'));var attributes=require(_0x9fa6('0x9'));module[_0x9fa6('0xa')]=function(_0xff6be5,_0x320a84){return _0xff6be5['define'](_0x9fa6('0xb'),attributes,{'tableName':_0x9fa6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 58fa7eb..e1b0f4b 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe134=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0xe134,0x102));var _0x4e13=function(_0x138281,_0x5e6188){_0x138281=_0x138281-0x0;var _0x535192=_0xe134[_0x138281];return _0x535192;};'use strict';var _=require(_0x4e13('0x0'));var util=require('util');var moment=require(_0x4e13('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e13('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e13('0x3'))['db'];var utils=require(_0x4e13('0x4'));var logger=require('../../config/logger')(_0x4e13('0x5'));var config=require(_0x4e13('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4e13('0x7')][_0x4e13('0x8')]({'port':0x232a});config[_0x4e13('0x9')]=_[_0x4e13('0xa')](config[_0x4e13('0x9')],{'host':_0x4e13('0xb'),'port':0x18eb});var socket=require(_0x4e13('0xc'))(new Redis(config[_0x4e13('0x9')]));require(_0x4e13('0xd'))[_0x4e13('0xe')](socket);function respondWithRpcPromise(_0x430970,_0xccc796,_0x3beec1){return new BPromise(function(_0x4a802e,_0x2e6ac0){return client[_0x4e13('0xf')](_0x430970,_0x3beec1)[_0x4e13('0x10')](function(_0xc3f27e){logger[_0x4e13('0x11')](_0x4e13('0x12'),_0xccc796,_0x4e13('0x13'));logger[_0x4e13('0x14')](_0x4e13('0x15'),_0xccc796,'request\x20sent',JSON['stringify'](_0xc3f27e));if(_0xc3f27e[_0x4e13('0x16')]){if(_0xc3f27e[_0x4e13('0x16')][_0x4e13('0x17')]===0x1f4){logger['error'](_0x4e13('0x12'),_0xccc796,_0xc3f27e[_0x4e13('0x16')][_0x4e13('0x18')]);return _0x2e6ac0(_0xc3f27e[_0x4e13('0x16')][_0x4e13('0x18')]);}logger['error'](_0x4e13('0x12'),_0xccc796,_0xc3f27e[_0x4e13('0x16')][_0x4e13('0x18')]);return _0x4a802e(_0xc3f27e[_0x4e13('0x16')][_0x4e13('0x18')]);}else{logger[_0x4e13('0x11')](_0x4e13('0x12'),_0xccc796,'request\x20sent');_0x4a802e(_0xc3f27e[_0x4e13('0x19')]['message']);}})['catch'](function(_0x20db43){logger['error'](_0x4e13('0x12'),_0xccc796,_0x20db43);_0x2e6ac0(_0x20db43);});});}
\ No newline at end of file
+var _0xf73a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x427249,_0x360587){var _0x5ad328=function(_0x3af302){while(--_0x3af302){_0x427249['push'](_0x427249['shift']());}};_0x5ad328(++_0x360587);}(_0xf73a,0x115));var _0xaf73=function(_0x3cb65e,_0x24dbcd){_0x3cb65e=_0x3cb65e-0x0;var _0x45c3fa=_0xf73a[_0x3cb65e];return _0x45c3fa;};'use strict';var _=require(_0xaf73('0x0'));var util=require(_0xaf73('0x1'));var moment=require('moment');var BPromise=require(_0xaf73('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf73('0x3'));var db=require(_0xaf73('0x4'))['db'];var utils=require(_0xaf73('0x5'));var logger=require(_0xaf73('0x6'))(_0xaf73('0x7'));var config=require(_0xaf73('0x8'));var jayson=require(_0xaf73('0x9'));var client=jayson[_0xaf73('0xa')][_0xaf73('0xb')]({'port':0x232a});config[_0xaf73('0xc')]=_[_0xaf73('0xd')](config['redis'],{'host':_0xaf73('0xe'),'port':0x18eb});var socket=require(_0xaf73('0xf'))(new Redis(config[_0xaf73('0xc')]));require(_0xaf73('0x10'))[_0xaf73('0x11')](socket);function respondWithRpcPromise(_0x5116bb,_0x83ce19,_0x29d6b9){return new BPromise(function(_0x524b95,_0x5158f3){return client[_0xaf73('0x12')](_0x5116bb,_0x29d6b9)[_0xaf73('0x13')](function(_0x451168){logger[_0xaf73('0x14')](_0xaf73('0x15'),_0x83ce19,_0xaf73('0x16'));logger['debug'](_0xaf73('0x17'),_0x83ce19,_0xaf73('0x16'),JSON[_0xaf73('0x18')](_0x451168));if(_0x451168[_0xaf73('0x19')]){if(_0x451168[_0xaf73('0x19')][_0xaf73('0x1a')]===0x1f4){logger['error'](_0xaf73('0x15'),_0x83ce19,_0x451168[_0xaf73('0x19')][_0xaf73('0x1b')]);return _0x5158f3(_0x451168[_0xaf73('0x19')][_0xaf73('0x1b')]);}logger[_0xaf73('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x83ce19,_0x451168[_0xaf73('0x19')][_0xaf73('0x1b')]);return _0x524b95(_0x451168[_0xaf73('0x19')][_0xaf73('0x1b')]);}else{logger['info'](_0xaf73('0x15'),_0x83ce19,'request\x20sent');_0x524b95(_0x451168[_0xaf73('0x1c')][_0xaf73('0x1b')]);}})[_0xaf73('0x1d')](function(_0x51b7ea){logger[_0xaf73('0x19')](_0xaf73('0x15'),_0x83ce19,_0x51b7ea);_0x5158f3(_0x51b7ea);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 422e409..44f227a 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb0a=['removeListener','register','length','remove','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb0a,0xad));var _0xabb0=function(_0x562ec0,_0x5692e3){_0x562ec0=_0x562ec0-0x0;var _0x213d70=_0xbb0a[_0x562ec0];return _0x213d70;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xabb0('0x0'),_0xabb0('0x1')];function createListener(_0x3a5f5b,_0x144f27){return function(_0x4ce766){_0x144f27['emit'](_0x3a5f5b,_0x4ce766);};}function removeListener(_0x18a2cd,_0x44bd80){return function(){ChatInternalMessageEvents[_0xabb0('0x2')](_0x18a2cd,_0x44bd80);};}exports[_0xabb0('0x3')]=function(_0x1afca2){for(var _0x260568=0x0,_0x2f9fd5=events[_0xabb0('0x4')];_0x260568<_0x2f9fd5;_0x260568++){var _0x38a5c3=events[_0x260568];var _0x2be81a=createListener('chatInternalMessage:'+_0x38a5c3,_0x1afca2);ChatInternalMessageEvents['on'](_0x38a5c3,_0x2be81a);}};
\ No newline at end of file
+var _0xdea9=['remove','update','removeListener','register','length','chatInternalMessage:'];(function(_0x42208a,_0x4a2177){var _0x12eb0f=function(_0x412d6e){while(--_0x412d6e){_0x42208a['push'](_0x42208a['shift']());}};_0x12eb0f(++_0x4a2177);}(_0xdea9,0x192));var _0x9dea=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdea9[_0x167cc1];return _0x10bc4b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x9dea('0x0'),_0x9dea('0x1')];function createListener(_0x1aac80,_0x31a153){return function(_0x4fdc34){_0x31a153['emit'](_0x1aac80,_0x4fdc34);};}function removeListener(_0x48ec1e,_0x2e5450){return function(){ChatInternalMessageEvents[_0x9dea('0x2')](_0x48ec1e,_0x2e5450);};}exports[_0x9dea('0x3')]=function(_0xd5c5f3){for(var _0x39f647=0x0,_0x3de04d=events[_0x9dea('0x4')];_0x39f647<_0x3de04d;_0x39f647++){var _0x33ca85=events[_0x39f647];var _0xdf5285=createListener(_0x9dea('0x5')+_0x33ca85,_0xd5c5f3);ChatInternalMessageEvents['on'](_0x33ca85,_0xdf5285);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index ad2a45b..796fecc 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d21=['getUsers','/:id','show','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users'];(function(_0x5a7c14,_0xfe838a){var _0x28ed61=function(_0x406c1d){while(--_0x406c1d){_0x5a7c14['push'](_0x5a7c14['shift']());}};_0x28ed61(++_0xfe838a);}(_0x5d21,0x178));var _0x15d2=function(_0x21f855,_0x443370){_0x21f855=_0x21f855-0x0;var _0x543a1c=_0x5d21[_0x21f855];return _0x543a1c;};'use strict';var multer=require(_0x15d2('0x0'));var util=require(_0x15d2('0x1'));var path=require('path');var timeout=require(_0x15d2('0x2'));var express=require(_0x15d2('0x3'));var router=express[_0x15d2('0x4')]();var fs_extra=require(_0x15d2('0x5'));var auth=require(_0x15d2('0x6'));var interaction=require(_0x15d2('0x7'));var config=require('../../config/environment');var controller=require(_0x15d2('0x8'));router[_0x15d2('0x9')]('/',auth['isAuthenticated'](),controller[_0x15d2('0xa')]);router[_0x15d2('0x9')](_0x15d2('0xb'),auth[_0x15d2('0xc')](),controller[_0x15d2('0xd')]);router[_0x15d2('0x9')](_0x15d2('0xe'),auth[_0x15d2('0xc')](),controller[_0x15d2('0xf')]);router[_0x15d2('0x9')](_0x15d2('0x10'),auth['isAuthenticated'](),controller[_0x15d2('0x11')]);router[_0x15d2('0x12')]('/',auth[_0x15d2('0xc')](),controller[_0x15d2('0x13')]);router['put'](_0x15d2('0x10'),controller[_0x15d2('0x14')]);router[_0x15d2('0x15')](_0x15d2('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x15d2('0x16')]=router;
\ No newline at end of file
+var _0xabad=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','create','put','update','delete','destroy'];(function(_0xb661b9,_0x4eae7b){var _0x105b16=function(_0x4da662){while(--_0x4da662){_0xb661b9['push'](_0xb661b9['shift']());}};_0x105b16(++_0x4eae7b);}(_0xabad,0x191));var _0xdaba=function(_0x5ba8fc,_0x3120dd){_0x5ba8fc=_0x5ba8fc-0x0;var _0x974890=_0xabad[_0x5ba8fc];return _0x974890;};'use strict';var multer=require(_0xdaba('0x0'));var util=require('util');var path=require(_0xdaba('0x1'));var timeout=require(_0xdaba('0x2'));var express=require(_0xdaba('0x3'));var router=express[_0xdaba('0x4')]();var fs_extra=require(_0xdaba('0x5'));var auth=require(_0xdaba('0x6'));var interaction=require(_0xdaba('0x7'));var config=require(_0xdaba('0x8'));var controller=require(_0xdaba('0x9'));router[_0xdaba('0xa')]('/',auth[_0xdaba('0xb')](),controller[_0xdaba('0xc')]);router[_0xdaba('0xa')](_0xdaba('0xd'),auth[_0xdaba('0xb')](),controller[_0xdaba('0xe')]);router[_0xdaba('0xa')](_0xdaba('0xf'),auth['isAuthenticated'](),controller[_0xdaba('0x10')]);router['get'](_0xdaba('0x11'),auth['isAuthenticated'](),controller[_0xdaba('0x12')]);router['post']('/',auth[_0xdaba('0xb')](),controller[_0xdaba('0x13')]);router[_0xdaba('0x14')](_0xdaba('0x11'),controller[_0xdaba('0x15')]);router[_0xdaba('0x16')](_0xdaba('0x11'),auth['isAuthenticated'](),controller[_0xdaba('0x17')]);module[_0xdaba('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 7fca2d8..e6a91c0 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5423=['out','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x5734ac,_0x326c9b){var _0x502ad9=function(_0x10aa82){while(--_0x10aa82){_0x5734ac['push'](_0x5734ac['shift']());}};_0x502ad9(++_0x326c9b);}(_0x5423,0xe3));var _0x3542=function(_0x4dea73,_0xf30851){_0x4dea73=_0x4dea73-0x0;var _0x103229=_0x5423[_0x4dea73];return _0x103229;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3542('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3542('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3542('0x4')]('in',_0x3542('0x5')),'defaultValue':_0x3542('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3542('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3542('0x7')]}};
\ No newline at end of file
+var _0x69d3=['TEXT','BOOLEAN','out','sequelize','exports'];(function(_0x107fb8,_0x1503dc){var _0x193322=function(_0x538e64){while(--_0x538e64){_0x107fb8['push'](_0x107fb8['shift']());}};_0x193322(++_0x1503dc);}(_0x69d3,0xda));var _0x369d=function(_0x5d2e01,_0x25fb5c){_0x5d2e01=_0x5d2e01-0x0;var _0x44dd1=_0x69d3[_0x5d2e01];return _0x44dd1;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'body':{'type':Sequelize[_0x369d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x369d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x369d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x369d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x369d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 28c3638..7adff86 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x069b=['format','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','User','internal','SIP/%s','formData','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','update','describe','../../config/logger','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','interaction','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','email','interface'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x069b,0x199));var _0xb069=function(_0x239049,_0x4b9d4c){_0x239049=_0x239049-0x0;var _0x35eb70=_0x069b[_0x239049];return _0x35eb70;};'use strict';var emlformat=require(_0xb069('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb069('0x1'));var jsonpatch=require(_0xb069('0x2'));var rp=require(_0xb069('0x3'));var moment=require(_0xb069('0x4'));var BPromise=require(_0xb069('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb069('0x6'));var csv=require(_0xb069('0x7'));var ejs=require(_0xb069('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb069('0x9'));var crypto=require(_0xb069('0xa'));var jsforce=require(_0xb069('0xb'));var deskjs=require(_0xb069('0xc'));var toCsv=require(_0xb069('0x7'));var querystring=require(_0xb069('0xd'));var Papa=require('papaparse');var Redis=require(_0xb069('0xe'));var authService=require(_0xb069('0xf'));var qs=require(_0xb069('0x10'));var as=require(_0xb069('0x11'));var hardwareService=require(_0xb069('0x12'));var logger=require('../../config/logger')(_0xb069('0x13'));var utils=require(_0xb069('0x14'));var config=require(_0xb069('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb069('0x16'))['db'];config[_0xb069('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb069('0x18'))(new Redis(config['redis']));require(_0xb069('0x19'))['register'](socket);var jayson=require(_0xb069('0x1a'));var client=jayson[_0xb069('0x1b')][_0xb069('0x1c')]({'port':0x232c});var client9002=jayson[_0xb069('0x1b')][_0xb069('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b0880,_0x3ecdd8,_0x1e509e,_0x420133){return new BPromise(function(_0x3c6744,_0x3de536){var _0x150e4f=_0x420133||client;return _0x150e4f[_0xb069('0x1d')](_0x4b0880,_0x1e509e)[_0xb069('0x1e')](function(_0x30f30a){logger[_0xb069('0x1f')](_0xb069('0x20'),_0x3ecdd8,'request\x20sent');logger[_0xb069('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3ecdd8,_0xb069('0x22'),JSON['stringify'](_0x30f30a));if(_0x30f30a[_0xb069('0x23')]){if(_0x30f30a[_0xb069('0x23')]['code']===0x1f4){logger['error'](_0xb069('0x20'),_0x3ecdd8,_0x30f30a[_0xb069('0x23')][_0xb069('0x24')]);return _0x3de536(_0x30f30a[_0xb069('0x23')][_0xb069('0x24')]);}logger[_0xb069('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3ecdd8,_0x30f30a[_0xb069('0x23')][_0xb069('0x24')]);return _0x3c6744(_0x30f30a[_0xb069('0x23')][_0xb069('0x24')]);}else{logger['info'](_0xb069('0x20'),_0x3ecdd8,'request\x20sent');_0x3c6744(_0x30f30a[_0xb069('0x25')][_0xb069('0x24')]);}})[_0xb069('0x26')](function(_0x2b07a6){logger[_0xb069('0x23')](_0xb069('0x20'),_0x3ecdd8,_0x2b07a6);_0x3de536(_0x2b07a6);});});}function respondWithStatusCode(_0x4ec4cc,_0x3c95fb){_0x3c95fb=_0x3c95fb||0xcc;return function(_0xef3367){if(_0xef3367){return _0x4ec4cc[_0xb069('0x27')](_0x3c95fb);}return _0x4ec4cc[_0xb069('0x28')](_0x3c95fb)[_0xb069('0x29')]();};}function respondWithResult(_0x19b6e1,_0x495040){_0x495040=_0x495040||0xc8;return function(_0x321088){if(_0x321088){return _0x19b6e1[_0xb069('0x28')](_0x495040)[_0xb069('0x2a')](_0x321088);}};}function respondWithFilteredResult(_0x17b4de,_0x3f1580){return function(_0x4e9acf){if(_0x4e9acf){var _0x5b3ae4=typeof _0x3f1580[_0xb069('0x2b')]===_0xb069('0x2c')&&typeof _0x3f1580[_0xb069('0x2d')]==='undefined';var _0x379954=_0x4e9acf['count'];var _0x7a7113=_0x5b3ae4?0x0:_0x3f1580[_0xb069('0x2b')];var _0x1103b1=_0x5b3ae4?_0x4e9acf[_0xb069('0x2e')]:_0x3f1580[_0xb069('0x2b')]+_0x3f1580['limit'];var _0x4b1c81;if(_0x1103b1>=_0x379954){_0x1103b1=_0x379954;_0x4b1c81=0xc8;}else{_0x4b1c81=0xce;}_0x17b4de['status'](_0x4b1c81);return _0x17b4de['set']('Content-Range',_0x7a7113+'-'+_0x1103b1+'/'+_0x379954)[_0xb069('0x2a')](_0x4e9acf);}return null;};}function patchUpdates(_0x4518b7){return function(_0x4a8428){try{jsonpatch[_0xb069('0x2f')](_0x4a8428,_0x4518b7,!![]);}catch(_0x9221bf){return BPromise[_0xb069('0x30')](_0x9221bf);}return _0x4a8428[_0xb069('0x31')]();};}function saveUpdates(_0x40e115,_0x53f182){return function(_0x1d835e){if(_0x1d835e){return _0x1d835e['update'](_0x40e115)[_0xb069('0x1e')](function(_0x3a8ebb){return _0x3a8ebb;});}return null;};}function removeEntity(_0x141a7d,_0x3c27a9){return function(_0xb355c5){if(_0xb355c5){return _0xb355c5[_0xb069('0x32')]()['then'](function(){_0x141a7d[_0xb069('0x28')](0xcc)[_0xb069('0x29')]();});}};}function handleEntityNotFound(_0x7de12f,_0x4d04a7){return function(_0x41f434){if(!_0x41f434){_0x7de12f[_0xb069('0x27')](0x194);}return _0x41f434;};}function handleError(_0x46244c,_0x50e3f2){_0x50e3f2=_0x50e3f2||0x1f4;return function(_0x3524c4){logger[_0xb069('0x23')](_0x3524c4[_0xb069('0x33')]);if(_0x3524c4[_0xb069('0x34')]){delete _0x3524c4[_0xb069('0x34')];}_0x46244c[_0xb069('0x28')](_0x50e3f2)[_0xb069('0x35')](_0x3524c4);};}exports[_0xb069('0x36')]=function(_0x85e18c,_0x80da87){var _0x14d0d1={},_0x555cf2={},_0x35439f={'count':0x0,'rows':[]};var _0x47c310=_[_0xb069('0x37')](db[_0xb069('0x38')][_0xb069('0x39')],function(_0x12f725){return{'name':_0x12f725[_0xb069('0x3a')],'type':_0x12f725['type'][_0xb069('0x3b')]};});_0x555cf2['model']=_[_0xb069('0x37')](_0x47c310,'name');_0x555cf2[_0xb069('0x3c')]=_[_0xb069('0x3d')](_0x85e18c[_0xb069('0x3c')]);_0x555cf2[_0xb069('0x3e')]=_[_0xb069('0x3f')](_0x555cf2['model'],_0x555cf2[_0xb069('0x3c')]);_0x14d0d1[_0xb069('0x40')]=_[_0xb069('0x3f')](_0x555cf2[_0xb069('0x41')],qs['fields'](_0x85e18c[_0xb069('0x3c')][_0xb069('0x42')]));_0x14d0d1[_0xb069('0x40')]=_0x14d0d1['attributes'][_0xb069('0x43')]?_0x14d0d1['attributes']:_0x555cf2[_0xb069('0x41')];if(!_0x85e18c['query'][_0xb069('0x44')](_0xb069('0x45'))){_0x14d0d1[_0xb069('0x2d')]=qs[_0xb069('0x2d')](_0x85e18c[_0xb069('0x3c')][_0xb069('0x2d')]);_0x14d0d1[_0xb069('0x2b')]=qs[_0xb069('0x2b')](_0x85e18c[_0xb069('0x3c')][_0xb069('0x2b')]);}_0x14d0d1[_0xb069('0x46')]=qs[_0xb069('0x47')](_0x85e18c[_0xb069('0x3c')]['sort']);_0x14d0d1[_0xb069('0x48')]=qs[_0xb069('0x3e')](_['pick'](_0x85e18c[_0xb069('0x3c')],_0x555cf2[_0xb069('0x3e')]),_0x47c310);if(_0x85e18c[_0xb069('0x3c')]['filter']){_0x14d0d1[_0xb069('0x48')]=_[_0xb069('0x49')](_0x14d0d1[_0xb069('0x48')],{'$or':_[_0xb069('0x37')](_0x47c310,function(_0x513c20){if(_0x513c20[_0xb069('0x4a')]!==_0xb069('0x4b')){var _0x1bd6f3={};_0x1bd6f3[_0x513c20[_0xb069('0x34')]]={'$like':'%'+_0x85e18c[_0xb069('0x3c')][_0xb069('0x4c')]+'%'};return _0x1bd6f3;}})});}_0x14d0d1=_['merge']({},_0x14d0d1,_0x85e18c[_0xb069('0x4d')]);var _0x236089={'where':_0x14d0d1[_0xb069('0x48')]};return db['ChatMessage'][_0xb069('0x2e')](_0x236089)[_0xb069('0x1e')](function(_0x50b537){_0x35439f['count']=_0x50b537;if(_0x85e18c[_0xb069('0x3c')][_0xb069('0x4e')]){_0x14d0d1[_0xb069('0x4f')]=[{'all':!![]}];}return db[_0xb069('0x38')][_0xb069('0x50')](_0x14d0d1);})[_0xb069('0x1e')](function(_0x253dc4){_0x35439f[_0xb069('0x51')]=_0x253dc4;return _0x35439f;})['then'](respondWithFilteredResult(_0x80da87,_0x14d0d1))['catch'](handleError(_0x80da87,null));};exports[_0xb069('0x52')]=function(_0x20ba90,_0x6708e8){var _0x214fa7={'raw':!![],'where':{'id':_0x20ba90[_0xb069('0x53')]['id']}},_0x37f066={};_0x37f066['model']=_['keys'](db[_0xb069('0x38')][_0xb069('0x39')]);_0x37f066[_0xb069('0x3c')]=_['keys'](_0x20ba90['query']);_0x37f066[_0xb069('0x3e')]=_[_0xb069('0x3f')](_0x37f066['model'],_0x37f066[_0xb069('0x3c')]);_0x214fa7[_0xb069('0x40')]=_[_0xb069('0x3f')](_0x37f066[_0xb069('0x41')],qs[_0xb069('0x42')](_0x20ba90[_0xb069('0x3c')][_0xb069('0x42')]));_0x214fa7['attributes']=_0x214fa7[_0xb069('0x40')]['length']?_0x214fa7[_0xb069('0x40')]:_0x37f066[_0xb069('0x41')];if(_0x20ba90['query'][_0xb069('0x4e')]){_0x214fa7[_0xb069('0x4f')]=[{'all':!![]}];}_0x214fa7=_['merge']({},_0x214fa7,_0x20ba90[_0xb069('0x4d')]);return db[_0xb069('0x38')][_0xb069('0x54')](_0x214fa7)[_0xb069('0x1e')](handleEntityNotFound(_0x6708e8,null))[_0xb069('0x1e')](respondWithResult(_0x6708e8,null))[_0xb069('0x26')](handleError(_0x6708e8,null));};exports[_0xb069('0x55')]=function(_0x43b235,_0x466048){return db['ChatMessage']['create'](_0x43b235[_0xb069('0x56')],{})[_0xb069('0x1e')](respondWithResult(_0x466048,0xc9))[_0xb069('0x26')](handleError(_0x466048,null));};exports[_0xb069('0x57')]=function(_0x3ce811,_0x1e4ab5){if(_0x3ce811[_0xb069('0x56')]['id']){delete _0x3ce811[_0xb069('0x56')]['id'];}return db[_0xb069('0x38')][_0xb069('0x54')]({'where':{'id':_0x3ce811[_0xb069('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e4ab5,null))[_0xb069('0x1e')](saveUpdates(_0x3ce811['body'],null))[_0xb069('0x1e')](respondWithResult(_0x1e4ab5,null))['catch'](handleError(_0x1e4ab5,null));};exports[_0xb069('0x32')]=function(_0x399416,_0x551bae){return db[_0xb069('0x38')][_0xb069('0x54')]({'where':{'id':_0x399416[_0xb069('0x53')]['id']}})['then'](handleEntityNotFound(_0x551bae,null))[_0xb069('0x1e')](removeEntity(_0x551bae,null))[_0xb069('0x26')](handleError(_0x551bae,null));};exports[_0xb069('0x58')]=function(_0xe2ff3b,_0x19d70f){return db['ChatMessage'][_0xb069('0x58')]()[_0xb069('0x1e')](respondWithResult(_0x19d70f,null))[_0xb069('0x26')](handleError(_0x19d70f,null));};var interaction_log=require(_0xb069('0x59'))('chat-interactions');exports[_0xb069('0x5a')]=function(_0x4912df,_0x43f05a,_0x11713a){var _0x35e599={'agent':{},'channel':_0xb069('0x5b')};if(_0x4912df[_0xb069('0x56')]['id']){delete _0x4912df[_0xb069('0x56')]['id'];}_0x4912df[_0xb069('0x56')][_0xb069('0x5c')]=!![];_0x4912df['body'][_0xb069('0x5d')]=moment()['format'](_0xb069('0x5e'));_0x4912df[_0xb069('0x56')][_0xb069('0x5f')]=_0x4912df[_0xb069('0x56')][_0xb069('0x5f')]||_0x4912df[_0xb069('0x60')]['id'];_0x35e599[_0xb069('0x61')]['id']=_0x4912df[_0xb069('0x56')][_0xb069('0x5f')];return db[_0xb069('0x38')][_0xb069('0x54')]({'where':{'id':_0x4912df[_0xb069('0x53')]['id'],'UserId':null}})[_0xb069('0x1e')](handleEntityNotFound(_0x43f05a,null))[_0xb069('0x1e')](saveUpdates(_0x4912df[_0xb069('0x56')],null))[_0xb069('0x1e')](function(_0x220ed6){if(_0x220ed6){_0x35e599[_0xb069('0x24')]=_0x220ed6[_0xb069('0x62')]({'plain':!![]});return db[_0xb069('0x63')]['find']({'where':{'id':_0x220ed6['ChatInteractionId']}});}return null;})[_0xb069('0x1e')](handleEntityNotFound(_0x43f05a,null))[_0xb069('0x1e')](function(_0xc2c71d){if(_0xc2c71d){return _0xc2c71d[_0xb069('0x57')]({'UserId':_0x4912df[_0xb069('0x56')][_0xb069('0x5f')],'read1stAt':_[_0xb069('0x64')](_0xc2c71d[_0xb069('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb069('0x1e')](function(_0x245dcd){if(_0x245dcd){_0x35e599[_0xb069('0x66')]=_0x245dcd[_0xb069('0x62')]({'plain':!![]});interaction_log[_0xb069('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4912df[_0xb069('0x60')]['id'],_0x4912df[_0xb069('0x60')][_0xb069('0x34')],_0x4912df['user'][_0xb069('0x67')],_0x35e599[_0xb069('0x66')]['id'],_0x4912df[_0xb069('0x56')]?JSON[_0xb069('0x68')](_0x4912df[_0xb069('0x56')]):_0xb069('0x69'));return respondWithRpcPromise(_0xb069('0x6a'),'acceptMessage',_0x35e599);}return null;})['then'](function(_0x940d57){var _0x5b2df0=_0xb069('0x6b')+_0x940d57[_0xb069('0x24')][_0xb069('0x6c')];return db[_0xb069('0x6d')][_0xb069('0x3c')](_0x5b2df0,{'type':db[_0xb069('0x6e')][_0xb069('0x6f')][_0xb069('0x70')],'raw':!![]})[_0xb069('0x1e')](function(_0x3526e9){return _0x3526e9;});})[_0xb069('0x1e')](function(_0xd0d29c){if(_0xd0d29c){_0x35e599[_0xb069('0x24')]['contact']=_0xd0d29c[0x0];if(!_0x4912df[_0xb069('0x56')][_0xb069('0x5f')])return;return db['User'][_0xb069('0x54')]({'where':{'id':_0x4912df[_0xb069('0x56')][_0xb069('0x5f')],'role':_0xb069('0x61')},'attributes':['id',_0xb069('0x34'),'fullname',_0xb069('0x71'),'internal'],'raw':!![]});}return null;})[_0xb069('0x1e')](function(_0x43c242){if(!_0x43c242)return null;_0x35e599[_0xb069('0x24')][_0xb069('0x61')]=_0x43c242;return _0x35e599;})[_0xb069('0x1e')](function(_0x4d6e14){if(_0x4d6e14){if(_0x4912df[_0xb069('0x56')]['manual']){_0x35e599[_0xb069('0x24')][_0xb069('0x72')]=util[_0xb069('0x73')]('SIP/%s',_0x4912df['user'][_0xb069('0x34')]);_0x35e599[_0xb069('0x24')]['channel']=_0x35e599[_0xb069('0x74')];_0x35e599[_0xb069('0x24')][_0xb069('0x75')]=_0x35e599['channel'];_0x35e599[_0xb069('0x24')][_0xb069('0x76')]='accept';return respondWithRpcPromise(_0xb069('0x77'),_0xb069('0x77'),{'event':_0xb069('0x78'),'message':_[_0xb069('0x49')](_0x35e599[_0xb069('0x24')],JSON[_0xb069('0x79')](_0x35e599[_0xb069('0x66')]['formData']))},client9002)[_0xb069('0x1e')](function(){return _0x35e599;});}return _0x35e599;}return null;})['then'](respondWithResult(_0x43f05a,null))[_0xb069('0x26')](handleError(_0x43f05a,null));};var interaction_log=require(_0xb069('0x59'))(_0xb069('0x7a'));exports[_0xb069('0x30')]=function(_0x1d01e2,_0x48002a,_0x395ed5){var _0xd6dafc={'agent':{},'channel':'chat'};if(_0x1d01e2[_0xb069('0x56')]['id']){delete _0x1d01e2[_0xb069('0x56')]['id'];}_0x1d01e2['body'][_0xb069('0x5f')]=_0x1d01e2[_0xb069('0x56')]['UserId']||_0x1d01e2['user']['id'];_0xd6dafc[_0xb069('0x61')]['id']=_0x1d01e2[_0xb069('0x56')][_0xb069('0x5f')];return db[_0xb069('0x38')][_0xb069('0x54')]({'where':{'id':_0x1d01e2[_0xb069('0x53')]['id'],'UserId':null}})[_0xb069('0x1e')](handleEntityNotFound(_0x48002a,null))['then'](function(_0x2f797e){if(_0x2f797e){_0xd6dafc[_0xb069('0x24')]=_0x2f797e[_0xb069('0x62')]({'plain':!![]});return db[_0xb069('0x63')][_0xb069('0x54')]({'where':{'id':_0x2f797e[_0xb069('0x7b')]}});}return null;})[_0xb069('0x1e')](handleEntityNotFound(_0x48002a,null))[_0xb069('0x1e')](function(_0x59cc5d){if(_0x59cc5d){_0xd6dafc['interaction']=_0x59cc5d['get']({'plain':!![]});interaction_log['info'](_0xb069('0x7c'),_0x1d01e2['user']['id'],_0x1d01e2[_0xb069('0x60')][_0xb069('0x34')],_0x1d01e2[_0xb069('0x60')]['role'],_0xd6dafc[_0xb069('0x66')]['id'],_0x1d01e2['body']?JSON[_0xb069('0x68')](_0x1d01e2[_0xb069('0x56')]):'null');return respondWithRpcPromise(_0xb069('0x7d'),'rejectMessage',_0xd6dafc);}return null;})['then'](function(_0x1f8ad4){var _0xbd3989=_0xb069('0x6b')+_0x1f8ad4[_0xb069('0x24')][_0xb069('0x6c')];return db[_0xb069('0x6d')][_0xb069('0x3c')](_0xbd3989,{'type':db[_0xb069('0x6e')][_0xb069('0x6f')][_0xb069('0x70')],'raw':!![]})['then'](function(_0x5c0b37){return _0x5c0b37;});})[_0xb069('0x1e')](function(_0x158639){if(_0x158639){_0xd6dafc['message'][_0xb069('0x7e')]=_0x158639[0x0];if(!_0x1d01e2[_0xb069('0x56')][_0xb069('0x5f')])return;return db[_0xb069('0x7f')][_0xb069('0x54')]({'where':{'id':_0x1d01e2['body'][_0xb069('0x5f')],'role':_0xb069('0x61')},'attributes':['id','name','fullname',_0xb069('0x71'),_0xb069('0x80')],'raw':!![]});}return null;})[_0xb069('0x1e')](function(_0x884a7){if(!_0x884a7)return null;_0xd6dafc[_0xb069('0x24')]['agent']=_0x884a7;return _0xd6dafc;})['then'](function(_0xc2f700){if(_0xc2f700){_0xc2f700[_0xb069('0x24')][_0xb069('0x72')]=util[_0xb069('0x73')](_0xb069('0x81'),_0x1d01e2[_0xb069('0x60')]['name']);_0xc2f700[_0xb069('0x24')][_0xb069('0x74')]=_0xd6dafc[_0xb069('0x74')];_0xc2f700[_0xb069('0x24')][_0xb069('0x75')]=_0xd6dafc[_0xb069('0x74')];_0xc2f700[_0xb069('0x24')][_0xb069('0x76')]=_0xb069('0x30');respondWithRpcPromise('EventManager',_0xb069('0x77'),{'event':'rejectmessage','message':_[_0xb069('0x49')](_0xd6dafc['message'],JSON['parse'](_0xd6dafc['interaction'][_0xb069('0x82')]))},client9002);return _0xd6dafc;}return null;})[_0xb069('0x1e')](respondWithResult(_0x48002a,null))[_0xb069('0x26')](handleError(_0x48002a,null));};
\ No newline at end of file
+var _0x369b=['catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','internal','parse','formData','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x369b,0xe4));var _0xb369=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x369b[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0xb369('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb369('0x1'));var rp=require(_0xb369('0x2'));var moment=require(_0xb369('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb369('0x4'));var util=require(_0xb369('0x5'));var path=require(_0xb369('0x6'));var sox=require(_0xb369('0x7'));var csv=require(_0xb369('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb369('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb369('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb369('0xb'));var toCsv=require(_0xb369('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb369('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xb369('0xd'));var hardwareService=require(_0xb369('0xe'));var logger=require(_0xb369('0xf'))('api');var utils=require(_0xb369('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xb369('0x11'));var db=require(_0xb369('0x12'))['db'];config[_0xb369('0x13')]=_['defaults'](config[_0xb369('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xb369('0x14'))(new Redis(config[_0xb369('0x13')]));require(_0xb369('0x15'))[_0xb369('0x16')](socket);var jayson=require(_0xb369('0x17'));var client=jayson[_0xb369('0x18')][_0xb369('0x19')]({'port':0x232c});var client9002=jayson[_0xb369('0x18')][_0xb369('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5c3cad,_0x5da475,_0x36e815,_0x35b356){return new BPromise(function(_0x20b9a4,_0x5d73ad){var _0x71f99d=_0x35b356||client;return _0x71f99d[_0xb369('0x1a')](_0x5c3cad,_0x36e815)[_0xb369('0x1b')](function(_0x2fe64b){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5da475,'request\x20sent');logger[_0xb369('0x1c')](_0xb369('0x1d'),_0x5da475,_0xb369('0x1e'),JSON[_0xb369('0x1f')](_0x2fe64b));if(_0x2fe64b[_0xb369('0x20')]){if(_0x2fe64b['error'][_0xb369('0x21')]===0x1f4){logger['error'](_0xb369('0x22'),_0x5da475,_0x2fe64b['error'][_0xb369('0x23')]);return _0x5d73ad(_0x2fe64b[_0xb369('0x20')][_0xb369('0x23')]);}logger[_0xb369('0x20')](_0xb369('0x22'),_0x5da475,_0x2fe64b[_0xb369('0x20')][_0xb369('0x23')]);return _0x20b9a4(_0x2fe64b[_0xb369('0x20')]['message']);}else{logger[_0xb369('0x24')](_0xb369('0x22'),_0x5da475,_0xb369('0x1e'));_0x20b9a4(_0x2fe64b[_0xb369('0x25')]['message']);}})[_0xb369('0x26')](function(_0x398152){logger[_0xb369('0x20')](_0xb369('0x22'),_0x5da475,_0x398152);_0x5d73ad(_0x398152);});});}function respondWithStatusCode(_0x7affc2,_0xbb3355){_0xbb3355=_0xbb3355||0xcc;return function(_0x286d6b){if(_0x286d6b){return _0x7affc2[_0xb369('0x27')](_0xbb3355);}return _0x7affc2[_0xb369('0x28')](_0xbb3355)[_0xb369('0x29')]();};}function respondWithResult(_0x5a1ab8,_0x1c3b45){_0x1c3b45=_0x1c3b45||0xc8;return function(_0x232206){if(_0x232206){return _0x5a1ab8[_0xb369('0x28')](_0x1c3b45)[_0xb369('0x2a')](_0x232206);}};}function respondWithFilteredResult(_0x5aa806,_0x253e0f){return function(_0x77e9ec){if(_0x77e9ec){var _0x19539f=typeof _0x253e0f['offset']==='undefined'&&typeof _0x253e0f[_0xb369('0x2b')]===_0xb369('0x2c');var _0x2ed3f5=_0x77e9ec[_0xb369('0x2d')];var _0x361076=_0x19539f?0x0:_0x253e0f[_0xb369('0x2e')];var _0x262330=_0x19539f?_0x77e9ec[_0xb369('0x2d')]:_0x253e0f[_0xb369('0x2e')]+_0x253e0f['limit'];var _0x281ec6;if(_0x262330>=_0x2ed3f5){_0x262330=_0x2ed3f5;_0x281ec6=0xc8;}else{_0x281ec6=0xce;}_0x5aa806['status'](_0x281ec6);return _0x5aa806[_0xb369('0x2f')](_0xb369('0x30'),_0x361076+'-'+_0x262330+'/'+_0x2ed3f5)[_0xb369('0x2a')](_0x77e9ec);}return null;};}function patchUpdates(_0x354cdb){return function(_0x59c47d){try{jsonpatch[_0xb369('0x31')](_0x59c47d,_0x354cdb,!![]);}catch(_0x4f66e0){return BPromise[_0xb369('0x32')](_0x4f66e0);}return _0x59c47d[_0xb369('0x33')]();};}function saveUpdates(_0x54db5a,_0x1d290d){return function(_0x12b7d7){if(_0x12b7d7){return _0x12b7d7[_0xb369('0x34')](_0x54db5a)[_0xb369('0x1b')](function(_0x3abfba){return _0x3abfba;});}return null;};}function removeEntity(_0x41a571,_0x4bcfb1){return function(_0x42b4a7){if(_0x42b4a7){return _0x42b4a7[_0xb369('0x35')]()[_0xb369('0x1b')](function(){_0x41a571[_0xb369('0x28')](0xcc)[_0xb369('0x29')]();});}};}function handleEntityNotFound(_0x45cc14,_0xcbdacf){return function(_0x1803be){if(!_0x1803be){_0x45cc14['sendStatus'](0x194);}return _0x1803be;};}function handleError(_0x1ab72d,_0x53c42a){_0x53c42a=_0x53c42a||0x1f4;return function(_0x3ba06f){logger[_0xb369('0x20')](_0x3ba06f[_0xb369('0x36')]);if(_0x3ba06f[_0xb369('0x37')]){delete _0x3ba06f[_0xb369('0x37')];}_0x1ab72d[_0xb369('0x28')](_0x53c42a)[_0xb369('0x38')](_0x3ba06f);};}exports[_0xb369('0x39')]=function(_0x585155,_0xa8606){var _0x822865={},_0x193c4d={},_0x1b0b6f={'count':0x0,'rows':[]};var _0x447dcb=_['map'](db[_0xb369('0x3a')][_0xb369('0x3b')],function(_0x58fa14){return{'name':_0x58fa14[_0xb369('0x3c')],'type':_0x58fa14[_0xb369('0x3d')][_0xb369('0x3e')]};});_0x193c4d['model']=_['map'](_0x447dcb,_0xb369('0x37'));_0x193c4d[_0xb369('0x3f')]=_[_0xb369('0x40')](_0x585155[_0xb369('0x3f')]);_0x193c4d[_0xb369('0x41')]=_['intersection'](_0x193c4d['model'],_0x193c4d[_0xb369('0x3f')]);_0x822865[_0xb369('0x42')]=_[_0xb369('0x43')](_0x193c4d[_0xb369('0x44')],qs['fields'](_0x585155['query']['fields']));_0x822865[_0xb369('0x42')]=_0x822865['attributes'][_0xb369('0x45')]?_0x822865[_0xb369('0x42')]:_0x193c4d[_0xb369('0x44')];if(!_0x585155[_0xb369('0x3f')][_0xb369('0x46')](_0xb369('0x47'))){_0x822865['limit']=qs[_0xb369('0x2b')](_0x585155['query']['limit']);_0x822865[_0xb369('0x2e')]=qs[_0xb369('0x2e')](_0x585155[_0xb369('0x3f')][_0xb369('0x2e')]);}_0x822865[_0xb369('0x48')]=qs[_0xb369('0x49')](_0x585155[_0xb369('0x3f')]['sort']);_0x822865[_0xb369('0x4a')]=qs[_0xb369('0x41')](_[_0xb369('0x4b')](_0x585155[_0xb369('0x3f')],_0x193c4d['filters']),_0x447dcb);if(_0x585155['query'][_0xb369('0x4c')]){_0x822865[_0xb369('0x4a')]=_[_0xb369('0x4d')](_0x822865[_0xb369('0x4a')],{'$or':_['map'](_0x447dcb,function(_0x6adf33){if(_0x6adf33[_0xb369('0x3d')]!=='VIRTUAL'){var _0x52a406={};_0x52a406[_0x6adf33[_0xb369('0x37')]]={'$like':'%'+_0x585155[_0xb369('0x3f')][_0xb369('0x4c')]+'%'};return _0x52a406;}})});}_0x822865=_['merge']({},_0x822865,_0x585155[_0xb369('0x4e')]);var _0x5ed89c={'where':_0x822865['where']};return db[_0xb369('0x3a')]['count'](_0x5ed89c)['then'](function(_0xca7fb){_0x1b0b6f['count']=_0xca7fb;if(_0x585155[_0xb369('0x3f')][_0xb369('0x4f')]){_0x822865[_0xb369('0x50')]=[{'all':!![]}];}return db[_0xb369('0x3a')][_0xb369('0x51')](_0x822865);})[_0xb369('0x1b')](function(_0x4ef418){_0x1b0b6f[_0xb369('0x52')]=_0x4ef418;return _0x1b0b6f;})['then'](respondWithFilteredResult(_0xa8606,_0x822865))[_0xb369('0x26')](handleError(_0xa8606,null));};exports[_0xb369('0x53')]=function(_0x51b5de,_0x37883b){var _0x208dbd={'raw':!![],'where':{'id':_0x51b5de[_0xb369('0x54')]['id']}},_0x4f3f3f={};_0x4f3f3f[_0xb369('0x44')]=_['keys'](db[_0xb369('0x3a')][_0xb369('0x3b')]);_0x4f3f3f[_0xb369('0x3f')]=_[_0xb369('0x40')](_0x51b5de[_0xb369('0x3f')]);_0x4f3f3f['filters']=_[_0xb369('0x43')](_0x4f3f3f[_0xb369('0x44')],_0x4f3f3f[_0xb369('0x3f')]);_0x208dbd[_0xb369('0x42')]=_['intersection'](_0x4f3f3f[_0xb369('0x44')],qs[_0xb369('0x55')](_0x51b5de[_0xb369('0x3f')][_0xb369('0x55')]));_0x208dbd[_0xb369('0x42')]=_0x208dbd[_0xb369('0x42')][_0xb369('0x45')]?_0x208dbd[_0xb369('0x42')]:_0x4f3f3f[_0xb369('0x44')];if(_0x51b5de[_0xb369('0x3f')][_0xb369('0x4f')]){_0x208dbd[_0xb369('0x50')]=[{'all':!![]}];}_0x208dbd=_[_0xb369('0x4d')]({},_0x208dbd,_0x51b5de['options']);return db['ChatMessage'][_0xb369('0x56')](_0x208dbd)[_0xb369('0x1b')](handleEntityNotFound(_0x37883b,null))[_0xb369('0x1b')](respondWithResult(_0x37883b,null))[_0xb369('0x26')](handleError(_0x37883b,null));};exports[_0xb369('0x57')]=function(_0x161e4e,_0x444e69){return db[_0xb369('0x3a')][_0xb369('0x57')](_0x161e4e['body'],{})[_0xb369('0x1b')](respondWithResult(_0x444e69,0xc9))[_0xb369('0x26')](handleError(_0x444e69,null));};exports[_0xb369('0x34')]=function(_0x5d510e,_0x54278d){if(_0x5d510e['body']['id']){delete _0x5d510e[_0xb369('0x58')]['id'];}return db[_0xb369('0x3a')][_0xb369('0x56')]({'where':{'id':_0x5d510e[_0xb369('0x54')]['id']}})['then'](handleEntityNotFound(_0x54278d,null))[_0xb369('0x1b')](saveUpdates(_0x5d510e[_0xb369('0x58')],null))[_0xb369('0x1b')](respondWithResult(_0x54278d,null))[_0xb369('0x26')](handleError(_0x54278d,null));};exports['destroy']=function(_0x1cdd9d,_0x24928f){return db['ChatMessage'][_0xb369('0x56')]({'where':{'id':_0x1cdd9d[_0xb369('0x54')]['id']}})['then'](handleEntityNotFound(_0x24928f,null))[_0xb369('0x1b')](removeEntity(_0x24928f,null))[_0xb369('0x26')](handleError(_0x24928f,null));};exports[_0xb369('0x59')]=function(_0x59b2e1,_0x2e9b3e){return db[_0xb369('0x3a')][_0xb369('0x59')]()[_0xb369('0x1b')](respondWithResult(_0x2e9b3e,null))[_0xb369('0x26')](handleError(_0x2e9b3e,null));};var interaction_log=require(_0xb369('0xf'))('chat-interactions');exports[_0xb369('0x5a')]=function(_0x2117f2,_0x247b5d,_0x94e116){var _0x150722={'agent':{},'channel':_0xb369('0x5b')};if(_0x2117f2[_0xb369('0x58')]['id']){delete _0x2117f2['body']['id'];}_0x2117f2[_0xb369('0x58')][_0xb369('0x5c')]=!![];_0x2117f2['body'][_0xb369('0x5d')]=moment()[_0xb369('0x5e')](_0xb369('0x5f'));_0x2117f2['body'][_0xb369('0x60')]=_0x2117f2[_0xb369('0x58')]['UserId']||_0x2117f2[_0xb369('0x61')]['id'];_0x150722['agent']['id']=_0x2117f2[_0xb369('0x58')][_0xb369('0x60')];return db['ChatMessage'][_0xb369('0x56')]({'where':{'id':_0x2117f2[_0xb369('0x54')]['id'],'UserId':null}})[_0xb369('0x1b')](handleEntityNotFound(_0x247b5d,null))[_0xb369('0x1b')](saveUpdates(_0x2117f2['body'],null))[_0xb369('0x1b')](function(_0x282b8d){if(_0x282b8d){_0x150722[_0xb369('0x23')]=_0x282b8d['get']({'plain':!![]});return db[_0xb369('0x62')]['find']({'where':{'id':_0x282b8d[_0xb369('0x63')]}});}return null;})[_0xb369('0x1b')](handleEntityNotFound(_0x247b5d,null))[_0xb369('0x1b')](function(_0x115b55){if(_0x115b55){return _0x115b55['update']({'UserId':_0x2117f2[_0xb369('0x58')]['UserId'],'read1stAt':_[_0xb369('0x64')](_0x115b55['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb369('0x1b')](function(_0x4ffdb7){if(_0x4ffdb7){_0x150722[_0xb369('0x65')]=_0x4ffdb7['get']({'plain':!![]});interaction_log[_0xb369('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2117f2[_0xb369('0x61')]['id'],_0x2117f2[_0xb369('0x61')][_0xb369('0x37')],_0x2117f2[_0xb369('0x61')]['role'],_0x150722[_0xb369('0x65')]['id'],_0x2117f2[_0xb369('0x58')]?JSON[_0xb369('0x1f')](_0x2117f2['body']):_0xb369('0x66'));return respondWithRpcPromise(_0xb369('0x67'),_0xb369('0x68'),_0x150722);}return null;})[_0xb369('0x1b')](function(_0x1c115d){var _0x4dbe13=_0xb369('0x69')+_0x1c115d[_0xb369('0x23')][_0xb369('0x6a')];return db[_0xb369('0x6b')][_0xb369('0x3f')](_0x4dbe13,{'type':db['Sequelize'][_0xb369('0x6c')][_0xb369('0x6d')],'raw':!![]})[_0xb369('0x1b')](function(_0xa08371){return _0xa08371;});})['then'](function(_0x6a9eab){if(_0x6a9eab){_0x150722[_0xb369('0x23')][_0xb369('0x6e')]=_0x6a9eab[0x0];if(!_0x2117f2[_0xb369('0x58')][_0xb369('0x60')])return;return db[_0xb369('0x6f')][_0xb369('0x56')]({'where':{'id':_0x2117f2[_0xb369('0x58')]['UserId'],'role':_0xb369('0x70')},'attributes':['id','name',_0xb369('0x71'),_0xb369('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5c3314){if(!_0x5c3314)return null;_0x150722[_0xb369('0x23')][_0xb369('0x70')]=_0x5c3314;return _0x150722;})['then'](function(_0x2c30d2){if(_0x2c30d2){if(_0x2117f2[_0xb369('0x58')][_0xb369('0x73')]){_0x150722[_0xb369('0x23')][_0xb369('0x74')]=util[_0xb369('0x5e')](_0xb369('0x75'),_0x2117f2['user'][_0xb369('0x37')]);_0x150722[_0xb369('0x23')][_0xb369('0x76')]=_0x150722[_0xb369('0x76')];_0x150722[_0xb369('0x23')][_0xb369('0x77')]=_0x150722[_0xb369('0x76')];_0x150722[_0xb369('0x23')][_0xb369('0x78')]=_0xb369('0x5a');return respondWithRpcPromise(_0xb369('0x79'),'EventManager',{'event':_0xb369('0x7a'),'message':_[_0xb369('0x4d')](_0x150722['message'],JSON['parse'](_0x150722[_0xb369('0x65')]['formData']))},client9002)[_0xb369('0x1b')](function(){return _0x150722;});}return _0x150722;}return null;})['then'](respondWithResult(_0x247b5d,null))[_0xb369('0x26')](handleError(_0x247b5d,null));};var interaction_log=require(_0xb369('0xf'))(_0xb369('0x7b'));exports[_0xb369('0x32')]=function(_0x246d1f,_0x3ca74e,_0x246683){var _0x25eaad={'agent':{},'channel':_0xb369('0x5b')};if(_0x246d1f[_0xb369('0x58')]['id']){delete _0x246d1f['body']['id'];}_0x246d1f['body']['UserId']=_0x246d1f[_0xb369('0x58')][_0xb369('0x60')]||_0x246d1f[_0xb369('0x61')]['id'];_0x25eaad[_0xb369('0x70')]['id']=_0x246d1f[_0xb369('0x58')][_0xb369('0x60')];return db[_0xb369('0x3a')][_0xb369('0x56')]({'where':{'id':_0x246d1f[_0xb369('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ca74e,null))['then'](function(_0x14e641){if(_0x14e641){_0x25eaad[_0xb369('0x23')]=_0x14e641[_0xb369('0x7c')]({'plain':!![]});return db['ChatInteraction'][_0xb369('0x56')]({'where':{'id':_0x14e641['ChatInteractionId']}});}return null;})[_0xb369('0x1b')](handleEntityNotFound(_0x3ca74e,null))['then'](function(_0xe941f3){if(_0xe941f3){_0x25eaad[_0xb369('0x65')]=_0xe941f3[_0xb369('0x7c')]({'plain':!![]});interaction_log[_0xb369('0x24')](_0xb369('0x7d'),_0x246d1f[_0xb369('0x61')]['id'],_0x246d1f[_0xb369('0x61')][_0xb369('0x37')],_0x246d1f[_0xb369('0x61')][_0xb369('0x7e')],_0x25eaad[_0xb369('0x65')]['id'],_0x246d1f[_0xb369('0x58')]?JSON['stringify'](_0x246d1f[_0xb369('0x58')]):_0xb369('0x66'));return respondWithRpcPromise(_0xb369('0x7f'),_0xb369('0x80'),_0x25eaad);}return null;})[_0xb369('0x1b')](function(_0x2b3c44){var _0x5ea819=_0xb369('0x69')+_0x2b3c44['message']['ContactId'];return db[_0xb369('0x6b')][_0xb369('0x3f')](_0x5ea819,{'type':db[_0xb369('0x81')][_0xb369('0x6c')][_0xb369('0x6d')],'raw':!![]})[_0xb369('0x1b')](function(_0x417a1c){return _0x417a1c;});})[_0xb369('0x1b')](function(_0x211208){if(_0x211208){_0x25eaad['message'][_0xb369('0x6e')]=_0x211208[0x0];if(!_0x246d1f[_0xb369('0x58')][_0xb369('0x60')])return;return db[_0xb369('0x6f')]['find']({'where':{'id':_0x246d1f[_0xb369('0x58')][_0xb369('0x60')],'role':'agent'},'attributes':['id',_0xb369('0x37'),_0xb369('0x71'),_0xb369('0x72'),_0xb369('0x82')],'raw':!![]});}return null;})[_0xb369('0x1b')](function(_0x283a50){if(!_0x283a50)return null;_0x25eaad[_0xb369('0x23')]['agent']=_0x283a50;return _0x25eaad;})[_0xb369('0x1b')](function(_0x33b434){if(_0x33b434){_0x33b434[_0xb369('0x23')][_0xb369('0x74')]=util[_0xb369('0x5e')](_0xb369('0x75'),_0x246d1f['user'][_0xb369('0x37')]);_0x33b434[_0xb369('0x23')][_0xb369('0x76')]=_0x25eaad[_0xb369('0x76')];_0x33b434[_0xb369('0x23')]['motionChannel']=_0x25eaad[_0xb369('0x76')];_0x33b434[_0xb369('0x23')][_0xb369('0x78')]=_0xb369('0x32');respondWithRpcPromise(_0xb369('0x79'),_0xb369('0x79'),{'event':'rejectmessage','message':_[_0xb369('0x4d')](_0x25eaad[_0xb369('0x23')],JSON[_0xb369('0x83')](_0x25eaad[_0xb369('0x65')][_0xb369('0x84')]))},client9002);return _0x25eaad;}return null;})[_0xb369('0x1b')](respondWithResult(_0x3ca74e,null))[_0xb369('0x26')](handleError(_0x3ca74e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 1fa7505..7c92a63 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x339e=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x19446d,_0x2e4229){var _0xbf8527=function(_0x479720){while(--_0x479720){_0x19446d['push'](_0x19446d['shift']());}};_0xbf8527(++_0x2e4229);}(_0x339e,0x89));var _0xe339=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x339e[_0x26b80e];return _0x84a8a8;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xe339('0x0'))['db'][_0xe339('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe339('0x2')](0x0);var events={'afterCreate':_0xe339('0x3'),'afterUpdate':_0xe339('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5dd8c1){return function(_0x348fad,_0x3c8561,_0x13c3a4){ChatMessageEvents[_0xe339('0x5')](_0x5dd8c1+':'+_0x348fad['id'],_0x348fad);ChatMessageEvents[_0xe339('0x5')](_0x5dd8c1,_0x348fad);_0x13c3a4(null);};}for(var e in events){if(events[_0xe339('0x6')](e)){var event=events[e];ChatMessage[_0xe339('0x7')](e,emitEvent(event));}}module[_0xe339('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x102f=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x5c67e3,_0x3b1a11){var _0x52762d=function(_0x2f20a7){while(--_0x2f20a7){_0x5c67e3['push'](_0x5c67e3['shift']());}};_0x52762d(++_0x3b1a11);}(_0x102f,0x127));var _0xf102=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x102f[_0x2160a9];return _0xa88cf7;};'use strict';var EventEmitter=require(_0xf102('0x0'));var ChatMessage=require(_0xf102('0x1'))['db'][_0xf102('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf102('0x3')](0x0);var events={'afterCreate':_0xf102('0x4'),'afterUpdate':_0xf102('0x5'),'afterDestroy':_0xf102('0x6')};function emitEvent(_0x450bff){return function(_0x196900,_0x9f58a0,_0x1b03c0){ChatMessageEvents[_0xf102('0x7')](_0x450bff+':'+_0x196900['id'],_0x196900);ChatMessageEvents[_0xf102('0x7')](_0x450bff,_0x196900);_0x1b03c0(null);};}for(var e in events){if(events[_0xf102('0x8')](e)){var event=events[e];ChatMessage[_0xf102('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index ebcd793..b20bd51 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x605c=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./chatMessage.attributes','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','then','createdAt','error','utf8mb4_unicode_ci'];(function(_0x13682c,_0x455b1d){var _0x40550=function(_0x570149){while(--_0x570149){_0x13682c['push'](_0x13682c['shift']());}};_0x40550(++_0x455b1d);}(_0x605c,0x1db));var _0xc605=function(_0x417fd1,_0x5b8052){_0x417fd1=_0x417fd1-0x0;var _0x504abb=_0x605c[_0x417fd1];return _0x504abb;};'use strict';var _=require(_0xc605('0x0'));var util=require(_0xc605('0x1'));var logger=require(_0xc605('0x2'))(_0xc605('0x3'));var moment=require(_0xc605('0x4'));var BPromise=require('bluebird');var rp=require(_0xc605('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc605('0x6'));var config=require('../../config/environment');var attributes=require(_0xc605('0x7'));module[_0xc605('0x8')]=function(_0x49d252,_0x17c755){return _0x49d252[_0xc605('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xc605('0xa'),'fields':[_0xc605('0xb')],'type':_0xc605('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3814d6,_0x2d2507,_0x5f5376){var _0x105cd9=_0x49d252[_0xc605('0xd')];var _0x5a8e45=_0x3814d6[_0xc605('0xe')]({'plain':!![]});if(_0x5a8e45['direction']['toLowerCase']()==='in'||_0x5a8e45[_0xc605('0xf')][_0xc605('0x10')]()===_0xc605('0x11')&&!_0x5a8e45[_0xc605('0x12')]&&!_[_0xc605('0x13')](_0x5a8e45['UserId'])){_0x105cd9['ChatInteraction'][_0xc605('0x14')]({'where':{'id':_0x5a8e45['ChatInteractionId']}})[_0xc605('0x15')](function(_0x8a172){if(_0x8a172){_0x8a172['update']({'lastMsgAt':_0x5a8e45[_0xc605('0x16')],'lastMsgDirection':_0x5a8e45['direction'][_0xc605('0x10')]()});}})['catch'](function(_0x595e56){console[_0xc605('0x17')](_0x595e56);});}_0x5f5376();}},'charset':'utf8mb4','collate':_0xc605('0x18')});};
\ No newline at end of file
+var _0xff3c=['util','api','moment','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1d58f0,_0x1a82db){var _0x2105a4=function(_0x5950b7){while(--_0x5950b7){_0x1d58f0['push'](_0x1d58f0['shift']());}};_0x2105a4(++_0x1a82db);}(_0xff3c,0x179));var _0xcff3=function(_0x1fb0cd,_0x1f71e9){_0x1fb0cd=_0x1fb0cd-0x0;var _0x293374=_0xff3c[_0x1fb0cd];return _0x293374;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require('../../config/logger')(_0xcff3('0x2'));var moment=require(_0xcff3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x4'));var rimraf=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var attributes=require(_0xcff3('0x7'));module[_0xcff3('0x8')]=function(_0x308a82,_0x47b899){return _0x308a82['define'](_0xcff3('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcff3('0xa'),'fields':['body'],'type':_0xcff3('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d9aec,_0x32db64,_0x3de9db){var _0x4473d7=_0x308a82[_0xcff3('0xc')];var _0x42e9da=_0x3d9aec['get']({'plain':!![]});if(_0x42e9da['direction'][_0xcff3('0xd')]()==='in'||_0x42e9da[_0xcff3('0xe')][_0xcff3('0xd')]()===_0xcff3('0xf')&&!_0x42e9da[_0xcff3('0x10')]&&!_[_0xcff3('0x11')](_0x42e9da[_0xcff3('0x12')])){_0x4473d7[_0xcff3('0x13')][_0xcff3('0x14')]({'where':{'id':_0x42e9da[_0xcff3('0x15')]}})[_0xcff3('0x16')](function(_0x155309){if(_0x155309){_0x155309[_0xcff3('0x17')]({'lastMsgAt':_0x42e9da[_0xcff3('0x18')],'lastMsgDirection':_0x42e9da[_0xcff3('0xe')][_0xcff3('0xd')]()});}})['catch'](function(_0x3fabce){console['error'](_0x3fabce);});}_0x3de9db();}},'charset':_0xcff3('0x19'),'collate':_0xcff3('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 51c0d19..182e386 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x677a=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatMessage','create','options','raw','CreateChatMessage','lodash','moment','bluebird'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x677a,0xd6));var _0xa677=function(_0x195ea7,_0x2873b1){_0x195ea7=_0x195ea7-0x0;var _0x10e3c1=_0x677a[_0x195ea7];return _0x10e3c1;};'use strict';var _=require(_0xa677('0x0'));var util=require('util');var moment=require(_0xa677('0x1'));var BPromise=require(_0xa677('0x2'));var rs=require(_0xa677('0x3'));var fs=require('fs');var Redis=require(_0xa677('0x4'));var db=require(_0xa677('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa677('0x6'))(_0xa677('0x7'));var config=require(_0xa677('0x8'));var jayson=require(_0xa677('0x9'));var client=jayson[_0xa677('0xa')]['http']({'port':0x232a});config[_0xa677('0xb')]=_[_0xa677('0xc')](config[_0xa677('0xb')],{'host':_0xa677('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xa677('0xe')](socket);function respondWithRpcPromise(_0x4c9e8c,_0x3e5e2c,_0x1d6586){return new BPromise(function(_0x5d2451,_0xead831){return client[_0xa677('0xf')](_0x4c9e8c,_0x1d6586)[_0xa677('0x10')](function(_0x96f98d){logger['info'](_0xa677('0x11'),_0x3e5e2c,_0xa677('0x12'));logger[_0xa677('0x13')](_0xa677('0x14'),_0x3e5e2c,'request\x20sent',JSON[_0xa677('0x15')](_0x96f98d));if(_0x96f98d['error']){if(_0x96f98d[_0xa677('0x16')][_0xa677('0x17')]===0x1f4){logger[_0xa677('0x16')](_0xa677('0x11'),_0x3e5e2c,_0x96f98d[_0xa677('0x16')][_0xa677('0x18')]);return _0xead831(_0x96f98d[_0xa677('0x16')][_0xa677('0x18')]);}logger[_0xa677('0x16')](_0xa677('0x11'),_0x3e5e2c,_0x96f98d[_0xa677('0x16')][_0xa677('0x18')]);return _0x5d2451(_0x96f98d[_0xa677('0x16')][_0xa677('0x18')]);}else{logger['info'](_0xa677('0x11'),_0x3e5e2c,_0xa677('0x12'));_0x5d2451(_0x96f98d['result']['message']);}})[_0xa677('0x19')](function(_0x73350){logger[_0xa677('0x16')](_0xa677('0x11'),_0x3e5e2c,_0x73350);_0xead831(_0x73350);});});}exports['CreateChatMessage']=function(_0x2eab12){var _0x2122ac=this;return new Promise(function(_0xad957e,_0x44de05){return db[_0xa677('0x1a')][_0xa677('0x1b')](_0x2eab12['body'],{'raw':_0x2eab12[_0xa677('0x1c')]?_0x2eab12['options'][_0xa677('0x1d')]===undefined?!![]:![]:!![]})[_0xa677('0x10')](function(_0x45eb0f){logger['info'](_0xa677('0x1e'),_0x2eab12);logger[_0xa677('0x13')](_0xa677('0x1e'),_0x2eab12,JSON[_0xa677('0x15')](_0x45eb0f));_0xad957e(_0x45eb0f);})['catch'](function(_0x1aa82b){logger[_0xa677('0x16')]('CreateChatMessage',_0x1aa82b[_0xa677('0x18')],_0x2eab12);_0x44de05(_0x2122ac[_0xa677('0x16')](0x1f4,_0x1aa82b[_0xa677('0x18')]));});});};
\ No newline at end of file
+var _0xb573=['message','result','catch','ChatMessage','create','body','raw','CreateChatMessage','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x4f8b44,_0x4eda31){var _0x45727b=function(_0x566b10){while(--_0x566b10){_0x4f8b44['push'](_0x4f8b44['shift']());}};_0x45727b(++_0x4eda31);}(_0xb573,0x101));var _0x3b57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb573[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b57('0x0'));var util=require('util');var moment=require(_0x3b57('0x1'));var BPromise=require(_0x3b57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b57('0x3'));var db=require(_0x3b57('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b57('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3b57('0x6')][_0x3b57('0x7')]({'port':0x232a});config[_0x3b57('0x8')]=_[_0x3b57('0x9')](config[_0x3b57('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b57('0xa'))(new Redis(config[_0x3b57('0x8')]));require(_0x3b57('0xb'))[_0x3b57('0xc')](socket);function respondWithRpcPromise(_0x3637f7,_0x36a88e,_0x534ffd){return new BPromise(function(_0x59cbba,_0x53f34f){return client[_0x3b57('0xd')](_0x3637f7,_0x534ffd)[_0x3b57('0xe')](function(_0xb8a66b){logger[_0x3b57('0xf')](_0x3b57('0x10'),_0x36a88e,_0x3b57('0x11'));logger[_0x3b57('0x12')](_0x3b57('0x13'),_0x36a88e,_0x3b57('0x11'),JSON['stringify'](_0xb8a66b));if(_0xb8a66b['error']){if(_0xb8a66b['error'][_0x3b57('0x14')]===0x1f4){logger['error'](_0x3b57('0x10'),_0x36a88e,_0xb8a66b[_0x3b57('0x15')]['message']);return _0x53f34f(_0xb8a66b['error'][_0x3b57('0x16')]);}logger[_0x3b57('0x15')](_0x3b57('0x10'),_0x36a88e,_0xb8a66b[_0x3b57('0x15')]['message']);return _0x59cbba(_0xb8a66b[_0x3b57('0x15')]['message']);}else{logger[_0x3b57('0xf')](_0x3b57('0x10'),_0x36a88e,_0x3b57('0x11'));_0x59cbba(_0xb8a66b[_0x3b57('0x17')][_0x3b57('0x16')]);}})[_0x3b57('0x18')](function(_0x2c1d6d){logger[_0x3b57('0x15')](_0x3b57('0x10'),_0x36a88e,_0x2c1d6d);_0x53f34f(_0x2c1d6d);});});}exports['CreateChatMessage']=function(_0x1db958){var _0x56c127=this;return new Promise(function(_0x8488ca,_0x1477bc){return db[_0x3b57('0x19')][_0x3b57('0x1a')](_0x1db958[_0x3b57('0x1b')],{'raw':_0x1db958['options']?_0x1db958['options'][_0x3b57('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x32fe49){logger[_0x3b57('0xf')](_0x3b57('0x1d'),_0x1db958);logger[_0x3b57('0x12')](_0x3b57('0x1d'),_0x1db958,JSON[_0x3b57('0x1e')](_0x32fe49));_0x8488ca(_0x32fe49);})[_0x3b57('0x18')](function(_0x3265f4){logger['error'](_0x3b57('0x1d'),_0x3265f4[_0x3b57('0x16')],_0x1db958);_0x1477bc(_0x56c127['error'](0x1f4,_0x3265f4[_0x3b57('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 433e305..1fe586a 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x379e=['./chatMessage.events','emit','removeListener','length','chatMessage:'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x379e,0x104));var _0xe379=function(_0x3f0ba1,_0xfb3397){_0x3f0ba1=_0x3f0ba1-0x0;var _0x50ac0f=_0x379e[_0x3f0ba1];return _0x50ac0f;};'use strict';var ChatMessageEvents=require(_0xe379('0x0'));var events=['save','remove','update'];function createListener(_0x594cd4,_0xccbef2){return function(_0x1e24f9){_0xccbef2[_0xe379('0x1')](_0x594cd4,_0x1e24f9);};}function removeListener(_0x3db31a,_0x475418){return function(){ChatMessageEvents[_0xe379('0x2')](_0x3db31a,_0x475418);};}exports['register']=function(_0x1f6c46){for(var _0x24221c=0x0,_0x166621=events[_0xe379('0x3')];_0x24221c<_0x166621;_0x24221c++){var _0x22cb37=events[_0x24221c];var _0x5475e7=createListener(_0xe379('0x4')+_0x22cb37,_0x1f6c46);ChatMessageEvents['on'](_0x22cb37,_0x5475e7);}};
\ No newline at end of file
+var _0x5334=['update','chatMessage:','./chatMessage.events','save','remove'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x5334,0x84));var _0x4533=function(_0x3db511,_0x44be0c){_0x3db511=_0x3db511-0x0;var _0x28f626=_0x5334[_0x3db511];return _0x28f626;};'use strict';var ChatMessageEvents=require(_0x4533('0x0'));var events=[_0x4533('0x1'),_0x4533('0x2'),_0x4533('0x3')];function createListener(_0x39af56,_0x52b768){return function(_0x17585f){_0x52b768['emit'](_0x39af56,_0x17585f);};}function removeListener(_0x42184d,_0x11ce61){return function(){ChatMessageEvents['removeListener'](_0x42184d,_0x11ce61);};}exports['register']=function(_0x51b4ce){for(var _0x201673=0x0,_0x4dea06=events['length'];_0x201673<_0x4dea06;_0x201673++){var _0x487906=events[_0x201673];var _0x3fbdc3=createListener(_0x4533('0x4')+_0x487906,_0x51b4ce);ChatMessageEvents['on'](_0x487906,_0x3fbdc3);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b39101d..0f47702 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a7f=['isAuthenticated','/describe','describe','/:id','post','tracked','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get'];(function(_0x48928d,_0x5b3413){var _0x45367f=function(_0x31a008){while(--_0x31a008){_0x48928d['push'](_0x48928d['shift']());}};_0x45367f(++_0x5b3413);}(_0x0a7f,0xb0));var _0xf0a7=function(_0x198add,_0x239d3c){_0x198add=_0x198add-0x0;var _0x35bfaa=_0x0a7f[_0x198add];return _0x35bfaa;};'use strict';var multer=require(_0xf0a7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf0a7('0x1'));var router=express[_0xf0a7('0x2')]();var fs_extra=require(_0xf0a7('0x3'));var auth=require(_0xf0a7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf0a7('0x5'));var controller=require(_0xf0a7('0x6'));router[_0xf0a7('0x7')]('/',auth[_0xf0a7('0x8')](),controller['index']);router[_0xf0a7('0x7')](_0xf0a7('0x9'),auth[_0xf0a7('0x8')](),controller[_0xf0a7('0xa')]);router[_0xf0a7('0x7')](_0xf0a7('0xb'),auth[_0xf0a7('0x8')](),controller['show']);router[_0xf0a7('0xc')]('/',auth[_0xf0a7('0x8')](),interaction[_0xf0a7('0xd')]('chat',_0xf0a7('0xe')),controller[_0xf0a7('0xf')]);router[_0xf0a7('0x10')](_0xf0a7('0xb'),controller[_0xf0a7('0x11')]);router[_0xf0a7('0x10')]('/:id/accept',auth['isAuthenticated'](),controller[_0xf0a7('0x12')]);router[_0xf0a7('0x10')](_0xf0a7('0x13'),auth[_0xf0a7('0x8')](),controller[_0xf0a7('0x14')]);router['delete']('/:id',auth[_0xf0a7('0x8')](),controller[_0xf0a7('0x15')]);module[_0xf0a7('0x16')]=router;
\ No newline at end of file
+var _0xa94f=['../../components/auth/service','../../config/environment','./chatMessage.controller','get','index','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','Router'];(function(_0x4f631a,_0x34bb43){var _0x37ec95=function(_0x294331){while(--_0x294331){_0x4f631a['push'](_0x4f631a['shift']());}};_0x37ec95(++_0x34bb43);}(_0xa94f,0x184));var _0xfa94=function(_0x2a1f02,_0x411fc1){_0x2a1f02=_0x2a1f02-0x0;var _0x385f3f=_0xa94f[_0x2a1f02];return _0x385f3f;};'use strict';var multer=require(_0xfa94('0x0'));var util=require(_0xfa94('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa94('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfa94('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfa94('0x4'));var controller=require(_0xfa94('0x5'));router[_0xfa94('0x6')]('/',auth['isAuthenticated'](),controller[_0xfa94('0x7')]);router[_0xfa94('0x6')]('/describe',auth[_0xfa94('0x8')](),controller[_0xfa94('0x9')]);router['get'](_0xfa94('0xa'),auth['isAuthenticated'](),controller[_0xfa94('0xb')]);router[_0xfa94('0xc')]('/',auth[_0xfa94('0x8')](),interaction[_0xfa94('0xd')](_0xfa94('0xe'),_0xfa94('0xf')),controller['create']);router[_0xfa94('0x10')](_0xfa94('0xa'),controller[_0xfa94('0x11')]);router['put']('/:id/accept',auth[_0xfa94('0x8')](),controller[_0xfa94('0x12')]);router[_0xfa94('0x10')](_0xfa94('0x13'),auth['isAuthenticated'](),controller[_0xfa94('0x14')]);router[_0xfa94('0x15')](_0xfa94('0xa'),auth[_0xfa94('0x8')](),controller[_0xfa94('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index e04917f..c91f503 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x279d0a,_0xd987ba){var _0x403056=function(_0x38e9f2){while(--_0x38e9f2){_0x279d0a['push'](_0x279d0a['shift']());}};_0x403056(++_0xd987ba);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34646f,_0x55a313){_0x34646f=_0x34646f-0x0;var _0x490624=_0x5f2f[_0x34646f];return _0x490624;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x577677,_0x150870){var _0x3a9818=function(_0x23b6ce){while(--_0x23b6ce){_0x577677['push'](_0x577677['shift']());}};_0x3a9818(++_0x150870);}(_0x5f2f,0x73));var _0xf5f2=function(_0x197789,_0x43d35b){_0x197789=_0x197789-0x0;var _0x48dcd=_0x5f2f[_0x197789];return _0x48dcd;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index b33ed98..330ad2c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x24a553,_0x5c9959){_0x24a553=_0x24a553-0x0;var _0x451aa5=_0x7a54[_0x24a553];return _0x451aa5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x53fbb7,_0x37a6f8){var _0x3075f8=function(_0x279717){while(--_0x279717){_0x53fbb7['push'](_0x53fbb7['shift']());}};_0x3075f8(++_0x37a6f8);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 9bc4949..6e80f88 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2619=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x328378,_0x1ce409){var _0x57f607=function(_0x22aec3){while(--_0x22aec3){_0x328378['push'](_0x328378['shift']());}};_0x57f607(++_0x1ce409);}(_0x2619,0x168));var _0x9261=function(_0x25a1c3,_0x4962c7){_0x25a1c3=_0x25a1c3-0x0;var _0x47b7a8=_0x2619[_0x25a1c3];return _0x47b7a8;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9261('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9261('0x1')](0x0);var events={'afterCreate':_0x9261('0x2'),'afterUpdate':_0x9261('0x3'),'afterDestroy':_0x9261('0x4')};function emitEvent(_0x32ac7d){return function(_0x54e29b,_0x2eabab,_0x1dc634){ChatOfflineMessageEvents[_0x9261('0x5')](_0x32ac7d+':'+_0x54e29b['id'],_0x54e29b);ChatOfflineMessageEvents[_0x9261('0x5')](_0x32ac7d,_0x54e29b);_0x1dc634(null);};}for(var e in events){if(events[_0x9261('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x9261('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xa445=['events','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x58725a,_0x389d19){var _0x2e6e65=function(_0x2f034e){while(--_0x2f034e){_0x58725a['push'](_0x58725a['shift']());}};_0x2e6e65(++_0x389d19);}(_0xa445,0xfa));var _0x5a44=function(_0x1909fa,_0x167ebe){_0x1909fa=_0x1909fa-0x0;var _0x2b1caa=_0xa445[_0x1909fa];return _0x2b1caa;};'use strict';var EventEmitter=require(_0x5a44('0x0'));var ChatOfflineMessage=require(_0x5a44('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5a44('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5b5f27){return function(_0x4d06bb,_0x1a3581,_0x10e14d){ChatOfflineMessageEvents[_0x5a44('0x3')](_0x5b5f27+':'+_0x4d06bb['id'],_0x4d06bb);ChatOfflineMessageEvents['emit'](_0x5b5f27,_0x4d06bb);_0x10e14d(null);};}for(var e in events){if(events[_0x5a44('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 4374bd4..4b44e07 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x068c=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x48e53c,_0x24baf7){var _0xb8dae2=function(_0x244913){while(--_0x244913){_0x48e53c['push'](_0x48e53c['shift']());}};_0xb8dae2(++_0x24baf7);}(_0x068c,0xdc));var _0xc068=function(_0x49bbf8,_0x31ea69){_0x49bbf8=_0x49bbf8-0x0;var _0x29d1d7=_0x068c[_0x49bbf8];return _0x29d1d7;};'use strict';var attributes=require(_0xc068('0x0'));module[_0xc068('0x1')]=function(_0x5129b4){return _0x5129b4[_0xc068('0x2')](_0xc068('0x3'),attributes,{'tableName':_0xc068('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc068('0x5')});};
\ No newline at end of file
+var _0xf8a1=['exports','utf8mb4'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf8a1,0x68));var _0x1f8a=function(_0x23ae76,_0x4f5909){_0x23ae76=_0x23ae76-0x0;var _0x36b7cf=_0xf8a1[_0x23ae76];return _0x36b7cf;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x1f8a('0x0')]=function(_0x412018){return _0x412018['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f8a('0x1'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 8084eca..93a6e13 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe52=['code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2ae0af,_0x2ba5f2){var _0xbd8402=function(_0x417762){while(--_0x417762){_0x2ae0af['push'](_0x2ae0af['shift']());}};_0xbd8402(++_0x2ba5f2);}(_0xfe52,0x1a8));var _0x2fe5=function(_0x4472b6,_0x3768b6){_0x4472b6=_0x4472b6-0x0;var _0x153531=_0xfe52[_0x4472b6];return _0x153531;};'use strict';var _=require(_0x2fe5('0x0'));var util=require(_0x2fe5('0x1'));var moment=require(_0x2fe5('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fe5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fe5('0x4'))['db'];var utils=require(_0x2fe5('0x5'));var logger=require(_0x2fe5('0x6'))(_0x2fe5('0x7'));var config=require('../../config/environment');var jayson=require(_0x2fe5('0x8'));var client=jayson[_0x2fe5('0x9')][_0x2fe5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40e891,_0x3575e3,_0x5d0d9e){return new BPromise(function(_0x2970b9,_0x285761){return client[_0x2fe5('0xb')](_0x40e891,_0x5d0d9e)['then'](function(_0x113c43){logger['info'](_0x2fe5('0xc'),_0x3575e3,'request\x20sent');logger[_0x2fe5('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3575e3,_0x2fe5('0xe'),JSON[_0x2fe5('0xf')](_0x113c43));if(_0x113c43[_0x2fe5('0x10')]){if(_0x113c43[_0x2fe5('0x10')][_0x2fe5('0x11')]===0x1f4){logger[_0x2fe5('0x10')](_0x2fe5('0xc'),_0x3575e3,_0x113c43[_0x2fe5('0x10')]['message']);return _0x285761(_0x113c43[_0x2fe5('0x10')]['message']);}logger['error'](_0x2fe5('0xc'),_0x3575e3,_0x113c43[_0x2fe5('0x10')][_0x2fe5('0x12')]);return _0x2970b9(_0x113c43[_0x2fe5('0x10')][_0x2fe5('0x12')]);}else{logger['info'](_0x2fe5('0xc'),_0x3575e3,'request\x20sent');_0x2970b9(_0x113c43[_0x2fe5('0x13')][_0x2fe5('0x12')]);}})[_0x2fe5('0x14')](function(_0x137723){logger[_0x2fe5('0x10')](_0x2fe5('0xc'),_0x3575e3,_0x137723);_0x285761(_0x137723);});});}
\ No newline at end of file
+var _0x53ba=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0xdb4cf,_0x319856){var _0x504265=function(_0x531daa){while(--_0x531daa){_0xdb4cf['push'](_0xdb4cf['shift']());}};_0x504265(++_0x319856);}(_0x53ba,0x18a));var _0xa53b=function(_0x272084,_0x5d30c1){_0x272084=_0x272084-0x0;var _0x1bb50f=_0x53ba[_0x272084];return _0x1bb50f;};'use strict';var _=require(_0xa53b('0x0'));var util=require(_0xa53b('0x1'));var moment=require(_0xa53b('0x2'));var BPromise=require(_0xa53b('0x3'));var rs=require(_0xa53b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa53b('0x5'));var logger=require(_0xa53b('0x6'))(_0xa53b('0x7'));var config=require(_0xa53b('0x8'));var jayson=require(_0xa53b('0x9'));var client=jayson[_0xa53b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x202134,_0x237755,_0x5c63ba){return new BPromise(function(_0x178981,_0x44bff6){return client[_0xa53b('0xb')](_0x202134,_0x5c63ba)['then'](function(_0x10dea8){logger[_0xa53b('0xc')](_0xa53b('0xd'),_0x237755,_0xa53b('0xe'));logger['debug'](_0xa53b('0xf'),_0x237755,_0xa53b('0xe'),JSON[_0xa53b('0x10')](_0x10dea8));if(_0x10dea8[_0xa53b('0x11')]){if(_0x10dea8[_0xa53b('0x11')][_0xa53b('0x12')]===0x1f4){logger[_0xa53b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x237755,_0x10dea8[_0xa53b('0x11')][_0xa53b('0x13')]);return _0x44bff6(_0x10dea8['error'][_0xa53b('0x13')]);}logger['error'](_0xa53b('0xd'),_0x237755,_0x10dea8['error'][_0xa53b('0x13')]);return _0x178981(_0x10dea8['error'][_0xa53b('0x13')]);}else{logger[_0xa53b('0xc')](_0xa53b('0xd'),_0x237755,'request\x20sent');_0x178981(_0x10dea8[_0xa53b('0x14')][_0xa53b('0x13')]);}})['catch'](function(_0x36a5a4){logger['error'](_0xa53b('0xd'),_0x237755,_0x36a5a4);_0x44bff6(_0x36a5a4);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6e4620e..e4a485f 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2df9=['isAuthenticated','index','describe','show','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x23f8d2,_0x301fec){var _0x5d174b=function(_0x2c3c9e){while(--_0x2c3c9e){_0x23f8d2['push'](_0x23f8d2['shift']());}};_0x5d174b(++_0x301fec);}(_0x2df9,0x172));var _0x92df=function(_0x14da79,_0x3b626e){_0x14da79=_0x14da79-0x0;var _0xb1b31a=_0x2df9[_0x14da79];return _0xb1b31a;};'use strict';var multer=require(_0x92df('0x0'));var util=require(_0x92df('0x1'));var path=require('path');var timeout=require(_0x92df('0x2'));var express=require(_0x92df('0x3'));var router=express[_0x92df('0x4')]();var fs_extra=require(_0x92df('0x5'));var auth=require(_0x92df('0x6'));var interaction=require(_0x92df('0x7'));var config=require(_0x92df('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x92df('0x9')]('/',auth[_0x92df('0xa')](),controller[_0x92df('0xb')]);router['get']('/describe',auth[_0x92df('0xa')](),controller[_0x92df('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x92df('0xd')]);router['post']('/',auth[_0x92df('0xa')](),controller['create']);router['put'](_0x92df('0xe'),auth[_0x92df('0xa')](),controller[_0x92df('0xf')]);router[_0x92df('0x10')](_0x92df('0xe'),auth[_0x92df('0xa')](),controller[_0x92df('0x11')]);module[_0x92df('0x12')]=router;
\ No newline at end of file
+var _0x1c2e=['create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x1c2e,0x193));var _0xe1c2=function(_0x5bc258,_0x406d3c){_0x5bc258=_0x5bc258-0x0;var _0xe9ae4f=_0x1c2e[_0x5bc258];return _0xe9ae4f;};'use strict';var multer=require(_0xe1c2('0x0'));var util=require(_0xe1c2('0x1'));var path=require(_0xe1c2('0x2'));var timeout=require(_0xe1c2('0x3'));var express=require(_0xe1c2('0x4'));var router=express[_0xe1c2('0x5')]();var fs_extra=require(_0xe1c2('0x6'));var auth=require(_0xe1c2('0x7'));var interaction=require(_0xe1c2('0x8'));var config=require(_0xe1c2('0x9'));var controller=require(_0xe1c2('0xa'));router[_0xe1c2('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe1c2('0xb')](_0xe1c2('0xc'),auth[_0xe1c2('0xd')](),controller[_0xe1c2('0xe')]);router[_0xe1c2('0xb')](_0xe1c2('0xf'),auth[_0xe1c2('0xd')](),controller['show']);router[_0xe1c2('0x10')]('/',auth['isAuthenticated'](),controller[_0xe1c2('0x11')]);router['put'](_0xe1c2('0xf'),auth[_0xe1c2('0xd')](),controller[_0xe1c2('0x12')]);router[_0xe1c2('0x13')](_0xe1c2('0xf'),auth[_0xe1c2('0xd')](),controller['destroy']);module[_0xe1c2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index db0910b..5d16ff6 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7ae8=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x7ae8,0xd8));var _0x87ae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ae8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x87ae('0x0'));module[_0x87ae('0x1')]={'name':{'type':Sequelize[_0x87ae('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x87ae('0x3')](_0x87ae('0x4'),_0x87ae('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x87ae('0x6')]}};
\ No newline at end of file
+var _0x207f=['mouseOver','INTEGER','sequelize','STRING','ENUM','timeout'];(function(_0x35e8c2,_0x1fc071){var _0x1c6bbe=function(_0x39dccb){while(--_0x39dccb){_0x35e8c2['push'](_0x35e8c2['shift']());}};_0x1c6bbe(++_0x1fc071);}(_0x207f,0x158));var _0xf207=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x207f[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xf207('0x0'));module['exports']={'name':{'type':Sequelize[_0xf207('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf207('0x2')]('mouseOver',_0xf207('0x3')),'defaultValue':_0xf207('0x4')},'selector':{'type':Sequelize[_0xf207('0x1')]},'timeout':{'type':Sequelize[_0xf207('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index ff1470a..d313801 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe52=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x3c55f2,_0x47f857){var _0x43fea0=function(_0x2d61f4){while(--_0x2d61f4){_0x3c55f2['push'](_0x3c55f2['shift']());}};_0x43fea0(++_0x47f857);}(_0xbe52,0x164));var _0x2be5=function(_0x415f2b,_0x13e8b4){_0x415f2b=_0x415f2b-0x0;var _0x172201=_0xbe52[_0x415f2b];return _0x172201;};'use strict';var emlformat=require(_0x2be5('0x0'));var rimraf=require(_0x2be5('0x1'));var zipdir=require(_0x2be5('0x2'));var jsonpatch=require(_0x2be5('0x3'));var rp=require(_0x2be5('0x4'));var moment=require('moment');var BPromise=require(_0x2be5('0x5'));var Mustache=require(_0x2be5('0x6'));var util=require(_0x2be5('0x7'));var path=require(_0x2be5('0x8'));var sox=require(_0x2be5('0x9'));var csv=require(_0x2be5('0xa'));var ejs=require(_0x2be5('0xb'));var fs=require('fs');var fs_extra=require(_0x2be5('0xc'));var _=require(_0x2be5('0xd'));var squel=require(_0x2be5('0xe'));var crypto=require(_0x2be5('0xf'));var jsforce=require(_0x2be5('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2be5('0xa'));var querystring=require(_0x2be5('0x11'));var Papa=require(_0x2be5('0x12'));var Redis=require('ioredis');var authService=require(_0x2be5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2be5('0x14'));var logger=require(_0x2be5('0x15'))(_0x2be5('0x16'));var utils=require(_0x2be5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2be5('0x18'));var db=require(_0x2be5('0x19'))['db'];function respondWithStatusCode(_0x5ce5ca,_0x588a62){_0x588a62=_0x588a62||0xcc;return function(_0x25b643){if(_0x25b643){return _0x5ce5ca[_0x2be5('0x1a')](_0x588a62);}return _0x5ce5ca['status'](_0x588a62)[_0x2be5('0x1b')]();};}function respondWithResult(_0x3af879,_0xd905c9){_0xd905c9=_0xd905c9||0xc8;return function(_0x71834e){if(_0x71834e){return _0x3af879[_0x2be5('0x1c')](_0xd905c9)[_0x2be5('0x1d')](_0x71834e);}};}function respondWithFilteredResult(_0x4a1be3,_0x4f8fce){return function(_0x3f4996){if(_0x3f4996){var _0x5e6f16=typeof _0x4f8fce[_0x2be5('0x1e')]==='undefined'&&typeof _0x4f8fce[_0x2be5('0x1f')]===_0x2be5('0x20');var _0x35db37=_0x3f4996['count'];var _0x8ea605=_0x5e6f16?0x0:_0x4f8fce[_0x2be5('0x1e')];var _0x544625=_0x5e6f16?_0x3f4996[_0x2be5('0x21')]:_0x4f8fce[_0x2be5('0x1e')]+_0x4f8fce[_0x2be5('0x1f')];var _0x1bffbf;if(_0x544625>=_0x35db37){_0x544625=_0x35db37;_0x1bffbf=0xc8;}else{_0x1bffbf=0xce;}_0x4a1be3[_0x2be5('0x1c')](_0x1bffbf);return _0x4a1be3[_0x2be5('0x22')](_0x2be5('0x23'),_0x8ea605+'-'+_0x544625+'/'+_0x35db37)['json'](_0x3f4996);}return null;};}function patchUpdates(_0x514223){return function(_0x329cf0){try{jsonpatch[_0x2be5('0x24')](_0x329cf0,_0x514223,!![]);}catch(_0x1bafd2){return BPromise[_0x2be5('0x25')](_0x1bafd2);}return _0x329cf0['save']();};}function saveUpdates(_0x2ecc64,_0x2bc13e){return function(_0x2bbe9f){if(_0x2bbe9f){return _0x2bbe9f[_0x2be5('0x26')](_0x2ecc64)[_0x2be5('0x27')](function(_0x3f78d4){return _0x3f78d4;});}return null;};}function removeEntity(_0x2b776f,_0x29910d){return function(_0x3f4430){if(_0x3f4430){return _0x3f4430[_0x2be5('0x28')]()['then'](function(){_0x2b776f[_0x2be5('0x1c')](0xcc)[_0x2be5('0x1b')]();});}};}function handleEntityNotFound(_0x323c2d,_0x4d3aee){return function(_0x25c47c){if(!_0x25c47c){_0x323c2d[_0x2be5('0x1a')](0x194);}return _0x25c47c;};}function handleError(_0x33ecf1,_0x127093){_0x127093=_0x127093||0x1f4;return function(_0x434637){logger[_0x2be5('0x29')](_0x434637['stack']);if(_0x434637[_0x2be5('0x2a')]){delete _0x434637[_0x2be5('0x2a')];}_0x33ecf1[_0x2be5('0x1c')](_0x127093)[_0x2be5('0x2b')](_0x434637);};}exports[_0x2be5('0x2c')]=function(_0x28c6bb,_0x19edba){var _0x5c8fec={'raw':!![],'where':{'id':_0x28c6bb[_0x2be5('0x2d')]['id']}},_0xed9be3={};_0xed9be3[_0x2be5('0x2e')]=_[_0x2be5('0x2f')](db[_0x2be5('0x30')][_0x2be5('0x31')]);_0xed9be3[_0x2be5('0x32')]=_['keys'](_0x28c6bb[_0x2be5('0x32')]);_0xed9be3[_0x2be5('0x33')]=_[_0x2be5('0x34')](_0xed9be3['model'],_0xed9be3[_0x2be5('0x32')]);_0x5c8fec[_0x2be5('0x35')]=_['intersection'](_0xed9be3[_0x2be5('0x2e')],qs[_0x2be5('0x36')](_0x28c6bb[_0x2be5('0x32')][_0x2be5('0x36')]));_0x5c8fec['attributes']=_0x5c8fec[_0x2be5('0x35')][_0x2be5('0x37')]?_0x5c8fec[_0x2be5('0x35')]:_0xed9be3['model'];if(_0x28c6bb['query'][_0x2be5('0x38')]){_0x5c8fec[_0x2be5('0x39')]=[{'all':!![]}];}_0x5c8fec=_[_0x2be5('0x3a')]({},_0x5c8fec,_0x28c6bb[_0x2be5('0x3b')]);return db[_0x2be5('0x30')][_0x2be5('0x3c')](_0x5c8fec)['then'](handleEntityNotFound(_0x19edba,null))[_0x2be5('0x27')](respondWithResult(_0x19edba,null))[_0x2be5('0x3d')](handleError(_0x19edba,null));};exports['create']=function(_0x101c6f,_0x935255){return db[_0x2be5('0x30')]['create'](_0x101c6f['body'],{})[_0x2be5('0x27')](respondWithResult(_0x935255,0xc9))[_0x2be5('0x3d')](handleError(_0x935255,null));};exports[_0x2be5('0x26')]=function(_0x1644be,_0x470f1d){if(_0x1644be[_0x2be5('0x3e')]['id']){delete _0x1644be[_0x2be5('0x3e')]['id'];}return db[_0x2be5('0x30')][_0x2be5('0x3c')]({'where':{'id':_0x1644be['params']['id']}})[_0x2be5('0x27')](handleEntityNotFound(_0x470f1d,null))[_0x2be5('0x27')](saveUpdates(_0x1644be[_0x2be5('0x3e')],null))['then'](respondWithResult(_0x470f1d,null))[_0x2be5('0x3d')](handleError(_0x470f1d,null));};exports[_0x2be5('0x28')]=function(_0x42f912,_0x4e21ff){return db['ChatProactiveAction'][_0x2be5('0x3c')]({'where':{'id':_0x42f912[_0x2be5('0x2d')]['id']}})[_0x2be5('0x27')](handleEntityNotFound(_0x4e21ff,null))['then'](removeEntity(_0x4e21ff,null))[_0x2be5('0x3d')](handleError(_0x4e21ff,null));};
\ No newline at end of file
+var _0xa990=['offset','limit','json','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count'];(function(_0x3eef73,_0x61c3b2){var _0xe1b202=function(_0x12ca19){while(--_0x12ca19){_0x3eef73['push'](_0x3eef73['shift']());}};_0xe1b202(++_0x61c3b2);}(_0xa990,0xc9));var _0x0a99=function(_0x2e5f54,_0x13dd84){_0x2e5f54=_0x2e5f54-0x0;var _0x407d00=_0xa990[_0x2e5f54];return _0x407d00;};'use strict';var emlformat=require(_0x0a99('0x0'));var rimraf=require(_0x0a99('0x1'));var zipdir=require(_0x0a99('0x2'));var jsonpatch=require(_0x0a99('0x3'));var rp=require(_0x0a99('0x4'));var moment=require(_0x0a99('0x5'));var BPromise=require(_0x0a99('0x6'));var Mustache=require(_0x0a99('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0a99('0x8'));var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require(_0x0a99('0xc'));var squel=require(_0x0a99('0xd'));var crypto=require(_0x0a99('0xe'));var jsforce=require(_0x0a99('0xf'));var deskjs=require(_0x0a99('0x10'));var toCsv=require(_0x0a99('0x9'));var querystring=require(_0x0a99('0x11'));var Papa=require('papaparse');var Redis=require(_0x0a99('0x12'));var authService=require(_0x0a99('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a99('0x14'));var logger=require(_0x0a99('0x15'))(_0x0a99('0x16'));var utils=require(_0x0a99('0x17'));var config=require(_0x0a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x19'))['db'];function respondWithStatusCode(_0x3aaaad,_0x57ab88){_0x57ab88=_0x57ab88||0xcc;return function(_0xb6a34d){if(_0xb6a34d){return _0x3aaaad[_0x0a99('0x1a')](_0x57ab88);}return _0x3aaaad[_0x0a99('0x1b')](_0x57ab88)[_0x0a99('0x1c')]();};}function respondWithResult(_0x346061,_0x23d018){_0x23d018=_0x23d018||0xc8;return function(_0x18c124){if(_0x18c124){return _0x346061[_0x0a99('0x1b')](_0x23d018)['json'](_0x18c124);}};}function respondWithFilteredResult(_0x5a17e1,_0x2c40db){return function(_0x3ac17e){if(_0x3ac17e){var _0xb7356c=typeof _0x2c40db['offset']===_0x0a99('0x1d')&&typeof _0x2c40db['limit']==='undefined';var _0x20104c=_0x3ac17e[_0x0a99('0x1e')];var _0x3de006=_0xb7356c?0x0:_0x2c40db[_0x0a99('0x1f')];var _0x572ce5=_0xb7356c?_0x3ac17e['count']:_0x2c40db[_0x0a99('0x1f')]+_0x2c40db[_0x0a99('0x20')];var _0xbe23f3;if(_0x572ce5>=_0x20104c){_0x572ce5=_0x20104c;_0xbe23f3=0xc8;}else{_0xbe23f3=0xce;}_0x5a17e1[_0x0a99('0x1b')](_0xbe23f3);return _0x5a17e1['set']('Content-Range',_0x3de006+'-'+_0x572ce5+'/'+_0x20104c)[_0x0a99('0x21')](_0x3ac17e);}return null;};}function patchUpdates(_0x4d0c78){return function(_0x1e8d30){try{jsonpatch['apply'](_0x1e8d30,_0x4d0c78,!![]);}catch(_0x191ee4){return BPromise['reject'](_0x191ee4);}return _0x1e8d30[_0x0a99('0x22')]();};}function saveUpdates(_0x356681,_0x3b1d60){return function(_0x1c1e5c){if(_0x1c1e5c){return _0x1c1e5c[_0x0a99('0x23')](_0x356681)[_0x0a99('0x24')](function(_0x19c870){return _0x19c870;});}return null;};}function removeEntity(_0x1d803c,_0x398dd2){return function(_0x5745ca){if(_0x5745ca){return _0x5745ca['destroy']()[_0x0a99('0x24')](function(){_0x1d803c[_0x0a99('0x1b')](0xcc)[_0x0a99('0x1c')]();});}};}function handleEntityNotFound(_0x518617,_0x5d917c){return function(_0x371b31){if(!_0x371b31){_0x518617[_0x0a99('0x1a')](0x194);}return _0x371b31;};}function handleError(_0x1b0e94,_0x40e765){_0x40e765=_0x40e765||0x1f4;return function(_0x10e70f){logger[_0x0a99('0x25')](_0x10e70f[_0x0a99('0x26')]);if(_0x10e70f[_0x0a99('0x27')]){delete _0x10e70f[_0x0a99('0x27')];}_0x1b0e94['status'](_0x40e765)[_0x0a99('0x28')](_0x10e70f);};}exports['show']=function(_0x47bc34,_0x4e597b){var _0x223bdb={'raw':!![],'where':{'id':_0x47bc34[_0x0a99('0x29')]['id']}},_0x379c7e={};_0x379c7e[_0x0a99('0x2a')]=_[_0x0a99('0x2b')](db[_0x0a99('0x2c')][_0x0a99('0x2d')]);_0x379c7e['query']=_[_0x0a99('0x2b')](_0x47bc34[_0x0a99('0x2e')]);_0x379c7e[_0x0a99('0x2f')]=_[_0x0a99('0x30')](_0x379c7e['model'],_0x379c7e['query']);_0x223bdb['attributes']=_[_0x0a99('0x30')](_0x379c7e[_0x0a99('0x2a')],qs[_0x0a99('0x31')](_0x47bc34['query'][_0x0a99('0x31')]));_0x223bdb[_0x0a99('0x32')]=_0x223bdb[_0x0a99('0x32')][_0x0a99('0x33')]?_0x223bdb[_0x0a99('0x32')]:_0x379c7e[_0x0a99('0x2a')];if(_0x47bc34[_0x0a99('0x2e')]['includeAll']){_0x223bdb[_0x0a99('0x34')]=[{'all':!![]}];}_0x223bdb=_[_0x0a99('0x35')]({},_0x223bdb,_0x47bc34[_0x0a99('0x36')]);return db[_0x0a99('0x2c')][_0x0a99('0x37')](_0x223bdb)['then'](handleEntityNotFound(_0x4e597b,null))[_0x0a99('0x24')](respondWithResult(_0x4e597b,null))['catch'](handleError(_0x4e597b,null));};exports['create']=function(_0x5f20d0,_0x51b4ec){return db[_0x0a99('0x2c')]['create'](_0x5f20d0[_0x0a99('0x38')],{})[_0x0a99('0x24')](respondWithResult(_0x51b4ec,0xc9))[_0x0a99('0x39')](handleError(_0x51b4ec,null));};exports[_0x0a99('0x23')]=function(_0x414a0f,_0x43614d){if(_0x414a0f[_0x0a99('0x38')]['id']){delete _0x414a0f[_0x0a99('0x38')]['id'];}return db[_0x0a99('0x2c')][_0x0a99('0x37')]({'where':{'id':_0x414a0f[_0x0a99('0x29')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x43614d,null))[_0x0a99('0x24')](saveUpdates(_0x414a0f['body'],null))[_0x0a99('0x24')](respondWithResult(_0x43614d,null))[_0x0a99('0x39')](handleError(_0x43614d,null));};exports['destroy']=function(_0x3f0a9,_0x549bb9){return db[_0x0a99('0x2c')]['find']({'where':{'id':_0x3f0a9[_0x0a99('0x29')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x549bb9,null))[_0x0a99('0x24')](removeEntity(_0x549bb9,null))[_0x0a99('0x39')](handleError(_0x549bb9,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index e74bdde..9e42e17 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56d6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','ChatProactiveAction'];(function(_0x1583ba,_0x3f0972){var _0x51b6b5=function(_0x4c20db){while(--_0x4c20db){_0x1583ba['push'](_0x1583ba['shift']());}};_0x51b6b5(++_0x3f0972);}(_0x56d6,0x16b));var _0x656d=function(_0x438bea,_0x34be26){_0x438bea=_0x438bea-0x0;var _0x150797=_0x56d6[_0x438bea];return _0x150797;};'use strict';var _=require(_0x656d('0x0'));var util=require(_0x656d('0x1'));var logger=require(_0x656d('0x2'))(_0x656d('0x3'));var moment=require(_0x656d('0x4'));var BPromise=require(_0x656d('0x5'));var rp=require(_0x656d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x656d('0x7'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x656d('0x8')]=function(_0x54cca9,_0x46702f){return _0x54cca9[_0x656d('0x9')](_0x656d('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44ba=['bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','api','moment'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x44ba,0xe0));var _0xa44b=function(_0xf0f7ba,_0x48be70){_0xf0f7ba=_0xf0f7ba-0x0;var _0x44382c=_0x44ba[_0xf0f7ba];return _0x44382c;};'use strict';var _=require(_0xa44b('0x0'));var util=require(_0xa44b('0x1'));var logger=require('../../config/logger')(_0xa44b('0x2'));var moment=require(_0xa44b('0x3'));var BPromise=require(_0xa44b('0x4'));var rp=require(_0xa44b('0x5'));var fs=require('fs');var path=require(_0xa44b('0x6'));var rimraf=require('rimraf');var config=require(_0xa44b('0x7'));var attributes=require(_0xa44b('0x8'));module[_0xa44b('0x9')]=function(_0xc11e90,_0x5f4309){return _0xc11e90[_0xa44b('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xa44b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index c2a40f9..ca5ee07 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41bc=['message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x453a05,_0x102018){var _0xc42c7d=function(_0x39f5a3){while(--_0x39f5a3){_0x453a05['push'](_0x453a05['shift']());}};_0xc42c7d(++_0x102018);}(_0x41bc,0x1a7));var _0xc41b=function(_0xd1969,_0x5a6d5e){_0xd1969=_0xd1969-0x0;var _0x5056b7=_0x41bc[_0xd1969];return _0x5056b7;};'use strict';var _=require(_0xc41b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc41b('0x1'));var fs=require('fs');var Redis=require(_0xc41b('0x2'));var db=require(_0xc41b('0x3'))['db'];var utils=require(_0xc41b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc41b('0x5'));var jayson=require(_0xc41b('0x6'));var client=jayson[_0xc41b('0x7')][_0xc41b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28eba1,_0x43e0de,_0x528817){return new BPromise(function(_0x35e3ca,_0x2ce59c){return client[_0xc41b('0x9')](_0x28eba1,_0x528817)['then'](function(_0x12e2f1){logger[_0xc41b('0xa')](_0xc41b('0xb'),_0x43e0de,_0xc41b('0xc'));logger[_0xc41b('0xd')](_0xc41b('0xe'),_0x43e0de,'request\x20sent',JSON['stringify'](_0x12e2f1));if(_0x12e2f1[_0xc41b('0xf')]){if(_0x12e2f1['error'][_0xc41b('0x10')]===0x1f4){logger[_0xc41b('0xf')](_0xc41b('0xb'),_0x43e0de,_0x12e2f1[_0xc41b('0xf')][_0xc41b('0x11')]);return _0x2ce59c(_0x12e2f1['error']['message']);}logger[_0xc41b('0xf')](_0xc41b('0xb'),_0x43e0de,_0x12e2f1[_0xc41b('0xf')][_0xc41b('0x11')]);return _0x35e3ca(_0x12e2f1[_0xc41b('0xf')]['message']);}else{logger[_0xc41b('0xa')](_0xc41b('0xb'),_0x43e0de,_0xc41b('0xc'));_0x35e3ca(_0x12e2f1[_0xc41b('0x12')][_0xc41b('0x11')]);}})[_0xc41b('0x13')](function(_0x5c2e69){logger[_0xc41b('0xf')](_0xc41b('0xb'),_0x43e0de,_0x5c2e69);_0x2ce59c(_0x5c2e69);});});}
\ No newline at end of file
+var _0xeab5=['http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x25a719,_0x27803b){var _0x389724=function(_0x2cf7b3){while(--_0x2cf7b3){_0x25a719['push'](_0x25a719['shift']());}};_0x389724(++_0x27803b);}(_0xeab5,0x192));var _0x5eab=function(_0x33d9ae,_0x3b54b9){_0x33d9ae=_0x33d9ae-0x0;var _0x5dc9e2=_0xeab5[_0x33d9ae];return _0x5dc9e2;};'use strict';var _=require(_0x5eab('0x0'));var util=require(_0x5eab('0x1'));var moment=require(_0x5eab('0x2'));var BPromise=require('bluebird');var rs=require(_0x5eab('0x3'));var fs=require('fs');var Redis=require(_0x5eab('0x4'));var db=require(_0x5eab('0x5'))['db'];var utils=require(_0x5eab('0x6'));var logger=require(_0x5eab('0x7'))(_0x5eab('0x8'));var config=require(_0x5eab('0x9'));var jayson=require(_0x5eab('0xa'));var client=jayson[_0x5eab('0xb')][_0x5eab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d8aa8,_0x38e526,_0x296872){return new BPromise(function(_0x36fe6b,_0x1178ba){return client[_0x5eab('0xd')](_0x2d8aa8,_0x296872)['then'](function(_0x3bc168){logger[_0x5eab('0xe')](_0x5eab('0xf'),_0x38e526,_0x5eab('0x10'));logger[_0x5eab('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x38e526,_0x5eab('0x10'),JSON['stringify'](_0x3bc168));if(_0x3bc168[_0x5eab('0x12')]){if(_0x3bc168[_0x5eab('0x12')][_0x5eab('0x13')]===0x1f4){logger[_0x5eab('0x12')](_0x5eab('0xf'),_0x38e526,_0x3bc168['error'][_0x5eab('0x14')]);return _0x1178ba(_0x3bc168[_0x5eab('0x12')][_0x5eab('0x14')]);}logger[_0x5eab('0x12')](_0x5eab('0xf'),_0x38e526,_0x3bc168[_0x5eab('0x12')][_0x5eab('0x14')]);return _0x36fe6b(_0x3bc168[_0x5eab('0x12')][_0x5eab('0x14')]);}else{logger[_0x5eab('0xe')](_0x5eab('0xf'),_0x38e526,_0x5eab('0x10'));_0x36fe6b(_0x3bc168[_0x5eab('0x15')][_0x5eab('0x14')]);}})[_0x5eab('0x16')](function(_0x59f9bd){logger[_0x5eab('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x38e526,_0x59f9bd);_0x1178ba(_0x59f9bd);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f098059..98f5f05 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1f74e4,_0x328659){_0x1f74e4=_0x1f74e4-0x0;var _0x2e8856=_0x9c5a[_0x1f74e4];return _0x2e8856;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xeff8,0x186));var _0x8eff=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xeff8[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 779b4bb..efef23f 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5140=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x220d39,_0x1abe28){var _0x356192=function(_0x35d5c6){while(--_0x35d5c6){_0x220d39['push'](_0x220d39['shift']());}};_0x356192(++_0x1abe28);}(_0x5140,0x19c));var _0x0514=function(_0x3af887,_0x514984){_0x3af887=_0x3af887-0x0;var _0x1c1e9e=_0x5140[_0x3af887];return _0x1c1e9e;};'use strict';var Sequelize=require(_0x0514('0x0'));module['exports']={'name':{'type':Sequelize[_0x0514('0x1')],'unique':_0x0514('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0514('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0514('0x4')](_0x0514('0x5'),_0x0514('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x9299=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x257a81,_0x58c5ab){var _0x14ee6d=function(_0x41e9b4){while(--_0x41e9b4){_0x257a81['push'](_0x257a81['shift']());}};_0x14ee6d(++_0x58c5ab);}(_0x9299,0xbb));var _0x9929=function(_0x2aab5c,_0x1590e5){_0x2aab5c=_0x2aab5c-0x0;var _0x3412b4=_0x9299[_0x2aab5c];return _0x3412b4;};'use strict';var Sequelize=require(_0x9929('0x0'));module[_0x9929('0x1')]={'name':{'type':Sequelize[_0x9929('0x2')],'unique':_0x9929('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9929('0x2')]},'timeout':{'type':Sequelize[_0x9929('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9929('0x5')](_0x9929('0x6'),'beepall',_0x9929('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c7c48bb..1c9c18c 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0340=['field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','QueryTypes','every','includes','all','union','compact','removeTeams','forEach','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','apply','save','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','params','includeAll','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','online','interface','flatMap','transaction','addTeams','each','findOrCreate','emit','userChatQueue:save','select'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x0340,0x1d7));var _0x0034=function(_0x1e8040,_0xda9ce7){_0x1e8040=_0x1e8040-0x0;var _0x24a40b=_0x0340[_0x1e8040];return _0x24a40b;};'use strict';var emlformat=require(_0x0034('0x0'));var rimraf=require(_0x0034('0x1'));var zipdir=require(_0x0034('0x2'));var jsonpatch=require(_0x0034('0x3'));var rp=require(_0x0034('0x4'));var moment=require(_0x0034('0x5'));var BPromise=require(_0x0034('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0034('0x7'));var sox=require(_0x0034('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0034('0x9'));var squel=require(_0x0034('0xa'));var crypto=require(_0x0034('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0034('0xc'));var querystring=require('querystring');var Papa=require(_0x0034('0xd'));var Redis=require(_0x0034('0xe'));var authService=require(_0x0034('0xf'));var qs=require(_0x0034('0x10'));var as=require(_0x0034('0x11'));var hardwareService=require(_0x0034('0x12'));var logger=require(_0x0034('0x13'))(_0x0034('0x14'));var utils=require(_0x0034('0x15'));var config=require(_0x0034('0x16'));var licenseUtil=require(_0x0034('0x17'));var db=require('../../mysqldb')['db'];config[_0x0034('0x18')]=_[_0x0034('0x19')](config[_0x0034('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0034('0x1a'))(new Redis(config[_0x0034('0x18')]));require(_0x0034('0x1b'))[_0x0034('0x1c')](socket);var jayson=require(_0x0034('0x1d'));var client=jayson[_0x0034('0x1e')][_0x0034('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x164daa,_0x2ef597,_0x5e3e6b,_0x4ddd8c){return new BPromise(function(_0x2a6472,_0x5e2967){var _0x316a20=_0x4ddd8c||client;return _0x316a20[_0x0034('0x20')](_0x164daa,_0x5e3e6b)[_0x0034('0x21')](function(_0x54295f){logger['info'](_0x0034('0x22'),_0x2ef597,_0x0034('0x23'));logger[_0x0034('0x24')](_0x0034('0x25'),_0x2ef597,_0x0034('0x23'),JSON['stringify'](_0x54295f));if(_0x54295f['error']){if(_0x54295f[_0x0034('0x26')][_0x0034('0x27')]===0x1f4){logger[_0x0034('0x26')](_0x0034('0x22'),_0x2ef597,_0x54295f[_0x0034('0x26')][_0x0034('0x28')]);return _0x5e2967(_0x54295f[_0x0034('0x26')][_0x0034('0x28')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2ef597,_0x54295f[_0x0034('0x26')][_0x0034('0x28')]);return _0x2a6472(_0x54295f[_0x0034('0x26')][_0x0034('0x28')]);}else{logger['info'](_0x0034('0x22'),_0x2ef597,_0x0034('0x23'));_0x2a6472(_0x54295f['result'][_0x0034('0x28')]);}})[_0x0034('0x29')](function(_0x2e6b9c){logger[_0x0034('0x26')](_0x0034('0x22'),_0x2ef597,_0x2e6b9c);_0x5e2967(_0x2e6b9c);});});}function respondWithStatusCode(_0x3f437f,_0x33ec19){_0x33ec19=_0x33ec19||0xcc;return function(_0x3df937){if(_0x3df937){return _0x3f437f['sendStatus'](_0x33ec19);}return _0x3f437f[_0x0034('0x2a')](_0x33ec19)[_0x0034('0x2b')]();};}function respondWithResult(_0x457b92,_0xca6eb7){_0xca6eb7=_0xca6eb7||0xc8;return function(_0x90c080){if(_0x90c080){return _0x457b92[_0x0034('0x2a')](_0xca6eb7)[_0x0034('0x2c')](_0x90c080);}};}function respondWithFilteredResult(_0x21762e,_0x302bcf){return function(_0x577c1f){if(_0x577c1f){var _0x3c01=typeof _0x302bcf[_0x0034('0x2d')]===_0x0034('0x2e')&&typeof _0x302bcf['limit']===_0x0034('0x2e');var _0x1f6d23=_0x577c1f['count'];var _0x35eebb=_0x3c01?0x0:_0x302bcf[_0x0034('0x2d')];var _0x4ddc28=_0x3c01?_0x577c1f['count']:_0x302bcf[_0x0034('0x2d')]+_0x302bcf[_0x0034('0x2f')];var _0x2a5f6e;if(_0x4ddc28>=_0x1f6d23){_0x4ddc28=_0x1f6d23;_0x2a5f6e=0xc8;}else{_0x2a5f6e=0xce;}_0x21762e[_0x0034('0x2a')](_0x2a5f6e);return _0x21762e['set']('Content-Range',_0x35eebb+'-'+_0x4ddc28+'/'+_0x1f6d23)[_0x0034('0x2c')](_0x577c1f);}return null;};}function patchUpdates(_0xd7c48d){return function(_0x5b6144){try{jsonpatch[_0x0034('0x30')](_0x5b6144,_0xd7c48d,!![]);}catch(_0x389482){return BPromise['reject'](_0x389482);}return _0x5b6144[_0x0034('0x31')]();};}function saveUpdates(_0x1399ec,_0x30edb0){return function(_0x26a983){if(_0x26a983){return _0x26a983['update'](_0x1399ec)[_0x0034('0x21')](function(_0x4d9923){return _0x4d9923;});}return null;};}function removeEntity(_0x4b35b4,_0x373954){return function(_0x56541c){if(_0x56541c){return _0x56541c[_0x0034('0x32')]()[_0x0034('0x21')](function(){var _0x270af5=_0x56541c[_0x0034('0x33')]({'plain':!![]});var _0xf8a9ec=_0x0034('0x34');return db[_0x0034('0x35')][_0x0034('0x32')]({'where':{'type':_0xf8a9ec,'resourceId':_0x270af5['id']}})[_0x0034('0x21')](function(){return _0x56541c;});})[_0x0034('0x21')](function(){_0x4b35b4['status'](0xcc)[_0x0034('0x2b')]();});}};}function handleEntityNotFound(_0x461b8a,_0x1e1f78){return function(_0x2de65b){if(!_0x2de65b){_0x461b8a[_0x0034('0x36')](0x194);}return _0x2de65b;};}function handleError(_0x150e1d,_0x1d973b){_0x1d973b=_0x1d973b||0x1f4;return function(_0x3f91d3){logger[_0x0034('0x26')](_0x3f91d3[_0x0034('0x37')]);if(_0x3f91d3[_0x0034('0x38')]){delete _0x3f91d3[_0x0034('0x38')];}_0x150e1d[_0x0034('0x2a')](_0x1d973b)[_0x0034('0x39')](_0x3f91d3);};}exports[_0x0034('0x3a')]=function(_0x251c60,_0x3caaf4){var _0x48aea8={},_0x8087cb={},_0x5a93ab={'count':0x0,'rows':[]};var _0x2998f7=_[_0x0034('0x3b')](db[_0x0034('0x3c')][_0x0034('0x3d')],function(_0x45f7fa){return{'name':_0x45f7fa[_0x0034('0x3e')],'type':_0x45f7fa['type'][_0x0034('0x3f')]};});_0x8087cb[_0x0034('0x40')]=_['map'](_0x2998f7,'name');_0x8087cb[_0x0034('0x41')]=_[_0x0034('0x42')](_0x251c60[_0x0034('0x41')]);_0x8087cb[_0x0034('0x43')]=_[_0x0034('0x44')](_0x8087cb[_0x0034('0x40')],_0x8087cb[_0x0034('0x41')]);_0x48aea8[_0x0034('0x45')]=_[_0x0034('0x44')](_0x8087cb['model'],qs['fields'](_0x251c60[_0x0034('0x41')][_0x0034('0x46')]));_0x48aea8[_0x0034('0x45')]=_0x48aea8[_0x0034('0x45')][_0x0034('0x47')]?_0x48aea8[_0x0034('0x45')]:_0x8087cb['model'];if(!_0x251c60['query'][_0x0034('0x48')](_0x0034('0x49'))){_0x48aea8[_0x0034('0x2f')]=qs[_0x0034('0x2f')](_0x251c60[_0x0034('0x41')][_0x0034('0x2f')]);_0x48aea8['offset']=qs['offset'](_0x251c60[_0x0034('0x41')][_0x0034('0x2d')]);}_0x48aea8[_0x0034('0x4a')]=qs[_0x0034('0x4b')](_0x251c60[_0x0034('0x41')]['sort']);_0x48aea8[_0x0034('0x4c')]=qs[_0x0034('0x43')](_['pick'](_0x251c60['query'],_0x8087cb['filters']),_0x2998f7);if(_0x251c60[_0x0034('0x41')][_0x0034('0x4d')]){_0x48aea8[_0x0034('0x4c')]=_[_0x0034('0x4e')](_0x48aea8[_0x0034('0x4c')],{'$or':_[_0x0034('0x3b')](_0x2998f7,function(_0x84a1c3){if(_0x84a1c3[_0x0034('0x4f')]!==_0x0034('0x50')){var _0x2d7625={};_0x2d7625[_0x84a1c3[_0x0034('0x38')]]={'$like':'%'+_0x251c60[_0x0034('0x41')][_0x0034('0x4d')]+'%'};return _0x2d7625;}})});}_0x48aea8=_[_0x0034('0x4e')]({},_0x48aea8,_0x251c60[_0x0034('0x51')]);var _0x190fbf={'where':_0x48aea8[_0x0034('0x4c')]};return db['ChatQueue']['count'](_0x190fbf)[_0x0034('0x21')](function(_0x254566){_0x5a93ab[_0x0034('0x52')]=_0x254566;if(_0x251c60[_0x0034('0x41')]['includeAll']){_0x48aea8[_0x0034('0x53')]=[{'all':!![]}];}return db[_0x0034('0x3c')][_0x0034('0x54')](_0x48aea8);})[_0x0034('0x21')](function(_0x174c45){_0x5a93ab[_0x0034('0x55')]=_0x174c45;return _0x5a93ab;})['then'](respondWithFilteredResult(_0x3caaf4,_0x48aea8))['catch'](handleError(_0x3caaf4,null));};exports['show']=function(_0x348700,_0x154eb7){var _0x222273={'raw':!![],'where':{'id':_0x348700[_0x0034('0x56')]['id']}},_0x2956ce={};_0x2956ce['model']=_[_0x0034('0x42')](db['ChatQueue'][_0x0034('0x3d')]);_0x2956ce[_0x0034('0x41')]=_[_0x0034('0x42')](_0x348700[_0x0034('0x41')]);_0x2956ce[_0x0034('0x43')]=_[_0x0034('0x44')](_0x2956ce[_0x0034('0x40')],_0x2956ce[_0x0034('0x41')]);_0x222273[_0x0034('0x45')]=_[_0x0034('0x44')](_0x2956ce[_0x0034('0x40')],qs[_0x0034('0x46')](_0x348700[_0x0034('0x41')]['fields']));_0x222273[_0x0034('0x45')]=_0x222273[_0x0034('0x45')]['length']?_0x222273[_0x0034('0x45')]:_0x2956ce[_0x0034('0x40')];if(_0x348700[_0x0034('0x41')][_0x0034('0x57')]){_0x222273[_0x0034('0x53')]=[{'all':!![]}];}_0x222273=_['merge']({},_0x222273,_0x348700[_0x0034('0x51')]);return db[_0x0034('0x3c')]['find'](_0x222273)[_0x0034('0x21')](handleEntityNotFound(_0x154eb7,null))[_0x0034('0x21')](respondWithResult(_0x154eb7,null))['catch'](handleError(_0x154eb7,null));};exports['create']=function(_0x510d5a,_0x476ba0){return db[_0x0034('0x3c')][_0x0034('0x58')](_0x510d5a[_0x0034('0x59')],{})[_0x0034('0x21')](function(_0x55ed3d){var _0x10975f=_0x510d5a['user'][_0x0034('0x33')]({'plain':!![]});if(!_0x10975f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10975f[_0x0034('0x5a')]===_0x0034('0x5b')){var _0x3e4757=_0x55ed3d['get']({'plain':!![]});var _0x53da13=_0x0034('0x34');return db[_0x0034('0x5c')][_0x0034('0x5d')]({'where':{'name':_0x53da13,'userProfileId':_0x10975f[_0x0034('0x5e')]},'raw':!![]})[_0x0034('0x21')](function(_0x1a6753){if(_0x1a6753&&_0x1a6753[_0x0034('0x5f')]===0x0){return db[_0x0034('0x35')]['create']({'name':_0x3e4757[_0x0034('0x38')],'resourceId':_0x3e4757['id'],'type':_0x1a6753[_0x0034('0x38')],'sectionId':_0x1a6753['id']},{})[_0x0034('0x21')](function(){return _0x55ed3d;});}else{return _0x55ed3d;}})['catch'](function(_0x178fc9){logger[_0x0034('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x178fc9);throw _0x178fc9;});}return _0x55ed3d;})[_0x0034('0x21')](respondWithResult(_0x476ba0,0xc9))['catch'](handleError(_0x476ba0,null));};exports['update']=function(_0x5cfb30,_0x2bb7a9){if(_0x5cfb30[_0x0034('0x59')]['id']){delete _0x5cfb30[_0x0034('0x59')]['id'];}return db[_0x0034('0x3c')]['find']({'where':{'id':_0x5cfb30[_0x0034('0x56')]['id']}})['then'](handleEntityNotFound(_0x2bb7a9,null))['then'](saveUpdates(_0x5cfb30['body'],null))[_0x0034('0x21')](respondWithResult(_0x2bb7a9,null))[_0x0034('0x29')](handleError(_0x2bb7a9,null));};exports[_0x0034('0x32')]=function(_0x231c80,_0x1b19c6){return db[_0x0034('0x3c')]['find']({'where':{'id':_0x231c80[_0x0034('0x56')]['id']}})[_0x0034('0x21')](handleEntityNotFound(_0x1b19c6,null))[_0x0034('0x21')](removeEntity(_0x1b19c6,null))['catch'](handleError(_0x1b19c6,null));};exports[_0x0034('0x60')]=function(_0x37a00d,_0xeaff03){return db[_0x0034('0x3c')][_0x0034('0x60')]()[_0x0034('0x21')](respondWithResult(_0xeaff03,null))[_0x0034('0x29')](handleError(_0xeaff03,null));};exports[_0x0034('0x61')]=function(_0x23c017,_0x441eda,_0x465df7){var _0x5097db={'raw':!![],'where':{}},_0x4dd925={},_0x39bd01;return db[_0x0034('0x3c')][_0x0034('0x62')]({'where':{'id':_0x23c017[_0x0034('0x56')]['id']}})[_0x0034('0x21')](handleEntityNotFound(_0x441eda,null))['then'](function(_0x52f815){if(_0x52f815){_0x39bd01=_0x52f815['get']({'plain':!![]});_0x4dd925[_0x0034('0x40')]=_[_0x0034('0x42')](db[_0x0034('0x63')]['rawAttributes']);_0x4dd925[_0x0034('0x41')]=_[_0x0034('0x42')](_0x23c017['query']);_0x4dd925[_0x0034('0x43')]=_['intersection'](_0x4dd925[_0x0034('0x40')],_0x4dd925[_0x0034('0x41')]);_0x5097db[_0x0034('0x45')]=_[_0x0034('0x44')](_0x4dd925[_0x0034('0x40')],qs['fields'](_0x23c017[_0x0034('0x41')][_0x0034('0x46')]));_0x5097db[_0x0034('0x45')]=_0x5097db[_0x0034('0x45')]['length']?_0x5097db[_0x0034('0x45')]:_0x4dd925[_0x0034('0x40')];if(!_0x23c017['query'][_0x0034('0x48')]('nolimit')){_0x5097db[_0x0034('0x2f')]=qs['limit'](_0x23c017[_0x0034('0x41')][_0x0034('0x2f')]);_0x5097db[_0x0034('0x2d')]=qs[_0x0034('0x2d')](_0x23c017['query'][_0x0034('0x2d')]);}_0x5097db['order']=qs['sort'](_0x23c017[_0x0034('0x41')][_0x0034('0x4b')]);_0x5097db[_0x0034('0x4c')]=qs['filters'](_[_0x0034('0x64')](_0x23c017[_0x0034('0x41')],_0x4dd925['filters']));_0x5097db[_0x0034('0x4c')][_0x0034('0x65')]=_0x52f815['id'];if(_0x23c017[_0x0034('0x41')][_0x0034('0x4d')]){_0x5097db['where']=_[_0x0034('0x4e')](_0x5097db['where'],{'$or':_['map'](_0x5097db['attributes'],function(_0x1917ea){var _0x2fced2={};_0x2fced2[_0x1917ea]={'$like':'%'+_0x23c017[_0x0034('0x41')][_0x0034('0x4d')]+'%'};return _0x2fced2;})});}_0x5097db=_[_0x0034('0x4e')]({},_0x5097db,_0x23c017[_0x0034('0x51')]);return db['UserChatQueue'][_0x0034('0x54')](_0x5097db);}})[_0x0034('0x21')](function(_0x34ab3c){if(_0x34ab3c){return db[_0x0034('0x66')][_0x0034('0x67')]({'where':{'id':_[_0x0034('0x3b')](_0x34ab3c,_0x0034('0x68')),'role':_0x0034('0x69')},'attributes':['id',_0x0034('0x38'),_0x0034('0x6a'),_0x0034('0x6b'),_0x0034('0x6c')]});}})[_0x0034('0x21')](function(_0x19cfe7){if(_0x19cfe7){return{'count':_0x19cfe7[_0x0034('0x52')],'rows':_[_0x0034('0x3b')](_0x19cfe7[_0x0034('0x55')],function(_0x3f4201){return{'membername':_0x3f4201['name'],'UserId':_0x3f4201['id'],'queue_name':_0x39bd01[_0x0034('0x38')],'ChatQueueId':_0x39bd01['id'],'interface':util['format'](_0x0034('0x6d'),_0x0034('0x6e'),_0x3f4201['name']),'penalty':0x0,'paused':_0x3f4201['chatPause'],'createdAt':_0x3f4201[_0x0034('0x6c')],'updatedAt':_0x3f4201[_0x0034('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0034('0x21')](respondWithFilteredResult(_0x441eda,_0x5097db))[_0x0034('0x29')](handleError(_0x441eda,null));};exports[_0x0034('0x6f')]=function(_0x4d0d5e,_0x41d32d,_0x13fb2a){var _0x3ff0f0={};var _0x3c3555={};var _0x98d50e;var _0x523934;return db['ChatQueue'][_0x0034('0x62')]({'where':{'id':_0x4d0d5e[_0x0034('0x56')]['id']}})[_0x0034('0x21')](handleEntityNotFound(_0x41d32d,null))['then'](function(_0x48fb9e){if(_0x48fb9e){_0x98d50e=_0x48fb9e;_0x3c3555['model']=_[_0x0034('0x42')](db[_0x0034('0x70')][_0x0034('0x3d')]);_0x3c3555[_0x0034('0x41')]=_[_0x0034('0x42')](_0x4d0d5e[_0x0034('0x41')]);_0x3c3555[_0x0034('0x43')]=_['intersection'](_0x3c3555[_0x0034('0x40')],_0x3c3555[_0x0034('0x41')]);_0x3ff0f0[_0x0034('0x45')]=_[_0x0034('0x44')](_0x3c3555[_0x0034('0x40')],qs[_0x0034('0x46')](_0x4d0d5e[_0x0034('0x41')][_0x0034('0x46')]));_0x3ff0f0['attributes']=_0x3ff0f0[_0x0034('0x45')][_0x0034('0x47')]?_0x3ff0f0['attributes']:_0x3c3555['model'];_0x3ff0f0[_0x0034('0x4a')]=qs[_0x0034('0x4b')](_0x4d0d5e[_0x0034('0x41')][_0x0034('0x4b')]);_0x3ff0f0[_0x0034('0x4c')]=qs[_0x0034('0x43')](_[_0x0034('0x64')](_0x4d0d5e[_0x0034('0x41')],_0x3c3555[_0x0034('0x43')]));if(_0x4d0d5e['query']['filter']){_0x3ff0f0['where']=_[_0x0034('0x4e')](_0x3ff0f0[_0x0034('0x4c')],{'$or':_[_0x0034('0x3b')](_0x3ff0f0[_0x0034('0x45')],function(_0x11c761){var _0x50a9aa={};_0x50a9aa[_0x11c761]={'$like':'%'+_0x4d0d5e[_0x0034('0x41')][_0x0034('0x4d')]+'%'};return _0x50a9aa;})});}_0x3ff0f0=_['merge']({},_0x3ff0f0,_0x4d0d5e[_0x0034('0x51')]);return _0x98d50e[_0x0034('0x6f')](_0x3ff0f0);}})['then'](function(_0x19e262){if(_0x19e262){_0x523934=_0x19e262[_0x0034('0x47')];if(!_0x4d0d5e[_0x0034('0x41')][_0x0034('0x48')](_0x0034('0x49'))){_0x3ff0f0['limit']=qs[_0x0034('0x2f')](_0x4d0d5e[_0x0034('0x41')][_0x0034('0x2f')]);_0x3ff0f0[_0x0034('0x2d')]=qs['offset'](_0x4d0d5e[_0x0034('0x41')][_0x0034('0x2d')]);}return _0x98d50e[_0x0034('0x6f')](_0x3ff0f0);}})['then'](function(_0x41a5fa){if(_0x41a5fa){return _0x41a5fa?{'count':_0x523934,'rows':_0x41a5fa}:null;}})[_0x0034('0x21')](respondWithResult(_0x41d32d,null))['catch'](handleError(_0x41d32d,null));};exports['addTeams']=function(_0x1f6936,_0x15c549,_0x4692e3){var _0x44a0b2=_0x1f6936[_0x0034('0x59')][_0x0034('0x71')];return db[_0x0034('0x70')][_0x0034('0x54')]({'where':{'id':_0x44a0b2},'attributes':['id'],'include':[{'model':db[_0x0034('0x66')],'as':_0x0034('0x72'),'attributes':['id','name',_0x0034('0x73'),'voicePause',_0x0034('0x74')],'raw':!![]}]})[_0x0034('0x21')](function(_0x1e9f14){if(_0x1e9f14){var _0x2b0b16=_[_0x0034('0x75')](_0x1e9f14,function(_0x4bd334){var _0x3f4cab=_0x4bd334['get']({'plain':!![]});return _0x3f4cab[_0x0034('0x72')];});return db['ChatQueue'][_0x0034('0x5d')]({'where':{'id':_0x1f6936[_0x0034('0x56')]['id']}})[_0x0034('0x21')](function(_0x5e0d2b){return db['sequelize'][_0x0034('0x76')](function(_0x5669c0){return _0x5e0d2b[_0x0034('0x77')](_0x44a0b2,{'transaction':_0x5669c0})['then'](function(){return BPromise[_0x0034('0x78')](_0x2b0b16,function(_0x24b862){return db[_0x0034('0x63')][_0x0034('0x79')]({'where':{'UserId':_0x24b862['id'],'ChatQueueId':_0x1f6936['params']['id']},'transaction':_0x5669c0});});})[_0x0034('0x21')](function(){_0x2b0b16['forEach'](function(_0x2f46b1){socket[_0x0034('0x7a')](_0x0034('0x7b'),{'UserId':_0x2f46b1['id'],'ChatQueueId':_0x5e0d2b['id']});});});});});}})[_0x0034('0x21')](respondWithStatusCode(_0x15c549,null))[_0x0034('0x29')](handleError(_0x15c549,null));};exports['removeTeams']=function(_0x16d295,_0x49e23e,_0x44ec45){return db['Team'][_0x0034('0x54')]({'where':{'id':_0x16d295[_0x0034('0x41')][_0x0034('0x71')]},'attributes':['id'],'include':[{'model':db[_0x0034('0x66')],'as':_0x0034('0x72'),'attributes':['id'],'raw':!![]}]})[_0x0034('0x21')](handleEntityNotFound(_0x49e23e,null))[_0x0034('0x21')](function(_0x2f3867){var _0x5390b1=_[_0x0034('0x3b')](_0x2f3867,'id');var _0x3fc569=[];var _0x19d2f8=[];var _0x38093a=squel[_0x0034('0x7c')]();_0x38093a[_0x0034('0x7d')](_0x0034('0x7e'))[_0x0034('0x7f')](_0x0034('0x80'),'tq')[_0x0034('0x81')](_0x0034('0x82'),'ut',_0x0034('0x83'))[_0x0034('0x4c')]('ChatQueueId\x20=\x20?',_0x16d295[_0x0034('0x56')]['id']);for(var _0x6c2a74=0x0;_0x6c2a74<_0x2f3867[_0x0034('0x47')];_0x6c2a74+=0x1){let _0xa7f352=_0x2f3867[_0x6c2a74];for(var _0x109042=0x0;_0x109042<_0xa7f352[_0x0034('0x72')][_0x0034('0x47')];_0x109042+=0x1){let _0x36f12e=_0xa7f352[_0x0034('0x72')][_0x109042];var _0x21ec0d=_0x38093a[_0x0034('0x84')]();_0x21ec0d[_0x0034('0x4c')]('ut.UserId\x20=\x20?',_0x36f12e['id']);_0x19d2f8[_0x0034('0x85')](db['sequelize'][_0x0034('0x41')](_0x21ec0d['toString'](),{'type':db[_0x0034('0x86')][_0x0034('0x87')]['SELECT']})[_0x0034('0x21')](function(_0x11269a){if(_0x11269a[_0x0034('0x47')]===0x1){return _0x36f12e['id'];}else{var _0x569294=_[_0x0034('0x88')](_[_0x0034('0x3b')](_0x11269a,'TeamId'),function(_0x3d1b6d){return _[_0x0034('0x89')](_0x5390b1,_0x3d1b6d);});if(_0x569294){return _0x36f12e['id'];}}}));}}return BPromise[_0x0034('0x8a')](_0x19d2f8)[_0x0034('0x21')](function(_0x235365){_0x3fc569=_(_0x3fc569)[_0x0034('0x8b')](_0x235365)[_0x0034('0x8c')]()['value']();return db[_0x0034('0x3c')][_0x0034('0x5d')]({'where':{'id':_0x16d295[_0x0034('0x56')]['id']}})[_0x0034('0x21')](function(_0x25aca8){return db[_0x0034('0x86')]['transaction'](function(_0x3b3e3d){return _0x25aca8[_0x0034('0x8d')](_0x16d295[_0x0034('0x41')]['ids'],{'transaction':_0x3b3e3d})['then'](function(){if(!_['isEmpty'](_0x3fc569)){return _0x25aca8['removeAgents'](_0x3fc569,{'transaction':_0x3b3e3d});}})[_0x0034('0x21')](function(){_0x3fc569[_0x0034('0x8e')](function(_0x150b57){socket['emit'](_0x0034('0x8f'),{'UserId':_0x150b57,'ChatQueueId':_0x25aca8['id']});});});});});});})[_0x0034('0x21')](respondWithStatusCode(_0x49e23e,null))[_0x0034('0x29')](handleError(_0x49e23e,null));};exports[_0x0034('0x90')]=function(_0x54283f,_0x2b152f,_0x2bdeee){return db[_0x0034('0x3c')][_0x0034('0x5d')]({'where':{'id':_0x54283f['params']['id']}})[_0x0034('0x21')](handleEntityNotFound(_0x2b152f,null))[_0x0034('0x21')](function(_0x1d39e1){if(_0x1d39e1){return _0x1d39e1[_0x0034('0x90')](_0x54283f[_0x0034('0x59')][_0x0034('0x71')],_['omit'](_0x54283f[_0x0034('0x59')],[_0x0034('0x71'),'id'])||{})[_0x0034('0x91')](function(_0x4ff165){for(var _0x359f1a=0x0;_0x359f1a<_0x54283f[_0x0034('0x59')]['ids'][_0x0034('0x47')];_0x359f1a+=0x1){socket[_0x0034('0x7a')](_0x0034('0x7b'),{'UserId':Number(_0x54283f[_0x0034('0x59')][_0x0034('0x71')][_0x359f1a]),'ChatQueueId':Number(_0x54283f['params']['id'])});}return _0x4ff165;});}})[_0x0034('0x21')](respondWithResult(_0x2b152f,null))['catch'](handleError(_0x2b152f,null));};exports[_0x0034('0x92')]=function(_0x59f046,_0x329637,_0x343ee1){return db[_0x0034('0x3c')][_0x0034('0x5d')]({'where':{'id':_0x59f046['params']['id']}})[_0x0034('0x21')](handleEntityNotFound(_0x329637,null))[_0x0034('0x21')](function(_0x2ea814){if(_0x2ea814){return _0x2ea814[_0x0034('0x92')](_0x59f046['query'][_0x0034('0x71')])['then'](function(){if(_[_0x0034('0x93')](_0x59f046[_0x0034('0x41')][_0x0034('0x71')])){for(var _0x5dd94d=0x0;_0x5dd94d<_0x59f046[_0x0034('0x41')][_0x0034('0x71')]['length'];_0x5dd94d+=0x1){socket[_0x0034('0x7a')](_0x0034('0x8f'),{'UserId':Number(_0x59f046[_0x0034('0x41')][_0x0034('0x71')][_0x5dd94d]),'ChatQueueId':Number(_0x59f046[_0x0034('0x56')]['id'])});}}else{socket[_0x0034('0x7a')](_0x0034('0x8f'),{'UserId':Number(_0x59f046[_0x0034('0x41')][_0x0034('0x71')]),'ChatQueueId':Number(_0x59f046[_0x0034('0x56')]['id'])});}});}})[_0x0034('0x21')](respondWithStatusCode(_0x329637,null))[_0x0034('0x29')](handleError(_0x329637,null));};exports[_0x0034('0x94')]=function(_0xedc6cf,_0x29a495,_0x4142f0){var _0x44dabc={};var _0x3cd067={};var _0x5e3ea7;var _0xc7bf0a;return db[_0x0034('0x3c')][_0x0034('0x62')]({'where':{'id':_0xedc6cf[_0x0034('0x56')]['id']}})[_0x0034('0x21')](handleEntityNotFound(_0x29a495,null))[_0x0034('0x21')](function(_0x4bafe0){if(_0x4bafe0){_0x5e3ea7=_0x4bafe0;_0x3cd067[_0x0034('0x40')]=_['keys'](db[_0x0034('0x66')][_0x0034('0x3d')]);_0x3cd067[_0x0034('0x41')]=_['keys'](_0xedc6cf[_0x0034('0x41')]);_0x3cd067['filters']=_['intersection'](_0x3cd067[_0x0034('0x40')],_0x3cd067[_0x0034('0x41')]);_0x44dabc[_0x0034('0x45')]=_[_0x0034('0x44')](_0x3cd067['model'],qs[_0x0034('0x46')](_0xedc6cf[_0x0034('0x41')][_0x0034('0x46')]));_0x44dabc[_0x0034('0x45')]=_0x44dabc[_0x0034('0x45')][_0x0034('0x47')]?_0x44dabc[_0x0034('0x45')]:_0x3cd067[_0x0034('0x40')];_0x44dabc[_0x0034('0x4a')]=qs[_0x0034('0x4b')](_0xedc6cf[_0x0034('0x41')][_0x0034('0x4b')]);_0x44dabc[_0x0034('0x4c')]=qs[_0x0034('0x43')](_[_0x0034('0x64')](_0xedc6cf[_0x0034('0x41')],_0x3cd067['filters']));if(_0xedc6cf['query']['filter']){_0x44dabc[_0x0034('0x4c')]=_['merge'](_0x44dabc['where'],{'$or':_[_0x0034('0x3b')](_0x44dabc[_0x0034('0x45')],function(_0x1379a5){var _0x16f242={};_0x16f242[_0x1379a5]={'$like':'%'+_0xedc6cf[_0x0034('0x41')][_0x0034('0x4d')]+'%'};return _0x16f242;})});}_0x44dabc=_[_0x0034('0x4e')]({},_0x44dabc,_0xedc6cf[_0x0034('0x51')]);return _0x5e3ea7[_0x0034('0x94')](_0x44dabc);}})[_0x0034('0x21')](function(_0xcee7f){if(_0xcee7f){_0xc7bf0a=_0xcee7f[_0x0034('0x47')];if(!_0xedc6cf[_0x0034('0x41')][_0x0034('0x48')](_0x0034('0x49'))){_0x44dabc[_0x0034('0x2f')]=qs['limit'](_0xedc6cf[_0x0034('0x41')]['limit']);_0x44dabc[_0x0034('0x2d')]=qs[_0x0034('0x2d')](_0xedc6cf[_0x0034('0x41')]['offset']);}return _0x5e3ea7['getAgents'](_0x44dabc);}})[_0x0034('0x21')](function(_0x4bd55e){if(_0x4bd55e){return _0x4bd55e?{'count':_0xc7bf0a,'rows':_0x4bd55e}:null;}})[_0x0034('0x21')](respondWithResult(_0x29a495,null))[_0x0034('0x29')](handleError(_0x29a495,null));};
\ No newline at end of file
+var _0xc065=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','update','describe','getMembers','findOne','length','pick','ChatQueueId','findAll','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','SIP','getTeams','hasOwnProperty','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','removeTeams','Team','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','emit','userChatQueue:save','removeAgents','isArray','getAgents','zip-dir','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','then','destroy','get','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','show','params'];(function(_0x40b6db,_0xd0d7f3){var _0x5705c7=function(_0x671159){while(--_0x671159){_0x40b6db['push'](_0x40b6db['shift']());}};_0x5705c7(++_0xd0d7f3);}(_0xc065,0x162));var _0x5c06=function(_0x3229da,_0x4a8b90){_0x3229da=_0x3229da-0x0;var _0x394e61=_0xc065[_0x3229da];return _0x394e61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c06('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5c06('0x1'));var BPromise=require(_0x5c06('0x2'));var Mustache=require(_0x5c06('0x3'));var util=require(_0x5c06('0x4'));var path=require(_0x5c06('0x5'));var sox=require('sox');var csv=require(_0x5c06('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5c06('0x7'));var crypto=require('crypto');var jsforce=require(_0x5c06('0x8'));var deskjs=require(_0x5c06('0x9'));var toCsv=require(_0x5c06('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c06('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c06('0xb'));var logger=require(_0x5c06('0xc'))(_0x5c06('0xd'));var utils=require(_0x5c06('0xe'));var config=require(_0x5c06('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c06('0x10'))['db'];config['redis']=_[_0x5c06('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5c06('0x12'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x5c06('0x13')](socket);var jayson=require(_0x5c06('0x14'));var client=jayson[_0x5c06('0x15')][_0x5c06('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x25e179,_0x58bf4e,_0x43e54e,_0x1a0b0b){return new BPromise(function(_0x522a86,_0x2923c6){var _0x3420ff=_0x1a0b0b||client;return _0x3420ff[_0x5c06('0x17')](_0x25e179,_0x43e54e)['then'](function(_0x511044){logger['info'](_0x5c06('0x18'),_0x58bf4e,_0x5c06('0x19'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x58bf4e,_0x5c06('0x19'),JSON[_0x5c06('0x1a')](_0x511044));if(_0x511044['error']){if(_0x511044[_0x5c06('0x1b')]['code']===0x1f4){logger[_0x5c06('0x1b')](_0x5c06('0x18'),_0x58bf4e,_0x511044[_0x5c06('0x1b')]['message']);return _0x2923c6(_0x511044['error']['message']);}logger[_0x5c06('0x1b')]('ChatQueue,\x20%s,\x20%s',_0x58bf4e,_0x511044[_0x5c06('0x1b')][_0x5c06('0x1c')]);return _0x522a86(_0x511044[_0x5c06('0x1b')][_0x5c06('0x1c')]);}else{logger[_0x5c06('0x1d')](_0x5c06('0x18'),_0x58bf4e,_0x5c06('0x19'));_0x522a86(_0x511044['result'][_0x5c06('0x1c')]);}})[_0x5c06('0x1e')](function(_0x36ab9f){logger[_0x5c06('0x1b')](_0x5c06('0x18'),_0x58bf4e,_0x36ab9f);_0x2923c6(_0x36ab9f);});});}function respondWithStatusCode(_0x1215d9,_0x229b24){_0x229b24=_0x229b24||0xcc;return function(_0xf0c90f){if(_0xf0c90f){return _0x1215d9[_0x5c06('0x1f')](_0x229b24);}return _0x1215d9[_0x5c06('0x20')](_0x229b24)[_0x5c06('0x21')]();};}function respondWithResult(_0x3e9381,_0x7fce65){_0x7fce65=_0x7fce65||0xc8;return function(_0x44adeb){if(_0x44adeb){return _0x3e9381['status'](_0x7fce65)['json'](_0x44adeb);}};}function respondWithFilteredResult(_0x53aafb,_0x22f66a){return function(_0x59e0fc){if(_0x59e0fc){var _0x1f4792=typeof _0x22f66a[_0x5c06('0x22')]==='undefined'&&typeof _0x22f66a['limit']===_0x5c06('0x23');var _0x3d065d=_0x59e0fc[_0x5c06('0x24')];var _0x1bffcb=_0x1f4792?0x0:_0x22f66a['offset'];var _0x554de2=_0x1f4792?_0x59e0fc[_0x5c06('0x24')]:_0x22f66a[_0x5c06('0x22')]+_0x22f66a[_0x5c06('0x25')];var _0x3cd001;if(_0x554de2>=_0x3d065d){_0x554de2=_0x3d065d;_0x3cd001=0xc8;}else{_0x3cd001=0xce;}_0x53aafb[_0x5c06('0x20')](_0x3cd001);return _0x53aafb[_0x5c06('0x26')]('Content-Range',_0x1bffcb+'-'+_0x554de2+'/'+_0x3d065d)[_0x5c06('0x27')](_0x59e0fc);}return null;};}function patchUpdates(_0x53730c){return function(_0x4c35e9){try{jsonpatch[_0x5c06('0x28')](_0x4c35e9,_0x53730c,!![]);}catch(_0x404928){return BPromise['reject'](_0x404928);}return _0x4c35e9[_0x5c06('0x29')]();};}function saveUpdates(_0x400ab8,_0x2f90ae){return function(_0x2e0a24){if(_0x2e0a24){return _0x2e0a24['update'](_0x400ab8)[_0x5c06('0x2a')](function(_0x3d9eb1){return _0x3d9eb1;});}return null;};}function removeEntity(_0x465ee6,_0xdc6de4){return function(_0x543bd5){if(_0x543bd5){return _0x543bd5[_0x5c06('0x2b')]()[_0x5c06('0x2a')](function(){var _0x972117=_0x543bd5[_0x5c06('0x2c')]({'plain':!![]});var _0x1ccdca='ChatQueues';return db[_0x5c06('0x2d')][_0x5c06('0x2b')]({'where':{'type':_0x1ccdca,'resourceId':_0x972117['id']}})[_0x5c06('0x2a')](function(){return _0x543bd5;});})['then'](function(){_0x465ee6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b466,_0x3ca6da){return function(_0xe56713){if(!_0xe56713){_0x12b466[_0x5c06('0x1f')](0x194);}return _0xe56713;};}function handleError(_0x25a38b,_0x23a798){_0x23a798=_0x23a798||0x1f4;return function(_0x56208e){logger['error'](_0x56208e[_0x5c06('0x2e')]);if(_0x56208e[_0x5c06('0x2f')]){delete _0x56208e['name'];}_0x25a38b[_0x5c06('0x20')](_0x23a798)['send'](_0x56208e);};}exports[_0x5c06('0x30')]=function(_0x26be53,_0x2f2394){var _0x265f07={},_0x49179f={},_0xcdafd={'count':0x0,'rows':[]};var _0x4dc6e3=_['map'](db[_0x5c06('0x31')][_0x5c06('0x32')],function(_0xcb2990){return{'name':_0xcb2990[_0x5c06('0x33')],'type':_0xcb2990[_0x5c06('0x34')][_0x5c06('0x35')]};});_0x49179f[_0x5c06('0x36')]=_['map'](_0x4dc6e3,_0x5c06('0x2f'));_0x49179f[_0x5c06('0x37')]=_[_0x5c06('0x38')](_0x26be53['query']);_0x49179f[_0x5c06('0x39')]=_[_0x5c06('0x3a')](_0x49179f['model'],_0x49179f[_0x5c06('0x37')]);_0x265f07[_0x5c06('0x3b')]=_[_0x5c06('0x3a')](_0x49179f[_0x5c06('0x36')],qs[_0x5c06('0x3c')](_0x26be53['query'][_0x5c06('0x3c')]));_0x265f07[_0x5c06('0x3b')]=_0x265f07[_0x5c06('0x3b')]['length']?_0x265f07['attributes']:_0x49179f[_0x5c06('0x36')];if(!_0x26be53[_0x5c06('0x37')]['hasOwnProperty'](_0x5c06('0x3d'))){_0x265f07['limit']=qs['limit'](_0x26be53['query'][_0x5c06('0x25')]);_0x265f07[_0x5c06('0x22')]=qs[_0x5c06('0x22')](_0x26be53[_0x5c06('0x37')][_0x5c06('0x22')]);}_0x265f07[_0x5c06('0x3e')]=qs[_0x5c06('0x3f')](_0x26be53[_0x5c06('0x37')][_0x5c06('0x3f')]);_0x265f07[_0x5c06('0x40')]=qs[_0x5c06('0x39')](_['pick'](_0x26be53[_0x5c06('0x37')],_0x49179f[_0x5c06('0x39')]),_0x4dc6e3);if(_0x26be53['query'][_0x5c06('0x41')]){_0x265f07[_0x5c06('0x40')]=_[_0x5c06('0x42')](_0x265f07['where'],{'$or':_[_0x5c06('0x43')](_0x4dc6e3,function(_0x5a56bf){if(_0x5a56bf['type']!==_0x5c06('0x44')){var _0x4a9567={};_0x4a9567[_0x5a56bf[_0x5c06('0x2f')]]={'$like':'%'+_0x26be53['query'][_0x5c06('0x41')]+'%'};return _0x4a9567;}})});}_0x265f07=_[_0x5c06('0x42')]({},_0x265f07,_0x26be53[_0x5c06('0x45')]);var _0x5ba31e={'where':_0x265f07['where']};return db[_0x5c06('0x31')][_0x5c06('0x24')](_0x5ba31e)['then'](function(_0x4425c2){_0xcdafd[_0x5c06('0x24')]=_0x4425c2;if(_0x26be53[_0x5c06('0x37')][_0x5c06('0x46')]){_0x265f07[_0x5c06('0x47')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x265f07);})[_0x5c06('0x2a')](function(_0x205421){_0xcdafd[_0x5c06('0x48')]=_0x205421;return _0xcdafd;})[_0x5c06('0x2a')](respondWithFilteredResult(_0x2f2394,_0x265f07))[_0x5c06('0x1e')](handleError(_0x2f2394,null));};exports[_0x5c06('0x49')]=function(_0x13a5ae,_0x1c1152){var _0x963fa7={'raw':!![],'where':{'id':_0x13a5ae[_0x5c06('0x4a')]['id']}},_0x444b34={};_0x444b34[_0x5c06('0x36')]=_[_0x5c06('0x38')](db['ChatQueue']['rawAttributes']);_0x444b34[_0x5c06('0x37')]=_[_0x5c06('0x38')](_0x13a5ae['query']);_0x444b34[_0x5c06('0x39')]=_['intersection'](_0x444b34['model'],_0x444b34[_0x5c06('0x37')]);_0x963fa7[_0x5c06('0x3b')]=_['intersection'](_0x444b34[_0x5c06('0x36')],qs['fields'](_0x13a5ae[_0x5c06('0x37')]['fields']));_0x963fa7[_0x5c06('0x3b')]=_0x963fa7[_0x5c06('0x3b')]['length']?_0x963fa7[_0x5c06('0x3b')]:_0x444b34[_0x5c06('0x36')];if(_0x13a5ae[_0x5c06('0x37')][_0x5c06('0x46')]){_0x963fa7['include']=[{'all':!![]}];}_0x963fa7=_[_0x5c06('0x42')]({},_0x963fa7,_0x13a5ae['options']);return db[_0x5c06('0x31')][_0x5c06('0x4b')](_0x963fa7)['then'](handleEntityNotFound(_0x1c1152,null))[_0x5c06('0x2a')](respondWithResult(_0x1c1152,null))[_0x5c06('0x1e')](handleError(_0x1c1152,null));};exports[_0x5c06('0x4c')]=function(_0x4965e6,_0x1e22fa){return db[_0x5c06('0x31')][_0x5c06('0x4c')](_0x4965e6[_0x5c06('0x4d')],{})[_0x5c06('0x2a')](function(_0x156a1a){var _0x2a563f=_0x4965e6[_0x5c06('0x4e')][_0x5c06('0x2c')]({'plain':!![]});if(!_0x2a563f)throw new Error(_0x5c06('0x4f'));if(_0x2a563f[_0x5c06('0x50')]===_0x5c06('0x4e')){var _0x49084a=_0x156a1a['get']({'plain':!![]});var _0xc8d245=_0x5c06('0x51');return db[_0x5c06('0x52')][_0x5c06('0x4b')]({'where':{'name':_0xc8d245,'userProfileId':_0x2a563f[_0x5c06('0x53')]},'raw':!![]})['then'](function(_0x2227b2){if(_0x2227b2&&_0x2227b2['autoAssociation']===0x0){return db[_0x5c06('0x2d')][_0x5c06('0x4c')]({'name':_0x49084a[_0x5c06('0x2f')],'resourceId':_0x49084a['id'],'type':_0x2227b2[_0x5c06('0x2f')],'sectionId':_0x2227b2['id']},{})[_0x5c06('0x2a')](function(){return _0x156a1a;});}else{return _0x156a1a;}})[_0x5c06('0x1e')](function(_0x4abecd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4abecd);throw _0x4abecd;});}return _0x156a1a;})[_0x5c06('0x2a')](respondWithResult(_0x1e22fa,0xc9))[_0x5c06('0x1e')](handleError(_0x1e22fa,null));};exports[_0x5c06('0x54')]=function(_0x48e091,_0x4fcb26){if(_0x48e091[_0x5c06('0x4d')]['id']){delete _0x48e091[_0x5c06('0x4d')]['id'];}return db[_0x5c06('0x31')][_0x5c06('0x4b')]({'where':{'id':_0x48e091[_0x5c06('0x4a')]['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x4fcb26,null))[_0x5c06('0x2a')](saveUpdates(_0x48e091[_0x5c06('0x4d')],null))[_0x5c06('0x2a')](respondWithResult(_0x4fcb26,null))['catch'](handleError(_0x4fcb26,null));};exports[_0x5c06('0x2b')]=function(_0x3ea524,_0x11358b){return db[_0x5c06('0x31')]['find']({'where':{'id':_0x3ea524[_0x5c06('0x4a')]['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x11358b,null))[_0x5c06('0x2a')](removeEntity(_0x11358b,null))['catch'](handleError(_0x11358b,null));};exports['describe']=function(_0x3f99fb,_0x3ab181){return db['ChatQueue'][_0x5c06('0x55')]()[_0x5c06('0x2a')](respondWithResult(_0x3ab181,null))[_0x5c06('0x1e')](handleError(_0x3ab181,null));};exports[_0x5c06('0x56')]=function(_0x39f207,_0x3d262d,_0x37adcd){var _0x138abe={'raw':!![],'where':{}},_0x185960={},_0x45b1a0;return db[_0x5c06('0x31')][_0x5c06('0x57')]({'where':{'id':_0x39f207[_0x5c06('0x4a')]['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x3d262d,null))[_0x5c06('0x2a')](function(_0x4affa7){if(_0x4affa7){_0x45b1a0=_0x4affa7['get']({'plain':!![]});_0x185960['model']=_[_0x5c06('0x38')](db['UserChatQueue']['rawAttributes']);_0x185960['query']=_[_0x5c06('0x38')](_0x39f207['query']);_0x185960[_0x5c06('0x39')]=_[_0x5c06('0x3a')](_0x185960[_0x5c06('0x36')],_0x185960[_0x5c06('0x37')]);_0x138abe['attributes']=_[_0x5c06('0x3a')](_0x185960[_0x5c06('0x36')],qs[_0x5c06('0x3c')](_0x39f207[_0x5c06('0x37')][_0x5c06('0x3c')]));_0x138abe[_0x5c06('0x3b')]=_0x138abe[_0x5c06('0x3b')][_0x5c06('0x58')]?_0x138abe[_0x5c06('0x3b')]:_0x185960[_0x5c06('0x36')];if(!_0x39f207[_0x5c06('0x37')]['hasOwnProperty'](_0x5c06('0x3d'))){_0x138abe[_0x5c06('0x25')]=qs[_0x5c06('0x25')](_0x39f207[_0x5c06('0x37')]['limit']);_0x138abe[_0x5c06('0x22')]=qs['offset'](_0x39f207['query']['offset']);}_0x138abe[_0x5c06('0x3e')]=qs['sort'](_0x39f207[_0x5c06('0x37')][_0x5c06('0x3f')]);_0x138abe[_0x5c06('0x40')]=qs[_0x5c06('0x39')](_[_0x5c06('0x59')](_0x39f207[_0x5c06('0x37')],_0x185960[_0x5c06('0x39')]));_0x138abe[_0x5c06('0x40')][_0x5c06('0x5a')]=_0x4affa7['id'];if(_0x39f207[_0x5c06('0x37')]['filter']){_0x138abe[_0x5c06('0x40')]=_[_0x5c06('0x42')](_0x138abe[_0x5c06('0x40')],{'$or':_[_0x5c06('0x43')](_0x138abe['attributes'],function(_0x30ea6e){var _0xeab711={};_0xeab711[_0x30ea6e]={'$like':'%'+_0x39f207['query'][_0x5c06('0x41')]+'%'};return _0xeab711;})});}_0x138abe=_[_0x5c06('0x42')]({},_0x138abe,_0x39f207[_0x5c06('0x45')]);return db['UserChatQueue'][_0x5c06('0x5b')](_0x138abe);}})[_0x5c06('0x2a')](function(_0x31cefa){if(_0x31cefa){return db[_0x5c06('0x5c')][_0x5c06('0x5d')]({'where':{'id':_[_0x5c06('0x43')](_0x31cefa,_0x5c06('0x5e')),'role':'agent'},'attributes':['id',_0x5c06('0x2f'),_0x5c06('0x5f'),_0x5c06('0x60'),_0x5c06('0x61')]});}})[_0x5c06('0x2a')](function(_0x24b5f2){if(_0x24b5f2){return{'count':_0x24b5f2[_0x5c06('0x24')],'rows':_['map'](_0x24b5f2[_0x5c06('0x48')],function(_0x446ee3){return{'membername':_0x446ee3[_0x5c06('0x2f')],'UserId':_0x446ee3['id'],'queue_name':_0x45b1a0[_0x5c06('0x2f')],'ChatQueueId':_0x45b1a0['id'],'interface':util[_0x5c06('0x62')]('%s/%s',_0x5c06('0x63'),_0x446ee3['name']),'penalty':0x0,'paused':_0x446ee3[_0x5c06('0x5f')],'createdAt':_0x446ee3[_0x5c06('0x61')],'updatedAt':_0x446ee3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3d262d,_0x138abe))[_0x5c06('0x1e')](handleError(_0x3d262d,null));};exports[_0x5c06('0x64')]=function(_0x4333a6,_0x21abdb,_0x361140){var _0x2bf8e0={};var _0xf4a714={};var _0x4f6233;var _0x53d46c;return db[_0x5c06('0x31')][_0x5c06('0x57')]({'where':{'id':_0x4333a6[_0x5c06('0x4a')]['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x21abdb,null))['then'](function(_0xa8ca87){if(_0xa8ca87){_0x4f6233=_0xa8ca87;_0xf4a714[_0x5c06('0x36')]=_[_0x5c06('0x38')](db['Team'][_0x5c06('0x32')]);_0xf4a714[_0x5c06('0x37')]=_[_0x5c06('0x38')](_0x4333a6[_0x5c06('0x37')]);_0xf4a714['filters']=_[_0x5c06('0x3a')](_0xf4a714['model'],_0xf4a714[_0x5c06('0x37')]);_0x2bf8e0['attributes']=_['intersection'](_0xf4a714[_0x5c06('0x36')],qs[_0x5c06('0x3c')](_0x4333a6[_0x5c06('0x37')]['fields']));_0x2bf8e0[_0x5c06('0x3b')]=_0x2bf8e0[_0x5c06('0x3b')][_0x5c06('0x58')]?_0x2bf8e0[_0x5c06('0x3b')]:_0xf4a714[_0x5c06('0x36')];_0x2bf8e0[_0x5c06('0x3e')]=qs[_0x5c06('0x3f')](_0x4333a6[_0x5c06('0x37')][_0x5c06('0x3f')]);_0x2bf8e0[_0x5c06('0x40')]=qs[_0x5c06('0x39')](_[_0x5c06('0x59')](_0x4333a6[_0x5c06('0x37')],_0xf4a714['filters']));if(_0x4333a6[_0x5c06('0x37')][_0x5c06('0x41')]){_0x2bf8e0[_0x5c06('0x40')]=_['merge'](_0x2bf8e0[_0x5c06('0x40')],{'$or':_[_0x5c06('0x43')](_0x2bf8e0['attributes'],function(_0x3ede9a){var _0x4ff9a3={};_0x4ff9a3[_0x3ede9a]={'$like':'%'+_0x4333a6[_0x5c06('0x37')][_0x5c06('0x41')]+'%'};return _0x4ff9a3;})});}_0x2bf8e0=_[_0x5c06('0x42')]({},_0x2bf8e0,_0x4333a6[_0x5c06('0x45')]);return _0x4f6233['getTeams'](_0x2bf8e0);}})[_0x5c06('0x2a')](function(_0x52d555){if(_0x52d555){_0x53d46c=_0x52d555[_0x5c06('0x58')];if(!_0x4333a6[_0x5c06('0x37')][_0x5c06('0x65')](_0x5c06('0x3d'))){_0x2bf8e0[_0x5c06('0x25')]=qs[_0x5c06('0x25')](_0x4333a6[_0x5c06('0x37')][_0x5c06('0x25')]);_0x2bf8e0[_0x5c06('0x22')]=qs[_0x5c06('0x22')](_0x4333a6['query'][_0x5c06('0x22')]);}return _0x4f6233['getTeams'](_0x2bf8e0);}})[_0x5c06('0x2a')](function(_0x17a58e){if(_0x17a58e){return _0x17a58e?{'count':_0x53d46c,'rows':_0x17a58e}:null;}})['then'](respondWithResult(_0x21abdb,null))[_0x5c06('0x1e')](handleError(_0x21abdb,null));};exports[_0x5c06('0x66')]=function(_0x306105,_0x552123,_0x4633e5){var _0x14d300=_0x306105[_0x5c06('0x4d')][_0x5c06('0x67')];return db['Team'][_0x5c06('0x5b')]({'where':{'id':_0x14d300},'attributes':['id'],'include':[{'model':db[_0x5c06('0x5c')],'as':'Agents','attributes':['id',_0x5c06('0x2f'),_0x5c06('0x68'),_0x5c06('0x69'),_0x5c06('0x6a')],'raw':!![]}]})['then'](function(_0x268692){if(_0x268692){var _0x32a368=_[_0x5c06('0x6b')](_0x268692,function(_0x389fab){var _0x3dcd7f=_0x389fab['get']({'plain':!![]});return _0x3dcd7f[_0x5c06('0x6c')];});return db[_0x5c06('0x31')][_0x5c06('0x4b')]({'where':{'id':_0x306105[_0x5c06('0x4a')]['id']}})['then'](function(_0x3eed73){return db[_0x5c06('0x6d')][_0x5c06('0x6e')](function(_0x42c67c){return _0x3eed73[_0x5c06('0x66')](_0x14d300,{'transaction':_0x42c67c})['then'](function(){return BPromise[_0x5c06('0x6f')](_0x32a368,function(_0x514d0d){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x514d0d['id'],'ChatQueueId':_0x306105[_0x5c06('0x4a')]['id']},'transaction':_0x42c67c});});})[_0x5c06('0x2a')](function(){_0x32a368['forEach'](function(_0x5c6af5){socket['emit']('userChatQueue:save',{'UserId':_0x5c6af5['id'],'ChatQueueId':_0x3eed73['id']});});});});});}})['then'](respondWithStatusCode(_0x552123,null))[_0x5c06('0x1e')](handleError(_0x552123,null));};exports[_0x5c06('0x70')]=function(_0x583c58,_0x33834e,_0x2fdde7){return db[_0x5c06('0x71')][_0x5c06('0x5b')]({'where':{'id':_0x583c58[_0x5c06('0x37')][_0x5c06('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x33834e,null))[_0x5c06('0x2a')](function(_0x598b16){var _0x2ec48c=_[_0x5c06('0x43')](_0x598b16,'id');var _0x37e87e=[];var _0x495a57=[];var _0x1e7dd5=squel[_0x5c06('0x72')]();_0x1e7dd5[_0x5c06('0x73')](_0x5c06('0x74'))[_0x5c06('0x75')](_0x5c06('0x76'),'tq')[_0x5c06('0x77')]('user_has_teams','ut',_0x5c06('0x78'))['where'](_0x5c06('0x79'),_0x583c58[_0x5c06('0x4a')]['id']);for(var _0x2876ee=0x0;_0x2876ee<_0x598b16['length'];_0x2876ee+=0x1){let _0x34c748=_0x598b16[_0x2876ee];for(var _0x597029=0x0;_0x597029<_0x34c748['Agents'][_0x5c06('0x58')];_0x597029+=0x1){let _0x4dc088=_0x34c748['Agents'][_0x597029];var _0x3d5769=_0x1e7dd5[_0x5c06('0x7a')]();_0x3d5769['where'](_0x5c06('0x7b'),_0x4dc088['id']);_0x495a57[_0x5c06('0x7c')](db[_0x5c06('0x6d')][_0x5c06('0x37')](_0x3d5769[_0x5c06('0x7d')](),{'type':db[_0x5c06('0x6d')][_0x5c06('0x7e')][_0x5c06('0x7f')]})['then'](function(_0x2766c6){if(_0x2766c6['length']===0x1){return _0x4dc088['id'];}else{var _0x294a3c=_[_0x5c06('0x80')](_[_0x5c06('0x43')](_0x2766c6,_0x5c06('0x81')),function(_0x4f927d){return _[_0x5c06('0x82')](_0x2ec48c,_0x4f927d);});if(_0x294a3c){return _0x4dc088['id'];}}}));}}return BPromise['all'](_0x495a57)[_0x5c06('0x2a')](function(_0x121c54){_0x37e87e=_(_0x37e87e)['union'](_0x121c54)['compact']()[_0x5c06('0x83')]();return db[_0x5c06('0x31')]['find']({'where':{'id':_0x583c58['params']['id']}})['then'](function(_0x437f5b){return db[_0x5c06('0x6d')]['transaction'](function(_0x202738){return _0x437f5b[_0x5c06('0x70')](_0x583c58[_0x5c06('0x37')][_0x5c06('0x67')],{'transaction':_0x202738})['then'](function(){if(!_[_0x5c06('0x84')](_0x37e87e)){return _0x437f5b['removeAgents'](_0x37e87e,{'transaction':_0x202738});}})[_0x5c06('0x2a')](function(){_0x37e87e[_0x5c06('0x85')](function(_0x231056){socket['emit'](_0x5c06('0x86'),{'UserId':_0x231056,'ChatQueueId':_0x437f5b['id']});});});});});});})[_0x5c06('0x2a')](respondWithStatusCode(_0x33834e,null))['catch'](handleError(_0x33834e,null));};exports[_0x5c06('0x87')]=function(_0x2dcb23,_0x1bb495,_0x5e115c){return db[_0x5c06('0x31')][_0x5c06('0x4b')]({'where':{'id':_0x2dcb23[_0x5c06('0x4a')]['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x1bb495,null))[_0x5c06('0x2a')](function(_0x327ce8){if(_0x327ce8){return _0x327ce8['addAgents'](_0x2dcb23['body'][_0x5c06('0x67')],_[_0x5c06('0x88')](_0x2dcb23['body'],[_0x5c06('0x67'),'id'])||{})[_0x5c06('0x89')](function(_0x244526){for(var _0x27c38e=0x0;_0x27c38e<_0x2dcb23[_0x5c06('0x4d')][_0x5c06('0x67')]['length'];_0x27c38e+=0x1){socket[_0x5c06('0x8a')](_0x5c06('0x8b'),{'UserId':Number(_0x2dcb23[_0x5c06('0x4d')][_0x5c06('0x67')][_0x27c38e]),'ChatQueueId':Number(_0x2dcb23['params']['id'])});}return _0x244526;});}})['then'](respondWithResult(_0x1bb495,null))[_0x5c06('0x1e')](handleError(_0x1bb495,null));};exports[_0x5c06('0x8c')]=function(_0x4366d9,_0x49b224,_0x2ab16d){return db[_0x5c06('0x31')]['find']({'where':{'id':_0x4366d9['params']['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x49b224,null))[_0x5c06('0x2a')](function(_0x13c533){if(_0x13c533){return _0x13c533[_0x5c06('0x8c')](_0x4366d9[_0x5c06('0x37')][_0x5c06('0x67')])[_0x5c06('0x2a')](function(){if(_[_0x5c06('0x8d')](_0x4366d9[_0x5c06('0x37')]['ids'])){for(var _0x23c6e4=0x0;_0x23c6e4<_0x4366d9[_0x5c06('0x37')][_0x5c06('0x67')][_0x5c06('0x58')];_0x23c6e4+=0x1){socket[_0x5c06('0x8a')](_0x5c06('0x86'),{'UserId':Number(_0x4366d9[_0x5c06('0x37')]['ids'][_0x23c6e4]),'ChatQueueId':Number(_0x4366d9[_0x5c06('0x4a')]['id'])});}}else{socket[_0x5c06('0x8a')](_0x5c06('0x86'),{'UserId':Number(_0x4366d9['query'][_0x5c06('0x67')]),'ChatQueueId':Number(_0x4366d9['params']['id'])});}});}})[_0x5c06('0x2a')](respondWithStatusCode(_0x49b224,null))[_0x5c06('0x1e')](handleError(_0x49b224,null));};exports[_0x5c06('0x8e')]=function(_0x1fdae8,_0x8651f6,_0x280cde){var _0x5090b8={};var _0x26d1da={};var _0x11da5c;var _0x4cf604;return db[_0x5c06('0x31')][_0x5c06('0x57')]({'where':{'id':_0x1fdae8['params']['id']}})[_0x5c06('0x2a')](handleEntityNotFound(_0x8651f6,null))['then'](function(_0x34ab32){if(_0x34ab32){_0x11da5c=_0x34ab32;_0x26d1da[_0x5c06('0x36')]=_[_0x5c06('0x38')](db['User'][_0x5c06('0x32')]);_0x26d1da[_0x5c06('0x37')]=_[_0x5c06('0x38')](_0x1fdae8[_0x5c06('0x37')]);_0x26d1da[_0x5c06('0x39')]=_[_0x5c06('0x3a')](_0x26d1da[_0x5c06('0x36')],_0x26d1da['query']);_0x5090b8['attributes']=_[_0x5c06('0x3a')](_0x26d1da[_0x5c06('0x36')],qs[_0x5c06('0x3c')](_0x1fdae8[_0x5c06('0x37')][_0x5c06('0x3c')]));_0x5090b8[_0x5c06('0x3b')]=_0x5090b8[_0x5c06('0x3b')][_0x5c06('0x58')]?_0x5090b8[_0x5c06('0x3b')]:_0x26d1da['model'];_0x5090b8[_0x5c06('0x3e')]=qs[_0x5c06('0x3f')](_0x1fdae8[_0x5c06('0x37')][_0x5c06('0x3f')]);_0x5090b8[_0x5c06('0x40')]=qs[_0x5c06('0x39')](_[_0x5c06('0x59')](_0x1fdae8[_0x5c06('0x37')],_0x26d1da[_0x5c06('0x39')]));if(_0x1fdae8[_0x5c06('0x37')][_0x5c06('0x41')]){_0x5090b8['where']=_[_0x5c06('0x42')](_0x5090b8[_0x5c06('0x40')],{'$or':_['map'](_0x5090b8[_0x5c06('0x3b')],function(_0x46d521){var _0x1136c2={};_0x1136c2[_0x46d521]={'$like':'%'+_0x1fdae8[_0x5c06('0x37')]['filter']+'%'};return _0x1136c2;})});}_0x5090b8=_[_0x5c06('0x42')]({},_0x5090b8,_0x1fdae8[_0x5c06('0x45')]);return _0x11da5c['getAgents'](_0x5090b8);}})[_0x5c06('0x2a')](function(_0x1bf1a4){if(_0x1bf1a4){_0x4cf604=_0x1bf1a4[_0x5c06('0x58')];if(!_0x1fdae8[_0x5c06('0x37')]['hasOwnProperty'](_0x5c06('0x3d'))){_0x5090b8[_0x5c06('0x25')]=qs[_0x5c06('0x25')](_0x1fdae8[_0x5c06('0x37')]['limit']);_0x5090b8['offset']=qs[_0x5c06('0x22')](_0x1fdae8[_0x5c06('0x37')][_0x5c06('0x22')]);}return _0x11da5c[_0x5c06('0x8e')](_0x5090b8);}})[_0x5c06('0x2a')](function(_0x1d872f){if(_0x1d872f){return _0x1d872f?{'count':_0x4cf604,'rows':_0x1d872f}:null;}})[_0x5c06('0x2a')](respondWithResult(_0x8651f6,null))[_0x5c06('0x1e')](handleError(_0x8651f6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 180c849..aa2b8d2 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9275=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','update','remove'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9275,0x154));var _0x5927=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x9275[_0x4aba15];return _0x1c8122;};'use strict';var EventEmitter=require(_0x5927('0x0'));var ChatQueue=require(_0x5927('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5927('0x2'),'afterDestroy':_0x5927('0x3')};function emitEvent(_0xf1b137){return function(_0x1c1900,_0x155969,_0x35a21c){ChatQueueEvents['emit'](_0xf1b137+':'+_0x1c1900['id'],_0x1c1900);ChatQueueEvents[_0x5927('0x4')](_0xf1b137,_0x1c1900);_0x35a21c(null);};}for(var e in events){if(events[_0x5927('0x5')](e)){var event=events[e];ChatQueue[_0x5927('0x6')](e,emitEvent(event));}}module[_0x5927('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe444=['exports','events','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4a4606,_0x47e0a1){var _0x45ef09=function(_0x497c78){while(--_0x497c78){_0x4a4606['push'](_0x4a4606['shift']());}};_0x45ef09(++_0x47e0a1);}(_0xe444,0x196));var _0x4e44=function(_0x1b4d7f,_0x1c0847){_0x1b4d7f=_0x1b4d7f-0x0;var _0x58e7be=_0xe444[_0x1b4d7f];return _0x58e7be;};'use strict';var EventEmitter=require(_0x4e44('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4e44('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4e44('0x2')](0x0);var events={'afterCreate':_0x4e44('0x3'),'afterUpdate':'update','afterDestroy':_0x4e44('0x4')};function emitEvent(_0x5d0e3d){return function(_0x4b770a,_0xdcbdec,_0x5569bd){ChatQueueEvents[_0x4e44('0x5')](_0x5d0e3d+':'+_0x4b770a['id'],_0x4b770a);ChatQueueEvents[_0x4e44('0x5')](_0x5d0e3d,_0x4b770a);_0x5569bd(null);};}for(var e in events){if(events[_0x4e44('0x6')](e)){var event=events[e];ChatQueue[_0x4e44('0x7')](e,emitEvent(event));}}module[_0x4e44('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 12d94ea..e4ecf67 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78c2=['moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger'];(function(_0x54edd3,_0x561dc7){var _0x550b19=function(_0x5a4382){while(--_0x5a4382){_0x54edd3['push'](_0x54edd3['shift']());}};_0x550b19(++_0x561dc7);}(_0x78c2,0x1b6));var _0x278c=function(_0x26d3db,_0x216e3b){_0x26d3db=_0x26d3db-0x0;var _0x36ee83=_0x78c2[_0x26d3db];return _0x36ee83;};'use strict';var _=require('lodash');var util=require(_0x278c('0x0'));var logger=require(_0x278c('0x1'))('api');var moment=require(_0x278c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x278c('0x3'));var rimraf=require(_0x278c('0x4'));var config=require(_0x278c('0x5'));var attributes=require(_0x278c('0x6'));module[_0x278c('0x7')]=function(_0x10daad,_0x2b9fd9){return _0x10daad['define'](_0x278c('0x8'),attributes,{'tableName':_0x278c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0cbd=['./chatQueue.attributes','ChatQueue','chat_queues','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xf4e9a0,_0x34f1db){var _0x520e40=function(_0x203c12){while(--_0x203c12){_0xf4e9a0['push'](_0xf4e9a0['shift']());}};_0x520e40(++_0x34f1db);}(_0x0cbd,0x1a5));var _0xd0cb=function(_0x22636f,_0x5daa9c){_0x22636f=_0x22636f-0x0;var _0x47b162=_0x0cbd[_0x22636f];return _0x47b162;};'use strict';var _=require(_0xd0cb('0x0'));var util=require(_0xd0cb('0x1'));var logger=require('../../config/logger')(_0xd0cb('0x2'));var moment=require(_0xd0cb('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0cb('0x4'));var fs=require('fs');var path=require(_0xd0cb('0x5'));var rimraf=require(_0xd0cb('0x6'));var config=require(_0xd0cb('0x7'));var attributes=require(_0xd0cb('0x8'));module['exports']=function(_0x39b5c3,_0x18bff4){return _0x39b5c3['define'](_0xd0cb('0x9'),attributes,{'tableName':_0xd0cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 5ac47aa..2c0b85a 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca73=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','catch','ChatQueue','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2f901a,_0x3089d8){var _0x188ba5=function(_0x312d84){while(--_0x312d84){_0x2f901a['push'](_0x2f901a['shift']());}};_0x188ba5(++_0x3089d8);}(_0xca73,0x1ee));var _0x3ca7=function(_0x582df0,_0x82017b){_0x582df0=_0x582df0-0x0;var _0x410fb7=_0xca73[_0x582df0];return _0x410fb7;};'use strict';var _=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var moment=require('moment');var BPromise=require(_0x3ca7('0x2'));var rs=require(_0x3ca7('0x3'));var fs=require('fs');var Redis=require(_0x3ca7('0x4'));var db=require(_0x3ca7('0x5'))['db'];var utils=require(_0x3ca7('0x6'));var logger=require(_0x3ca7('0x7'))(_0x3ca7('0x8'));var config=require(_0x3ca7('0x9'));var jayson=require(_0x3ca7('0xa'));var client=jayson[_0x3ca7('0xb')]['http']({'port':0x232a});config[_0x3ca7('0xc')]=_[_0x3ca7('0xd')](config[_0x3ca7('0xc')],{'host':_0x3ca7('0xe'),'port':0x18eb});var socket=require(_0x3ca7('0xf'))(new Redis(config[_0x3ca7('0xc')]));require('./chatQueue.socket')[_0x3ca7('0x10')](socket);function respondWithRpcPromise(_0xf5217a,_0x484546,_0x5acbe2){return new BPromise(function(_0x33f89c,_0x1fbfe7){return client[_0x3ca7('0x11')](_0xf5217a,_0x5acbe2)[_0x3ca7('0x12')](function(_0x186739){logger[_0x3ca7('0x13')](_0x3ca7('0x14'),_0x484546,_0x3ca7('0x15'));logger[_0x3ca7('0x16')](_0x3ca7('0x17'),_0x484546,_0x3ca7('0x15'),JSON[_0x3ca7('0x18')](_0x186739));if(_0x186739[_0x3ca7('0x19')]){if(_0x186739['error'][_0x3ca7('0x1a')]===0x1f4){logger[_0x3ca7('0x19')]('ChatQueue,\x20%s,\x20%s',_0x484546,_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);return _0x1fbfe7(_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);}logger['error'](_0x3ca7('0x14'),_0x484546,_0x186739['error'][_0x3ca7('0x1b')]);return _0x33f89c(_0x186739[_0x3ca7('0x19')][_0x3ca7('0x1b')]);}else{logger['info'](_0x3ca7('0x14'),_0x484546,'request\x20sent');_0x33f89c(_0x186739['result'][_0x3ca7('0x1b')]);}})['catch'](function(_0x40d7f0){logger['error']('ChatQueue,\x20%s,\x20%s',_0x484546,_0x40d7f0);_0x1fbfe7(_0x40d7f0);});});}exports[_0x3ca7('0x1c')]=function(_0x181849){var _0x2d2882=this;return new Promise(function(_0x49f0ad,_0x2f28cb){return db['ChatQueue'][_0x3ca7('0x1d')]({'raw':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x1f')]===undefined?!![]:![]:!![],'where':_0x181849['options']?_0x181849['options'][_0x3ca7('0x20')]||null:null,'attributes':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')]['attributes']||null:null,'limit':_0x181849[_0x3ca7('0x1e')]?_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x21')]||null:null,'include':_0x181849[_0x3ca7('0x1e')]?_0x181849['options']['include']?_[_0x3ca7('0x22')](_0x181849[_0x3ca7('0x1e')][_0x3ca7('0x23')],function(_0x2fbd3a){return{'model':db[_0x2fbd3a[_0x3ca7('0x24')]],'as':_0x2fbd3a['as'],'attributes':_0x2fbd3a[_0x3ca7('0x25')],'include':_0x2fbd3a[_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x2fbd3a[_0x3ca7('0x23')],function(_0x236e7d){return{'model':db[_0x236e7d[_0x3ca7('0x24')]],'as':_0x236e7d['as'],'attributes':_0x236e7d[_0x3ca7('0x25')],'include':_0x236e7d[_0x3ca7('0x23')]?_['map'](_0x236e7d[_0x3ca7('0x23')],function(_0x308541){return{'model':db[_0x308541[_0x3ca7('0x24')]],'as':_0x308541['as'],'attributes':_0x308541[_0x3ca7('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30aa21){logger['info']('GetChatQueue',_0x181849);logger[_0x3ca7('0x16')]('GetChatQueue',_0x181849,JSON[_0x3ca7('0x18')](_0x30aa21));_0x49f0ad(_0x30aa21);})[_0x3ca7('0x26')](function(_0x1a579d){logger['error']('GetChatQueue',_0x1a579d[_0x3ca7('0x1b')],_0x181849);_0x2f28cb(_0x2d2882['error'](0x1f4,_0x1a579d[_0x3ca7('0x1b')]));});});};exports['ShowChatQueue']=function(_0x597bd3){var _0x3bd2de=this;return new Promise(function(_0x402489,_0x5e2816){return db[_0x3ca7('0x27')][_0x3ca7('0x28')]({'raw':_0x597bd3['options']?_0x597bd3[_0x3ca7('0x1e')][_0x3ca7('0x1f')]===undefined?!![]:![]:!![],'where':_0x597bd3[_0x3ca7('0x1e')]?_0x597bd3[_0x3ca7('0x1e')][_0x3ca7('0x20')]||null:null,'attributes':_0x597bd3['options']?_0x597bd3[_0x3ca7('0x1e')]['attributes']||null:null,'include':_0x597bd3[_0x3ca7('0x1e')]?_0x597bd3['options'][_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x597bd3[_0x3ca7('0x1e')]['include'],function(_0x4a597c){return{'model':db[_0x4a597c['model']],'as':_0x4a597c['as'],'attributes':_0x4a597c[_0x3ca7('0x25')],'include':_0x4a597c[_0x3ca7('0x23')]?_['map'](_0x4a597c[_0x3ca7('0x23')],function(_0x5a1c27){return{'model':db[_0x5a1c27[_0x3ca7('0x24')]],'as':_0x5a1c27['as'],'attributes':_0x5a1c27[_0x3ca7('0x25')],'include':_0x5a1c27[_0x3ca7('0x23')]?_[_0x3ca7('0x22')](_0x5a1c27[_0x3ca7('0x23')],function(_0xd4cb0a){return{'model':db[_0xd4cb0a['model']],'as':_0xd4cb0a['as'],'attributes':_0xd4cb0a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d948a){logger['info'](_0x3ca7('0x29'),_0x597bd3);logger[_0x3ca7('0x16')](_0x3ca7('0x29'),_0x597bd3,JSON[_0x3ca7('0x18')](_0x3d948a));_0x402489(_0x3d948a);})['catch'](function(_0x12c47a){logger[_0x3ca7('0x19')](_0x3ca7('0x29'),_0x12c47a[_0x3ca7('0x1b')],_0x597bd3);_0x5e2816(_0x3bd2de['error'](0x1f4,_0x12c47a[_0x3ca7('0x1b')]));});});};
\ No newline at end of file
+var _0x5c96=['ChatQueue','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','options','raw','where','attributes','include','map','ShowChatQueue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5c96,0x133));var _0x65c9=function(_0x248cbb,_0x20f938){_0x248cbb=_0x248cbb-0x0;var _0x208a55=_0x5c96[_0x248cbb];return _0x208a55;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var moment=require(_0x65c9('0x2'));var BPromise=require(_0x65c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65c9('0x4'));var db=require(_0x65c9('0x5'))['db'];var utils=require(_0x65c9('0x6'));var logger=require(_0x65c9('0x7'))(_0x65c9('0x8'));var config=require(_0x65c9('0x9'));var jayson=require(_0x65c9('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x65c9('0xb')],{'host':_0x65c9('0xc'),'port':0x18eb});var socket=require(_0x65c9('0xd'))(new Redis(config['redis']));require(_0x65c9('0xe'))[_0x65c9('0xf')](socket);function respondWithRpcPromise(_0x9498d6,_0x2ed1d6,_0x4106e9){return new BPromise(function(_0x34b7c6,_0x292827){return client['request'](_0x9498d6,_0x4106e9)['then'](function(_0x5a29dd){logger[_0x65c9('0x10')](_0x65c9('0x11'),_0x2ed1d6,_0x65c9('0x12'));logger[_0x65c9('0x13')](_0x65c9('0x14'),_0x2ed1d6,'request\x20sent',JSON[_0x65c9('0x15')](_0x5a29dd));if(_0x5a29dd[_0x65c9('0x16')]){if(_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x17')]===0x1f4){logger['error'](_0x65c9('0x11'),_0x2ed1d6,_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);return _0x292827(_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);}logger[_0x65c9('0x16')](_0x65c9('0x11'),_0x2ed1d6,_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);return _0x34b7c6(_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);}else{logger[_0x65c9('0x10')]('ChatQueue,\x20%s,\x20%s',_0x2ed1d6,'request\x20sent');_0x34b7c6(_0x5a29dd[_0x65c9('0x19')][_0x65c9('0x18')]);}})[_0x65c9('0x1a')](function(_0x1caf2a){logger[_0x65c9('0x16')](_0x65c9('0x11'),_0x2ed1d6,_0x1caf2a);_0x292827(_0x1caf2a);});});}exports[_0x65c9('0x1b')]=function(_0x483c1d){var _0x42f7f2=this;return new Promise(function(_0x4fccab,_0x5b275d){return db['ChatQueue']['findAll']({'raw':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x1e')]||null:null,'attributes':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x1f')]||null:null,'limit':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')]['limit']||null:null,'include':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x20')]?_[_0x65c9('0x21')](_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x20')],function(_0x580445){return{'model':db[_0x580445['model']],'as':_0x580445['as'],'attributes':_0x580445[_0x65c9('0x1f')],'include':_0x580445[_0x65c9('0x20')]?_['map'](_0x580445[_0x65c9('0x20')],function(_0x368e13){return{'model':db[_0x368e13['model']],'as':_0x368e13['as'],'attributes':_0x368e13[_0x65c9('0x1f')],'include':_0x368e13[_0x65c9('0x20')]?_['map'](_0x368e13['include'],function(_0x1b2d58){return{'model':db[_0x1b2d58['model']],'as':_0x1b2d58['as'],'attributes':_0x1b2d58[_0x65c9('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c8d72){logger['info'](_0x65c9('0x1b'),_0x483c1d);logger[_0x65c9('0x13')](_0x65c9('0x1b'),_0x483c1d,JSON['stringify'](_0x1c8d72));_0x4fccab(_0x1c8d72);})[_0x65c9('0x1a')](function(_0x172d86){logger['error'](_0x65c9('0x1b'),_0x172d86['message'],_0x483c1d);_0x5b275d(_0x42f7f2[_0x65c9('0x16')](0x1f4,_0x172d86[_0x65c9('0x18')]));});});};exports[_0x65c9('0x22')]=function(_0x379a57){var _0x5315f2=this;return new Promise(function(_0x1dcd81,_0x34b80b){return db[_0x65c9('0x23')]['find']({'raw':_0x379a57[_0x65c9('0x1c')]?_0x379a57[_0x65c9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x379a57[_0x65c9('0x1c')]?_0x379a57['options'][_0x65c9('0x1e')]||null:null,'attributes':_0x379a57[_0x65c9('0x1c')]?_0x379a57[_0x65c9('0x1c')][_0x65c9('0x1f')]||null:null,'include':_0x379a57['options']?_0x379a57[_0x65c9('0x1c')][_0x65c9('0x20')]?_['map'](_0x379a57[_0x65c9('0x1c')][_0x65c9('0x20')],function(_0x2f58e6){return{'model':db[_0x2f58e6[_0x65c9('0x24')]],'as':_0x2f58e6['as'],'attributes':_0x2f58e6[_0x65c9('0x1f')],'include':_0x2f58e6[_0x65c9('0x20')]?_[_0x65c9('0x21')](_0x2f58e6[_0x65c9('0x20')],function(_0x20ab98){return{'model':db[_0x20ab98[_0x65c9('0x24')]],'as':_0x20ab98['as'],'attributes':_0x20ab98[_0x65c9('0x1f')],'include':_0x20ab98[_0x65c9('0x20')]?_[_0x65c9('0x21')](_0x20ab98[_0x65c9('0x20')],function(_0x2f04f1){return{'model':db[_0x2f04f1[_0x65c9('0x24')]],'as':_0x2f04f1['as'],'attributes':_0x2f04f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x65c9('0x25')](function(_0x4a752e){logger[_0x65c9('0x10')](_0x65c9('0x22'),_0x379a57);logger['debug']('ShowChatQueue',_0x379a57,JSON[_0x65c9('0x15')](_0x4a752e));_0x1dcd81(_0x4a752e);})[_0x65c9('0x1a')](function(_0x1795fc){logger[_0x65c9('0x16')](_0x65c9('0x22'),_0x1795fc['message'],_0x379a57);_0x34b80b(_0x5315f2[_0x65c9('0x16')](0x1f4,_0x1795fc['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 63fa0af..c0018ad 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x00bb[_0x47a7d0];return _0xb9bd08;};'use strict';var ChatQueueEvents=require(_0xb00b('0x0'));var events=[_0xb00b('0x1'),_0xb00b('0x2'),'update'];function createListener(_0x170f94,_0x47a3bf){return function(_0x278c5e){_0x47a3bf[_0xb00b('0x3')](_0x170f94,_0x278c5e);};}function removeListener(_0x582ef9,_0x14b5d0){return function(){ChatQueueEvents[_0xb00b('0x4')](_0x582ef9,_0x14b5d0);};}exports['register']=function(_0x574cf8){for(var _0x532ffb=0x0,_0x36e363=events[_0xb00b('0x5')];_0x532ffb<_0x36e363;_0x532ffb++){var _0x41dfc9=events[_0x532ffb];var _0x37f07d=createListener(_0xb00b('0x6')+_0x41dfc9,_0x574cf8);ChatQueueEvents['on'](_0x41dfc9,_0x37f07d);}};
\ No newline at end of file
+var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x581c27,_0x52e4d5){var _0x5d1392=function(_0x14c83d){while(--_0x14c83d){_0x581c27['push'](_0x581c27['shift']());}};_0x5d1392(++_0x52e4d5);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5443e2,_0xe2863c){_0x5443e2=_0x5443e2-0x0;var _0x5cb7c0=_0x4c6d[_0x5443e2];return _0x5cb7c0;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c1b7236..a9d2fb2 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x2306a5,_0x175f5b){var _0x1a2e0b=function(_0x51bac0){while(--_0x51bac0){_0x2306a5['push'](_0x2306a5['shift']());}};_0x1a2e0b(++_0x175f5b);}(_0xe14b,0x93));var _0xbe14=function(_0xfd5b09,_0x121584){_0xfd5b09=_0xfd5b09-0x0;var _0x5d443c=_0xe14b[_0xfd5b09];return _0x5d443c;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x4b5fea,_0x1e88aa){_0x4b5fea=_0x4b5fea-0x0;var _0x2b342a=_0x3e74[_0x4b5fea];return _0x2b342a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 7af47f1..ee69967 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4621=['STRING','DATE'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x4621,0x16d));var _0x1462=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4621[_0x40a045];return _0x1a687c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1462('0x0')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1462('0x0')]},'exitAt':{'type':Sequelize[_0x1462('0x0')]},'reason':{'type':Sequelize[_0x1462('0x1')]}};
\ No newline at end of file
+var _0x623d=['exports','STRING','DATE'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x623d,0x1b0));var _0xd623=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x623d[_0x432682];return _0x463d05;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd623('0x0')]={'uniqueid':{'type':Sequelize[_0xd623('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xd623('0x1')]},'joinAt':{'type':Sequelize[_0xd623('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd623('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd623('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 8c94d8b..b9728ac 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c99=['show','params','intersection','length','includeAll','find','catch','create','body','update','describe','eml-format','zip-dir','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','filters','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','ChatQueueReport','findAll','rows'];(function(_0x5c9829,_0x1c621b){var _0x7201d=function(_0x2ce86b){while(--_0x2ce86b){_0x5c9829['push'](_0x5c9829['shift']());}};_0x7201d(++_0x1c621b);}(_0x6c99,0x9b));var _0x96c9=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x6c99[_0x588011];return _0x3b3773;};'use strict';var emlformat=require(_0x96c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96c9('0x2'));var path=require(_0x96c9('0x3'));var sox=require(_0x96c9('0x4'));var csv=require(_0x96c9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96c9('0x6'));var _=require(_0x96c9('0x7'));var squel=require(_0x96c9('0x8'));var crypto=require(_0x96c9('0x9'));var jsforce=require(_0x96c9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x96c9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x96c9('0xd'));var as=require(_0x96c9('0xe'));var hardwareService=require(_0x96c9('0xf'));var logger=require(_0x96c9('0x10'))('api');var utils=require(_0x96c9('0x11'));var config=require(_0x96c9('0x12'));var licenseUtil=require(_0x96c9('0x13'));var db=require(_0x96c9('0x14'))['db'];function respondWithStatusCode(_0x3e2e57,_0x5243ca){_0x5243ca=_0x5243ca||0xcc;return function(_0x46f105){if(_0x46f105){return _0x3e2e57[_0x96c9('0x15')](_0x5243ca);}return _0x3e2e57[_0x96c9('0x16')](_0x5243ca)[_0x96c9('0x17')]();};}function respondWithResult(_0x59418c,_0x5d1f4e){_0x5d1f4e=_0x5d1f4e||0xc8;return function(_0x3f1cf9){if(_0x3f1cf9){return _0x59418c[_0x96c9('0x16')](_0x5d1f4e)[_0x96c9('0x18')](_0x3f1cf9);}};}function respondWithFilteredResult(_0x2f6ec5,_0x5c1116){return function(_0x4fa3db){if(_0x4fa3db){var _0x5d18da=typeof _0x5c1116[_0x96c9('0x19')]==='undefined'&&typeof _0x5c1116[_0x96c9('0x1a')]==='undefined';var _0x1ceeb0=_0x4fa3db[_0x96c9('0x1b')];var _0x21a0d0=_0x5d18da?0x0:_0x5c1116[_0x96c9('0x19')];var _0x3bdf8f=_0x5d18da?_0x4fa3db['count']:_0x5c1116[_0x96c9('0x19')]+_0x5c1116['limit'];var _0x3dd3de;if(_0x3bdf8f>=_0x1ceeb0){_0x3bdf8f=_0x1ceeb0;_0x3dd3de=0xc8;}else{_0x3dd3de=0xce;}_0x2f6ec5[_0x96c9('0x16')](_0x3dd3de);return _0x2f6ec5[_0x96c9('0x1c')]('Content-Range',_0x21a0d0+'-'+_0x3bdf8f+'/'+_0x1ceeb0)['json'](_0x4fa3db);}return null;};}function patchUpdates(_0x17aea5){return function(_0x20f974){try{jsonpatch[_0x96c9('0x1d')](_0x20f974,_0x17aea5,!![]);}catch(_0x1bf748){return BPromise[_0x96c9('0x1e')](_0x1bf748);}return _0x20f974[_0x96c9('0x1f')]();};}function saveUpdates(_0x596453,_0x101a25){return function(_0x3a7fc5){if(_0x3a7fc5){return _0x3a7fc5['update'](_0x596453)[_0x96c9('0x20')](function(_0x2a7ae1){return _0x2a7ae1;});}return null;};}function removeEntity(_0x185bb5,_0x575364){return function(_0x13e642){if(_0x13e642){return _0x13e642[_0x96c9('0x21')]()[_0x96c9('0x20')](function(){_0x185bb5[_0x96c9('0x16')](0xcc)[_0x96c9('0x17')]();});}};}function handleEntityNotFound(_0x2b7ad3,_0x62b05e){return function(_0x5c7252){if(!_0x5c7252){_0x2b7ad3[_0x96c9('0x15')](0x194);}return _0x5c7252;};}function handleError(_0x40b1db,_0x316d86){_0x316d86=_0x316d86||0x1f4;return function(_0x3b8b0f){logger[_0x96c9('0x22')](_0x3b8b0f[_0x96c9('0x23')]);if(_0x3b8b0f[_0x96c9('0x24')]){delete _0x3b8b0f[_0x96c9('0x24')];}_0x40b1db[_0x96c9('0x16')](_0x316d86)[_0x96c9('0x25')](_0x3b8b0f);};}exports[_0x96c9('0x26')]=function(_0x7d2858,_0x56b920){var _0x5364e5={},_0x342216={},_0x3a770b={'count':0x0,'rows':[]};var _0x4cae5a=_[_0x96c9('0x27')](db['ChatQueueReport']['rawAttributes'],function(_0x1fa934){return{'name':_0x1fa934[_0x96c9('0x28')],'type':_0x1fa934[_0x96c9('0x29')]['key']};});_0x342216['model']=_[_0x96c9('0x27')](_0x4cae5a,_0x96c9('0x24'));_0x342216[_0x96c9('0x2a')]=_[_0x96c9('0x2b')](_0x7d2858[_0x96c9('0x2a')]);_0x342216[_0x96c9('0x2c')]=_['intersection'](_0x342216['model'],_0x342216[_0x96c9('0x2a')]);_0x5364e5[_0x96c9('0x2d')]=_['intersection'](_0x342216[_0x96c9('0x2e')],qs[_0x96c9('0x2f')](_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x2f')]));_0x5364e5[_0x96c9('0x2d')]=_0x5364e5[_0x96c9('0x2d')]['length']?_0x5364e5[_0x96c9('0x2d')]:_0x342216[_0x96c9('0x2e')];if(!_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x30')]('nolimit')){_0x5364e5[_0x96c9('0x1a')]=qs['limit'](_0x7d2858['query'][_0x96c9('0x1a')]);_0x5364e5['offset']=qs[_0x96c9('0x19')](_0x7d2858['query'][_0x96c9('0x19')]);}_0x5364e5[_0x96c9('0x31')]=qs[_0x96c9('0x32')](_0x7d2858['query']['sort']);_0x5364e5[_0x96c9('0x33')]=qs['filters'](_[_0x96c9('0x34')](_0x7d2858['query'],_0x342216[_0x96c9('0x2c')]),_0x4cae5a);if(_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x35')]){_0x5364e5[_0x96c9('0x33')]=_['merge'](_0x5364e5[_0x96c9('0x33')],{'$or':_[_0x96c9('0x27')](_0x4cae5a,function(_0x338925){if(_0x338925[_0x96c9('0x29')]!==_0x96c9('0x36')){var _0x770669={};_0x770669[_0x338925[_0x96c9('0x24')]]={'$like':'%'+_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x35')]+'%'};return _0x770669;}})});}_0x5364e5=_[_0x96c9('0x37')]({},_0x5364e5,_0x7d2858[_0x96c9('0x38')]);var _0x331735={'where':_0x5364e5['where']};return db['ChatQueueReport'][_0x96c9('0x1b')](_0x331735)[_0x96c9('0x20')](function(_0x59db64){_0x3a770b[_0x96c9('0x1b')]=_0x59db64;if(_0x7d2858[_0x96c9('0x2a')]['includeAll']){_0x5364e5[_0x96c9('0x39')]=[{'all':!![]}];}return db[_0x96c9('0x3a')][_0x96c9('0x3b')](_0x5364e5);})[_0x96c9('0x20')](function(_0x3b64c8){_0x3a770b[_0x96c9('0x3c')]=_0x3b64c8;return _0x3a770b;})[_0x96c9('0x20')](respondWithFilteredResult(_0x56b920,_0x5364e5))['catch'](handleError(_0x56b920,null));};exports[_0x96c9('0x3d')]=function(_0x3d9056,_0x18592b){var _0x3a3399={'raw':!![],'where':{'id':_0x3d9056[_0x96c9('0x3e')]['id']}},_0x49ee79={};_0x49ee79['model']=_[_0x96c9('0x2b')](db[_0x96c9('0x3a')]['rawAttributes']);_0x49ee79[_0x96c9('0x2a')]=_[_0x96c9('0x2b')](_0x3d9056[_0x96c9('0x2a')]);_0x49ee79[_0x96c9('0x2c')]=_[_0x96c9('0x3f')](_0x49ee79[_0x96c9('0x2e')],_0x49ee79[_0x96c9('0x2a')]);_0x3a3399[_0x96c9('0x2d')]=_[_0x96c9('0x3f')](_0x49ee79['model'],qs['fields'](_0x3d9056[_0x96c9('0x2a')][_0x96c9('0x2f')]));_0x3a3399[_0x96c9('0x2d')]=_0x3a3399[_0x96c9('0x2d')][_0x96c9('0x40')]?_0x3a3399['attributes']:_0x49ee79[_0x96c9('0x2e')];if(_0x3d9056[_0x96c9('0x2a')][_0x96c9('0x41')]){_0x3a3399[_0x96c9('0x39')]=[{'all':!![]}];}_0x3a3399=_['merge']({},_0x3a3399,_0x3d9056['options']);return db[_0x96c9('0x3a')][_0x96c9('0x42')](_0x3a3399)[_0x96c9('0x20')](handleEntityNotFound(_0x18592b,null))['then'](respondWithResult(_0x18592b,null))[_0x96c9('0x43')](handleError(_0x18592b,null));};exports['create']=function(_0x3c4bf1,_0x2071d5){return db['ChatQueueReport'][_0x96c9('0x44')](_0x3c4bf1[_0x96c9('0x45')],{})['then'](respondWithResult(_0x2071d5,0xc9))[_0x96c9('0x43')](handleError(_0x2071d5,null));};exports[_0x96c9('0x46')]=function(_0x986731,_0x16156e){if(_0x986731[_0x96c9('0x45')]['id']){delete _0x986731[_0x96c9('0x45')]['id'];}return db[_0x96c9('0x3a')][_0x96c9('0x42')]({'where':{'id':_0x986731[_0x96c9('0x3e')]['id']}})[_0x96c9('0x20')](handleEntityNotFound(_0x16156e,null))['then'](saveUpdates(_0x986731[_0x96c9('0x45')],null))['then'](respondWithResult(_0x16156e,null))[_0x96c9('0x43')](handleError(_0x16156e,null));};exports[_0x96c9('0x21')]=function(_0x25f3df,_0x59dea7){return db[_0x96c9('0x3a')][_0x96c9('0x42')]({'where':{'id':_0x25f3df[_0x96c9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59dea7,null))[_0x96c9('0x20')](removeEntity(_0x59dea7,null))[_0x96c9('0x43')](handleError(_0x59dea7,null));};exports[_0x96c9('0x47')]=function(_0x576314,_0x4f18ad){return db[_0x96c9('0x3a')][_0x96c9('0x47')]()[_0x96c9('0x20')](respondWithResult(_0x4f18ad,null))[_0x96c9('0x43')](handleError(_0x4f18ad,null));};
\ No newline at end of file
+var _0xd7c3=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x29a43f,_0x5bc56f){_0x29a43f=_0x29a43f-0x0;var _0x14b425=_0xd7c3[_0x29a43f];return _0x14b425;};'use strict';var emlformat=require(_0x3d7c('0x0'));var rimraf=require(_0x3d7c('0x1'));var zipdir=require(_0x3d7c('0x2'));var jsonpatch=require(_0x3d7c('0x3'));var rp=require(_0x3d7c('0x4'));var moment=require(_0x3d7c('0x5'));var BPromise=require(_0x3d7c('0x6'));var Mustache=require(_0x3d7c('0x7'));var util=require(_0x3d7c('0x8'));var path=require('path');var sox=require(_0x3d7c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d7c('0xa'));var squel=require(_0x3d7c('0xb'));var crypto=require(_0x3d7c('0xc'));var jsforce=require(_0x3d7c('0xd'));var deskjs=require(_0x3d7c('0xe'));var toCsv=require(_0x3d7c('0xf'));var querystring=require(_0x3d7c('0x10'));var Papa=require(_0x3d7c('0x11'));var Redis=require(_0x3d7c('0x12'));var authService=require(_0x3d7c('0x13'));var qs=require(_0x3d7c('0x14'));var as=require(_0x3d7c('0x15'));var hardwareService=require(_0x3d7c('0x16'));var logger=require(_0x3d7c('0x17'))(_0x3d7c('0x18'));var utils=require(_0x3d7c('0x19'));var config=require(_0x3d7c('0x1a'));var licenseUtil=require(_0x3d7c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20148f,_0x40e8a6){_0x40e8a6=_0x40e8a6||0xcc;return function(_0xb7bd60){if(_0xb7bd60){return _0x20148f[_0x3d7c('0x1c')](_0x40e8a6);}return _0x20148f[_0x3d7c('0x1d')](_0x40e8a6)[_0x3d7c('0x1e')]();};}function respondWithResult(_0x4728dc,_0x477faf){_0x477faf=_0x477faf||0xc8;return function(_0x2717c5){if(_0x2717c5){return _0x4728dc[_0x3d7c('0x1d')](_0x477faf)[_0x3d7c('0x1f')](_0x2717c5);}};}function respondWithFilteredResult(_0x37122a,_0x1ba7ee){return function(_0xf0a186){if(_0xf0a186){var _0x9d0305=typeof _0x1ba7ee[_0x3d7c('0x20')]==='undefined'&&typeof _0x1ba7ee[_0x3d7c('0x21')]===_0x3d7c('0x22');var _0x49e25c=_0xf0a186['count'];var _0x447ea0=_0x9d0305?0x0:_0x1ba7ee[_0x3d7c('0x20')];var _0x323204=_0x9d0305?_0xf0a186[_0x3d7c('0x23')]:_0x1ba7ee['offset']+_0x1ba7ee[_0x3d7c('0x21')];var _0x328851;if(_0x323204>=_0x49e25c){_0x323204=_0x49e25c;_0x328851=0xc8;}else{_0x328851=0xce;}_0x37122a[_0x3d7c('0x1d')](_0x328851);return _0x37122a['set'](_0x3d7c('0x24'),_0x447ea0+'-'+_0x323204+'/'+_0x49e25c)[_0x3d7c('0x1f')](_0xf0a186);}return null;};}function patchUpdates(_0x3a99fd){return function(_0x5a91d2){try{jsonpatch[_0x3d7c('0x25')](_0x5a91d2,_0x3a99fd,!![]);}catch(_0x22f9f6){return BPromise[_0x3d7c('0x26')](_0x22f9f6);}return _0x5a91d2[_0x3d7c('0x27')]();};}function saveUpdates(_0xa4fbe9,_0x4c977f){return function(_0x126c5e){if(_0x126c5e){return _0x126c5e[_0x3d7c('0x28')](_0xa4fbe9)[_0x3d7c('0x29')](function(_0x81a5a3){return _0x81a5a3;});}return null;};}function removeEntity(_0x553df1,_0x4a7966){return function(_0x3518c9){if(_0x3518c9){return _0x3518c9[_0x3d7c('0x2a')]()[_0x3d7c('0x29')](function(){_0x553df1[_0x3d7c('0x1d')](0xcc)[_0x3d7c('0x1e')]();});}};}function handleEntityNotFound(_0x2806a5,_0x139fa2){return function(_0x2ac594){if(!_0x2ac594){_0x2806a5[_0x3d7c('0x1c')](0x194);}return _0x2ac594;};}function handleError(_0x4696f1,_0x820d20){_0x820d20=_0x820d20||0x1f4;return function(_0x4d440b){logger['error'](_0x4d440b[_0x3d7c('0x2b')]);if(_0x4d440b[_0x3d7c('0x2c')]){delete _0x4d440b['name'];}_0x4696f1[_0x3d7c('0x1d')](_0x820d20)[_0x3d7c('0x2d')](_0x4d440b);};}exports[_0x3d7c('0x2e')]=function(_0x53698b,_0x457c53){var _0x386719={},_0x215c60={},_0x236440={'count':0x0,'rows':[]};var _0x257dde=_['map'](db[_0x3d7c('0x2f')][_0x3d7c('0x30')],function(_0x20dc15){return{'name':_0x20dc15['fieldName'],'type':_0x20dc15[_0x3d7c('0x31')][_0x3d7c('0x32')]};});_0x215c60[_0x3d7c('0x33')]=_[_0x3d7c('0x34')](_0x257dde,_0x3d7c('0x2c'));_0x215c60[_0x3d7c('0x35')]=_['keys'](_0x53698b['query']);_0x215c60[_0x3d7c('0x36')]=_[_0x3d7c('0x37')](_0x215c60[_0x3d7c('0x33')],_0x215c60[_0x3d7c('0x35')]);_0x386719[_0x3d7c('0x38')]=_[_0x3d7c('0x37')](_0x215c60['model'],qs[_0x3d7c('0x39')](_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x39')]));_0x386719['attributes']=_0x386719[_0x3d7c('0x38')]['length']?_0x386719['attributes']:_0x215c60[_0x3d7c('0x33')];if(!_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x3a')](_0x3d7c('0x3b'))){_0x386719['limit']=qs[_0x3d7c('0x21')](_0x53698b[_0x3d7c('0x35')]['limit']);_0x386719[_0x3d7c('0x20')]=qs['offset'](_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x20')]);}_0x386719[_0x3d7c('0x3c')]=qs[_0x3d7c('0x3d')](_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x3d')]);_0x386719[_0x3d7c('0x3e')]=qs[_0x3d7c('0x36')](_[_0x3d7c('0x3f')](_0x53698b[_0x3d7c('0x35')],_0x215c60[_0x3d7c('0x36')]),_0x257dde);if(_0x53698b[_0x3d7c('0x35')]['filter']){_0x386719[_0x3d7c('0x3e')]=_[_0x3d7c('0x40')](_0x386719[_0x3d7c('0x3e')],{'$or':_[_0x3d7c('0x34')](_0x257dde,function(_0x1f1e29){if(_0x1f1e29[_0x3d7c('0x31')]!==_0x3d7c('0x41')){var _0x55ada1={};_0x55ada1[_0x1f1e29[_0x3d7c('0x2c')]]={'$like':'%'+_0x53698b[_0x3d7c('0x35')]['filter']+'%'};return _0x55ada1;}})});}_0x386719=_['merge']({},_0x386719,_0x53698b['options']);var _0x40058f={'where':_0x386719[_0x3d7c('0x3e')]};return db[_0x3d7c('0x2f')][_0x3d7c('0x23')](_0x40058f)['then'](function(_0x130583){_0x236440[_0x3d7c('0x23')]=_0x130583;if(_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x42')]){_0x386719[_0x3d7c('0x43')]=[{'all':!![]}];}return db[_0x3d7c('0x2f')][_0x3d7c('0x44')](_0x386719);})[_0x3d7c('0x29')](function(_0x12fc85){_0x236440[_0x3d7c('0x45')]=_0x12fc85;return _0x236440;})[_0x3d7c('0x29')](respondWithFilteredResult(_0x457c53,_0x386719))[_0x3d7c('0x46')](handleError(_0x457c53,null));};exports[_0x3d7c('0x47')]=function(_0x5bb21a,_0x5b0db8){var _0x177ad7={'raw':!![],'where':{'id':_0x5bb21a[_0x3d7c('0x48')]['id']}},_0x2ed019={};_0x2ed019['model']=_[_0x3d7c('0x49')](db[_0x3d7c('0x2f')][_0x3d7c('0x30')]);_0x2ed019[_0x3d7c('0x35')]=_[_0x3d7c('0x49')](_0x5bb21a[_0x3d7c('0x35')]);_0x2ed019[_0x3d7c('0x36')]=_[_0x3d7c('0x37')](_0x2ed019['model'],_0x2ed019[_0x3d7c('0x35')]);_0x177ad7[_0x3d7c('0x38')]=_[_0x3d7c('0x37')](_0x2ed019[_0x3d7c('0x33')],qs['fields'](_0x5bb21a[_0x3d7c('0x35')][_0x3d7c('0x39')]));_0x177ad7[_0x3d7c('0x38')]=_0x177ad7[_0x3d7c('0x38')][_0x3d7c('0x4a')]?_0x177ad7['attributes']:_0x2ed019[_0x3d7c('0x33')];if(_0x5bb21a['query'][_0x3d7c('0x42')]){_0x177ad7[_0x3d7c('0x43')]=[{'all':!![]}];}_0x177ad7=_[_0x3d7c('0x40')]({},_0x177ad7,_0x5bb21a['options']);return db[_0x3d7c('0x2f')][_0x3d7c('0x4b')](_0x177ad7)[_0x3d7c('0x29')](handleEntityNotFound(_0x5b0db8,null))[_0x3d7c('0x29')](respondWithResult(_0x5b0db8,null))[_0x3d7c('0x46')](handleError(_0x5b0db8,null));};exports['create']=function(_0x468a9c,_0x393217){return db[_0x3d7c('0x2f')][_0x3d7c('0x4c')](_0x468a9c[_0x3d7c('0x4d')],{})[_0x3d7c('0x29')](respondWithResult(_0x393217,0xc9))[_0x3d7c('0x46')](handleError(_0x393217,null));};exports[_0x3d7c('0x28')]=function(_0x2549ed,_0x33cc2c){if(_0x2549ed['body']['id']){delete _0x2549ed[_0x3d7c('0x4d')]['id'];}return db[_0x3d7c('0x2f')][_0x3d7c('0x4b')]({'where':{'id':_0x2549ed[_0x3d7c('0x48')]['id']}})[_0x3d7c('0x29')](handleEntityNotFound(_0x33cc2c,null))['then'](saveUpdates(_0x2549ed[_0x3d7c('0x4d')],null))[_0x3d7c('0x29')](respondWithResult(_0x33cc2c,null))[_0x3d7c('0x46')](handleError(_0x33cc2c,null));};exports[_0x3d7c('0x2a')]=function(_0x1cba46,_0x31bbac){return db[_0x3d7c('0x2f')][_0x3d7c('0x4b')]({'where':{'id':_0x1cba46['params']['id']}})[_0x3d7c('0x29')](handleEntityNotFound(_0x31bbac,null))['then'](removeEntity(_0x31bbac,null))['catch'](handleError(_0x31bbac,null));};exports['describe']=function(_0x5b65a9,_0x55a56c){return db[_0x3d7c('0x2f')]['describe']()['then'](respondWithResult(_0x55a56c,null))[_0x3d7c('0x46')](handleError(_0x55a56c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 80e7685..5770bfa 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x3c6254,_0x24ab89){var _0x551e02=function(_0xb437ac){while(--_0xb437ac){_0x3c6254['push'](_0x3c6254['shift']());}};_0x551e02(++_0x24ab89);}(_0x757a,0xde));var _0xa757=function(_0x432923,_0x4f4024){_0x432923=_0x432923-0x0;var _0x4ad7e7=_0x757a[_0x432923];return _0x4ad7e7;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x55a62d,_0x2b1826){var _0x5adef7=function(_0x42cdf0){while(--_0x42cdf0){_0x55a62d['push'](_0x55a62d['shift']());}};_0x5adef7(++_0x2b1826);}(_0x757a,0xde));var _0xa757=function(_0x3b1bab,_0x379389){_0x3b1bab=_0x3b1bab-0x0;var _0x3a7974=_0x757a[_0x3b1bab];return _0x3a7974;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 44dd31a..6ee3a20 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7889=['UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','catch'];(function(_0x5acc8c,_0x4f7b1a){var _0x236007=function(_0x1aeaab){while(--_0x1aeaab){_0x5acc8c['push'](_0x5acc8c['shift']());}};_0x236007(++_0x4f7b1a);}(_0x7889,0x1cc));var _0x9788=function(_0x4a31c5,_0x3ae3e9){_0x4a31c5=_0x4a31c5-0x0;var _0x2cb35a=_0x7889[_0x4a31c5];return _0x2cb35a;};'use strict';var _=require(_0x9788('0x0'));var util=require(_0x9788('0x1'));var moment=require(_0x9788('0x2'));var BPromise=require(_0x9788('0x3'));var rs=require(_0x9788('0x4'));var fs=require('fs');var Redis=require(_0x9788('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9788('0x6'));var logger=require('../../config/logger')(_0x9788('0x7'));var config=require(_0x9788('0x8'));var jayson=require(_0x9788('0x9'));var client=jayson['client'][_0x9788('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422af7,_0x4e825c,_0x59dea1){return new BPromise(function(_0x280169,_0x262aec){return client[_0x9788('0xb')](_0x422af7,_0x59dea1)[_0x9788('0xc')](function(_0x16c231){logger[_0x9788('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x4e825c,'request\x20sent');logger[_0x9788('0xe')](_0x9788('0xf'),_0x4e825c,_0x9788('0x10'),JSON[_0x9788('0x11')](_0x16c231));if(_0x16c231[_0x9788('0x12')]){if(_0x16c231[_0x9788('0x12')][_0x9788('0x13')]===0x1f4){logger[_0x9788('0x12')](_0x9788('0x14'),_0x4e825c,_0x16c231[_0x9788('0x12')]['message']);return _0x262aec(_0x16c231[_0x9788('0x12')][_0x9788('0x15')]);}logger[_0x9788('0x12')](_0x9788('0x14'),_0x4e825c,_0x16c231['error'][_0x9788('0x15')]);return _0x280169(_0x16c231['error'][_0x9788('0x15')]);}else{logger[_0x9788('0xd')](_0x9788('0x14'),_0x4e825c,'request\x20sent');_0x280169(_0x16c231[_0x9788('0x16')]['message']);}})['catch'](function(_0x10750e){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4e825c,_0x10750e);_0x262aec(_0x10750e);});});}exports['CreateChatQueueReport']=function(_0x3df7d9){var _0x3c79d4=this;return new Promise(function(_0x4525fb,_0x3905cc){return db[_0x9788('0x17')][_0x9788('0x18')](_0x3df7d9[_0x9788('0x19')],{'raw':_0x3df7d9[_0x9788('0x1a')]?_0x3df7d9[_0x9788('0x1a')][_0x9788('0x1b')]===undefined?!![]:![]:!![]})[_0x9788('0xc')](function(_0x4a119d){logger[_0x9788('0xd')](_0x9788('0x1c'),_0x3df7d9);logger[_0x9788('0xe')](_0x9788('0x1c'),_0x3df7d9,JSON['stringify'](_0x4a119d));_0x4525fb(_0x4a119d);})[_0x9788('0x1d')](function(_0x4cdad9){logger[_0x9788('0x12')]('CreateChatQueueReport',_0x4cdad9[_0x9788('0x15')],_0x3df7d9);_0x3905cc(_0x3c79d4['error'](0x1f4,_0x4cdad9['message']));});});};exports[_0x9788('0x1e')]=function(_0x5e1a5f){var _0x4b06f8=this;return new Promise(function(_0x1e3b76,_0x2e4793){return db[_0x9788('0x17')][_0x9788('0x1f')](_0x5e1a5f['body'],{'raw':_0x5e1a5f[_0x9788('0x1a')]?_0x5e1a5f[_0x9788('0x1a')][_0x9788('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1a5f[_0x9788('0x1a')]?_0x5e1a5f[_0x9788('0x1a')][_0x9788('0x20')]||null:null,'attributes':_0x5e1a5f['options']?_0x5e1a5f['options'][_0x9788('0x21')]||null:null,'limit':_0x5e1a5f[_0x9788('0x1a')]?_0x5e1a5f[_0x9788('0x1a')][_0x9788('0x22')]||null:null})[_0x9788('0xc')](function(_0x4a7c1c){logger[_0x9788('0xd')](_0x9788('0x1e'),_0x5e1a5f);logger[_0x9788('0xe')]('UpdateChatQueueReport',_0x5e1a5f,JSON[_0x9788('0x11')](_0x4a7c1c));_0x1e3b76(_0x4a7c1c);})['catch'](function(_0x78bb83){logger[_0x9788('0x12')]('UpdateChatQueueReport',_0x78bb83[_0x9788('0x15')],_0x5e1a5f);_0x2e4793(_0x4b06f8[_0x9788('0x12')](0x1f4,_0x78bb83[_0x9788('0x15')]));});});};
\ No newline at end of file
+var _0xb991=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','where','limit','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb991,0x69));var _0x1b99=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xb991[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x1b99('0x0'));var util=require(_0x1b99('0x1'));var moment=require(_0x1b99('0x2'));var BPromise=require(_0x1b99('0x3'));var rs=require(_0x1b99('0x4'));var fs=require('fs');var Redis=require(_0x1b99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b99('0x6'));var logger=require(_0x1b99('0x7'))(_0x1b99('0x8'));var config=require(_0x1b99('0x9'));var jayson=require(_0x1b99('0xa'));var client=jayson[_0x1b99('0xb')][_0x1b99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2693a5,_0x5cd2d3,_0x592297){return new BPromise(function(_0x3bb0ee,_0x1694e7){return client['request'](_0x2693a5,_0x592297)['then'](function(_0x415ae1){logger[_0x1b99('0xd')](_0x1b99('0xe'),_0x5cd2d3,_0x1b99('0xf'));logger['debug'](_0x1b99('0x10'),_0x5cd2d3,_0x1b99('0xf'),JSON[_0x1b99('0x11')](_0x415ae1));if(_0x415ae1[_0x1b99('0x12')]){if(_0x415ae1['error'][_0x1b99('0x13')]===0x1f4){logger['error'](_0x1b99('0xe'),_0x5cd2d3,_0x415ae1[_0x1b99('0x12')][_0x1b99('0x14')]);return _0x1694e7(_0x415ae1[_0x1b99('0x12')][_0x1b99('0x14')]);}logger[_0x1b99('0x12')](_0x1b99('0xe'),_0x5cd2d3,_0x415ae1['error'][_0x1b99('0x14')]);return _0x3bb0ee(_0x415ae1['error'][_0x1b99('0x14')]);}else{logger[_0x1b99('0xd')](_0x1b99('0xe'),_0x5cd2d3,'request\x20sent');_0x3bb0ee(_0x415ae1[_0x1b99('0x15')]['message']);}})[_0x1b99('0x16')](function(_0x2f4e6a){logger[_0x1b99('0x12')](_0x1b99('0xe'),_0x5cd2d3,_0x2f4e6a);_0x1694e7(_0x2f4e6a);});});}exports[_0x1b99('0x17')]=function(_0x4e219e){var _0x1d314a=this;return new Promise(function(_0x480e94,_0x3983c8){return db[_0x1b99('0x18')][_0x1b99('0x19')](_0x4e219e[_0x1b99('0x1a')],{'raw':_0x4e219e[_0x1b99('0x1b')]?_0x4e219e[_0x1b99('0x1b')][_0x1b99('0x1c')]===undefined?!![]:![]:!![]})[_0x1b99('0x1d')](function(_0x392a9a){logger[_0x1b99('0xd')]('CreateChatQueueReport',_0x4e219e);logger['debug'](_0x1b99('0x17'),_0x4e219e,JSON[_0x1b99('0x11')](_0x392a9a));_0x480e94(_0x392a9a);})[_0x1b99('0x16')](function(_0x558d7b){logger['error'](_0x1b99('0x17'),_0x558d7b[_0x1b99('0x14')],_0x4e219e);_0x3983c8(_0x1d314a[_0x1b99('0x12')](0x1f4,_0x558d7b[_0x1b99('0x14')]));});});};exports[_0x1b99('0x1e')]=function(_0x419937){var _0x5b740a=this;return new Promise(function(_0x270c88,_0x589dde){return db[_0x1b99('0x18')][_0x1b99('0x1f')](_0x419937['body'],{'raw':_0x419937[_0x1b99('0x1b')]?_0x419937[_0x1b99('0x1b')][_0x1b99('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419937['options']?_0x419937[_0x1b99('0x1b')][_0x1b99('0x20')]||null:null,'attributes':_0x419937['options']?_0x419937[_0x1b99('0x1b')]['attributes']||null:null,'limit':_0x419937[_0x1b99('0x1b')]?_0x419937[_0x1b99('0x1b')][_0x1b99('0x21')]||null:null})[_0x1b99('0x1d')](function(_0x5052cc){logger[_0x1b99('0xd')](_0x1b99('0x1e'),_0x419937);logger[_0x1b99('0x22')](_0x1b99('0x1e'),_0x419937,JSON[_0x1b99('0x11')](_0x5052cc));_0x270c88(_0x5052cc);})[_0x1b99('0x16')](function(_0x57518a){logger[_0x1b99('0x12')](_0x1b99('0x1e'),_0x57518a['message'],_0x419937);_0x589dde(_0x5b740a[_0x1b99('0x12')](0x1f4,_0x57518a[_0x1b99('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4632b1b..d28e87a 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdeb8=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdeb8,0x1b9));var _0x8deb=function(_0x214787,_0x29db96){_0x214787=_0x214787-0x0;var _0x1bb519=_0xdeb8[_0x214787];return _0x1bb519;};'use strict';var multer=require(_0x8deb('0x0'));var util=require(_0x8deb('0x1'));var path=require(_0x8deb('0x2'));var timeout=require('connect-timeout');var express=require(_0x8deb('0x3'));var router=express[_0x8deb('0x4')]();var fs_extra=require(_0x8deb('0x5'));var auth=require(_0x8deb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8deb('0x7'));var controller=require(_0x8deb('0x8'));router[_0x8deb('0x9')]('/',auth[_0x8deb('0xa')](),controller[_0x8deb('0xb')]);router['get'](_0x8deb('0xc'),auth[_0x8deb('0xa')](),controller[_0x8deb('0xd')]);router[_0x8deb('0x9')](_0x8deb('0xe'),auth[_0x8deb('0xa')](),controller[_0x8deb('0xf')]);router[_0x8deb('0x10')]('/',auth[_0x8deb('0xa')](),controller[_0x8deb('0x11')]);router[_0x8deb('0x12')]('/:id',auth[_0x8deb('0xa')](),controller[_0x8deb('0x13')]);router['delete'](_0x8deb('0xe'),auth['isAuthenticated'](),controller[_0x8deb('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x3558=['index','/describe','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x5b0fc9,_0x345838){var _0x25420e=function(_0x2ef1c2){while(--_0x2ef1c2){_0x5b0fc9['push'](_0x5b0fc9['shift']());}};_0x25420e(++_0x345838);}(_0x3558,0xaa));var _0x8355=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x3558[_0x1d87fc];return _0x492b56;};'use strict';var multer=require(_0x8355('0x0'));var util=require(_0x8355('0x1'));var path=require(_0x8355('0x2'));var timeout=require(_0x8355('0x3'));var express=require(_0x8355('0x4'));var router=express[_0x8355('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8355('0x6'));var interaction=require(_0x8355('0x7'));var config=require('../../config/environment');var controller=require(_0x8355('0x8'));router[_0x8355('0x9')]('/',auth['isAuthenticated'](),controller[_0x8355('0xa')]);router[_0x8355('0x9')](_0x8355('0xb'),auth[_0x8355('0xc')](),controller['describe']);router[_0x8355('0x9')](_0x8355('0xd'),auth[_0x8355('0xc')](),controller[_0x8355('0xe')]);router[_0x8355('0xf')]('/',auth[_0x8355('0xc')](),controller[_0x8355('0x10')]);router['put'](_0x8355('0xd'),auth[_0x8355('0xc')](),controller['update']);router[_0x8355('0x11')](_0x8355('0xd'),auth[_0x8355('0xc')](),controller[_0x8355('0x12')]);module[_0x8355('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 6ece408..358018f 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x595e30,_0x1f0f9f){var _0x3bcd17=function(_0x4faeb){while(--_0x4faeb){_0x595e30['push'](_0x595e30['shift']());}};_0x3bcd17(++_0x1f0f9f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x00bb[_0x5783f4];return _0x28e380;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2254a5,_0x26d21c){var _0x3433b9=function(_0x407e94){while(--_0x407e94){_0x2254a5['push'](_0x2254a5['shift']());}};_0x3433b9(++_0x26d21c);}(_0xf4eb,0xec));var _0xbf4e=function(_0xbb0544,_0x4e46d7){_0xbb0544=_0xbb0544-0x0;var _0x4e6146=_0xf4eb[_0xbb0544];return _0x4e6146;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 11e6253..aee29e7 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd10=['stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','ChatTransferReport','includeAll','include','rows','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x4e2f0e,_0x59fedc){var _0x281145=function(_0x5fcce8){while(--_0x5fcce8){_0x4e2f0e['push'](_0x4e2f0e['shift']());}};_0x281145(++_0x59fedc);}(_0xdd10,0x6f));var _0x0dd1=function(_0x2ee0c1,_0x2355b2){_0x2ee0c1=_0x2ee0c1-0x0;var _0x5cfe33=_0xdd10[_0x2ee0c1];return _0x5cfe33;};'use strict';var emlformat=require(_0x0dd1('0x0'));var rimraf=require(_0x0dd1('0x1'));var zipdir=require(_0x0dd1('0x2'));var jsonpatch=require(_0x0dd1('0x3'));var rp=require(_0x0dd1('0x4'));var moment=require('moment');var BPromise=require(_0x0dd1('0x5'));var Mustache=require(_0x0dd1('0x6'));var util=require(_0x0dd1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0dd1('0x8'));var ejs=require(_0x0dd1('0x9'));var fs=require('fs');var fs_extra=require(_0x0dd1('0xa'));var _=require(_0x0dd1('0xb'));var squel=require(_0x0dd1('0xc'));var crypto=require(_0x0dd1('0xd'));var jsforce=require(_0x0dd1('0xe'));var deskjs=require(_0x0dd1('0xf'));var toCsv=require(_0x0dd1('0x8'));var querystring=require(_0x0dd1('0x10'));var Papa=require(_0x0dd1('0x11'));var Redis=require(_0x0dd1('0x12'));var authService=require(_0x0dd1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0dd1('0x14'));var hardwareService=require(_0x0dd1('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0dd1('0x16'));var licenseUtil=require(_0x0dd1('0x17'));var db=require(_0x0dd1('0x18'))['db'];function respondWithStatusCode(_0x536332,_0x5fed78){_0x5fed78=_0x5fed78||0xcc;return function(_0x30b433){if(_0x30b433){return _0x536332[_0x0dd1('0x19')](_0x5fed78);}return _0x536332[_0x0dd1('0x1a')](_0x5fed78)['end']();};}function respondWithResult(_0x320294,_0x21b6aa){_0x21b6aa=_0x21b6aa||0xc8;return function(_0x53eead){if(_0x53eead){return _0x320294['status'](_0x21b6aa)[_0x0dd1('0x1b')](_0x53eead);}};}function respondWithFilteredResult(_0x5b0836,_0x51c677){return function(_0x2c4274){if(_0x2c4274){var _0x443db5=typeof _0x51c677[_0x0dd1('0x1c')]==='undefined'&&typeof _0x51c677['limit']===_0x0dd1('0x1d');var _0x18d1aa=_0x2c4274['count'];var _0x42daa9=_0x443db5?0x0:_0x51c677[_0x0dd1('0x1c')];var _0xd2fa22=_0x443db5?_0x2c4274[_0x0dd1('0x1e')]:_0x51c677[_0x0dd1('0x1c')]+_0x51c677[_0x0dd1('0x1f')];var _0x3d4f54;if(_0xd2fa22>=_0x18d1aa){_0xd2fa22=_0x18d1aa;_0x3d4f54=0xc8;}else{_0x3d4f54=0xce;}_0x5b0836['status'](_0x3d4f54);return _0x5b0836[_0x0dd1('0x20')](_0x0dd1('0x21'),_0x42daa9+'-'+_0xd2fa22+'/'+_0x18d1aa)[_0x0dd1('0x1b')](_0x2c4274);}return null;};}function patchUpdates(_0x80d9fd){return function(_0x2422d2){try{jsonpatch[_0x0dd1('0x22')](_0x2422d2,_0x80d9fd,!![]);}catch(_0x5b351b){return BPromise[_0x0dd1('0x23')](_0x5b351b);}return _0x2422d2[_0x0dd1('0x24')]();};}function saveUpdates(_0x1b5377,_0x34a77c){return function(_0x13c6db){if(_0x13c6db){return _0x13c6db[_0x0dd1('0x25')](_0x1b5377)[_0x0dd1('0x26')](function(_0x4743d9){return _0x4743d9;});}return null;};}function removeEntity(_0x3e25f5,_0xd29cc){return function(_0x449ff3){if(_0x449ff3){return _0x449ff3[_0x0dd1('0x27')]()['then'](function(){_0x3e25f5[_0x0dd1('0x1a')](0xcc)[_0x0dd1('0x28')]();});}};}function handleEntityNotFound(_0x4f77a0,_0x3d5d8f){return function(_0x282613){if(!_0x282613){_0x4f77a0[_0x0dd1('0x19')](0x194);}return _0x282613;};}function handleError(_0x54d206,_0xd22cfb){_0xd22cfb=_0xd22cfb||0x1f4;return function(_0x4b1de8){logger['error'](_0x4b1de8[_0x0dd1('0x29')]);if(_0x4b1de8[_0x0dd1('0x2a')]){delete _0x4b1de8[_0x0dd1('0x2a')];}_0x54d206[_0x0dd1('0x1a')](_0xd22cfb)[_0x0dd1('0x2b')](_0x4b1de8);};}exports['index']=function(_0x507d78,_0x373fbe){var _0x5782b4={},_0x5068dc={},_0x1d9630={'count':0x0,'rows':[]};var _0xc1a64e=_[_0x0dd1('0x2c')](db['ChatTransferReport'][_0x0dd1('0x2d')],function(_0x4b198c){return{'name':_0x4b198c[_0x0dd1('0x2e')],'type':_0x4b198c[_0x0dd1('0x2f')][_0x0dd1('0x30')]};});_0x5068dc[_0x0dd1('0x31')]=_[_0x0dd1('0x2c')](_0xc1a64e,_0x0dd1('0x2a'));_0x5068dc['query']=_[_0x0dd1('0x32')](_0x507d78[_0x0dd1('0x33')]);_0x5068dc[_0x0dd1('0x34')]=_[_0x0dd1('0x35')](_0x5068dc[_0x0dd1('0x31')],_0x5068dc[_0x0dd1('0x33')]);_0x5782b4['attributes']=_[_0x0dd1('0x35')](_0x5068dc[_0x0dd1('0x31')],qs[_0x0dd1('0x36')](_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x36')]));_0x5782b4[_0x0dd1('0x37')]=_0x5782b4[_0x0dd1('0x37')][_0x0dd1('0x38')]?_0x5782b4['attributes']:_0x5068dc[_0x0dd1('0x31')];if(!_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x39')]('nolimit')){_0x5782b4[_0x0dd1('0x1f')]=qs[_0x0dd1('0x1f')](_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x1f')]);_0x5782b4['offset']=qs['offset'](_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x1c')]);}_0x5782b4[_0x0dd1('0x3a')]=qs[_0x0dd1('0x3b')](_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x3b')]);_0x5782b4['where']=qs[_0x0dd1('0x34')](_[_0x0dd1('0x3c')](_0x507d78[_0x0dd1('0x33')],_0x5068dc[_0x0dd1('0x34')]),_0xc1a64e);if(_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x3d')]){_0x5782b4[_0x0dd1('0x3e')]=_[_0x0dd1('0x3f')](_0x5782b4[_0x0dd1('0x3e')],{'$or':_[_0x0dd1('0x2c')](_0xc1a64e,function(_0x32fdd3){if(_0x32fdd3[_0x0dd1('0x2f')]!==_0x0dd1('0x40')){var _0xf87014={};_0xf87014[_0x32fdd3['name']]={'$like':'%'+_0x507d78[_0x0dd1('0x33')]['filter']+'%'};return _0xf87014;}})});}_0x5782b4=_[_0x0dd1('0x3f')]({},_0x5782b4,_0x507d78['options']);var _0x5dcc60={'where':_0x5782b4[_0x0dd1('0x3e')]};return db[_0x0dd1('0x41')][_0x0dd1('0x1e')](_0x5dcc60)[_0x0dd1('0x26')](function(_0x1c1cff){_0x1d9630[_0x0dd1('0x1e')]=_0x1c1cff;if(_0x507d78[_0x0dd1('0x33')][_0x0dd1('0x42')]){_0x5782b4[_0x0dd1('0x43')]=[{'all':!![]}];}return db[_0x0dd1('0x41')]['findAll'](_0x5782b4);})[_0x0dd1('0x26')](function(_0x204fba){_0x1d9630[_0x0dd1('0x44')]=_0x204fba;return _0x1d9630;})[_0x0dd1('0x26')](respondWithFilteredResult(_0x373fbe,_0x5782b4))[_0x0dd1('0x45')](handleError(_0x373fbe,null));};exports['show']=function(_0x1b99d6,_0x47ed90){var _0x2768da={'raw':!![],'where':{'id':_0x1b99d6['params']['id']}},_0x57ef34={};_0x57ef34['model']=_[_0x0dd1('0x32')](db[_0x0dd1('0x41')][_0x0dd1('0x2d')]);_0x57ef34[_0x0dd1('0x33')]=_['keys'](_0x1b99d6['query']);_0x57ef34['filters']=_[_0x0dd1('0x35')](_0x57ef34[_0x0dd1('0x31')],_0x57ef34[_0x0dd1('0x33')]);_0x2768da['attributes']=_[_0x0dd1('0x35')](_0x57ef34[_0x0dd1('0x31')],qs[_0x0dd1('0x36')](_0x1b99d6[_0x0dd1('0x33')][_0x0dd1('0x36')]));_0x2768da[_0x0dd1('0x37')]=_0x2768da[_0x0dd1('0x37')]['length']?_0x2768da[_0x0dd1('0x37')]:_0x57ef34[_0x0dd1('0x31')];if(_0x1b99d6[_0x0dd1('0x33')][_0x0dd1('0x42')]){_0x2768da[_0x0dd1('0x43')]=[{'all':!![]}];}_0x2768da=_[_0x0dd1('0x3f')]({},_0x2768da,_0x1b99d6[_0x0dd1('0x46')]);return db[_0x0dd1('0x41')][_0x0dd1('0x47')](_0x2768da)[_0x0dd1('0x26')](handleEntityNotFound(_0x47ed90,null))[_0x0dd1('0x26')](respondWithResult(_0x47ed90,null))[_0x0dd1('0x45')](handleError(_0x47ed90,null));};exports[_0x0dd1('0x48')]=function(_0x3b94d4,_0x290962){return db[_0x0dd1('0x41')][_0x0dd1('0x48')](_0x3b94d4[_0x0dd1('0x49')],{})[_0x0dd1('0x26')](respondWithResult(_0x290962,0xc9))['catch'](handleError(_0x290962,null));};exports[_0x0dd1('0x25')]=function(_0x51e3f3,_0x2dafa2){if(_0x51e3f3[_0x0dd1('0x49')]['id']){delete _0x51e3f3[_0x0dd1('0x49')]['id'];}return db[_0x0dd1('0x41')][_0x0dd1('0x47')]({'where':{'id':_0x51e3f3['params']['id']}})[_0x0dd1('0x26')](handleEntityNotFound(_0x2dafa2,null))['then'](saveUpdates(_0x51e3f3[_0x0dd1('0x49')],null))[_0x0dd1('0x26')](respondWithResult(_0x2dafa2,null))[_0x0dd1('0x45')](handleError(_0x2dafa2,null));};exports[_0x0dd1('0x27')]=function(_0x57f204,_0x4e3729){return db[_0x0dd1('0x41')]['find']({'where':{'id':_0x57f204[_0x0dd1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4e3729,null))[_0x0dd1('0x26')](removeEntity(_0x4e3729,null))[_0x0dd1('0x45')](handleError(_0x4e3729,null));};exports[_0x0dd1('0x4b')]=function(_0x1e0400,_0x21876c){return db['ChatTransferReport'][_0x0dd1('0x4b')]()[_0x0dd1('0x26')](respondWithResult(_0x21876c,null))[_0x0dd1('0x45')](handleError(_0x21876c,null));};
\ No newline at end of file
+var _0xa1ff=['count','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','ChatTransferReport','rawAttributes','type','key','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','show','params','keys','length','merge','create','body','catch','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0xa1ff,0x101));var _0xfa1f=function(_0x483d79,_0x15706b){_0x483d79=_0x483d79-0x0;var _0x54b429=_0xa1ff[_0x483d79];return _0x54b429;};'use strict';var emlformat=require(_0xfa1f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa1f('0x1'));var jsonpatch=require(_0xfa1f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfa1f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfa1f('0x4'));var csv=require(_0xfa1f('0x5'));var ejs=require(_0xfa1f('0x6'));var fs=require('fs');var fs_extra=require(_0xfa1f('0x7'));var _=require(_0xfa1f('0x8'));var squel=require(_0xfa1f('0x9'));var crypto=require('crypto');var jsforce=require(_0xfa1f('0xa'));var deskjs=require(_0xfa1f('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa1f('0xc'));var Papa=require(_0xfa1f('0xd'));var Redis=require('ioredis');var authService=require(_0xfa1f('0xe'));var qs=require(_0xfa1f('0xf'));var as=require(_0xfa1f('0x10'));var hardwareService=require(_0xfa1f('0x11'));var logger=require('../../config/logger')(_0xfa1f('0x12'));var utils=require(_0xfa1f('0x13'));var config=require(_0xfa1f('0x14'));var licenseUtil=require(_0xfa1f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f7b22,_0x428004){_0x428004=_0x428004||0xcc;return function(_0x3b03ac){if(_0x3b03ac){return _0x1f7b22['sendStatus'](_0x428004);}return _0x1f7b22[_0xfa1f('0x16')](_0x428004)['end']();};}function respondWithResult(_0x4df719,_0x11fd0f){_0x11fd0f=_0x11fd0f||0xc8;return function(_0x2b189b){if(_0x2b189b){return _0x4df719[_0xfa1f('0x16')](_0x11fd0f)[_0xfa1f('0x17')](_0x2b189b);}};}function respondWithFilteredResult(_0x4db318,_0x19c27d){return function(_0x3ba8a4){if(_0x3ba8a4){var _0x39e65e=typeof _0x19c27d[_0xfa1f('0x18')]===_0xfa1f('0x19')&&typeof _0x19c27d[_0xfa1f('0x1a')]===_0xfa1f('0x19');var _0x1793eb=_0x3ba8a4['count'];var _0x5816d4=_0x39e65e?0x0:_0x19c27d[_0xfa1f('0x18')];var _0x465785=_0x39e65e?_0x3ba8a4[_0xfa1f('0x1b')]:_0x19c27d[_0xfa1f('0x18')]+_0x19c27d[_0xfa1f('0x1a')];var _0x4537b3;if(_0x465785>=_0x1793eb){_0x465785=_0x1793eb;_0x4537b3=0xc8;}else{_0x4537b3=0xce;}_0x4db318['status'](_0x4537b3);return _0x4db318['set']('Content-Range',_0x5816d4+'-'+_0x465785+'/'+_0x1793eb)['json'](_0x3ba8a4);}return null;};}function patchUpdates(_0x2e15b3){return function(_0x10c661){try{jsonpatch[_0xfa1f('0x1c')](_0x10c661,_0x2e15b3,!![]);}catch(_0x54ff4a){return BPromise[_0xfa1f('0x1d')](_0x54ff4a);}return _0x10c661['save']();};}function saveUpdates(_0x1be753,_0x1c6a1a){return function(_0x40c435){if(_0x40c435){return _0x40c435[_0xfa1f('0x1e')](_0x1be753)[_0xfa1f('0x1f')](function(_0x2f9a43){return _0x2f9a43;});}return null;};}function removeEntity(_0x25a1e6,_0x52031d){return function(_0xb34751){if(_0xb34751){return _0xb34751[_0xfa1f('0x20')]()[_0xfa1f('0x1f')](function(){_0x25a1e6['status'](0xcc)[_0xfa1f('0x21')]();});}};}function handleEntityNotFound(_0x5d270c,_0xf062a9){return function(_0x4918c2){if(!_0x4918c2){_0x5d270c[_0xfa1f('0x22')](0x194);}return _0x4918c2;};}function handleError(_0x34e3e2,_0x82cfef){_0x82cfef=_0x82cfef||0x1f4;return function(_0x36143f){logger[_0xfa1f('0x23')](_0x36143f[_0xfa1f('0x24')]);if(_0x36143f['name']){delete _0x36143f[_0xfa1f('0x25')];}_0x34e3e2[_0xfa1f('0x16')](_0x82cfef)[_0xfa1f('0x26')](_0x36143f);};}exports['index']=function(_0xcd34fa,_0x1d2f1c){var _0x3f1877={},_0x4193f6={},_0x164d26={'count':0x0,'rows':[]};var _0x709ec5=_[_0xfa1f('0x27')](db[_0xfa1f('0x28')][_0xfa1f('0x29')],function(_0x51b352){return{'name':_0x51b352['fieldName'],'type':_0x51b352[_0xfa1f('0x2a')][_0xfa1f('0x2b')]};});_0x4193f6['model']=_[_0xfa1f('0x27')](_0x709ec5,'name');_0x4193f6[_0xfa1f('0x2c')]=_['keys'](_0xcd34fa[_0xfa1f('0x2c')]);_0x4193f6['filters']=_['intersection'](_0x4193f6[_0xfa1f('0x2d')],_0x4193f6[_0xfa1f('0x2c')]);_0x3f1877[_0xfa1f('0x2e')]=_[_0xfa1f('0x2f')](_0x4193f6['model'],qs[_0xfa1f('0x30')](_0xcd34fa[_0xfa1f('0x2c')][_0xfa1f('0x30')]));_0x3f1877[_0xfa1f('0x2e')]=_0x3f1877[_0xfa1f('0x2e')]['length']?_0x3f1877[_0xfa1f('0x2e')]:_0x4193f6[_0xfa1f('0x2d')];if(!_0xcd34fa['query'][_0xfa1f('0x31')](_0xfa1f('0x32'))){_0x3f1877[_0xfa1f('0x1a')]=qs[_0xfa1f('0x1a')](_0xcd34fa[_0xfa1f('0x2c')]['limit']);_0x3f1877['offset']=qs[_0xfa1f('0x18')](_0xcd34fa[_0xfa1f('0x2c')][_0xfa1f('0x18')]);}_0x3f1877[_0xfa1f('0x33')]=qs[_0xfa1f('0x34')](_0xcd34fa[_0xfa1f('0x2c')][_0xfa1f('0x34')]);_0x3f1877[_0xfa1f('0x35')]=qs[_0xfa1f('0x36')](_[_0xfa1f('0x37')](_0xcd34fa['query'],_0x4193f6[_0xfa1f('0x36')]),_0x709ec5);if(_0xcd34fa[_0xfa1f('0x2c')][_0xfa1f('0x38')]){_0x3f1877[_0xfa1f('0x35')]=_['merge'](_0x3f1877[_0xfa1f('0x35')],{'$or':_[_0xfa1f('0x27')](_0x709ec5,function(_0x2f85a6){if(_0x2f85a6['type']!=='VIRTUAL'){var _0x1c3054={};_0x1c3054[_0x2f85a6[_0xfa1f('0x25')]]={'$like':'%'+_0xcd34fa[_0xfa1f('0x2c')][_0xfa1f('0x38')]+'%'};return _0x1c3054;}})});}_0x3f1877=_['merge']({},_0x3f1877,_0xcd34fa[_0xfa1f('0x39')]);var _0x544189={'where':_0x3f1877[_0xfa1f('0x35')]};return db[_0xfa1f('0x28')]['count'](_0x544189)[_0xfa1f('0x1f')](function(_0xdd78b9){_0x164d26[_0xfa1f('0x1b')]=_0xdd78b9;if(_0xcd34fa[_0xfa1f('0x2c')][_0xfa1f('0x3a')]){_0x3f1877[_0xfa1f('0x3b')]=[{'all':!![]}];}return db[_0xfa1f('0x28')][_0xfa1f('0x3c')](_0x3f1877);})[_0xfa1f('0x1f')](function(_0x253e4b){_0x164d26['rows']=_0x253e4b;return _0x164d26;})['then'](respondWithFilteredResult(_0x1d2f1c,_0x3f1877))['catch'](handleError(_0x1d2f1c,null));};exports[_0xfa1f('0x3d')]=function(_0x496240,_0x1515ef){var _0x405b8c={'raw':!![],'where':{'id':_0x496240[_0xfa1f('0x3e')]['id']}},_0x3cb5f7={};_0x3cb5f7[_0xfa1f('0x2d')]=_[_0xfa1f('0x3f')](db['ChatTransferReport'][_0xfa1f('0x29')]);_0x3cb5f7[_0xfa1f('0x2c')]=_[_0xfa1f('0x3f')](_0x496240[_0xfa1f('0x2c')]);_0x3cb5f7[_0xfa1f('0x36')]=_[_0xfa1f('0x2f')](_0x3cb5f7[_0xfa1f('0x2d')],_0x3cb5f7[_0xfa1f('0x2c')]);_0x405b8c[_0xfa1f('0x2e')]=_[_0xfa1f('0x2f')](_0x3cb5f7[_0xfa1f('0x2d')],qs[_0xfa1f('0x30')](_0x496240[_0xfa1f('0x2c')][_0xfa1f('0x30')]));_0x405b8c['attributes']=_0x405b8c[_0xfa1f('0x2e')][_0xfa1f('0x40')]?_0x405b8c[_0xfa1f('0x2e')]:_0x3cb5f7['model'];if(_0x496240[_0xfa1f('0x2c')][_0xfa1f('0x3a')]){_0x405b8c[_0xfa1f('0x3b')]=[{'all':!![]}];}_0x405b8c=_[_0xfa1f('0x41')]({},_0x405b8c,_0x496240[_0xfa1f('0x39')]);return db[_0xfa1f('0x28')]['find'](_0x405b8c)[_0xfa1f('0x1f')](handleEntityNotFound(_0x1515ef,null))[_0xfa1f('0x1f')](respondWithResult(_0x1515ef,null))['catch'](handleError(_0x1515ef,null));};exports[_0xfa1f('0x42')]=function(_0x2e52b9,_0x4f3727){return db[_0xfa1f('0x28')][_0xfa1f('0x42')](_0x2e52b9[_0xfa1f('0x43')],{})['then'](respondWithResult(_0x4f3727,0xc9))[_0xfa1f('0x44')](handleError(_0x4f3727,null));};exports[_0xfa1f('0x1e')]=function(_0x5b2ab9,_0x22a32b){if(_0x5b2ab9[_0xfa1f('0x43')]['id']){delete _0x5b2ab9[_0xfa1f('0x43')]['id'];}return db['ChatTransferReport'][_0xfa1f('0x45')]({'where':{'id':_0x5b2ab9[_0xfa1f('0x3e')]['id']}})[_0xfa1f('0x1f')](handleEntityNotFound(_0x22a32b,null))[_0xfa1f('0x1f')](saveUpdates(_0x5b2ab9[_0xfa1f('0x43')],null))[_0xfa1f('0x1f')](respondWithResult(_0x22a32b,null))[_0xfa1f('0x44')](handleError(_0x22a32b,null));};exports[_0xfa1f('0x20')]=function(_0x1754a8,_0x391bcc){return db[_0xfa1f('0x28')][_0xfa1f('0x45')]({'where':{'id':_0x1754a8[_0xfa1f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x391bcc,null))['then'](removeEntity(_0x391bcc,null))[_0xfa1f('0x44')](handleError(_0x391bcc,null));};exports[_0xfa1f('0x46')]=function(_0x5bf2bb,_0x5baa9e){return db[_0xfa1f('0x28')][_0xfa1f('0x46')]()[_0xfa1f('0x1f')](respondWithResult(_0x5baa9e,null))[_0xfa1f('0x44')](handleError(_0x5baa9e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 71ac0f2..1977cfb 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70d6=['bluebird','request-promise','path','../../config/environment','define','uniqueid','lodash','util','../../config/logger','api'];(function(_0xeb56e0,_0x242ed0){var _0xc9e71d=function(_0x33f60c){while(--_0x33f60c){_0xeb56e0['push'](_0xeb56e0['shift']());}};_0xc9e71d(++_0x242ed0);}(_0x70d6,0x10a));var _0x670d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x70d6[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x670d('0x0'));var util=require(_0x670d('0x1'));var logger=require(_0x670d('0x2'))(_0x670d('0x3'));var moment=require('moment');var BPromise=require(_0x670d('0x4'));var rp=require(_0x670d('0x5'));var fs=require('fs');var path=require(_0x670d('0x6'));var rimraf=require('rimraf');var config=require(_0x670d('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x5b2432,_0xc951b2){return _0x5b2432[_0x670d('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x670d('0x9'),'fields':[_0x670d('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb62=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xcb62,0x108));var _0x2cb6=function(_0x38b6c7,_0x3b8628){_0x38b6c7=_0x38b6c7-0x0;var _0x18cead=_0xcb62[_0x38b6c7];return _0x18cead;};'use strict';var _=require('lodash');var util=require(_0x2cb6('0x0'));var logger=require(_0x2cb6('0x1'))(_0x2cb6('0x2'));var moment=require('moment');var BPromise=require(_0x2cb6('0x3'));var rp=require(_0x2cb6('0x4'));var fs=require('fs');var path=require(_0x2cb6('0x5'));var rimraf=require(_0x2cb6('0x6'));var config=require(_0x2cb6('0x7'));var attributes=require(_0x2cb6('0x8'));module['exports']=function(_0x3250dc,_0x26c373){return _0x3250dc[_0x2cb6('0x9')]('ChatTransferReport',attributes,{'tableName':_0x2cb6('0xa'),'paranoid':![],'indexes':[{'name':_0x2cb6('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 5b229d2..2cdf08e 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedbb=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4b34f0,_0x5913dd){var _0x2fa2d2=function(_0x23da5c){while(--_0x23da5c){_0x4b34f0['push'](_0x4b34f0['shift']());}};_0x2fa2d2(++_0x5913dd);}(_0xedbb,0x150));var _0xbedb=function(_0x4966b8,_0x45cb3f){_0x4966b8=_0x4966b8-0x0;var _0x311109=_0xedbb[_0x4966b8];return _0x311109;};'use strict';var _=require(_0xbedb('0x0'));var util=require(_0xbedb('0x1'));var moment=require(_0xbedb('0x2'));var BPromise=require(_0xbedb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbedb('0x4'));var db=require(_0xbedb('0x5'))['db'];var utils=require(_0xbedb('0x6'));var logger=require(_0xbedb('0x7'))('rpc');var config=require(_0xbedb('0x8'));var jayson=require(_0xbedb('0x9'));var client=jayson[_0xbedb('0xa')][_0xbedb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24056e,_0x348cc0,_0x1629b6){return new BPromise(function(_0x1021a1,_0x19487c){return client['request'](_0x24056e,_0x1629b6)[_0xbedb('0xc')](function(_0x5508c8){logger[_0xbedb('0xd')](_0xbedb('0xe'),_0x348cc0,_0xbedb('0xf'));logger[_0xbedb('0x10')](_0xbedb('0x11'),_0x348cc0,_0xbedb('0xf'),JSON['stringify'](_0x5508c8));if(_0x5508c8[_0xbedb('0x12')]){if(_0x5508c8[_0xbedb('0x12')][_0xbedb('0x13')]===0x1f4){logger[_0xbedb('0x12')](_0xbedb('0xe'),_0x348cc0,_0x5508c8['error'][_0xbedb('0x14')]);return _0x19487c(_0x5508c8[_0xbedb('0x12')]['message']);}logger['error'](_0xbedb('0xe'),_0x348cc0,_0x5508c8[_0xbedb('0x12')][_0xbedb('0x14')]);return _0x1021a1(_0x5508c8[_0xbedb('0x12')][_0xbedb('0x14')]);}else{logger[_0xbedb('0xd')](_0xbedb('0xe'),_0x348cc0,_0xbedb('0xf'));_0x1021a1(_0x5508c8['result']['message']);}})[_0xbedb('0x15')](function(_0x3d812b){logger[_0xbedb('0x12')](_0xbedb('0xe'),_0x348cc0,_0x3d812b);_0x19487c(_0x3d812b);});});}
\ No newline at end of file
+var _0x5ff2=['lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2513c7,_0x30ca8f){var _0x51d34b=function(_0x35937e){while(--_0x35937e){_0x2513c7['push'](_0x2513c7['shift']());}};_0x51d34b(++_0x30ca8f);}(_0x5ff2,0x17c));var _0x25ff=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x5ff2[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require(_0x25ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25ff('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x25ff('0x2'))(_0x25ff('0x3'));var config=require(_0x25ff('0x4'));var jayson=require(_0x25ff('0x5'));var client=jayson['client'][_0x25ff('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x306dba,_0x1b0fed,_0x17f85e){return new BPromise(function(_0x18e00c,_0x31912b){return client[_0x25ff('0x7')](_0x306dba,_0x17f85e)['then'](function(_0x3ea5d2){logger[_0x25ff('0x8')](_0x25ff('0x9'),_0x1b0fed,_0x25ff('0xa'));logger[_0x25ff('0xb')](_0x25ff('0xc'),_0x1b0fed,'request\x20sent',JSON[_0x25ff('0xd')](_0x3ea5d2));if(_0x3ea5d2[_0x25ff('0xe')]){if(_0x3ea5d2[_0x25ff('0xe')][_0x25ff('0xf')]===0x1f4){logger[_0x25ff('0xe')](_0x25ff('0x9'),_0x1b0fed,_0x3ea5d2[_0x25ff('0xe')][_0x25ff('0x10')]);return _0x31912b(_0x3ea5d2[_0x25ff('0xe')][_0x25ff('0x10')]);}logger['error'](_0x25ff('0x9'),_0x1b0fed,_0x3ea5d2[_0x25ff('0xe')][_0x25ff('0x10')]);return _0x18e00c(_0x3ea5d2[_0x25ff('0xe')][_0x25ff('0x10')]);}else{logger['info'](_0x25ff('0x9'),_0x1b0fed,_0x25ff('0xa'));_0x18e00c(_0x3ea5d2[_0x25ff('0x11')]['message']);}})[_0x25ff('0x12')](function(_0x506eb8){logger[_0x25ff('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x1b0fed,_0x506eb8);_0x31912b(_0x506eb8);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 3c41841..d55f277 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbbfc=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put'];(function(_0x2aa727,_0x396eb6){var _0x286d36=function(_0x13318f){while(--_0x13318f){_0x2aa727['push'](_0x2aa727['shift']());}};_0x286d36(++_0x396eb6);}(_0xbbfc,0x17f));var _0xcbbf=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xbbfc[_0x377a6e];return _0x37f751;};'use strict';var multer=require(_0xcbbf('0x0'));var util=require('util');var path=require(_0xcbbf('0x1'));var timeout=require('connect-timeout');var express=require(_0xcbbf('0x2'));var router=express[_0xcbbf('0x3')]();var fs_extra=require(_0xcbbf('0x4'));var auth=require(_0xcbbf('0x5'));var interaction=require(_0xcbbf('0x6'));var config=require(_0xcbbf('0x7'));var controller=require(_0xcbbf('0x8'));router['get']('/',auth[_0xcbbf('0x9')](),controller[_0xcbbf('0xa')]);router[_0xcbbf('0xb')](_0xcbbf('0xc'),auth[_0xcbbf('0x9')](),controller[_0xcbbf('0xd')]);router[_0xcbbf('0xb')](_0xcbbf('0xe'),auth[_0xcbbf('0x9')](),controller[_0xcbbf('0xf')]);router['post']('/',auth[_0xcbbf('0x9')](),controller['create']);router[_0xcbbf('0x10')](_0xcbbf('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xcbbf('0x11')](_0xcbbf('0xe'),auth[_0xcbbf('0x9')](),controller[_0xcbbf('0x12')]);module[_0xcbbf('0x13')]=router;
\ No newline at end of file
+var _0x7bec=['index','/describe','isAuthenticated','describe','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x7bec,0x19a));var _0xc7be=function(_0x1ba894,_0x1bdcdd){_0x1ba894=_0x1ba894-0x0;var _0x1e705d=_0x7bec[_0x1ba894];return _0x1e705d;};'use strict';var multer=require(_0xc7be('0x0'));var util=require(_0xc7be('0x1'));var path=require(_0xc7be('0x2'));var timeout=require(_0xc7be('0x3'));var express=require(_0xc7be('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc7be('0x5'));var interaction=require(_0xc7be('0x6'));var config=require(_0xc7be('0x7'));var controller=require(_0xc7be('0x8'));router[_0xc7be('0x9')]('/',auth['isAuthenticated'](),controller[_0xc7be('0xa')]);router[_0xc7be('0x9')](_0xc7be('0xb'),auth[_0xc7be('0xc')](),controller[_0xc7be('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc7be('0xe')]('/',auth[_0xc7be('0xc')](),controller['create']);router[_0xc7be('0xf')](_0xc7be('0x10'),auth[_0xc7be('0xc')](),controller[_0xc7be('0x11')]);router[_0xc7be('0x12')](_0xc7be('0x10'),auth[_0xc7be('0xc')](),controller[_0xc7be('0x13')]);module[_0xc7be('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a21425d..de00ded 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x508e2a,_0x392ea1){var _0x18f170=function(_0x4047fc){while(--_0x4047fc){_0x508e2a['push'](_0x508e2a['shift']());}};_0x18f170(++_0x392ea1);}(_0x55e0,0xdc));var _0x055e=function(_0x5340fb,_0x53d5a2){_0x5340fb=_0x5340fb-0x0;var _0x35701e=_0x55e0[_0x5340fb];return _0x35701e;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}};
\ No newline at end of file
+var _0x0713=['offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x3071('0x0')]={'name':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'unique':_0x3071('0x2')},'description':{'type':Sequelize[_0x3071('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x3')},'mapKeyOffline':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x3')},'key':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x4')},'customerAlias':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3071('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3071('0x1')]},'animation':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3071('0x9')]('rounded',_0x3071('0xa')),'defaultValue':_0x3071('0xb')},'header_online':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0xc')},'start_chat_button':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0xe')},'download_transcript':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3071('0xf')]},'closingQuestion':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x12')},'noteTitle':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x14')},'closingMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x15')},'closingMessageButton':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0xd')},'skipMessageButton':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x16')},'conditionAgreement':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3071('0x9')]('star',_0x3071('0x17')),'defaultValue':_0x3071('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3071('0xf')],'defaultValue':function(){return JSON[_0x3071('0x19')]({'items':[{'type':_0x3071('0x1a'),'variable':null,'config':{'placeholder':_0x3071('0x1b'),'type':_0x3071('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x3071('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x3071('0x3'),'type':_0x3071('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3071('0x1d')](_0x3071('0x1e'))?JSON[_0x3071('0x1f')](this[_0x3071('0x1d')](_0x3071('0x1e'))):{};},'set':function(_0x1de5fb){return this['setDataValue'](_0x3071('0x1e'),JSON[_0x3071('0x19')](_0x1de5fb));}},'offlineForm':{'type':Sequelize[_0x3071('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3071('0x1a'),'props':{'title':_0x3071('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x3071('0x3'),'type':_0x3071('0x3')},'variable':null},{'type':_0x3071('0x20'),'config':{'placeholder':_0x3071('0x21')},'props':{'title':_0x3071('0x21'),'helpText':_0x3071('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x3071('0x1d')](_0x3071('0x23'))?JSON[_0x3071('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x9e26d1){return this[_0x3071('0x24')](_0x3071('0x23'),JSON[_0x3071('0x19')](_0x9e26d1));}},'token':{'type':Sequelize[_0x3071('0x1')],'defaultValue':function(){return rs[_0x3071('0x25')]();}},'autoclose':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3071('0x1')]},'waitingTitle':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x16')},'sendUnmanaged':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3071('0x1')]},'notificationTemplate':{'type':Sequelize[_0x3071('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3071('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2b')},'verticalAlignment':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2d')},'defaultTitle':{'type':Sequelize[_0x3071('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3071('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3071('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2f')},'systemAvatar':{'type':Sequelize[_0x3071('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3071('0x7')],'comment':_0x3071('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x53ed25){if(!_0x53ed25)this[_0x3071('0x24')](_0x3071('0x31'),null);this[_0x3071('0x24')](_0x3071('0x32'),_0x53ed25);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3071('0x1')]},'vidaooTopic':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x33')},'vidaooNote':{'type':Sequelize[_0x3071('0x1')],'defaultValue':function(){return _0x3071('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x3071('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3071('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 070495b..8a0a634 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f6a=['keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','intersection','include','find','create','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sitepic','addAvatar','agentAvatar','file','filename','addCustomerAvatar','addSystemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','contact','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','*,*,*,*','Start','startRouting','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','basename','sequelize','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','mapValues','offlineMessageSubject','Chat','notifyMail','server','attachments','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','increment','push','all','server/files/chat/iframe.ejs','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','update','destroy','get','ChatWebsites','end','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model'];(function(_0x36c4bb,_0x287df6){var _0x37846b=function(_0x4b3c0f){while(--_0x4b3c0f){_0x36c4bb['push'](_0x36c4bb['shift']());}};_0x37846b(++_0x287df6);}(_0x9f6a,0xe8));var _0xa9f6=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x9f6a[_0x1fc18b];return _0x16a351;};'use strict';var BPromise=require(_0xa9f6('0x0'));var Mustache=require(_0xa9f6('0x1'));var util=require(_0xa9f6('0x2'));var path=require(_0xa9f6('0x3'));var ejs=require(_0xa9f6('0x4'));var fs=require('fs');var fs_extra=require(_0xa9f6('0x5'));var _=require(_0xa9f6('0x6'));var querystring=require(_0xa9f6('0x7'));var Redis=require(_0xa9f6('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xa9f6('0x9'))(_0xa9f6('0xa'));var config=require(_0xa9f6('0xb'));var db=require(_0xa9f6('0xc'))['db'];config[_0xa9f6('0xd')]=_[_0xa9f6('0xe')](config['redis'],{'host':_0xa9f6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9f6('0xd')]));require(_0xa9f6('0x10'))[_0xa9f6('0x11')](socket);var htmlToText=require(_0xa9f6('0x12'));var jayson=require(_0xa9f6('0x13'));var client=jayson[_0xa9f6('0x14')][_0xa9f6('0x15')]({'port':0x232c});var client9002=jayson[_0xa9f6('0x14')][_0xa9f6('0x15')]({'port':0x232a});var client9003=jayson[_0xa9f6('0x14')][_0xa9f6('0x15')]({'port':0x232b});var client9001=jayson[_0xa9f6('0x14')][_0xa9f6('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x331618,_0x40cf72,_0x3b8a8b,_0x597a51){return new BPromise(function(_0x2b896e,_0x1026e8){var _0x31f99b=_0x597a51||client;return _0x31f99b[_0xa9f6('0x16')](_0x331618,_0x3b8a8b)[_0xa9f6('0x17')](function(_0x5fb15a){logger[_0xa9f6('0x18')](_0xa9f6('0x19'),_0x40cf72,_0xa9f6('0x1a'));logger['debug'](_0xa9f6('0x1b'),_0x40cf72,'request\x20sent',JSON[_0xa9f6('0x1c')](_0x5fb15a));if(_0x5fb15a['error']){if(_0x5fb15a[_0xa9f6('0x1d')][_0xa9f6('0x1e')]===0x1f4){logger[_0xa9f6('0x1d')](_0xa9f6('0x19'),_0x40cf72,_0x5fb15a[_0xa9f6('0x1d')][_0xa9f6('0x1f')]);return _0x1026e8(_0x5fb15a[_0xa9f6('0x1d')][_0xa9f6('0x1f')]);}logger[_0xa9f6('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x40cf72,_0x5fb15a[_0xa9f6('0x1d')][_0xa9f6('0x1f')]);return _0x2b896e(_0x5fb15a['error'][_0xa9f6('0x1f')]);}else{logger['info'](_0xa9f6('0x19'),_0x40cf72,_0xa9f6('0x1a'));_0x2b896e(_0x5fb15a[_0xa9f6('0x20')]['message']);}})[_0xa9f6('0x21')](function(_0x29ab13){logger[_0xa9f6('0x1d')](_0xa9f6('0x19'),_0x40cf72,_0x29ab13);_0x1026e8(_0x29ab13);});});}function respondWithStatusCode(_0x48af38,_0x2ea271){_0x2ea271=_0x2ea271||0xcc;return function(_0xe128dc){if(_0xe128dc){return _0x48af38[_0xa9f6('0x22')](_0x2ea271);}return _0x48af38[_0xa9f6('0x23')](_0x2ea271)['end']();};}function respondWithResult(_0x35aa70,_0x487718){_0x487718=_0x487718||0xc8;return function(_0x57809a){if(_0x57809a){return _0x35aa70[_0xa9f6('0x23')](_0x487718)[_0xa9f6('0x24')](_0x57809a);}};}function respondWithFilteredResult(_0x5cdf92,_0x514a12){return function(_0x5d90d2){if(_0x5d90d2){var _0xc85ca8=typeof _0x514a12[_0xa9f6('0x25')]===_0xa9f6('0x26')&&typeof _0x514a12[_0xa9f6('0x27')]===_0xa9f6('0x26');var _0x479633=_0x5d90d2['count'];var _0x39194f=_0xc85ca8?0x0:_0x514a12[_0xa9f6('0x25')];var _0x51b5b4=_0xc85ca8?_0x5d90d2[_0xa9f6('0x28')]:_0x514a12[_0xa9f6('0x25')]+_0x514a12[_0xa9f6('0x27')];var _0x52a896;if(_0x51b5b4>=_0x479633){_0x51b5b4=_0x479633;_0x52a896=0xc8;}else{_0x52a896=0xce;}_0x5cdf92[_0xa9f6('0x23')](_0x52a896);return _0x5cdf92['set']('Content-Range',_0x39194f+'-'+_0x51b5b4+'/'+_0x479633)['json'](_0x5d90d2);}return null;};}function saveUpdates(_0x44de2e){return function(_0x2482c6){if(_0x2482c6){return _0x2482c6[_0xa9f6('0x29')](_0x44de2e)[_0xa9f6('0x17')](function(_0x1ddf8f){return _0x1ddf8f;});}return null;};}function removeEntity(_0x2d1119){return function(_0x15b349){if(_0x15b349){return _0x15b349[_0xa9f6('0x2a')]()[_0xa9f6('0x17')](function(){var _0xed4602=_0x15b349[_0xa9f6('0x2b')]({'plain':!![]});var _0x4383d9=_0xa9f6('0x2c');return db['UserProfileResource'][_0xa9f6('0x2a')]({'where':{'type':_0x4383d9,'resourceId':_0xed4602['id']}})[_0xa9f6('0x17')](function(){return _0x15b349;});})[_0xa9f6('0x17')](function(){_0x2d1119[_0xa9f6('0x23')](0xcc)[_0xa9f6('0x2d')]();});}};}function handleEntityNotFound(_0x419c99){return function(_0x216995){if(!_0x216995){_0x419c99['sendStatus'](0x194);}return _0x216995;};}function handleError(_0x44349f,_0x2bfefd){_0x2bfefd=_0x2bfefd||0x1f4;return function(_0x71f0e5){logger[_0xa9f6('0x1d')](_0x71f0e5[_0xa9f6('0x2e')]);if(_0x71f0e5[_0xa9f6('0x2f')]){delete _0x71f0e5['name'];}_0x44349f[_0xa9f6('0x23')](_0x2bfefd)['send'](_0x71f0e5);};}exports[_0xa9f6('0x30')]=function(_0x36b222,_0xbd44f1){var _0x221151={'include':[{'model':db[_0xa9f6('0x31')],'as':_0xa9f6('0x32')}]},_0x419264={},_0x43f05a={'count':0x0,'rows':[]};var _0x26e22b=_[_0xa9f6('0x33')](db[_0xa9f6('0x34')][_0xa9f6('0x35')],function(_0x537aeb){return{'name':_0x537aeb[_0xa9f6('0x36')],'type':_0x537aeb[_0xa9f6('0x37')]['key']};});_0x419264[_0xa9f6('0x38')]=_[_0xa9f6('0x33')](_0x26e22b,_0xa9f6('0x2f'));_0x419264['query']=_[_0xa9f6('0x39')](_0x36b222[_0xa9f6('0x3a')]);_0x419264[_0xa9f6('0x3b')]=_['intersection'](_0x419264[_0xa9f6('0x38')],_0x419264[_0xa9f6('0x3a')]);_0x221151[_0xa9f6('0x3c')]=_['intersection'](_0x419264[_0xa9f6('0x38')],qs[_0xa9f6('0x3d')](_0x36b222['query'][_0xa9f6('0x3d')]));_0x221151[_0xa9f6('0x3c')]=_0x221151[_0xa9f6('0x3c')][_0xa9f6('0x3e')]?_0x221151[_0xa9f6('0x3c')]:_0x419264[_0xa9f6('0x38')];if(!_0x36b222[_0xa9f6('0x3a')][_0xa9f6('0x3f')](_0xa9f6('0x40'))){_0x221151['limit']=qs[_0xa9f6('0x27')](_0x36b222['query'][_0xa9f6('0x27')]);_0x221151[_0xa9f6('0x25')]=qs[_0xa9f6('0x25')](_0x36b222['query'][_0xa9f6('0x25')]);}_0x221151[_0xa9f6('0x41')]=qs['sort'](_0x36b222[_0xa9f6('0x3a')][_0xa9f6('0x42')]);_0x221151[_0xa9f6('0x43')]=qs[_0xa9f6('0x3b')](_[_0xa9f6('0x44')](_0x36b222[_0xa9f6('0x3a')],_0x419264[_0xa9f6('0x3b')]),_0x26e22b);if(_0x36b222['query'][_0xa9f6('0x45')]){_0x221151[_0xa9f6('0x43')]=_['merge'](_0x221151[_0xa9f6('0x43')],{'$or':_['map'](_0x26e22b,function(_0x5b296a){if(_0x5b296a[_0xa9f6('0x37')]!=='VIRTUAL'){var _0x229bdf={};_0x229bdf[_0x5b296a[_0xa9f6('0x2f')]]={'$like':'%'+_0x36b222['query'][_0xa9f6('0x45')]+'%'};return _0x229bdf;}})});}_0x221151=_[_0xa9f6('0x46')]({},_0x221151,_0x36b222[_0xa9f6('0x47')]);var _0x1ec70e={'where':_0x221151[_0xa9f6('0x43')]};return db[_0xa9f6('0x34')]['count'](_0x1ec70e)['then'](function(_0x356ba4){_0x43f05a[_0xa9f6('0x28')]=_0x356ba4;if(_0x36b222[_0xa9f6('0x3a')][_0xa9f6('0x48')]){_0x221151['include']=[{'all':!![]}];}return db[_0xa9f6('0x34')][_0xa9f6('0x49')](_0x221151);})[_0xa9f6('0x17')](function(_0x406efb){_0x43f05a['rows']=_0x406efb;return _0x43f05a;})['then'](respondWithFilteredResult(_0xbd44f1,_0x221151))[_0xa9f6('0x21')](handleError(_0xbd44f1,null));};exports[_0xa9f6('0x4a')]=function(_0x33b980,_0x8e3724){var _0x5941c6={'raw':![],'where':{'id':_0x33b980[_0xa9f6('0x4b')]['id']},'include':[{'model':db[_0xa9f6('0x31')],'as':_0xa9f6('0x32')}]},_0x449db3={};_0x449db3[_0xa9f6('0x38')]=_[_0xa9f6('0x39')](db['ChatWebsite'][_0xa9f6('0x35')]);_0x449db3['query']=_[_0xa9f6('0x39')](_0x33b980[_0xa9f6('0x3a')]);_0x449db3['filters']=_[_0xa9f6('0x4c')](_0x449db3[_0xa9f6('0x38')],_0x449db3['query']);_0x5941c6[_0xa9f6('0x3c')]=_[_0xa9f6('0x4c')](_0x449db3[_0xa9f6('0x38')],qs[_0xa9f6('0x3d')](_0x33b980['query']['fields']));_0x5941c6[_0xa9f6('0x3c')]=_0x5941c6[_0xa9f6('0x3c')]['length']?_0x5941c6[_0xa9f6('0x3c')]:_0x449db3['model'];if(_0x33b980[_0xa9f6('0x3a')][_0xa9f6('0x48')]){_0x5941c6[_0xa9f6('0x4d')]=[{'all':!![]}];}_0x5941c6=_[_0xa9f6('0x46')]({},_0x5941c6,_0x33b980['options']);return db[_0xa9f6('0x34')][_0xa9f6('0x4e')](_0x5941c6)['then'](handleEntityNotFound(_0x8e3724,null))['then'](respondWithResult(_0x8e3724,null))[_0xa9f6('0x21')](handleError(_0x8e3724,null));};exports[_0xa9f6('0x4f')]=function(_0x347aed,_0x2b005d){return db['ChatWebsite'][_0xa9f6('0x4f')](_0x347aed['body'],{})[_0xa9f6('0x17')](function(_0x2d2a54){var _0x2c4cbc=_0x347aed[_0xa9f6('0x50')]['get']({'plain':!![]});if(!_0x2c4cbc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c4cbc['role']==='user'){var _0x3908ed=_0x2d2a54[_0xa9f6('0x2b')]({'plain':!![]});var _0x18ce4b=_0xa9f6('0x2c');return db[_0xa9f6('0x51')]['find']({'where':{'name':_0x18ce4b,'userProfileId':_0x2c4cbc[_0xa9f6('0x52')]},'raw':!![]})[_0xa9f6('0x17')](function(_0x436f5e){if(_0x436f5e&&_0x436f5e['autoAssociation']===0x0){return db[_0xa9f6('0x53')][_0xa9f6('0x4f')]({'name':_0x3908ed['name'],'resourceId':_0x3908ed['id'],'type':_0x436f5e['name'],'sectionId':_0x436f5e['id']},{})[_0xa9f6('0x17')](function(){return _0x2d2a54;});}else{return _0x2d2a54;}})[_0xa9f6('0x21')](function(_0x14c216){logger[_0xa9f6('0x1d')](_0xa9f6('0x54'),_0x14c216);throw _0x14c216;});}return _0x2d2a54;})['then'](respondWithResult(_0x2b005d,0xc9))[_0xa9f6('0x21')](handleError(_0x2b005d,null));};exports[_0xa9f6('0x29')]=function(_0x3d754c,_0x4ae163){if(_0x3d754c[_0xa9f6('0x55')]['id']){delete _0x3d754c[_0xa9f6('0x55')]['id'];}return db[_0xa9f6('0x34')]['find']({'where':{'id':_0x3d754c[_0xa9f6('0x4b')]['id']},'include':[{'model':db[_0xa9f6('0x31')],'as':_0xa9f6('0x32')}]})[_0xa9f6('0x17')](handleEntityNotFound(_0x4ae163,null))[_0xa9f6('0x17')](saveUpdates(_0x3d754c[_0xa9f6('0x55')],null))[_0xa9f6('0x17')](respondWithResult(_0x4ae163,null))[_0xa9f6('0x21')](handleError(_0x4ae163,null));};exports['destroy']=function(_0x20daa3,_0x5704de){return db['ChatWebsite']['find']({'where':{'id':_0x20daa3[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x5704de,null))[_0xa9f6('0x17')](removeEntity(_0x5704de,null))[_0xa9f6('0x21')](handleError(_0x5704de,null));};exports[_0xa9f6('0x56')]=function(_0x5a7b54,_0x53761a){return db[_0xa9f6('0x34')][_0xa9f6('0x56')]()[_0xa9f6('0x17')](respondWithResult(_0x53761a,null))['catch'](handleError(_0x53761a,null));};exports[_0xa9f6('0x57')]=function(_0xa421f2,_0x372339){if(_0xa421f2['body']['id']){delete _0xa421f2['body']['id'];}return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0xa421f2[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x372339,null))[_0xa9f6('0x17')](function(_0x4e9146){if(_0x4e9146){_0xa421f2[_0xa9f6('0x55')][_0xa9f6('0x58')]=_0x4e9146['id'];return db[_0xa9f6('0x59')][_0xa9f6('0x4f')](_0xa421f2[_0xa9f6('0x55')]);}})[_0xa9f6('0x17')](respondWithResult(_0x372339,null))[_0xa9f6('0x21')](handleError(_0x372339,null));};exports[_0xa9f6('0x5a')]=function(_0x4e1f8c,_0x52da2b){var _0x39ff1b={'raw':![],'where':{}};var _0x48fa7e={};var _0xe1ff2d={'count':0x0,'rows':[]};return db[_0xa9f6('0x34')][_0xa9f6('0x5b')]({'where':{'id':_0x4e1f8c[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x52da2b,null))[_0xa9f6('0x17')](function(_0x1d8f08){if(_0x1d8f08){_0x48fa7e[_0xa9f6('0x38')]=_[_0xa9f6('0x39')](db[_0xa9f6('0x59')][_0xa9f6('0x35')]);_0x48fa7e['query']=_['keys'](_0x4e1f8c[_0xa9f6('0x3a')]);_0x48fa7e[_0xa9f6('0x3b')]=_[_0xa9f6('0x4c')](_0x48fa7e['model'],_0x48fa7e[_0xa9f6('0x3a')]);_0x39ff1b[_0xa9f6('0x3c')]=_[_0xa9f6('0x4c')](_0x48fa7e[_0xa9f6('0x38')],qs['fields'](_0x4e1f8c[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x39ff1b['attributes']=_0x39ff1b[_0xa9f6('0x3c')]['length']?_0x39ff1b['attributes']:_0x48fa7e[_0xa9f6('0x38')];if(!_0x4e1f8c[_0xa9f6('0x3a')][_0xa9f6('0x3f')](_0xa9f6('0x40'))){_0x39ff1b[_0xa9f6('0x27')]=qs[_0xa9f6('0x27')](_0x4e1f8c['query'][_0xa9f6('0x27')]);_0x39ff1b[_0xa9f6('0x25')]=qs[_0xa9f6('0x25')](_0x4e1f8c[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}_0x39ff1b[_0xa9f6('0x41')]=qs[_0xa9f6('0x42')](_0x4e1f8c[_0xa9f6('0x3a')][_0xa9f6('0x42')]);_0x39ff1b['where']=qs[_0xa9f6('0x3b')](_[_0xa9f6('0x44')](_0x4e1f8c[_0xa9f6('0x3a')],_0x48fa7e[_0xa9f6('0x3b')]));_0x39ff1b[_0xa9f6('0x43')][_0xa9f6('0x58')]=_0x1d8f08['id'];if(_0x4e1f8c[_0xa9f6('0x3a')]['filter']){_0x39ff1b[_0xa9f6('0x43')]=_[_0xa9f6('0x46')](_0x39ff1b['where'],{'$or':_['map'](_0x39ff1b[_0xa9f6('0x3c')],function(_0x2a8795){var _0x2cbb6f={};_0x2cbb6f[_0x2a8795]={'$like':'%'+_0x4e1f8c[_0xa9f6('0x3a')]['filter']+'%'};return _0x2cbb6f;})});}_0x39ff1b=_['merge']({},_0x39ff1b,_0x4e1f8c[_0xa9f6('0x47')]);return db[_0xa9f6('0x59')][_0xa9f6('0x28')]({'where':_0x39ff1b[_0xa9f6('0x43')]})[_0xa9f6('0x17')](function(_0x51bedb){_0xe1ff2d[_0xa9f6('0x28')]=_0x51bedb;if(_0x4e1f8c[_0xa9f6('0x3a')][_0xa9f6('0x48')]){_0x39ff1b[_0xa9f6('0x4d')]=[{'all':!![]}];}return db[_0xa9f6('0x59')][_0xa9f6('0x49')](_0x39ff1b);})[_0xa9f6('0x17')](function(_0x2adb4b){_0xe1ff2d[_0xa9f6('0x5c')]=_0x2adb4b;return _0xe1ff2d;});}})[_0xa9f6('0x17')](respondWithFilteredResult(_0x52da2b,_0x39ff1b))[_0xa9f6('0x21')](handleError(_0x52da2b,null));};exports[_0xa9f6('0x5d')]=function(_0x4157b9,_0x5b395d){return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0x4157b9[_0xa9f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b395d,null))[_0xa9f6('0x17')](function(_0x33b3ad){if(_0x33b3ad){return _0x33b3ad[_0xa9f6('0x5d')](_0x4157b9['query'][_0xa9f6('0x5e')]);}})[_0xa9f6('0x17')](respondWithStatusCode(_0x5b395d,null))[_0xa9f6('0x21')](handleError(_0x5b395d,null));};exports['addAnswer']=function(_0x6fadf3,_0x754747){if(_0x6fadf3[_0xa9f6('0x55')]['id']){delete _0x6fadf3[_0xa9f6('0x55')]['id'];}return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0x6fadf3[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x754747,null))[_0xa9f6('0x17')](function(_0x5dbe64){if(_0x5dbe64){_0x6fadf3['body'][_0xa9f6('0x58')]=_0x5dbe64['id'];return db[_0xa9f6('0x5f')][_0xa9f6('0x4f')](_0x6fadf3[_0xa9f6('0x55')]);}})[_0xa9f6('0x17')](respondWithResult(_0x754747,null))[_0xa9f6('0x21')](handleError(_0x754747,null));};exports[_0xa9f6('0x60')]=function(_0x3e1898,_0x9e22e6){var _0x3d5978={'raw':![],'where':{}};var _0x3a2b36={};var _0x515947={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3e1898[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x9e22e6,null))[_0xa9f6('0x17')](function(_0xb8825b){if(_0xb8825b){_0x3a2b36[_0xa9f6('0x38')]=_[_0xa9f6('0x39')](db['CannedAnswer'][_0xa9f6('0x35')]);_0x3a2b36[_0xa9f6('0x3a')]=_['keys'](_0x3e1898['query']);_0x3a2b36[_0xa9f6('0x3b')]=_[_0xa9f6('0x4c')](_0x3a2b36[_0xa9f6('0x38')],_0x3a2b36['query']);_0x3d5978[_0xa9f6('0x3c')]=_[_0xa9f6('0x4c')](_0x3a2b36['model'],qs[_0xa9f6('0x3d')](_0x3e1898[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x3d5978[_0xa9f6('0x3c')]=_0x3d5978[_0xa9f6('0x3c')][_0xa9f6('0x3e')]?_0x3d5978[_0xa9f6('0x3c')]:_0x3a2b36[_0xa9f6('0x38')];if(!_0x3e1898['query'][_0xa9f6('0x3f')]('nolimit')){_0x3d5978[_0xa9f6('0x27')]=qs['limit'](_0x3e1898[_0xa9f6('0x3a')]['limit']);_0x3d5978[_0xa9f6('0x25')]=qs[_0xa9f6('0x25')](_0x3e1898[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}_0x3d5978[_0xa9f6('0x41')]=qs[_0xa9f6('0x42')](_0x3e1898[_0xa9f6('0x3a')][_0xa9f6('0x42')]);_0x3d5978[_0xa9f6('0x43')]=qs['filters'](_['pick'](_0x3e1898[_0xa9f6('0x3a')],_0x3a2b36[_0xa9f6('0x3b')]));_0x3d5978[_0xa9f6('0x43')][_0xa9f6('0x58')]=_0xb8825b['id'];if(_0x3e1898[_0xa9f6('0x3a')]['filter']){_0x3d5978[_0xa9f6('0x43')]=_['merge'](_0x3d5978['where'],{'$or':_[_0xa9f6('0x33')](_0x3d5978[_0xa9f6('0x3c')],function(_0xbc20d9){var _0x2362b1={};_0x2362b1[_0xbc20d9]={'$like':'%'+_0x3e1898[_0xa9f6('0x3a')][_0xa9f6('0x45')]+'%'};return _0x2362b1;})});}_0x3d5978=_['merge']({},_0x3d5978,_0x3e1898[_0xa9f6('0x47')]);return db[_0xa9f6('0x5f')][_0xa9f6('0x28')]({'where':_0x3d5978[_0xa9f6('0x43')]})['then'](function(_0x277b07){_0x515947[_0xa9f6('0x28')]=_0x277b07;if(_0x3e1898[_0xa9f6('0x3a')][_0xa9f6('0x48')]){_0x3d5978['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xa9f6('0x49')](_0x3d5978);})[_0xa9f6('0x17')](function(_0x31c202){_0x515947['rows']=_0x31c202;return _0x515947;});}})[_0xa9f6('0x17')](respondWithFilteredResult(_0x9e22e6,_0x3d5978))[_0xa9f6('0x21')](handleError(_0x9e22e6,null));};exports[_0xa9f6('0x61')]=function(_0x945de,_0x4ebf84){return db['ChatWebsite'][_0xa9f6('0x4e')]({'where':{'id':_0x945de[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x4ebf84,null))[_0xa9f6('0x17')](function(_0x561660){if(_0x561660){return _0x561660[_0xa9f6('0x61')](_0x945de[_0xa9f6('0x3a')][_0xa9f6('0x5e')]);}})['then'](respondWithStatusCode(_0x4ebf84,null))[_0xa9f6('0x21')](handleError(_0x4ebf84,null));};exports['addLogo']=function(_0x513546,_0x1bd4bf){_0x513546[_0xa9f6('0x55')][_0xa9f6('0x62')]=_0x513546['file']['filename'];return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0x513546[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x1bd4bf,null))[_0xa9f6('0x17')](saveUpdates(_0x513546[_0xa9f6('0x55')],null))[_0xa9f6('0x17')](respondWithResult(_0x1bd4bf,null))[_0xa9f6('0x21')](handleError(_0x1bd4bf,null));};exports[_0xa9f6('0x63')]=function(_0xf72926,_0x4a366e){_0xf72926[_0xa9f6('0x55')][_0xa9f6('0x64')]=_0xf72926[_0xa9f6('0x65')][_0xa9f6('0x66')];return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0xf72926[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x4a366e,null))['then'](saveUpdates(_0xf72926['body'],null))[_0xa9f6('0x17')](respondWithResult(_0x4a366e,null))[_0xa9f6('0x21')](handleError(_0x4a366e,null));};exports[_0xa9f6('0x67')]=function(_0x31e8ef,_0x5c2add){_0x31e8ef[_0xa9f6('0x55')]['customerAvatar']=_0x31e8ef['file'][_0xa9f6('0x66')];return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0x31e8ef[_0xa9f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c2add,null))[_0xa9f6('0x17')](saveUpdates(_0x31e8ef['body'],null))['then'](respondWithResult(_0x5c2add,null))[_0xa9f6('0x21')](handleError(_0x5c2add,null));};exports[_0xa9f6('0x68')]=function(_0x3a3504,_0xaab023){_0x3a3504[_0xa9f6('0x55')]['systemAvatar']=_0x3a3504[_0xa9f6('0x65')][_0xa9f6('0x66')];return db[_0xa9f6('0x34')]['find']({'where':{'id':_0x3a3504[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0xaab023,null))['then'](saveUpdates(_0x3a3504[_0xa9f6('0x55')],null))[_0xa9f6('0x17')](respondWithResult(_0xaab023,null))[_0xa9f6('0x21')](handleError(_0xaab023,null));};exports[_0xa9f6('0x69')]=function(_0x177af5,_0x4cd1d3){var _0x48a716=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],'server/files/images/logos/default_logo.svg');var _0x5cf757={'where':{'id':_0x177af5[_0xa9f6('0x4b')]['id']},'attributes':['id',_0xa9f6('0x62')],'raw':!![]};var _0x125c43=![];return require(_0xa9f6('0x6c'))[_0xa9f6('0x6d')]()[_0xa9f6('0x17')](function(_0x82fa3){if(_0x82fa3){_0x125c43=_0x82fa3[_0xa9f6('0x6e')];}})[_0xa9f6('0x17')](function(){return db[_0xa9f6('0x34')][_0xa9f6('0x4e')](_0x5cf757);})[_0xa9f6('0x17')](handleEntityNotFound(_0x4cd1d3,null))['then'](function(_0x3bd0ec){if(_0x3bd0ec){if(!_[_0xa9f6('0x6f')](_0x3bd0ec[_0xa9f6('0x62')])){if(fs[_0xa9f6('0x70')](path['join'](config[_0xa9f6('0x6b')],_0xa9f6('0x71'),_0x3bd0ec['sitepic']))&&_0x125c43){_0x48a716=path['join'](config[_0xa9f6('0x6b')],_0xa9f6('0x71'),_0x3bd0ec['sitepic']);}}return _0x4cd1d3[_0xa9f6('0x72')](_0x48a716);}})['catch'](handleError(_0x4cd1d3,null));};exports[_0xa9f6('0x73')]=function(_0x4e402a,_0x378949){var _0x31e399=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],'server/files/images/avatars/default_avatar.png');var _0x47c271={'where':{'id':_0x4e402a[_0xa9f6('0x4b')]['id']},'attributes':['id',_0xa9f6('0x64')],'raw':!![]};return db[_0xa9f6('0x34')][_0xa9f6('0x4e')](_0x47c271)[_0xa9f6('0x17')](handleEntityNotFound(_0x378949,null))['then'](function(_0x499e26){if(_0x499e26){if(!_[_0xa9f6('0x6f')](_0x499e26[_0xa9f6('0x64')])){if(fs[_0xa9f6('0x70')](path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],'server/files/images/avatars/',_0x499e26[_0xa9f6('0x64')]))){_0x31e399=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],_0xa9f6('0x74'),_0x499e26[_0xa9f6('0x64')]);}}return _0x378949['download'](_0x31e399);}})[_0xa9f6('0x21')](handleError(_0x378949,null));};exports['getCustomerAvatar']=function(_0xe491b2,_0xd56857){var _0x5222fe=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0x1593db={'where':{'id':_0xe491b2[_0xa9f6('0x4b')]['id']},'attributes':['id',_0xa9f6('0x75'),_0xa9f6('0x76')],'raw':!![]};return db[_0xa9f6('0x34')][_0xa9f6('0x4e')](_0x1593db)[_0xa9f6('0x17')](handleEntityNotFound(_0xd56857,null))[_0xa9f6('0x17')](function(_0x25ddf4){if(_0x25ddf4){if(!_['isNil'](_0x25ddf4[_0xa9f6('0x75')])){if(fs[_0xa9f6('0x70')](path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],_0xa9f6('0x74'),_0x25ddf4['customerAvatar']))&&_0x25ddf4[_0xa9f6('0x76')]){_0x5222fe=path[_0xa9f6('0x6a')](config['root'],_0xa9f6('0x74'),_0x25ddf4[_0xa9f6('0x75')]);}}return _0xd56857[_0xa9f6('0x72')](_0x5222fe);}})[_0xa9f6('0x21')](handleError(_0xd56857,null));};exports[_0xa9f6('0x77')]=function(_0x1d611e,_0x6d12f9){var _0x29c642=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],'server/files/images/avatars/system_avatar.png');var _0x2e4521={'where':{'id':_0x1d611e['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xa9f6('0x34')][_0xa9f6('0x4e')](_0x2e4521)[_0xa9f6('0x17')](handleEntityNotFound(_0x6d12f9,null))[_0xa9f6('0x17')](function(_0x286692){if(_0x286692){if(!_['isNil'](_0x286692['systemAvatar'])){if(fs[_0xa9f6('0x70')](path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],_0xa9f6('0x74'),_0x286692[_0xa9f6('0x78')]))){_0x29c642=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],'server/files/images/avatars/',_0x286692[_0xa9f6('0x78')]);}}return _0x6d12f9[_0xa9f6('0x72')](_0x29c642);}})[_0xa9f6('0x21')](handleError(_0x6d12f9,null));};exports[_0xa9f6('0x79')]=function(_0x1cfa39,_0x4d7b9d){var _0x69bdbc=require(_0xa9f6('0x7a'));var _0x4652c3=new _0x69bdbc();var _0x4f0302=_0x4652c3[_0xa9f6('0x7b')](_0x1cfa39[_0xa9f6('0x7c')]['user-agent'])[_0xa9f6('0x7d')]();var _0x4d8d4a={'body':_0x1cfa39[_0xa9f6('0x55')],'channel':'chat'};var _0x33d36b=[];var _0x4cd6c4=[];var _0x424a67={};var _0x4fd195=![];return db[_0xa9f6('0x7e')][_0xa9f6('0x56')]()[_0xa9f6('0x17')](function(_0x2e4118){if(!_0x2e4118){throw new db[(_0xa9f6('0x7f'))][(_0xa9f6('0x80'))](_0xa9f6('0x81'));}_0x33d36b=_[_0xa9f6('0x82')](_[_0xa9f6('0x39')](_0x2e4118),[_0xa9f6('0x83'),'updatedAt']);_0x4cd6c4=_['difference'](_[_0xa9f6('0x39')](_0x2e4118),['createdAt',_0xa9f6('0x84'),_0xa9f6('0x85'),_0xa9f6('0x86')]);if(_0x1cfa39[_0xa9f6('0x55')]['id']){delete _0x1cfa39['body']['id'];}if(_[_0xa9f6('0x6f')](_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0x87')])){throw new db[(_0xa9f6('0x7f'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa9f6('0x6f')](_0x1cfa39[_0xa9f6('0x55')]['body'])||_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0x55')]===''){throw new db[(_0xa9f6('0x7f'))][(_0xa9f6('0x80'))](_0xa9f6('0x88'));}if(_[_0xa9f6('0x6f')](_0x1cfa39[_0xa9f6('0x55')]['mapKey'])){throw new db[(_0xa9f6('0x7f'))][(_0xa9f6('0x80'))](_0xa9f6('0x89')+_0x4cd6c4);}if(!_[_0xa9f6('0x8a')](_0x4cd6c4,_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0x8b')])){throw new db['Sequelize'][(_0xa9f6('0x80'))](_0xa9f6('0x8c')+_0x4cd6c4);}_0x424a67[_0x1cfa39[_0xa9f6('0x55')]['mapKey']]=_0x1cfa39[_0xa9f6('0x55')]['from'];})['then'](function(){return db[_0xa9f6('0x34')]['find']({'where':{'id':_0x1cfa39['params']['id']},'include':[{'model':db[_0xa9f6('0x8d')],'as':_0xa9f6('0x8e'),'include':[{'model':db[_0xa9f6('0x7e')],'as':_0xa9f6('0x8f'),'where':_0x424a67,'limit':0x1,'order':[[_0xa9f6('0x84'),_0xa9f6('0x90')]]}]},{'model':db[_0xa9f6('0x91')],'as':_0xa9f6('0x92')}]});})[_0xa9f6('0x17')](handleEntityNotFound(_0x4d7b9d,null))[_0xa9f6('0x17')](function(_0x3579b6){if(_0x3579b6&&_0x3579b6[_0xa9f6('0x8e')]){_0x4d8d4a[_0xa9f6('0x93')]=_0x3579b6;_0x4d8d4a[_0xa9f6('0x94')]=_0x3579b6[_0xa9f6('0x92')];_0x4d8d4a[_0xa9f6('0x95')]=_0x3579b6[_0xa9f6('0x8e')];_0x4d8d4a[_0xa9f6('0x94')]=_[_0xa9f6('0x96')](_0x4d8d4a['applications'],[_0xa9f6('0x97')],[_0xa9f6('0x98')]);if(_0x4d8d4a[_0xa9f6('0x93')][_0xa9f6('0x92')]){delete _0x4d8d4a[_0xa9f6('0x93')][_0xa9f6('0x92')];}if(_0x4d8d4a[_0xa9f6('0x93')][_0xa9f6('0x8e')]&&_0x4d8d4a['account'][_0xa9f6('0x8e')][_0xa9f6('0x8f')][_0xa9f6('0x3e')]){return _0x4d8d4a[_0xa9f6('0x93')][_0xa9f6('0x8e')]['Contacts'][0x0];}var _0x4b60d0=_[_0xa9f6('0xe')](_0x1cfa39[_0xa9f6('0x55')],{'firstName':_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0x87')],'ListId':_0x3579b6[_0xa9f6('0x86')]});_0x4b60d0[_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0x8b')]]=_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0x87')];return db[_0xa9f6('0x7e')]['create'](_0x4b60d0,{'fields':_0x33d36b,'raw':!![]});}})[_0xa9f6('0x17')](handleEntityNotFound(_0x4d7b9d,null))[_0xa9f6('0x17')](function(_0x55e2ba){_0x4d8d4a['contact']=_0x55e2ba;var _0x434876=_0x1cfa39['body'][_0xa9f6('0x99')];if(_0x1cfa39[_0xa9f6('0x7c')][_0xa9f6('0x9a')]){_0x434876=_0x1cfa39[_0xa9f6('0x7c')][_0xa9f6('0x9a')];}else if(_0x1cfa39[_0xa9f6('0x7c')][_0xa9f6('0x9b')]){_0x434876=_[_0xa9f6('0x9c')](_0x1cfa39[_0xa9f6('0x7c')][_0xa9f6('0x9b')][_0xa9f6('0x9d')](','));}if(_0x55e2ba){var _0x5a2055={'ContactId':_0x55e2ba['id'],'ChatWebsiteId':_0x1cfa39[_0xa9f6('0x4b')]['id'],'from':(_0x55e2ba['firstName']||'')+'\x20'+(_0x55e2ba[_0xa9f6('0x9e')]||''),'customerIp':_0x434876,'customerPort':_0x1cfa39[_0xa9f6('0x7c')][_0xa9f6('0x9f')]?_0x1cfa39[_0xa9f6('0x7c')][_0xa9f6('0x9f')]:null,'referer':_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xa0')],'browserName':_0x4f0302[_0xa9f6('0xa1')][_0xa9f6('0x2f')]&&_0x4f0302[_0xa9f6('0xa1')][_0xa9f6('0xa2')]?util[_0xa9f6('0xa3')](_0xa9f6('0xa4'),_0x4f0302[_0xa9f6('0xa1')][_0xa9f6('0x2f')],_0x4f0302[_0xa9f6('0xa1')][_0xa9f6('0xa2')]):_0xa9f6('0xa5'),'browserVersion':_0x4f0302[_0xa9f6('0xa1')][_0xa9f6('0xa2')]||'unknown','osName':util['format'](_0xa9f6('0xa4'),_0x4f0302['os']['name'],_0x4f0302['os'][_0xa9f6('0xa2')]),'osVersion':_0x4f0302['os'][_0xa9f6('0xa2')],'deviceModel':_0x4f0302['device'][_0xa9f6('0x38')]&&_0x4f0302[_0xa9f6('0xa6')][_0xa9f6('0xa7')]?util['format']('%s\x20%s\x20%s',_0x4f0302[_0xa9f6('0xa6')]['model'],_0x4f0302[_0xa9f6('0xa6')][_0xa9f6('0xa7')],_0x4f0302[_0xa9f6('0xa6')]['type']):null,'deviceVendor':_0x4f0302[_0xa9f6('0xa6')][_0xa9f6('0xa7')],'deviceType':_0x4f0302[_0xa9f6('0xa6')][_0xa9f6('0x37')],'formData':JSON[_0xa9f6('0x1c')](_0x1cfa39['body'])};var _0x49205d={'ChatWebsiteId':_0x1cfa39[_0xa9f6('0x4b')]['id'],'closed':![]};if(_0x1cfa39['body'][_0xa9f6('0xa8')]){_0x49205d['threadId']=_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xa8')];return db['ChatInteraction'][_0xa9f6('0x4e')]({'where':_0x49205d})[_0xa9f6('0x17')](function(_0x28d64a){if(_0x28d64a){return[_0x28d64a,![]];}_0x5a2055[_0xa9f6('0xa8')]=_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xa8')];_0x5a2055[_0xa9f6('0xa9')]=_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xa9')];return db[_0xa9f6('0xaa')]['create'](_0x5a2055)['then'](function(_0x361afd){return[_0x361afd,!![]];});});}_0x49205d[_0xa9f6('0xab')]=_0x55e2ba['id'];if(_0x1cfa39[_0xa9f6('0x55')]['interaction']&&_0x1cfa39[_0xa9f6('0x55')]['interaction']['id']){_0x49205d['id']=_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xac')]['id'];return db['ChatInteraction'][_0xa9f6('0x4e')]({'where':_0x49205d})[_0xa9f6('0x17')](function(_0x366783){if(_0x366783){return[_0x366783,![]];}return db[_0xa9f6('0xaa')][_0xa9f6('0x4f')](_0x5a2055)['then'](function(_0x4c924e){return[_0x4c924e,!![]];});});}return db['ChatInteraction'][_0xa9f6('0x4f')](_0x5a2055)[_0xa9f6('0x17')](function(_0x267ada){return[_0x267ada,!![]];});}})['spread'](function(_0x34e1ec,_0x4f5397){if(_0x34e1ec){_0x4fd195=_0x4f5397;if(!_0x4f5397){var _0x3c7afc={'from':(_0x4d8d4a[_0xa9f6('0xad')][_0xa9f6('0xae')]||'')+'\x20'+(_0x4d8d4a[_0xa9f6('0xad')][_0xa9f6('0x9e')]||'')};if(_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xa8')]&&_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xaf')]&&_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xa8')]!=_0x1cfa39['body'][_0xa9f6('0xaf')]){_0x3c7afc[_0xa9f6('0xa8')]=_0x1cfa39[_0xa9f6('0x55')][_0xa9f6('0xaf')];}return _0x34e1ec[_0xa9f6('0x29')](_0x3c7afc);}else{return _0x34e1ec;}}})['then'](function(_0x237eb1){_0x4d8d4a[_0xa9f6('0xac')]=_0x237eb1[_0xa9f6('0x2b')]({'plain':!![]});_0x4d8d4a[_0xa9f6('0xac')]['created']=_0x4fd195;if(_0x4d8d4a[_0xa9f6('0xac')][_0xa9f6('0xb0')]){if(_0x4d8d4a['account'][_0xa9f6('0xb1')]){_0x4d8d4a['applications']['push']({'id':0x0,'priority':_0x4d8d4a[_0xa9f6('0x94')][_0xa9f6('0x3e')]+0x1,'app':_0xa9f6('0xb2'),'appdata':_0xa9f6('0xb3'),'interval':'*,*,*,*'});}}return db[_0xa9f6('0xb4')][_0xa9f6('0x4f')]({'body':_0x1cfa39[_0xa9f6('0x55')]['body'],'ChatWebsiteId':_0x1cfa39[_0xa9f6('0x4b')]['id'],'ChatInteractionId':_0x237eb1['id'],'direction':'in','ContactId':_0x4d8d4a['contact']['id'],'AttachmentId':_0x1cfa39['body'][_0xa9f6('0xb5')]});})[_0xa9f6('0x17')](function(_0x3a25eb){_0x4d8d4a['message']=_0x3a25eb;if(_0x4d8d4a['interaction'][_0xa9f6('0xb6')]){return db[_0xa9f6('0xb7')][_0xa9f6('0x4e')]({'attributes':['id',_0xa9f6('0x2f')],'where':{'id':_0x4d8d4a['interaction'][_0xa9f6('0xb6')]}})[_0xa9f6('0x17')](function(_0x5d0d33){if(_0x5d0d33){_0x4d8d4a[_0xa9f6('0x94')][_0xa9f6('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5d0d33['name']+','+(_0x4d8d4a['account']['waitForTheAssignedAgent']||0xa),'interval':_0xa9f6('0xb9')});_0x4d8d4a['forcedOwnership']=!![];}return respondWithRpcPromise(_0xa9f6('0xba'),_0xa9f6('0xbb'),_0x4d8d4a);});}return respondWithRpcPromise(_0xa9f6('0xba'),'startRouting',_0x4d8d4a);})[_0xa9f6('0x17')](function(_0x267402){respondWithRpcPromise(_0xa9f6('0xbc'),_0xa9f6('0xbc'),{'event':'notify','message':_0x267402},client9002);return _0x267402;})[_0xa9f6('0x17')](respondWithResult(_0x4d7b9d,null))[_0xa9f6('0x21')](handleError(_0x4d7b9d,null));};exports['offline']=function(_0xb03120,_0x2cab8d){var _0x146bee,_0xee538b,_0x5e307e;var _0x2fd840=[];var _0x542da4={};var _0x3ba8c7=_0xb03120[_0xa9f6('0xbd')]||[];var _0x3e712b=[];var _0x5a0bd9;return db[_0xa9f6('0x7e')][_0xa9f6('0x56')]()['then'](function(_0x2cb678){if(!_0x2cb678){throw new db[(_0xa9f6('0x7f'))]['ValidationError'](_0xa9f6('0x81'));}_0x2fd840=_[_0xa9f6('0x82')](_[_0xa9f6('0x39')](_0x2cb678),['createdAt','updatedAt',_0xa9f6('0x85'),_0xa9f6('0x86')]);if(_0xb03120[_0xa9f6('0x55')]['id']){delete _0xb03120[_0xa9f6('0x55')]['id'];}if(_[_0xa9f6('0x6f')](_0xb03120[_0xa9f6('0x55')]['from'])){throw _0x2cab8d[_0xa9f6('0x23')](0x1f4)[_0xa9f6('0xbe')](new db[(_0xa9f6('0x7f'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0xb03120[_0xa9f6('0x55')][_0xa9f6('0x55')])||_0xb03120['body']['body']===''){throw _0x2cab8d[_0xa9f6('0x23')](0x1f4)[_0xa9f6('0xbe')](new db[(_0xa9f6('0x7f'))][(_0xa9f6('0x80'))](_0xa9f6('0x88')));}if(_[_0xa9f6('0x6f')](_0xb03120['body'][_0xa9f6('0xbf')])){throw _0x2cab8d['status'](0x1f4)[_0xa9f6('0xbe')](new db[(_0xa9f6('0x7f'))]['ValidationError'](_0xa9f6('0xc0')+_0x2fd840));}if(!_[_0xa9f6('0x8a')](_0x2fd840,_0xb03120[_0xa9f6('0x55')][_0xa9f6('0xbf')])){throw _0x2cab8d[_0xa9f6('0x23')](0x1f4)[_0xa9f6('0xbe')](new db[(_0xa9f6('0x7f'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2fd840));}_0x542da4[_0xb03120[_0xa9f6('0x55')][_0xa9f6('0xbf')]]=_0xb03120['body'][_0xa9f6('0x87')];})[_0xa9f6('0x17')](function(){return db[_0xa9f6('0x34')][_0xa9f6('0x4e')]({'where':{'id':_0xb03120[_0xa9f6('0x4b')]['id']},'include':[{'model':db[_0xa9f6('0x8d')],'as':_0xa9f6('0x8e')},{'model':db[_0xa9f6('0xc1')],'as':_0xa9f6('0xc1')}]});})['then'](handleEntityNotFound(_0x2cab8d,null))[_0xa9f6('0x17')](function(_0x20d72b){if(_0x20d72b&&_0x20d72b[_0xa9f6('0x8e')]){_0xee538b=_0x20d72b;var _0x1694d0=_[_0xa9f6('0xe')](_0xb03120[_0xa9f6('0x55')],{'firstName':_0xb03120[_0xa9f6('0x55')][_0xa9f6('0x87')],'phone':_0xb03120[_0xa9f6('0x55')][_0xa9f6('0x87')],'ListId':_0x20d72b['ListId']});_0x1694d0[_0xb03120[_0xa9f6('0x55')][_0xa9f6('0xbf')]]=_0xb03120[_0xa9f6('0x55')][_0xa9f6('0x87')];return db[_0xa9f6('0x7e')][_0xa9f6('0xc2')]({'where':_0x542da4,'defaults':_0x1694d0});}})[_0xa9f6('0xc3')](function(_0x33540d){if(_0x33540d){_0x5e307e=_0x33540d;var _0x2e36f6=fs['readFileSync'](path['join'](config[_0xa9f6('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0xa9f6('0xc4'));var _0x47c4b3=ejs[_0xa9f6('0xc5')](_0x2e36f6,{'body':_[_0xa9f6('0xc6')](_0xb03120[_0xa9f6('0x55')][_0xa9f6('0x55')]),'bodyTitle':_0xee538b[_0xa9f6('0xc7')]});return db[_0xa9f6('0xc8')][_0xa9f6('0x4f')]({'body':_0x47c4b3,'plainBody':htmlToText[_0xa9f6('0xc9')](_0x47c4b3),'ContactId':_0x33540d['id'],'ChatWebsiteId':_0xee538b['id']});}})['then'](function(_0x45548a){_0x5a0bd9=_0x45548a;if(_0x3ba8c7[_0xa9f6('0x3e')]){var _0x1313a9=_0x3ba8c7[_0xa9f6('0x33')](function(_0x2c6e3e){return{'name':_0x2c6e3e[_0xa9f6('0xca')],'basename':_0x2c6e3e[_0xa9f6('0x66')],'type':_0x2c6e3e[_0xa9f6('0xcb')],'ChatOfflineMessageId':_0x45548a['id']};});_0x3e712b=_0x1313a9['map'](_0x161d7e=>{var _0x1d3dce={'filename':_0x161d7e[_0xa9f6('0x2f')],'path':path[_0xa9f6('0x6a')](config['root'],'server',_0xa9f6('0xbd'),'attachments','offline-chat',_0x161d7e[_0xa9f6('0xcc')])};return _0x1d3dce;});if(!_0xee538b['openNewInteraction']){return db[_0xa9f6('0xcd')]['transaction'](function(_0xf04394){return db[_0xa9f6('0xce')][_0xa9f6('0xcf')](_0x1313a9,{'transaction':_0xf04394});});}}})[_0xa9f6('0x17')](function(){if(_0x5a0bd9){_0x146bee=_0x5a0bd9;return db[_0xa9f6('0xc1')][_0xa9f6('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa9f6('0xd0')],'as':_0xa9f6('0xd0'),'raw':!![]}]}]});}})['then'](function(_0x7823b2){if(_0x7823b2&&_0x7823b2['Smtp']&&_0xee538b[_0xa9f6('0xd1')]&&_0xee538b[_0xa9f6('0xd2')]){var _0x59ffba=_0x7823b2['getSmtpOptions']();return respondWithRpcPromise(_0xa9f6('0xd3'),_0xa9f6('0xd4'),{'account':_0x59ffba,'message':{'from':util[_0xa9f6('0xa3')](_0xa9f6('0xd5'),_0x7823b2[_0xa9f6('0x2f')],_0x7823b2[_0xa9f6('0xd6')]||_0x7823b2['Smtp'][_0xa9f6('0x50')]),'to':_0xee538b['forwardOfflineAddress'],'subject':_0xee538b['offlineMessageSubject'],'html':_0x146bee[_0xa9f6('0x55')],'attachments':_0x3e712b}},client9003)['then'](function(){return _0x146bee;})[_0xa9f6('0x21')](function(_0x636403){logger[_0xa9f6('0x1d')](_0x636403);});}})[_0xa9f6('0x17')](function(){if(_0xee538b&&_0xee538b['openNewInteraction']&&_0xee538b[_0xa9f6('0xd7')]){var _0x508664=[];if(_0x3ba8c7[_0xa9f6('0x3e')]){_0x508664=_0x3ba8c7[_0xa9f6('0x33')](function(_0x40f55c){return{'name':_0x40f55c[_0xa9f6('0xca')],'basename':_0x40f55c['filename'],'type':_0x40f55c[_0xa9f6('0xcb')],'ChatOfflineMessageId':_0x5a0bd9['id']};});}var _0x2ea078;if(!_['isNil'](_0xee538b[_0xa9f6('0xd8')])){var _0x1a3ffe=_[_0xa9f6('0x33')](_0xb03120[_0xa9f6('0x55')],function(_0x41a2cc){return _0x41a2cc;});var _0x4a6134=_['toPairsIn'](_0x1a3ffe)[0x0];var _0x528329=_[_0xa9f6('0xd9')](_0x4a6134,function(_0x41b97d){return _0x41b97d;});_0x2ea078=_0x528329[0x1][_0xee538b[_0xa9f6('0xd8')]];}var _0x3cd357={'from':_0x5e307e['email'],'firstName':_0x5e307e[_0xa9f6('0xae')],'lastName':_0x5e307e[_0xa9f6('0x9e')],'mapKey':_0xa9f6('0xd6'),'message':{'from':_0x5e307e['email'],'to':_0xee538b[_0xa9f6('0xc1')][_0xa9f6('0xd6')],'cc':'','subject':_['isNil'](_0x2ea078)?_0xee538b[_0xa9f6('0xda')]:_0x2ea078,'messageId':'','sentAt':new Date(),'attach':_0x508664[_0xa9f6('0x3e')],'attachments':_0x508664,'originChannel':_0xa9f6('0xdb'),'ChatWebsiteId':_0xee538b['id'],'ChatOfflineMessageId':_0x146bee['id'],'originTo':_0xee538b[_0xa9f6('0xc1')][_0xa9f6('0xd6')]},'body':_0x146bee['body']};var _0x3d361b={'account':{'id':_0xee538b[_0xa9f6('0xd7')]},'body':_0x3cd357,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xa9f6('0xdc'),_0x3d361b,client9001)['then'](function(){return _0x146bee;})[_0xa9f6('0x21')](function(_0x4f0143){logger['error'](_0x4f0143);});}return;})[_0xa9f6('0x17')](function(){if(_0x146bee){return _0x146bee;}})[_0xa9f6('0x17')](respondWithResult(_0x2cab8d,null))[_0xa9f6('0x21')](function(_0x4731f5){logger[_0xa9f6('0x1d')](_0xa9f6('0x21'),_0x4731f5);for(var _0x404500 of _0x3ba8c7){var _0x1d312e=path[_0xa9f6('0x6a')](config[_0xa9f6('0x6b')],_0xa9f6('0xdd'),_0xa9f6('0xbd'),_0xa9f6('0xde'),_0xa9f6('0xdf'),_0x404500['filename']);fs_extra['remove'](_0x1d312e)[_0xa9f6('0x21')](function(_0x228681){logger[_0xa9f6('0x1d')](_0xa9f6('0xe0'),_0x1d312e,_0x228681);});}});};exports[_0xa9f6('0xe1')]=function(_0x5a22ed,_0x251c81){return db[_0xa9f6('0xaa')][_0xa9f6('0x4e')]({'where':{'id':_0x5a22ed[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x251c81,null))['then'](function(_0x978c1c){if(_0x978c1c){return _0x978c1c[_0xa9f6('0xe1')](_0x5a22ed['body']['ids'],_[_0xa9f6('0xe2')](_0x5a22ed[_0xa9f6('0x55')],[_0xa9f6('0x5e'),'id'])||{});}})[_0xa9f6('0x17')](respondWithResult(_0x251c81,null))['catch'](handleError(_0x251c81,null));};exports[_0xa9f6('0xe3')]=function(_0x2c7837,_0x3e6077){var _0x2cd5a7={'raw':![],'where':{}};var _0x4b5990={};var _0x562b20={'count':0x0,'rows':[]};return db[_0xa9f6('0x34')]['findOne']({'where':{'id':_0x2c7837[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x3e6077,null))[_0xa9f6('0x17')](function(_0x238e77){if(_0x238e77){_0x4b5990['model']=_[_0xa9f6('0x39')](db[_0xa9f6('0xaa')][_0xa9f6('0x35')]);_0x4b5990[_0xa9f6('0x3a')]=_[_0xa9f6('0x39')](_0x2c7837['query']);_0x4b5990['filters']=_['intersection'](_0x4b5990['model'],_0x4b5990[_0xa9f6('0x3a')]);_0x2cd5a7[_0xa9f6('0x3c')]=_['intersection'](_0x4b5990[_0xa9f6('0x38')],qs[_0xa9f6('0x3d')](_0x2c7837[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x2cd5a7[_0xa9f6('0x3c')]=_0x2cd5a7[_0xa9f6('0x3c')][_0xa9f6('0x3e')]?_0x2cd5a7['attributes']:_0x4b5990[_0xa9f6('0x38')];if(!_0x2c7837[_0xa9f6('0x3a')][_0xa9f6('0x3f')]('nolimit')){_0x2cd5a7['limit']=qs[_0xa9f6('0x27')](_0x2c7837[_0xa9f6('0x3a')]['limit']);_0x2cd5a7['offset']=qs[_0xa9f6('0x25')](_0x2c7837[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}_0x2cd5a7['order']=qs[_0xa9f6('0x42')](_0x2c7837['query']['sort']);_0x2cd5a7['where']=qs[_0xa9f6('0x3b')](_[_0xa9f6('0x44')](_0x2c7837[_0xa9f6('0x3a')],_0x4b5990[_0xa9f6('0x3b')]));_0x2cd5a7[_0xa9f6('0x43')]['ChatWebsiteId']=_0x238e77['id'];if(_0x2c7837[_0xa9f6('0x3a')][_0xa9f6('0x45')]){_0x2cd5a7[_0xa9f6('0x43')]=_['merge'](_0x2cd5a7[_0xa9f6('0x43')],{'$or':_[_0xa9f6('0x33')](_0x2cd5a7[_0xa9f6('0x3c')],function(_0x32d26f){var _0xd12e61={};_0xd12e61[_0x32d26f]={'$like':'%'+_0x2c7837['query'][_0xa9f6('0x45')]+'%'};return _0xd12e61;})});}_0x2cd5a7=_[_0xa9f6('0x46')]({},_0x2cd5a7,_0x2c7837[_0xa9f6('0x47')]);return db['ChatInteraction'][_0xa9f6('0x28')]({'where':_0x2cd5a7['where']})[_0xa9f6('0x17')](function(_0x198878){_0x562b20[_0xa9f6('0x28')]=_0x198878;if(_0x2c7837[_0xa9f6('0x3a')]['includeAll']){_0x2cd5a7['include']=[{'model':db['CmContact'],'as':_0xa9f6('0xe4'),'required':![]},{'model':db[_0xa9f6('0xb7')],'as':_0xa9f6('0xe5'),'attributes':[_0xa9f6('0x2f'),_0xa9f6('0xe6'),_0xa9f6('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xa9f6('0xe8'),'attributes':['id',_0xa9f6('0x2f'),_0xa9f6('0xe9')],'where':_0x2c7837[_0xa9f6('0x3a')]['tag']?{'id':_0x2c7837[_0xa9f6('0x3a')]['tag']}:undefined,'required':_0x2c7837[_0xa9f6('0x3a')][_0xa9f6('0xea')]?!![]:![]}];}return db[_0xa9f6('0xaa')][_0xa9f6('0x49')](_0x2cd5a7);})[_0xa9f6('0x17')](function(_0x1eee0e){_0x562b20[_0xa9f6('0x5c')]=_0x1eee0e;return _0x562b20;});}})[_0xa9f6('0x17')](respondWithFilteredResult(_0x3e6077,_0x2cd5a7))[_0xa9f6('0x21')](handleError(_0x3e6077,null));};function iftimePromise(_0x333938,_0x5340e4){return respondWithRpcPromise('Command',_0xa9f6('0xeb'),{'command':_0x5340e4[_0xa9f6('0xec')]?util[_0xa9f6('0xa3')](_0xa9f6('0xed'),_0x333938['interval'],_0x5340e4['timezone']):util[_0xa9f6('0xa3')](_0xa9f6('0xee'),_0x333938[_0xa9f6('0xef')])},client9002)['then'](function(_0x4de002){var _0x290a7e=_0x4de002&&_0x4de002[_0xa9f6('0xf0')]('true')>=0x0?!![]:![];logger['info'](_0xa9f6('0xf1'),_0x5340e4['id'],_0x333938['id'],_0x333938[_0xa9f6('0xef')],_0x290a7e?_0xa9f6('0xf2'):_0xa9f6('0xf3'),_0x5340e4[_0xa9f6('0xec')]?_0x5340e4['timezone']:_0xa9f6('0xf4'));return _0x290a7e;})[_0xa9f6('0x21')](function(_0x2857e8){logger[_0xa9f6('0x1d')](_0xa9f6('0xf1'),_0x5340e4['id'],_0x333938['id'],_0x333938[_0xa9f6('0xef')],util[_0xa9f6('0xf5')](_0x2857e8,{'showHidden':![],'depth':null}),_0x5340e4[_0xa9f6('0xec')]?_0x5340e4[_0xa9f6('0xec')]:_0xa9f6('0xf4'));return![];});}exports[_0xa9f6('0xeb')]=function(_0x4de582,_0x1bd8aa){var _0x284f85=0x0;var _0x561856=0x0;var _0x497485=![];var _0x5f97c9;var _0x1ef2d9;return db['ChatWebsite'][_0xa9f6('0x4e')]({'where':{'id':_0x4de582['params']['id']},'include':[{'model':db['Interval'],'as':_0xa9f6('0xf6'),'include':[{'model':db[_0xa9f6('0xf6')],'as':_0xa9f6('0xf7'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xa9f6('0x17')](handleEntityNotFound(_0x1bd8aa,null))['then'](function(_0x4339e0){if(_0x4339e0){_0x5f97c9=_0x4339e0;return _0x4339e0[_0xa9f6('0xf8')]({'raw':!![]});}})[_0xa9f6('0x17')](function(_0x361bc5){if(_0x5f97c9){if(_0x361bc5){_0x1ef2d9=_0x361bc5;}}return require(_0xa9f6('0x6c'))[_0xa9f6('0x6d')]();})[_0xa9f6('0x17')](function(_0xa5bde3){if(_0xa5bde3){_0x561856=_0xa5bde3['virtual'];_0x497485=_0xa5bde3[_0xa9f6('0x6e')];}})[_0xa9f6('0x17')](function(){return db[_0xa9f6('0xaa')]['count']({'where':{'closed':![]}});})['then'](function(_0x5998a0){_0x284f85=_0x5998a0;if(_0x561856&&_0x5998a0>_0x561856){return db['License']['findOne']({'where':{'id':0x1}})[_0xa9f6('0x17')](function(_0x1e586b){if(_0x1e586b){_0x1e586b[_0xa9f6('0xf9')]('chatLicenseExceeded');}});}})[_0xa9f6('0x17')](function(){if(_0x5f97c9[_0xa9f6('0xf6')]&&_0x5f97c9['Interval'][_0xa9f6('0xf7')]){var _0x3346a6=[];for(var _0x2e0a93=0x0;_0x2e0a93<_0x5f97c9[_0xa9f6('0xf6')]['Intervals'][_0xa9f6('0x3e')];_0x2e0a93++){var _0x44cf74=_0x5f97c9[_0xa9f6('0xf6')]['Intervals'][_0x2e0a93][_0xa9f6('0x2b')]({'plain':!![]});_0x3346a6[_0xa9f6('0xfa')](iftimePromise(_0x44cf74,_0x5f97c9));}return BPromise[_0xa9f6('0xfb')](_0x3346a6)[_0xa9f6('0x17')](function(_0x257c72){return _['some'](_0x257c72);});}else{return!![];}})[_0xa9f6('0x17')](function(_0x27dc60){var _0x369f76=fs['readFileSync'](path['join'](config[_0xa9f6('0x6b')],_0xa9f6('0xfc')),_0xa9f6('0xc4'));var _0x101590={'remote':_0x5f97c9['remote'],'query':querystring[_0xa9f6('0x1c')](_[_0xa9f6('0x46')](_0x5f97c9[_0xa9f6('0x2b')]({'plain':!![]}),{'customerIp':_0x4de582[_0xa9f6('0x7c')][_0xa9f6('0x9b')]||_0x4de582[_0xa9f6('0x7c')]['x-real-ip']||_0x4de582[_0xa9f6('0xfd')][_0xa9f6('0xfe')]||_0x4de582['ip'],'referer':_0x4de582[_0xa9f6('0x7c')][_0xa9f6('0xa0')],'openedInteractions':_0x284f85,'maxInteractions':_0x561856,'virtual':_0x497485['virtual'],'online':_0x27dc60,'custom':_0x497485}))[_0xa9f6('0xff')](/'/g,'\x5c\x27')};_0x1bd8aa['send'](ejs[_0xa9f6('0xc5')](Mustache['render'](_0x369f76,_0x101590),{'proactiveActions':_0x1ef2d9,'alignment':_0x5f97c9[_0xa9f6('0x100')],'verticalAlignment':_0x5f97c9[_0xa9f6('0x101')],'div_color':_0x5f97c9['color'],'labelText':_0x5f97c9[_0xa9f6('0x102')],'text_color':_0x5f97c9[_0xa9f6('0x103')],'text_button_color':_0x5f97c9[_0xa9f6('0x104')],'button_color':_0x5f97c9[_0xa9f6('0x105')],'background_color':_0x5f97c9[_0xa9f6('0x106')],'hideWhenOffline':_0x5f97c9['hideWhenOffline'],'interval':_0x5f97c9[_0xa9f6('0x107')]}));})[_0xa9f6('0x21')](handleError(_0x1bd8aa,null));};exports[_0xa9f6('0x108')]=function(_0x524c53,_0x104db2){var _0x44fc50=_0x524c53[_0xa9f6('0x4b')]['id'];var _0x54a5f8=_0x524c53[_0xa9f6('0x55')];var _0x76c598=0xc8;var _0x551da9=null;return db[_0xa9f6('0xcd')][_0xa9f6('0x109')]({'isolationLevel':db[_0xa9f6('0xcd')][_0xa9f6('0x10a')][_0xa9f6('0x10b')][_0xa9f6('0x10c')]},function(_0x53e2aa){return db[_0xa9f6('0x34')][_0xa9f6('0x5b')]({'where':{'id':_0x44fc50},'transaction':_0x53e2aa})[_0xa9f6('0x17')](function(_0x2326e3){if(_0x2326e3){return db[_0xa9f6('0x91')][_0xa9f6('0x2a')]({'where':{'ChatWebsiteId':_0x44fc50},'transaction':_0x53e2aa})[_0xa9f6('0x17')](function(){var _0x42532c=_[_0xa9f6('0x33')](_0x54a5f8,function(_0x8f090c){_0x8f090c[_0xa9f6('0x58')]=_0x44fc50;return _0x8f090c;});return db[_0xa9f6('0x91')][_0xa9f6('0xcf')](_0x42532c,{'transaction':_0x53e2aa});});}else{_0x76c598=0x194;_0x551da9=[];}});})['then'](function(){if(_0x76c598!==0x194){return db[_0xa9f6('0x91')][_0xa9f6('0x10d')]({'where':{'ChatWebsiteId':_0x44fc50},'order':_0xa9f6('0x97')})[_0xa9f6('0x17')](function(_0x5f0cd9){_0x551da9=_0x5f0cd9;});}})['catch'](function(_0x69bb45){_0x76c598=0x1f4;logger[_0xa9f6('0x1d')](_0x69bb45[_0xa9f6('0x2e')]);if(_0x69bb45[_0xa9f6('0x2f')]){delete _0x69bb45[_0xa9f6('0x2f')];}_0x551da9=_0x69bb45;})[_0xa9f6('0x10e')](function(){if(_0x551da9===null){_0x104db2[_0xa9f6('0x22')](_0x76c598);}else{if(_0x76c598===0x1f4){_0x104db2[_0xa9f6('0x23')](_0x76c598)[_0xa9f6('0xbe')](_0x551da9);}else{_0x104db2[_0xa9f6('0x23')](_0x76c598)[_0xa9f6('0x24')](_0x551da9);}}});};exports[_0xa9f6('0x10f')]=function(_0x19d95f,_0x391827){var _0x431f70={};var _0x25cf97={};var _0x2cce97;var _0x72841d;return db[_0xa9f6('0x34')][_0xa9f6('0x5b')]({'where':{'id':_0x19d95f[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x391827,null))[_0xa9f6('0x17')](function(_0x31bde6){if(_0x31bde6){_0x2cce97=_0x31bde6;_0x25cf97[_0xa9f6('0x38')]=_[_0xa9f6('0x39')](db[_0xa9f6('0x91')]['rawAttributes']);_0x25cf97[_0xa9f6('0x3a')]=_['keys'](_0x19d95f[_0xa9f6('0x3a')]);_0x25cf97[_0xa9f6('0x3b')]=_[_0xa9f6('0x4c')](_0x25cf97[_0xa9f6('0x38')],_0x25cf97[_0xa9f6('0x3a')]);_0x431f70['attributes']=_['intersection'](_0x25cf97[_0xa9f6('0x38')],qs[_0xa9f6('0x3d')](_0x19d95f[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x431f70[_0xa9f6('0x3c')]=_0x431f70['attributes'][_0xa9f6('0x3e')]?_0x431f70[_0xa9f6('0x3c')]:_0x25cf97['model'];_0x431f70[_0xa9f6('0x41')]=qs[_0xa9f6('0x42')](_0x19d95f[_0xa9f6('0x3a')][_0xa9f6('0x42')]);_0x431f70[_0xa9f6('0x43')]=qs[_0xa9f6('0x3b')](_[_0xa9f6('0x44')](_0x19d95f[_0xa9f6('0x3a')],_0x25cf97[_0xa9f6('0x3b')]));if(_0x19d95f[_0xa9f6('0x3a')][_0xa9f6('0x45')]){_0x431f70[_0xa9f6('0x43')]=_[_0xa9f6('0x46')](_0x431f70[_0xa9f6('0x43')],{'$or':_[_0xa9f6('0x33')](_0x431f70[_0xa9f6('0x3c')],function(_0x3e7583){var _0x3808dc={};_0x3808dc[_0x3e7583]={'$like':'%'+_0x19d95f[_0xa9f6('0x3a')][_0xa9f6('0x45')]+'%'};return _0x3808dc;})});}_0x431f70=_[_0xa9f6('0x46')]({},_0x431f70,_0x19d95f[_0xa9f6('0x47')]);return _0x2cce97['getApplications'](_0x431f70);}})[_0xa9f6('0x17')](function(_0x2d4ff9){if(_0x2d4ff9){_0x72841d=_0x2d4ff9[_0xa9f6('0x3e')];if(!_0x19d95f['query']['hasOwnProperty'](_0xa9f6('0x40'))){_0x431f70['limit']=qs['limit'](_0x19d95f[_0xa9f6('0x3a')]['limit']);_0x431f70['offset']=qs[_0xa9f6('0x25')](_0x19d95f[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}return _0x2cce97[_0xa9f6('0x10f')](_0x431f70);}})[_0xa9f6('0x17')](function(_0x5bf93a){if(_0x5bf93a){return _0x5bf93a?{'count':_0x72841d,'rows':_0x5bf93a}:null;}})[_0xa9f6('0x17')](respondWithResult(_0x391827,null))[_0xa9f6('0x21')](handleError(_0x391827,null));};exports[_0xa9f6('0x110')]=function(_0x215a36,_0x414ac8){return db[_0xa9f6('0x111')]['find']({'where':{'id':_0x215a36[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x414ac8,null))[_0xa9f6('0x17')](function(_0x4de846){if(_0x4de846){return _0x4de846[_0xa9f6('0x110')](_0x215a36[_0xa9f6('0x55')]['ids'],_[_0xa9f6('0xe2')](_0x215a36[_0xa9f6('0x55')],[_0xa9f6('0x5e'),'id'])||{});}})[_0xa9f6('0x17')](respondWithResult(_0x414ac8,null))[_0xa9f6('0x21')](handleError(_0x414ac8,null));};exports[_0xa9f6('0xf8')]=function(_0x5eb4f5,_0x265f71){var _0x55ae24={};var _0x5a171b={};var _0x47de82;var _0x4525d4;return db[_0xa9f6('0x34')][_0xa9f6('0x5b')]({'where':{'id':_0x5eb4f5[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x265f71,null))[_0xa9f6('0x17')](function(_0x264000){if(_0x264000){_0x47de82=_0x264000;_0x5a171b[_0xa9f6('0x38')]=_[_0xa9f6('0x39')](db[_0xa9f6('0x112')][_0xa9f6('0x35')]);_0x5a171b[_0xa9f6('0x3a')]=_[_0xa9f6('0x39')](_0x5eb4f5[_0xa9f6('0x3a')]);_0x5a171b[_0xa9f6('0x3b')]=_[_0xa9f6('0x4c')](_0x5a171b[_0xa9f6('0x38')],_0x5a171b[_0xa9f6('0x3a')]);_0x55ae24[_0xa9f6('0x3c')]=_[_0xa9f6('0x4c')](_0x5a171b[_0xa9f6('0x38')],qs[_0xa9f6('0x3d')](_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x55ae24[_0xa9f6('0x3c')]=_0x55ae24['attributes'][_0xa9f6('0x3e')]?_0x55ae24['attributes']:_0x5a171b['model'];_0x55ae24[_0xa9f6('0x41')]=qs[_0xa9f6('0x42')](_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x42')]);_0x55ae24[_0xa9f6('0x43')]=qs[_0xa9f6('0x3b')](_['pick'](_0x5eb4f5[_0xa9f6('0x3a')],_0x5a171b[_0xa9f6('0x3b')]));if(_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x45')]){_0x55ae24[_0xa9f6('0x43')]=_[_0xa9f6('0x46')](_0x55ae24[_0xa9f6('0x43')],{'$or':_[_0xa9f6('0x33')](_0x55ae24[_0xa9f6('0x3c')],function(_0x19b802){var _0x20e7b1={};_0x20e7b1[_0x19b802]={'$like':'%'+_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x45')]+'%'};return _0x20e7b1;})});}_0x55ae24=_['merge']({},_0x55ae24,_0x5eb4f5['options']);return _0x47de82[_0xa9f6('0xf8')](_0x55ae24);}})['then'](function(_0x55c07d){if(_0x55c07d){_0x4525d4=_0x55c07d['length'];if(!_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x3f')]('nolimit')){_0x55ae24['limit']=qs[_0xa9f6('0x27')](_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x27')]);_0x55ae24[_0xa9f6('0x25')]=qs[_0xa9f6('0x25')](_0x5eb4f5[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}return _0x47de82[_0xa9f6('0xf8')](_0x55ae24);}})[_0xa9f6('0x17')](function(_0x286f00){if(_0x286f00){return _0x286f00?{'count':_0x4525d4,'rows':_0x286f00}:null;}})[_0xa9f6('0x17')](respondWithResult(_0x265f71,null))['catch'](handleError(_0x265f71,null));};exports[_0xa9f6('0x113')]=function(_0x4cb8d0,_0x58f5c3){var _0x5350c6=_0x4cb8d0[_0xa9f6('0x3a')][_0xa9f6('0x114')]===_0xa9f6('0x115')?_0xa9f6('0x116'):_0xa9f6('0x117');return db['ChatWebsite'][_0xa9f6('0x4e')]({'attributes':['id',_0x5350c6],'where':{'id':_0x4cb8d0['params']['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x58f5c3,null))[_0xa9f6('0x17')](function(_0x43c35d){if(_0x43c35d){var _0x5ef74c=_0x43c35d[_0x5350c6];var _0x5261b1=_0x5ef74c&&_0x5ef74c[_0xa9f6('0x118')]?_0x5ef74c[_0xa9f6('0x118')]:[];_0x58f5c3[_0xa9f6('0xbe')]({'fromKey':_[_0xa9f6('0x6f')](_0x5ef74c[_0xa9f6('0x119')])?undefined:_0x5ef74c[_0xa9f6('0x119')],'count':_0x5261b1[_0xa9f6('0x3e')],'rows':_0x5261b1});}})[_0xa9f6('0x21')](handleError(_0x58f5c3,null));};exports[_0xa9f6('0x11a')]=function(_0x27be70,_0x4341a7){var _0x114409={'raw':![],'where':{}};var _0x51f670={};var _0x239735={'count':0x0,'rows':[]};return db[_0xa9f6('0x34')][_0xa9f6('0x5b')]({'where':{'id':_0x27be70['params']['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x4341a7,null))[_0xa9f6('0x17')](function(_0x13d266){if(_0x13d266){_0x51f670[_0xa9f6('0x38')]=_[_0xa9f6('0x39')](db[_0xa9f6('0xc8')][_0xa9f6('0x35')]);_0x51f670[_0xa9f6('0x3a')]=_[_0xa9f6('0x39')](_0x27be70[_0xa9f6('0x3a')]);_0x51f670['filters']=_['intersection'](_0x51f670[_0xa9f6('0x38')],_0x51f670[_0xa9f6('0x3a')]);_0x114409['attributes']=_[_0xa9f6('0x4c')](_0x51f670['model'],qs[_0xa9f6('0x3d')](_0x27be70[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x114409[_0xa9f6('0x3c')]=_0x114409['attributes']['length']?_0x114409['attributes']:_0x51f670[_0xa9f6('0x38')];if(!_0x27be70['query']['hasOwnProperty'](_0xa9f6('0x40'))){_0x114409[_0xa9f6('0x27')]=qs['limit'](_0x27be70['query'][_0xa9f6('0x27')]);_0x114409['offset']=qs[_0xa9f6('0x25')](_0x27be70[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}_0x114409[_0xa9f6('0x41')]=qs[_0xa9f6('0x42')](_0x27be70[_0xa9f6('0x3a')]['sort']);_0x114409[_0xa9f6('0x43')]=qs[_0xa9f6('0x3b')](_['pick'](_0x27be70[_0xa9f6('0x3a')],_0x51f670['filters']));_0x114409[_0xa9f6('0x43')][_0xa9f6('0x58')]=_0x13d266['id'];if(_0x27be70[_0xa9f6('0x3a')][_0xa9f6('0x45')]){_0x114409[_0xa9f6('0x43')]=_[_0xa9f6('0x46')](_0x114409[_0xa9f6('0x43')],{'$or':_['map'](_0x114409[_0xa9f6('0x3c')],function(_0x1d8977){var _0x563ac7={};_0x563ac7[_0x1d8977]={'$like':'%'+_0x27be70[_0xa9f6('0x3a')][_0xa9f6('0x45')]+'%'};return _0x563ac7;})});}_0x114409=_['merge']({},_0x114409,_0x27be70['options']);return db[_0xa9f6('0xc8')][_0xa9f6('0x28')]({'where':_0x114409[_0xa9f6('0x43')]})[_0xa9f6('0x17')](function(_0x58a096){_0x239735[_0xa9f6('0x28')]=_0x58a096;if(_0x27be70[_0xa9f6('0x3a')]['includeAll']){_0x114409[_0xa9f6('0x4d')]=[{'all':!![]}];}else{_0x114409[_0xa9f6('0x4d')]=[{'model':db[_0xa9f6('0x7e')],'as':'Contact','required':![]},{'model':db[_0xa9f6('0xce')],'as':_0xa9f6('0x11b'),'required':![]}];}return db['ChatOfflineMessage'][_0xa9f6('0x49')](_0x114409);})['then'](function(_0x32ef89){_0x239735[_0xa9f6('0x5c')]=_0x32ef89;return _0x239735;});}})[_0xa9f6('0x17')](respondWithFilteredResult(_0x4341a7,_0x114409))[_0xa9f6('0x21')](handleError(_0x4341a7,null));};exports[_0xa9f6('0x11c')]=function(_0x21d0ab,_0x14ebd4){return db['ChatWebsite'][_0xa9f6('0x4e')]({'where':{'id':_0x21d0ab[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x14ebd4,null))['then'](function(_0x1ef4cb){if(_0x1ef4cb){return _0x1ef4cb['addAgents'](_0x21d0ab[_0xa9f6('0x55')]['ids'],_[_0xa9f6('0xe2')](_0x21d0ab[_0xa9f6('0x55')],[_0xa9f6('0x5e'),'id'])||{})[_0xa9f6('0xc3')](function(_0x21247d){for(var _0x1ac4d8=0x0;_0x1ac4d8<_0x21d0ab[_0xa9f6('0x55')][_0xa9f6('0x5e')][_0xa9f6('0x3e')];_0x1ac4d8+=0x1){socket[_0xa9f6('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x21d0ab[_0xa9f6('0x55')]['ids'][_0x1ac4d8]),'ChatWebsiteId':Number(_0x21d0ab[_0xa9f6('0x4b')]['id'])});}return _0x21247d;});}})['then'](respondWithResult(_0x14ebd4,null))[_0xa9f6('0x21')](handleError(_0x14ebd4,null));};exports[_0xa9f6('0x11e')]=function(_0x31a716,_0x2e164b){return db['ChatWebsite'][_0xa9f6('0x4e')]({'where':{'id':_0x31a716[_0xa9f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e164b,null))['then'](function(_0x479831){if(_0x479831){return _0x479831[_0xa9f6('0x11e')](_0x31a716[_0xa9f6('0x3a')][_0xa9f6('0x5e')])['then'](function(){if(_['isArray'](_0x31a716[_0xa9f6('0x3a')][_0xa9f6('0x5e')])){for(var _0x354937=0x0;_0x354937<_0x31a716['query']['ids'][_0xa9f6('0x3e')];_0x354937+=0x1){socket['emit'](_0xa9f6('0x11f'),{'UserId':Number(_0x31a716[_0xa9f6('0x3a')][_0xa9f6('0x5e')][_0x354937]),'ChatWebsiteId':Number(_0x31a716[_0xa9f6('0x4b')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x31a716[_0xa9f6('0x3a')][_0xa9f6('0x5e')]),'ChatWebsiteId':Number(_0x31a716['params']['id'])});}});}})[_0xa9f6('0x17')](respondWithStatusCode(_0x2e164b,null))[_0xa9f6('0x21')](handleError(_0x2e164b,null));};exports[_0xa9f6('0x120')]=function(_0x3c5578,_0x872d30){var _0x36487b={};var _0x2e534b={};var _0x3e1179;var _0x457d09;return db['ChatWebsite']['findOne']({'where':{'id':_0x3c5578[_0xa9f6('0x4b')]['id']}})[_0xa9f6('0x17')](handleEntityNotFound(_0x872d30,null))[_0xa9f6('0x17')](function(_0x25b1c0){if(_0x25b1c0){_0x3e1179=_0x25b1c0;_0x2e534b['model']=_[_0xa9f6('0x39')](db[_0xa9f6('0xb7')][_0xa9f6('0x35')]);_0x2e534b[_0xa9f6('0x3a')]=_[_0xa9f6('0x39')](_0x3c5578[_0xa9f6('0x3a')]);_0x2e534b[_0xa9f6('0x3b')]=_[_0xa9f6('0x4c')](_0x2e534b[_0xa9f6('0x38')],_0x2e534b[_0xa9f6('0x3a')]);_0x36487b[_0xa9f6('0x3c')]=_[_0xa9f6('0x4c')](_0x2e534b[_0xa9f6('0x38')],qs[_0xa9f6('0x3d')](_0x3c5578[_0xa9f6('0x3a')][_0xa9f6('0x3d')]));_0x36487b['attributes']=_0x36487b['attributes']['length']?_0x36487b[_0xa9f6('0x3c')]:_0x2e534b[_0xa9f6('0x38')];_0x36487b[_0xa9f6('0x41')]=qs[_0xa9f6('0x42')](_0x3c5578[_0xa9f6('0x3a')][_0xa9f6('0x42')]);_0x36487b[_0xa9f6('0x43')]=qs[_0xa9f6('0x3b')](_[_0xa9f6('0x44')](_0x3c5578[_0xa9f6('0x3a')],_0x2e534b[_0xa9f6('0x3b')]));if(_0x3c5578[_0xa9f6('0x3a')][_0xa9f6('0x45')]){_0x36487b[_0xa9f6('0x43')]=_[_0xa9f6('0x46')](_0x36487b[_0xa9f6('0x43')],{'$or':_['map'](_0x36487b[_0xa9f6('0x3c')],function(_0x1a19f1){var _0x189562={};_0x189562[_0x1a19f1]={'$like':'%'+_0x3c5578[_0xa9f6('0x3a')][_0xa9f6('0x45')]+'%'};return _0x189562;})});}_0x36487b=_['merge']({},_0x36487b,_0x3c5578[_0xa9f6('0x47')]);return _0x3e1179[_0xa9f6('0x120')](_0x36487b);}})[_0xa9f6('0x17')](function(_0x2815fc){if(_0x2815fc){_0x457d09=_0x2815fc[_0xa9f6('0x3e')];if(!_0x3c5578['query'][_0xa9f6('0x3f')](_0xa9f6('0x40'))){_0x36487b[_0xa9f6('0x27')]=qs[_0xa9f6('0x27')](_0x3c5578[_0xa9f6('0x3a')]['limit']);_0x36487b[_0xa9f6('0x25')]=qs[_0xa9f6('0x25')](_0x3c5578[_0xa9f6('0x3a')][_0xa9f6('0x25')]);}return _0x3e1179[_0xa9f6('0x120')](_0x36487b);}})['then'](function(_0x491d8d){if(_0x491d8d){return _0x491d8d?{'count':_0x457d09,'rows':_0x491d8d}:null;}})[_0xa9f6('0x17')](respondWithResult(_0x872d30,null))[_0xa9f6('0x21')](handleError(_0x872d30,null));};
\ No newline at end of file
+var _0x0692=['Owner','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','addApplications','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','items','fromKey','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','filter','options','includeAll','include','findAll','rows','show','Pause','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','find','ChatWebsiteId','Disposition','params','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','server/files/images/logos/','download','getAvatar','join','server/files/images/avatars/default_avatar.png','isNil','existsSync','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','account','from','customerIp','headers','cf-connecting-ip','x-forwarded-for','split','x-real-port','referer','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','contact','lastName','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','format','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','server','attachments','remove','addInteraction','omit','getInteractions','Contact'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0x0692,0x15b));var _0x2069=function(_0x23b7d6,_0x55846d){_0x23b7d6=_0x23b7d6-0x0;var _0x489b2f=_0x0692[_0x23b7d6];return _0x489b2f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x2069('0x0'));var util=require(_0x2069('0x1'));var path=require(_0x2069('0x2'));var ejs=require(_0x2069('0x3'));var fs=require('fs');var fs_extra=require(_0x2069('0x4'));var _=require(_0x2069('0x5'));var querystring=require(_0x2069('0x6'));var Redis=require('ioredis');var qs=require(_0x2069('0x7'));var logger=require(_0x2069('0x8'))(_0x2069('0x9'));var config=require(_0x2069('0xa'));var db=require(_0x2069('0xb'))['db'];config[_0x2069('0xc')]=_[_0x2069('0xd')](config['redis'],{'host':_0x2069('0xe'),'port':0x18eb});var socket=require(_0x2069('0xf'))(new Redis(config[_0x2069('0xc')]));require(_0x2069('0x10'))[_0x2069('0x11')](socket);var htmlToText=require(_0x2069('0x12'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2069('0x13')]({'port':0x232c});var client9002=jayson[_0x2069('0x14')][_0x2069('0x13')]({'port':0x232a});var client9003=jayson[_0x2069('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x2069('0x14')][_0x2069('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x185b2e,_0x4e572d,_0xa18ce3,_0x59d46b){return new BPromise(function(_0x1789be,_0x1f9d7d){var _0x1d5d27=_0x59d46b||client;return _0x1d5d27[_0x2069('0x15')](_0x185b2e,_0xa18ce3)[_0x2069('0x16')](function(_0x545868){logger[_0x2069('0x17')](_0x2069('0x18'),_0x4e572d,_0x2069('0x19'));logger[_0x2069('0x1a')](_0x2069('0x1b'),_0x4e572d,'request\x20sent',JSON[_0x2069('0x1c')](_0x545868));if(_0x545868[_0x2069('0x1d')]){if(_0x545868['error'][_0x2069('0x1e')]===0x1f4){logger[_0x2069('0x1d')](_0x2069('0x18'),_0x4e572d,_0x545868[_0x2069('0x1d')][_0x2069('0x1f')]);return _0x1f9d7d(_0x545868[_0x2069('0x1d')][_0x2069('0x1f')]);}logger[_0x2069('0x1d')](_0x2069('0x18'),_0x4e572d,_0x545868['error'][_0x2069('0x1f')]);return _0x1789be(_0x545868[_0x2069('0x1d')][_0x2069('0x1f')]);}else{logger['info'](_0x2069('0x18'),_0x4e572d,_0x2069('0x19'));_0x1789be(_0x545868['result'][_0x2069('0x1f')]);}})[_0x2069('0x20')](function(_0x2083ee){logger[_0x2069('0x1d')](_0x2069('0x18'),_0x4e572d,_0x2083ee);_0x1f9d7d(_0x2083ee);});});}function respondWithStatusCode(_0x4647bf,_0x506853){_0x506853=_0x506853||0xcc;return function(_0x73c3a9){if(_0x73c3a9){return _0x4647bf[_0x2069('0x21')](_0x506853);}return _0x4647bf['status'](_0x506853)[_0x2069('0x22')]();};}function respondWithResult(_0x2b5689,_0x1246a4){_0x1246a4=_0x1246a4||0xc8;return function(_0x3bbdbd){if(_0x3bbdbd){return _0x2b5689[_0x2069('0x23')](_0x1246a4)[_0x2069('0x24')](_0x3bbdbd);}};}function respondWithFilteredResult(_0x4cbd2f,_0x286fd1){return function(_0x19e90c){if(_0x19e90c){var _0x5ef7a6=typeof _0x286fd1[_0x2069('0x25')]==='undefined'&&typeof _0x286fd1[_0x2069('0x26')]===_0x2069('0x27');var _0x486172=_0x19e90c[_0x2069('0x28')];var _0x21ef5c=_0x5ef7a6?0x0:_0x286fd1[_0x2069('0x25')];var _0x2679dc=_0x5ef7a6?_0x19e90c[_0x2069('0x28')]:_0x286fd1['offset']+_0x286fd1[_0x2069('0x26')];var _0xdffcff;if(_0x2679dc>=_0x486172){_0x2679dc=_0x486172;_0xdffcff=0xc8;}else{_0xdffcff=0xce;}_0x4cbd2f[_0x2069('0x23')](_0xdffcff);return _0x4cbd2f[_0x2069('0x29')](_0x2069('0x2a'),_0x21ef5c+'-'+_0x2679dc+'/'+_0x486172)[_0x2069('0x24')](_0x19e90c);}return null;};}function saveUpdates(_0x47a28d){return function(_0x548db9){if(_0x548db9){return _0x548db9[_0x2069('0x2b')](_0x47a28d)[_0x2069('0x16')](function(_0x566b3e){return _0x566b3e;});}return null;};}function removeEntity(_0x5e6dd1){return function(_0x3c7e02){if(_0x3c7e02){return _0x3c7e02[_0x2069('0x2c')]()[_0x2069('0x16')](function(){var _0x164f7f=_0x3c7e02[_0x2069('0x2d')]({'plain':!![]});var _0x2685be=_0x2069('0x2e');return db[_0x2069('0x2f')]['destroy']({'where':{'type':_0x2685be,'resourceId':_0x164f7f['id']}})[_0x2069('0x16')](function(){return _0x3c7e02;});})[_0x2069('0x16')](function(){_0x5e6dd1[_0x2069('0x23')](0xcc)[_0x2069('0x22')]();});}};}function handleEntityNotFound(_0xc7a491){return function(_0x5e1353){if(!_0x5e1353){_0xc7a491[_0x2069('0x21')](0x194);}return _0x5e1353;};}function handleError(_0x30b9ec,_0x27123e){_0x27123e=_0x27123e||0x1f4;return function(_0x3a64d1){logger[_0x2069('0x1d')](_0x3a64d1[_0x2069('0x30')]);if(_0x3a64d1[_0x2069('0x31')]){delete _0x3a64d1['name'];}_0x30b9ec[_0x2069('0x23')](_0x27123e)[_0x2069('0x32')](_0x3a64d1);};}exports['index']=function(_0x4c7edf,_0x1cacd7){var _0x3b4b36={'include':[{'model':db['Pause'],'as':_0x2069('0x33')}]},_0x5a9948={},_0xca8e2={'count':0x0,'rows':[]};var _0x5012e5=_[_0x2069('0x34')](db[_0x2069('0x35')][_0x2069('0x36')],function(_0x1d9036){return{'name':_0x1d9036['fieldName'],'type':_0x1d9036[_0x2069('0x37')][_0x2069('0x38')]};});_0x5a9948[_0x2069('0x39')]=_[_0x2069('0x34')](_0x5012e5,_0x2069('0x31'));_0x5a9948[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0x4c7edf[_0x2069('0x3a')]);_0x5a9948[_0x2069('0x3c')]=_[_0x2069('0x3d')](_0x5a9948[_0x2069('0x39')],_0x5a9948[_0x2069('0x3a')]);_0x3b4b36[_0x2069('0x3e')]=_[_0x2069('0x3d')](_0x5a9948[_0x2069('0x39')],qs['fields'](_0x4c7edf[_0x2069('0x3a')]['fields']));_0x3b4b36['attributes']=_0x3b4b36[_0x2069('0x3e')][_0x2069('0x3f')]?_0x3b4b36[_0x2069('0x3e')]:_0x5a9948[_0x2069('0x39')];if(!_0x4c7edf[_0x2069('0x3a')][_0x2069('0x40')](_0x2069('0x41'))){_0x3b4b36[_0x2069('0x26')]=qs[_0x2069('0x26')](_0x4c7edf[_0x2069('0x3a')][_0x2069('0x26')]);_0x3b4b36[_0x2069('0x25')]=qs[_0x2069('0x25')](_0x4c7edf[_0x2069('0x3a')][_0x2069('0x25')]);}_0x3b4b36[_0x2069('0x42')]=qs[_0x2069('0x43')](_0x4c7edf[_0x2069('0x3a')]['sort']);_0x3b4b36['where']=qs['filters'](_['pick'](_0x4c7edf['query'],_0x5a9948[_0x2069('0x3c')]),_0x5012e5);if(_0x4c7edf[_0x2069('0x3a')]['filter']){_0x3b4b36['where']=_[_0x2069('0x44')](_0x3b4b36[_0x2069('0x45')],{'$or':_[_0x2069('0x34')](_0x5012e5,function(_0x517d1c){if(_0x517d1c[_0x2069('0x37')]!=='VIRTUAL'){var _0x48edf0={};_0x48edf0[_0x517d1c[_0x2069('0x31')]]={'$like':'%'+_0x4c7edf['query'][_0x2069('0x46')]+'%'};return _0x48edf0;}})});}_0x3b4b36=_[_0x2069('0x44')]({},_0x3b4b36,_0x4c7edf[_0x2069('0x47')]);var _0xdcbde4={'where':_0x3b4b36[_0x2069('0x45')]};return db['ChatWebsite'][_0x2069('0x28')](_0xdcbde4)[_0x2069('0x16')](function(_0x149905){_0xca8e2[_0x2069('0x28')]=_0x149905;if(_0x4c7edf[_0x2069('0x3a')][_0x2069('0x48')]){_0x3b4b36[_0x2069('0x49')]=[{'all':!![]}];}return db[_0x2069('0x35')][_0x2069('0x4a')](_0x3b4b36);})['then'](function(_0x1006c9){_0xca8e2[_0x2069('0x4b')]=_0x1006c9;return _0xca8e2;})[_0x2069('0x16')](respondWithFilteredResult(_0x1cacd7,_0x3b4b36))[_0x2069('0x20')](handleError(_0x1cacd7,null));};exports[_0x2069('0x4c')]=function(_0xe27827,_0x1220c8){var _0x2182f4={'raw':![],'where':{'id':_0xe27827['params']['id']},'include':[{'model':db[_0x2069('0x4d')],'as':_0x2069('0x33')}]},_0x97d0cc={};_0x97d0cc['model']=_[_0x2069('0x3b')](db[_0x2069('0x35')][_0x2069('0x36')]);_0x97d0cc[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0xe27827[_0x2069('0x3a')]);_0x97d0cc[_0x2069('0x3c')]=_['intersection'](_0x97d0cc['model'],_0x97d0cc['query']);_0x2182f4[_0x2069('0x3e')]=_['intersection'](_0x97d0cc[_0x2069('0x39')],qs[_0x2069('0x4e')](_0xe27827[_0x2069('0x3a')][_0x2069('0x4e')]));_0x2182f4[_0x2069('0x3e')]=_0x2182f4['attributes'][_0x2069('0x3f')]?_0x2182f4[_0x2069('0x3e')]:_0x97d0cc[_0x2069('0x39')];if(_0xe27827[_0x2069('0x3a')]['includeAll']){_0x2182f4[_0x2069('0x49')]=[{'all':!![]}];}_0x2182f4=_[_0x2069('0x44')]({},_0x2182f4,_0xe27827['options']);return db[_0x2069('0x35')]['find'](_0x2182f4)['then'](handleEntityNotFound(_0x1220c8,null))['then'](respondWithResult(_0x1220c8,null))['catch'](handleError(_0x1220c8,null));};exports['create']=function(_0x523082,_0x1a8646){return db[_0x2069('0x35')][_0x2069('0x4f')](_0x523082[_0x2069('0x50')],{})[_0x2069('0x16')](function(_0x3b9a82){var _0x14d216=_0x523082[_0x2069('0x51')]['get']({'plain':!![]});if(!_0x14d216)throw new Error(_0x2069('0x52'));if(_0x14d216[_0x2069('0x53')]===_0x2069('0x51')){var _0x553f30=_0x3b9a82['get']({'plain':!![]});var _0x4b937a='ChatWebsites';return db[_0x2069('0x54')]['find']({'where':{'name':_0x4b937a,'userProfileId':_0x14d216['userProfileId']},'raw':!![]})[_0x2069('0x16')](function(_0x409b95){if(_0x409b95&&_0x409b95[_0x2069('0x55')]===0x0){return db[_0x2069('0x2f')][_0x2069('0x4f')]({'name':_0x553f30['name'],'resourceId':_0x553f30['id'],'type':_0x409b95[_0x2069('0x31')],'sectionId':_0x409b95['id']},{})[_0x2069('0x16')](function(){return _0x3b9a82;});}else{return _0x3b9a82;}})[_0x2069('0x20')](function(_0x142597){logger['error'](_0x2069('0x56'),_0x142597);throw _0x142597;});}return _0x3b9a82;})['then'](respondWithResult(_0x1a8646,0xc9))[_0x2069('0x20')](handleError(_0x1a8646,null));};exports[_0x2069('0x2b')]=function(_0x4135bc,_0x3fecb3){if(_0x4135bc[_0x2069('0x50')]['id']){delete _0x4135bc[_0x2069('0x50')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4135bc['params']['id']},'include':[{'model':db[_0x2069('0x4d')],'as':_0x2069('0x33')}]})['then'](handleEntityNotFound(_0x3fecb3,null))['then'](saveUpdates(_0x4135bc[_0x2069('0x50')],null))['then'](respondWithResult(_0x3fecb3,null))[_0x2069('0x20')](handleError(_0x3fecb3,null));};exports[_0x2069('0x2c')]=function(_0x1edd2e,_0x5ba7cc){return db[_0x2069('0x35')]['find']({'where':{'id':_0x1edd2e['params']['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x5ba7cc,null))[_0x2069('0x16')](removeEntity(_0x5ba7cc,null))[_0x2069('0x20')](handleError(_0x5ba7cc,null));};exports[_0x2069('0x57')]=function(_0x332816,_0x4c508b){return db['ChatWebsite']['describe']()[_0x2069('0x16')](respondWithResult(_0x4c508b,null))[_0x2069('0x20')](handleError(_0x4c508b,null));};exports[_0x2069('0x58')]=function(_0x5b9fb5,_0x3e6e1d){if(_0x5b9fb5[_0x2069('0x50')]['id']){delete _0x5b9fb5['body']['id'];}return db['ChatWebsite'][_0x2069('0x59')]({'where':{'id':_0x5b9fb5['params']['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x3e6e1d,null))[_0x2069('0x16')](function(_0x245513){if(_0x245513){_0x5b9fb5[_0x2069('0x50')][_0x2069('0x5a')]=_0x245513['id'];return db[_0x2069('0x5b')]['create'](_0x5b9fb5[_0x2069('0x50')]);}})[_0x2069('0x16')](respondWithResult(_0x3e6e1d,null))['catch'](handleError(_0x3e6e1d,null));};exports['getDispositions']=function(_0x25473c,_0x2258d6){var _0x348b37={'raw':![],'where':{}};var _0x13ead4={};var _0x562b4a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x25473c[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x2258d6,null))['then'](function(_0x1b0c89){if(_0x1b0c89){_0x13ead4[_0x2069('0x39')]=_[_0x2069('0x3b')](db['Disposition'][_0x2069('0x36')]);_0x13ead4['query']=_[_0x2069('0x3b')](_0x25473c[_0x2069('0x3a')]);_0x13ead4[_0x2069('0x3c')]=_[_0x2069('0x3d')](_0x13ead4[_0x2069('0x39')],_0x13ead4[_0x2069('0x3a')]);_0x348b37['attributes']=_['intersection'](_0x13ead4[_0x2069('0x39')],qs[_0x2069('0x4e')](_0x25473c['query']['fields']));_0x348b37[_0x2069('0x3e')]=_0x348b37[_0x2069('0x3e')][_0x2069('0x3f')]?_0x348b37[_0x2069('0x3e')]:_0x13ead4[_0x2069('0x39')];if(!_0x25473c['query'][_0x2069('0x40')](_0x2069('0x41'))){_0x348b37[_0x2069('0x26')]=qs[_0x2069('0x26')](_0x25473c[_0x2069('0x3a')][_0x2069('0x26')]);_0x348b37['offset']=qs[_0x2069('0x25')](_0x25473c[_0x2069('0x3a')]['offset']);}_0x348b37[_0x2069('0x42')]=qs[_0x2069('0x43')](_0x25473c[_0x2069('0x3a')]['sort']);_0x348b37[_0x2069('0x45')]=qs['filters'](_[_0x2069('0x5d')](_0x25473c[_0x2069('0x3a')],_0x13ead4[_0x2069('0x3c')]));_0x348b37[_0x2069('0x45')][_0x2069('0x5a')]=_0x1b0c89['id'];if(_0x25473c['query']['filter']){_0x348b37['where']=_[_0x2069('0x44')](_0x348b37[_0x2069('0x45')],{'$or':_[_0x2069('0x34')](_0x348b37['attributes'],function(_0x3ece0d){var _0x4910c7={};_0x4910c7[_0x3ece0d]={'$like':'%'+_0x25473c['query'][_0x2069('0x46')]+'%'};return _0x4910c7;})});}_0x348b37=_['merge']({},_0x348b37,_0x25473c['options']);return db[_0x2069('0x5b')]['count']({'where':_0x348b37['where']})[_0x2069('0x16')](function(_0x28d0b6){_0x562b4a[_0x2069('0x28')]=_0x28d0b6;if(_0x25473c[_0x2069('0x3a')]['includeAll']){_0x348b37['include']=[{'all':!![]}];}return db['Disposition'][_0x2069('0x4a')](_0x348b37);})[_0x2069('0x16')](function(_0x3d3ec1){_0x562b4a[_0x2069('0x4b')]=_0x3d3ec1;return _0x562b4a;});}})[_0x2069('0x16')](respondWithFilteredResult(_0x2258d6,_0x348b37))[_0x2069('0x20')](handleError(_0x2258d6,null));};exports[_0x2069('0x5e')]=function(_0x4a3e15,_0x2dc294){return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x4a3e15[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x2dc294,null))['then'](function(_0x3379ac){if(_0x3379ac){return _0x3379ac[_0x2069('0x5e')](_0x4a3e15[_0x2069('0x3a')][_0x2069('0x5f')]);}})[_0x2069('0x16')](respondWithStatusCode(_0x2dc294,null))['catch'](handleError(_0x2dc294,null));};exports[_0x2069('0x60')]=function(_0x3340b6,_0x214065){if(_0x3340b6[_0x2069('0x50')]['id']){delete _0x3340b6[_0x2069('0x50')]['id'];}return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x3340b6[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x214065,null))[_0x2069('0x16')](function(_0xbf2fd8){if(_0xbf2fd8){_0x3340b6[_0x2069('0x50')][_0x2069('0x5a')]=_0xbf2fd8['id'];return db['CannedAnswer'][_0x2069('0x4f')](_0x3340b6[_0x2069('0x50')]);}})[_0x2069('0x16')](respondWithResult(_0x214065,null))['catch'](handleError(_0x214065,null));};exports[_0x2069('0x61')]=function(_0x5ef8ec,_0x442fdb){var _0x1cc2f0={'raw':![],'where':{}};var _0x21c432={};var _0x3f4483={'count':0x0,'rows':[]};return db[_0x2069('0x35')][_0x2069('0x62')]({'where':{'id':_0x5ef8ec['params']['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x442fdb,null))['then'](function(_0x1398a6){if(_0x1398a6){_0x21c432[_0x2069('0x39')]=_[_0x2069('0x3b')](db[_0x2069('0x63')][_0x2069('0x36')]);_0x21c432[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0x5ef8ec[_0x2069('0x3a')]);_0x21c432['filters']=_[_0x2069('0x3d')](_0x21c432[_0x2069('0x39')],_0x21c432[_0x2069('0x3a')]);_0x1cc2f0[_0x2069('0x3e')]=_['intersection'](_0x21c432['model'],qs[_0x2069('0x4e')](_0x5ef8ec[_0x2069('0x3a')][_0x2069('0x4e')]));_0x1cc2f0['attributes']=_0x1cc2f0[_0x2069('0x3e')][_0x2069('0x3f')]?_0x1cc2f0[_0x2069('0x3e')]:_0x21c432[_0x2069('0x39')];if(!_0x5ef8ec[_0x2069('0x3a')]['hasOwnProperty'](_0x2069('0x41'))){_0x1cc2f0[_0x2069('0x26')]=qs[_0x2069('0x26')](_0x5ef8ec[_0x2069('0x3a')][_0x2069('0x26')]);_0x1cc2f0['offset']=qs[_0x2069('0x25')](_0x5ef8ec['query'][_0x2069('0x25')]);}_0x1cc2f0[_0x2069('0x42')]=qs[_0x2069('0x43')](_0x5ef8ec['query']['sort']);_0x1cc2f0['where']=qs['filters'](_[_0x2069('0x5d')](_0x5ef8ec[_0x2069('0x3a')],_0x21c432[_0x2069('0x3c')]));_0x1cc2f0['where'][_0x2069('0x5a')]=_0x1398a6['id'];if(_0x5ef8ec[_0x2069('0x3a')][_0x2069('0x46')]){_0x1cc2f0[_0x2069('0x45')]=_[_0x2069('0x44')](_0x1cc2f0[_0x2069('0x45')],{'$or':_[_0x2069('0x34')](_0x1cc2f0['attributes'],function(_0x56b209){var _0xd5f665={};_0xd5f665[_0x56b209]={'$like':'%'+_0x5ef8ec[_0x2069('0x3a')][_0x2069('0x46')]+'%'};return _0xd5f665;})});}_0x1cc2f0=_['merge']({},_0x1cc2f0,_0x5ef8ec['options']);return db[_0x2069('0x63')][_0x2069('0x28')]({'where':_0x1cc2f0[_0x2069('0x45')]})[_0x2069('0x16')](function(_0x50da2c){_0x3f4483[_0x2069('0x28')]=_0x50da2c;if(_0x5ef8ec['query']['includeAll']){_0x1cc2f0[_0x2069('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2069('0x4a')](_0x1cc2f0);})[_0x2069('0x16')](function(_0x51718a){_0x3f4483['rows']=_0x51718a;return _0x3f4483;});}})[_0x2069('0x16')](respondWithFilteredResult(_0x442fdb,_0x1cc2f0))[_0x2069('0x20')](handleError(_0x442fdb,null));};exports[_0x2069('0x64')]=function(_0x362f54,_0x14b49e){return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x362f54[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x14b49e,null))[_0x2069('0x16')](function(_0x2a46e6){if(_0x2a46e6){return _0x2a46e6[_0x2069('0x64')](_0x362f54[_0x2069('0x3a')][_0x2069('0x5f')]);}})['then'](respondWithStatusCode(_0x14b49e,null))[_0x2069('0x20')](handleError(_0x14b49e,null));};exports[_0x2069('0x65')]=function(_0x4f9b3d,_0x32e2af){_0x4f9b3d[_0x2069('0x50')][_0x2069('0x66')]=_0x4f9b3d[_0x2069('0x67')][_0x2069('0x68')];return db[_0x2069('0x35')]['find']({'where':{'id':_0x4f9b3d[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x32e2af,null))[_0x2069('0x16')](saveUpdates(_0x4f9b3d[_0x2069('0x50')],null))['then'](respondWithResult(_0x32e2af,null))[_0x2069('0x20')](handleError(_0x32e2af,null));};exports[_0x2069('0x69')]=function(_0x1c5412,_0x2d2c60){_0x1c5412[_0x2069('0x50')][_0x2069('0x6a')]=_0x1c5412[_0x2069('0x67')]['filename'];return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x1c5412[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x2d2c60,null))['then'](saveUpdates(_0x1c5412['body'],null))['then'](respondWithResult(_0x2d2c60,null))[_0x2069('0x20')](handleError(_0x2d2c60,null));};exports[_0x2069('0x6b')]=function(_0xe2354d,_0x518398){_0xe2354d[_0x2069('0x50')][_0x2069('0x6c')]=_0xe2354d[_0x2069('0x67')]['filename'];return db[_0x2069('0x35')]['find']({'where':{'id':_0xe2354d[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x518398,null))[_0x2069('0x16')](saveUpdates(_0xe2354d[_0x2069('0x50')],null))['then'](respondWithResult(_0x518398,null))[_0x2069('0x20')](handleError(_0x518398,null));};exports[_0x2069('0x6d')]=function(_0x362e62,_0x8f994d){_0x362e62[_0x2069('0x50')]['systemAvatar']=_0x362e62[_0x2069('0x67')][_0x2069('0x68')];return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x362e62[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x8f994d,null))[_0x2069('0x16')](saveUpdates(_0x362e62[_0x2069('0x50')],null))[_0x2069('0x16')](respondWithResult(_0x8f994d,null))[_0x2069('0x20')](handleError(_0x8f994d,null));};exports[_0x2069('0x6e')]=function(_0x31c97e,_0x40c410){var _0x35b8c6=path['join'](config[_0x2069('0x6f')],_0x2069('0x70'));var _0x59d574={'where':{'id':_0x31c97e[_0x2069('0x5c')]['id']},'attributes':['id',_0x2069('0x66')],'raw':!![]};var _0x7f9e55=![];return require('../../config/license/util')[_0x2069('0x71')]()[_0x2069('0x16')](function(_0x373675){if(_0x373675){_0x7f9e55=_0x373675[_0x2069('0x72')];}})['then'](function(){return db['ChatWebsite'][_0x2069('0x59')](_0x59d574);})['then'](handleEntityNotFound(_0x40c410,null))[_0x2069('0x16')](function(_0x3f1dda){if(_0x3f1dda){if(!_['isNil'](_0x3f1dda['sitepic'])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/logos/',_0x3f1dda['sitepic']))&&_0x7f9e55){_0x35b8c6=path['join'](config[_0x2069('0x6f')],_0x2069('0x73'),_0x3f1dda['sitepic']);}}return _0x40c410[_0x2069('0x74')](_0x35b8c6);}})['catch'](handleError(_0x40c410,null));};exports[_0x2069('0x75')]=function(_0x57e870,_0x233d68){var _0x1ad60e=path[_0x2069('0x76')](config[_0x2069('0x6f')],_0x2069('0x77'));var _0x3ce716={'where':{'id':_0x57e870['params']['id']},'attributes':['id',_0x2069('0x6a')],'raw':!![]};return db[_0x2069('0x35')][_0x2069('0x59')](_0x3ce716)[_0x2069('0x16')](handleEntityNotFound(_0x233d68,null))['then'](function(_0x4af5d1){if(_0x4af5d1){if(!_[_0x2069('0x78')](_0x4af5d1[_0x2069('0x6a')])){if(fs[_0x2069('0x79')](path[_0x2069('0x76')](config[_0x2069('0x6f')],'server/files/images/avatars/',_0x4af5d1[_0x2069('0x6a')]))){_0x1ad60e=path[_0x2069('0x76')](config[_0x2069('0x6f')],'server/files/images/avatars/',_0x4af5d1[_0x2069('0x6a')]);}}return _0x233d68[_0x2069('0x74')](_0x1ad60e);}})[_0x2069('0x20')](handleError(_0x233d68,null));};exports[_0x2069('0x7a')]=function(_0x2832ce,_0xd6e183){var _0x46b818=path[_0x2069('0x76')](config['root'],_0x2069('0x7b'));var _0x1a6844={'where':{'id':_0x2832ce[_0x2069('0x5c')]['id']},'attributes':['id',_0x2069('0x6c'),'showCustomerAvatar'],'raw':!![]};return db[_0x2069('0x35')][_0x2069('0x59')](_0x1a6844)[_0x2069('0x16')](handleEntityNotFound(_0xd6e183,null))['then'](function(_0x920014){if(_0x920014){if(!_[_0x2069('0x78')](_0x920014[_0x2069('0x6c')])){if(fs[_0x2069('0x79')](path['join'](config[_0x2069('0x6f')],_0x2069('0x7c'),_0x920014[_0x2069('0x6c')]))&&_0x920014[_0x2069('0x7d')]){_0x46b818=path['join'](config['root'],_0x2069('0x7c'),_0x920014[_0x2069('0x6c')]);}}return _0xd6e183['download'](_0x46b818);}})[_0x2069('0x20')](handleError(_0xd6e183,null));};exports[_0x2069('0x7e')]=function(_0x1cbfce,_0x41dce9){var _0x3387a2=path[_0x2069('0x76')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x334427={'where':{'id':_0x1cbfce[_0x2069('0x5c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x2069('0x35')][_0x2069('0x59')](_0x334427)[_0x2069('0x16')](handleEntityNotFound(_0x41dce9,null))['then'](function(_0xfbc769){if(_0xfbc769){if(!_['isNil'](_0xfbc769[_0x2069('0x7f')])){if(fs['existsSync'](path[_0x2069('0x76')](config[_0x2069('0x6f')],_0x2069('0x7c'),_0xfbc769[_0x2069('0x7f')]))){_0x3387a2=path[_0x2069('0x76')](config[_0x2069('0x6f')],_0x2069('0x7c'),_0xfbc769[_0x2069('0x7f')]);}}return _0x41dce9[_0x2069('0x74')](_0x3387a2);}})['catch'](handleError(_0x41dce9,null));};exports[_0x2069('0x80')]=function(_0x42cd34,_0x2308ea){var _0x1093b0=require(_0x2069('0x81'));var _0x2ad30c=new _0x1093b0();var _0x2ffa87=_0x2ad30c[_0x2069('0x82')](_0x42cd34['headers'][_0x2069('0x83')])[_0x2069('0x84')]();var _0x3823aa={'body':_0x42cd34[_0x2069('0x50')],'channel':_0x2069('0x85')};var _0x32e353=[];var _0x42c330=[];var _0x2c81d1={};var _0x596e64=![];return db[_0x2069('0x86')][_0x2069('0x57')]()['then'](function(_0x5978d5){if(!_0x5978d5){throw new db[(_0x2069('0x87'))][(_0x2069('0x88'))](_0x2069('0x89'));}_0x32e353=_[_0x2069('0x8a')](_['keys'](_0x5978d5),[_0x2069('0x8b'),'updatedAt']);_0x42c330=_[_0x2069('0x8a')](_[_0x2069('0x3b')](_0x5978d5),[_0x2069('0x8b'),_0x2069('0x8c'),'CompanyId',_0x2069('0x8d')]);if(_0x42cd34[_0x2069('0x50')]['id']){delete _0x42cd34[_0x2069('0x50')]['id'];}if(_[_0x2069('0x78')](_0x42cd34['body']['from'])){throw new db[(_0x2069('0x87'))]['ValidationError'](_0x2069('0x8e'));}if(_['isNil'](_0x42cd34[_0x2069('0x50')][_0x2069('0x50')])||_0x42cd34[_0x2069('0x50')][_0x2069('0x50')]===''){throw new db[(_0x2069('0x87'))][(_0x2069('0x88'))](_0x2069('0x8f'));}if(_[_0x2069('0x78')](_0x42cd34[_0x2069('0x50')]['mapKey'])){throw new db[(_0x2069('0x87'))][(_0x2069('0x88'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x42c330);}if(!_[_0x2069('0x90')](_0x42c330,_0x42cd34[_0x2069('0x50')][_0x2069('0x91')])){throw new db[(_0x2069('0x87'))]['ValidationError'](_0x2069('0x92')+_0x42c330);}_0x2c81d1[_0x42cd34[_0x2069('0x50')][_0x2069('0x91')]]=_0x42cd34[_0x2069('0x50')]['from'];})[_0x2069('0x16')](function(){return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x42cd34['params']['id']},'include':[{'model':db[_0x2069('0x93')],'as':_0x2069('0x94'),'include':[{'model':db[_0x2069('0x86')],'as':_0x2069('0x95'),'where':_0x2c81d1,'limit':0x1,'order':[[_0x2069('0x8c'),_0x2069('0x96')]]}]},{'model':db[_0x2069('0x97')],'as':_0x2069('0x98')}]});})[_0x2069('0x16')](handleEntityNotFound(_0x2308ea,null))[_0x2069('0x16')](function(_0x4a9aab){if(_0x4a9aab&&_0x4a9aab['List']){_0x3823aa['account']=_0x4a9aab;_0x3823aa[_0x2069('0x99')]=_0x4a9aab['Applications'];_0x3823aa[_0x2069('0x9a')]=_0x4a9aab[_0x2069('0x94')];_0x3823aa[_0x2069('0x99')]=_[_0x2069('0x9b')](_0x3823aa['applications'],['priority'],['asc']);if(_0x3823aa[_0x2069('0x9c')]['Applications']){delete _0x3823aa[_0x2069('0x9c')]['Applications'];}if(_0x3823aa['account'][_0x2069('0x94')]&&_0x3823aa['account']['List'][_0x2069('0x95')][_0x2069('0x3f')]){return _0x3823aa['account'][_0x2069('0x94')][_0x2069('0x95')][0x0];}var _0x92fb0c=_[_0x2069('0xd')](_0x42cd34[_0x2069('0x50')],{'firstName':_0x42cd34[_0x2069('0x50')][_0x2069('0x9d')],'ListId':_0x4a9aab[_0x2069('0x8d')]});_0x92fb0c[_0x42cd34[_0x2069('0x50')]['mapKey']]=_0x42cd34[_0x2069('0x50')]['from'];return db[_0x2069('0x86')]['create'](_0x92fb0c,{'fields':_0x32e353,'raw':!![]});}})[_0x2069('0x16')](handleEntityNotFound(_0x2308ea,null))[_0x2069('0x16')](function(_0x4a7453){_0x3823aa['contact']=_0x4a7453;var _0x2accfa=_0x42cd34[_0x2069('0x50')][_0x2069('0x9e')];if(_0x42cd34[_0x2069('0x9f')]['cf-connecting-ip']){_0x2accfa=_0x42cd34[_0x2069('0x9f')][_0x2069('0xa0')];}else if(_0x42cd34['headers'][_0x2069('0xa1')]){_0x2accfa=_['first'](_0x42cd34[_0x2069('0x9f')]['x-forwarded-for'][_0x2069('0xa2')](','));}if(_0x4a7453){var _0x52ebd9={'ContactId':_0x4a7453['id'],'ChatWebsiteId':_0x42cd34[_0x2069('0x5c')]['id'],'from':(_0x4a7453['firstName']||'')+'\x20'+(_0x4a7453['lastName']||''),'customerIp':_0x2accfa,'customerPort':_0x42cd34[_0x2069('0x9f')][_0x2069('0xa3')]?_0x42cd34['headers'][_0x2069('0xa3')]:null,'referer':_0x42cd34[_0x2069('0x50')][_0x2069('0xa4')],'browserName':_0x2ffa87[_0x2069('0xa5')][_0x2069('0x31')]&&_0x2ffa87[_0x2069('0xa5')][_0x2069('0xa6')]?util['format'](_0x2069('0xa7'),_0x2ffa87[_0x2069('0xa5')]['name'],_0x2ffa87['browser'][_0x2069('0xa6')]):_0x2069('0xa8'),'browserVersion':_0x2ffa87[_0x2069('0xa5')][_0x2069('0xa6')]||_0x2069('0xa8'),'osName':util['format'](_0x2069('0xa7'),_0x2ffa87['os']['name'],_0x2ffa87['os'][_0x2069('0xa6')]),'osVersion':_0x2ffa87['os'][_0x2069('0xa6')],'deviceModel':_0x2ffa87[_0x2069('0xa9')]['model']&&_0x2ffa87[_0x2069('0xa9')][_0x2069('0xaa')]?util['format'](_0x2069('0xab'),_0x2ffa87[_0x2069('0xa9')][_0x2069('0x39')],_0x2ffa87[_0x2069('0xa9')][_0x2069('0xaa')],_0x2ffa87[_0x2069('0xa9')][_0x2069('0x37')]):null,'deviceVendor':_0x2ffa87['device'][_0x2069('0xaa')],'deviceType':_0x2ffa87['device'][_0x2069('0x37')],'formData':JSON[_0x2069('0x1c')](_0x42cd34[_0x2069('0x50')])};var _0x1e9a29={'ChatWebsiteId':_0x42cd34[_0x2069('0x5c')]['id'],'closed':![]};if(_0x42cd34[_0x2069('0x50')][_0x2069('0xac')]){_0x1e9a29['threadId']=_0x42cd34[_0x2069('0x50')][_0x2069('0xac')];return db[_0x2069('0xad')][_0x2069('0x59')]({'where':_0x1e9a29})[_0x2069('0x16')](function(_0x5cdd3f){if(_0x5cdd3f){return[_0x5cdd3f,![]];}_0x52ebd9['threadId']=_0x42cd34[_0x2069('0x50')][_0x2069('0xac')];_0x52ebd9[_0x2069('0xae')]=_0x42cd34[_0x2069('0x50')]['externalUrl'];return db[_0x2069('0xad')]['create'](_0x52ebd9)[_0x2069('0x16')](function(_0x252dcf){return[_0x252dcf,!![]];});});}_0x1e9a29['ContactId']=_0x4a7453['id'];if(_0x42cd34[_0x2069('0x50')]['interaction']&&_0x42cd34[_0x2069('0x50')][_0x2069('0xaf')]['id']){_0x1e9a29['id']=_0x42cd34[_0x2069('0x50')][_0x2069('0xaf')]['id'];return db[_0x2069('0xad')][_0x2069('0x59')]({'where':_0x1e9a29})[_0x2069('0x16')](function(_0x4d7c3d){if(_0x4d7c3d){return[_0x4d7c3d,![]];}return db[_0x2069('0xad')]['create'](_0x52ebd9)[_0x2069('0x16')](function(_0x6b792f){return[_0x6b792f,!![]];});});}return db[_0x2069('0xad')][_0x2069('0x4f')](_0x52ebd9)[_0x2069('0x16')](function(_0x5e526f){return[_0x5e526f,!![]];});}})[_0x2069('0xb0')](function(_0x92e3b,_0x24285f){if(_0x92e3b){_0x596e64=_0x24285f;if(!_0x24285f){var _0x172d44={'from':(_0x3823aa[_0x2069('0xb1')]['firstName']||'')+'\x20'+(_0x3823aa[_0x2069('0xb1')][_0x2069('0xb2')]||'')};if(_0x42cd34[_0x2069('0x50')][_0x2069('0xac')]&&_0x42cd34[_0x2069('0x50')][_0x2069('0xb3')]&&_0x42cd34[_0x2069('0x50')]['threadId']!=_0x42cd34[_0x2069('0x50')][_0x2069('0xb3')]){_0x172d44[_0x2069('0xac')]=_0x42cd34[_0x2069('0x50')][_0x2069('0xb3')];}return _0x92e3b[_0x2069('0x2b')](_0x172d44);}else{return _0x92e3b;}}})[_0x2069('0x16')](function(_0x1ba0a6){_0x3823aa[_0x2069('0xaf')]=_0x1ba0a6[_0x2069('0x2d')]({'plain':!![]});_0x3823aa['interaction'][_0x2069('0xb4')]=_0x596e64;if(_0x3823aa['interaction']['created']){if(_0x3823aa['account']['autoclose']){_0x3823aa[_0x2069('0x99')][_0x2069('0xb5')]({'id':0x0,'priority':_0x3823aa['applications'][_0x2069('0x3f')]+0x1,'app':_0x2069('0xb6'),'appdata':_0x2069('0xb7'),'interval':_0x2069('0xb8')});}}return db['ChatMessage'][_0x2069('0x4f')]({'body':_0x42cd34[_0x2069('0x50')][_0x2069('0x50')],'ChatWebsiteId':_0x42cd34[_0x2069('0x5c')]['id'],'ChatInteractionId':_0x1ba0a6['id'],'direction':'in','ContactId':_0x3823aa['contact']['id'],'AttachmentId':_0x42cd34[_0x2069('0x50')][_0x2069('0xb9')]});})[_0x2069('0x16')](function(_0xadd14d){_0x3823aa[_0x2069('0x1f')]=_0xadd14d;if(_0x3823aa['interaction'][_0x2069('0xba')]){return db['User'][_0x2069('0x59')]({'attributes':['id','name'],'where':{'id':_0x3823aa['interaction'][_0x2069('0xba')]}})[_0x2069('0x16')](function(_0x240256){if(_0x240256){_0x3823aa[_0x2069('0x99')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2069('0xbb'),'appdata':_0x240256[_0x2069('0x31')]+','+(_0x3823aa[_0x2069('0x9c')][_0x2069('0xbc')]||0xa),'interval':'*,*,*,*'});_0x3823aa[_0x2069('0xbd')]=!![];}return respondWithRpcPromise(_0x2069('0xbe'),_0x2069('0xbf'),_0x3823aa);});}return respondWithRpcPromise(_0x2069('0xbe'),_0x2069('0xbf'),_0x3823aa);})[_0x2069('0x16')](function(_0x3d7764){respondWithRpcPromise(_0x2069('0xc0'),_0x2069('0xc0'),{'event':_0x2069('0x80'),'message':_0x3d7764},client9002);return _0x3d7764;})['then'](respondWithResult(_0x2308ea,null))[_0x2069('0x20')](handleError(_0x2308ea,null));};exports[_0x2069('0xc1')]=function(_0x378292,_0x2fdc71){var _0xb1ffd2,_0x42f4ec,_0xc5af88;var _0x4c3441=[];var _0x34bcbb={};var _0x400759=_0x378292[_0x2069('0xc2')]||[];var _0x5bb1d2=[];var _0x64bc93;return db[_0x2069('0x86')][_0x2069('0x57')]()[_0x2069('0x16')](function(_0x27db79){if(!_0x27db79){throw new db[(_0x2069('0x87'))][(_0x2069('0x88'))]('no\x20available\x20attributes');}_0x4c3441=_[_0x2069('0x8a')](_[_0x2069('0x3b')](_0x27db79),[_0x2069('0x8b'),_0x2069('0x8c'),_0x2069('0xc3'),_0x2069('0x8d')]);if(_0x378292['body']['id']){delete _0x378292[_0x2069('0x50')]['id'];}if(_[_0x2069('0x78')](_0x378292[_0x2069('0x50')][_0x2069('0x9d')])){throw _0x2fdc71['status'](0x1f4)[_0x2069('0x32')](new db[(_0x2069('0x87'))][(_0x2069('0x88'))]('from\x20is\x20mandatory'));}if(_[_0x2069('0x78')](_0x378292[_0x2069('0x50')][_0x2069('0x50')])||_0x378292[_0x2069('0x50')]['body']===''){throw _0x2fdc71['status'](0x1f4)[_0x2069('0x32')](new db['Sequelize'][(_0x2069('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x2069('0x78')](_0x378292['body']['mapKeyOffline'])){throw _0x2fdc71['status'](0x1f4)[_0x2069('0x32')](new db['Sequelize']['ValidationError'](_0x2069('0xc4')+_0x4c3441));}if(!_[_0x2069('0x90')](_0x4c3441,_0x378292[_0x2069('0x50')][_0x2069('0xc5')])){throw _0x2fdc71['status'](0x1f4)[_0x2069('0x32')](new db[(_0x2069('0x87'))][(_0x2069('0x88'))](_0x2069('0xc6')+_0x4c3441));}_0x34bcbb[_0x378292['body'][_0x2069('0xc5')]]=_0x378292['body'][_0x2069('0x9d')];})[_0x2069('0x16')](function(){return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x378292[_0x2069('0x5c')]['id']},'include':[{'model':db[_0x2069('0x93')],'as':'List'},{'model':db[_0x2069('0xc7')],'as':_0x2069('0xc7')}]});})[_0x2069('0x16')](handleEntityNotFound(_0x2fdc71,null))[_0x2069('0x16')](function(_0x61601c){if(_0x61601c&&_0x61601c[_0x2069('0x94')]){_0x42f4ec=_0x61601c;var _0x348858=_[_0x2069('0xd')](_0x378292[_0x2069('0x50')],{'firstName':_0x378292[_0x2069('0x50')][_0x2069('0x9d')],'phone':_0x378292['body'][_0x2069('0x9d')],'ListId':_0x61601c['ListId']});_0x348858[_0x378292['body'][_0x2069('0xc5')]]=_0x378292[_0x2069('0x50')][_0x2069('0x9d')];return db[_0x2069('0x86')][_0x2069('0xc8')]({'where':_0x34bcbb,'defaults':_0x348858});}})[_0x2069('0xb0')](function(_0x4e2e59){if(_0x4e2e59){_0xc5af88=_0x4e2e59;var _0x123104=fs[_0x2069('0xc9')](path['join'](config[_0x2069('0x6f')],_0x2069('0xca')),'utf8');var _0xc6da50=ejs['render'](_0x123104,{'body':_[_0x2069('0xcb')](_0x378292[_0x2069('0x50')]['body']),'bodyTitle':_0x42f4ec['offlineMessageBody']});return db[_0x2069('0xcc')][_0x2069('0x4f')]({'body':_0xc6da50,'plainBody':htmlToText['fromString'](_0xc6da50),'ContactId':_0x4e2e59['id'],'ChatWebsiteId':_0x42f4ec['id']});}})[_0x2069('0x16')](function(_0x4c063f){_0x64bc93=_0x4c063f;if(_0x400759[_0x2069('0x3f')]){var _0x482bf1=_0x400759[_0x2069('0x34')](function(_0x4439de){return{'name':_0x4439de[_0x2069('0xcd')],'basename':_0x4439de['filename'],'type':_0x4439de[_0x2069('0xce')],'ChatOfflineMessageId':_0x4c063f['id']};});_0x5bb1d2=_0x482bf1[_0x2069('0x34')](_0x15fc66=>{var _0x2010ab={'filename':_0x15fc66['name'],'path':path[_0x2069('0x76')](config[_0x2069('0x6f')],'server',_0x2069('0xc2'),'attachments',_0x2069('0xcf'),_0x15fc66[_0x2069('0xd0')])};return _0x2010ab;});if(!_0x42f4ec[_0x2069('0xd1')]){return db[_0x2069('0xd2')][_0x2069('0xd3')](function(_0x372b9b){return db[_0x2069('0xd4')][_0x2069('0xd5')](_0x482bf1,{'transaction':_0x372b9b});});}}})[_0x2069('0x16')](function(){if(_0x64bc93){_0xb1ffd2=_0x64bc93;return db[_0x2069('0xc7')][_0x2069('0x62')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2069('0xd6'),'raw':!![],'include':[{'model':db[_0x2069('0xd7')],'as':_0x2069('0xd7'),'raw':!![]}]}]});}})[_0x2069('0x16')](function(_0x126b4e){if(_0x126b4e&&_0x126b4e[_0x2069('0xd6')]&&_0x42f4ec[_0x2069('0xd8')]&&_0x42f4ec[_0x2069('0xd9')]){var _0x196677=_0x126b4e['getSmtpOptions']();return respondWithRpcPromise(_0x2069('0xda'),'sendMail',{'account':_0x196677,'message':{'from':util[_0x2069('0xdb')](_0x2069('0xdc'),_0x126b4e[_0x2069('0x31')],_0x126b4e[_0x2069('0xdd')]||_0x126b4e[_0x2069('0xd6')]['user']),'to':_0x42f4ec[_0x2069('0xd9')],'subject':_0x42f4ec[_0x2069('0xde')],'html':_0xb1ffd2[_0x2069('0x50')],'attachments':_0x5bb1d2}},client9003)['then'](function(){return _0xb1ffd2;})[_0x2069('0x20')](function(_0x463a3e){logger[_0x2069('0x1d')](_0x463a3e);});}})[_0x2069('0x16')](function(){if(_0x42f4ec&&_0x42f4ec[_0x2069('0xd1')]&&_0x42f4ec['MailAccountId']){var _0x1bf022=[];if(_0x400759['length']){_0x1bf022=_0x400759[_0x2069('0x34')](function(_0x102d5a){return{'name':_0x102d5a[_0x2069('0xcd')],'basename':_0x102d5a[_0x2069('0x68')],'type':_0x102d5a[_0x2069('0xce')],'ChatOfflineMessageId':_0x64bc93['id']};});}var _0x52d730;if(!_[_0x2069('0x78')](_0x42f4ec[_0x2069('0xdf')])){var _0x2e0778=_[_0x2069('0x34')](_0x378292[_0x2069('0x50')],function(_0x51e5d9){return _0x51e5d9;});var _0x6cb6be=_[_0x2069('0xe0')](_0x2e0778)[0x0];var _0x2d2e40=_[_0x2069('0xe1')](_0x6cb6be,function(_0x42ac3a){return _0x42ac3a;});_0x52d730=_0x2d2e40[0x1][_0x42f4ec[_0x2069('0xdf')]];}var _0x3cf230={'from':_0xc5af88['email'],'firstName':_0xc5af88['firstName'],'lastName':_0xc5af88[_0x2069('0xb2')],'mapKey':_0x2069('0xdd'),'message':{'from':_0xc5af88[_0x2069('0xdd')],'to':_0x42f4ec[_0x2069('0xc7')][_0x2069('0xdd')],'cc':'','subject':_[_0x2069('0x78')](_0x52d730)?_0x42f4ec[_0x2069('0xde')]:_0x52d730,'messageId':'','sentAt':new Date(),'attach':_0x1bf022['length'],'attachments':_0x1bf022,'originChannel':_0x2069('0xe2'),'ChatWebsiteId':_0x42f4ec['id'],'ChatOfflineMessageId':_0xb1ffd2['id'],'originTo':_0x42f4ec[_0x2069('0xc7')][_0x2069('0xdd')]},'body':_0xb1ffd2[_0x2069('0x50')]};var _0x288eed={'account':{'id':_0x42f4ec['MailAccountId']},'body':_0x3cf230,'log':_0x2069('0xe3')};return respondWithRpcPromise(_0x2069('0xe3'),'notifyMail',_0x288eed,client9001)[_0x2069('0x16')](function(){return _0xb1ffd2;})[_0x2069('0x20')](function(_0x3c45d6){logger[_0x2069('0x1d')](_0x3c45d6);});}return;})[_0x2069('0x16')](function(){if(_0xb1ffd2){return _0xb1ffd2;}})['then'](respondWithResult(_0x2fdc71,null))[_0x2069('0x20')](function(_0x407ff3){logger['error'](_0x2069('0x20'),_0x407ff3);for(var _0x3aa142 of _0x400759){var _0x37a051=path[_0x2069('0x76')](config['root'],_0x2069('0xe4'),_0x2069('0xc2'),_0x2069('0xe5'),'offline-chat',_0x3aa142[_0x2069('0x68')]);fs_extra[_0x2069('0xe6')](_0x37a051)[_0x2069('0x20')](function(_0x3d797d){logger[_0x2069('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x37a051,_0x3d797d);});}});};exports[_0x2069('0xe7')]=function(_0x54e187,_0x115de0){return db['ChatInteraction'][_0x2069('0x59')]({'where':{'id':_0x54e187[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x115de0,null))[_0x2069('0x16')](function(_0x3040c2){if(_0x3040c2){return _0x3040c2[_0x2069('0xe7')](_0x54e187['body'][_0x2069('0x5f')],_[_0x2069('0xe8')](_0x54e187['body'],[_0x2069('0x5f'),'id'])||{});}})[_0x2069('0x16')](respondWithResult(_0x115de0,null))[_0x2069('0x20')](handleError(_0x115de0,null));};exports[_0x2069('0xe9')]=function(_0x5c7d41,_0x2b981d){var _0x85add7={'raw':![],'where':{}};var _0xc2f4f8={};var _0x434f26={'count':0x0,'rows':[]};return db[_0x2069('0x35')][_0x2069('0x62')]({'where':{'id':_0x5c7d41[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x2b981d,null))['then'](function(_0x5403fb){if(_0x5403fb){_0xc2f4f8[_0x2069('0x39')]=_['keys'](db[_0x2069('0xad')][_0x2069('0x36')]);_0xc2f4f8['query']=_[_0x2069('0x3b')](_0x5c7d41[_0x2069('0x3a')]);_0xc2f4f8['filters']=_['intersection'](_0xc2f4f8['model'],_0xc2f4f8['query']);_0x85add7[_0x2069('0x3e')]=_['intersection'](_0xc2f4f8[_0x2069('0x39')],qs[_0x2069('0x4e')](_0x5c7d41[_0x2069('0x3a')][_0x2069('0x4e')]));_0x85add7[_0x2069('0x3e')]=_0x85add7[_0x2069('0x3e')]['length']?_0x85add7['attributes']:_0xc2f4f8[_0x2069('0x39')];if(!_0x5c7d41[_0x2069('0x3a')][_0x2069('0x40')](_0x2069('0x41'))){_0x85add7[_0x2069('0x26')]=qs[_0x2069('0x26')](_0x5c7d41[_0x2069('0x3a')][_0x2069('0x26')]);_0x85add7[_0x2069('0x25')]=qs[_0x2069('0x25')](_0x5c7d41['query']['offset']);}_0x85add7[_0x2069('0x42')]=qs['sort'](_0x5c7d41[_0x2069('0x3a')][_0x2069('0x43')]);_0x85add7[_0x2069('0x45')]=qs['filters'](_[_0x2069('0x5d')](_0x5c7d41[_0x2069('0x3a')],_0xc2f4f8[_0x2069('0x3c')]));_0x85add7[_0x2069('0x45')][_0x2069('0x5a')]=_0x5403fb['id'];if(_0x5c7d41[_0x2069('0x3a')][_0x2069('0x46')]){_0x85add7[_0x2069('0x45')]=_[_0x2069('0x44')](_0x85add7[_0x2069('0x45')],{'$or':_[_0x2069('0x34')](_0x85add7[_0x2069('0x3e')],function(_0x53a1e8){var _0x5f2759={};_0x5f2759[_0x53a1e8]={'$like':'%'+_0x5c7d41[_0x2069('0x3a')][_0x2069('0x46')]+'%'};return _0x5f2759;})});}_0x85add7=_['merge']({},_0x85add7,_0x5c7d41[_0x2069('0x47')]);return db[_0x2069('0xad')][_0x2069('0x28')]({'where':_0x85add7[_0x2069('0x45')]})[_0x2069('0x16')](function(_0x2c522b){_0x434f26[_0x2069('0x28')]=_0x2c522b;if(_0x5c7d41['query']['includeAll']){_0x85add7['include']=[{'model':db[_0x2069('0x86')],'as':_0x2069('0xea'),'required':![]},{'model':db['User'],'as':_0x2069('0xeb'),'attributes':['name','fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x2069('0xec'),'attributes':['id',_0x2069('0x31'),_0x2069('0xed')],'where':_0x5c7d41[_0x2069('0x3a')][_0x2069('0xee')]?{'id':_0x5c7d41['query'][_0x2069('0xee')]}:undefined,'required':_0x5c7d41[_0x2069('0x3a')][_0x2069('0xee')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x85add7);})[_0x2069('0x16')](function(_0x640f5b){_0x434f26[_0x2069('0x4b')]=_0x640f5b;return _0x434f26;});}})['then'](respondWithFilteredResult(_0x2b981d,_0x85add7))[_0x2069('0x20')](handleError(_0x2b981d,null));};function iftimePromise(_0x304199,_0x56180c){return respondWithRpcPromise(_0x2069('0xef'),_0x2069('0xf0'),{'command':_0x56180c['timezone']?util[_0x2069('0xdb')](_0x2069('0xf1'),_0x304199[_0x2069('0xf2')],_0x56180c[_0x2069('0xf3')]):util[_0x2069('0xdb')]('iftime\x20%s',_0x304199[_0x2069('0xf2')])},client9002)[_0x2069('0x16')](function(_0x5d94f7){var _0x5f160c=_0x5d94f7&&_0x5d94f7[_0x2069('0xf4')](_0x2069('0xf5'))>=0x0?!![]:![];logger[_0x2069('0x17')](_0x2069('0xf6'),_0x56180c['id'],_0x304199['id'],_0x304199[_0x2069('0xf2')],_0x5f160c?_0x2069('0xf7'):_0x2069('0xf8'),_0x56180c[_0x2069('0xf3')]?_0x56180c['timezone']:_0x2069('0xf9'));return _0x5f160c;})['catch'](function(_0x5c9dbf){logger[_0x2069('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x56180c['id'],_0x304199['id'],_0x304199[_0x2069('0xf2')],util[_0x2069('0xfa')](_0x5c9dbf,{'showHidden':![],'depth':null}),_0x56180c[_0x2069('0xf3')]?_0x56180c['timezone']:_0x2069('0xf9'));return![];});}exports['getSnippet']=function(_0x596b94,_0x546f71){var _0x325376=0x0;var _0x294044=0x0;var _0x26a5bb=![];var _0x42c49d;var _0x4761a0;return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x596b94[_0x2069('0x5c')]['id']},'include':[{'model':db[_0x2069('0xfb')],'as':'Interval','include':[{'model':db[_0x2069('0xfb')],'as':_0x2069('0xfc'),'attributes':['id',_0x2069('0xf2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x546f71,null))[_0x2069('0x16')](function(_0x1c7a66){if(_0x1c7a66){_0x42c49d=_0x1c7a66;return _0x1c7a66[_0x2069('0xfd')]({'raw':!![]});}})[_0x2069('0x16')](function(_0x322cba){if(_0x42c49d){if(_0x322cba){_0x4761a0=_0x322cba;}}return require(_0x2069('0xfe'))['getLicense']();})[_0x2069('0x16')](function(_0x145975){if(_0x145975){_0x294044=_0x145975[_0x2069('0xff')];_0x26a5bb=_0x145975['custom'];}})[_0x2069('0x16')](function(){return db['ChatInteraction'][_0x2069('0x28')]({'where':{'closed':![]}});})[_0x2069('0x16')](function(_0x3c2ea2){_0x325376=_0x3c2ea2;if(_0x294044&&_0x3c2ea2>_0x294044){return db[_0x2069('0x100')][_0x2069('0x62')]({'where':{'id':0x1}})[_0x2069('0x16')](function(_0x4da9d8){if(_0x4da9d8){_0x4da9d8[_0x2069('0x101')](_0x2069('0x102'));}});}})[_0x2069('0x16')](function(){if(_0x42c49d[_0x2069('0xfb')]&&_0x42c49d['Interval'][_0x2069('0xfc')]){var _0x3366cf=[];for(var _0x1c7fe7=0x0;_0x1c7fe7<_0x42c49d[_0x2069('0xfb')][_0x2069('0xfc')][_0x2069('0x3f')];_0x1c7fe7++){var _0x1b5815=_0x42c49d[_0x2069('0xfb')]['Intervals'][_0x1c7fe7][_0x2069('0x2d')]({'plain':!![]});_0x3366cf[_0x2069('0xb5')](iftimePromise(_0x1b5815,_0x42c49d));}return BPromise[_0x2069('0x103')](_0x3366cf)['then'](function(_0x2c89b9){return _[_0x2069('0x104')](_0x2c89b9);});}else{return!![];}})[_0x2069('0x16')](function(_0x4ab06a){var _0xeb29b=fs[_0x2069('0xc9')](path[_0x2069('0x76')](config['root'],_0x2069('0x105')),'utf8');var _0x207a4a={'remote':_0x42c49d[_0x2069('0x106')],'query':querystring['stringify'](_[_0x2069('0x44')](_0x42c49d[_0x2069('0x2d')]({'plain':!![]}),{'customerIp':_0x596b94['headers']['x-forwarded-for']||_0x596b94['headers'][_0x2069('0x107')]||_0x596b94[_0x2069('0x108')][_0x2069('0x109')]||_0x596b94['ip'],'referer':_0x596b94[_0x2069('0x9f')][_0x2069('0xa4')],'openedInteractions':_0x325376,'maxInteractions':_0x294044,'virtual':_0x26a5bb[_0x2069('0xff')],'online':_0x4ab06a,'custom':_0x26a5bb}))[_0x2069('0x10a')](/'/g,'\x5c\x27')};_0x546f71[_0x2069('0x32')](ejs[_0x2069('0x10b')](Mustache['render'](_0xeb29b,_0x207a4a),{'proactiveActions':_0x4761a0,'alignment':_0x42c49d[_0x2069('0x10c')],'verticalAlignment':_0x42c49d[_0x2069('0x10d')],'div_color':_0x42c49d[_0x2069('0xed')],'labelText':_0x42c49d[_0x2069('0x10e')],'text_color':_0x42c49d[_0x2069('0x10f')],'text_button_color':_0x42c49d[_0x2069('0x110')],'button_color':_0x42c49d['color_button'],'background_color':_0x42c49d[_0x2069('0x111')],'hideWhenOffline':_0x42c49d['hideWhenOffline'],'interval':_0x42c49d['IntervalId']}));})[_0x2069('0x20')](handleError(_0x546f71,null));};exports[_0x2069('0x112')]=function(_0x1fb637,_0xc4c9cf){var _0x6c0f4f=_0x1fb637['params']['id'];var _0x243d19=_0x1fb637['body'];var _0xe52638=0xc8;var _0x4e143a=null;return db[_0x2069('0xd2')][_0x2069('0xd3')]({'isolationLevel':db[_0x2069('0xd2')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x373008){return db['ChatWebsite'][_0x2069('0x62')]({'where':{'id':_0x6c0f4f},'transaction':_0x373008})['then'](function(_0x1098f2){if(_0x1098f2){return db['ChatApplication'][_0x2069('0x2c')]({'where':{'ChatWebsiteId':_0x6c0f4f},'transaction':_0x373008})['then'](function(){var _0x3734b3=_[_0x2069('0x34')](_0x243d19,function(_0x58fb56){_0x58fb56[_0x2069('0x5a')]=_0x6c0f4f;return _0x58fb56;});return db[_0x2069('0x97')][_0x2069('0xd5')](_0x3734b3,{'transaction':_0x373008});});}else{_0xe52638=0x194;_0x4e143a=[];}});})[_0x2069('0x16')](function(){if(_0xe52638!==0x194){return db[_0x2069('0x97')][_0x2069('0x113')]({'where':{'ChatWebsiteId':_0x6c0f4f},'order':'priority'})[_0x2069('0x16')](function(_0x95c1f0){_0x4e143a=_0x95c1f0;});}})[_0x2069('0x20')](function(_0x5c7f32){_0xe52638=0x1f4;logger[_0x2069('0x1d')](_0x5c7f32[_0x2069('0x30')]);if(_0x5c7f32[_0x2069('0x31')]){delete _0x5c7f32[_0x2069('0x31')];}_0x4e143a=_0x5c7f32;})[_0x2069('0x114')](function(){if(_0x4e143a===null){_0xc4c9cf['sendStatus'](_0xe52638);}else{if(_0xe52638===0x1f4){_0xc4c9cf[_0x2069('0x23')](_0xe52638)[_0x2069('0x32')](_0x4e143a);}else{_0xc4c9cf[_0x2069('0x23')](_0xe52638)[_0x2069('0x24')](_0x4e143a);}}});};exports[_0x2069('0x115')]=function(_0x42c272,_0x2a048f){var _0x13b29a={};var _0x3af982={};var _0x327bcd;var _0x13637d;return db[_0x2069('0x35')][_0x2069('0x62')]({'where':{'id':_0x42c272[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x2a048f,null))[_0x2069('0x16')](function(_0x670435){if(_0x670435){_0x327bcd=_0x670435;_0x3af982[_0x2069('0x39')]=_[_0x2069('0x3b')](db[_0x2069('0x97')]['rawAttributes']);_0x3af982[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0x42c272[_0x2069('0x3a')]);_0x3af982[_0x2069('0x3c')]=_['intersection'](_0x3af982['model'],_0x3af982[_0x2069('0x3a')]);_0x13b29a[_0x2069('0x3e')]=_[_0x2069('0x3d')](_0x3af982[_0x2069('0x39')],qs[_0x2069('0x4e')](_0x42c272['query'][_0x2069('0x4e')]));_0x13b29a[_0x2069('0x3e')]=_0x13b29a['attributes'][_0x2069('0x3f')]?_0x13b29a[_0x2069('0x3e')]:_0x3af982['model'];_0x13b29a[_0x2069('0x42')]=qs[_0x2069('0x43')](_0x42c272[_0x2069('0x3a')][_0x2069('0x43')]);_0x13b29a[_0x2069('0x45')]=qs[_0x2069('0x3c')](_['pick'](_0x42c272[_0x2069('0x3a')],_0x3af982['filters']));if(_0x42c272[_0x2069('0x3a')][_0x2069('0x46')]){_0x13b29a[_0x2069('0x45')]=_['merge'](_0x13b29a[_0x2069('0x45')],{'$or':_['map'](_0x13b29a[_0x2069('0x3e')],function(_0x2e8676){var _0x3c48b5={};_0x3c48b5[_0x2e8676]={'$like':'%'+_0x42c272[_0x2069('0x3a')]['filter']+'%'};return _0x3c48b5;})});}_0x13b29a=_[_0x2069('0x44')]({},_0x13b29a,_0x42c272[_0x2069('0x47')]);return _0x327bcd['getApplications'](_0x13b29a);}})['then'](function(_0x728314){if(_0x728314){_0x13637d=_0x728314[_0x2069('0x3f')];if(!_0x42c272['query'][_0x2069('0x40')](_0x2069('0x41'))){_0x13b29a[_0x2069('0x26')]=qs['limit'](_0x42c272[_0x2069('0x3a')][_0x2069('0x26')]);_0x13b29a['offset']=qs[_0x2069('0x25')](_0x42c272[_0x2069('0x3a')][_0x2069('0x25')]);}return _0x327bcd[_0x2069('0x115')](_0x13b29a);}})['then'](function(_0x48560e){if(_0x48560e){return _0x48560e?{'count':_0x13637d,'rows':_0x48560e}:null;}})[_0x2069('0x16')](respondWithResult(_0x2a048f,null))['catch'](handleError(_0x2a048f,null));};exports[_0x2069('0x116')]=function(_0x35cf6a,_0x5e716e){return db[_0x2069('0x117')][_0x2069('0x59')]({'where':{'id':_0x35cf6a[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x5e716e,null))[_0x2069('0x16')](function(_0xbadaeb){if(_0xbadaeb){return _0xbadaeb['addProactiveActions'](_0x35cf6a[_0x2069('0x50')][_0x2069('0x5f')],_[_0x2069('0xe8')](_0x35cf6a[_0x2069('0x50')],['ids','id'])||{});}})[_0x2069('0x16')](respondWithResult(_0x5e716e,null))[_0x2069('0x20')](handleError(_0x5e716e,null));};exports[_0x2069('0xfd')]=function(_0x27d043,_0x30ceac){var _0x42b7bc={};var _0x12e786={};var _0x348591;var _0x51adbb;return db[_0x2069('0x35')][_0x2069('0x62')]({'where':{'id':_0x27d043[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x30ceac,null))[_0x2069('0x16')](function(_0x3036e2){if(_0x3036e2){_0x348591=_0x3036e2;_0x12e786[_0x2069('0x39')]=_[_0x2069('0x3b')](db[_0x2069('0x118')]['rawAttributes']);_0x12e786[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0x27d043[_0x2069('0x3a')]);_0x12e786[_0x2069('0x3c')]=_[_0x2069('0x3d')](_0x12e786['model'],_0x12e786['query']);_0x42b7bc[_0x2069('0x3e')]=_['intersection'](_0x12e786[_0x2069('0x39')],qs['fields'](_0x27d043[_0x2069('0x3a')][_0x2069('0x4e')]));_0x42b7bc['attributes']=_0x42b7bc[_0x2069('0x3e')][_0x2069('0x3f')]?_0x42b7bc[_0x2069('0x3e')]:_0x12e786[_0x2069('0x39')];_0x42b7bc['order']=qs[_0x2069('0x43')](_0x27d043['query'][_0x2069('0x43')]);_0x42b7bc[_0x2069('0x45')]=qs[_0x2069('0x3c')](_['pick'](_0x27d043[_0x2069('0x3a')],_0x12e786['filters']));if(_0x27d043['query']['filter']){_0x42b7bc['where']=_[_0x2069('0x44')](_0x42b7bc[_0x2069('0x45')],{'$or':_['map'](_0x42b7bc[_0x2069('0x3e')],function(_0x53dafd){var _0x3b49c7={};_0x3b49c7[_0x53dafd]={'$like':'%'+_0x27d043[_0x2069('0x3a')][_0x2069('0x46')]+'%'};return _0x3b49c7;})});}_0x42b7bc=_[_0x2069('0x44')]({},_0x42b7bc,_0x27d043[_0x2069('0x47')]);return _0x348591[_0x2069('0xfd')](_0x42b7bc);}})[_0x2069('0x16')](function(_0x545ff7){if(_0x545ff7){_0x51adbb=_0x545ff7['length'];if(!_0x27d043[_0x2069('0x3a')][_0x2069('0x40')]('nolimit')){_0x42b7bc['limit']=qs['limit'](_0x27d043[_0x2069('0x3a')][_0x2069('0x26')]);_0x42b7bc[_0x2069('0x25')]=qs[_0x2069('0x25')](_0x27d043[_0x2069('0x3a')][_0x2069('0x25')]);}return _0x348591[_0x2069('0xfd')](_0x42b7bc);}})['then'](function(_0x1fbede){if(_0x1fbede){return _0x1fbede?{'count':_0x51adbb,'rows':_0x1fbede}:null;}})[_0x2069('0x16')](respondWithResult(_0x30ceac,null))['catch'](handleError(_0x30ceac,null));};exports[_0x2069('0x119')]=function(_0x1483ee,_0x34c716){var _0xfc462b=_0x1483ee[_0x2069('0x3a')]['online']===_0x2069('0x11a')?'offlineForm':'onlineForm';return db[_0x2069('0x35')][_0x2069('0x59')]({'attributes':['id',_0xfc462b],'where':{'id':_0x1483ee[_0x2069('0x5c')]['id']}})['then'](handleEntityNotFound(_0x34c716,null))[_0x2069('0x16')](function(_0x446f20){if(_0x446f20){var _0x4adb88=_0x446f20[_0xfc462b];var _0x3cc7c5=_0x4adb88&&_0x4adb88[_0x2069('0x11b')]?_0x4adb88[_0x2069('0x11b')]:[];_0x34c716[_0x2069('0x32')]({'fromKey':_[_0x2069('0x78')](_0x4adb88[_0x2069('0x11c')])?undefined:_0x4adb88[_0x2069('0x11c')],'count':_0x3cc7c5[_0x2069('0x3f')],'rows':_0x3cc7c5});}})[_0x2069('0x20')](handleError(_0x34c716,null));};exports['getOfflineMessages']=function(_0x20b0b8,_0x4e515d){var _0x24e451={'raw':![],'where':{}};var _0x12a586={};var _0x3715db={'count':0x0,'rows':[]};return db[_0x2069('0x35')][_0x2069('0x62')]({'where':{'id':_0x20b0b8[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x4e515d,null))['then'](function(_0x57e5bb){if(_0x57e5bb){_0x12a586[_0x2069('0x39')]=_[_0x2069('0x3b')](db[_0x2069('0xcc')][_0x2069('0x36')]);_0x12a586[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0x20b0b8[_0x2069('0x3a')]);_0x12a586[_0x2069('0x3c')]=_[_0x2069('0x3d')](_0x12a586[_0x2069('0x39')],_0x12a586[_0x2069('0x3a')]);_0x24e451['attributes']=_[_0x2069('0x3d')](_0x12a586['model'],qs['fields'](_0x20b0b8[_0x2069('0x3a')][_0x2069('0x4e')]));_0x24e451[_0x2069('0x3e')]=_0x24e451[_0x2069('0x3e')][_0x2069('0x3f')]?_0x24e451[_0x2069('0x3e')]:_0x12a586[_0x2069('0x39')];if(!_0x20b0b8[_0x2069('0x3a')]['hasOwnProperty'](_0x2069('0x41'))){_0x24e451[_0x2069('0x26')]=qs[_0x2069('0x26')](_0x20b0b8['query'][_0x2069('0x26')]);_0x24e451[_0x2069('0x25')]=qs[_0x2069('0x25')](_0x20b0b8[_0x2069('0x3a')]['offset']);}_0x24e451[_0x2069('0x42')]=qs[_0x2069('0x43')](_0x20b0b8[_0x2069('0x3a')]['sort']);_0x24e451[_0x2069('0x45')]=qs[_0x2069('0x3c')](_[_0x2069('0x5d')](_0x20b0b8[_0x2069('0x3a')],_0x12a586['filters']));_0x24e451[_0x2069('0x45')]['ChatWebsiteId']=_0x57e5bb['id'];if(_0x20b0b8[_0x2069('0x3a')]['filter']){_0x24e451[_0x2069('0x45')]=_[_0x2069('0x44')](_0x24e451[_0x2069('0x45')],{'$or':_[_0x2069('0x34')](_0x24e451[_0x2069('0x3e')],function(_0x1c6589){var _0x5514b9={};_0x5514b9[_0x1c6589]={'$like':'%'+_0x20b0b8[_0x2069('0x3a')][_0x2069('0x46')]+'%'};return _0x5514b9;})});}_0x24e451=_['merge']({},_0x24e451,_0x20b0b8[_0x2069('0x47')]);return db[_0x2069('0xcc')]['count']({'where':_0x24e451['where']})[_0x2069('0x16')](function(_0x552bdd){_0x3715db['count']=_0x552bdd;if(_0x20b0b8['query'][_0x2069('0x48')]){_0x24e451['include']=[{'all':!![]}];}else{_0x24e451[_0x2069('0x49')]=[{'model':db[_0x2069('0x86')],'as':_0x2069('0xea'),'required':![]},{'model':db[_0x2069('0xd4')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x2069('0x4a')](_0x24e451);})['then'](function(_0x2bf5b6){_0x3715db['rows']=_0x2bf5b6;return _0x3715db;});}})[_0x2069('0x16')](respondWithFilteredResult(_0x4e515d,_0x24e451))[_0x2069('0x20')](handleError(_0x4e515d,null));};exports[_0x2069('0x11d')]=function(_0x249d55,_0x3ddc8f){return db[_0x2069('0x35')][_0x2069('0x59')]({'where':{'id':_0x249d55[_0x2069('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3ddc8f,null))[_0x2069('0x16')](function(_0x41dc05){if(_0x41dc05){return _0x41dc05['addAgents'](_0x249d55[_0x2069('0x50')]['ids'],_[_0x2069('0xe8')](_0x249d55[_0x2069('0x50')],[_0x2069('0x5f'),'id'])||{})[_0x2069('0xb0')](function(_0x3da3a7){for(var _0x11e338=0x0;_0x11e338<_0x249d55[_0x2069('0x50')]['ids']['length'];_0x11e338+=0x1){socket[_0x2069('0x11e')]('userChatWebsite:save',{'UserId':Number(_0x249d55[_0x2069('0x50')][_0x2069('0x5f')][_0x11e338]),'ChatWebsiteId':Number(_0x249d55[_0x2069('0x5c')]['id'])});}return _0x3da3a7;});}})[_0x2069('0x16')](respondWithResult(_0x3ddc8f,null))[_0x2069('0x20')](handleError(_0x3ddc8f,null));};exports[_0x2069('0x11f')]=function(_0x35ab28,_0x1f5534){return db['ChatWebsite'][_0x2069('0x59')]({'where':{'id':_0x35ab28[_0x2069('0x5c')]['id']}})[_0x2069('0x16')](handleEntityNotFound(_0x1f5534,null))['then'](function(_0x279015){if(_0x279015){return _0x279015[_0x2069('0x11f')](_0x35ab28['query']['ids'])[_0x2069('0x16')](function(){if(_[_0x2069('0x120')](_0x35ab28[_0x2069('0x3a')][_0x2069('0x5f')])){for(var _0x32e933=0x0;_0x32e933<_0x35ab28[_0x2069('0x3a')]['ids'][_0x2069('0x3f')];_0x32e933+=0x1){socket['emit'](_0x2069('0x121'),{'UserId':Number(_0x35ab28[_0x2069('0x3a')][_0x2069('0x5f')][_0x32e933]),'ChatWebsiteId':Number(_0x35ab28[_0x2069('0x5c')]['id'])});}}else{socket[_0x2069('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x35ab28[_0x2069('0x3a')][_0x2069('0x5f')]),'ChatWebsiteId':Number(_0x35ab28[_0x2069('0x5c')]['id'])});}});}})[_0x2069('0x16')](respondWithStatusCode(_0x1f5534,null))['catch'](handleError(_0x1f5534,null));};exports['getAgents']=function(_0x5d5e25,_0x387adb){var _0x4ddada={};var _0xb49efc={};var _0x1ebed0;var _0x1906ff;return db[_0x2069('0x35')][_0x2069('0x62')]({'where':{'id':_0x5d5e25['params']['id']}})['then'](handleEntityNotFound(_0x387adb,null))[_0x2069('0x16')](function(_0xabb90e){if(_0xabb90e){_0x1ebed0=_0xabb90e;_0xb49efc['model']=_[_0x2069('0x3b')](db['User'][_0x2069('0x36')]);_0xb49efc[_0x2069('0x3a')]=_[_0x2069('0x3b')](_0x5d5e25[_0x2069('0x3a')]);_0xb49efc[_0x2069('0x3c')]=_[_0x2069('0x3d')](_0xb49efc[_0x2069('0x39')],_0xb49efc['query']);_0x4ddada[_0x2069('0x3e')]=_['intersection'](_0xb49efc[_0x2069('0x39')],qs[_0x2069('0x4e')](_0x5d5e25[_0x2069('0x3a')][_0x2069('0x4e')]));_0x4ddada[_0x2069('0x3e')]=_0x4ddada[_0x2069('0x3e')][_0x2069('0x3f')]?_0x4ddada[_0x2069('0x3e')]:_0xb49efc[_0x2069('0x39')];_0x4ddada['order']=qs[_0x2069('0x43')](_0x5d5e25['query'][_0x2069('0x43')]);_0x4ddada[_0x2069('0x45')]=qs['filters'](_[_0x2069('0x5d')](_0x5d5e25[_0x2069('0x3a')],_0xb49efc['filters']));if(_0x5d5e25[_0x2069('0x3a')][_0x2069('0x46')]){_0x4ddada[_0x2069('0x45')]=_[_0x2069('0x44')](_0x4ddada['where'],{'$or':_[_0x2069('0x34')](_0x4ddada['attributes'],function(_0x11953d){var _0x581b67={};_0x581b67[_0x11953d]={'$like':'%'+_0x5d5e25['query']['filter']+'%'};return _0x581b67;})});}_0x4ddada=_[_0x2069('0x44')]({},_0x4ddada,_0x5d5e25[_0x2069('0x47')]);return _0x1ebed0[_0x2069('0x122')](_0x4ddada);}})[_0x2069('0x16')](function(_0x2b0578){if(_0x2b0578){_0x1906ff=_0x2b0578[_0x2069('0x3f')];if(!_0x5d5e25['query']['hasOwnProperty'](_0x2069('0x41'))){_0x4ddada[_0x2069('0x26')]=qs[_0x2069('0x26')](_0x5d5e25['query'][_0x2069('0x26')]);_0x4ddada[_0x2069('0x25')]=qs['offset'](_0x5d5e25[_0x2069('0x3a')]['offset']);}return _0x1ebed0['getAgents'](_0x4ddada);}})[_0x2069('0x16')](function(_0x25cc9e){if(_0x25cc9e){return _0x25cc9e?{'count':_0x1906ff,'rows':_0x25cc9e}:null;}})[_0x2069('0x16')](respondWithResult(_0x387adb,null))['catch'](handleError(_0x387adb,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 29c3849..ca18671 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa4ba=['setMaxListeners','save','remove','emit','hook','../../mysqldb','ChatWebsite'];(function(_0xadf23b,_0x2511f1){var _0x36fb64=function(_0x3254c9){while(--_0x3254c9){_0xadf23b['push'](_0xadf23b['shift']());}};_0x36fb64(++_0x2511f1);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xa4ba[_0x32f7d7];return _0x133d09;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xaa4b('0x0'))['db'][_0xaa4b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xaa4b('0x2')](0x0);var events={'afterCreate':_0xaa4b('0x3'),'afterUpdate':'update','afterDestroy':_0xaa4b('0x4')};function emitEvent(_0x5e7bce){return function(_0x54f0ce,_0xeb83b1,_0x1b2ee8){ChatWebsiteEvents[_0xaa4b('0x5')](_0x5e7bce+':'+_0x54f0ce['id'],_0x54f0ce);ChatWebsiteEvents[_0xaa4b('0x5')](_0x5e7bce,_0x54f0ce);_0x1b2ee8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xaa4b('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x61a5=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5dc217,_0x260474){var _0x57bbe7=function(_0x5f078d){while(--_0x5f078d){_0x5dc217['push'](_0x5dc217['shift']());}};_0x57bbe7(++_0x260474);}(_0x61a5,0xf0));var _0x561a=function(_0x5d6280,_0x3f72ab){_0x5d6280=_0x5d6280-0x0;var _0x77b738=_0x61a5[_0x5d6280];return _0x77b738;};'use strict';var EventEmitter=require(_0x561a('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x561a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x561a('0x2')](0x0);var events={'afterCreate':_0x561a('0x3'),'afterUpdate':_0x561a('0x4'),'afterDestroy':_0x561a('0x5')};function emitEvent(_0x58f636){return function(_0xe92b4d,_0x33c0f5,_0x5b9ca9){ChatWebsiteEvents[_0x561a('0x6')](_0x58f636+':'+_0xe92b4d['id'],_0xe92b4d);ChatWebsiteEvents[_0x561a('0x6')](_0x58f636,_0xe92b4d);_0x5b9ca9(null);};}for(var e in events){if(events[_0x561a('0x7')](e)){var event=events[e];ChatWebsite[_0x561a('0x8')](e,emitEvent(event));}}module[_0x561a('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 21f31cd..7592050 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1837=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatWebsite','lodash'];(function(_0x134e51,_0x180acb){var _0x56c680=function(_0x357ef0){while(--_0x357ef0){_0x134e51['push'](_0x134e51['shift']());}};_0x56c680(++_0x180acb);}(_0x1837,0x1d8));var _0x7183=function(_0x4f7152,_0x6e2e36){_0x4f7152=_0x4f7152-0x0;var _0x112d12=_0x1837[_0x4f7152];return _0x112d12;};'use strict';var _=require(_0x7183('0x0'));var util=require(_0x7183('0x1'));var logger=require('../../config/logger')(_0x7183('0x2'));var moment=require(_0x7183('0x3'));var BPromise=require(_0x7183('0x4'));var rp=require(_0x7183('0x5'));var fs=require('fs');var path=require(_0x7183('0x6'));var rimraf=require(_0x7183('0x7'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x7183('0x8')]=function(_0x14a842,_0x4a0ab7){return _0x14a842[_0x7183('0x9')](_0x7183('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4806=['request-promise','path','rimraf','../../config/environment','exports','ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird'];(function(_0x57c142,_0x1a8d59){var _0x38f66=function(_0x1a863f){while(--_0x1a863f){_0x57c142['push'](_0x57c142['shift']());}};_0x38f66(++_0x1a8d59);}(_0x4806,0x1d5));var _0x6480=function(_0x80c62,_0xe09ac2){_0x80c62=_0x80c62-0x0;var _0x1e36ab=_0x4806[_0x80c62];return _0x1e36ab;};'use strict';var _=require('lodash');var util=require(_0x6480('0x0'));var logger=require(_0x6480('0x1'))('api');var moment=require(_0x6480('0x2'));var BPromise=require(_0x6480('0x3'));var rp=require(_0x6480('0x4'));var fs=require('fs');var path=require(_0x6480('0x5'));var rimraf=require(_0x6480('0x6'));var config=require(_0x6480('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x6480('0x8')]=function(_0x3ba60e,_0x1bafea){return _0x3ba60e['define'](_0x6480('0x9'),attributes,{'tableName':_0x6480('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 947ae9f..4574cb0 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f82=['jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2bf9dd,_0x1cf613){var _0x1bdcd3=function(_0x50dee5){while(--_0x50dee5){_0x2bf9dd['push'](_0x2bf9dd['shift']());}};_0x1bdcd3(++_0x1cf613);}(_0x5f82,0x161));var _0x25f8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f82[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x25f8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x25f8('0x1'));var fs=require('fs');var Redis=require(_0x25f8('0x2'));var db=require(_0x25f8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x25f8('0x4'))(_0x25f8('0x5'));var config=require(_0x25f8('0x6'));var jayson=require(_0x25f8('0x7'));var client=jayson['client'][_0x25f8('0x8')]({'port':0x232a});config[_0x25f8('0x9')]=_[_0x25f8('0xa')](config[_0x25f8('0x9')],{'host':_0x25f8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25f8('0x9')]));require(_0x25f8('0xc'))[_0x25f8('0xd')](socket);function respondWithRpcPromise(_0x432a1e,_0x21bce0,_0x4a8a6e){return new BPromise(function(_0x54fb7a,_0x3e42a7){return client[_0x25f8('0xe')](_0x432a1e,_0x4a8a6e)[_0x25f8('0xf')](function(_0x5bd70b){logger[_0x25f8('0x10')](_0x25f8('0x11'),_0x21bce0,'request\x20sent');logger['debug'](_0x25f8('0x12'),_0x21bce0,_0x25f8('0x13'),JSON[_0x25f8('0x14')](_0x5bd70b));if(_0x5bd70b['error']){if(_0x5bd70b[_0x25f8('0x15')][_0x25f8('0x16')]===0x1f4){logger[_0x25f8('0x15')](_0x25f8('0x11'),_0x21bce0,_0x5bd70b['error'][_0x25f8('0x17')]);return _0x3e42a7(_0x5bd70b['error'][_0x25f8('0x17')]);}logger[_0x25f8('0x15')](_0x25f8('0x11'),_0x21bce0,_0x5bd70b[_0x25f8('0x15')][_0x25f8('0x17')]);return _0x54fb7a(_0x5bd70b[_0x25f8('0x15')][_0x25f8('0x17')]);}else{logger[_0x25f8('0x10')](_0x25f8('0x11'),_0x21bce0,_0x25f8('0x13'));_0x54fb7a(_0x5bd70b['result']['message']);}})['catch'](function(_0x55d578){logger[_0x25f8('0x15')](_0x25f8('0x11'),_0x21bce0,_0x55d578);_0x3e42a7(_0x55d578);});});}
\ No newline at end of file
+var _0xbf2c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x163d42,_0x3cabea){var _0x59186c=function(_0x139ab9){while(--_0x139ab9){_0x163d42['push'](_0x163d42['shift']());}};_0x59186c(++_0x3cabea);}(_0xbf2c,0x13a));var _0xcbf2=function(_0x782554,_0x1f1e1b){_0x782554=_0x782554-0x0;var _0xdfb436=_0xbf2c[_0x782554];return _0xdfb436;};'use strict';var _=require(_0xcbf2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbf2('0x1'));var rs=require(_0xcbf2('0x2'));var fs=require('fs');var Redis=require(_0xcbf2('0x3'));var db=require(_0xcbf2('0x4'))['db'];var utils=require(_0xcbf2('0x5'));var logger=require(_0xcbf2('0x6'))(_0xcbf2('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbf2('0x8'));var client=jayson[_0xcbf2('0x9')][_0xcbf2('0xa')]({'port':0x232a});config[_0xcbf2('0xb')]=_[_0xcbf2('0xc')](config['redis'],{'host':_0xcbf2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbf2('0xb')]));require(_0xcbf2('0xe'))[_0xcbf2('0xf')](socket);function respondWithRpcPromise(_0x34255a,_0x432f02,_0x39ef08){return new BPromise(function(_0x58604c,_0x2c1947){return client[_0xcbf2('0x10')](_0x34255a,_0x39ef08)[_0xcbf2('0x11')](function(_0x2e85b1){logger[_0xcbf2('0x12')](_0xcbf2('0x13'),_0x432f02,_0xcbf2('0x14'));logger[_0xcbf2('0x15')](_0xcbf2('0x16'),_0x432f02,_0xcbf2('0x14'),JSON[_0xcbf2('0x17')](_0x2e85b1));if(_0x2e85b1[_0xcbf2('0x18')]){if(_0x2e85b1[_0xcbf2('0x18')][_0xcbf2('0x19')]===0x1f4){logger[_0xcbf2('0x18')](_0xcbf2('0x13'),_0x432f02,_0x2e85b1[_0xcbf2('0x18')][_0xcbf2('0x1a')]);return _0x2c1947(_0x2e85b1['error'][_0xcbf2('0x1a')]);}logger[_0xcbf2('0x18')](_0xcbf2('0x13'),_0x432f02,_0x2e85b1[_0xcbf2('0x18')]['message']);return _0x58604c(_0x2e85b1[_0xcbf2('0x18')][_0xcbf2('0x1a')]);}else{logger[_0xcbf2('0x12')](_0xcbf2('0x13'),_0x432f02,_0xcbf2('0x14'));_0x58604c(_0x2e85b1[_0xcbf2('0x1b')]['message']);}})[_0xcbf2('0x1c')](function(_0x1ebece){logger[_0xcbf2('0x18')](_0xcbf2('0x13'),_0x432f02,_0x1ebece);_0x2c1947(_0x1ebece);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 59bd5df..31e905c 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x146d=['update','emit','removeListener','register','length','chatWebsite:','save','remove'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x146d,0x15e));var _0xd146=function(_0x35ace7,_0xbd1eaa){_0x35ace7=_0x35ace7-0x0;var _0x203523=_0x146d[_0x35ace7];return _0x203523;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd146('0x0'),_0xd146('0x1'),_0xd146('0x2')];function createListener(_0x28f377,_0x29f305){return function(_0x27325f){_0x29f305[_0xd146('0x3')](_0x28f377,_0x27325f);};}function removeListener(_0x264773,_0x54b452){return function(){ChatWebsiteEvents[_0xd146('0x4')](_0x264773,_0x54b452);};}exports[_0xd146('0x5')]=function(_0x1964cc){for(var _0x50d80a=0x0,_0x56c043=events[_0xd146('0x6')];_0x50d80a<_0x56c043;_0x50d80a++){var _0x456c4d=events[_0x50d80a];var _0x26b3c2=createListener(_0xd146('0x7')+_0x456c4d,_0x1964cc);ChatWebsiteEvents['on'](_0x456c4d,_0x26b3c2);}};
\ No newline at end of file
+var _0x15c6=['length','chatWebsite:','save','remove','emit','removeListener','register'];(function(_0x17cae3,_0x5d3d3c){var _0x2e6081=function(_0x2e3cd6){while(--_0x2e3cd6){_0x17cae3['push'](_0x17cae3['shift']());}};_0x2e6081(++_0x5d3d3c);}(_0x15c6,0x136));var _0x615c=function(_0x58381c,_0x3b9374){_0x58381c=_0x58381c-0x0;var _0x1a7440=_0x15c6[_0x58381c];return _0x1a7440;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x615c('0x0'),_0x615c('0x1'),'update'];function createListener(_0x1eb42f,_0x175231){return function(_0xdca239){_0x175231[_0x615c('0x2')](_0x1eb42f,_0xdca239);};}function removeListener(_0x229a3c,_0x3888c2){return function(){ChatWebsiteEvents[_0x615c('0x3')](_0x229a3c,_0x3888c2);};}exports[_0x615c('0x4')]=function(_0x12dfb7){for(var _0x53e7bd=0x0,_0x43ea98=events[_0x615c('0x5')];_0x53e7bd<_0x43ea98;_0x53e7bd++){var _0x504702=events[_0x53e7bd];var _0x244765=createListener(_0x615c('0x6')+_0x504702,_0x12dfb7);ChatWebsiteEvents['on'](_0x504702,_0x244765);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9eaf221..63a51c8 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeddd=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','show','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/notify','server/files','attachments','replace','/:id/offline','offline','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeddd,0x11c));var _0xdedd=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xeddd[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var path=require(_0xdedd('0x2'));var timeout=require('connect-timeout');var express=require(_0xdedd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdedd('0x4'));var interaction=require(_0xdedd('0x5'));var config=require(_0xdedd('0x6'));var controller=require(_0xdedd('0x7'));router[_0xdedd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdedd('0x8')](_0xdedd('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xdedd('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xdedd('0xa')]);router[_0xdedd('0x8')]('/:id/dispositions',auth[_0xdedd('0xb')](),controller[_0xdedd('0xc')]);router['get'](_0xdedd('0xd'),auth[_0xdedd('0xb')](),controller[_0xdedd('0xe')]);router[_0xdedd('0x8')]('/:id/logo',controller[_0xdedd('0xf')]);router[_0xdedd('0x8')](_0xdedd('0x10'),controller[_0xdedd('0x11')]);router[_0xdedd('0x8')](_0xdedd('0x12'),controller[_0xdedd('0x13')]);router[_0xdedd('0x8')](_0xdedd('0x14'),controller[_0xdedd('0x15')]);router['get'](_0xdedd('0x16'),auth['isAuthenticated'](),controller[_0xdedd('0x17')]);router[_0xdedd('0x8')](_0xdedd('0x18'),controller[_0xdedd('0x19')]);router[_0xdedd('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0xdedd('0x1a')]);router[_0xdedd('0x8')](_0xdedd('0x1b'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x1c')]);router[_0xdedd('0x8')](_0xdedd('0x1d'),controller[_0xdedd('0x1e')]);router[_0xdedd('0x8')](_0xdedd('0x1f'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x20')]);router[_0xdedd('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xdedd('0x21')]);router[_0xdedd('0x22')]('/',auth[_0xdedd('0xb')](),controller[_0xdedd('0x23')]);router[_0xdedd('0x22')](_0xdedd('0x24'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x25')]);router[_0xdedd('0x22')](_0xdedd('0xd'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x26')]);var upload=multer({'storage':multer[_0xdedd('0x27')]({'destination':function(_0x12db6f,_0x3d966f,_0x56b1cc){_0x56b1cc(null,path[_0xdedd('0x28')](config[_0xdedd('0x29')],_0xdedd('0x2a')));},'filename':function(_0x3af902,_0x283509,_0x5116f3){_0x5116f3(null,util[_0xdedd('0x2b')](_0xdedd('0x2c'),Date[_0xdedd('0x2d')](),_0x283509[_0xdedd('0x2e')]));}})});router['post'](_0xdedd('0x2f'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xdedd('0x27')]({'destination':function(_0x3fe3d4,_0x3f271e,_0x32e8ed){_0x32e8ed(null,path['join'](config[_0xdedd('0x29')],'server/files/images/avatars/'));},'filename':function(_0x5c5f2f,_0x3a2958,_0x261706){_0x261706(null,util[_0xdedd('0x2b')](_0xdedd('0x2c'),Date[_0xdedd('0x2d')](),_0x3a2958[_0xdedd('0x2e')]));}})});router[_0xdedd('0x22')](_0xdedd('0x10'),upload[_0xdedd('0x30')](_0xdedd('0x31')),controller[_0xdedd('0x32')]);var upload=multer({'storage':multer[_0xdedd('0x27')]({'destination':function(_0x576fb3,_0x1c10ac,_0x465cb2){_0x465cb2(null,path[_0xdedd('0x28')](config[_0xdedd('0x29')],_0xdedd('0x33')));},'filename':function(_0x6bd3d6,_0x40f5c2,_0x298aa7){_0x298aa7(null,util[_0xdedd('0x2b')](_0xdedd('0x2c'),Date[_0xdedd('0x2d')](),_0x40f5c2[_0xdedd('0x2e')]));}})});router[_0xdedd('0x22')](_0xdedd('0x12'),upload[_0xdedd('0x30')](_0xdedd('0x31')),controller[_0xdedd('0x34')]);var upload=multer({'storage':multer[_0xdedd('0x27')]({'destination':function(_0x58ad8e,_0x30d3ea,_0x32def4){_0x32def4(null,path[_0xdedd('0x28')](config['root'],_0xdedd('0x33')));},'filename':function(_0x7bffcc,_0x281fe4,_0x2ef65d){_0x2ef65d(null,util['format'](_0xdedd('0x2c'),Date[_0xdedd('0x2d')](),_0x281fe4[_0xdedd('0x2e')]));}})});router[_0xdedd('0x22')]('/:id/system_avatar',upload['single']('file'),controller['addSystemAvatar']);router[_0xdedd('0x22')](_0xdedd('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdedd('0x27')]({'destination':function(_0x5b0807,_0x5352bd,_0x23421f){const _0x2120f1=path[_0xdedd('0x28')](config['root'],_0xdedd('0x36'),_0xdedd('0x37'),'offline-chat');fs_extra['ensureDir'](_0x2120f1,function(){_0x23421f(null,_0x2120f1);});},'filename':function(_0x36f8d8,_0x3ebd1d,_0x5d1f99){const _0x59fc72=_0x3ebd1d['originalname'][_0xdedd('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa6e522=path['extname'](_0x59fc72);const _0x16960e=Date['now']()+'-'+_0x59fc72[_0xdedd('0x38')](_0xa6e522,'')+_0xa6e522;_0x5d1f99(null,_0x16960e);}})});router[_0xdedd('0x22')](_0xdedd('0x39'),offlineUploadMulter['any'](),controller[_0xdedd('0x3a')]);router[_0xdedd('0x22')](_0xdedd('0x16'),auth[_0xdedd('0xb')](),controller['addInteraction']);router['post'](_0xdedd('0x3b'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x3c')]);router[_0xdedd('0x22')](_0xdedd('0x1b'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x3d')]);router['post'](_0xdedd('0x3e'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x3f')]);router[_0xdedd('0x40')](_0xdedd('0x41'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x42')]);router[_0xdedd('0x43')](_0xdedd('0x41'),auth[_0xdedd('0xb')](),controller[_0xdedd('0x44')]);router[_0xdedd('0x43')](_0xdedd('0x24'),auth['isAuthenticated'](),controller[_0xdedd('0x45')]);router[_0xdedd('0x43')](_0xdedd('0xd'),auth[_0xdedd('0xb')](),controller['removeAnswers']);router[_0xdedd('0x43')]('/:id/users',auth[_0xdedd('0xb')](),controller[_0xdedd('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0x5e8b=['/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','join','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','root','server/files/images/avatars/','/:id/avatar','addAvatar','diskStorage','addCustomerAvatar','addSystemAvatar','/:id/notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields'];(function(_0x464b27,_0x1877c8){var _0x59de43=function(_0x4dc439){while(--_0x4dc439){_0x464b27['push'](_0x464b27['shift']());}};_0x59de43(++_0x1877c8);}(_0x5e8b,0x6a));var _0xb5e8=function(_0x45c04f,_0x5e18f1){_0x45c04f=_0x45c04f-0x0;var _0x2af7cd=_0x5e8b[_0x45c04f];return _0x2af7cd;};'use strict';var multer=require(_0xb5e8('0x0'));var util=require(_0xb5e8('0x1'));var path=require(_0xb5e8('0x2'));var timeout=require(_0xb5e8('0x3'));var express=require(_0xb5e8('0x4'));var router=express[_0xb5e8('0x5')]();var fs_extra=require(_0xb5e8('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5e8('0x7'));var controller=require(_0xb5e8('0x8'));router[_0xb5e8('0x9')]('/',auth[_0xb5e8('0xa')](),controller[_0xb5e8('0xb')]);router[_0xb5e8('0x9')](_0xb5e8('0xc'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0xd')]);router[_0xb5e8('0x9')](_0xb5e8('0xe'),auth[_0xb5e8('0xa')](),controller['show']);router[_0xb5e8('0x9')](_0xb5e8('0xf'),auth['isAuthenticated'](),controller[_0xb5e8('0x10')]);router['get'](_0xb5e8('0x11'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x12')]);router[_0xb5e8('0x9')]('/:id/logo',controller[_0xb5e8('0x13')]);router[_0xb5e8('0x9')]('/:id/avatar',controller[_0xb5e8('0x14')]);router[_0xb5e8('0x9')](_0xb5e8('0x15'),controller['getCustomerAvatar']);router[_0xb5e8('0x9')](_0xb5e8('0x16'),controller[_0xb5e8('0x17')]);router[_0xb5e8('0x9')](_0xb5e8('0x18'),auth[_0xb5e8('0xa')](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0xb5e8('0x19')]);router['get'](_0xb5e8('0x1a'),auth['isAuthenticated'](),controller['getApplications']);router[_0xb5e8('0x9')](_0xb5e8('0x1b'),auth[_0xb5e8('0xa')](),controller['getProactiveActions']);router[_0xb5e8('0x9')](_0xb5e8('0x1c'),controller[_0xb5e8('0x1d')]);router['get'](_0xb5e8('0x1e'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x1f')]);router['get'](_0xb5e8('0x20'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x21')]);router[_0xb5e8('0x22')]('/',auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x23')]);router[_0xb5e8('0x22')](_0xb5e8('0xf'),auth[_0xb5e8('0xa')](),controller['addDisposition']);router[_0xb5e8('0x22')](_0xb5e8('0x11'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x200a5f,_0xcf8b0f,_0x892b53){_0x892b53(null,path[_0xb5e8('0x24')](config['root'],_0xb5e8('0x25')));},'filename':function(_0x102066,_0x4c4193,_0x2215ed){_0x2215ed(null,util[_0xb5e8('0x26')](_0xb5e8('0x27'),Date[_0xb5e8('0x28')](),_0x4c4193[_0xb5e8('0x29')]));}})});router[_0xb5e8('0x22')](_0xb5e8('0x2a'),upload[_0xb5e8('0x2b')](_0xb5e8('0x2c')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e7abf,_0x2a7eaa,_0x2d1f21){_0x2d1f21(null,path[_0xb5e8('0x24')](config[_0xb5e8('0x2d')],_0xb5e8('0x2e')));},'filename':function(_0x212a42,_0x579d96,_0x5885f5){_0x5885f5(null,util[_0xb5e8('0x26')](_0xb5e8('0x27'),Date['now'](),_0x579d96[_0xb5e8('0x29')]));}})});router[_0xb5e8('0x22')](_0xb5e8('0x2f'),upload[_0xb5e8('0x2b')](_0xb5e8('0x2c')),controller[_0xb5e8('0x30')]);var upload=multer({'storage':multer[_0xb5e8('0x31')]({'destination':function(_0x41623a,_0x454007,_0x17058c){_0x17058c(null,path[_0xb5e8('0x24')](config[_0xb5e8('0x2d')],'server/files/images/avatars/'));},'filename':function(_0x15f2a4,_0x1fd399,_0xd25e6a){_0xd25e6a(null,util[_0xb5e8('0x26')]('%s-%s',Date['now'](),_0x1fd399['originalname']));}})});router[_0xb5e8('0x22')](_0xb5e8('0x15'),upload[_0xb5e8('0x2b')]('file'),controller[_0xb5e8('0x32')]);var upload=multer({'storage':multer[_0xb5e8('0x31')]({'destination':function(_0x570c1b,_0x588e7c,_0x123f5b){_0x123f5b(null,path['join'](config[_0xb5e8('0x2d')],_0xb5e8('0x2e')));},'filename':function(_0x219bca,_0x5e6cd0,_0x243ef0){_0x243ef0(null,util[_0xb5e8('0x26')]('%s-%s',Date[_0xb5e8('0x28')](),_0x5e6cd0[_0xb5e8('0x29')]));}})});router[_0xb5e8('0x22')](_0xb5e8('0x16'),upload[_0xb5e8('0x2b')](_0xb5e8('0x2c')),controller[_0xb5e8('0x33')]);router[_0xb5e8('0x22')](_0xb5e8('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xb5e8('0x31')]({'destination':function(_0x1f54b3,_0x570a14,_0x504eca){const _0x84b4e4=path[_0xb5e8('0x24')](config['root'],'server/files',_0xb5e8('0x35'),_0xb5e8('0x36'));fs_extra[_0xb5e8('0x37')](_0x84b4e4,function(){_0x504eca(null,_0x84b4e4);});},'filename':function(_0xe7921c,_0x55987a,_0x186822){const _0x52e0ac=_0x55987a[_0xb5e8('0x29')][_0xb5e8('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x10e477=path['extname'](_0x52e0ac);const _0x2025e9=Date[_0xb5e8('0x28')]()+'-'+_0x52e0ac[_0xb5e8('0x38')](_0x10e477,'')+_0x10e477;_0x186822(null,_0x2025e9);}})});router[_0xb5e8('0x22')](_0xb5e8('0x39'),offlineUploadMulter[_0xb5e8('0x3a')](),controller[_0xb5e8('0x3b')]);router[_0xb5e8('0x22')](_0xb5e8('0x18'),auth[_0xb5e8('0xa')](),controller['addInteraction']);router[_0xb5e8('0x22')](_0xb5e8('0x1a'),auth[_0xb5e8('0xa')](),controller['addApplications']);router[_0xb5e8('0x22')]('/:id/proactive_actions',auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x3c')]);router[_0xb5e8('0x22')]('/:id/users',auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x3d')]);router[_0xb5e8('0x3e')](_0xb5e8('0xe'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x3f')]);router[_0xb5e8('0x40')](_0xb5e8('0xe'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x41')]);router[_0xb5e8('0x40')](_0xb5e8('0xf'),auth[_0xb5e8('0xa')](),controller['removeDispositions']);router[_0xb5e8('0x40')](_0xb5e8('0x11'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x42')]);router[_0xb5e8('0x40')](_0xb5e8('0x20'),auth[_0xb5e8('0xa')](),controller[_0xb5e8('0x43')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 1d34bfc..17831de 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd874=['../config/environment','Router','env','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x1e2688,_0x19411e){var _0x3dc79a=function(_0x378ee9){while(--_0x378ee9){_0x1e2688['push'](_0x1e2688['shift']());}};_0x3dc79a(++_0x19411e);}(_0xd874,0x171));var _0x4d87=function(_0x9e5b39,_0xa86fe6){_0x9e5b39=_0x9e5b39-0x0;var _0x1bbc15=_0xd874[_0x9e5b39];return _0x1bbc15;};var beaverLogger=require(_0x4d87('0x0'));var express=require(_0x4d87('0x1'));var auth=require(_0x4d87('0x2'));var config=require(_0x4d87('0x3'));var router=express[_0x4d87('0x4')]();var isProduction=config[_0x4d87('0x5')]==='production'||![];function clientSideLogs(_0x17a2ad,_0x3e490f,_0x582f67){var _0x381619=_0x17a2ad['app'][_0x4d87('0x6')](_0x4d87('0x7'));if(!_0x381619){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x4d87('0x8')]({'uri':'/client-logs','logger':_0x381619,'enableCors':!isProduction})(_0x17a2ad,_0x3e490f,_0x582f67);}router[_0x4d87('0x9')](auth[_0x4d87('0xa')](),clientSideLogs);module[_0x4d87('0xb')]=router;
\ No newline at end of file
+var _0xc4b2=['isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','app','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0xc4b2,0x1ce));var _0x2c4b=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0xc4b2[_0x867b0a];return _0x137438;};var beaverLogger=require(_0x2c4b('0x0'));var express=require('express');var auth=require(_0x2c4b('0x1'));var config=require(_0x2c4b('0x2'));var router=express[_0x2c4b('0x3')]();var isProduction=config[_0x2c4b('0x4')]==='production'||![];function clientSideLogs(_0x2eacb2,_0x1908db,_0x35e508){var _0x35b4aa=_0x2eacb2[_0x2c4b('0x5')]['get']('client-side-logger');if(!_0x35b4aa){throw new Error(_0x2c4b('0x6'));}return beaverLogger['expressEndpoint']({'uri':_0x2c4b('0x7'),'logger':_0x35b4aa,'enableCors':!isProduction})(_0x2eacb2,_0x1908db,_0x35e508);}router['use'](auth[_0x2c4b('0x8')](),clientSideLogs);module[_0x2c4b('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f791181..71fd1c0 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x453a=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x453a,0x18a));var _0xa453=function(_0x20187f,_0xbf67c9){_0x20187f=_0x20187f-0x0;var _0x398db5=_0x453a[_0x20187f];return _0x398db5;};'use strict';var Sequelize=require(_0xa453('0x0'));module[_0xa453('0x1')]={'name':{'type':Sequelize[_0xa453('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa453('0x3')](_0xa453('0x4'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa453('0x3')](_0xa453('0x5'),_0xa453('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xa453('0x7')},'data2':{'type':Sequelize[_0xa453('0x2')],'comment':_0xa453('0x8')},'data3':{'type':Sequelize[_0xa453('0x2')],'comment':_0xa453('0x9')},'data4':{'type':Sequelize[_0xa453('0x2')],'comment':_0xa453('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xa453('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0xa453('0xc')},'data7':{'type':Sequelize[_0xa453('0xd')],'comment':_0xa453('0xe')}};
\ No newline at end of file
+var _0xe63f=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0xe63f,0x9e));var _0xfe63=function(_0xd31b2c,_0x2bccdd){_0xd31b2c=_0xd31b2c-0x0;var _0x5ec823=_0xe63f[_0xd31b2c];return _0x5ec823;};'use strict';var Sequelize=require('sequelize');module[_0xfe63('0x0')]={'name':{'type':Sequelize[_0xfe63('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfe63('0x2')](_0xfe63('0x3'),_0xfe63('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfe63('0x5'),_0xfe63('0x6'))},'data1':{'type':Sequelize[_0xfe63('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xfe63('0x1')],'comment':_0xfe63('0x7')},'data3':{'type':Sequelize[_0xfe63('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xfe63('0x1')],'comment':_0xfe63('0x8')},'data5':{'type':Sequelize[_0xfe63('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xfe63('0x9')],'comment':_0xfe63('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 815400d..1f3752a 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa4f7=['set','Content-Range','update','destroy','then','error','stack','name','send','slice','index','map','CloudProvider','fieldName','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','params','oauth2MicrosoftAuthorize','findOne','get','state','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x10af2b,_0x302c36){var _0x314be2=function(_0x24d803){while(--_0x24d803){_0x10af2b['push'](_0x10af2b['shift']());}};_0x314be2(++_0x302c36);}(_0xa4f7,0x169));var _0x7a4f=function(_0x3c3db9,_0x2f532a){_0x3c3db9=_0x3c3db9-0x0;var _0x3f7d51=_0xa4f7[_0x3c3db9];return _0x3f7d51;};'use strict';var _=require(_0x7a4f('0x0'));var Redis=require(_0x7a4f('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x7a4f('0x2'));var config=require(_0x7a4f('0x3'));var logger=require(_0x7a4f('0x4'))(_0x7a4f('0x5'));var db=require(_0x7a4f('0x6'))['db'];var oauth=require(_0x7a4f('0x7'));config['redis']=_[_0x7a4f('0x8')](config[_0x7a4f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a4f('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x7a4f('0x9')]);function respondWithStatusCode(_0x150b40,_0x703b65){_0x703b65=_0x703b65||0xcc;return function(_0x5c9b81){if(_0x5c9b81){return _0x150b40[_0x7a4f('0xb')](_0x703b65);}return _0x150b40[_0x7a4f('0xc')](_0x703b65)[_0x7a4f('0xd')]();};}function respondWithResult(_0x25f6d3,_0xb68ff4){_0xb68ff4=_0xb68ff4||0xc8;return function(_0x1e121b){if(_0x1e121b){return _0x25f6d3['status'](_0xb68ff4)[_0x7a4f('0xe')](_0x1e121b);}};}function respondWithFilteredResult(_0x2dec04,_0x495d7a){return function(_0x4175f5){if(_0x4175f5){var _0x2211cb=typeof _0x495d7a[_0x7a4f('0xf')]==='undefined'&&typeof _0x495d7a[_0x7a4f('0x10')]===_0x7a4f('0x11');var _0x8e7842=_0x4175f5['count'];var _0x565a8b=_0x2211cb?0x0:_0x495d7a[_0x7a4f('0xf')];var _0x2495de=_0x2211cb?_0x4175f5[_0x7a4f('0x12')]:_0x495d7a[_0x7a4f('0xf')]+_0x495d7a[_0x7a4f('0x10')];var _0xd27483;if(_0x2495de>=_0x8e7842){_0x2495de=_0x8e7842;_0xd27483=0xc8;}else{_0xd27483=0xce;}_0x2dec04[_0x7a4f('0xc')](_0xd27483);return _0x2dec04[_0x7a4f('0x13')](_0x7a4f('0x14'),_0x565a8b+'-'+_0x2495de+'/'+_0x8e7842)['json'](_0x4175f5);}return null;};}function saveUpdates(_0x86f0c3){return function(_0x25eabe){if(_0x25eabe){return _0x25eabe[_0x7a4f('0x15')](_0x86f0c3)['then'](function(_0x23999c){return _0x23999c;});}return null;};}function removeEntity(_0x3bcad2){return function(_0x2a919c){if(_0x2a919c){return _0x2a919c[_0x7a4f('0x16')]()[_0x7a4f('0x17')](function(){_0x3bcad2[_0x7a4f('0xc')](0xcc)[_0x7a4f('0xd')]();});}};}function handleEntityNotFound(_0x2d0594){return function(_0x9bc5da){if(!_0x9bc5da){_0x2d0594['sendStatus'](0x194);}return _0x9bc5da;};}function handleError(_0x2fc7bc,_0x5ae90c){_0x5ae90c=_0x5ae90c||0x1f4;return function(_0x19f6f4){logger[_0x7a4f('0x18')](_0x19f6f4[_0x7a4f('0x19')]);if(_0x19f6f4[_0x7a4f('0x1a')]){delete _0x19f6f4[_0x7a4f('0x1a')];}_0x2fc7bc['status'](_0x5ae90c)[_0x7a4f('0x1b')](_0x19f6f4);};}function maskClientSecret(_0x1a721d){return _['padEnd'](_0x1a721d[_0x7a4f('0x1c')](0x0,0x3),0x14,'*');}exports[_0x7a4f('0x1d')]=function(_0x251ff4,_0xb8bd4a){var _0x5a6f7f={},_0x41c7ee={},_0x20163b={'count':0x0,'rows':[]};var _0x12fa34=_[_0x7a4f('0x1e')](db[_0x7a4f('0x1f')]['rawAttributes'],function(_0x286b34){return{'name':_0x286b34[_0x7a4f('0x20')],'type':_0x286b34['type'][_0x7a4f('0x21')]};});_0x41c7ee[_0x7a4f('0x22')]=_[_0x7a4f('0x1e')](_0x12fa34,_0x7a4f('0x1a'));_0x41c7ee['query']=_[_0x7a4f('0x23')](_0x251ff4['query']);_0x41c7ee[_0x7a4f('0x24')]=_[_0x7a4f('0x25')](_0x41c7ee[_0x7a4f('0x22')],_0x41c7ee['query']);_0x5a6f7f['attributes']=_[_0x7a4f('0x25')](_0x41c7ee[_0x7a4f('0x22')],qs[_0x7a4f('0x26')](_0x251ff4[_0x7a4f('0x27')]['fields']));_0x5a6f7f[_0x7a4f('0x28')]=_0x5a6f7f[_0x7a4f('0x28')][_0x7a4f('0x29')]?_0x5a6f7f[_0x7a4f('0x28')]:_0x41c7ee['model'];if(!_0x251ff4[_0x7a4f('0x27')][_0x7a4f('0x2a')](_0x7a4f('0x2b'))){_0x5a6f7f[_0x7a4f('0x10')]=qs[_0x7a4f('0x10')](_0x251ff4[_0x7a4f('0x27')]['limit']);_0x5a6f7f[_0x7a4f('0xf')]=qs[_0x7a4f('0xf')](_0x251ff4[_0x7a4f('0x27')]['offset']);}_0x5a6f7f[_0x7a4f('0x2c')]=qs[_0x7a4f('0x2d')](_0x251ff4[_0x7a4f('0x27')][_0x7a4f('0x2d')]);_0x5a6f7f[_0x7a4f('0x2e')]=qs[_0x7a4f('0x24')](_['pick'](_0x251ff4['query'],_0x41c7ee[_0x7a4f('0x24')]),_0x12fa34);if(_0x251ff4[_0x7a4f('0x27')]['filter']){_0x5a6f7f[_0x7a4f('0x2e')]=_[_0x7a4f('0x2f')](_0x5a6f7f['where'],{'$or':_[_0x7a4f('0x1e')](_0x12fa34,function(_0x17b27b){if(_0x17b27b['type']!==_0x7a4f('0x30')){var _0x7c9624={};_0x7c9624[_0x17b27b[_0x7a4f('0x1a')]]={'$like':'%'+_0x251ff4[_0x7a4f('0x27')][_0x7a4f('0x31')]+'%'};return _0x7c9624;}})});}_0x5a6f7f=_[_0x7a4f('0x2f')]({},_0x5a6f7f,_0x251ff4[_0x7a4f('0x32')]);var _0x51762b={'where':_0x5a6f7f[_0x7a4f('0x2e')]};return db[_0x7a4f('0x1f')][_0x7a4f('0x12')](_0x51762b)[_0x7a4f('0x17')](function(_0x3a3ed6){_0x20163b[_0x7a4f('0x12')]=_0x3a3ed6;if(_0x251ff4['query'][_0x7a4f('0x33')]){_0x5a6f7f[_0x7a4f('0x34')]=[{'all':!![]}];}return db[_0x7a4f('0x1f')][_0x7a4f('0x35')](_0x5a6f7f);})[_0x7a4f('0x17')](function(_0x56b259){_0x20163b[_0x7a4f('0x36')]=_[_0x7a4f('0x1e')](_0x56b259,function(_0x42e012){if(_0x42e012[_0x7a4f('0x37')]==='MicrosoftAzure'){var _0x151c37=encryptor[_0x7a4f('0x38')](_0x42e012[_0x7a4f('0x39')]);_0x42e012[_0x7a4f('0x39')]=maskClientSecret(_0x151c37);}return _0x42e012;});return _0x20163b;})[_0x7a4f('0x17')](respondWithFilteredResult(_0xb8bd4a,_0x5a6f7f))[_0x7a4f('0x3a')](handleError(_0xb8bd4a,null));};exports[_0x7a4f('0x3b')]=function(_0x5c021a,_0x1848c1){var _0x29100b={'raw':!![],'where':{'id':_0x5c021a['params']['id']}},_0x1748f7={};_0x1748f7['model']=_[_0x7a4f('0x23')](db['CloudProvider']['rawAttributes']);_0x1748f7[_0x7a4f('0x27')]=_[_0x7a4f('0x23')](_0x5c021a['query']);_0x1748f7['filters']=_[_0x7a4f('0x25')](_0x1748f7['model'],_0x1748f7[_0x7a4f('0x27')]);_0x29100b[_0x7a4f('0x28')]=_[_0x7a4f('0x25')](_0x1748f7[_0x7a4f('0x22')],qs[_0x7a4f('0x26')](_0x5c021a[_0x7a4f('0x27')][_0x7a4f('0x26')]));_0x29100b[_0x7a4f('0x28')]=_0x29100b[_0x7a4f('0x28')]['length']?_0x29100b[_0x7a4f('0x28')]:_0x1748f7[_0x7a4f('0x22')];if(_0x5c021a[_0x7a4f('0x27')][_0x7a4f('0x33')]){_0x29100b[_0x7a4f('0x34')]=[{'all':!![]}];}_0x29100b=_[_0x7a4f('0x2f')]({},_0x29100b,_0x5c021a[_0x7a4f('0x32')]);return db[_0x7a4f('0x1f')][_0x7a4f('0x3c')](_0x29100b)[_0x7a4f('0x17')](handleEntityNotFound(_0x1848c1,null))['then'](function(_0x240846){if(_0x240846['service']==='MicrosoftAzure'){var _0xad81cc=encryptor['decryptString'](_0x240846[_0x7a4f('0x39')]);_0x240846[_0x7a4f('0x39')]=maskClientSecret(_0xad81cc);}return _0x240846;})[_0x7a4f('0x17')](respondWithResult(_0x1848c1,null))['catch'](handleError(_0x1848c1,null));};exports[_0x7a4f('0x3d')]=function(_0x578154,_0xa58570){if(!_0x578154[_0x7a4f('0x3e')][_0x7a4f('0x1a')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x578154[_0x7a4f('0x3e')][_0x7a4f('0x37')])throw new Error(_0x7a4f('0x3f'));var _0x37b524=db[_0x7a4f('0x1f')]['rawAttributes'][_0x7a4f('0x37')][_0x7a4f('0x40')];if(!_0x37b524[_0x7a4f('0x41')](_0x578154['body'][_0x7a4f('0x37')]))throw new Error(_0x7a4f('0x42')+_0x37b524[_0x7a4f('0x43')](',\x20'));if(_0x578154[_0x7a4f('0x3e')][_0x7a4f('0x37')]===_0x7a4f('0x44')&&_0x578154[_0x7a4f('0x3e')][_0x7a4f('0x39')]){_0x578154[_0x7a4f('0x3e')][_0x7a4f('0x39')]=encryptor[_0x7a4f('0x45')](_0x578154[_0x7a4f('0x3e')][_0x7a4f('0x39')]);}return db[_0x7a4f('0x1f')][_0x7a4f('0x3d')](_0x578154[_0x7a4f('0x3e')],{})['then'](respondWithResult(_0xa58570,0xc9))['catch'](handleError(_0xa58570,null));};exports[_0x7a4f('0x15')]=function(_0xc4d136,_0x237251){if(_0xc4d136['body']['id']){delete _0xc4d136[_0x7a4f('0x3e')]['id'];}return db[_0x7a4f('0x1f')]['find']({'where':{'id':_0xc4d136[_0x7a4f('0x46')]['id']}})[_0x7a4f('0x17')](handleEntityNotFound(_0x237251,null))[_0x7a4f('0x17')](function(_0x4cf58c){if(_0x4cf58c['service']==='MicrosoftAzure'&&_0xc4d136['body'][_0x7a4f('0x39')]){_0xc4d136['body'][_0x7a4f('0x39')]=encryptor[_0x7a4f('0x45')](_0xc4d136['body']['data3']);}return _0x4cf58c;})['then'](saveUpdates(_0xc4d136[_0x7a4f('0x3e')],null))[_0x7a4f('0x17')](respondWithResult(_0x237251,null))['catch'](handleError(_0x237251,null));};exports['destroy']=function(_0xcf2362,_0x493be6){return db[_0x7a4f('0x1f')]['find']({'where':{'id':_0xcf2362[_0x7a4f('0x46')]['id']}})['then'](handleEntityNotFound(_0x493be6,null))['then'](removeEntity(_0x493be6,null))[_0x7a4f('0x3a')](handleError(_0x493be6,null));};exports[_0x7a4f('0x47')]=function(_0x105031,_0x54bc39){return db[_0x7a4f('0x1f')][_0x7a4f('0x48')]({'where':{'id':_0x105031[_0x7a4f('0x46')]['id']},'raw':!![]})[_0x7a4f('0x17')](function(_0x1de21a){if(!_0x1de21a)return _0x54bc39[_0x7a4f('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1de21a,_0x105031['user']['id'])};})['then'](respondWithResult(_0x54bc39,null))[_0x7a4f('0x3a')](handleError(_0x54bc39,null));};exports['oauth2MicrosoftCallback']=function(_0x1a48d0,_0x5a8971){var _0x3be61b=_0x1a48d0[_0x7a4f('0x3e')];var _0x4c2d87;var _0x1858ad;if(_0x3be61b['error'])throw _0x3be61b;redis[_0x7a4f('0x49')](_0x3be61b[_0x7a4f('0x4a')])[_0x7a4f('0x17')](function(_0x2bc3b6){if(!_0x2bc3b6)throw new Error('Invalid\x20state\x20parameter');_0x4c2d87=JSON[_0x7a4f('0x4b')](_0x2bc3b6);var _0x91f99e=Buffer['from'](_0x3be61b[_0x7a4f('0x4a')],_0x7a4f('0x4c'))[_0x7a4f('0x4d')](_0x7a4f('0x4e'));_0x1858ad=JSON['parse'](_0x91f99e);if(!oauth[_0x7a4f('0x4f')](_0x3be61b[_0x7a4f('0x50')],_0x4c2d87[_0x7a4f('0x51')]))throw new Error(_0x7a4f('0x52'));redis['del'](_0x3be61b[_0x7a4f('0x4a')]);return oauth[_0x7a4f('0x53')](_0x3be61b[_0x7a4f('0x54')],_0x4c2d87);})[_0x7a4f('0x17')](function(_0x2d9d03){_0x4c2d87[_0x7a4f('0x55')]=_0x2d9d03[_0x7a4f('0x56')];_0x4c2d87[_0x7a4f('0x57')]=_0x2d9d03['refresh_token'];return db[_0x7a4f('0x1f')]['update']({'data5':_0x4c2d87['data5'],'data6':_0x4c2d87[_0x7a4f('0x57')]},{'where':{'id':_0x4c2d87['id']}});})[_0x7a4f('0x17')](function(){oauth['startRefreshInterval'](_0x4c2d87);socket['emit'](_0x7a4f('0x58'),{'id':_0x1858ad['id']});return;})[_0x7a4f('0x17')](respondWithStatusCode(_0x5a8971,null))[_0x7a4f('0x3a')](function(_0x1ac4c4){if(_0x1858ad){socket[_0x7a4f('0x59')](_0x7a4f('0x5a'),{'id':_0x1858ad['id']});}if(!_0x4c2d87){logger[_0x7a4f('0x18')](_0x7a4f('0x5b'),_0x1ac4c4);return _0x5a8971[_0x7a4f('0xc')](0x1f4)[_0x7a4f('0x1b')](_0x1ac4c4[_0x7a4f('0x5c')]);}logger[_0x7a4f('0x18')](_0x7a4f('0x5d'),_0x4c2d87['id'],JSON[_0x7a4f('0x5e')](_0x1ac4c4));});};
\ No newline at end of file
+var _0x47db=['destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','keys','length','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','parse','from','state','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then'];(function(_0x2ef1ae,_0x3f0649){var _0x41fdd7=function(_0x56bfec){while(--_0x56bfec){_0x2ef1ae['push'](_0x2ef1ae['shift']());}};_0x41fdd7(++_0x3f0649);}(_0x47db,0x15f));var _0xb47d=function(_0x2010ef,_0x2e0229){_0x2010ef=_0x2010ef-0x0;var _0x281728=_0x47db[_0x2010ef];return _0x281728;};'use strict';var _=require('lodash');var Redis=require(_0xb47d('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xb47d('0x1'))(_0xb47d('0x2'));var db=require(_0xb47d('0x3'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xb47d('0x4')]=_[_0xb47d('0x5')](config[_0xb47d('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xb47d('0x6'))(new Redis(config[_0xb47d('0x4')]));var redis=new Redis(config[_0xb47d('0x4')]);function respondWithStatusCode(_0x3b2e15,_0x2802c9){_0x2802c9=_0x2802c9||0xcc;return function(_0x32dfd1){if(_0x32dfd1){return _0x3b2e15[_0xb47d('0x7')](_0x2802c9);}return _0x3b2e15[_0xb47d('0x8')](_0x2802c9)['end']();};}function respondWithResult(_0x3f0fc2,_0x261674){_0x261674=_0x261674||0xc8;return function(_0x5ab928){if(_0x5ab928){return _0x3f0fc2['status'](_0x261674)['json'](_0x5ab928);}};}function respondWithFilteredResult(_0x3d7ad8,_0x35b9e4){return function(_0x133199){if(_0x133199){var _0x3c79ab=typeof _0x35b9e4[_0xb47d('0x9')]===_0xb47d('0xa')&&typeof _0x35b9e4[_0xb47d('0xb')]===_0xb47d('0xa');var _0x353fd2=_0x133199[_0xb47d('0xc')];var _0x175e83=_0x3c79ab?0x0:_0x35b9e4[_0xb47d('0x9')];var _0x4f4248=_0x3c79ab?_0x133199[_0xb47d('0xc')]:_0x35b9e4['offset']+_0x35b9e4[_0xb47d('0xb')];var _0x47913c;if(_0x4f4248>=_0x353fd2){_0x4f4248=_0x353fd2;_0x47913c=0xc8;}else{_0x47913c=0xce;}_0x3d7ad8[_0xb47d('0x8')](_0x47913c);return _0x3d7ad8['set'](_0xb47d('0xd'),_0x175e83+'-'+_0x4f4248+'/'+_0x353fd2)[_0xb47d('0xe')](_0x133199);}return null;};}function saveUpdates(_0x275b6c){return function(_0x258ab7){if(_0x258ab7){return _0x258ab7[_0xb47d('0xf')](_0x275b6c)[_0xb47d('0x10')](function(_0x7ee9c1){return _0x7ee9c1;});}return null;};}function removeEntity(_0x1fb5ee){return function(_0x4ac953){if(_0x4ac953){return _0x4ac953[_0xb47d('0x11')]()[_0xb47d('0x10')](function(){_0x1fb5ee[_0xb47d('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x255d0d){return function(_0x51f1a8){if(!_0x51f1a8){_0x255d0d[_0xb47d('0x7')](0x194);}return _0x51f1a8;};}function handleError(_0x5f39e4,_0x3e66fa){_0x3e66fa=_0x3e66fa||0x1f4;return function(_0x79d79b){logger[_0xb47d('0x12')](_0x79d79b[_0xb47d('0x13')]);if(_0x79d79b[_0xb47d('0x14')]){delete _0x79d79b['name'];}_0x5f39e4[_0xb47d('0x8')](_0x3e66fa)[_0xb47d('0x15')](_0x79d79b);};}function maskClientSecret(_0x39daef){return _[_0xb47d('0x16')](_0x39daef[_0xb47d('0x17')](0x0,0x3),0x14,'*');}exports[_0xb47d('0x18')]=function(_0x4ddf96,_0x38150c){var _0x229c4d={},_0x23619f={},_0x5d9f9d={'count':0x0,'rows':[]};var _0x42be46=_[_0xb47d('0x19')](db[_0xb47d('0x1a')]['rawAttributes'],function(_0x157c32){return{'name':_0x157c32[_0xb47d('0x1b')],'type':_0x157c32['type'][_0xb47d('0x1c')]};});_0x23619f[_0xb47d('0x1d')]=_[_0xb47d('0x19')](_0x42be46,'name');_0x23619f[_0xb47d('0x1e')]=_['keys'](_0x4ddf96[_0xb47d('0x1e')]);_0x23619f[_0xb47d('0x1f')]=_[_0xb47d('0x20')](_0x23619f[_0xb47d('0x1d')],_0x23619f[_0xb47d('0x1e')]);_0x229c4d[_0xb47d('0x21')]=_[_0xb47d('0x20')](_0x23619f[_0xb47d('0x1d')],qs[_0xb47d('0x22')](_0x4ddf96[_0xb47d('0x1e')][_0xb47d('0x22')]));_0x229c4d[_0xb47d('0x21')]=_0x229c4d['attributes']['length']?_0x229c4d['attributes']:_0x23619f[_0xb47d('0x1d')];if(!_0x4ddf96[_0xb47d('0x1e')]['hasOwnProperty'](_0xb47d('0x23'))){_0x229c4d[_0xb47d('0xb')]=qs['limit'](_0x4ddf96[_0xb47d('0x1e')][_0xb47d('0xb')]);_0x229c4d[_0xb47d('0x9')]=qs[_0xb47d('0x9')](_0x4ddf96[_0xb47d('0x1e')]['offset']);}_0x229c4d[_0xb47d('0x24')]=qs[_0xb47d('0x25')](_0x4ddf96[_0xb47d('0x1e')][_0xb47d('0x25')]);_0x229c4d[_0xb47d('0x26')]=qs[_0xb47d('0x1f')](_['pick'](_0x4ddf96['query'],_0x23619f['filters']),_0x42be46);if(_0x4ddf96[_0xb47d('0x1e')]['filter']){_0x229c4d[_0xb47d('0x26')]=_[_0xb47d('0x27')](_0x229c4d['where'],{'$or':_[_0xb47d('0x19')](_0x42be46,function(_0x895c2a){if(_0x895c2a[_0xb47d('0x28')]!==_0xb47d('0x29')){var _0x12d968={};_0x12d968[_0x895c2a[_0xb47d('0x14')]]={'$like':'%'+_0x4ddf96[_0xb47d('0x1e')][_0xb47d('0x2a')]+'%'};return _0x12d968;}})});}_0x229c4d=_['merge']({},_0x229c4d,_0x4ddf96[_0xb47d('0x2b')]);var _0x1520f0={'where':_0x229c4d['where']};return db[_0xb47d('0x1a')][_0xb47d('0xc')](_0x1520f0)['then'](function(_0x266340){_0x5d9f9d[_0xb47d('0xc')]=_0x266340;if(_0x4ddf96['query'][_0xb47d('0x2c')]){_0x229c4d[_0xb47d('0x2d')]=[{'all':!![]}];}return db[_0xb47d('0x1a')][_0xb47d('0x2e')](_0x229c4d);})[_0xb47d('0x10')](function(_0x5a1045){_0x5d9f9d[_0xb47d('0x2f')]=_[_0xb47d('0x19')](_0x5a1045,function(_0x33dff6){if(_0x33dff6[_0xb47d('0x30')]===_0xb47d('0x31')){var _0x1c76c4=encryptor[_0xb47d('0x32')](_0x33dff6[_0xb47d('0x33')]);_0x33dff6['data3']=maskClientSecret(_0x1c76c4);}return _0x33dff6;});return _0x5d9f9d;})[_0xb47d('0x10')](respondWithFilteredResult(_0x38150c,_0x229c4d))[_0xb47d('0x34')](handleError(_0x38150c,null));};exports[_0xb47d('0x35')]=function(_0x3e0e08,_0x4aaa22){var _0x23e0e5={'raw':!![],'where':{'id':_0x3e0e08[_0xb47d('0x36')]['id']}},_0x581067={};_0x581067['model']=_['keys'](db[_0xb47d('0x1a')][_0xb47d('0x37')]);_0x581067[_0xb47d('0x1e')]=_[_0xb47d('0x38')](_0x3e0e08['query']);_0x581067[_0xb47d('0x1f')]=_['intersection'](_0x581067[_0xb47d('0x1d')],_0x581067[_0xb47d('0x1e')]);_0x23e0e5[_0xb47d('0x21')]=_[_0xb47d('0x20')](_0x581067['model'],qs['fields'](_0x3e0e08['query'][_0xb47d('0x22')]));_0x23e0e5[_0xb47d('0x21')]=_0x23e0e5[_0xb47d('0x21')][_0xb47d('0x39')]?_0x23e0e5['attributes']:_0x581067[_0xb47d('0x1d')];if(_0x3e0e08[_0xb47d('0x1e')]['includeAll']){_0x23e0e5['include']=[{'all':!![]}];}_0x23e0e5=_[_0xb47d('0x27')]({},_0x23e0e5,_0x3e0e08[_0xb47d('0x2b')]);return db[_0xb47d('0x1a')][_0xb47d('0x3a')](_0x23e0e5)[_0xb47d('0x10')](handleEntityNotFound(_0x4aaa22,null))[_0xb47d('0x10')](function(_0x527bb2){if(_0x527bb2['service']===_0xb47d('0x31')){var _0x34c3a4=encryptor[_0xb47d('0x32')](_0x527bb2['data3']);_0x527bb2[_0xb47d('0x33')]=maskClientSecret(_0x34c3a4);}return _0x527bb2;})['then'](respondWithResult(_0x4aaa22,null))[_0xb47d('0x34')](handleError(_0x4aaa22,null));};exports[_0xb47d('0x3b')]=function(_0xff14d2,_0x40f297){if(!_0xff14d2[_0xb47d('0x3c')][_0xb47d('0x14')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xff14d2[_0xb47d('0x3c')][_0xb47d('0x30')])throw new Error(_0xb47d('0x3d'));var _0x21319=db[_0xb47d('0x1a')]['rawAttributes'][_0xb47d('0x30')][_0xb47d('0x3e')];if(!_0x21319[_0xb47d('0x3f')](_0xff14d2[_0xb47d('0x3c')][_0xb47d('0x30')]))throw new Error(_0xb47d('0x40')+_0x21319[_0xb47d('0x41')](',\x20'));if(_0xff14d2[_0xb47d('0x3c')]['service']==='MicrosoftAzure'&&_0xff14d2[_0xb47d('0x3c')][_0xb47d('0x33')]){_0xff14d2['body'][_0xb47d('0x33')]=encryptor[_0xb47d('0x42')](_0xff14d2['body'][_0xb47d('0x33')]);}return db[_0xb47d('0x1a')][_0xb47d('0x3b')](_0xff14d2[_0xb47d('0x3c')],{})['then'](respondWithResult(_0x40f297,0xc9))[_0xb47d('0x34')](handleError(_0x40f297,null));};exports[_0xb47d('0xf')]=function(_0x320587,_0x1a0689){if(_0x320587['body']['id']){delete _0x320587[_0xb47d('0x3c')]['id'];}return db[_0xb47d('0x1a')][_0xb47d('0x3a')]({'where':{'id':_0x320587[_0xb47d('0x36')]['id']}})['then'](handleEntityNotFound(_0x1a0689,null))[_0xb47d('0x10')](function(_0x20d7e9){if(_0x20d7e9[_0xb47d('0x30')]===_0xb47d('0x31')&&_0x320587[_0xb47d('0x3c')][_0xb47d('0x33')]){_0x320587[_0xb47d('0x3c')][_0xb47d('0x33')]=encryptor[_0xb47d('0x42')](_0x320587[_0xb47d('0x3c')][_0xb47d('0x33')]);}return _0x20d7e9;})[_0xb47d('0x10')](saveUpdates(_0x320587[_0xb47d('0x3c')],null))['then'](respondWithResult(_0x1a0689,null))[_0xb47d('0x34')](handleError(_0x1a0689,null));};exports['destroy']=function(_0xeb524b,_0x402a24){return db[_0xb47d('0x1a')][_0xb47d('0x3a')]({'where':{'id':_0xeb524b[_0xb47d('0x36')]['id']}})[_0xb47d('0x10')](handleEntityNotFound(_0x402a24,null))[_0xb47d('0x10')](removeEntity(_0x402a24,null))[_0xb47d('0x34')](handleError(_0x402a24,null));};exports[_0xb47d('0x43')]=function(_0x1aa0e4,_0x3c42e4){return db[_0xb47d('0x1a')][_0xb47d('0x44')]({'where':{'id':_0x1aa0e4[_0xb47d('0x36')]['id']},'raw':!![]})['then'](function(_0x42750d){if(!_0x42750d)return _0x3c42e4[_0xb47d('0x7')](0x194);return{'url':oauth[_0xb47d('0x45')](_0x42750d,_0x1aa0e4[_0xb47d('0x46')]['id'])};})['then'](respondWithResult(_0x3c42e4,null))[_0xb47d('0x34')](handleError(_0x3c42e4,null));};exports['oauth2MicrosoftCallback']=function(_0x20147f,_0xfe2188){var _0x1042cd=_0x20147f[_0xb47d('0x3c')];var _0x5eca7f;var _0x5ba3f9;if(_0x1042cd[_0xb47d('0x12')])throw _0x1042cd;redis[_0xb47d('0x47')](_0x1042cd['state'])['then'](function(_0x379626){if(!_0x379626)throw new Error(_0xb47d('0x48'));_0x5eca7f=JSON[_0xb47d('0x49')](_0x379626);var _0x3f4d5a=Buffer[_0xb47d('0x4a')](_0x1042cd[_0xb47d('0x4b')],'base64')[_0xb47d('0x4c')]('ascii');_0x5ba3f9=JSON[_0xb47d('0x49')](_0x3f4d5a);if(!oauth[_0xb47d('0x4d')](_0x1042cd['id_token'],_0x5eca7f[_0xb47d('0x4e')]))throw new Error(_0xb47d('0x4f'));redis['del'](_0x1042cd['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x1042cd[_0xb47d('0x50')],_0x5eca7f);})[_0xb47d('0x10')](function(_0x1fb02a){_0x5eca7f[_0xb47d('0x51')]=_0x1fb02a[_0xb47d('0x52')];_0x5eca7f[_0xb47d('0x53')]=_0x1fb02a[_0xb47d('0x54')];return db['CloudProvider']['update']({'data5':_0x5eca7f['data5'],'data6':_0x5eca7f[_0xb47d('0x53')]},{'where':{'id':_0x5eca7f['id']}});})[_0xb47d('0x10')](function(){oauth['startRefreshInterval'](_0x5eca7f);socket[_0xb47d('0x55')](_0xb47d('0x56'),{'id':_0x5ba3f9['id']});return;})[_0xb47d('0x10')](respondWithStatusCode(_0xfe2188,null))[_0xb47d('0x34')](function(_0x55a0b7){if(_0x5ba3f9){socket[_0xb47d('0x55')](_0xb47d('0x57'),{'id':_0x5ba3f9['id']});}if(!_0x5eca7f){logger[_0xb47d('0x12')](_0xb47d('0x58'),_0x55a0b7);return _0xfe2188[_0xb47d('0x8')](0x1f4)[_0xb47d('0x15')](_0x55a0b7[_0xb47d('0x59')]);}logger[_0xb47d('0x12')](_0xb47d('0x5a'),_0x5eca7f['id'],JSON[_0xb47d('0x5b')](_0x55a0b7));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 778db76..796e7cd 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x195b=['rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xced98a,_0x5cb79a){var _0x2055db=function(_0x7c4807){while(--_0x7c4807){_0xced98a['push'](_0xced98a['shift']());}};_0x2055db(++_0x5cb79a);}(_0x195b,0x1c0));var _0xb195=function(_0x19eea4,_0x333721){_0x19eea4=_0x19eea4-0x0;var _0x413d38=_0x195b[_0x19eea4];return _0x413d38;};'use strict';var _=require(_0xb195('0x0'));var util=require(_0xb195('0x1'));var logger=require('../../config/logger')(_0xb195('0x2'));var moment=require(_0xb195('0x3'));var BPromise=require(_0xb195('0x4'));var rp=require(_0xb195('0x5'));var fs=require('fs');var path=require(_0xb195('0x6'));var rimraf=require(_0xb195('0x7'));var config=require(_0xb195('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xb195('0x9')]=function(_0x17713c,_0x5622c3){return _0x17713c[_0xb195('0xa')](_0xb195('0xb'),attributes,{'tableName':_0xb195('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8ef=['request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x949cc1,_0x5903ba){var _0x52cc2e=function(_0x3f19a9){while(--_0x3f19a9){_0x949cc1['push'](_0x949cc1['shift']());}};_0x52cc2e(++_0x5903ba);}(_0xc8ef,0xb1));var _0xfc8e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xc8ef[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xfc8e('0x0'));var util=require(_0xfc8e('0x1'));var logger=require(_0xfc8e('0x2'))('api');var moment=require(_0xfc8e('0x3'));var BPromise=require(_0xfc8e('0x4'));var rp=require(_0xfc8e('0x5'));var fs=require('fs');var path=require(_0xfc8e('0x6'));var rimraf=require(_0xfc8e('0x7'));var config=require(_0xfc8e('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xfc8e('0x9')]=function(_0x19a878,_0x1a04a6){return _0x19a878[_0xfc8e('0xa')](_0xfc8e('0xb'),attributes,{'tableName':_0xfc8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 8f48ac4..4fc2bb8 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x754c=['access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','catch','inspect','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','id_token','from','stringify','toString','base64','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','nonce','map','key','value','join','set','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data2','data5'];(function(_0x14854e,_0x731c62){var _0x2f96d0=function(_0x4dcc99){while(--_0x4dcc99){_0x14854e['push'](_0x14854e['shift']());}};_0x2f96d0(++_0x731c62);}(_0x754c,0xeb));var _0xc754=function(_0x1e5dfc,_0x5791eb){_0x1e5dfc=_0x1e5dfc-0x0;var _0x519071=_0x754c[_0x1e5dfc];return _0x519071;};'use strict';var _=require(_0xc754('0x0'));var crypto=require(_0xc754('0x1'));var jwt=require(_0xc754('0x2'));var moment=require(_0xc754('0x3'));var Redis=require(_0xc754('0x4'));var rp=require(_0xc754('0x5'));var util=require('util');var encryptor=require(_0xc754('0x6'));var config=require(_0xc754('0x7'));var logger=require(_0xc754('0x8'))('api');var schedule=require(_0xc754('0x9'));var db=require(_0xc754('0xa'))['db'];config[_0xc754('0xb')]=_['defaults'](config[_0xc754('0xb')],{'host':_0xc754('0xc'),'port':0x18eb});var redis=new Redis(config[_0xc754('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xc754('0xd'),_0xc754('0xe'),_0xc754('0xf'),_0xc754('0x10'),_0xc754('0x11'),_0xc754('0x12'),_0xc754('0x13')],'Dynamics365':[_0xc754('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xc754('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xe7111d){var _0x10e369=_['map'](AZURE_AUTH_SCOPES[_0xe7111d[_0xc754('0x15')]]);if(_0xe7111d[_0xc754('0x15')]===_0xc754('0x16'))_0x10e369[_0xc754('0x17')](_0xe7111d[_0xc754('0x18')]+_0xc754('0x19'));return _0x10e369['join']('\x20');}function getAccessTokenScope(_0x3336f4){if(_0x3336f4[_0xc754('0x15')]===_0xc754('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3336f4[_0xc754('0x15')]===_0xc754('0x16'))return _0x3336f4[_0xc754('0x18')]+_0xc754('0x19');}function generateMicrosoftAuthorizationUrl(_0x1ff16a,_0x799a8){var _0x405fe0=MICROSOFT_AUTH_URL[_0xc754('0x1b')](_0xc754('0x1c'),_0x1ff16a['data2']);var _0x274124=['code',_0xc754('0x1d')];var _0x2a6d52=Buffer[_0xc754('0x1e')](JSON[_0xc754('0x1f')]({'id':_0x799a8}))[_0xc754('0x20')](_0xc754('0x21'));var _0x5b325a=crypto['randomBytes'](0x10)['toString']('hex');var _0x188749=getAuthorizationScopes(_0x1ff16a);var _0x5601b4=[{'key':_0xc754('0x22'),'value':_0x1ff16a[_0xc754('0x23')]},{'key':_0xc754('0x24'),'value':encodeURIComponent(_0x274124['join']('\x20'))},{'key':_0xc754('0x25'),'value':_0x1ff16a[_0xc754('0x26')]},{'key':_0xc754('0x27'),'value':'form_post'},{'key':_0xc754('0x28'),'value':encodeURIComponent(_0x188749)},{'key':'state','value':_0x2a6d52},{'key':_0xc754('0x29'),'value':_0x5b325a},{'key':'prompt','value':'login'}];var _0x35f060=_0x405fe0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc754('0x2a')](_0x5601b4,function(_0x756e90){return _0x756e90[_0xc754('0x2b')]+'='+_0x756e90[_0xc754('0x2c')];})[_0xc754('0x2d')]('&');_0x1ff16a['oauth2Claims']={'issuer':_0x405fe0[_0xc754('0x1b')]('oauth2/',''),'audience':_0x1ff16a[_0xc754('0x23')],'state':_0x2a6d52,'nonce':_0x5b325a};redis[_0xc754('0x2e')](_0x2a6d52,JSON[_0xc754('0x1f')](_0x1ff16a));return _0x35f060;}function isValidIdToken(_0x524a2c,_0x168f71){try{var _0x57513a=jwt[_0xc754('0x2f')](_0x524a2c,{'complete':!![]});var _0x12c63f=_0x57513a[_0xc754('0x30')];if(_0x12c63f['iss']!==_0x168f71[_0xc754('0x31')])return![];if(_0x12c63f[_0xc754('0x32')]!==_0x168f71[_0xc754('0x33')])return![];if(_0x12c63f['nonce']!==_0x168f71[_0xc754('0x29')])return![];if(moment()[_0xc754('0x34')](moment[_0xc754('0x35')](_0x12c63f[_0xc754('0x36')])))return![];return!![];}catch(_0x292d6f){throw _0x292d6f;}}function refreshOauth2MicrosoftAccessToken(_0x2dcf7b){return Promise[_0xc754('0x37')]()[_0xc754('0x38')](function(){if(_0x2dcf7b['data3'])return _0x2dcf7b;return db[_0xc754('0x39')][_0xc754('0x3a')]({'where':{'id':_0x2dcf7b['id']},'raw':!![]});})['then'](function(_0x367800){var _0x13ef8e={'grant_type':_0xc754('0x3b'),'refresh_token':_0x367800[_0xc754('0x3c')],'scope':getAccessTokenScope(_0x367800),'redirect_uri':_0x367800[_0xc754('0x26')],'client_id':_0x367800['data1'],'client_secret':encryptor[_0xc754('0x3d')](_0x367800['data3'])};var _0x404aed={'method':_0xc754('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xc754('0x1b')]('{TENANT_ID}',_0x367800[_0xc754('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x13ef8e,'json':!![]};return rp(_0x404aed);})['then'](function(_0x168fc6){_0x2dcf7b[_0xc754('0x40')]=_0x168fc6[_0xc754('0x41')];_0x2dcf7b[_0xc754('0x3c')]=_0x168fc6[_0xc754('0x3b')];return db[_0xc754('0x39')][_0xc754('0x42')]({'data5':_0x2dcf7b[_0xc754('0x40')],'data6':_0x2dcf7b[_0xc754('0x3c')]},{'where':{'id':_0x2dcf7b['id']}});})['then'](function(){return _0x2dcf7b;})['catch'](function(_0x2d1a51){logger[_0xc754('0x43')](_0xc754('0x44'),_0x2dcf7b['id'],_0x2d1a51);});}function getOauth2MicrosoftAccessToken(_0x4c88ef,_0x37d31e){var _0x3c0bde={'grant_type':_0xc754('0x45'),'code':_0x4c88ef,'scope':getAccessTokenScope(_0x37d31e),'redirect_uri':_0x37d31e[_0xc754('0x26')],'client_id':_0x37d31e['data1'],'client_secret':encryptor['decryptString'](_0x37d31e['data3'])};var _0x29296d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xc754('0x1b')](_0xc754('0x1c'),_0x37d31e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3c0bde,'json':!![]};return rp(_0x29296d);}function startRefreshInterval(_0x4301ab){var _0x56db51=schedule[_0xc754('0x46')];if(_0x56db51[_0x4301ab['id']])clearInterval(_0x56db51[_0x4301ab['id']]);_0x56db51[_0x4301ab['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc754('0x47')](this,{'id':_0x4301ab['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc754('0x46')]=_0x56db51;}function startAllRefreshIntervals(){return db[_0xc754('0x39')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc754('0x38')](function(_0x48c721){var _0xa2c826=_0x48c721[_0xc754('0x2a')](function(_0x5638ca){return refreshOauth2MicrosoftAccessToken(_0x5638ca)[_0xc754('0x38')](function(_0x2b4e43){startRefreshInterval(_0x2b4e43);});});return Promise[_0xc754('0x48')](_0xa2c826);})[_0xc754('0x49')](function(_0x383ad1){var _0x2a1f21=_0x383ad1?util[_0xc754('0x4a')](_0x383ad1,{'showHidden':![],'depth':null}):'';logger[_0xc754('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2a1f21);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x4752=['resolve','then','data3','CloudProvider','findOne','decryptString','POST','access_token','data6','data5','catch','authorization_code','intervals','bind','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','data2','id_token','toString','randomBytes','hex','data1','response_type','join','data4','form_post','scope','state','nonce','prompt','key','value','oauth2/','payload','iss','aud','isAfter','unix','exp'];(function(_0x5da086,_0x3b56ce){var _0x4b23fd=function(_0x3b4caa){while(--_0x3b4caa){_0x5da086['push'](_0x5da086['shift']());}};_0x4b23fd(++_0x3b56ce);}(_0x4752,0x93));var _0x2475=function(_0x279eb4,_0x11b8c0){_0x279eb4=_0x279eb4-0x0;var _0x24f399=_0x4752[_0x279eb4];return _0x24f399;};'use strict';var _=require('lodash');var crypto=require(_0x2475('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x2475('0x1'));var Redis=require(_0x2475('0x2'));var rp=require('request-promise');var util=require(_0x2475('0x3'));var encryptor=require(_0x2475('0x4'));var config=require(_0x2475('0x5'));var logger=require(_0x2475('0x6'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2475('0x7')](config[_0x2475('0x8')],{'host':_0x2475('0x9'),'port':0x18eb});var redis=new Redis(config[_0x2475('0x8')]);var MICROSOFT_AUTH_URL=_0x2475('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2475('0xb'),_0x2475('0xc'),_0x2475('0xd'),_0x2475('0xe'),_0x2475('0xf'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x2475('0xb'),_0x2475('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x2475('0x10');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b132c){var _0x41fdf4=_[_0x2475('0x11')](AZURE_AUTH_SCOPES[_0x5b132c[_0x2475('0x12')]]);if(_0x5b132c[_0x2475('0x12')]===_0x2475('0x13'))_0x41fdf4[_0x2475('0x14')](_0x5b132c[_0x2475('0x15')]+_0x2475('0x16'));return _0x41fdf4['join']('\x20');}function getAccessTokenScope(_0x3415fc){if(_0x3415fc[_0x2475('0x12')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3415fc['type']===_0x2475('0x13'))return _0x3415fc[_0x2475('0x15')]+_0x2475('0x16');}function generateMicrosoftAuthorizationUrl(_0x2754cd,_0x255eba){var _0x4a0ff0=MICROSOFT_AUTH_URL[_0x2475('0x17')](_0x2475('0x18'),_0x2754cd[_0x2475('0x19')]);var _0x3432ce=['code',_0x2475('0x1a')];var _0x1a10c0=Buffer['from'](JSON['stringify']({'id':_0x255eba}))[_0x2475('0x1b')]('base64');var _0x317b3a=crypto[_0x2475('0x1c')](0x10)[_0x2475('0x1b')](_0x2475('0x1d'));var _0x130f6f=getAuthorizationScopes(_0x2754cd);var _0x1f6dfe=[{'key':'client_id','value':_0x2754cd[_0x2475('0x1e')]},{'key':_0x2475('0x1f'),'value':encodeURIComponent(_0x3432ce[_0x2475('0x20')]('\x20'))},{'key':'redirect_uri','value':_0x2754cd[_0x2475('0x21')]},{'key':'response_mode','value':_0x2475('0x22')},{'key':_0x2475('0x23'),'value':encodeURIComponent(_0x130f6f)},{'key':_0x2475('0x24'),'value':_0x1a10c0},{'key':_0x2475('0x25'),'value':_0x317b3a},{'key':_0x2475('0x26'),'value':'login'}];var _0x1e99fd=_0x4a0ff0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2475('0x11')](_0x1f6dfe,function(_0x46cd62){return _0x46cd62[_0x2475('0x27')]+'='+_0x46cd62[_0x2475('0x28')];})[_0x2475('0x20')]('&');_0x2754cd['oauth2Claims']={'issuer':_0x4a0ff0[_0x2475('0x17')](_0x2475('0x29'),''),'audience':_0x2754cd[_0x2475('0x1e')],'state':_0x1a10c0,'nonce':_0x317b3a};redis['set'](_0x1a10c0,JSON['stringify'](_0x2754cd));return _0x1e99fd;}function isValidIdToken(_0x296b4b,_0x18f8ae){try{var _0x274986=jwt['decode'](_0x296b4b,{'complete':!![]});var _0x219dad=_0x274986[_0x2475('0x2a')];if(_0x219dad[_0x2475('0x2b')]!==_0x18f8ae['issuer'])return![];if(_0x219dad[_0x2475('0x2c')]!==_0x18f8ae['audience'])return![];if(_0x219dad[_0x2475('0x25')]!==_0x18f8ae[_0x2475('0x25')])return![];if(moment()[_0x2475('0x2d')](moment[_0x2475('0x2e')](_0x219dad[_0x2475('0x2f')])))return![];return!![];}catch(_0x14060d){throw _0x14060d;}}function refreshOauth2MicrosoftAccessToken(_0x45c425){return Promise[_0x2475('0x30')]()[_0x2475('0x31')](function(){if(_0x45c425[_0x2475('0x32')])return _0x45c425;return db[_0x2475('0x33')][_0x2475('0x34')]({'where':{'id':_0x45c425['id']},'raw':!![]});})[_0x2475('0x31')](function(_0x1baa26){var _0x13bde9={'grant_type':'refresh_token','refresh_token':_0x1baa26['data6'],'scope':getAccessTokenScope(_0x1baa26),'redirect_uri':_0x1baa26[_0x2475('0x21')],'client_id':_0x1baa26[_0x2475('0x1e')],'client_secret':encryptor[_0x2475('0x35')](_0x1baa26[_0x2475('0x32')])};var _0x2829ee={'method':_0x2475('0x36'),'uri':MICROSOFT_AUTH_URL['replace'](_0x2475('0x18'),_0x1baa26[_0x2475('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x13bde9,'json':!![]};return rp(_0x2829ee);})[_0x2475('0x31')](function(_0x2db4c9){_0x45c425['data5']=_0x2db4c9[_0x2475('0x37')];_0x45c425[_0x2475('0x38')]=_0x2db4c9['refresh_token'];return db[_0x2475('0x33')]['update']({'data5':_0x45c425[_0x2475('0x39')],'data6':_0x45c425[_0x2475('0x38')]},{'where':{'id':_0x45c425['id']}});})[_0x2475('0x31')](function(){return _0x45c425;})[_0x2475('0x3a')](function(_0xa5d19f){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x45c425['id'],_0xa5d19f);});}function getOauth2MicrosoftAccessToken(_0x587258,_0x3ed31f){var _0x16a98a={'grant_type':_0x2475('0x3b'),'code':_0x587258,'scope':getAccessTokenScope(_0x3ed31f),'redirect_uri':_0x3ed31f[_0x2475('0x21')],'client_id':_0x3ed31f['data1'],'client_secret':encryptor['decryptString'](_0x3ed31f[_0x2475('0x32')])};var _0x1f82d0={'method':_0x2475('0x36'),'uri':MICROSOFT_AUTH_URL[_0x2475('0x17')](_0x2475('0x18'),_0x3ed31f[_0x2475('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x16a98a,'json':!![]};return rp(_0x1f82d0);}function startRefreshInterval(_0x2f2dc2){var _0x14f800=schedule[_0x2475('0x3c')];if(_0x14f800[_0x2f2dc2['id']])clearInterval(_0x14f800[_0x2f2dc2['id']]);_0x14f800[_0x2f2dc2['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2475('0x3d')](this,{'id':_0x2f2dc2['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x14f800;}function startAllRefreshIntervals(){return db[_0x2475('0x33')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2475('0x31')](function(_0x43c215){var _0x5baeeb=_0x43c215[_0x2475('0x11')](function(_0x4b3099){return refreshOauth2MicrosoftAccessToken(_0x4b3099)[_0x2475('0x31')](function(_0x500e29){startRefreshInterval(_0x500e29);});});return Promise[_0x2475('0x3e')](_0x5baeeb);})[_0x2475('0x3a')](function(_0x37ac87){var _0x19aa3a=_0x37ac87?util['inspect'](_0x37ac87,{'showHidden':![],'depth':null}):'';logger[_0x2475('0x3f')](_0x2475('0x40'),_0x19aa3a);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 21d3038..05bfda6 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd08d=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x1e0052,_0x4af3fe){var _0x4a55fe=function(_0x4d1091){while(--_0x4d1091){_0x1e0052['push'](_0x1e0052['shift']());}};_0x4a55fe(++_0x4af3fe);}(_0xd08d,0x81));var _0xdd08=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd08d[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13999f,_0x28d59c,_0x147a23){return new BPromise(function(_0x54a5a3,_0x15416b){return client[_0xdd08('0xa')](_0x13999f,_0x147a23)[_0xdd08('0xb')](function(_0x51ce97){logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));logger[_0xdd08('0xf')](_0xdd08('0x10'),_0x28d59c,_0xdd08('0xe'),JSON[_0xdd08('0x11')](_0x51ce97));if(_0x51ce97[_0xdd08('0x12')]){if(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x13')]===0x1f4){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97['error'][_0xdd08('0x14')]);return _0x15416b(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);return _0x54a5a3(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}else{logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));_0x54a5a3(_0x51ce97[_0xdd08('0x15')][_0xdd08('0x14')]);}})[_0xdd08('0x16')](function(_0x278f5e){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x278f5e);_0x15416b(_0x278f5e);});});}
\ No newline at end of file
+var _0xe2ab=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x391d6d,_0x3a747c){_0x391d6d=_0x391d6d-0x0;var _0x37d5c6=_0xe2ab[_0x391d6d];return _0x37d5c6;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require(_0xbe2a('0x2'));var BPromise=require(_0xbe2a('0x3'));var rs=require(_0xbe2a('0x4'));var fs=require('fs');var Redis=require(_0xbe2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f504b,_0x58b8f1,_0x5a8a5d){return new BPromise(function(_0xfccbff,_0x232194){return client['request'](_0x2f504b,_0x5a8a5d)['then'](function(_0x83d775){logger[_0xbe2a('0xb')]('CloudProvider,\x20%s,\x20%s',_0x58b8f1,_0xbe2a('0xc'));logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x58b8f1,_0xbe2a('0xc'),JSON[_0xbe2a('0xf')](_0x83d775));if(_0x83d775['error']){if(_0x83d775['error']['code']===0x1f4){logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);return _0x232194(_0x83d775[_0xbe2a('0x10')]['message']);}logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')]['message']);return _0xfccbff(_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);}else{logger[_0xbe2a('0xb')](_0xbe2a('0x11'),_0x58b8f1,_0xbe2a('0xc'));_0xfccbff(_0x83d775[_0xbe2a('0x13')][_0xbe2a('0x12')]);}})[_0xbe2a('0x14')](function(_0x4395fe){logger['error'](_0xbe2a('0x11'),_0x58b8f1,_0x4395fe);_0x232194(_0x4395fe);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index e5bb872..a6d09f2 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x1deac0,_0x4e0895){var _0x4e38a7=function(_0x32739a){while(--_0x32739a){_0x1deac0['push'](_0x1deac0['shift']());}};_0x4e38a7(++_0x4e0895);}(_0xdb28,0x106));var _0x8db2=function(_0x104a8a,_0x19421a){_0x104a8a=_0x104a8a-0x0;var _0x314058=_0xdb28[_0x104a8a];return _0x314058;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x4344b7,_0x20113b){_0x4344b7=_0x4344b7-0x0;var _0x570f7d=_0x7a54[_0x4344b7];return _0x570f7d;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 5dafe2d..592bdf7 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf6d5=['name','sequelize','exports','STRING'];(function(_0x5ce2bd,_0x267de7){var _0x68a7e7=function(_0x1e484c){while(--_0x1e484c){_0x5ce2bd['push'](_0x5ce2bd['shift']());}};_0x68a7e7(++_0x267de7);}(_0xf6d5,0x179));var _0x5f6d=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xf6d5[_0x485201];return _0x9ca98a;};'use strict';var Sequelize=require(_0x5f6d('0x0'));module[_0x5f6d('0x1')]={'name':{'type':Sequelize[_0x5f6d('0x2')],'unique':_0x5f6d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5f6d('0x2')]},'website':{'type':Sequelize[_0x5f6d('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5f6d('0x2')]},'type':{'type':Sequelize[_0x5f6d('0x2')]},'street':{'type':Sequelize[_0x5f6d('0x2')]},'postalCode':{'type':Sequelize[_0x5f6d('0x2')]},'city':{'type':Sequelize[_0x5f6d('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5f6d('0x2')]},'sStreet':{'type':Sequelize[_0x5f6d('0x2')]},'sPostalCode':{'type':Sequelize[_0x5f6d('0x2')]},'sCity':{'type':Sequelize[_0x5f6d('0x2')]},'sCountry':{'type':Sequelize[_0x5f6d('0x2')]},'description':{'type':Sequelize[_0x5f6d('0x2')]}};
\ No newline at end of file
+var _0xa468=['name','STRING'];(function(_0x15cf11,_0x5a3678){var _0x3ed63f=function(_0xed467d){while(--_0xed467d){_0x15cf11['push'](_0x15cf11['shift']());}};_0x3ed63f(++_0x5a3678);}(_0xa468,0xef));var _0x8a46=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa468[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a46('0x0')],'unique':_0x8a46('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8a46('0x0')]},'companyId':{'type':Sequelize[_0x8a46('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8a46('0x0')]},'fax':{'type':Sequelize[_0x8a46('0x0')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8a46('0x0')]},'postalCode':{'type':Sequelize[_0x8a46('0x0')]},'city':{'type':Sequelize[_0x8a46('0x0')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8a46('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x8a46('0x0')]},'sPostalCode':{'type':Sequelize[_0x8a46('0x0')]},'sCity':{'type':Sequelize[_0x8a46('0x0')]},'sCountry':{'type':Sequelize[_0x8a46('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 284ee79..38c9ad5 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe7ed=['Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Companies','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','pick','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','stack','name','index','CmCompany','describe','model','keys','query','filters','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','length','find','create','body'];(function(_0x9b9b84,_0x5af466){var _0x73b9ea=function(_0x5cc826){while(--_0x5cc826){_0x9b9b84['push'](_0x9b9b84['shift']());}};_0x73b9ea(++_0x5af466);}(_0xe7ed,0x174));var _0xde7e=function(_0x52272d,_0x32757b){_0x52272d=_0x52272d-0x0;var _0x144092=_0xe7ed[_0x52272d];return _0x144092;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde7e('0x0'));var zipdir=require(_0xde7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde7e('0x2'));var moment=require(_0xde7e('0x3'));var BPromise=require(_0xde7e('0x4'));var Mustache=require(_0xde7e('0x5'));var util=require(_0xde7e('0x6'));var path=require(_0xde7e('0x7'));var sox=require('sox');var csv=require(_0xde7e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde7e('0x9'));var _=require(_0xde7e('0xa'));var squel=require('squel');var crypto=require(_0xde7e('0xb'));var jsforce=require(_0xde7e('0xc'));var deskjs=require(_0xde7e('0xd'));var toCsv=require(_0xde7e('0x8'));var querystring=require(_0xde7e('0xe'));var Papa=require(_0xde7e('0xf'));var Redis=require(_0xde7e('0x10'));var authService=require(_0xde7e('0x11'));var qs=require(_0xde7e('0x12'));var as=require(_0xde7e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde7e('0x14'));var utils=require(_0xde7e('0x15'));var config=require(_0xde7e('0x16'));var licenseUtil=require(_0xde7e('0x17'));var db=require(_0xde7e('0x18'))['db'];function respondWithStatusCode(_0x1415a2,_0x1e5760){_0x1e5760=_0x1e5760||0xcc;return function(_0x1b1139){if(_0x1b1139){return _0x1415a2[_0xde7e('0x19')](_0x1e5760);}return _0x1415a2[_0xde7e('0x1a')](_0x1e5760)[_0xde7e('0x1b')]();};}function respondWithResult(_0x5bb48d,_0x20d520){_0x20d520=_0x20d520||0xc8;return function(_0x5b0ca8){if(_0x5b0ca8){return _0x5bb48d[_0xde7e('0x1a')](_0x20d520)[_0xde7e('0x1c')](_0x5b0ca8);}};}function respondWithFilteredResult(_0x1adaf6,_0x2b11fd){return function(_0x5bf8bd){if(_0x5bf8bd){var _0x158dbe=typeof _0x2b11fd['offset']===_0xde7e('0x1d')&&typeof _0x2b11fd[_0xde7e('0x1e')]===_0xde7e('0x1d');var _0x28e3eb=_0x5bf8bd[_0xde7e('0x1f')];var _0x13af61=_0x158dbe?0x0:_0x2b11fd[_0xde7e('0x20')];var _0x30f83b=_0x158dbe?_0x5bf8bd[_0xde7e('0x1f')]:_0x2b11fd[_0xde7e('0x20')]+_0x2b11fd[_0xde7e('0x1e')];var _0x1cda46;if(_0x30f83b>=_0x28e3eb){_0x30f83b=_0x28e3eb;_0x1cda46=0xc8;}else{_0x1cda46=0xce;}_0x1adaf6[_0xde7e('0x1a')](_0x1cda46);return _0x1adaf6[_0xde7e('0x21')](_0xde7e('0x22'),_0x13af61+'-'+_0x30f83b+'/'+_0x28e3eb)[_0xde7e('0x1c')](_0x5bf8bd);}return null;};}function patchUpdates(_0x54f7e1){return function(_0x26a1e6){try{jsonpatch[_0xde7e('0x23')](_0x26a1e6,_0x54f7e1,!![]);}catch(_0x3539fb){return BPromise['reject'](_0x3539fb);}return _0x26a1e6[_0xde7e('0x24')]();};}function saveUpdates(_0x21e659,_0x386c9a){return function(_0x3ec9f3){if(_0x3ec9f3){return _0x3ec9f3[_0xde7e('0x25')](_0x21e659)[_0xde7e('0x26')](function(_0x502cd6){return _0x502cd6;});}return null;};}function removeEntity(_0x4d2f8d,_0x58a314){return function(_0x996a74){if(_0x996a74){return _0x996a74[_0xde7e('0x27')]()[_0xde7e('0x26')](function(){var _0x36d3bf=_0x996a74[_0xde7e('0x28')]({'plain':!![]});var _0x2626d8='Companies';return db[_0xde7e('0x29')][_0xde7e('0x27')]({'where':{'type':_0x2626d8,'resourceId':_0x36d3bf['id']}})[_0xde7e('0x26')](function(){return _0x996a74;});})[_0xde7e('0x26')](function(){_0x4d2f8d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43baf1,_0x45ac4a){return function(_0xef0e7e){if(!_0xef0e7e){_0x43baf1[_0xde7e('0x19')](0x194);}return _0xef0e7e;};}function handleError(_0x35ffdd,_0x51634f){_0x51634f=_0x51634f||0x1f4;return function(_0x113eae){logger['error'](_0x113eae[_0xde7e('0x2a')]);if(_0x113eae[_0xde7e('0x2b')]){delete _0x113eae[_0xde7e('0x2b')];}_0x35ffdd[_0xde7e('0x1a')](_0x51634f)['send'](_0x113eae);};}exports[_0xde7e('0x2c')]=function(_0x37c797,_0x1c2b96){var _0x54f1ac={},_0x24ad97={},_0x54ae92={'count':0x0,'rows':[]};return db[_0xde7e('0x2d')][_0xde7e('0x2e')]()[_0xde7e('0x26')](function(_0x1eace6){_0x24ad97[_0xde7e('0x2f')]=_[_0xde7e('0x30')](_0x1eace6);_0x24ad97[_0xde7e('0x31')]=_[_0xde7e('0x30')](_0x37c797['query']);_0x24ad97[_0xde7e('0x32')]=_['intersection'](_0x24ad97['model'],_0x24ad97['query']);_0x54f1ac['attributes']=_['intersection'](_0x24ad97[_0xde7e('0x2f')],qs[_0xde7e('0x33')](_0x37c797[_0xde7e('0x31')][_0xde7e('0x33')]));_0x54f1ac[_0xde7e('0x34')]=_0x54f1ac[_0xde7e('0x34')]['length']?_0x54f1ac[_0xde7e('0x34')]:_0x24ad97[_0xde7e('0x2f')];if(!_0x37c797['query'][_0xde7e('0x35')]('nolimit')){_0x54f1ac[_0xde7e('0x1e')]=qs['limit'](_0x37c797[_0xde7e('0x31')][_0xde7e('0x1e')]);_0x54f1ac[_0xde7e('0x20')]=qs['offset'](_0x37c797[_0xde7e('0x31')]['offset']);}_0x54f1ac[_0xde7e('0x36')]=qs[_0xde7e('0x37')](_0x37c797[_0xde7e('0x31')][_0xde7e('0x37')]);_0x54f1ac[_0xde7e('0x38')]=qs['filters'](_['pick'](_0x37c797['query'],_0x24ad97['filters']),_0x1eace6);if(_0x37c797[_0xde7e('0x31')][_0xde7e('0x39')]){_0x54f1ac['where']=_[_0xde7e('0x3a')](_0x54f1ac[_0xde7e('0x38')],{'$or':_[_0xde7e('0x3b')](_0x54f1ac[_0xde7e('0x34')],function(_0x4bd521){var _0x4da77c={};_0x4da77c[_0x4bd521]={'$like':'%'+_0x37c797['query']['filter']+'%'};return _0x4da77c;})});}_0x54f1ac=_[_0xde7e('0x3a')]({},_0x54f1ac,_0x37c797[_0xde7e('0x3c')]);var _0x564ff8={'where':_0x54f1ac[_0xde7e('0x38')]};return db[_0xde7e('0x2d')]['count'](_0x564ff8)[_0xde7e('0x26')](function(_0x3330ce){_0x54ae92[_0xde7e('0x1f')]=_0x3330ce;if(_0x37c797[_0xde7e('0x31')][_0xde7e('0x3d')]){_0x54f1ac[_0xde7e('0x3e')]=[{'all':!![]}];}return db[_0xde7e('0x2d')][_0xde7e('0x3f')](_0x54f1ac);})[_0xde7e('0x26')](function(_0x45bacb){_0x54ae92['rows']=_0x45bacb;return _0x54ae92;})[_0xde7e('0x26')](respondWithFilteredResult(_0x1c2b96,_0x54f1ac))[_0xde7e('0x40')](handleError(_0x1c2b96,null));})[_0xde7e('0x40')](handleError(_0x1c2b96,null));};exports[_0xde7e('0x41')]=function(_0x3e7b78,_0x15b514){var _0x26c6ab={'raw':![],'where':{'id':_0x3e7b78[_0xde7e('0x42')]['id']}},_0x322a64={};_0x322a64[_0xde7e('0x2f')]=_[_0xde7e('0x30')](db[_0xde7e('0x2d')][_0xde7e('0x43')]);_0x322a64['query']=_[_0xde7e('0x30')](_0x3e7b78[_0xde7e('0x31')]);_0x322a64[_0xde7e('0x32')]=_[_0xde7e('0x44')](_0x322a64[_0xde7e('0x2f')],_0x322a64[_0xde7e('0x31')]);_0x26c6ab[_0xde7e('0x34')]=_[_0xde7e('0x44')](_0x322a64[_0xde7e('0x2f')],qs[_0xde7e('0x33')](_0x3e7b78[_0xde7e('0x31')][_0xde7e('0x33')]));_0x26c6ab[_0xde7e('0x34')]=_0x26c6ab[_0xde7e('0x34')][_0xde7e('0x45')]?_0x26c6ab[_0xde7e('0x34')]:_0x322a64['model'];if(_0x3e7b78['query'][_0xde7e('0x3d')]){_0x26c6ab[_0xde7e('0x3e')]=[{'all':!![]}];}_0x26c6ab=_[_0xde7e('0x3a')]({},_0x26c6ab,_0x3e7b78[_0xde7e('0x3c')]);return db[_0xde7e('0x2d')][_0xde7e('0x46')](_0x26c6ab)[_0xde7e('0x26')](handleEntityNotFound(_0x15b514,null))[_0xde7e('0x26')](respondWithResult(_0x15b514,null))[_0xde7e('0x40')](handleError(_0x15b514,null));};exports[_0xde7e('0x47')]=function(_0x5cac13,_0x45e491){return db[_0xde7e('0x2d')][_0xde7e('0x47')](_0x5cac13[_0xde7e('0x48')],{})[_0xde7e('0x26')](function(_0x338d97){var _0x4a79e1=_0x5cac13['user'][_0xde7e('0x28')]({'plain':!![]});if(!_0x4a79e1)throw new Error(_0xde7e('0x49'));if(_0x4a79e1['role']===_0xde7e('0x4a')){var _0x332176=_0x338d97[_0xde7e('0x28')]({'plain':!![]});var _0x1c9748=_0xde7e('0x4b');return db[_0xde7e('0x4c')][_0xde7e('0x46')]({'where':{'name':_0x1c9748,'userProfileId':_0x4a79e1[_0xde7e('0x4d')]},'raw':!![]})['then'](function(_0x3c9bf7){if(_0x3c9bf7&&_0x3c9bf7[_0xde7e('0x4e')]===0x0){return db[_0xde7e('0x29')][_0xde7e('0x47')]({'name':_0x332176['name'],'resourceId':_0x332176['id'],'type':_0x3c9bf7[_0xde7e('0x2b')],'sectionId':_0x3c9bf7['id']},{})[_0xde7e('0x26')](function(){return _0x338d97;});}else{return _0x338d97;}})['catch'](function(_0x295639){logger[_0xde7e('0x4f')](_0xde7e('0x50'),_0x295639);throw _0x295639;});}return _0x338d97;})[_0xde7e('0x26')](respondWithResult(_0x45e491,0xc9))['catch'](handleError(_0x45e491,null));};exports[_0xde7e('0x25')]=function(_0x305739,_0x42e308){if(_0x305739[_0xde7e('0x48')]['id']){delete _0x305739[_0xde7e('0x48')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x305739[_0xde7e('0x42')]['id']}})[_0xde7e('0x26')](handleEntityNotFound(_0x42e308,null))[_0xde7e('0x26')](saveUpdates(_0x305739[_0xde7e('0x48')],null))['then'](respondWithResult(_0x42e308,null))[_0xde7e('0x40')](handleError(_0x42e308,null));};exports[_0xde7e('0x27')]=function(_0x938213,_0x442ce4){return db[_0xde7e('0x2d')][_0xde7e('0x46')]({'where':{'id':_0x938213['params']['id']}})[_0xde7e('0x26')](handleEntityNotFound(_0x442ce4,null))['then'](removeEntity(_0x442ce4,null))[_0xde7e('0x40')](handleError(_0x442ce4,null));};exports[_0xde7e('0x2e')]=function(_0x20dada,_0x486917){return db[_0xde7e('0x2d')][_0xde7e('0x2e')]()[_0xde7e('0x26')](respondWithResult(_0x486917,null))[_0xde7e('0x40')](handleError(_0x486917,null));};exports[_0xde7e('0x51')]=function(_0x2e3c17,_0x4d96fc,_0xa69e1d){return db['CmContact'][_0xde7e('0x46')]({'where':{'id':_0x2e3c17[_0xde7e('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d96fc,null))['then'](function(_0x126326){if(_0x126326){return _0x126326['addContacts'](_0x2e3c17[_0xde7e('0x48')][_0xde7e('0x52')],_[_0xde7e('0x53')](_0x2e3c17[_0xde7e('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x4d96fc,null))[_0xde7e('0x40')](handleError(_0x4d96fc,null));};exports[_0xde7e('0x54')]=function(_0x4754f0,_0x2a1717,_0x28a143){var _0x562d02={};var _0x3f57fe={};var _0x12be61;var _0x3717b1;return db[_0xde7e('0x2d')][_0xde7e('0x55')]({'where':{'id':_0x4754f0['params']['id']}})[_0xde7e('0x26')](handleEntityNotFound(_0x2a1717,null))[_0xde7e('0x26')](function(_0x1b5555){if(_0x1b5555){_0x12be61=_0x1b5555;_0x3f57fe[_0xde7e('0x2f')]=_['keys'](db[_0xde7e('0x56')][_0xde7e('0x43')]);_0x3f57fe[_0xde7e('0x31')]=_['keys'](_0x4754f0[_0xde7e('0x31')]);_0x3f57fe['filters']=_[_0xde7e('0x44')](_0x3f57fe[_0xde7e('0x2f')],_0x3f57fe[_0xde7e('0x31')]);_0x562d02[_0xde7e('0x34')]=_['intersection'](_0x3f57fe[_0xde7e('0x2f')],qs[_0xde7e('0x33')](_0x4754f0[_0xde7e('0x31')][_0xde7e('0x33')]));_0x562d02[_0xde7e('0x34')]=_0x562d02[_0xde7e('0x34')][_0xde7e('0x45')]?_0x562d02[_0xde7e('0x34')]:_0x3f57fe[_0xde7e('0x2f')];_0x562d02['order']=qs[_0xde7e('0x37')](_0x4754f0[_0xde7e('0x31')][_0xde7e('0x37')]);_0x562d02[_0xde7e('0x38')]=qs[_0xde7e('0x32')](_[_0xde7e('0x57')](_0x4754f0['query'],_0x3f57fe[_0xde7e('0x32')]));if(_0x4754f0['query'][_0xde7e('0x39')]){_0x562d02['where']=_[_0xde7e('0x3a')](_0x562d02[_0xde7e('0x38')],{'$or':_[_0xde7e('0x3b')](_0x562d02[_0xde7e('0x34')],function(_0x14118a){var _0x7da07c={};_0x7da07c[_0x14118a]={'$like':'%'+_0x4754f0['query']['filter']+'%'};return _0x7da07c;})});}_0x562d02=_[_0xde7e('0x3a')]({},_0x562d02,_0x4754f0['options']);return _0x12be61['getContacts'](_0x562d02);}})['then'](function(_0x250536){if(_0x250536){_0x3717b1=_0x250536['length'];if(!_0x4754f0[_0xde7e('0x31')][_0xde7e('0x35')](_0xde7e('0x58'))){_0x562d02['limit']=qs[_0xde7e('0x1e')](_0x4754f0['query'][_0xde7e('0x1e')]);_0x562d02[_0xde7e('0x20')]=qs['offset'](_0x4754f0[_0xde7e('0x31')][_0xde7e('0x20')]);}return _0x12be61[_0xde7e('0x54')](_0x562d02);}})[_0xde7e('0x26')](function(_0x292c35){if(_0x292c35){return _0x292c35?{'count':_0x3717b1,'rows':_0x292c35}:null;}})[_0xde7e('0x26')](respondWithResult(_0x2a1717,null))[_0xde7e('0x40')](handleError(_0x2a1717,null));};
\ No newline at end of file
+var _0x5433=['../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','map','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','addContacts','ids','omit','getContacts','findOne','CmContact','filter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x96602e,_0x3d75d4){var _0x5c004d=function(_0x1432ba){while(--_0x1432ba){_0x96602e['push'](_0x96602e['shift']());}};_0x5c004d(++_0x3d75d4);}(_0x5433,0x97));var _0x3543=function(_0x351b82,_0x15e88b){_0x351b82=_0x351b82-0x0;var _0x108433=_0x5433[_0x351b82];return _0x108433;};'use strict';var emlformat=require(_0x3543('0x0'));var rimraf=require(_0x3543('0x1'));var zipdir=require(_0x3543('0x2'));var jsonpatch=require(_0x3543('0x3'));var rp=require(_0x3543('0x4'));var moment=require('moment');var BPromise=require(_0x3543('0x5'));var Mustache=require(_0x3543('0x6'));var util=require(_0x3543('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3543('0x8'));var ejs=require(_0x3543('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3543('0xa'));var squel=require(_0x3543('0xb'));var crypto=require('crypto');var jsforce=require(_0x3543('0xc'));var deskjs=require(_0x3543('0xd'));var toCsv=require(_0x3543('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3543('0xe'));var authService=require(_0x3543('0xf'));var qs=require(_0x3543('0x10'));var as=require(_0x3543('0x11'));var hardwareService=require(_0x3543('0x12'));var logger=require(_0x3543('0x13'))(_0x3543('0x14'));var utils=require(_0x3543('0x15'));var config=require(_0x3543('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e4157,_0xbf587d){_0xbf587d=_0xbf587d||0xcc;return function(_0x4eeee4){if(_0x4eeee4){return _0x3e4157[_0x3543('0x17')](_0xbf587d);}return _0x3e4157[_0x3543('0x18')](_0xbf587d)[_0x3543('0x19')]();};}function respondWithResult(_0xc1315d,_0x2cf222){_0x2cf222=_0x2cf222||0xc8;return function(_0x3c6190){if(_0x3c6190){return _0xc1315d[_0x3543('0x18')](_0x2cf222)[_0x3543('0x1a')](_0x3c6190);}};}function respondWithFilteredResult(_0x269669,_0x18d031){return function(_0x59ba09){if(_0x59ba09){var _0x4430a8=typeof _0x18d031[_0x3543('0x1b')]===_0x3543('0x1c')&&typeof _0x18d031[_0x3543('0x1d')]===_0x3543('0x1c');var _0x4a972a=_0x59ba09[_0x3543('0x1e')];var _0x59dd59=_0x4430a8?0x0:_0x18d031[_0x3543('0x1b')];var _0x3ff8cd=_0x4430a8?_0x59ba09[_0x3543('0x1e')]:_0x18d031[_0x3543('0x1b')]+_0x18d031['limit'];var _0x1bc801;if(_0x3ff8cd>=_0x4a972a){_0x3ff8cd=_0x4a972a;_0x1bc801=0xc8;}else{_0x1bc801=0xce;}_0x269669[_0x3543('0x18')](_0x1bc801);return _0x269669[_0x3543('0x1f')](_0x3543('0x20'),_0x59dd59+'-'+_0x3ff8cd+'/'+_0x4a972a)[_0x3543('0x1a')](_0x59ba09);}return null;};}function patchUpdates(_0x58d5f8){return function(_0x37402a){try{jsonpatch[_0x3543('0x21')](_0x37402a,_0x58d5f8,!![]);}catch(_0x3f1561){return BPromise[_0x3543('0x22')](_0x3f1561);}return _0x37402a[_0x3543('0x23')]();};}function saveUpdates(_0x52fedb,_0x39d809){return function(_0x26de70){if(_0x26de70){return _0x26de70[_0x3543('0x24')](_0x52fedb)[_0x3543('0x25')](function(_0x1e1d11){return _0x1e1d11;});}return null;};}function removeEntity(_0x1a96c9,_0x496059){return function(_0x48950b){if(_0x48950b){return _0x48950b[_0x3543('0x26')]()['then'](function(){var _0x4551e5=_0x48950b[_0x3543('0x27')]({'plain':!![]});var _0x35e36c='Companies';return db[_0x3543('0x28')]['destroy']({'where':{'type':_0x35e36c,'resourceId':_0x4551e5['id']}})[_0x3543('0x25')](function(){return _0x48950b;});})[_0x3543('0x25')](function(){_0x1a96c9['status'](0xcc)[_0x3543('0x19')]();});}};}function handleEntityNotFound(_0x4eb797,_0x1ba0d0){return function(_0x26e46a){if(!_0x26e46a){_0x4eb797[_0x3543('0x17')](0x194);}return _0x26e46a;};}function handleError(_0x4b5edc,_0x313678){_0x313678=_0x313678||0x1f4;return function(_0xfff75a){logger[_0x3543('0x29')](_0xfff75a['stack']);if(_0xfff75a[_0x3543('0x2a')]){delete _0xfff75a[_0x3543('0x2a')];}_0x4b5edc[_0x3543('0x18')](_0x313678)[_0x3543('0x2b')](_0xfff75a);};}exports[_0x3543('0x2c')]=function(_0x570eea,_0x133ea2){var _0x2a94fb={},_0x22edd7={},_0x1244f9={'count':0x0,'rows':[]};return db['CmCompany'][_0x3543('0x2d')]()[_0x3543('0x25')](function(_0x1571de){_0x22edd7[_0x3543('0x2e')]=_[_0x3543('0x2f')](_0x1571de);_0x22edd7[_0x3543('0x30')]=_[_0x3543('0x2f')](_0x570eea['query']);_0x22edd7[_0x3543('0x31')]=_[_0x3543('0x32')](_0x22edd7[_0x3543('0x2e')],_0x22edd7[_0x3543('0x30')]);_0x2a94fb[_0x3543('0x33')]=_['intersection'](_0x22edd7['model'],qs['fields'](_0x570eea['query'][_0x3543('0x34')]));_0x2a94fb[_0x3543('0x33')]=_0x2a94fb[_0x3543('0x33')][_0x3543('0x35')]?_0x2a94fb['attributes']:_0x22edd7['model'];if(!_0x570eea[_0x3543('0x30')][_0x3543('0x36')]('nolimit')){_0x2a94fb[_0x3543('0x1d')]=qs['limit'](_0x570eea['query'][_0x3543('0x1d')]);_0x2a94fb[_0x3543('0x1b')]=qs[_0x3543('0x1b')](_0x570eea[_0x3543('0x30')][_0x3543('0x1b')]);}_0x2a94fb[_0x3543('0x37')]=qs[_0x3543('0x38')](_0x570eea['query']['sort']);_0x2a94fb['where']=qs['filters'](_[_0x3543('0x39')](_0x570eea[_0x3543('0x30')],_0x22edd7[_0x3543('0x31')]),_0x1571de);if(_0x570eea[_0x3543('0x30')]['filter']){_0x2a94fb['where']=_[_0x3543('0x3a')](_0x2a94fb[_0x3543('0x3b')],{'$or':_[_0x3543('0x3c')](_0x2a94fb[_0x3543('0x33')],function(_0x438a1b){var _0x397026={};_0x397026[_0x438a1b]={'$like':'%'+_0x570eea['query']['filter']+'%'};return _0x397026;})});}_0x2a94fb=_[_0x3543('0x3a')]({},_0x2a94fb,_0x570eea['options']);var _0x46f8ab={'where':_0x2a94fb['where']};return db[_0x3543('0x3d')][_0x3543('0x1e')](_0x46f8ab)[_0x3543('0x25')](function(_0x10430c){_0x1244f9['count']=_0x10430c;if(_0x570eea[_0x3543('0x30')][_0x3543('0x3e')]){_0x2a94fb[_0x3543('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0x3543('0x40')](_0x2a94fb);})['then'](function(_0xda981c){_0x1244f9[_0x3543('0x41')]=_0xda981c;return _0x1244f9;})[_0x3543('0x25')](respondWithFilteredResult(_0x133ea2,_0x2a94fb))[_0x3543('0x42')](handleError(_0x133ea2,null));})['catch'](handleError(_0x133ea2,null));};exports[_0x3543('0x43')]=function(_0x2b6f3b,_0x2c46ce){var _0x539462={'raw':![],'where':{'id':_0x2b6f3b['params']['id']}},_0x48b6c6={};_0x48b6c6[_0x3543('0x2e')]=_[_0x3543('0x2f')](db['CmCompany'][_0x3543('0x44')]);_0x48b6c6['query']=_[_0x3543('0x2f')](_0x2b6f3b[_0x3543('0x30')]);_0x48b6c6[_0x3543('0x31')]=_['intersection'](_0x48b6c6[_0x3543('0x2e')],_0x48b6c6['query']);_0x539462[_0x3543('0x33')]=_[_0x3543('0x32')](_0x48b6c6[_0x3543('0x2e')],qs[_0x3543('0x34')](_0x2b6f3b[_0x3543('0x30')]['fields']));_0x539462[_0x3543('0x33')]=_0x539462[_0x3543('0x33')][_0x3543('0x35')]?_0x539462[_0x3543('0x33')]:_0x48b6c6['model'];if(_0x2b6f3b['query'][_0x3543('0x3e')]){_0x539462[_0x3543('0x3f')]=[{'all':!![]}];}_0x539462=_[_0x3543('0x3a')]({},_0x539462,_0x2b6f3b[_0x3543('0x45')]);return db[_0x3543('0x3d')][_0x3543('0x46')](_0x539462)[_0x3543('0x25')](handleEntityNotFound(_0x2c46ce,null))[_0x3543('0x25')](respondWithResult(_0x2c46ce,null))[_0x3543('0x42')](handleError(_0x2c46ce,null));};exports[_0x3543('0x47')]=function(_0x57bf00,_0x3b8520){return db[_0x3543('0x3d')][_0x3543('0x47')](_0x57bf00[_0x3543('0x48')],{})[_0x3543('0x25')](function(_0x1ffc70){var _0x34ba99=_0x57bf00['user'][_0x3543('0x27')]({'plain':!![]});if(!_0x34ba99)throw new Error(_0x3543('0x49'));if(_0x34ba99[_0x3543('0x4a')]==='user'){var _0x30f4eb=_0x1ffc70[_0x3543('0x27')]({'plain':!![]});var _0x3a8598='Companies';return db[_0x3543('0x4b')][_0x3543('0x46')]({'where':{'name':_0x3a8598,'userProfileId':_0x34ba99['userProfileId']},'raw':!![]})[_0x3543('0x25')](function(_0x140f7f){if(_0x140f7f&&_0x140f7f[_0x3543('0x4c')]===0x0){return db['UserProfileResource'][_0x3543('0x47')]({'name':_0x30f4eb['name'],'resourceId':_0x30f4eb['id'],'type':_0x140f7f['name'],'sectionId':_0x140f7f['id']},{})[_0x3543('0x25')](function(){return _0x1ffc70;});}else{return _0x1ffc70;}})[_0x3543('0x42')](function(_0x1ab788){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ab788);throw _0x1ab788;});}return _0x1ffc70;})[_0x3543('0x25')](respondWithResult(_0x3b8520,0xc9))[_0x3543('0x42')](handleError(_0x3b8520,null));};exports[_0x3543('0x24')]=function(_0x2ec325,_0x4596d6){if(_0x2ec325['body']['id']){delete _0x2ec325[_0x3543('0x48')]['id'];}return db[_0x3543('0x3d')][_0x3543('0x46')]({'where':{'id':_0x2ec325[_0x3543('0x4d')]['id']}})[_0x3543('0x25')](handleEntityNotFound(_0x4596d6,null))['then'](saveUpdates(_0x2ec325[_0x3543('0x48')],null))[_0x3543('0x25')](respondWithResult(_0x4596d6,null))[_0x3543('0x42')](handleError(_0x4596d6,null));};exports[_0x3543('0x26')]=function(_0x1b4011,_0x25ed9c){return db[_0x3543('0x3d')][_0x3543('0x46')]({'where':{'id':_0x1b4011[_0x3543('0x4d')]['id']}})[_0x3543('0x25')](handleEntityNotFound(_0x25ed9c,null))[_0x3543('0x25')](removeEntity(_0x25ed9c,null))['catch'](handleError(_0x25ed9c,null));};exports[_0x3543('0x2d')]=function(_0xc9e26e,_0x361c67){return db['CmCompany'][_0x3543('0x2d')]()['then'](respondWithResult(_0x361c67,null))[_0x3543('0x42')](handleError(_0x361c67,null));};exports[_0x3543('0x4e')]=function(_0x30d3db,_0x1a8331,_0x1964f2){return db['CmContact'][_0x3543('0x46')]({'where':{'id':_0x30d3db[_0x3543('0x4d')]['id']}})[_0x3543('0x25')](handleEntityNotFound(_0x1a8331,null))[_0x3543('0x25')](function(_0x478486){if(_0x478486){return _0x478486[_0x3543('0x4e')](_0x30d3db[_0x3543('0x48')][_0x3543('0x4f')],_[_0x3543('0x50')](_0x30d3db[_0x3543('0x48')],[_0x3543('0x4f'),'id'])||{});}})[_0x3543('0x25')](respondWithResult(_0x1a8331,null))['catch'](handleError(_0x1a8331,null));};exports[_0x3543('0x51')]=function(_0x33f0a9,_0x510a16,_0x1b1f6a){var _0x3b4f29={};var _0x4a6339={};var _0x9184d0;var _0x18a35c;return db[_0x3543('0x3d')][_0x3543('0x52')]({'where':{'id':_0x33f0a9[_0x3543('0x4d')]['id']}})[_0x3543('0x25')](handleEntityNotFound(_0x510a16,null))[_0x3543('0x25')](function(_0x413c81){if(_0x413c81){_0x9184d0=_0x413c81;_0x4a6339[_0x3543('0x2e')]=_[_0x3543('0x2f')](db[_0x3543('0x53')][_0x3543('0x44')]);_0x4a6339[_0x3543('0x30')]=_[_0x3543('0x2f')](_0x33f0a9['query']);_0x4a6339[_0x3543('0x31')]=_[_0x3543('0x32')](_0x4a6339[_0x3543('0x2e')],_0x4a6339[_0x3543('0x30')]);_0x3b4f29[_0x3543('0x33')]=_[_0x3543('0x32')](_0x4a6339[_0x3543('0x2e')],qs[_0x3543('0x34')](_0x33f0a9[_0x3543('0x30')][_0x3543('0x34')]));_0x3b4f29[_0x3543('0x33')]=_0x3b4f29[_0x3543('0x33')]['length']?_0x3b4f29[_0x3543('0x33')]:_0x4a6339['model'];_0x3b4f29[_0x3543('0x37')]=qs['sort'](_0x33f0a9[_0x3543('0x30')][_0x3543('0x38')]);_0x3b4f29[_0x3543('0x3b')]=qs[_0x3543('0x31')](_[_0x3543('0x39')](_0x33f0a9[_0x3543('0x30')],_0x4a6339['filters']));if(_0x33f0a9[_0x3543('0x30')][_0x3543('0x54')]){_0x3b4f29[_0x3543('0x3b')]=_[_0x3543('0x3a')](_0x3b4f29['where'],{'$or':_[_0x3543('0x3c')](_0x3b4f29[_0x3543('0x33')],function(_0x598601){var _0x52069c={};_0x52069c[_0x598601]={'$like':'%'+_0x33f0a9[_0x3543('0x30')][_0x3543('0x54')]+'%'};return _0x52069c;})});}_0x3b4f29=_[_0x3543('0x3a')]({},_0x3b4f29,_0x33f0a9[_0x3543('0x45')]);return _0x9184d0[_0x3543('0x51')](_0x3b4f29);}})[_0x3543('0x25')](function(_0x484fcb){if(_0x484fcb){_0x18a35c=_0x484fcb['length'];if(!_0x33f0a9[_0x3543('0x30')][_0x3543('0x36')](_0x3543('0x55'))){_0x3b4f29[_0x3543('0x1d')]=qs[_0x3543('0x1d')](_0x33f0a9[_0x3543('0x30')][_0x3543('0x1d')]);_0x3b4f29['offset']=qs[_0x3543('0x1b')](_0x33f0a9[_0x3543('0x30')][_0x3543('0x1b')]);}return _0x9184d0[_0x3543('0x51')](_0x3b4f29);}})['then'](function(_0x54401e){if(_0x54401e){return _0x54401e?{'count':_0x18a35c,'rows':_0x54401e}:null;}})[_0x3543('0x25')](respondWithResult(_0x510a16,null))[_0x3543('0x42')](handleError(_0x510a16,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 253050f..67ac0a8 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7de1=['exports','cm_companies','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x7de1,0xd4));var _0x17de=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x7de1[_0x3fa7d3];return _0x4c51bd;};'use strict';var _=require('lodash');var util=require(_0x17de('0x0'));var logger=require(_0x17de('0x1'))(_0x17de('0x2'));var moment=require('moment');var BPromise=require(_0x17de('0x3'));var rp=require(_0x17de('0x4'));var fs=require('fs');var path=require(_0x17de('0x5'));var rimraf=require('rimraf');var config=require(_0x17de('0x6'));var attributes=require(_0x17de('0x7'));module[_0x17de('0x8')]=function(_0x221ae7,_0x13056d){return _0x221ae7['define']('CmCompany',attributes,{'tableName':_0x17de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c32=['cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x4ed70e,_0xe5509a){var _0x355f5d=function(_0x3269da){while(--_0x3269da){_0x4ed70e['push'](_0x4ed70e['shift']());}};_0x355f5d(++_0xe5509a);}(_0x8c32,0x91));var _0x28c3=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x8c32[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x28c3('0x0'));var util=require('util');var logger=require(_0x28c3('0x1'))('api');var moment=require(_0x28c3('0x2'));var BPromise=require(_0x28c3('0x3'));var rp=require(_0x28c3('0x4'));var fs=require('fs');var path=require(_0x28c3('0x5'));var rimraf=require(_0x28c3('0x6'));var config=require(_0x28c3('0x7'));var attributes=require(_0x28c3('0x8'));module['exports']=function(_0x31bb68,_0x4a8254){return _0x31bb68[_0x28c3('0x9')](_0x28c3('0xa'),attributes,{'tableName':_0x28c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 59b94c0..5f2b114 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c6b=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x0c6b,0x89));var _0xb0c6=function(_0x2fa326,_0x5bb165){_0x2fa326=_0x2fa326-0x0;var _0x6888ea=_0x0c6b[_0x2fa326];return _0x6888ea;};'use strict';var _=require(_0xb0c6('0x0'));var util=require('util');var moment=require(_0xb0c6('0x1'));var BPromise=require(_0xb0c6('0x2'));var rs=require(_0xb0c6('0x3'));var fs=require('fs');var Redis=require(_0xb0c6('0x4'));var db=require(_0xb0c6('0x5'))['db'];var utils=require(_0xb0c6('0x6'));var logger=require(_0xb0c6('0x7'))(_0xb0c6('0x8'));var config=require('../../config/environment');var jayson=require(_0xb0c6('0x9'));var client=jayson[_0xb0c6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fb7c,_0x9b0a5a,_0x4c4e56){return new BPromise(function(_0x9ce313,_0x4c97e6){return client[_0xb0c6('0xb')](_0x31fb7c,_0x4c4e56)[_0xb0c6('0xc')](function(_0x5c17cf){logger[_0xb0c6('0xd')](_0xb0c6('0xe'),_0x9b0a5a,_0xb0c6('0xf'));logger[_0xb0c6('0x10')](_0xb0c6('0x11'),_0x9b0a5a,_0xb0c6('0xf'),JSON[_0xb0c6('0x12')](_0x5c17cf));if(_0x5c17cf[_0xb0c6('0x13')]){if(_0x5c17cf[_0xb0c6('0x13')][_0xb0c6('0x14')]===0x1f4){logger[_0xb0c6('0x13')](_0xb0c6('0xe'),_0x9b0a5a,_0x5c17cf[_0xb0c6('0x13')][_0xb0c6('0x15')]);return _0x4c97e6(_0x5c17cf['error'][_0xb0c6('0x15')]);}logger['error'](_0xb0c6('0xe'),_0x9b0a5a,_0x5c17cf[_0xb0c6('0x13')][_0xb0c6('0x15')]);return _0x9ce313(_0x5c17cf['error'][_0xb0c6('0x15')]);}else{logger[_0xb0c6('0xd')](_0xb0c6('0xe'),_0x9b0a5a,_0xb0c6('0xf'));_0x9ce313(_0x5c17cf['result'][_0xb0c6('0x15')]);}})['catch'](function(_0x27985d){logger[_0xb0c6('0x13')]('CmCompany,\x20%s,\x20%s',_0x9b0a5a,_0x27985d);_0x4c97e6(_0x27985d);});});}
\ No newline at end of file
+var _0x8538=['code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','debug','stringify','error'];(function(_0x512f90,_0x23171e){var _0x3f1e21=function(_0x459201){while(--_0x459201){_0x512f90['push'](_0x512f90['shift']());}};_0x3f1e21(++_0x23171e);}(_0x8538,0x158));var _0x8853=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8538[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8853('0x0'));var moment=require(_0x8853('0x1'));var BPromise=require(_0x8853('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8853('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8853('0x4'));var logger=require(_0x8853('0x5'))(_0x8853('0x6'));var config=require(_0x8853('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8853('0x8')][_0x8853('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c3fb9,_0xf78e42,_0x3a33f1){return new BPromise(function(_0x256563,_0x2b22dd){return client['request'](_0x2c3fb9,_0x3a33f1)[_0x8853('0xa')](function(_0x1601dc){logger[_0x8853('0xb')](_0x8853('0xc'),_0xf78e42,'request\x20sent');logger[_0x8853('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xf78e42,'request\x20sent',JSON[_0x8853('0xe')](_0x1601dc));if(_0x1601dc[_0x8853('0xf')]){if(_0x1601dc['error'][_0x8853('0x10')]===0x1f4){logger['error'](_0x8853('0xc'),_0xf78e42,_0x1601dc[_0x8853('0xf')][_0x8853('0x11')]);return _0x2b22dd(_0x1601dc[_0x8853('0xf')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0xf78e42,_0x1601dc['error'][_0x8853('0x11')]);return _0x256563(_0x1601dc['error']['message']);}else{logger[_0x8853('0xb')]('CmCompany,\x20%s,\x20%s',_0xf78e42,'request\x20sent');_0x256563(_0x1601dc[_0x8853('0x12')][_0x8853('0x11')]);}})[_0x8853('0x13')](function(_0x56f0ce){logger[_0x8853('0xf')]('CmCompany,\x20%s,\x20%s',_0xf78e42,_0x56f0ce);_0x2b22dd(_0x56f0ce);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 687d3c8..62d3758 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b8e=['exports','multer','util','path','express','fs-extra','../../components/interaction/service','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getContacts','post','addContacts','put','update','delete','destroy'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x1b8e,0x14b));var _0xe1b8=function(_0x3b97cc,_0x2b2220){_0x3b97cc=_0x3b97cc-0x0;var _0x5079ba=_0x1b8e[_0x3b97cc];return _0x5079ba;};'use strict';var multer=require(_0xe1b8('0x0'));var util=require(_0xe1b8('0x1'));var path=require(_0xe1b8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1b8('0x3'));var router=express['Router']();var fs_extra=require(_0xe1b8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1b8('0x5'));var config=require('../../config/environment');var controller=require(_0xe1b8('0x6'));router[_0xe1b8('0x7')]('/',auth['isAuthenticated'](),controller[_0xe1b8('0x8')]);router[_0xe1b8('0x7')](_0xe1b8('0x9'),auth[_0xe1b8('0xa')](),controller[_0xe1b8('0xb')]);router[_0xe1b8('0x7')](_0xe1b8('0xc'),auth[_0xe1b8('0xa')](),controller[_0xe1b8('0xd')]);router[_0xe1b8('0x7')]('/:id/contacts',auth[_0xe1b8('0xa')](),controller[_0xe1b8('0xe')]);router['post']('/',auth[_0xe1b8('0xa')](),controller['create']);router[_0xe1b8('0xf')]('/:id/contacts',auth[_0xe1b8('0xa')](),controller[_0xe1b8('0x10')]);router[_0xe1b8('0x11')](_0xe1b8('0xc'),auth[_0xe1b8('0xa')](),controller[_0xe1b8('0x12')]);router[_0xe1b8('0x13')]('/:id',auth[_0xe1b8('0xa')](),controller[_0xe1b8('0x14')]);module[_0xe1b8('0x15')]=router;
\ No newline at end of file
+var _0x235b=['../../config/environment','./cmCompany.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2344d5,_0x1a8690){var _0x58dd20=function(_0x16d9c4){while(--_0x16d9c4){_0x2344d5['push'](_0x2344d5['shift']());}};_0x58dd20(++_0x1a8690);}(_0x235b,0x130));var _0xb235=function(_0x5c4dee,_0x3ceeb1){_0x5c4dee=_0x5c4dee-0x0;var _0xa47b=_0x235b[_0x5c4dee];return _0xa47b;};'use strict';var multer=require(_0xb235('0x0'));var util=require(_0xb235('0x1'));var path=require(_0xb235('0x2'));var timeout=require(_0xb235('0x3'));var express=require(_0xb235('0x4'));var router=express[_0xb235('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb235('0x6'));var interaction=require(_0xb235('0x7'));var config=require(_0xb235('0x8'));var controller=require(_0xb235('0x9'));router[_0xb235('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb235('0xa')](_0xb235('0xb'),auth[_0xb235('0xc')](),controller[_0xb235('0xd')]);router['get'](_0xb235('0xe'),auth[_0xb235('0xc')](),controller[_0xb235('0xf')]);router[_0xb235('0xa')](_0xb235('0x10'),auth[_0xb235('0xc')](),controller[_0xb235('0x11')]);router[_0xb235('0x12')]('/',auth['isAuthenticated'](),controller[_0xb235('0x13')]);router[_0xb235('0x12')](_0xb235('0x10'),auth[_0xb235('0xc')](),controller['addContacts']);router['put'](_0xb235('0xe'),auth['isAuthenticated'](),controller[_0xb235('0x14')]);router[_0xb235('0x15')](_0xb235('0xe'),auth['isAuthenticated'](),controller[_0xb235('0x16')]);module[_0xb235('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 0139697..4f5ff87 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf870=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x3a30d3,_0x55eb4a){var _0x4a4f79=function(_0x49de7e){while(--_0x49de7e){_0x3a30d3['push'](_0x3a30d3['shift']());}};_0x4a4f79(++_0x55eb4a);}(_0xf870,0x141));var _0x0f87=function(_0x3bee2f,_0x32b1d3){_0x3bee2f=_0x3bee2f-0x0;var _0x160186=_0xf870[_0x3bee2f];return _0x160186;};'use strict';var _=require(_0x0f87('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x0f87('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0f87('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0f87('0x1')]},'dateOfBirth':{'type':Sequelize[_0x0f87('0x1')]},'description':{'type':Sequelize[_0x0f87('0x2')]},'phone':{'type':Sequelize[_0x0f87('0x1')]},'mobile':{'type':Sequelize[_0x0f87('0x1')]},'fax':{'type':Sequelize[_0x0f87('0x1')]},'email':{'type':Sequelize[_0x0f87('0x1')]},'url':{'type':Sequelize[_0x0f87('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x0f87('0x1')]},'twitter':{'type':Sequelize[_0x0f87('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x0f87('0x1')]},'line':{'type':Sequelize[_0x0f87('0x1')]},'wechat':{'type':Sequelize[_0x0f87('0x1')]},'telegram':{'type':Sequelize[_0x0f87('0x1')]},'UserId':{'type':Sequelize[_0x0f87('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x0f87('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0f87('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0f87('0x5')],'defaultValue':Sequelize[_0x0f87('0x6')]},'dialTimezone':{'type':Sequelize[_0x0f87('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc416=['STRING','TEXT','INTEGER','DATE','lodash','sequelize','exports'];(function(_0x47bf8b,_0x5c377e){var _0x2d71ff=function(_0x96d3b2){while(--_0x96d3b2){_0x47bf8b['push'](_0x47bf8b['shift']());}};_0x2d71ff(++_0x5c377e);}(_0xc416,0x1e7));var _0x6c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc416[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c41('0x0'));var Sequelize=require(_0x6c41('0x1'));module[_0x6c41('0x2')]={'firstName':{'type':Sequelize[_0x6c41('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6c41('0x3')]},'street':{'type':Sequelize[_0x6c41('0x3')]},'postalCode':{'type':Sequelize[_0x6c41('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6c41('0x3')]},'description':{'type':Sequelize[_0x6c41('0x4')]},'phone':{'type':Sequelize[_0x6c41('0x3')]},'mobile':{'type':Sequelize[_0x6c41('0x3')]},'fax':{'type':Sequelize[_0x6c41('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x6c41('0x3')]},'facebook':{'type':Sequelize[_0x6c41('0x3')]},'fb_data':{'type':Sequelize[_0x6c41('0x3')]},'twitter':{'type':Sequelize[_0x6c41('0x3')]},'skype':{'type':Sequelize[_0x6c41('0x3')]},'teams':{'type':Sequelize[_0x6c41('0x3')]},'viber':{'type':Sequelize[_0x6c41('0x3')]},'line':{'type':Sequelize[_0x6c41('0x3')]},'wechat':{'type':Sequelize[_0x6c41('0x3')]},'telegram':{'type':Sequelize[_0x6c41('0x3')]},'UserId':{'type':Sequelize[_0x6c41('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x6c41('0x3')]},'priority':{'type':Sequelize[_0x6c41('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6c41('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 603d591..2975e72 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa70c=['-createdAt','channel','includes','toLowerCase','range','Invalid\x20createdAt\x20filter','type','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','color','browserName','customerIp','customerPort','osName','ratingMessage','referer','subject','substatus','threadId','startCase','Interaction','findAndCountAll','Owner','flatten','sortBy','reverse','slice','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','offset','undefined','limit','count','status','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','describe','keys','length','cf_','push','findOne','trimStart','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','field','tools_tags','select','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','DATE','text','start','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','role','some','user','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','c.firstName','c.mobile','c.fax','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','CmContact','params','tags','columnName','displayName','analytics','findAll','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','create','isNil','dialTimezone','utcOffset','timezones','additionalPhones','duplicates','$or','findOrCreate','spread','contact','all','show','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','CmCustomField','omit','cf_%d','pickBy','startsWith','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','pick','options','nolimit','setTags','OrderBy','items','item_types','description','ItemTypeId','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','CmHopper','`ItemType`.OrderBy','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','upload','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','chat','sms','fax','whatsapp','voice'];(function(_0x182820,_0x1e704a){var _0x3ad285=function(_0x516ac4){while(--_0x516ac4){_0x182820['push'](_0x182820['shift']());}};_0x3ad285(++_0x1e704a);}(_0xa70c,0x15e));var _0xca70=function(_0x36154a,_0x2cf98c){_0x36154a=_0x36154a-0x0;var _0x61104e=_0xa70c[_0x36154a];return _0x61104e;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xca70('0x0'));var path=require(_0xca70('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca70('0x2'));var Papa=require(_0xca70('0x3'));var Redis=require(_0xca70('0x4'));var qs=require(_0xca70('0x5'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xca70('0x6'))('api');var config=require('../../config/environment');var shared=require(_0xca70('0x7'));var db=require(_0xca70('0x8'))['db'];config['redis']=_[_0xca70('0x9')](config[_0xca70('0xa')],{'host':_0xca70('0xb'),'port':0x18eb});var socket=require(_0xca70('0xc'))(new Redis(config['redis']));require(_0xca70('0xd'))[_0xca70('0xe')](socket);function respondWithResult(_0x9b32ed,_0x54160d){_0x54160d=_0x54160d||0xc8;return function(_0x2b1043){if(_0x2b1043){return _0x9b32ed['status'](_0x54160d)['json'](_0x2b1043);}};}function respondWithFilteredResult(_0xf1b13,_0x318021){return function(_0x23bc7e){if(_0x23bc7e){var _0x1b424b=typeof _0x318021[_0xca70('0xf')]===_0xca70('0x10')&&typeof _0x318021[_0xca70('0x11')]===_0xca70('0x10');var _0x2122f4=_0x23bc7e[_0xca70('0x12')];var _0x291839=_0x1b424b?0x0:_0x318021[_0xca70('0xf')];var _0x1816e7=_0x1b424b?_0x23bc7e[_0xca70('0x12')]:_0x318021['offset']+_0x318021[_0xca70('0x11')];var _0x54258f;if(_0x1816e7>=_0x2122f4){_0x1816e7=_0x2122f4;_0x54258f=0xc8;}else{_0x54258f=0xce;}_0xf1b13[_0xca70('0x13')](_0x54258f);return _0xf1b13[_0xca70('0x14')](_0xca70('0x15'),_0x291839+'-'+_0x1816e7+'/'+_0x2122f4)['json'](_0x23bc7e);}return null;};}function saveUpdates(_0x3caec3){return function(_0x39f889){if(_0x39f889){return _0x39f889[_0xca70('0x16')](_0x3caec3)[_0xca70('0x17')](function(_0x289c28){return _0x289c28;});}return null;};}function removeEntity(_0x42a1c9){return function(_0x161976){if(_0x161976){return _0x161976['destroy']()[_0xca70('0x17')](function(){_0x42a1c9['status'](0xcc)[_0xca70('0x18')]();});}};}function handleEntityNotFound(_0x46f0a3){return function(_0x583577){if(!_0x583577){_0x46f0a3[_0xca70('0x19')](0x194);}return _0x583577;};}function handleError(_0x196b19,_0x161447){_0x161447=_0x161447||0x1f4;return function(_0x3c1f0b){logger[_0xca70('0x1a')](_0x3c1f0b[_0xca70('0x1b')]);if(_0x3c1f0b[_0xca70('0x1c')]){delete _0x3c1f0b[_0xca70('0x1c')];}_0x196b19['status'](_0x161447)[_0xca70('0x1d')](_0x3c1f0b);};}exports[_0xca70('0x1e')]=function(_0x21cb38,_0x52e625){var _0x38cd4e={},_0x48aefa={},_0x528e6e={'count':0x0,'rows':[]};return db['CmContact'][_0xca70('0x1f')]()[_0xca70('0x17')](function(_0x3dfdf3){var _0x43771c=[];for(var _0x4d8498=0x0;_0x4d8498
','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','node-tnef','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','split','length','slice'];(function(_0x439ea1,_0x49faaa){var _0x173e09=function(_0x4be1f9){while(--_0x4be1f9){_0x439ea1['push'](_0x439ea1['shift']());}};_0x173e09(++_0x49faaa);}(_0xa7c1,0x7b));var _0x1a7c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xa7c1[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x1a7c('0x0'));var moment=require(_0x1a7c('0x1'));var random=require(_0x1a7c('0x2'));var fs=require('fs');var path=require(_0x1a7c('0x3'));var util=require('util');var tnef=require(_0x1a7c('0x4'));var logger=require('../../../config/logger')(_0x1a7c('0x5'));var config=require(_0x1a7c('0x6'));function getAddress(_0x42ee27){var _0x5d37bc=_[_0x1a7c('0x7')](_0x42ee27[_0x1a7c('0x8')]);return _0x5d37bc&&_0x5d37bc[_0x1a7c('0x9')]?_0x5d37bc['address']:'anonymous'+random[_0x1a7c('0xa')](0x6)+_0x1a7c('0xb');}function getFirstName(_0x28f5c7){var _0x28efb1=_[_0x1a7c('0x7')](_0x28f5c7['value']);if(_0x28efb1&&_0x28efb1[_0x1a7c('0xc')]){if(_0x28efb1[_0x1a7c('0xc')]==_0x28efb1['address']){return _0x28efb1[_0x1a7c('0xc')][_0x1a7c('0xd')](0x0,_0x28efb1[_0x1a7c('0xc')]['indexOf']('@'));}var _0x5cece2=_0x28efb1[_0x1a7c('0xc')][_0x1a7c('0xe')](/\s+/);return _0x5cece2[_0x1a7c('0xf')]>0x1?_0x5cece2[_0x1a7c('0x10')](0x0,-0x1)['join']('\x20'):_0x28efb1[_0x1a7c('0xc')];}return _0x1a7c('0x11');}function getLastName(_0x4b82a6){var _0x388455=_[_0x1a7c('0x7')](_0x4b82a6[_0x1a7c('0x8')]);if(_0x388455&&_0x388455[_0x1a7c('0xc')]){var _0x2ce4f1=_0x388455[_0x1a7c('0xc')][_0x1a7c('0xe')](/\s+/);return _0x2ce4f1['length']>0x1?_0x2ce4f1['pop']():'';}return'';}function getMails(_0x51c694,_0x40e11f){var _0x59fd26='';for(var _0x365340=0x0;_0x365340<_0x40e11f[_0x1a7c('0x8')][_0x1a7c('0xf')];_0x365340+=0x1){if(_0x40e11f[_0x1a7c('0x8')][_0x365340][_0x1a7c('0x9')]!==_0x51c694){if(!_[_0x1a7c('0x12')](_0x59fd26)){_0x59fd26+=',';}_0x59fd26+=_0x40e11f[_0x1a7c('0x8')][_0x365340][_0x1a7c('0xc')]||_0x40e11f[_0x1a7c('0x8')][_0x365340][_0x1a7c('0x9')]||'';_0x59fd26+='\x20<';_0x59fd26+=_0x40e11f[_0x1a7c('0x8')][_0x365340][_0x1a7c('0x9')]?_0x40e11f['value'][_0x365340]['address']:'anonymous'+random[_0x1a7c('0xa')](0x6)+'@xcally.com';_0x59fd26+='>';}}return _0x59fd26;}function parseEmail(_0x240e6c,_0x141bcb,_0xfc547e){if(_0x141bcb[_0x1a7c('0x13')]){var _0x28c2df=/