From: Andrea Amorese
Date: Thu, 28 Oct 2021 07:32:50 +0000 (+0200)
Subject: Built motion from commit 1742a442.|2.5.37
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=8c55dd7ead2b4becd94c805c7a9688f83ebd4226;p=motion2.git
Built motion from commit 1742a442.|2.5.37
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 2700636..ec26cdd 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-27T15:34:06.033Z",
+ "time": "2021-10-28T07:15:41.227Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index b03a9b3..6da3c19 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-27T15:34:06.033Z",
+ "time": "2021-10-28T07:15:41.227Z",
"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 eab498a..964af3e 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 _0x8873=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','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)]'];(function(_0x4a4d71,_0x1d4d72){var _0x2f1f18=function(_0x50796d){while(--_0x50796d){_0x4a4d71['push'](_0x4a4d71['shift']());}};_0x2f1f18(++_0x1d4d72);}(_0x8873,0x9f));var _0x3887=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0x8873[_0x2d3d0d];return _0xca35b6;};'use strict';var Sequelize=require(_0x3887('0x0'));module[_0x3887('0x1')]={'name':{'type':Sequelize[_0x3887('0x2')],'get':function(_0x378d88){return this[_0x3887('0x3')](_0x3887('0x4'));}},'action':{'type':Sequelize[_0x3887('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3887('0x6'),'integration',_0x3887('0x7'),_0x3887('0x8'),_0x3887('0x9'),_0x3887('0xa'),_0x3887('0xb'),_0x3887('0xc')]],'msg':_0x3887('0xd')}},'comment':_0x3887('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0x10')},'data4':{'type':Sequelize[_0x3887('0x5')](0x1000),'comments':_0x3887('0x11')},'data5':{'type':Sequelize[_0x3887('0x5')](0x1000),'comments':_0x3887('0x12')},'data6':{'type':Sequelize[_0x3887('0x5')],'comments':_0x3887('0x13')},'data7':{'type':Sequelize[_0x3887('0x14')],'comments':_0x3887('0x15')}};
\ No newline at end of file
+var _0x9559=['STRING','contactManager','integration','motionbar','browser','bot','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x2d4521,_0x8d98b6){var _0x5d765f=function(_0x21795d){while(--_0x21795d){_0x2d4521['push'](_0x2d4521['shift']());}};_0x5d765f(++_0x8d98b6);}(_0x9559,0x14f));var _0x9955=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x9559[_0x5f08a6];return _0x5d0641;};'use strict';var Sequelize=require(_0x9955('0x0'));module[_0x9955('0x1')]={'name':{'type':Sequelize[_0x9955('0x2')],'get':function(_0x55f339){return this[_0x9955('0x3')](_0x9955('0x4'));}},'action':{'type':Sequelize[_0x9955('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9955('0x6'),_0x9955('0x7'),_0x9955('0x8'),'jscripty','urlForward',_0x9955('0x9'),_0x9955('0xa'),'script']],'msg':_0x9955('0xb')}},'comment':_0x9955('0xb')},'data1':{'type':Sequelize[_0x9955('0x5')](0x1000),'comment':_0x9955('0xc')},'data2':{'type':Sequelize[_0x9955('0x5')](0x1000),'comment':_0x9955('0xd')},'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':_0x9955('0xe')},'data5':{'type':Sequelize[_0x9955('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x9955('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x9955('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 67327d8..56ab696 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 _0x01b9=['json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range'];(function(_0x52d7d2,_0x3c2a17){var _0x46b0f3=function(_0x157ef6){while(--_0x157ef6){_0x52d7d2['push'](_0x52d7d2['shift']());}};_0x46b0f3(++_0x3c2a17);}(_0x01b9,0x136));var _0x901b=function(_0xe02258,_0x13d2dc){_0xe02258=_0xe02258-0x0;var _0xce1ce3=_0x01b9[_0xe02258];return _0xce1ce3;};'use strict';var emlformat=require(_0x901b('0x0'));var rimraf=require(_0x901b('0x1'));var zipdir=require(_0x901b('0x2'));var jsonpatch=require(_0x901b('0x3'));var rp=require(_0x901b('0x4'));var moment=require(_0x901b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x901b('0x6'));var util=require(_0x901b('0x7'));var path=require(_0x901b('0x8'));var sox=require(_0x901b('0x9'));var csv=require(_0x901b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901b('0xb'));var _=require(_0x901b('0xc'));var squel=require(_0x901b('0xd'));var crypto=require(_0x901b('0xe'));var jsforce=require(_0x901b('0xf'));var deskjs=require(_0x901b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x901b('0x11'));var Redis=require('ioredis');var authService=require(_0x901b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x901b('0x13'));var hardwareService=require(_0x901b('0x14'));var logger=require(_0x901b('0x15'))(_0x901b('0x16'));var utils=require(_0x901b('0x17'));var config=require(_0x901b('0x18'));var licenseUtil=require(_0x901b('0x19'));var db=require(_0x901b('0x1a'))['db'];function respondWithStatusCode(_0x5e434d,_0x4b22e7){_0x4b22e7=_0x4b22e7||0xcc;return function(_0x305f75){if(_0x305f75){return _0x5e434d['sendStatus'](_0x4b22e7);}return _0x5e434d[_0x901b('0x1b')](_0x4b22e7)['end']();};}function respondWithResult(_0x3a4efc,_0x4de7ef){_0x4de7ef=_0x4de7ef||0xc8;return function(_0x1d473f){if(_0x1d473f){return _0x3a4efc[_0x901b('0x1b')](_0x4de7ef)['json'](_0x1d473f);}};}function respondWithFilteredResult(_0x450082,_0x1db4cf){return function(_0x4eb6f0){if(_0x4eb6f0){var _0x542452=typeof _0x1db4cf[_0x901b('0x1c')]===_0x901b('0x1d')&&typeof _0x1db4cf[_0x901b('0x1e')]===_0x901b('0x1d');var _0x3e04b6=_0x4eb6f0[_0x901b('0x1f')];var _0x31b1cc=_0x542452?0x0:_0x1db4cf['offset'];var _0x196cc7=_0x542452?_0x4eb6f0[_0x901b('0x1f')]:_0x1db4cf['offset']+_0x1db4cf['limit'];var _0xb461ed;if(_0x196cc7>=_0x3e04b6){_0x196cc7=_0x3e04b6;_0xb461ed=0xc8;}else{_0xb461ed=0xce;}_0x450082[_0x901b('0x1b')](_0xb461ed);return _0x450082['set'](_0x901b('0x20'),_0x31b1cc+'-'+_0x196cc7+'/'+_0x3e04b6)[_0x901b('0x21')](_0x4eb6f0);}return null;};}function patchUpdates(_0x2d571e){return function(_0x4d7ee6){try{jsonpatch['apply'](_0x4d7ee6,_0x2d571e,!![]);}catch(_0x35d6a6){return BPromise[_0x901b('0x22')](_0x35d6a6);}return _0x4d7ee6[_0x901b('0x23')]();};}function saveUpdates(_0x37eedd,_0x3edaa6){return function(_0x24bc47){if(_0x24bc47){return _0x24bc47[_0x901b('0x24')](_0x37eedd)['then'](function(_0x1f2932){return _0x1f2932;});}return null;};}function removeEntity(_0x3fdde0,_0x381593){return function(_0x299859){if(_0x299859){return _0x299859[_0x901b('0x25')]()[_0x901b('0x26')](function(){_0x3fdde0[_0x901b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289afa,_0x59cfb7){return function(_0x4624dc){if(!_0x4624dc){_0x289afa[_0x901b('0x27')](0x194);}return _0x4624dc;};}function handleError(_0x7ec692,_0x3b0067){_0x3b0067=_0x3b0067||0x1f4;return function(_0x310188){logger[_0x901b('0x28')](_0x310188[_0x901b('0x29')]);if(_0x310188[_0x901b('0x2a')]){delete _0x310188['name'];}_0x7ec692[_0x901b('0x1b')](_0x3b0067)[_0x901b('0x2b')](_0x310188);};}exports[_0x901b('0x24')]=function(_0x1b0096,_0x518258){if(_0x1b0096['body']['id']){delete _0x1b0096[_0x901b('0x2c')]['id'];}return db[_0x901b('0x2d')][_0x901b('0x2e')]({'where':{'id':_0x1b0096['params']['id']}})[_0x901b('0x26')](handleEntityNotFound(_0x518258,null))['then'](saveUpdates(_0x1b0096[_0x901b('0x2c')],null))['then'](respondWithResult(_0x518258,null))[_0x901b('0x2f')](handleError(_0x518258,null));};exports[_0x901b('0x25')]=function(_0x2b90d2,_0x1a21cb){return db[_0x901b('0x2d')][_0x901b('0x2e')]({'where':{'id':_0x2b90d2[_0x901b('0x30')]['id']}})[_0x901b('0x26')](handleEntityNotFound(_0x1a21cb,null))[_0x901b('0x26')](removeEntity(_0x1a21cb,null))[_0x901b('0x2f')](handleError(_0x1a21cb,null));};
\ No newline at end of file
+var _0xe417=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','name','send','update','body','find','catch','Action','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe417,0x151));var _0x7e41=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0xe417[_0x28e74e];return _0xb45ac1;};'use strict';var emlformat=require(_0x7e41('0x0'));var rimraf=require(_0x7e41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e41('0x2'));var rp=require(_0x7e41('0x3'));var moment=require('moment');var BPromise=require(_0x7e41('0x4'));var Mustache=require(_0x7e41('0x5'));var util=require('util');var path=require(_0x7e41('0x6'));var sox=require(_0x7e41('0x7'));var csv=require('to-csv');var ejs=require(_0x7e41('0x8'));var fs=require('fs');var fs_extra=require(_0x7e41('0x9'));var _=require(_0x7e41('0xa'));var squel=require(_0x7e41('0xb'));var crypto=require(_0x7e41('0xc'));var jsforce=require(_0x7e41('0xd'));var deskjs=require(_0x7e41('0xe'));var toCsv=require(_0x7e41('0xf'));var querystring=require(_0x7e41('0x10'));var Papa=require(_0x7e41('0x11'));var Redis=require(_0x7e41('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7e41('0x13'));var as=require(_0x7e41('0x14'));var hardwareService=require(_0x7e41('0x15'));var logger=require(_0x7e41('0x16'))(_0x7e41('0x17'));var utils=require(_0x7e41('0x18'));var config=require(_0x7e41('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e41('0x1a'))['db'];function respondWithStatusCode(_0x3de07d,_0x55caec){_0x55caec=_0x55caec||0xcc;return function(_0x27c088){if(_0x27c088){return _0x3de07d[_0x7e41('0x1b')](_0x55caec);}return _0x3de07d['status'](_0x55caec)[_0x7e41('0x1c')]();};}function respondWithResult(_0x2be9a1,_0x1299a0){_0x1299a0=_0x1299a0||0xc8;return function(_0x5be73e){if(_0x5be73e){return _0x2be9a1['status'](_0x1299a0)[_0x7e41('0x1d')](_0x5be73e);}};}function respondWithFilteredResult(_0x1bfb35,_0xb962f7){return function(_0x4e802e){if(_0x4e802e){var _0x1424ad=typeof _0xb962f7[_0x7e41('0x1e')]===_0x7e41('0x1f')&&typeof _0xb962f7[_0x7e41('0x20')]===_0x7e41('0x1f');var _0x494d6f=_0x4e802e[_0x7e41('0x21')];var _0x3ece82=_0x1424ad?0x0:_0xb962f7[_0x7e41('0x1e')];var _0x253b8e=_0x1424ad?_0x4e802e['count']:_0xb962f7['offset']+_0xb962f7[_0x7e41('0x20')];var _0x42a43d;if(_0x253b8e>=_0x494d6f){_0x253b8e=_0x494d6f;_0x42a43d=0xc8;}else{_0x42a43d=0xce;}_0x1bfb35[_0x7e41('0x22')](_0x42a43d);return _0x1bfb35[_0x7e41('0x23')](_0x7e41('0x24'),_0x3ece82+'-'+_0x253b8e+'/'+_0x494d6f)[_0x7e41('0x1d')](_0x4e802e);}return null;};}function patchUpdates(_0x204886){return function(_0x358770){try{jsonpatch[_0x7e41('0x25')](_0x358770,_0x204886,!![]);}catch(_0x367016){return BPromise[_0x7e41('0x26')](_0x367016);}return _0x358770[_0x7e41('0x27')]();};}function saveUpdates(_0x162d7f,_0x46ba0a){return function(_0x203dda){if(_0x203dda){return _0x203dda['update'](_0x162d7f)[_0x7e41('0x28')](function(_0x2c4818){return _0x2c4818;});}return null;};}function removeEntity(_0x3f6c5c,_0x2b0e51){return function(_0x5d196e){if(_0x5d196e){return _0x5d196e[_0x7e41('0x29')]()[_0x7e41('0x28')](function(){_0x3f6c5c['status'](0xcc)[_0x7e41('0x1c')]();});}};}function handleEntityNotFound(_0x1dcffe,_0x3c5aa0){return function(_0x4aee72){if(!_0x4aee72){_0x1dcffe[_0x7e41('0x1b')](0x194);}return _0x4aee72;};}function handleError(_0x99de5f,_0x224368){_0x224368=_0x224368||0x1f4;return function(_0x456342){logger['error'](_0x456342['stack']);if(_0x456342[_0x7e41('0x2a')]){delete _0x456342[_0x7e41('0x2a')];}_0x99de5f['status'](_0x224368)[_0x7e41('0x2b')](_0x456342);};}exports[_0x7e41('0x2c')]=function(_0xb16f41,_0x2f8f66){if(_0xb16f41[_0x7e41('0x2d')]['id']){delete _0xb16f41[_0x7e41('0x2d')]['id'];}return db['Action'][_0x7e41('0x2e')]({'where':{'id':_0xb16f41['params']['id']}})['then'](handleEntityNotFound(_0x2f8f66,null))[_0x7e41('0x28')](saveUpdates(_0xb16f41[_0x7e41('0x2d')],null))[_0x7e41('0x28')](respondWithResult(_0x2f8f66,null))[_0x7e41('0x2f')](handleError(_0x2f8f66,null));};exports[_0x7e41('0x29')]=function(_0x5b900c,_0x14589b){return db[_0x7e41('0x30')][_0x7e41('0x2e')]({'where':{'id':_0x5b900c[_0x7e41('0x31')]['id']}})[_0x7e41('0x28')](handleEntityNotFound(_0x14589b,null))[_0x7e41('0x28')](removeEntity(_0x14589b,null))[_0x7e41('0x2f')](handleError(_0x14589b,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 2397fd3..f578532 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 _0xb626=['Action','tools_actions','util','../../config/logger','moment','rimraf','./action.attributes'];(function(_0x356cff,_0x531a96){var _0x264796=function(_0xf22449){while(--_0xf22449){_0x356cff['push'](_0x356cff['shift']());}};_0x264796(++_0x531a96);}(_0xb626,0xbf));var _0x6b62=function(_0x16632f,_0x44d3df){_0x16632f=_0x16632f-0x0;var _0xd83545=_0xb626[_0x16632f];return _0xd83545;};'use strict';var _=require('lodash');var util=require(_0x6b62('0x0'));var logger=require(_0x6b62('0x1'))('api');var moment=require(_0x6b62('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b62('0x3'));var config=require('../../config/environment');var attributes=require(_0x6b62('0x4'));module['exports']=function(_0x49624a,_0x26f818){return _0x49624a['define'](_0x6b62('0x5'),attributes,{'tableName':_0x6b62('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cdd=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger','moment'];(function(_0x30b73c,_0x584f7c){var _0x182ad1=function(_0x5333ee){while(--_0x5333ee){_0x30b73c['push'](_0x30b73c['shift']());}};_0x182ad1(++_0x584f7c);}(_0x6cdd,0x8d));var _0xd6cd=function(_0x7d8967,_0x42a213){_0x7d8967=_0x7d8967-0x0;var _0x314cf5=_0x6cdd[_0x7d8967];return _0x314cf5;};'use strict';var _=require('lodash');var util=require(_0xd6cd('0x0'));var logger=require(_0xd6cd('0x1'))('api');var moment=require(_0xd6cd('0x2'));var BPromise=require(_0xd6cd('0x3'));var rp=require(_0xd6cd('0x4'));var fs=require('fs');var path=require(_0xd6cd('0x5'));var rimraf=require(_0xd6cd('0x6'));var config=require(_0xd6cd('0x7'));var attributes=require('./action.attributes');module[_0xd6cd('0x8')]=function(_0x11120c,_0xa23db2){return _0x11120c[_0xd6cd('0x9')](_0xd6cd('0xa'),attributes,{'tableName':_0xd6cd('0xb'),'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 cf09b4a..398a558 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2f3395,_0x2846f5){_0x2f3395=_0x2f3395-0x0;var _0x59a706=_0x1cb9[_0x2f3395];return _0x59a706;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x6cbbcf,_0x1349bc){var _0x1df7a2=function(_0x1e0913){while(--_0x1e0913){_0x6cbbcf['push'](_0x6cbbcf['shift']());}};_0x1df7a2(++_0x1349bc);}(_0xabce,0x103));var _0xeabc=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xabce[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b7c1479..745e312 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 _0xf55a=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x4a7b46,_0x5e916c){var _0x436bee=function(_0x1c98ba){while(--_0x1c98ba){_0x4a7b46['push'](_0x4a7b46['shift']());}};_0x436bee(++_0x5e916c);}(_0xf55a,0x95));var _0xaf55=function(_0x23adc4,_0x45a8fc){_0x23adc4=_0x23adc4-0x0;var _0x5e8137=_0xf55a[_0x23adc4];return _0x5e8137;};'use strict';var multer=require(_0xaf55('0x0'));var util=require('util');var path=require(_0xaf55('0x1'));var timeout=require(_0xaf55('0x2'));var express=require('express');var router=express[_0xaf55('0x3')]();var fs_extra=require(_0xaf55('0x4'));var auth=require(_0xaf55('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf55('0x6'));var controller=require(_0xaf55('0x7'));router[_0xaf55('0x8')](_0xaf55('0x9'),auth[_0xaf55('0xa')](),controller[_0xaf55('0xb')]);router[_0xaf55('0xc')](_0xaf55('0x9'),auth[_0xaf55('0xa')](),controller[_0xaf55('0xd')]);module[_0xaf55('0xe')]=router;
\ No newline at end of file
+var _0x711a=['isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./action.controller','put'];(function(_0x533e75,_0x5b84d7){var _0x3e05af=function(_0x388972){while(--_0x388972){_0x533e75['push'](_0x533e75['shift']());}};_0x3e05af(++_0x5b84d7);}(_0x711a,0xe6));var _0xa711=function(_0x1b33f8,_0x42d767){_0x1b33f8=_0x1b33f8-0x0;var _0x166ec2=_0x711a[_0x1b33f8];return _0x166ec2;};'use strict';var multer=require(_0xa711('0x0'));var util=require(_0xa711('0x1'));var path=require('path');var timeout=require(_0xa711('0x2'));var express=require(_0xa711('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa711('0x4'));var interaction=require(_0xa711('0x5'));var config=require('../../config/environment');var controller=require(_0xa711('0x6'));router[_0xa711('0x7')]('/:id',auth[_0xa711('0x8')](),controller[_0xa711('0x9')]);router[_0xa711('0xa')](_0xa711('0xb'),auth[_0xa711('0x8')](),controller[_0xa711('0xc')]);module[_0xa711('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index e1bfd8d..dd4a554 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 _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x4adc8a,_0x4846fb){var _0x3953fa=function(_0x21ab7c){while(--_0x21ab7c){_0x4adc8a['push'](_0x4adc8a['shift']());}};_0x3953fa(++_0x4846fb);}(_0x5496,0x175));var _0x6549=function(_0x55a5d5,_0xc954bb){_0x55a5d5=_0x55a5d5-0x0;var _0x39f704=_0x5496[_0x55a5d5];return _0x39f704;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x038b=['exports','STRING','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x038b,0x114));var _0xb038=function(_0x50e501,_0x483689){_0x50e501=_0x50e501-0x0;var _0x3e3489=_0x038b[_0x50e501];return _0x3e3489;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 03b9447..8eecede 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 _0xb3f9=['destroy','then','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','ValidationErrorItem','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','Sequelize','AnalyticMetric','from','field','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','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','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','CustomReports','UserProfileResource'];(function(_0x53fd68,_0x508a41){var _0x9e77bb=function(_0x16f999){while(--_0x16f999){_0x53fd68['push'](_0x53fd68['shift']());}};_0x9e77bb(++_0x508a41);}(_0xb3f9,0x122));var _0x9b3f=function(_0x9cb41b,_0x118b53){_0x9cb41b=_0x9cb41b-0x0;var _0x185058=_0xb3f9[_0x9cb41b];return _0x185058;};'use strict';var emlformat=require(_0x9b3f('0x0'));var rimraf=require(_0x9b3f('0x1'));var zipdir=require(_0x9b3f('0x2'));var jsonpatch=require(_0x9b3f('0x3'));var rp=require(_0x9b3f('0x4'));var moment=require('moment');var BPromise=require(_0x9b3f('0x5'));var Mustache=require(_0x9b3f('0x6'));var util=require(_0x9b3f('0x7'));var path=require(_0x9b3f('0x8'));var sox=require('sox');var csv=require(_0x9b3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b3f('0xa'));var _=require(_0x9b3f('0xb'));var squel=require(_0x9b3f('0xc'));var crypto=require(_0x9b3f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b3f('0x9'));var querystring=require(_0x9b3f('0xe'));var Papa=require(_0x9b3f('0xf'));var Redis=require(_0x9b3f('0x10'));var authService=require(_0x9b3f('0x11'));var qs=require(_0x9b3f('0x12'));var as=require(_0x9b3f('0x13'));var hardwareService=require(_0x9b3f('0x14'));var logger=require(_0x9b3f('0x15'))(_0x9b3f('0x16'));var utils=require(_0x9b3f('0x17'));var config=require(_0x9b3f('0x18'));var licenseUtil=require(_0x9b3f('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9b3f('0x1a'))[_0x9b3f('0x1b')];function respondWithStatusCode(_0x39931d,_0x84412e){_0x84412e=_0x84412e||0xcc;return function(_0x2d8879){if(_0x2d8879){return _0x39931d[_0x9b3f('0x1c')](_0x84412e);}return _0x39931d[_0x9b3f('0x1d')](_0x84412e)[_0x9b3f('0x1e')]();};}function respondWithResult(_0x25dcef,_0x39a810){_0x39a810=_0x39a810||0xc8;return function(_0x21fef5){if(_0x21fef5){return _0x25dcef[_0x9b3f('0x1d')](_0x39a810)[_0x9b3f('0x1f')](_0x21fef5);}};}function respondWithFilteredResult(_0x495554,_0x267da8){return function(_0x32b0e1){if(_0x32b0e1){var _0x1a4567=typeof _0x267da8[_0x9b3f('0x20')]==='undefined'&&typeof _0x267da8[_0x9b3f('0x21')]===_0x9b3f('0x22');var _0x295eed=_0x32b0e1[_0x9b3f('0x23')];var _0x32fecc=_0x1a4567?0x0:_0x267da8['offset'];var _0x281ad6=_0x1a4567?_0x32b0e1['count']:_0x267da8[_0x9b3f('0x20')]+_0x267da8[_0x9b3f('0x21')];var _0x1c29d2;if(_0x281ad6>=_0x295eed){_0x281ad6=_0x295eed;_0x1c29d2=0xc8;}else{_0x1c29d2=0xce;}_0x495554[_0x9b3f('0x1d')](_0x1c29d2);return _0x495554[_0x9b3f('0x24')]('Content-Range',_0x32fecc+'-'+_0x281ad6+'/'+_0x295eed)[_0x9b3f('0x1f')](_0x32b0e1);}return null;};}function patchUpdates(_0xbb7aa5){return function(_0x4f0e55){try{jsonpatch[_0x9b3f('0x25')](_0x4f0e55,_0xbb7aa5,!![]);}catch(_0x4ef190){return BPromise['reject'](_0x4ef190);}return _0x4f0e55[_0x9b3f('0x26')]();};}function saveUpdates(_0x58898e,_0x1078cf){return function(_0x2d4d08){if(_0x2d4d08){return _0x2d4d08[_0x9b3f('0x27')](_0x58898e)['then'](function(_0x59f029){return _0x59f029;});}return null;};}function removeEntity(_0x486349,_0x2d84d7){return function(_0x1fb8f6){if(_0x1fb8f6){return _0x1fb8f6['destroy']()['then'](function(){var _0x3d3246=_0x1fb8f6['get']({'plain':!![]});var _0xfae7d3=_0x9b3f('0x28');return db[_0x9b3f('0x29')][_0x9b3f('0x2a')]({'where':{'type':_0xfae7d3,'resourceId':_0x3d3246['id']}})[_0x9b3f('0x2b')](function(){return _0x1fb8f6;});})[_0x9b3f('0x2b')](function(){_0x486349[_0x9b3f('0x1d')](0xcc)[_0x9b3f('0x1e')]();});}};}function handleEntityNotFound(_0x108ec8,_0x295013){return function(_0x609717){if(!_0x609717){_0x108ec8['sendStatus'](0x194);}return _0x609717;};}function handleError(_0x54cfa9,_0x54ed85){_0x54ed85=_0x54ed85||0x1f4;return function(_0x3bb032){logger[_0x9b3f('0x2c')](_0x3bb032[_0x9b3f('0x2d')]);if(_0x3bb032['name']){delete _0x3bb032[_0x9b3f('0x2e')];}_0x54cfa9[_0x9b3f('0x1d')](_0x54ed85)[_0x9b3f('0x2f')](_0x3bb032);};}exports['index']=function(_0x51564c,_0x52c8d9){var _0x15b5ef={},_0x87dcdb={},_0x5e6cc9={'count':0x0,'rows':[]};var _0x588d4b=_['map'](db[_0x9b3f('0x30')][_0x9b3f('0x31')],function(_0x5617d9){return{'name':_0x5617d9[_0x9b3f('0x32')],'type':_0x5617d9[_0x9b3f('0x33')]['key']};});_0x87dcdb[_0x9b3f('0x34')]=_[_0x9b3f('0x35')](_0x588d4b,_0x9b3f('0x2e'));_0x87dcdb[_0x9b3f('0x36')]=_[_0x9b3f('0x37')](_0x51564c[_0x9b3f('0x36')]);_0x87dcdb[_0x9b3f('0x38')]=_[_0x9b3f('0x39')](_0x87dcdb['model'],_0x87dcdb[_0x9b3f('0x36')]);_0x15b5ef[_0x9b3f('0x3a')]=_[_0x9b3f('0x39')](_0x87dcdb['model'],qs[_0x9b3f('0x3b')](_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x3b')]));_0x15b5ef[_0x9b3f('0x3a')]=_0x15b5ef[_0x9b3f('0x3a')][_0x9b3f('0x3c')]?_0x15b5ef['attributes']:_0x87dcdb['model'];if(!_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x3d')]('nolimit')){_0x15b5ef['limit']=qs[_0x9b3f('0x21')](_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x21')]);_0x15b5ef[_0x9b3f('0x20')]=qs[_0x9b3f('0x20')](_0x51564c['query'][_0x9b3f('0x20')]);}_0x15b5ef[_0x9b3f('0x3e')]=qs[_0x9b3f('0x3f')](_0x51564c[_0x9b3f('0x36')][_0x9b3f('0x3f')]);_0x15b5ef[_0x9b3f('0x40')]=qs['filters'](_['pick'](_0x51564c['query'],_0x87dcdb[_0x9b3f('0x38')]),_0x588d4b);if(_0x51564c[_0x9b3f('0x36')]['filter']){_0x15b5ef[_0x9b3f('0x40')]=_[_0x9b3f('0x41')](_0x15b5ef[_0x9b3f('0x40')],{'$or':_[_0x9b3f('0x35')](_0x588d4b,function(_0x5be3fd){if(_0x5be3fd[_0x9b3f('0x33')]!==_0x9b3f('0x42')){var _0x45d0c4={};_0x45d0c4[_0x5be3fd[_0x9b3f('0x2e')]]={'$like':'%'+_0x51564c['query'][_0x9b3f('0x43')]+'%'};return _0x45d0c4;}})});}_0x15b5ef=_['merge']({},_0x15b5ef,_0x51564c['options']);var _0x4c2866={'where':_0x15b5ef[_0x9b3f('0x40')]};return db['AnalyticCustomReport']['count'](_0x4c2866)[_0x9b3f('0x2b')](function(_0x53af06){_0x5e6cc9[_0x9b3f('0x23')]=_0x53af06;if(_0x51564c[_0x9b3f('0x36')]['includeAll']){_0x15b5ef[_0x9b3f('0x44')]=[{'all':!![]}];}return db[_0x9b3f('0x30')][_0x9b3f('0x45')](_0x15b5ef);})[_0x9b3f('0x2b')](function(_0x398fda){_0x5e6cc9[_0x9b3f('0x46')]=_0x398fda;return _0x5e6cc9;})[_0x9b3f('0x2b')](respondWithFilteredResult(_0x52c8d9,_0x15b5ef))['catch'](handleError(_0x52c8d9,null));};exports[_0x9b3f('0x47')]=function(_0x468ea6,_0x490a8e){var _0x566c60={'raw':![],'where':{'id':_0x468ea6[_0x9b3f('0x48')]['id']}},_0x124078={};_0x124078[_0x9b3f('0x34')]=_[_0x9b3f('0x37')](db[_0x9b3f('0x30')][_0x9b3f('0x31')]);_0x124078[_0x9b3f('0x36')]=_[_0x9b3f('0x37')](_0x468ea6[_0x9b3f('0x36')]);_0x124078[_0x9b3f('0x38')]=_[_0x9b3f('0x39')](_0x124078[_0x9b3f('0x34')],_0x124078[_0x9b3f('0x36')]);_0x566c60[_0x9b3f('0x3a')]=_[_0x9b3f('0x39')](_0x124078[_0x9b3f('0x34')],qs[_0x9b3f('0x3b')](_0x468ea6[_0x9b3f('0x36')][_0x9b3f('0x3b')]));_0x566c60[_0x9b3f('0x3a')]=_0x566c60[_0x9b3f('0x3a')]['length']?_0x566c60['attributes']:_0x124078['model'];if(_0x468ea6['query'][_0x9b3f('0x49')]){_0x566c60[_0x9b3f('0x44')]=[{'all':!![]}];}_0x566c60=_['merge']({},_0x566c60,_0x468ea6['options']);return db[_0x9b3f('0x30')][_0x9b3f('0x4a')](_0x566c60)['then'](handleEntityNotFound(_0x490a8e,null))['then'](respondWithResult(_0x490a8e,null))[_0x9b3f('0x4b')](handleError(_0x490a8e,null));};exports['create']=function(_0x562577,_0x48aa9e){return db[_0x9b3f('0x30')][_0x9b3f('0x4c')](_0x562577[_0x9b3f('0x4d')],{})[_0x9b3f('0x2b')](function(_0x290253){var _0x103ae2=_0x562577[_0x9b3f('0x4e')][_0x9b3f('0x4f')]({'plain':!![]});if(!_0x103ae2)throw new Error(_0x9b3f('0x50'));if(_0x103ae2['role']===_0x9b3f('0x4e')){var _0x384f97=_0x290253['get']({'plain':!![]});var _0x584b5f=_0x9b3f('0x51');return db[_0x9b3f('0x52')][_0x9b3f('0x4a')]({'where':{'name':_0x584b5f,'userProfileId':_0x103ae2['userProfileId']},'raw':!![]})[_0x9b3f('0x2b')](function(_0x491eae){if(_0x491eae&&_0x491eae['autoAssociation']===0x0){return db[_0x9b3f('0x29')][_0x9b3f('0x4c')]({'name':_0x384f97['name'],'resourceId':_0x384f97['id'],'type':_0x9b3f('0x28'),'sectionId':_0x491eae['id']},{})['then'](function(){return _0x290253;});}else{return _0x290253;}})[_0x9b3f('0x4b')](function(_0xa354f2){logger['error'](_0x9b3f('0x53'),_0xa354f2);throw _0xa354f2;});}return _0x290253;})[_0x9b3f('0x2b')](respondWithResult(_0x48aa9e,0xc9))['catch'](handleError(_0x48aa9e,null));};exports['update']=function(_0x543903,_0x13d165){if(_0x543903[_0x9b3f('0x4d')]['id']){delete _0x543903[_0x9b3f('0x4d')]['id'];}return db[_0x9b3f('0x30')][_0x9b3f('0x4a')]({'where':{'id':_0x543903['params']['id']}})['then'](handleEntityNotFound(_0x13d165,null))['then'](saveUpdates(_0x543903['body'],null))[_0x9b3f('0x2b')](respondWithResult(_0x13d165,null))['catch'](handleError(_0x13d165,null));};exports[_0x9b3f('0x2a')]=function(_0x1fe86e,_0x47c96b){return db['AnalyticCustomReport'][_0x9b3f('0x4a')]({'where':{'id':_0x1fe86e[_0x9b3f('0x48')]['id']}})[_0x9b3f('0x2b')](handleEntityNotFound(_0x47c96b,null))[_0x9b3f('0x2b')](removeEntity(_0x47c96b,null))[_0x9b3f('0x4b')](handleError(_0x47c96b,null));};exports[_0x9b3f('0x54')]=function(_0x1d2376,_0xa958a3){var _0x2cb1a6=0xa;var _0x39c04a=[_0x9b3f('0x55'),_0x9b3f('0x56'),_0x9b3f('0x57'),_0x9b3f('0x58')];var _0x15075f={'SUM':_0x9b3f('0x59'),'COUNT':_0x9b3f('0x5a'),'COUNT DISTINCT':_0x9b3f('0x5b'),'MAX':'MAX(%s)','MIN':_0x9b3f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9b3f('0x5d'),'GROUP_CONCAT ASC':_0x9b3f('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb7249b={'SEC_TO_TIME':_0x9b3f('0x5f'),'DATE':'DATE(%s)','HOUR':_0x9b3f('0x60'),'ROUND':_0x9b3f('0x61'),'UNIX_TIMESTAMP':_0x9b3f('0x62')};var _0x4d7017=function(_0x4ef0a4){return!_[_0x9b3f('0x63')]([_0x9b3f('0x64'),_0x9b3f('0x65'),_0x9b3f('0x66'),_0x9b3f('0x67')],_0x4ef0a4);};var _0x37b0d0=function(_0x5f3a8e){if(!_0x5f3a8e||!_0x5f3a8e[_0x9b3f('0x68')][_0x9b3f('0x3c')]){return'';}for(var _0x4aeb7f='(',_0xd7204f=0x0;_0xd7204f<_0x5f3a8e[_0x9b3f('0x68')][_0x9b3f('0x3c')];_0xd7204f+=0x1){_0xd7204f>0x0&&(_0x4aeb7f+='\x20'+_0x5f3a8e[_0x9b3f('0x69')]+'\x20');_0x4aeb7f+=_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f]['group']?_0x37b0d0(_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6a')]):_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f]['field']+'\x20'+_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6b')]+(_0x4d7017(_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6b')])?'\x20'+_0x5f3a8e[_0x9b3f('0x68')][_0xd7204f][_0x9b3f('0x6c')]:'');}return _0x4aeb7f+')';};var _0x1f0b8b={'where':{'id':_0x1d2376[_0x9b3f('0x48')]['id']}},_0x30bfb7,_0x48773f,_0x310e16,_0x1296c4,_0x232f1a;_0x1f0b8b=_[_0x9b3f('0x41')]({},_0x1f0b8b,_0x1d2376[_0x9b3f('0x6d')]);return db['AnalyticCustomReport']['find'](_0x1f0b8b)['then'](function(_0x2c861f){if(_0x2c861f){_0x30bfb7=_0x2c861f;return _0x2c861f[_0x9b3f('0x6e')]();}return null;})[_0x9b3f('0x2b')](function(_0x2ffb12){if(_0x2ffb12){if(!_0x2ffb12['length']){throw new db['Sequelize'][(_0x9b3f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x48773f=_0x2ffb12;return db['AnalyticMetric'][_0x9b3f('0x45')]({'raw':!![]});}return null;})['then'](function(_0xce4cda){if(_0xce4cda){_0x310e16=_['keyBy'](_0xce4cda,'id');var _0x311419;var _0x4daa02=squel[_0x9b3f('0x70')]();_0x4daa02['from'](_0x30bfb7[_0x9b3f('0x71')]);for(var _0x207a1e=0x0;_0x207a1e<_0x48773f[_0x9b3f('0x3c')];_0x207a1e+=0x1){_0x311419=_0x48773f[_0x207a1e][_0x9b3f('0x72')]?_0x310e16[_0x48773f[_0x207a1e][_0x9b3f('0x72')]][_0x9b3f('0x73')]:_0x48773f[_0x207a1e]['field'];_0x311419=_0x48773f[_0x207a1e][_0x9b3f('0x74')]?_[_0x9b3f('0x75')](_0x15075f[_0x48773f[_0x207a1e][_0x9b3f('0x74')]],'%s',_0x311419):_0x311419;_0x311419=_0x48773f[_0x207a1e][_0x9b3f('0x76')]?_[_0x9b3f('0x75')](_0xb7249b[_0x48773f[_0x207a1e][_0x9b3f('0x76')]],'%s',_0x311419):_0x311419;if(_0x48773f[_0x207a1e][_0x9b3f('0x77')]){_0x4daa02[_0x9b3f('0x6a')](_0x311419);}_0x48773f[_0x207a1e][_0x9b3f('0x78')]&&_0x4daa02[_0x9b3f('0x3e')](_0x311419,_0x48773f[_0x207a1e][_0x9b3f('0x78')]==='DESC'?![]:!![]);_0x4daa02['field'](_0x311419,_0x48773f[_0x207a1e][_0x9b3f('0x79')]||_0x311419);}if(_0x30bfb7[_0x9b3f('0x7a')]){_0x30bfb7[_0x9b3f('0x7a')]=JSON[_0x9b3f('0x7b')](_0x30bfb7[_0x9b3f('0x7a')]);for(var _0xfe23a5=0x0;_0xfe23a5<_0x30bfb7['joins'][_0x9b3f('0x3c')];_0xfe23a5+=0x1){if(_0x30bfb7['joins'][_0xfe23a5][_0x9b3f('0x33')]&&_['includes'](_0x39c04a,_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x33')])&&_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x7c')]&&_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5]['foreignTable']&&_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x7d')]){_0x4daa02[_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x33')]](_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5]['foreignTable'],null,util[_0x9b3f('0x76')](_0x9b3f('0x7e'),_0x30bfb7[_0x9b3f('0x71')],_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5][_0x9b3f('0x7c')],_0x30bfb7['joins'][_0xfe23a5][_0x9b3f('0x7f')],_0x30bfb7[_0x9b3f('0x7a')][_0xfe23a5]['foreignKey']));}}}if(_0x30bfb7[_0x9b3f('0x80')]){_0x30bfb7['conditions']=JSON[_0x9b3f('0x7b')](_0x30bfb7[_0x9b3f('0x80')]);_0x4daa02[_0x9b3f('0x40')](_0x37b0d0(_0x30bfb7[_0x9b3f('0x80')][_0x9b3f('0x6a')]));}_0x232f1a=_0x4daa02[_0x9b3f('0x81')]();_0x4daa02[_0x9b3f('0x21')](_0x2cb1a6);_0x4daa02[_0x9b3f('0x20')](0x0);logger[_0x9b3f('0x82')](_0x9b3f('0x83'),_0x4daa02[_0x9b3f('0x84')]());return dbH['sequelize'][_0x9b3f('0x36')](_0x4daa02['toString'](),{'type':dbH[_0x9b3f('0x85')][_0x9b3f('0x86')][_0x9b3f('0x87')]});}})['then'](respondWithResult(_0xa958a3,null))[_0x9b3f('0x4b')](handleError(_0xa958a3,null));};function runReport(_0x4afc6b,_0x52f4bf,_0x34f56c){var _0x15e4db=_0x52f4bf[_0x9b3f('0x2e')];var _0xc9275=0xa;var _0x3b99ab=[_0x9b3f('0x55'),'left_join','right_join',_0x9b3f('0x58')];var _0x578100={'SUM':_0x9b3f('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9b3f('0x5b'),'MAX':_0x9b3f('0x88'),'MIN':_0x9b3f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9b3f('0x5d'),'GROUP_CONCAT ASC':_0x9b3f('0x5e'),'GROUP_CONCAT DESC':_0x9b3f('0x89')};var _0x8d1f04={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9b3f('0x8a'),'HOUR':_0x9b3f('0x60'),'ROUND':_0x9b3f('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x587abe=function(_0x37d95e){return!_[_0x9b3f('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x9b3f('0x66'),_0x9b3f('0x67')],_0x37d95e);};var _0x35ba43=function(_0x52083b){if(!_0x52083b||!_0x52083b[_0x9b3f('0x68')]['length']){return'';}for(var _0x3c4cbc='(',_0x36bb42=0x0;_0x36bb42<_0x52083b[_0x9b3f('0x68')][_0x9b3f('0x3c')];_0x36bb42+=0x1){_0x36bb42>0x0&&(_0x3c4cbc+='\x20'+_0x52083b[_0x9b3f('0x69')]+'\x20');_0x3c4cbc+=_0x52083b[_0x9b3f('0x68')][_0x36bb42][_0x9b3f('0x6a')]?_0x35ba43(_0x52083b[_0x9b3f('0x68')][_0x36bb42]['group']):_0x52083b[_0x9b3f('0x68')][_0x36bb42]['field']+'\x20'+_0x52083b[_0x9b3f('0x68')][_0x36bb42][_0x9b3f('0x6b')]+(_0x587abe(_0x52083b[_0x9b3f('0x68')][_0x36bb42][_0x9b3f('0x6b')])?'\x20'+_0x52083b[_0x9b3f('0x68')][_0x36bb42]['value']:'');}return _0x3c4cbc+')';};var _0x45f035={'where':{'id':_0x4afc6b['id']}},_0x2ca247,_0x287951,_0x199281,_0x53802a,_0x54612d;_0x45f035=_['merge']({},_0x45f035,_0x34f56c);return db[_0x9b3f('0x30')][_0x9b3f('0x4a')](_0x45f035)[_0x9b3f('0x2b')](function(_0x29a949){if(_0x29a949){_0x2ca247=_0x29a949;return _0x29a949[_0x9b3f('0x6e')]();}return null;})[_0x9b3f('0x2b')](function(_0x223601){if(_0x223601){if(!_0x223601[_0x9b3f('0x3c')]){throw new db[(_0x9b3f('0x8b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x287951=_0x223601;return db[_0x9b3f('0x8c')][_0x9b3f('0x45')]({'raw':!![]});}return null;})[_0x9b3f('0x2b')](function(_0x54c39b){if(_0x54c39b){_0x199281=_['keyBy'](_0x54c39b,'id');var _0x72782;var _0x259716=squel[_0x9b3f('0x70')]();_0x259716[_0x9b3f('0x8d')](_0x2ca247[_0x9b3f('0x71')]);for(var _0x4fa30b=0x0;_0x4fa30b<_0x287951['length'];_0x4fa30b+=0x1){_0x72782=_0x287951[_0x4fa30b][_0x9b3f('0x72')]?_0x199281[_0x287951[_0x4fa30b]['MetricId']][_0x9b3f('0x73')]:_0x287951[_0x4fa30b][_0x9b3f('0x8e')];_0x72782=_0x287951[_0x4fa30b][_0x9b3f('0x74')]?_['replace'](_0x578100[_0x287951[_0x4fa30b][_0x9b3f('0x74')]],'%s',_0x72782):_0x72782;_0x72782=_0x287951[_0x4fa30b][_0x9b3f('0x76')]?_[_0x9b3f('0x75')](_0x8d1f04[_0x287951[_0x4fa30b][_0x9b3f('0x76')]],'%s',_0x72782):_0x72782;if(_0x287951[_0x4fa30b][_0x9b3f('0x77')]){_0x259716['group'](_0x72782);}_0x287951[_0x4fa30b][_0x9b3f('0x78')]&&_0x259716['order'](_0x72782,_0x287951[_0x4fa30b][_0x9b3f('0x78')]===_0x9b3f('0x8f')?![]:!![]);_0x259716['field'](_0x72782,_0x287951[_0x4fa30b][_0x9b3f('0x79')]||_0x72782);}if(_0x2ca247[_0x9b3f('0x7a')]){_0x2ca247[_0x9b3f('0x7a')]=JSON['parse'](_0x2ca247[_0x9b3f('0x7a')]);for(var _0x174b94=0x0;_0x174b94<_0x2ca247[_0x9b3f('0x7a')][_0x9b3f('0x3c')];_0x174b94+=0x1){if(_0x2ca247['joins'][_0x174b94][_0x9b3f('0x33')]&&_[_0x9b3f('0x63')](_0x3b99ab,_0x2ca247['joins'][_0x174b94][_0x9b3f('0x33')])&&_0x2ca247['joins'][_0x174b94][_0x9b3f('0x7c')]&&_0x2ca247[_0x9b3f('0x7a')][_0x174b94]['foreignTable']&&_0x2ca247[_0x9b3f('0x7a')][_0x174b94][_0x9b3f('0x7d')]){_0x259716[_0x2ca247['joins'][_0x174b94]['type']](_0x2ca247['joins'][_0x174b94][_0x9b3f('0x7f')],null,util[_0x9b3f('0x76')](_0x9b3f('0x7e'),_0x2ca247[_0x9b3f('0x71')],_0x2ca247['joins'][_0x174b94][_0x9b3f('0x7c')],_0x2ca247[_0x9b3f('0x7a')][_0x174b94][_0x9b3f('0x7f')],_0x2ca247[_0x9b3f('0x7a')][_0x174b94][_0x9b3f('0x7d')]));}}}if(_0x2ca247[_0x9b3f('0x80')]){_0x2ca247['conditions']=JSON[_0x9b3f('0x7b')](_0x2ca247[_0x9b3f('0x80')]);_0x259716[_0x9b3f('0x40')](_0x35ba43(_0x2ca247[_0x9b3f('0x80')][_0x9b3f('0x6a')]));}_0x54612d=_0x259716[_0x9b3f('0x81')]();_0x259716[_0x9b3f('0x21')](_0xc9275);_0x259716[_0x9b3f('0x20')](0x0);return;}})[_0x9b3f('0x2b')](function(){if(_0x52f4bf[_0x9b3f('0x90')]==='web'){return null;}var _0x12f1fa=_[_0x9b3f('0x41')](_0x52f4bf,{'name':_0x52f4bf[_0x9b3f('0x91')]||_0x52f4bf[_0x9b3f('0x2e')]||_0x2ca247[_0x9b3f('0x2e')],'basename':_0x15e4db,'savename':util[_0x9b3f('0x76')](_0x9b3f('0x92'),_0x52f4bf[_0x9b3f('0x2e')]||_0x2ca247[_0x9b3f('0x2e')],require(_0x9b3f('0x93'))[_0x9b3f('0x94')](0x4),_0x52f4bf[_0x9b3f('0x90')]||_0x9b3f('0x95')),'reportId':_0x2ca247['id'],'reportType':_0x9b3f('0x96')});return db[_0x9b3f('0x97')][_0x9b3f('0x4c')](_0x12f1fa,{'raw':!![]});})[_0x9b3f('0x2b')](function(_0x5d5ef4){if(_0x2ca247['table']==='cdr'){_0x54612d[_0x9b3f('0x40')](_0x2ca247[_0x9b3f('0x71')]+_0x9b3f('0x98'),_0x52f4bf[_0x9b3f('0x99')],_0x52f4bf[_0x9b3f('0x9a')]);}else{_0x54612d['where'](_0x2ca247[_0x9b3f('0x71')]+_0x9b3f('0x9b'),_0x52f4bf['startDate'],_0x52f4bf[_0x9b3f('0x9a')]);}if(_0x5d5ef4){logger['info'](_0x9b3f('0x9c'),_0x54612d[_0x9b3f('0x84')]());require(_0x9b3f('0x9d'))[_0x9b3f('0x9e')](path[_0x9b3f('0x55')](__dirname,'../../components/export/',_0x5d5ef4[_0x9b3f('0x90')]),[_0x5d5ef4['id'],_0x54612d[_0x9b3f('0x84')](),path[_0x9b3f('0x55')](__dirname,_0x9b3f('0x9f'),_0x5d5ef4[_0x9b3f('0xa0')]),_0x15e4db]);return _0x5d5ef4;}else{var _0xfec4dd=squel[_0x9b3f('0x70')]();_0xfec4dd[_0x9b3f('0x8d')]('('+_0x54612d[_0x9b3f('0x84')]()+')',_0x9b3f('0xa1'));_0xfec4dd[_0x9b3f('0x8e')](_0x9b3f('0xa2'),_0x9b3f('0x23'));_0x54612d[_0x9b3f('0x21')](_0x52f4bf[_0x9b3f('0x21')]||_0xc9275);_0x54612d[_0x9b3f('0x20')](_0x52f4bf[_0x9b3f('0x20')]||0x0);return dbH[_0x9b3f('0x85')][_0x9b3f('0x36')](_0xfec4dd['toString'](),{'type':dbH[_0x9b3f('0x85')][_0x9b3f('0x86')][_0x9b3f('0x87')]})[_0x9b3f('0x2b')](function(_0x54d533){if(!_0x54d533[_0x9b3f('0x3c')]){_0x53802a=0x0;}else{_0x53802a=_0x54d533[0x0][_0x9b3f('0x23')]||0x0;}return dbH[_0x9b3f('0x85')][_0x9b3f('0x36')](_0x54612d[_0x9b3f('0x84')](),{'type':dbH[_0x9b3f('0x85')][_0x9b3f('0x86')][_0x9b3f('0x87')]});})['then'](function(_0x3779e6){return{'rows':_0x3779e6||[],'count':_0x53802a};});}});}exports[_0x9b3f('0xa3')]=function(_0x592a82,_0x2bb67b){return runReport(_0x592a82[_0x9b3f('0x48')],_0x592a82['query'],_0x592a82[_0x9b3f('0x6d')])[_0x9b3f('0x2b')](respondWithResult(_0x2bb67b,null))[_0x9b3f('0x4b')](handleError(_0x2bb67b,null));};exports['runReport']=runReport;exports[_0x9b3f('0x36')]=function(_0x33837c,_0x5406e2){var _0x215a37=0xa;var _0x363870=['join',_0x9b3f('0x56'),_0x9b3f('0x57'),_0x9b3f('0x58')];var _0x5c4ff8={'SUM':'SUM(%s)','COUNT':_0x9b3f('0x5a'),'COUNT DISTINCT':_0x9b3f('0x5b'),'MAX':_0x9b3f('0x88'),'MIN':_0x9b3f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9b3f('0x5d'),'GROUP_CONCAT ASC':_0x9b3f('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x438a44={'SEC_TO_TIME':_0x9b3f('0x5f'),'DATE':_0x9b3f('0x8a'),'HOUR':_0x9b3f('0x60'),'ROUND':_0x9b3f('0x61'),'UNIX_TIMESTAMP':_0x9b3f('0x62')};var _0x40b876=function(_0x113dee){return!_[_0x9b3f('0x63')]([_0x9b3f('0x64'),_0x9b3f('0x65'),_0x9b3f('0x66'),_0x9b3f('0x67')],_0x113dee);};var _0x8cfdb1=function(_0x307fda){if(!_0x307fda||!_0x307fda[_0x9b3f('0x68')][_0x9b3f('0x3c')]){return'';}for(var _0x237846='(',_0x2a17db=0x0;_0x2a17db<_0x307fda['rules'][_0x9b3f('0x3c')];_0x2a17db+=0x1){_0x2a17db>0x0&&(_0x237846+='\x20'+_0x307fda[_0x9b3f('0x69')]+'\x20');_0x237846+=_0x307fda['rules'][_0x2a17db][_0x9b3f('0x6a')]?_0x8cfdb1(_0x307fda['rules'][_0x2a17db]['group']):_0x307fda[_0x9b3f('0x68')][_0x2a17db][_0x9b3f('0x8e')]+'\x20'+_0x307fda[_0x9b3f('0x68')][_0x2a17db]['condition']+(_0x40b876(_0x307fda[_0x9b3f('0x68')][_0x2a17db][_0x9b3f('0x6b')])?'\x20'+_0x307fda[_0x9b3f('0x68')][_0x2a17db][_0x9b3f('0x6c')]:'');}return _0x237846+')';};var _0x7e1896={'where':{'id':_0x33837c[_0x9b3f('0x48')]['id']}},_0x32cc25,_0x23912b,_0x326dff,_0x3fff15,_0x495861;_0x7e1896=_[_0x9b3f('0x41')]({},_0x7e1896,_0x33837c[_0x9b3f('0x6d')]);return db['AnalyticCustomReport'][_0x9b3f('0x4a')](_0x7e1896)[_0x9b3f('0x2b')](function(_0x7a82f0){if(_0x7a82f0){_0x32cc25=_0x7a82f0;return _0x7a82f0[_0x9b3f('0x6e')]();}return null;})[_0x9b3f('0x2b')](function(_0x40116c){if(_0x40116c){if(!_0x40116c['length']){throw new db[(_0x9b3f('0x8b'))][(_0x9b3f('0x6f'))](_0x9b3f('0xa4'),0x193);}_0x23912b=_0x40116c;return db[_0x9b3f('0x8c')][_0x9b3f('0x45')]({'raw':!![]});}return null;})[_0x9b3f('0x2b')](function(_0x5a90f9){if(_0x5a90f9){_0x326dff=_[_0x9b3f('0xa5')](_0x5a90f9,'id');var _0x733b69;var _0x414da4=squel[_0x9b3f('0x70')]();_0x414da4[_0x9b3f('0x8d')](_0x32cc25[_0x9b3f('0x71')]);for(var _0x4271c9=0x0;_0x4271c9<_0x23912b[_0x9b3f('0x3c')];_0x4271c9+=0x1){_0x733b69=_0x23912b[_0x4271c9][_0x9b3f('0x72')]?_0x326dff[_0x23912b[_0x4271c9][_0x9b3f('0x72')]][_0x9b3f('0x73')]:_0x23912b[_0x4271c9][_0x9b3f('0x8e')];_0x733b69=_0x23912b[_0x4271c9][_0x9b3f('0x74')]?_[_0x9b3f('0x75')](_0x5c4ff8[_0x23912b[_0x4271c9][_0x9b3f('0x74')]],'%s',_0x733b69):_0x733b69;_0x733b69=_0x23912b[_0x4271c9][_0x9b3f('0x76')]?_[_0x9b3f('0x75')](_0x438a44[_0x23912b[_0x4271c9][_0x9b3f('0x76')]],'%s',_0x733b69):_0x733b69;if(_0x23912b[_0x4271c9][_0x9b3f('0x77')]){_0x414da4[_0x9b3f('0x6a')](_0x733b69);}_0x23912b[_0x4271c9][_0x9b3f('0x78')]&&_0x414da4['order'](_0x733b69,_0x23912b[_0x4271c9]['orderBy']==='DESC'?![]:!![]);_0x414da4[_0x9b3f('0x8e')](_0x733b69,_0x23912b[_0x4271c9][_0x9b3f('0x79')]||_0x733b69);}if(_0x32cc25[_0x9b3f('0x7a')]){_0x32cc25['joins']=JSON[_0x9b3f('0x7b')](_0x32cc25[_0x9b3f('0x7a')]);for(var _0x395fe2=0x0;_0x395fe2<_0x32cc25['joins'][_0x9b3f('0x3c')];_0x395fe2+=0x1){if(_0x32cc25['joins'][_0x395fe2][_0x9b3f('0x33')]&&_[_0x9b3f('0x63')](_0x363870,_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x33')])&&_0x32cc25[_0x9b3f('0x7a')][_0x395fe2]['parentKey']&&_0x32cc25['joins'][_0x395fe2][_0x9b3f('0x7f')]&&_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x7d')]){_0x414da4[_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x33')]](_0x32cc25['joins'][_0x395fe2][_0x9b3f('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x32cc25['table'],_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x7c')],_0x32cc25[_0x9b3f('0x7a')][_0x395fe2][_0x9b3f('0x7f')],_0x32cc25[_0x9b3f('0x7a')][_0x395fe2]['foreignKey']));}}}if(_0x32cc25[_0x9b3f('0x80')]){_0x32cc25[_0x9b3f('0x80')]=JSON[_0x9b3f('0x7b')](_0x32cc25['conditions']);_0x414da4[_0x9b3f('0x40')](_0x8cfdb1(_0x32cc25[_0x9b3f('0x80')][_0x9b3f('0x6a')]));}_0x495861=_0x414da4['clone']();_0x414da4['limit'](_0x215a37);_0x414da4['offset'](0x0);logger[_0x9b3f('0x82')](_0x9b3f('0x83'),_0x414da4['toString']());return dbH[_0x9b3f('0x85')][_0x9b3f('0x36')](_0x414da4[_0x9b3f('0x84')](),{'type':dbH['sequelize'][_0x9b3f('0x86')][_0x9b3f('0x87')]});}})[_0x9b3f('0x2b')](function(){return{'sql':_0x495861[_0x9b3f('0x84')]()};})[_0x9b3f('0x2b')](respondWithResult(_0x5406e2,null))[_0x9b3f('0x4b')](handleError(_0x5406e2,null));};
\ No newline at end of file
+var _0xea12=['util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','length','nolimit','order','pick','filters','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','attributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','find','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','operator','AnalyticMetric','from','clone','web','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','runReport','SEC_TO_TIME(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xea12,0x1c5));var _0x2ea1=function(_0x46b92c,_0x2b5537){_0x46b92c=_0x46b92c-0x0;var _0x4d58ef=_0xea12[_0x46b92c];return _0x4d58ef;};'use strict';var emlformat=require(_0x2ea1('0x0'));var rimraf=require(_0x2ea1('0x1'));var zipdir=require(_0x2ea1('0x2'));var jsonpatch=require(_0x2ea1('0x3'));var rp=require('request-promise');var moment=require(_0x2ea1('0x4'));var BPromise=require(_0x2ea1('0x5'));var Mustache=require('mustache');var util=require(_0x2ea1('0x6'));var path=require(_0x2ea1('0x7'));var sox=require(_0x2ea1('0x8'));var csv=require(_0x2ea1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ea1('0xa'));var _=require(_0x2ea1('0xb'));var squel=require('squel');var crypto=require(_0x2ea1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ea1('0x9'));var querystring=require(_0x2ea1('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ea1('0xe'));var authService=require(_0x2ea1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ea1('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ea1('0x11'));var db=require(_0x2ea1('0x12'))['db'];var dbH=require(_0x2ea1('0x12'))[_0x2ea1('0x13')];function respondWithStatusCode(_0x4ffdd9,_0x587d01){_0x587d01=_0x587d01||0xcc;return function(_0x35e04a){if(_0x35e04a){return _0x4ffdd9[_0x2ea1('0x14')](_0x587d01);}return _0x4ffdd9[_0x2ea1('0x15')](_0x587d01)[_0x2ea1('0x16')]();};}function respondWithResult(_0x57de47,_0x4dfcbb){_0x4dfcbb=_0x4dfcbb||0xc8;return function(_0x23344d){if(_0x23344d){return _0x57de47[_0x2ea1('0x15')](_0x4dfcbb)[_0x2ea1('0x17')](_0x23344d);}};}function respondWithFilteredResult(_0x360268,_0x406f46){return function(_0x443ebf){if(_0x443ebf){var _0x30854c=typeof _0x406f46[_0x2ea1('0x18')]===_0x2ea1('0x19')&&typeof _0x406f46['limit']===_0x2ea1('0x19');var _0x537f52=_0x443ebf[_0x2ea1('0x1a')];var _0x2bc034=_0x30854c?0x0:_0x406f46[_0x2ea1('0x18')];var _0x449d4d=_0x30854c?_0x443ebf[_0x2ea1('0x1a')]:_0x406f46[_0x2ea1('0x18')]+_0x406f46[_0x2ea1('0x1b')];var _0x2ebb49;if(_0x449d4d>=_0x537f52){_0x449d4d=_0x537f52;_0x2ebb49=0xc8;}else{_0x2ebb49=0xce;}_0x360268[_0x2ea1('0x15')](_0x2ebb49);return _0x360268[_0x2ea1('0x1c')]('Content-Range',_0x2bc034+'-'+_0x449d4d+'/'+_0x537f52)[_0x2ea1('0x17')](_0x443ebf);}return null;};}function patchUpdates(_0x32a6d3){return function(_0x29410b){try{jsonpatch['apply'](_0x29410b,_0x32a6d3,!![]);}catch(_0x23eed4){return BPromise[_0x2ea1('0x1d')](_0x23eed4);}return _0x29410b[_0x2ea1('0x1e')]();};}function saveUpdates(_0x1ac7ab,_0x2e5975){return function(_0x1b2a50){if(_0x1b2a50){return _0x1b2a50[_0x2ea1('0x1f')](_0x1ac7ab)[_0x2ea1('0x20')](function(_0x55d5fb){return _0x55d5fb;});}return null;};}function removeEntity(_0x387fe6,_0x25f945){return function(_0x140a37){if(_0x140a37){return _0x140a37[_0x2ea1('0x21')]()[_0x2ea1('0x20')](function(){var _0x11710e=_0x140a37[_0x2ea1('0x22')]({'plain':!![]});var _0x514182=_0x2ea1('0x23');return db[_0x2ea1('0x24')][_0x2ea1('0x21')]({'where':{'type':_0x514182,'resourceId':_0x11710e['id']}})[_0x2ea1('0x20')](function(){return _0x140a37;});})['then'](function(){_0x387fe6[_0x2ea1('0x15')](0xcc)[_0x2ea1('0x16')]();});}};}function handleEntityNotFound(_0x5b84b0,_0x354238){return function(_0x3db0dc){if(!_0x3db0dc){_0x5b84b0[_0x2ea1('0x14')](0x194);}return _0x3db0dc;};}function handleError(_0x518faa,_0x29aa0c){_0x29aa0c=_0x29aa0c||0x1f4;return function(_0x350214){logger['error'](_0x350214[_0x2ea1('0x25')]);if(_0x350214['name']){delete _0x350214[_0x2ea1('0x26')];}_0x518faa[_0x2ea1('0x15')](_0x29aa0c)[_0x2ea1('0x27')](_0x350214);};}exports['index']=function(_0x459d52,_0x49b4f9){var _0x2a55ec={},_0x33f7ff={},_0x2172fd={'count':0x0,'rows':[]};var _0x34ba5b=_[_0x2ea1('0x28')](db[_0x2ea1('0x29')][_0x2ea1('0x2a')],function(_0x4d8ade){return{'name':_0x4d8ade[_0x2ea1('0x2b')],'type':_0x4d8ade[_0x2ea1('0x2c')][_0x2ea1('0x2d')]};});_0x33f7ff[_0x2ea1('0x2e')]=_[_0x2ea1('0x28')](_0x34ba5b,_0x2ea1('0x26'));_0x33f7ff['query']=_['keys'](_0x459d52[_0x2ea1('0x2f')]);_0x33f7ff['filters']=_[_0x2ea1('0x30')](_0x33f7ff[_0x2ea1('0x2e')],_0x33f7ff[_0x2ea1('0x2f')]);_0x2a55ec['attributes']=_[_0x2ea1('0x30')](_0x33f7ff['model'],qs[_0x2ea1('0x31')](_0x459d52['query']['fields']));_0x2a55ec['attributes']=_0x2a55ec['attributes'][_0x2ea1('0x32')]?_0x2a55ec['attributes']:_0x33f7ff[_0x2ea1('0x2e')];if(!_0x459d52[_0x2ea1('0x2f')]['hasOwnProperty'](_0x2ea1('0x33'))){_0x2a55ec[_0x2ea1('0x1b')]=qs[_0x2ea1('0x1b')](_0x459d52['query'][_0x2ea1('0x1b')]);_0x2a55ec['offset']=qs[_0x2ea1('0x18')](_0x459d52['query'][_0x2ea1('0x18')]);}_0x2a55ec[_0x2ea1('0x34')]=qs['sort'](_0x459d52[_0x2ea1('0x2f')]['sort']);_0x2a55ec['where']=qs['filters'](_[_0x2ea1('0x35')](_0x459d52[_0x2ea1('0x2f')],_0x33f7ff[_0x2ea1('0x36')]),_0x34ba5b);if(_0x459d52[_0x2ea1('0x2f')]['filter']){_0x2a55ec[_0x2ea1('0x37')]=_[_0x2ea1('0x38')](_0x2a55ec['where'],{'$or':_['map'](_0x34ba5b,function(_0x3349ca){if(_0x3349ca[_0x2ea1('0x2c')]!==_0x2ea1('0x39')){var _0x1f2ac3={};_0x1f2ac3[_0x3349ca[_0x2ea1('0x26')]]={'$like':'%'+_0x459d52[_0x2ea1('0x2f')]['filter']+'%'};return _0x1f2ac3;}})});}_0x2a55ec=_[_0x2ea1('0x38')]({},_0x2a55ec,_0x459d52[_0x2ea1('0x3a')]);var _0x66817b={'where':_0x2a55ec[_0x2ea1('0x37')]};return db[_0x2ea1('0x29')][_0x2ea1('0x1a')](_0x66817b)[_0x2ea1('0x20')](function(_0x5ed68f){_0x2172fd[_0x2ea1('0x1a')]=_0x5ed68f;if(_0x459d52['query'][_0x2ea1('0x3b')]){_0x2a55ec[_0x2ea1('0x3c')]=[{'all':!![]}];}return db[_0x2ea1('0x29')]['findAll'](_0x2a55ec);})[_0x2ea1('0x20')](function(_0x33ba97){_0x2172fd[_0x2ea1('0x3d')]=_0x33ba97;return _0x2172fd;})['then'](respondWithFilteredResult(_0x49b4f9,_0x2a55ec))[_0x2ea1('0x3e')](handleError(_0x49b4f9,null));};exports['show']=function(_0x4881e4,_0x560c1b){var _0x2fb466={'raw':![],'where':{'id':_0x4881e4[_0x2ea1('0x3f')]['id']}},_0x59cea9={};_0x59cea9[_0x2ea1('0x2e')]=_[_0x2ea1('0x40')](db[_0x2ea1('0x29')][_0x2ea1('0x2a')]);_0x59cea9['query']=_['keys'](_0x4881e4['query']);_0x59cea9[_0x2ea1('0x36')]=_[_0x2ea1('0x30')](_0x59cea9['model'],_0x59cea9['query']);_0x2fb466[_0x2ea1('0x41')]=_[_0x2ea1('0x30')](_0x59cea9[_0x2ea1('0x2e')],qs[_0x2ea1('0x31')](_0x4881e4[_0x2ea1('0x2f')][_0x2ea1('0x31')]));_0x2fb466[_0x2ea1('0x41')]=_0x2fb466[_0x2ea1('0x41')]['length']?_0x2fb466['attributes']:_0x59cea9[_0x2ea1('0x2e')];if(_0x4881e4[_0x2ea1('0x2f')][_0x2ea1('0x3b')]){_0x2fb466[_0x2ea1('0x3c')]=[{'all':!![]}];}_0x2fb466=_[_0x2ea1('0x38')]({},_0x2fb466,_0x4881e4[_0x2ea1('0x3a')]);return db[_0x2ea1('0x29')]['find'](_0x2fb466)['then'](handleEntityNotFound(_0x560c1b,null))[_0x2ea1('0x20')](respondWithResult(_0x560c1b,null))[_0x2ea1('0x3e')](handleError(_0x560c1b,null));};exports[_0x2ea1('0x42')]=function(_0x58bf5d,_0x4c6cd1){return db[_0x2ea1('0x29')][_0x2ea1('0x42')](_0x58bf5d[_0x2ea1('0x43')],{})[_0x2ea1('0x20')](function(_0x115fe1){var _0x39351c=_0x58bf5d[_0x2ea1('0x44')][_0x2ea1('0x22')]({'plain':!![]});if(!_0x39351c)throw new Error(_0x2ea1('0x45'));if(_0x39351c['role']===_0x2ea1('0x44')){var _0x45c5a0=_0x115fe1[_0x2ea1('0x22')]({'plain':!![]});var _0x403846='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x403846,'userProfileId':_0x39351c[_0x2ea1('0x46')]},'raw':!![]})[_0x2ea1('0x20')](function(_0x4f52ed){if(_0x4f52ed&&_0x4f52ed[_0x2ea1('0x47')]===0x0){return db[_0x2ea1('0x24')][_0x2ea1('0x42')]({'name':_0x45c5a0[_0x2ea1('0x26')],'resourceId':_0x45c5a0['id'],'type':_0x2ea1('0x23'),'sectionId':_0x4f52ed['id']},{})[_0x2ea1('0x20')](function(){return _0x115fe1;});}else{return _0x115fe1;}})[_0x2ea1('0x3e')](function(_0x2fc13a){logger[_0x2ea1('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fc13a);throw _0x2fc13a;});}return _0x115fe1;})[_0x2ea1('0x20')](respondWithResult(_0x4c6cd1,0xc9))[_0x2ea1('0x3e')](handleError(_0x4c6cd1,null));};exports['update']=function(_0x8d2aa6,_0x127a52){if(_0x8d2aa6[_0x2ea1('0x43')]['id']){delete _0x8d2aa6[_0x2ea1('0x43')]['id'];}return db[_0x2ea1('0x29')][_0x2ea1('0x49')]({'where':{'id':_0x8d2aa6[_0x2ea1('0x3f')]['id']}})[_0x2ea1('0x20')](handleEntityNotFound(_0x127a52,null))['then'](saveUpdates(_0x8d2aa6[_0x2ea1('0x43')],null))['then'](respondWithResult(_0x127a52,null))['catch'](handleError(_0x127a52,null));};exports[_0x2ea1('0x21')]=function(_0x33876b,_0x15e7b6){return db[_0x2ea1('0x29')]['find']({'where':{'id':_0x33876b[_0x2ea1('0x3f')]['id']}})[_0x2ea1('0x20')](handleEntityNotFound(_0x15e7b6,null))[_0x2ea1('0x20')](removeEntity(_0x15e7b6,null))[_0x2ea1('0x3e')](handleError(_0x15e7b6,null));};exports[_0x2ea1('0x4a')]=function(_0x2ea3b2,_0x27367f){var _0x51b38e=0xa;var _0xd1e7f9=[_0x2ea1('0x4b'),_0x2ea1('0x4c'),'right_join',_0x2ea1('0x4d')];var _0x3519d3={'SUM':_0x2ea1('0x4e'),'COUNT':_0x2ea1('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2ea1('0x50'),'MIN':_0x2ea1('0x51'),'AVG':_0x2ea1('0x52'),'GROUP_CONCAT':_0x2ea1('0x53'),'GROUP_CONCAT ASC':_0x2ea1('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x55b463={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x2ea1('0x55'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2ea1('0x56')};var _0x1ca328=function(_0x6b70f){return!_[_0x2ea1('0x57')](['IS\x20NULL',_0x2ea1('0x58'),_0x2ea1('0x59'),_0x2ea1('0x5a')],_0x6b70f);};var _0x442873=function(_0x404c3a){if(!_0x404c3a||!_0x404c3a[_0x2ea1('0x5b')][_0x2ea1('0x32')]){return'';}for(var _0x515b6d='(',_0x42437a=0x0;_0x42437a<_0x404c3a[_0x2ea1('0x5b')][_0x2ea1('0x32')];_0x42437a+=0x1){_0x42437a>0x0&&(_0x515b6d+='\x20'+_0x404c3a['operator']+'\x20');_0x515b6d+=_0x404c3a['rules'][_0x42437a][_0x2ea1('0x5c')]?_0x442873(_0x404c3a['rules'][_0x42437a][_0x2ea1('0x5c')]):_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5d')]+'\x20'+_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5e')]+(_0x1ca328(_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5e')])?'\x20'+_0x404c3a[_0x2ea1('0x5b')][_0x42437a][_0x2ea1('0x5f')]:'');}return _0x515b6d+')';};var _0x519f6a={'where':{'id':_0x2ea3b2[_0x2ea1('0x3f')]['id']}},_0xcc2f53,_0x100e7c,_0x26dea8,_0x4254b5,_0x3a4c77;_0x519f6a=_[_0x2ea1('0x38')]({},_0x519f6a,_0x2ea3b2[_0x2ea1('0x3a')]);return db[_0x2ea1('0x29')][_0x2ea1('0x49')](_0x519f6a)[_0x2ea1('0x20')](function(_0x31b198){if(_0x31b198){_0xcc2f53=_0x31b198;return _0x31b198[_0x2ea1('0x60')]();}return null;})[_0x2ea1('0x20')](function(_0x436ab5){if(_0x436ab5){if(!_0x436ab5['length']){throw new db[(_0x2ea1('0x61'))][(_0x2ea1('0x62'))](_0x2ea1('0x63'),0x193);}_0x100e7c=_0x436ab5;return db['AnalyticMetric'][_0x2ea1('0x64')]({'raw':!![]});}return null;})[_0x2ea1('0x20')](function(_0x45cb49){if(_0x45cb49){_0x26dea8=_[_0x2ea1('0x65')](_0x45cb49,'id');var _0x58e071;var _0x1ff32e=squel[_0x2ea1('0x66')]();_0x1ff32e['from'](_0xcc2f53[_0x2ea1('0x67')]);for(var _0x121a8d=0x0;_0x121a8d<_0x100e7c[_0x2ea1('0x32')];_0x121a8d+=0x1){_0x58e071=_0x100e7c[_0x121a8d][_0x2ea1('0x68')]?_0x26dea8[_0x100e7c[_0x121a8d]['MetricId']][_0x2ea1('0x69')]:_0x100e7c[_0x121a8d][_0x2ea1('0x5d')];_0x58e071=_0x100e7c[_0x121a8d][_0x2ea1('0x6a')]?_[_0x2ea1('0x6b')](_0x3519d3[_0x100e7c[_0x121a8d]['function']],'%s',_0x58e071):_0x58e071;_0x58e071=_0x100e7c[_0x121a8d][_0x2ea1('0x6c')]?_[_0x2ea1('0x6b')](_0x55b463[_0x100e7c[_0x121a8d][_0x2ea1('0x6c')]],'%s',_0x58e071):_0x58e071;if(_0x100e7c[_0x121a8d][_0x2ea1('0x6d')]){_0x1ff32e['group'](_0x58e071);}_0x100e7c[_0x121a8d][_0x2ea1('0x6e')]&&_0x1ff32e[_0x2ea1('0x34')](_0x58e071,_0x100e7c[_0x121a8d]['orderBy']===_0x2ea1('0x6f')?![]:!![]);_0x1ff32e['field'](_0x58e071,_0x100e7c[_0x121a8d][_0x2ea1('0x70')]||_0x58e071);}if(_0xcc2f53[_0x2ea1('0x71')]){_0xcc2f53[_0x2ea1('0x71')]=JSON[_0x2ea1('0x72')](_0xcc2f53['joins']);for(var _0x59db73=0x0;_0x59db73<_0xcc2f53[_0x2ea1('0x71')][_0x2ea1('0x32')];_0x59db73+=0x1){if(_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x2c')]&&_[_0x2ea1('0x57')](_0xd1e7f9,_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x2c')])&&_0xcc2f53['joins'][_0x59db73][_0x2ea1('0x73')]&&_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x74')]&&_0xcc2f53[_0x2ea1('0x71')][_0x59db73]['foreignKey']){_0x1ff32e[_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x2c')]](_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x74')],null,util['format'](_0x2ea1('0x75'),_0xcc2f53[_0x2ea1('0x67')],_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x73')],_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x74')],_0xcc2f53[_0x2ea1('0x71')][_0x59db73][_0x2ea1('0x76')]));}}}if(_0xcc2f53[_0x2ea1('0x77')]){_0xcc2f53[_0x2ea1('0x77')]=JSON[_0x2ea1('0x72')](_0xcc2f53[_0x2ea1('0x77')]);_0x1ff32e[_0x2ea1('0x37')](_0x442873(_0xcc2f53[_0x2ea1('0x77')][_0x2ea1('0x5c')]));}_0x3a4c77=_0x1ff32e['clone']();_0x1ff32e[_0x2ea1('0x1b')](_0x51b38e);_0x1ff32e[_0x2ea1('0x18')](0x0);logger[_0x2ea1('0x78')](_0x2ea1('0x79'),_0x1ff32e[_0x2ea1('0x7a')]());return dbH[_0x2ea1('0x7b')]['query'](_0x1ff32e['toString'](),{'type':dbH[_0x2ea1('0x7b')][_0x2ea1('0x7c')][_0x2ea1('0x7d')]});}})[_0x2ea1('0x20')](respondWithResult(_0x27367f,null))[_0x2ea1('0x3e')](handleError(_0x27367f,null));};function runReport(_0x47617b,_0x2e585b,_0x3e2ac2){var _0x4e7a51=_0x2e585b[_0x2ea1('0x26')];var _0x548f82=0xa;var _0x6e2f44=[_0x2ea1('0x4b'),_0x2ea1('0x4c'),_0x2ea1('0x7e'),'cross_join'];var _0x25a969={'SUM':'SUM(%s)','COUNT':_0x2ea1('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x2ea1('0x51'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2ea1('0x53'),'GROUP_CONCAT ASC':_0x2ea1('0x54'),'GROUP_CONCAT DESC':_0x2ea1('0x7f')};var _0x34e4be={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2ea1('0x80'),'HOUR':'HOUR(%s)','ROUND':_0x2ea1('0x81'),'UNIX_TIMESTAMP':_0x2ea1('0x56')};var _0x320cc3=function(_0x50cbfd){return!_[_0x2ea1('0x57')](['IS\x20NULL',_0x2ea1('0x58'),_0x2ea1('0x59'),'IS\x20NOT\x20EMPTY'],_0x50cbfd);};var _0x2796fb=function(_0x598242){if(!_0x598242||!_0x598242[_0x2ea1('0x5b')][_0x2ea1('0x32')]){return'';}for(var _0x6442b3='(',_0x12f1d2=0x0;_0x12f1d2<_0x598242[_0x2ea1('0x5b')]['length'];_0x12f1d2+=0x1){_0x12f1d2>0x0&&(_0x6442b3+='\x20'+_0x598242[_0x2ea1('0x82')]+'\x20');_0x6442b3+=_0x598242['rules'][_0x12f1d2][_0x2ea1('0x5c')]?_0x2796fb(_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5c')]):_0x598242[_0x2ea1('0x5b')][_0x12f1d2]['field']+'\x20'+_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5e')]+(_0x320cc3(_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5e')])?'\x20'+_0x598242[_0x2ea1('0x5b')][_0x12f1d2][_0x2ea1('0x5f')]:'');}return _0x6442b3+')';};var _0x4ffb39={'where':{'id':_0x47617b['id']}},_0x3c48ce,_0x5454f8,_0x2e2803,_0x32ca6a,_0x41a4ac;_0x4ffb39=_[_0x2ea1('0x38')]({},_0x4ffb39,_0x3e2ac2);return db[_0x2ea1('0x29')][_0x2ea1('0x49')](_0x4ffb39)[_0x2ea1('0x20')](function(_0x1c7c07){if(_0x1c7c07){_0x3c48ce=_0x1c7c07;return _0x1c7c07[_0x2ea1('0x60')]();}return null;})['then'](function(_0x3994a7){if(_0x3994a7){if(!_0x3994a7['length']){throw new db['Sequelize'][(_0x2ea1('0x62'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5454f8=_0x3994a7;return db[_0x2ea1('0x83')][_0x2ea1('0x64')]({'raw':!![]});}return null;})[_0x2ea1('0x20')](function(_0x3e9791){if(_0x3e9791){_0x2e2803=_[_0x2ea1('0x65')](_0x3e9791,'id');var _0xf36107;var _0x5f2b42=squel[_0x2ea1('0x66')]();_0x5f2b42[_0x2ea1('0x84')](_0x3c48ce[_0x2ea1('0x67')]);for(var _0x13ced8=0x0;_0x13ced8<_0x5454f8[_0x2ea1('0x32')];_0x13ced8+=0x1){_0xf36107=_0x5454f8[_0x13ced8][_0x2ea1('0x68')]?_0x2e2803[_0x5454f8[_0x13ced8]['MetricId']][_0x2ea1('0x69')]:_0x5454f8[_0x13ced8]['field'];_0xf36107=_0x5454f8[_0x13ced8][_0x2ea1('0x6a')]?_[_0x2ea1('0x6b')](_0x25a969[_0x5454f8[_0x13ced8][_0x2ea1('0x6a')]],'%s',_0xf36107):_0xf36107;_0xf36107=_0x5454f8[_0x13ced8][_0x2ea1('0x6c')]?_['replace'](_0x34e4be[_0x5454f8[_0x13ced8][_0x2ea1('0x6c')]],'%s',_0xf36107):_0xf36107;if(_0x5454f8[_0x13ced8][_0x2ea1('0x6d')]){_0x5f2b42[_0x2ea1('0x5c')](_0xf36107);}_0x5454f8[_0x13ced8]['orderBy']&&_0x5f2b42[_0x2ea1('0x34')](_0xf36107,_0x5454f8[_0x13ced8][_0x2ea1('0x6e')]===_0x2ea1('0x6f')?![]:!![]);_0x5f2b42[_0x2ea1('0x5d')](_0xf36107,_0x5454f8[_0x13ced8][_0x2ea1('0x70')]||_0xf36107);}if(_0x3c48ce[_0x2ea1('0x71')]){_0x3c48ce[_0x2ea1('0x71')]=JSON[_0x2ea1('0x72')](_0x3c48ce['joins']);for(var _0x4810ed=0x0;_0x4810ed<_0x3c48ce[_0x2ea1('0x71')][_0x2ea1('0x32')];_0x4810ed+=0x1){if(_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x2c')]&&_[_0x2ea1('0x57')](_0x6e2f44,_0x3c48ce[_0x2ea1('0x71')][_0x4810ed]['type'])&&_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x73')]&&_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x74')]&&_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x76')]){_0x5f2b42[_0x3c48ce['joins'][_0x4810ed][_0x2ea1('0x2c')]](_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x74')],null,util[_0x2ea1('0x6c')](_0x2ea1('0x75'),_0x3c48ce['table'],_0x3c48ce[_0x2ea1('0x71')][_0x4810ed][_0x2ea1('0x73')],_0x3c48ce['joins'][_0x4810ed][_0x2ea1('0x74')],_0x3c48ce[_0x2ea1('0x71')][_0x4810ed]['foreignKey']));}}}if(_0x3c48ce[_0x2ea1('0x77')]){_0x3c48ce[_0x2ea1('0x77')]=JSON[_0x2ea1('0x72')](_0x3c48ce['conditions']);_0x5f2b42[_0x2ea1('0x37')](_0x2796fb(_0x3c48ce[_0x2ea1('0x77')]['group']));}_0x41a4ac=_0x5f2b42[_0x2ea1('0x85')]();_0x5f2b42[_0x2ea1('0x1b')](_0x548f82);_0x5f2b42[_0x2ea1('0x18')](0x0);return;}})[_0x2ea1('0x20')](function(){if(_0x2e585b['output']===_0x2ea1('0x86')){return null;}var _0xc5908c=_[_0x2ea1('0x38')](_0x2e585b,{'name':_0x2e585b['fullPath']||_0x2e585b[_0x2ea1('0x26')]||_0x3c48ce[_0x2ea1('0x26')],'basename':_0x4e7a51,'savename':util['format']('%s-%s.%s',_0x2e585b[_0x2ea1('0x26')]||_0x3c48ce[_0x2ea1('0x26')],require(_0x2ea1('0x87'))[_0x2ea1('0x88')](0x4),_0x2e585b[_0x2ea1('0x89')]||_0x2ea1('0x8a')),'reportId':_0x3c48ce['id'],'reportType':_0x2ea1('0x8b')});return db[_0x2ea1('0x8c')]['create'](_0xc5908c,{'raw':!![]});})[_0x2ea1('0x20')](function(_0x460b19){if(_0x3c48ce[_0x2ea1('0x67')]==='cdr'){_0x41a4ac[_0x2ea1('0x37')](_0x3c48ce[_0x2ea1('0x67')]+_0x2ea1('0x8d'),_0x2e585b['startDate'],_0x2e585b[_0x2ea1('0x8e')]);}else{_0x41a4ac[_0x2ea1('0x37')](_0x3c48ce[_0x2ea1('0x67')]+_0x2ea1('0x8f'),_0x2e585b['startDate'],_0x2e585b['endDate']);}if(_0x460b19){logger[_0x2ea1('0x90')](_0x2ea1('0x91'),_0x41a4ac['toString']());require(_0x2ea1('0x92'))[_0x2ea1('0x93')](path[_0x2ea1('0x4b')](__dirname,_0x2ea1('0x94'),_0x460b19[_0x2ea1('0x89')]),[_0x460b19['id'],_0x41a4ac[_0x2ea1('0x7a')](),path[_0x2ea1('0x4b')](__dirname,_0x2ea1('0x95'),_0x460b19[_0x2ea1('0x96')]),_0x4e7a51]);return _0x460b19;}else{var _0x383137=squel[_0x2ea1('0x66')]();_0x383137['from']('('+_0x41a4ac[_0x2ea1('0x7a')]()+')','countTable');_0x383137['field']('COUNT(*)','count');_0x41a4ac[_0x2ea1('0x1b')](_0x2e585b[_0x2ea1('0x1b')]||_0x548f82);_0x41a4ac[_0x2ea1('0x18')](_0x2e585b[_0x2ea1('0x18')]||0x0);return dbH['sequelize']['query'](_0x383137[_0x2ea1('0x7a')](),{'type':dbH['sequelize'][_0x2ea1('0x7c')][_0x2ea1('0x7d')]})[_0x2ea1('0x20')](function(_0x49e23d){if(!_0x49e23d[_0x2ea1('0x32')]){_0x32ca6a=0x0;}else{_0x32ca6a=_0x49e23d[0x0][_0x2ea1('0x1a')]||0x0;}return dbH[_0x2ea1('0x7b')][_0x2ea1('0x2f')](_0x41a4ac['toString'](),{'type':dbH[_0x2ea1('0x7b')][_0x2ea1('0x7c')][_0x2ea1('0x7d')]});})[_0x2ea1('0x20')](function(_0x4da2dd){return{'rows':_0x4da2dd||[],'count':_0x32ca6a};});}});}exports['run']=function(_0x34e3b2,_0x583e53){return runReport(_0x34e3b2[_0x2ea1('0x3f')],_0x34e3b2[_0x2ea1('0x2f')],_0x34e3b2[_0x2ea1('0x3a')])[_0x2ea1('0x20')](respondWithResult(_0x583e53,null))[_0x2ea1('0x3e')](handleError(_0x583e53,null));};exports[_0x2ea1('0x97')]=runReport;exports[_0x2ea1('0x2f')]=function(_0x20b9fa,_0x383520){var _0x369d05=0xa;var _0xb09fd0=[_0x2ea1('0x4b'),_0x2ea1('0x4c'),_0x2ea1('0x7e'),_0x2ea1('0x4d')];var _0x5cc503={'SUM':_0x2ea1('0x4e'),'COUNT':_0x2ea1('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2ea1('0x50'),'MIN':_0x2ea1('0x51'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2ea1('0x53'),'GROUP_CONCAT ASC':_0x2ea1('0x54'),'GROUP_CONCAT DESC':_0x2ea1('0x7f')};var _0x308ea4={'SEC_TO_TIME':_0x2ea1('0x98'),'DATE':_0x2ea1('0x80'),'HOUR':_0x2ea1('0x55'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2ea1('0x56')};var _0x87dfb8=function(_0x755f57){return!_[_0x2ea1('0x57')](['IS\x20NULL',_0x2ea1('0x58'),_0x2ea1('0x59'),_0x2ea1('0x5a')],_0x755f57);};var _0x3db600=function(_0x2a4281){if(!_0x2a4281||!_0x2a4281['rules']['length']){return'';}for(var _0x18d7b2='(',_0x497880=0x0;_0x497880<_0x2a4281['rules'][_0x2ea1('0x32')];_0x497880+=0x1){_0x497880>0x0&&(_0x18d7b2+='\x20'+_0x2a4281['operator']+'\x20');_0x18d7b2+=_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5c')]?_0x3db600(_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5c')]):_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5d')]+'\x20'+_0x2a4281['rules'][_0x497880][_0x2ea1('0x5e')]+(_0x87dfb8(_0x2a4281[_0x2ea1('0x5b')][_0x497880][_0x2ea1('0x5e')])?'\x20'+_0x2a4281['rules'][_0x497880][_0x2ea1('0x5f')]:'');}return _0x18d7b2+')';};var _0x7bec94={'where':{'id':_0x20b9fa[_0x2ea1('0x3f')]['id']}},_0x78af26,_0x45f7ab,_0x5675d8,_0x48b966,_0x38a13e;_0x7bec94=_[_0x2ea1('0x38')]({},_0x7bec94,_0x20b9fa[_0x2ea1('0x3a')]);return db[_0x2ea1('0x29')][_0x2ea1('0x49')](_0x7bec94)[_0x2ea1('0x20')](function(_0x1478dd){if(_0x1478dd){_0x78af26=_0x1478dd;return _0x1478dd[_0x2ea1('0x60')]();}return null;})['then'](function(_0x61dd47){if(_0x61dd47){if(!_0x61dd47[_0x2ea1('0x32')]){throw new db[(_0x2ea1('0x61'))]['ValidationErrorItem'](_0x2ea1('0x63'),0x193);}_0x45f7ab=_0x61dd47;return db[_0x2ea1('0x83')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x293e2a){if(_0x293e2a){_0x5675d8=_[_0x2ea1('0x65')](_0x293e2a,'id');var _0x4c9334;var _0xde0b00=squel[_0x2ea1('0x66')]();_0xde0b00[_0x2ea1('0x84')](_0x78af26[_0x2ea1('0x67')]);for(var _0x2ef063=0x0;_0x2ef063<_0x45f7ab['length'];_0x2ef063+=0x1){_0x4c9334=_0x45f7ab[_0x2ef063][_0x2ea1('0x68')]?_0x5675d8[_0x45f7ab[_0x2ef063]['MetricId']]['metric']:_0x45f7ab[_0x2ef063][_0x2ea1('0x5d')];_0x4c9334=_0x45f7ab[_0x2ef063][_0x2ea1('0x6a')]?_[_0x2ea1('0x6b')](_0x5cc503[_0x45f7ab[_0x2ef063][_0x2ea1('0x6a')]],'%s',_0x4c9334):_0x4c9334;_0x4c9334=_0x45f7ab[_0x2ef063][_0x2ea1('0x6c')]?_[_0x2ea1('0x6b')](_0x308ea4[_0x45f7ab[_0x2ef063][_0x2ea1('0x6c')]],'%s',_0x4c9334):_0x4c9334;if(_0x45f7ab[_0x2ef063]['groupBy']){_0xde0b00['group'](_0x4c9334);}_0x45f7ab[_0x2ef063][_0x2ea1('0x6e')]&&_0xde0b00[_0x2ea1('0x34')](_0x4c9334,_0x45f7ab[_0x2ef063][_0x2ea1('0x6e')]===_0x2ea1('0x6f')?![]:!![]);_0xde0b00[_0x2ea1('0x5d')](_0x4c9334,_0x45f7ab[_0x2ef063]['alias']||_0x4c9334);}if(_0x78af26[_0x2ea1('0x71')]){_0x78af26[_0x2ea1('0x71')]=JSON['parse'](_0x78af26[_0x2ea1('0x71')]);for(var _0x235c3a=0x0;_0x235c3a<_0x78af26[_0x2ea1('0x71')][_0x2ea1('0x32')];_0x235c3a+=0x1){if(_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x2c')]&&_[_0x2ea1('0x57')](_0xb09fd0,_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x2c')])&&_0x78af26['joins'][_0x235c3a]['parentKey']&&_0x78af26[_0x2ea1('0x71')][_0x235c3a]['foreignTable']&&_0x78af26['joins'][_0x235c3a][_0x2ea1('0x76')]){_0xde0b00[_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x2c')]](_0x78af26[_0x2ea1('0x71')][_0x235c3a]['foreignTable'],null,util[_0x2ea1('0x6c')](_0x2ea1('0x75'),_0x78af26[_0x2ea1('0x67')],_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x73')],_0x78af26['joins'][_0x235c3a][_0x2ea1('0x74')],_0x78af26[_0x2ea1('0x71')][_0x235c3a][_0x2ea1('0x76')]));}}}if(_0x78af26[_0x2ea1('0x77')]){_0x78af26['conditions']=JSON[_0x2ea1('0x72')](_0x78af26[_0x2ea1('0x77')]);_0xde0b00[_0x2ea1('0x37')](_0x3db600(_0x78af26[_0x2ea1('0x77')]['group']));}_0x38a13e=_0xde0b00[_0x2ea1('0x85')]();_0xde0b00[_0x2ea1('0x1b')](_0x369d05);_0xde0b00[_0x2ea1('0x18')](0x0);logger[_0x2ea1('0x78')](_0x2ea1('0x79'),_0xde0b00['toString']());return dbH[_0x2ea1('0x7b')]['query'](_0xde0b00['toString'](),{'type':dbH[_0x2ea1('0x7b')][_0x2ea1('0x7c')][_0x2ea1('0x7d')]});}})[_0x2ea1('0x20')](function(){return{'sql':_0x38a13e['toString']()};})[_0x2ea1('0x20')](respondWithResult(_0x383520,null))['catch'](handleError(_0x383520,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 78e0b2d..990f6bd 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 _0xd7b8=['path','rimraf','exports','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd7b8,0x102));var _0x8d7b=function(_0x384cc2,_0x225e73){_0x384cc2=_0x384cc2-0x0;var _0x3cb452=_0xd7b8[_0x384cc2];return _0x3cb452;};'use strict';var _=require(_0x8d7b('0x0'));var util=require(_0x8d7b('0x1'));var logger=require('../../config/logger')(_0x8d7b('0x2'));var moment=require(_0x8d7b('0x3'));var BPromise=require(_0x8d7b('0x4'));var rp=require(_0x8d7b('0x5'));var fs=require('fs');var path=require(_0x8d7b('0x6'));var rimraf=require(_0x8d7b('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x8d7b('0x8')]=function(_0x340b14,_0x379650){return _0x340b14[_0x8d7b('0x9')](_0x8d7b('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4347=['path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x6eb02d,_0x20bdf5){var _0xb756de=function(_0x18fef2){while(--_0x18fef2){_0x6eb02d['push'](_0x6eb02d['shift']());}};_0xb756de(++_0x20bdf5);}(_0x4347,0x97));var _0x7434=function(_0xfe8790,_0x1e1172){_0xfe8790=_0xfe8790-0x0;var _0x443355=_0x4347[_0xfe8790];return _0x443355;};'use strict';var _=require(_0x7434('0x0'));var util=require('util');var logger=require(_0x7434('0x1'))('api');var moment=require(_0x7434('0x2'));var BPromise=require(_0x7434('0x3'));var rp=require(_0x7434('0x4'));var fs=require('fs');var path=require(_0x7434('0x5'));var rimraf=require('rimraf');var config=require(_0x7434('0x6'));var attributes=require(_0x7434('0x7'));module[_0x7434('0x8')]=function(_0x5ef568,_0x3c215f){return _0x5ef568[_0x7434('0x9')](_0x7434('0xa'),attributes,{'tableName':_0x7434('0xb'),'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 26ee172..ebcad26 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 _0x3a49=['request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x2da80f,_0x420bb3){var _0xb9417e=function(_0x58baab){while(--_0x58baab){_0x2da80f['push'](_0x2da80f['shift']());}};_0xb9417e(++_0x420bb3);}(_0x3a49,0xc0));var _0x93a4=function(_0x18ea62,_0x3c4611){_0x18ea62=_0x18ea62-0x0;var _0x568c9c=_0x3a49[_0x18ea62];return _0x568c9c;};'use strict';var _=require(_0x93a4('0x0'));var util=require(_0x93a4('0x1'));var moment=require(_0x93a4('0x2'));var BPromise=require('bluebird');var rs=require(_0x93a4('0x3'));var fs=require('fs');var Redis=require(_0x93a4('0x4'));var db=require(_0x93a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x93a4('0x6'))(_0x93a4('0x7'));var config=require(_0x93a4('0x8'));var jayson=require(_0x93a4('0x9'));var client=jayson[_0x93a4('0xa')][_0x93a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c849d,_0xc3267b,_0x3acbf8){return new BPromise(function(_0x4a4a57,_0xc0b832){return client[_0x93a4('0xc')](_0x3c849d,_0x3acbf8)['then'](function(_0x5d7778){logger[_0x93a4('0xd')](_0x93a4('0xe'),_0xc3267b,_0x93a4('0xf'));logger['debug'](_0x93a4('0x10'),_0xc3267b,_0x93a4('0xf'),JSON[_0x93a4('0x11')](_0x5d7778));if(_0x5d7778['error']){if(_0x5d7778['error'][_0x93a4('0x12')]===0x1f4){logger[_0x93a4('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc3267b,_0x5d7778[_0x93a4('0x13')][_0x93a4('0x14')]);return _0xc0b832(_0x5d7778['error'][_0x93a4('0x14')]);}logger[_0x93a4('0x13')](_0x93a4('0xe'),_0xc3267b,_0x5d7778['error'][_0x93a4('0x14')]);return _0x4a4a57(_0x5d7778[_0x93a4('0x13')][_0x93a4('0x14')]);}else{logger[_0x93a4('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc3267b,'request\x20sent');_0x4a4a57(_0x5d7778[_0x93a4('0x15')]['message']);}})[_0x93a4('0x16')](function(_0x4129fe){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xc3267b,_0x4129fe);_0xc0b832(_0x4129fe);});});}
\ No newline at end of file
+var _0x62f2=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4fd2d1,_0x43f306){var _0x564564=function(_0x54121a){while(--_0x54121a){_0x4fd2d1['push'](_0x4fd2d1['shift']());}};_0x564564(++_0x43f306);}(_0x62f2,0x11e));var _0x262f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x62f2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x262f('0x0'));var util=require(_0x262f('0x1'));var moment=require(_0x262f('0x2'));var BPromise=require('bluebird');var rs=require(_0x262f('0x3'));var fs=require('fs');var Redis=require(_0x262f('0x4'));var db=require(_0x262f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x262f('0x6'))(_0x262f('0x7'));var config=require(_0x262f('0x8'));var jayson=require(_0x262f('0x9'));var client=jayson[_0x262f('0xa')][_0x262f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12f4b8,_0x40f0e0,_0x2b117f){return new BPromise(function(_0x389945,_0x3f8473){return client[_0x262f('0xc')](_0x12f4b8,_0x2b117f)[_0x262f('0xd')](function(_0x16933c){logger[_0x262f('0xe')](_0x262f('0xf'),_0x40f0e0,'request\x20sent');logger[_0x262f('0x10')](_0x262f('0x11'),_0x40f0e0,_0x262f('0x12'),JSON[_0x262f('0x13')](_0x16933c));if(_0x16933c[_0x262f('0x14')]){if(_0x16933c[_0x262f('0x14')][_0x262f('0x15')]===0x1f4){logger[_0x262f('0x14')](_0x262f('0xf'),_0x40f0e0,_0x16933c[_0x262f('0x14')][_0x262f('0x16')]);return _0x3f8473(_0x16933c['error'][_0x262f('0x16')]);}logger['error'](_0x262f('0xf'),_0x40f0e0,_0x16933c[_0x262f('0x14')][_0x262f('0x16')]);return _0x389945(_0x16933c[_0x262f('0x14')]['message']);}else{logger[_0x262f('0xe')](_0x262f('0xf'),_0x40f0e0,_0x262f('0x12'));_0x389945(_0x16933c[_0x262f('0x17')]['message']);}})[_0x262f('0x18')](function(_0x49a79b){logger[_0x262f('0x14')](_0x262f('0xf'),_0x40f0e0,_0x49a79b);_0x3f8473(_0x49a79b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ba7a14b..d2e12c3 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 _0x7581=['put','update','destroy','util','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','query','post','create'];(function(_0x4d1760,_0x47c103){var _0x5ee388=function(_0x469f2c){while(--_0x469f2c){_0x4d1760['push'](_0x4d1760['shift']());}};_0x5ee388(++_0x47c103);}(_0x7581,0x8f));var _0x1758=function(_0x48e723,_0x34a5e9){_0x48e723=_0x48e723-0x0;var _0x1c0ee2=_0x7581[_0x48e723];return _0x1c0ee2;};'use strict';var multer=require('multer');var util=require(_0x1758('0x0'));var path=require('path');var timeout=require(_0x1758('0x1'));var express=require(_0x1758('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1758('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1758('0x4'));var controller=require(_0x1758('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x1758('0x6')]);router[_0x1758('0x7')](_0x1758('0x8'),auth[_0x1758('0x9')](),controller[_0x1758('0xa')]);router['get'](_0x1758('0xb'),auth[_0x1758('0x9')](),controller['preview']);router[_0x1758('0x7')](_0x1758('0xc'),auth[_0x1758('0x9')](),controller['run']);router['get'](_0x1758('0xd'),auth[_0x1758('0x9')](),controller[_0x1758('0xe')]);router[_0x1758('0xf')]('/',auth[_0x1758('0x9')](),controller[_0x1758('0x10')]);router[_0x1758('0x11')]('/:id',auth[_0x1758('0x9')](),controller[_0x1758('0x12')]);router['delete'](_0x1758('0x8'),auth[_0x1758('0x9')](),controller[_0x1758('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xdfc9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','/:id/preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0x1e6d07,_0x5ee49a){var _0x4ec616=function(_0x5b20cb){while(--_0x5b20cb){_0x1e6d07['push'](_0x1e6d07['shift']());}};_0x4ec616(++_0x5ee49a);}(_0xdfc9,0x103));var _0x9dfc=function(_0x140e7f,_0x5f50a7){_0x140e7f=_0x140e7f-0x0;var _0x39656b=_0xdfc9[_0x140e7f];return _0x39656b;};'use strict';var multer=require(_0x9dfc('0x0'));var util=require(_0x9dfc('0x1'));var path=require(_0x9dfc('0x2'));var timeout=require('connect-timeout');var express=require(_0x9dfc('0x3'));var router=express[_0x9dfc('0x4')]();var fs_extra=require(_0x9dfc('0x5'));var auth=require(_0x9dfc('0x6'));var interaction=require(_0x9dfc('0x7'));var config=require(_0x9dfc('0x8'));var controller=require(_0x9dfc('0x9'));router[_0x9dfc('0xa')]('/',auth['isAuthenticated'](),controller[_0x9dfc('0xb')]);router['get'](_0x9dfc('0xc'),auth[_0x9dfc('0xd')](),controller['show']);router[_0x9dfc('0xa')](_0x9dfc('0xe'),auth[_0x9dfc('0xd')](),controller['preview']);router[_0x9dfc('0xa')](_0x9dfc('0xf'),auth[_0x9dfc('0xd')](),controller['run']);router[_0x9dfc('0xa')](_0x9dfc('0x10'),auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x11')]);router[_0x9dfc('0x12')]('/',auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x13')]);router[_0x9dfc('0x14')](_0x9dfc('0xc'),auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x15')]);router[_0x9dfc('0x16')](_0x9dfc('0xc'),auth[_0x9dfc('0xd')](),controller[_0x9dfc('0x17')]);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 7524914..98435b7 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x1ae4c7,_0xc94382){var _0x290659=function(_0x58d055){while(--_0x58d055){_0x1ae4c7['push'](_0x1ae4c7['shift']());}};_0x290659(++_0xc94382);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x53f20e,_0x432ee6){_0x53f20e=_0x53f20e-0x0;var _0x46cab4=_0x9c5a[_0x53f20e];return _0x46cab4;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x2f2093,_0x9a1af9){var _0xa3289a=function(_0x2c291a){while(--_0x2c291a){_0x2f2093['push'](_0x2f2093['shift']());}};_0xa3289a(++_0x9a1af9);}(_0xabce,0x103));var _0xeabc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xabce[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index c0a37d6..85b2c8f 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 _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x34f470,_0x464db5){var _0x3ac6cd=function(_0x4a72be){while(--_0x4a72be){_0x34f470['push'](_0x34f470['shift']());}};_0x3ac6cd(++_0x464db5);}(_0x46ed,0x168));var _0xd46e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46ed[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
+var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6d38[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 9916080..b59265f 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 _0x95f3=['AnalyticDefaultReport','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x95f3,0x198));var _0x395f=function(_0xe5ddf,_0x435f31){_0xe5ddf=_0xe5ddf-0x0;var _0xb23604=_0x95f3[_0xe5ddf];return _0xb23604;};'use strict';var _=require('lodash');var util=require(_0x395f('0x0'));var logger=require(_0x395f('0x1'))('api');var moment=require(_0x395f('0x2'));var BPromise=require(_0x395f('0x3'));var rp=require(_0x395f('0x4'));var fs=require('fs');var path=require(_0x395f('0x5'));var rimraf=require(_0x395f('0x6'));var config=require(_0x395f('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x395f('0x8')]=function(_0x7fcf89,_0x209423){return _0x7fcf89[_0x395f('0x9')](_0x395f('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51b4=['moment','request-promise','path','rimraf','exports','define','lodash','util','../../config/logger'];(function(_0x131c48,_0x44c325){var _0xcba1aa=function(_0x2ced82){while(--_0x2ced82){_0x131c48['push'](_0x131c48['shift']());}};_0xcba1aa(++_0x44c325);}(_0x51b4,0xa8));var _0x451b=function(_0x3bde83,_0x3e6deb){_0x3bde83=_0x3bde83-0x0;var _0x158fc6=_0x51b4[_0x3bde83];return _0x158fc6;};'use strict';var _=require(_0x451b('0x0'));var util=require(_0x451b('0x1'));var logger=require(_0x451b('0x2'))('api');var moment=require(_0x451b('0x3'));var BPromise=require('bluebird');var rp=require(_0x451b('0x4'));var fs=require('fs');var path=require(_0x451b('0x5'));var rimraf=require(_0x451b('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x451b('0x7')]=function(_0x439f95,_0x1d8c5e){return _0x439f95[_0x451b('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','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 28c21d4..8b345d1 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 _0xc0b3=['jayson/promise','client','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0xf3eb9,_0x225c4c){var _0x353601=function(_0x781c72){while(--_0x781c72){_0xf3eb9['push'](_0xf3eb9['shift']());}};_0x353601(++_0x225c4c);}(_0xc0b3,0x1d8));var _0x3c0b=function(_0x397c99,_0x21a0f2){_0x397c99=_0x397c99-0x0;var _0x47853c=_0xc0b3[_0x397c99];return _0x47853c;};'use strict';var _=require(_0x3c0b('0x0'));var util=require(_0x3c0b('0x1'));var moment=require(_0x3c0b('0x2'));var BPromise=require(_0x3c0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c0b('0x4'));var db=require(_0x3c0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c0b('0x6'))('rpc');var config=require(_0x3c0b('0x7'));var jayson=require(_0x3c0b('0x8'));var client=jayson[_0x3c0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cb9c6,_0x5c7c6b,_0x1d57b2){return new BPromise(function(_0x40c74c,_0x17cb00){return client[_0x3c0b('0xa')](_0x1cb9c6,_0x1d57b2)['then'](function(_0x52f4fc){logger['info'](_0x3c0b('0xb'),_0x5c7c6b,_0x3c0b('0xc'));logger[_0x3c0b('0xd')](_0x3c0b('0xe'),_0x5c7c6b,_0x3c0b('0xc'),JSON[_0x3c0b('0xf')](_0x52f4fc));if(_0x52f4fc[_0x3c0b('0x10')]){if(_0x52f4fc[_0x3c0b('0x10')]['code']===0x1f4){logger['error'](_0x3c0b('0xb'),_0x5c7c6b,_0x52f4fc['error'][_0x3c0b('0x11')]);return _0x17cb00(_0x52f4fc[_0x3c0b('0x10')][_0x3c0b('0x11')]);}logger[_0x3c0b('0x10')](_0x3c0b('0xb'),_0x5c7c6b,_0x52f4fc[_0x3c0b('0x10')]['message']);return _0x40c74c(_0x52f4fc[_0x3c0b('0x10')][_0x3c0b('0x11')]);}else{logger[_0x3c0b('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5c7c6b,'request\x20sent');_0x40c74c(_0x52f4fc[_0x3c0b('0x13')][_0x3c0b('0x11')]);}})['catch'](function(_0x51646e){logger[_0x3c0b('0x10')](_0x3c0b('0xb'),_0x5c7c6b,_0x51646e);_0x17cb00(_0x51646e);});});}
\ No newline at end of file
+var _0x9517=['../../config/environment','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x34cffb,_0x50d170){var _0x4f3ff3=function(_0x2044fc){while(--_0x2044fc){_0x34cffb['push'](_0x34cffb['shift']());}};_0x4f3ff3(++_0x50d170);}(_0x9517,0x177));var _0x7951=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9517[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7951('0x0'));var util=require('util');var moment=require(_0x7951('0x1'));var BPromise=require('bluebird');var rs=require(_0x7951('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7951('0x3'));var logger=require(_0x7951('0x4'))('rpc');var config=require(_0x7951('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7951('0x6')][_0x7951('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4804c1,_0x108541,_0x261d9f){return new BPromise(function(_0x4799b8,_0xb31e55){return client[_0x7951('0x8')](_0x4804c1,_0x261d9f)[_0x7951('0x9')](function(_0x2002b7){logger['info'](_0x7951('0xa'),_0x108541,_0x7951('0xb'));logger[_0x7951('0xc')](_0x7951('0xd'),_0x108541,_0x7951('0xb'),JSON[_0x7951('0xe')](_0x2002b7));if(_0x2002b7[_0x7951('0xf')]){if(_0x2002b7[_0x7951('0xf')][_0x7951('0x10')]===0x1f4){logger[_0x7951('0xf')](_0x7951('0xa'),_0x108541,_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);return _0xb31e55(_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);}logger[_0x7951('0xf')](_0x7951('0xa'),_0x108541,_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);return _0x4799b8(_0x2002b7[_0x7951('0xf')][_0x7951('0x11')]);}else{logger[_0x7951('0x12')](_0x7951('0xa'),_0x108541,_0x7951('0xb'));_0x4799b8(_0x2002b7[_0x7951('0x13')][_0x7951('0x11')]);}})['catch'](function(_0x3b53d5){logger[_0x7951('0xf')](_0x7951('0xa'),_0x108541,_0x3b53d5);_0xb31e55(_0x3b53d5);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index b41b4d9..c09de92 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 _0x5e11=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','/:id','update','delete','destroy','exports','multer','path','express'];(function(_0x789179,_0x455e5f){var _0x10878f=function(_0x450629){while(--_0x450629){_0x789179['push'](_0x789179['shift']());}};_0x10878f(++_0x455e5f);}(_0x5e11,0x1a6));var _0x15e1=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x5e11[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0x15e1('0x0'));var util=require('util');var path=require(_0x15e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x15e1('0x2'));var router=express[_0x15e1('0x3')]();var fs_extra=require(_0x15e1('0x4'));var auth=require(_0x15e1('0x5'));var interaction=require(_0x15e1('0x6'));var config=require(_0x15e1('0x7'));var controller=require(_0x15e1('0x8'));router['get']('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0xa')]);router[_0x15e1('0xb')]('/:id',auth[_0x15e1('0x9')](),controller[_0x15e1('0xc')]);router[_0x15e1('0xb')](_0x15e1('0xd'),auth['isAuthenticated'](),controller[_0x15e1('0xe')]);router['get'](_0x15e1('0xf'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x10')]);router['get'](_0x15e1('0x11'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x12')]);router['post']('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0x13')]);router['put'](_0x15e1('0x14'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x15')]);router[_0x15e1('0x16')](_0x15e1('0x14'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x17')]);module[_0x15e1('0x18')]=router;
\ No newline at end of file
+var _0xc599=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create'];(function(_0x54ffb6,_0x503f04){var _0x1ce6b2=function(_0x41351a){while(--_0x41351a){_0x54ffb6['push'](_0x54ffb6['shift']());}};_0x1ce6b2(++_0x503f04);}(_0xc599,0x123));var _0x9c59=function(_0x51be7f,_0xd159f3){_0x51be7f=_0x51be7f-0x0;var _0x58f88c=_0xc599[_0x51be7f];return _0x58f88c;};'use strict';var multer=require(_0x9c59('0x0'));var util=require(_0x9c59('0x1'));var path=require(_0x9c59('0x2'));var timeout=require(_0x9c59('0x3'));var express=require(_0x9c59('0x4'));var router=express[_0x9c59('0x5')]();var fs_extra=require(_0x9c59('0x6'));var auth=require(_0x9c59('0x7'));var interaction=require(_0x9c59('0x8'));var config=require('../../config/environment');var controller=require(_0x9c59('0x9'));router[_0x9c59('0xa')]('/',auth[_0x9c59('0xb')](),controller[_0x9c59('0xc')]);router[_0x9c59('0xa')](_0x9c59('0xd'),auth[_0x9c59('0xb')](),controller[_0x9c59('0xe')]);router[_0x9c59('0xa')](_0x9c59('0xf'),auth[_0x9c59('0xb')](),controller['preview']);router[_0x9c59('0xa')](_0x9c59('0x10'),auth[_0x9c59('0xb')](),controller['run']);router[_0x9c59('0xa')](_0x9c59('0x11'),auth['isAuthenticated'](),controller[_0x9c59('0x12')]);router[_0x9c59('0x13')]('/',auth['isAuthenticated'](),controller[_0x9c59('0x14')]);router['put'](_0x9c59('0xd'),auth[_0x9c59('0xb')](),controller[_0x9c59('0x15')]);router[_0x9c59('0x16')](_0x9c59('0xd'),auth[_0x9c59('0xb')](),controller['destroy']);module[_0x9c59('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f3ddef8..5be4bd4 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 _0xa297=['sequelize','moment','exports','STRING','ENUM','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x43085b,_0x50aa9e){var _0x52e132=function(_0x3b60a7){while(--_0x3b60a7){_0x43085b['push'](_0x43085b['shift']());}};_0x52e132(++_0x50aa9e);}(_0xa297,0x1e1));var _0x7a29=function(_0x2cb79d,_0x13d34d){_0x2cb79d=_0x2cb79d-0x0;var _0x32dfdf=_0xa297[_0x2cb79d];return _0x32dfdf;};'use strict';var Sequelize=require(_0x7a29('0x0'));var moment=require(_0x7a29('0x1'));module[_0x7a29('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x7a29('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7a29('0x4')]('csv',_0x7a29('0x5'),_0x7a29('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7a29('0x7')]},'status':{'type':Sequelize[_0x7a29('0x3')],'defaultValue':_0x7a29('0x8')},'type':{'type':Sequelize[_0x7a29('0x4')]('manual',_0x7a29('0x9')),'allowNull':![],'defaultValue':_0x7a29('0xa')},'reportId':{'type':Sequelize[_0x7a29('0xb')](0xb)[_0x7a29('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2de1=['UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER'];(function(_0x35084e,_0x471ceb){var _0x3eaf60=function(_0x132052){while(--_0x132052){_0x35084e['push'](_0x35084e['shift']());}};_0x3eaf60(++_0x471ceb);}(_0x2de1,0x1ed));var _0x12de=function(_0x3dcf96,_0x400d95){_0x3dcf96=_0x3dcf96-0x0;var _0x5e1126=_0x2de1[_0x3dcf96];return _0x5e1126;};'use strict';var Sequelize=require(_0x12de('0x0'));var moment=require('moment');module[_0x12de('0x1')]={'name':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x12de('0x3')](_0x12de('0x4'),_0x12de('0x5'),_0x12de('0x6')),'allowNull':![],'defaultValue':_0x12de('0x4')},'savename':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x12de('0x7')]},'endDate':{'type':Sequelize[_0x12de('0x7')]},'status':{'type':Sequelize[_0x12de('0x2')],'defaultValue':_0x12de('0x8')},'type':{'type':Sequelize[_0x12de('0x3')](_0x12de('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x12de('0x9')},'reportId':{'type':Sequelize[_0x12de('0xa')](0xb)[_0x12de('0xb')]},'reportType':{'type':Sequelize[_0x12de('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7af6504..6da5002 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 _0x45b5=['count','set','Content-Range','apply','then','ExtractedReports','destroy','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit'];(function(_0x88baaa,_0x23707f){var _0x177141=function(_0x466732){while(--_0x466732){_0x88baaa['push'](_0x88baaa['shift']());}};_0x177141(++_0x23707f);}(_0x45b5,0xfc));var _0x545b=function(_0x2d1230,_0x49456e){_0x2d1230=_0x2d1230-0x0;var _0x56bcb0=_0x45b5[_0x2d1230];return _0x56bcb0;};'use strict';var emlformat=require(_0x545b('0x0'));var rimraf=require(_0x545b('0x1'));var zipdir=require(_0x545b('0x2'));var jsonpatch=require(_0x545b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x545b('0x4'));var Mustache=require(_0x545b('0x5'));var util=require(_0x545b('0x6'));var path=require(_0x545b('0x7'));var sox=require(_0x545b('0x8'));var csv=require(_0x545b('0x9'));var ejs=require(_0x545b('0xa'));var fs=require('fs');var fs_extra=require(_0x545b('0xb'));var _=require(_0x545b('0xc'));var squel=require(_0x545b('0xd'));var crypto=require(_0x545b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x545b('0xf'));var toCsv=require(_0x545b('0x9'));var querystring=require(_0x545b('0x10'));var Papa=require(_0x545b('0x11'));var Redis=require(_0x545b('0x12'));var authService=require(_0x545b('0x13'));var qs=require(_0x545b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x545b('0x15'));var logger=require(_0x545b('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x545b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155bb9,_0x41e737){_0x41e737=_0x41e737||0xcc;return function(_0x165329){if(_0x165329){return _0x155bb9[_0x545b('0x18')](_0x41e737);}return _0x155bb9[_0x545b('0x19')](_0x41e737)['end']();};}function respondWithResult(_0x41fb4d,_0x24aeaf){_0x24aeaf=_0x24aeaf||0xc8;return function(_0x42365e){if(_0x42365e){return _0x41fb4d[_0x545b('0x19')](_0x24aeaf)[_0x545b('0x1a')](_0x42365e);}};}function respondWithFilteredResult(_0xe7742c,_0x4b0bbd){return function(_0x26b74e){if(_0x26b74e){var _0x2fa49f=typeof _0x4b0bbd[_0x545b('0x1b')]===_0x545b('0x1c')&&typeof _0x4b0bbd[_0x545b('0x1d')]===_0x545b('0x1c');var _0x299178=_0x26b74e['count'];var _0x35e388=_0x2fa49f?0x0:_0x4b0bbd[_0x545b('0x1b')];var _0x3e079d=_0x2fa49f?_0x26b74e[_0x545b('0x1e')]:_0x4b0bbd['offset']+_0x4b0bbd[_0x545b('0x1d')];var _0x37eeeb;if(_0x3e079d>=_0x299178){_0x3e079d=_0x299178;_0x37eeeb=0xc8;}else{_0x37eeeb=0xce;}_0xe7742c[_0x545b('0x19')](_0x37eeeb);return _0xe7742c[_0x545b('0x1f')](_0x545b('0x20'),_0x35e388+'-'+_0x3e079d+'/'+_0x299178)[_0x545b('0x1a')](_0x26b74e);}return null;};}function patchUpdates(_0x152b6b){return function(_0x3c938f){try{jsonpatch[_0x545b('0x21')](_0x3c938f,_0x152b6b,!![]);}catch(_0x42cc7e){return BPromise['reject'](_0x42cc7e);}return _0x3c938f['save']();};}function saveUpdates(_0x490069,_0x1055f8){return function(_0x255f3d){if(_0x255f3d){return _0x255f3d['update'](_0x490069)[_0x545b('0x22')](function(_0x321733){return _0x321733;});}return null;};}function removeEntity(_0x333166,_0x2202c5){return function(_0x2140e5){if(_0x2140e5){return _0x2140e5['destroy']()[_0x545b('0x22')](function(){var _0x49123c=_0x2140e5['get']({'plain':!![]});var _0x453e1c=_0x545b('0x23');return db['UserProfileResource'][_0x545b('0x24')]({'where':{'type':_0x453e1c,'resourceId':_0x49123c['id']}})[_0x545b('0x22')](function(){return _0x2140e5;});})['then'](function(){_0x333166[_0x545b('0x19')](0xcc)[_0x545b('0x25')]();});}};}function handleEntityNotFound(_0x57393f,_0x155834){return function(_0x2e0473){if(!_0x2e0473){_0x57393f[_0x545b('0x18')](0x194);}return _0x2e0473;};}function handleError(_0x2bbd3a,_0x8fe2bb){_0x8fe2bb=_0x8fe2bb||0x1f4;return function(_0x128480){logger[_0x545b('0x26')](_0x128480[_0x545b('0x27')]);if(_0x128480[_0x545b('0x28')]){delete _0x128480['name'];}_0x2bbd3a[_0x545b('0x19')](_0x8fe2bb)[_0x545b('0x29')](_0x128480);};}exports[_0x545b('0x2a')]=function(_0x22ef0a,_0x21c93c){var _0x562dd3={},_0x41225b={},_0x393c39={'count':0x0,'rows':[]};var _0x22e1ee=_[_0x545b('0x2b')](db[_0x545b('0x2c')][_0x545b('0x2d')],function(_0x580c53){return{'name':_0x580c53['fieldName'],'type':_0x580c53[_0x545b('0x2e')][_0x545b('0x2f')]};});_0x41225b[_0x545b('0x30')]=_[_0x545b('0x2b')](_0x22e1ee,_0x545b('0x28'));_0x41225b[_0x545b('0x31')]=_[_0x545b('0x32')](_0x22ef0a[_0x545b('0x31')]);_0x41225b[_0x545b('0x33')]=_[_0x545b('0x34')](_0x41225b[_0x545b('0x30')],_0x41225b[_0x545b('0x31')]);_0x562dd3[_0x545b('0x35')]=_['intersection'](_0x41225b[_0x545b('0x30')],qs[_0x545b('0x36')](_0x22ef0a[_0x545b('0x31')][_0x545b('0x36')]));_0x562dd3[_0x545b('0x35')]=_0x562dd3['attributes'][_0x545b('0x37')]?_0x562dd3[_0x545b('0x35')]:_0x41225b[_0x545b('0x30')];if(!_0x22ef0a[_0x545b('0x31')][_0x545b('0x38')](_0x545b('0x39'))){_0x562dd3[_0x545b('0x1d')]=qs['limit'](_0x22ef0a[_0x545b('0x31')][_0x545b('0x1d')]);_0x562dd3['offset']=qs[_0x545b('0x1b')](_0x22ef0a['query']['offset']);}_0x562dd3[_0x545b('0x3a')]=qs[_0x545b('0x3b')](_0x22ef0a[_0x545b('0x31')]['sort']);_0x562dd3[_0x545b('0x3c')]=qs[_0x545b('0x33')](_['pick'](_0x22ef0a[_0x545b('0x31')],_0x41225b[_0x545b('0x33')]),_0x22e1ee);if(_0x22ef0a[_0x545b('0x31')][_0x545b('0x3d')]){_0x562dd3['where']=_[_0x545b('0x3e')](_0x562dd3[_0x545b('0x3c')],{'$or':_[_0x545b('0x2b')](_0x22e1ee,function(_0x549d41){if(_0x549d41[_0x545b('0x2e')]!==_0x545b('0x3f')){var _0x4af0e0={};_0x4af0e0[_0x549d41[_0x545b('0x28')]]={'$like':'%'+_0x22ef0a[_0x545b('0x31')][_0x545b('0x3d')]+'%'};return _0x4af0e0;}})});}_0x562dd3=_['merge']({},_0x562dd3,_0x22ef0a['options']);var _0x69b2ab={'where':_0x562dd3[_0x545b('0x3c')]};return db[_0x545b('0x2c')][_0x545b('0x1e')](_0x69b2ab)['then'](function(_0x2eb71a){_0x393c39[_0x545b('0x1e')]=_0x2eb71a;if(_0x22ef0a[_0x545b('0x31')][_0x545b('0x40')]){_0x562dd3['include']=[{'all':!![]}];}return db[_0x545b('0x2c')][_0x545b('0x41')](_0x562dd3);})[_0x545b('0x22')](function(_0x5c68e1){_0x393c39[_0x545b('0x42')]=_0x5c68e1;return _0x393c39;})[_0x545b('0x22')](respondWithFilteredResult(_0x21c93c,_0x562dd3))[_0x545b('0x43')](handleError(_0x21c93c,null));};exports[_0x545b('0x44')]=function(_0x47e849,_0x5e76db){var _0x3e75b5={'raw':!![],'where':{'id':_0x47e849['params']['id']}},_0x2e693c={};_0x2e693c['model']=_['keys'](db[_0x545b('0x2c')][_0x545b('0x2d')]);_0x2e693c[_0x545b('0x31')]=_[_0x545b('0x32')](_0x47e849[_0x545b('0x31')]);_0x2e693c[_0x545b('0x33')]=_[_0x545b('0x34')](_0x2e693c['model'],_0x2e693c[_0x545b('0x31')]);_0x3e75b5['attributes']=_[_0x545b('0x34')](_0x2e693c[_0x545b('0x30')],qs[_0x545b('0x36')](_0x47e849['query'][_0x545b('0x36')]));_0x3e75b5['attributes']=_0x3e75b5[_0x545b('0x35')][_0x545b('0x37')]?_0x3e75b5[_0x545b('0x35')]:_0x2e693c[_0x545b('0x30')];if(_0x47e849[_0x545b('0x31')][_0x545b('0x40')]){_0x3e75b5[_0x545b('0x45')]=[{'all':!![]}];}_0x3e75b5=_[_0x545b('0x3e')]({},_0x3e75b5,_0x47e849[_0x545b('0x46')]);return db[_0x545b('0x2c')][_0x545b('0x47')](_0x3e75b5)['then'](handleEntityNotFound(_0x5e76db,null))['then'](respondWithResult(_0x5e76db,null))[_0x545b('0x43')](handleError(_0x5e76db,null));};exports[_0x545b('0x48')]=function(_0x2f9cfb,_0x369968){return db[_0x545b('0x2c')][_0x545b('0x48')](_0x2f9cfb['body'],{})[_0x545b('0x22')](function(_0x3e5a94){var _0x4e90aa=_0x2f9cfb[_0x545b('0x49')]['get']({'plain':!![]});if(!_0x4e90aa)throw new Error(_0x545b('0x4a'));if(_0x4e90aa[_0x545b('0x4b')]===_0x545b('0x49')){var _0x53393c=_0x3e5a94['get']({'plain':!![]});var _0x5c3e8f=_0x545b('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x5c3e8f,'userProfileId':_0x4e90aa[_0x545b('0x4c')]},'raw':!![]})['then'](function(_0x387456){if(_0x387456&&_0x387456[_0x545b('0x4d')]===0x0){return db[_0x545b('0x4e')][_0x545b('0x48')]({'name':_0x53393c['name'],'resourceId':_0x53393c['id'],'type':_0x387456[_0x545b('0x28')],'sectionId':_0x387456['id']},{})[_0x545b('0x22')](function(){return _0x3e5a94;});}else{return _0x3e5a94;}})[_0x545b('0x43')](function(_0x583b9d){logger[_0x545b('0x26')](_0x545b('0x4f'),_0x583b9d);throw _0x583b9d;});}return _0x3e5a94;})[_0x545b('0x22')](respondWithResult(_0x369968,0xc9))['catch'](handleError(_0x369968,null));};exports['update']=function(_0x47d6fa,_0x581f6a){if(_0x47d6fa[_0x545b('0x50')]['id']){delete _0x47d6fa[_0x545b('0x50')]['id'];}return db[_0x545b('0x2c')][_0x545b('0x47')]({'where':{'id':_0x47d6fa[_0x545b('0x51')]['id']}})['then'](handleEntityNotFound(_0x581f6a,null))['then'](saveUpdates(_0x47d6fa['body'],null))[_0x545b('0x22')](respondWithResult(_0x581f6a,null))['catch'](handleError(_0x581f6a,null));};exports[_0x545b('0x24')]=function(_0x2b609f,_0xadbeaf){return db[_0x545b('0x2c')]['find']({'where':{'id':_0x2b609f[_0x545b('0x51')]['id']}})['then'](handleEntityNotFound(_0xadbeaf,null))[_0x545b('0x22')](removeEntity(_0xadbeaf,null))[_0x545b('0x43')](handleError(_0xadbeaf,null));};exports[_0x545b('0x52')]=function(_0x67b809,_0x1e0ac2,_0x2fe8f7){return db[_0x545b('0x2c')]['find']({'where':{'id':_0x67b809[_0x545b('0x51')]['id']},'attributes':['name',_0x545b('0x53'),_0x545b('0x54'),_0x545b('0x55')],'raw':!![]})[_0x545b('0x22')](handleEntityNotFound(_0x1e0ac2,null))[_0x545b('0x22')](function(_0x374695){if(_0x374695){if(!fs['existsSync'](path[_0x545b('0x56')](config[_0x545b('0x57')],_0x545b('0x58'),_0x374695[_0x545b('0x54')]))){throw new db[(_0x545b('0x59'))]['ValidationError'](_0x545b('0x5a'));}if(_0x67b809[_0x545b('0x31')][_0x545b('0x5b')]){return _0x1e0ac2[_0x545b('0x18')](0xc8);}return _0x1e0ac2[_0x545b('0x52')](path[_0x545b('0x56')](config[_0x545b('0x57')],_0x545b('0x58'),_0x374695[_0x545b('0x54')]),util['format'](_0x545b('0x5c'),_0x374695[_0x545b('0x53')]||_0x374695[_0x545b('0x28')],_0x374695['output'][_0x545b('0x5d')]()));}})[_0x545b('0x43')](handleError(_0x1e0ac2,null));};
\ No newline at end of file
+var _0xbf26=['options','includeAll','include','findAll','rows','catch','rawAttributes','create','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','AnalyticExtractedReport','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name'];(function(_0x220fd6,_0x3466b8){var _0x15f951=function(_0xd2802b){while(--_0xd2802b){_0x220fd6['push'](_0x220fd6['shift']());}};_0x15f951(++_0x3466b8);}(_0xbf26,0x1a4));var _0x6bf2=function(_0x2abec0,_0x480ff3){_0x2abec0=_0x2abec0-0x0;var _0x4bf548=_0xbf26[_0x2abec0];return _0x4bf548;};'use strict';var emlformat=require(_0x6bf2('0x0'));var rimraf=require(_0x6bf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6bf2('0x2'));var moment=require(_0x6bf2('0x3'));var BPromise=require(_0x6bf2('0x4'));var Mustache=require(_0x6bf2('0x5'));var util=require(_0x6bf2('0x6'));var path=require(_0x6bf2('0x7'));var sox=require(_0x6bf2('0x8'));var csv=require(_0x6bf2('0x9'));var ejs=require(_0x6bf2('0xa'));var fs=require('fs');var fs_extra=require(_0x6bf2('0xb'));var _=require(_0x6bf2('0xc'));var squel=require('squel');var crypto=require(_0x6bf2('0xd'));var jsforce=require(_0x6bf2('0xe'));var deskjs=require(_0x6bf2('0xf'));var toCsv=require(_0x6bf2('0x9'));var querystring=require(_0x6bf2('0x10'));var Papa=require(_0x6bf2('0x11'));var Redis=require(_0x6bf2('0x12'));var authService=require(_0x6bf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6bf2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bf2('0x15'))(_0x6bf2('0x16'));var utils=require(_0x6bf2('0x17'));var config=require(_0x6bf2('0x18'));var licenseUtil=require(_0x6bf2('0x19'));var db=require(_0x6bf2('0x1a'))['db'];function respondWithStatusCode(_0x22f88c,_0x48ed67){_0x48ed67=_0x48ed67||0xcc;return function(_0x34d48d){if(_0x34d48d){return _0x22f88c[_0x6bf2('0x1b')](_0x48ed67);}return _0x22f88c[_0x6bf2('0x1c')](_0x48ed67)[_0x6bf2('0x1d')]();};}function respondWithResult(_0xa24380,_0x10f63f){_0x10f63f=_0x10f63f||0xc8;return function(_0xfffb2d){if(_0xfffb2d){return _0xa24380[_0x6bf2('0x1c')](_0x10f63f)['json'](_0xfffb2d);}};}function respondWithFilteredResult(_0x36ab5c,_0x15a215){return function(_0x11abd5){if(_0x11abd5){var _0x371d02=typeof _0x15a215[_0x6bf2('0x1e')]===_0x6bf2('0x1f')&&typeof _0x15a215[_0x6bf2('0x20')]===_0x6bf2('0x1f');var _0x3ddbc4=_0x11abd5[_0x6bf2('0x21')];var _0x3102f6=_0x371d02?0x0:_0x15a215['offset'];var _0x2e7912=_0x371d02?_0x11abd5[_0x6bf2('0x21')]:_0x15a215[_0x6bf2('0x1e')]+_0x15a215[_0x6bf2('0x20')];var _0x3c2442;if(_0x2e7912>=_0x3ddbc4){_0x2e7912=_0x3ddbc4;_0x3c2442=0xc8;}else{_0x3c2442=0xce;}_0x36ab5c[_0x6bf2('0x1c')](_0x3c2442);return _0x36ab5c[_0x6bf2('0x22')](_0x6bf2('0x23'),_0x3102f6+'-'+_0x2e7912+'/'+_0x3ddbc4)[_0x6bf2('0x24')](_0x11abd5);}return null;};}function patchUpdates(_0x280506){return function(_0x511fe9){try{jsonpatch[_0x6bf2('0x25')](_0x511fe9,_0x280506,!![]);}catch(_0x22b095){return BPromise[_0x6bf2('0x26')](_0x22b095);}return _0x511fe9[_0x6bf2('0x27')]();};}function saveUpdates(_0x746e99,_0x217534){return function(_0x38b179){if(_0x38b179){return _0x38b179[_0x6bf2('0x28')](_0x746e99)[_0x6bf2('0x29')](function(_0x3a4ad8){return _0x3a4ad8;});}return null;};}function removeEntity(_0x21f41e,_0x596828){return function(_0x1695e0){if(_0x1695e0){return _0x1695e0[_0x6bf2('0x2a')]()[_0x6bf2('0x29')](function(){var _0x458612=_0x1695e0[_0x6bf2('0x2b')]({'plain':!![]});var _0x4d627e='ExtractedReports';return db[_0x6bf2('0x2c')][_0x6bf2('0x2a')]({'where':{'type':_0x4d627e,'resourceId':_0x458612['id']}})[_0x6bf2('0x29')](function(){return _0x1695e0;});})[_0x6bf2('0x29')](function(){_0x21f41e[_0x6bf2('0x1c')](0xcc)[_0x6bf2('0x1d')]();});}};}function handleEntityNotFound(_0x31f042,_0x5f532c){return function(_0x3fae7a){if(!_0x3fae7a){_0x31f042['sendStatus'](0x194);}return _0x3fae7a;};}function handleError(_0x15cd5a,_0x6410a8){_0x6410a8=_0x6410a8||0x1f4;return function(_0x2c451d){logger[_0x6bf2('0x2d')](_0x2c451d[_0x6bf2('0x2e')]);if(_0x2c451d['name']){delete _0x2c451d['name'];}_0x15cd5a[_0x6bf2('0x1c')](_0x6410a8)[_0x6bf2('0x2f')](_0x2c451d);};}exports[_0x6bf2('0x30')]=function(_0x143c3e,_0x12d632){var _0x4a8410={},_0x5b83e7={},_0x4f7ccd={'count':0x0,'rows':[]};var _0x629c0f=_[_0x6bf2('0x31')](db[_0x6bf2('0x32')]['rawAttributes'],function(_0x23092d){return{'name':_0x23092d['fieldName'],'type':_0x23092d[_0x6bf2('0x33')]['key']};});_0x5b83e7[_0x6bf2('0x34')]=_[_0x6bf2('0x31')](_0x629c0f,'name');_0x5b83e7[_0x6bf2('0x35')]=_[_0x6bf2('0x36')](_0x143c3e['query']);_0x5b83e7[_0x6bf2('0x37')]=_[_0x6bf2('0x38')](_0x5b83e7[_0x6bf2('0x34')],_0x5b83e7[_0x6bf2('0x35')]);_0x4a8410[_0x6bf2('0x39')]=_[_0x6bf2('0x38')](_0x5b83e7[_0x6bf2('0x34')],qs[_0x6bf2('0x3a')](_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x3a')]));_0x4a8410[_0x6bf2('0x39')]=_0x4a8410[_0x6bf2('0x39')][_0x6bf2('0x3b')]?_0x4a8410[_0x6bf2('0x39')]:_0x5b83e7[_0x6bf2('0x34')];if(!_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x3c')](_0x6bf2('0x3d'))){_0x4a8410[_0x6bf2('0x20')]=qs[_0x6bf2('0x20')](_0x143c3e['query'][_0x6bf2('0x20')]);_0x4a8410['offset']=qs[_0x6bf2('0x1e')](_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x1e')]);}_0x4a8410[_0x6bf2('0x3e')]=qs[_0x6bf2('0x3f')](_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x3f')]);_0x4a8410['where']=qs[_0x6bf2('0x37')](_[_0x6bf2('0x40')](_0x143c3e[_0x6bf2('0x35')],_0x5b83e7[_0x6bf2('0x37')]),_0x629c0f);if(_0x143c3e['query'][_0x6bf2('0x41')]){_0x4a8410[_0x6bf2('0x42')]=_[_0x6bf2('0x43')](_0x4a8410[_0x6bf2('0x42')],{'$or':_[_0x6bf2('0x31')](_0x629c0f,function(_0x197ec6){if(_0x197ec6['type']!==_0x6bf2('0x44')){var _0xfe99b8={};_0xfe99b8[_0x197ec6[_0x6bf2('0x45')]]={'$like':'%'+_0x143c3e['query'][_0x6bf2('0x41')]+'%'};return _0xfe99b8;}})});}_0x4a8410=_['merge']({},_0x4a8410,_0x143c3e[_0x6bf2('0x46')]);var _0x5f503d={'where':_0x4a8410[_0x6bf2('0x42')]};return db[_0x6bf2('0x32')][_0x6bf2('0x21')](_0x5f503d)['then'](function(_0x3984c6){_0x4f7ccd[_0x6bf2('0x21')]=_0x3984c6;if(_0x143c3e[_0x6bf2('0x35')][_0x6bf2('0x47')]){_0x4a8410[_0x6bf2('0x48')]=[{'all':!![]}];}return db[_0x6bf2('0x32')][_0x6bf2('0x49')](_0x4a8410);})['then'](function(_0x13e27d){_0x4f7ccd[_0x6bf2('0x4a')]=_0x13e27d;return _0x4f7ccd;})[_0x6bf2('0x29')](respondWithFilteredResult(_0x12d632,_0x4a8410))[_0x6bf2('0x4b')](handleError(_0x12d632,null));};exports['show']=function(_0x47b56c,_0x1d06fb){var _0x3f57d5={'raw':!![],'where':{'id':_0x47b56c['params']['id']}},_0x1a745c={};_0x1a745c['model']=_[_0x6bf2('0x36')](db[_0x6bf2('0x32')][_0x6bf2('0x4c')]);_0x1a745c[_0x6bf2('0x35')]=_[_0x6bf2('0x36')](_0x47b56c[_0x6bf2('0x35')]);_0x1a745c['filters']=_[_0x6bf2('0x38')](_0x1a745c[_0x6bf2('0x34')],_0x1a745c[_0x6bf2('0x35')]);_0x3f57d5['attributes']=_['intersection'](_0x1a745c[_0x6bf2('0x34')],qs[_0x6bf2('0x3a')](_0x47b56c[_0x6bf2('0x35')]['fields']));_0x3f57d5[_0x6bf2('0x39')]=_0x3f57d5[_0x6bf2('0x39')][_0x6bf2('0x3b')]?_0x3f57d5[_0x6bf2('0x39')]:_0x1a745c[_0x6bf2('0x34')];if(_0x47b56c[_0x6bf2('0x35')][_0x6bf2('0x47')]){_0x3f57d5['include']=[{'all':!![]}];}_0x3f57d5=_['merge']({},_0x3f57d5,_0x47b56c[_0x6bf2('0x46')]);return db[_0x6bf2('0x32')]['find'](_0x3f57d5)[_0x6bf2('0x29')](handleEntityNotFound(_0x1d06fb,null))[_0x6bf2('0x29')](respondWithResult(_0x1d06fb,null))[_0x6bf2('0x4b')](handleError(_0x1d06fb,null));};exports[_0x6bf2('0x4d')]=function(_0x4ad030,_0x28cb8f){return db['AnalyticExtractedReport'][_0x6bf2('0x4d')](_0x4ad030['body'],{})['then'](function(_0x15b526){var _0x1d0d2f=_0x4ad030[_0x6bf2('0x4e')]['get']({'plain':!![]});if(!_0x1d0d2f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d0d2f['role']===_0x6bf2('0x4e')){var _0x24bc3e=_0x15b526[_0x6bf2('0x2b')]({'plain':!![]});var _0x4b1f10='ExtractedReports';return db[_0x6bf2('0x4f')][_0x6bf2('0x50')]({'where':{'name':_0x4b1f10,'userProfileId':_0x1d0d2f[_0x6bf2('0x51')]},'raw':!![]})['then'](function(_0x1aa8bb){if(_0x1aa8bb&&_0x1aa8bb[_0x6bf2('0x52')]===0x0){return db[_0x6bf2('0x2c')][_0x6bf2('0x4d')]({'name':_0x24bc3e['name'],'resourceId':_0x24bc3e['id'],'type':_0x1aa8bb[_0x6bf2('0x45')],'sectionId':_0x1aa8bb['id']},{})['then'](function(){return _0x15b526;});}else{return _0x15b526;}})[_0x6bf2('0x4b')](function(_0x59167f){logger[_0x6bf2('0x2d')](_0x6bf2('0x53'),_0x59167f);throw _0x59167f;});}return _0x15b526;})[_0x6bf2('0x29')](respondWithResult(_0x28cb8f,0xc9))['catch'](handleError(_0x28cb8f,null));};exports['update']=function(_0x396699,_0x56064a){if(_0x396699[_0x6bf2('0x54')]['id']){delete _0x396699[_0x6bf2('0x54')]['id'];}return db[_0x6bf2('0x32')][_0x6bf2('0x50')]({'where':{'id':_0x396699['params']['id']}})[_0x6bf2('0x29')](handleEntityNotFound(_0x56064a,null))[_0x6bf2('0x29')](saveUpdates(_0x396699[_0x6bf2('0x54')],null))[_0x6bf2('0x29')](respondWithResult(_0x56064a,null))[_0x6bf2('0x4b')](handleError(_0x56064a,null));};exports[_0x6bf2('0x2a')]=function(_0x98898f,_0x12a887){return db[_0x6bf2('0x32')][_0x6bf2('0x50')]({'where':{'id':_0x98898f[_0x6bf2('0x55')]['id']}})[_0x6bf2('0x29')](handleEntityNotFound(_0x12a887,null))['then'](removeEntity(_0x12a887,null))[_0x6bf2('0x4b')](handleError(_0x12a887,null));};exports['download']=function(_0x1c11c3,_0x55c046,_0x8c7669){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1c11c3[_0x6bf2('0x55')]['id']},'attributes':[_0x6bf2('0x45'),_0x6bf2('0x56'),_0x6bf2('0x57'),_0x6bf2('0x58')],'raw':!![]})[_0x6bf2('0x29')](handleEntityNotFound(_0x55c046,null))[_0x6bf2('0x29')](function(_0x11ef19){if(_0x11ef19){if(!fs[_0x6bf2('0x59')](path[_0x6bf2('0x5a')](config[_0x6bf2('0x5b')],'server/files/reports',_0x11ef19[_0x6bf2('0x57')]))){throw new db[(_0x6bf2('0x5c'))][(_0x6bf2('0x5d'))](_0x6bf2('0x5e'));}if(_0x1c11c3[_0x6bf2('0x35')][_0x6bf2('0x5f')]){return _0x55c046['sendStatus'](0xc8);}return _0x55c046[_0x6bf2('0x60')](path[_0x6bf2('0x5a')](config['root'],'server/files/reports',_0x11ef19[_0x6bf2('0x57')]),util[_0x6bf2('0x61')]('%s.%s',_0x11ef19[_0x6bf2('0x56')]||_0x11ef19['name'],_0x11ef19[_0x6bf2('0x58')]['toLowerCase']()));}})[_0x6bf2('0x4b')](handleError(_0x55c046,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 6aca402..0863c6b 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 _0x70df=['path','rimraf','../../config/environment','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c0b53,_0x34cdd3){var _0x48246a=function(_0x314dbc){while(--_0x314dbc){_0x3c0b53['push'](_0x3c0b53['shift']());}};_0x48246a(++_0x34cdd3);}(_0x70df,0x192));var _0xf70d=function(_0x2c8805,_0x320e32){_0x2c8805=_0x2c8805-0x0;var _0x31fd9f=_0x70df[_0x2c8805];return _0x31fd9f;};'use strict';var _=require('lodash');var util=require(_0xf70d('0x0'));var logger=require(_0xf70d('0x1'))(_0xf70d('0x2'));var moment=require(_0xf70d('0x3'));var BPromise=require(_0xf70d('0x4'));var rp=require(_0xf70d('0x5'));var fs=require('fs');var path=require(_0xf70d('0x6'));var rimraf=require(_0xf70d('0x7'));var config=require(_0xf70d('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf70d('0x9')]=function(_0x52d7d2,_0x9896c1){return _0x52d7d2[_0xf70d('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xf70d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x290d=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x36b072,_0xaf2687){var _0x32de4e=function(_0x197a30){while(--_0x197a30){_0x36b072['push'](_0x36b072['shift']());}};_0x32de4e(++_0xaf2687);}(_0x290d,0x177));var _0xd290=function(_0x3d201d,_0x4fb09b){_0x3d201d=_0x3d201d-0x0;var _0x53d923=_0x290d[_0x3d201d];return _0x53d923;};'use strict';var _=require(_0xd290('0x0'));var util=require('util');var logger=require(_0xd290('0x1'))(_0xd290('0x2'));var moment=require('moment');var BPromise=require(_0xd290('0x3'));var rp=require(_0xd290('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd290('0x5'));var config=require(_0xd290('0x6'));var attributes=require(_0xd290('0x7'));module[_0xd290('0x8')]=function(_0x4a45bb,_0x362cad){return _0x4a45bb[_0xd290('0x9')](_0xd290('0xa'),attributes,{'tableName':_0xd290('0xb'),'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 73ef17f..0c502cf 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 _0x256e=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c1489,_0x167dfa){var _0xff0770=function(_0x1bbfa1){while(--_0x1bbfa1){_0x1c1489['push'](_0x1c1489['shift']());}};_0xff0770(++_0x167dfa);}(_0x256e,0x176));var _0xe256=function(_0x2d40b9,_0x2aa430){_0x2d40b9=_0x2d40b9-0x0;var _0x118c40=_0x256e[_0x2d40b9];return _0x118c40;};'use strict';var _=require(_0xe256('0x0'));var util=require(_0xe256('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe256('0x2'));var fs=require('fs');var Redis=require(_0xe256('0x3'));var db=require(_0xe256('0x4'))['db'];var utils=require(_0xe256('0x5'));var logger=require(_0xe256('0x6'))(_0xe256('0x7'));var config=require(_0xe256('0x8'));var jayson=require(_0xe256('0x9'));var client=jayson[_0xe256('0xa')][_0xe256('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdfe79,_0x1ee628,_0x3646d0){return new BPromise(function(_0x4e9e9a,_0x429fc0){return client['request'](_0xdfe79,_0x3646d0)[_0xe256('0xc')](function(_0x4ea116){logger[_0xe256('0xd')](_0xe256('0xe'),_0x1ee628,_0xe256('0xf'));logger[_0xe256('0x10')](_0xe256('0x11'),_0x1ee628,'request\x20sent',JSON[_0xe256('0x12')](_0x4ea116));if(_0x4ea116[_0xe256('0x13')]){if(_0x4ea116[_0xe256('0x13')]['code']===0x1f4){logger[_0xe256('0x13')](_0xe256('0xe'),_0x1ee628,_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);return _0x429fc0(_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);}logger[_0xe256('0x13')](_0xe256('0xe'),_0x1ee628,_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);return _0x4e9e9a(_0x4ea116[_0xe256('0x13')][_0xe256('0x14')]);}else{logger[_0xe256('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1ee628,'request\x20sent');_0x4e9e9a(_0x4ea116[_0xe256('0x15')][_0xe256('0x14')]);}})[_0xe256('0x16')](function(_0x4c8f05){logger[_0xe256('0x13')](_0xe256('0xe'),_0x1ee628,_0x4c8f05);_0x429fc0(_0x4c8f05);});});}
\ No newline at end of file
+var _0x5216=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x3fb2d4,_0x44a3a8){var _0x4cfd9a=function(_0x35f723){while(--_0x35f723){_0x3fb2d4['push'](_0x3fb2d4['shift']());}};_0x4cfd9a(++_0x44a3a8);}(_0x5216,0x165));var _0x6521=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5216[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x6521('0x0'));var moment=require(_0x6521('0x1'));var BPromise=require(_0x6521('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6521('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6521('0x4'))('rpc');var config=require(_0x6521('0x5'));var jayson=require(_0x6521('0x6'));var client=jayson['client'][_0x6521('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54ebf2,_0xb493b8,_0x570d63){return new BPromise(function(_0x359d3b,_0x375406){return client[_0x6521('0x8')](_0x54ebf2,_0x570d63)[_0x6521('0x9')](function(_0x594f32){logger[_0x6521('0xa')](_0x6521('0xb'),_0xb493b8,_0x6521('0xc'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xb493b8,_0x6521('0xc'),JSON[_0x6521('0xd')](_0x594f32));if(_0x594f32[_0x6521('0xe')]){if(_0x594f32[_0x6521('0xe')][_0x6521('0xf')]===0x1f4){logger[_0x6521('0xe')](_0x6521('0xb'),_0xb493b8,_0x594f32[_0x6521('0xe')][_0x6521('0x10')]);return _0x375406(_0x594f32[_0x6521('0xe')][_0x6521('0x10')]);}logger[_0x6521('0xe')](_0x6521('0xb'),_0xb493b8,_0x594f32['error'][_0x6521('0x10')]);return _0x359d3b(_0x594f32[_0x6521('0xe')][_0x6521('0x10')]);}else{logger[_0x6521('0xa')](_0x6521('0xb'),_0xb493b8,_0x6521('0xc'));_0x359d3b(_0x594f32[_0x6521('0x11')][_0x6521('0x10')]);}})[_0x6521('0x12')](function(_0x42faab){logger[_0x6521('0xe')](_0x6521('0xb'),_0xb493b8,_0x42faab);_0x375406(_0x42faab);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 1ad3a9f..b47a8b1 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 _0xc775=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','exports','multer'];(function(_0x1fff57,_0x143cee){var _0x43cc66=function(_0x4e812d){while(--_0x4e812d){_0x1fff57['push'](_0x1fff57['shift']());}};_0x43cc66(++_0x143cee);}(_0xc775,0x1da));var _0x5c77=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc775[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x5c77('0x0'));var util=require(_0x5c77('0x1'));var path=require('path');var timeout=require(_0x5c77('0x2'));var express=require(_0x5c77('0x3'));var router=express[_0x5c77('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5c77('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5c77('0x6'));var controller=require(_0x5c77('0x7'));router[_0x5c77('0x8')]('/',auth[_0x5c77('0x9')](),controller[_0x5c77('0xa')]);router['get'](_0x5c77('0xb'),auth[_0x5c77('0x9')](),controller[_0x5c77('0xc')]);router['get'](_0x5c77('0xd'),auth[_0x5c77('0x9')](),controller[_0x5c77('0xe')]);router[_0x5c77('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c77('0x10')](_0x5c77('0xb'),auth['isAuthenticated'](),controller[_0x5c77('0x11')]);router['delete'](_0x5c77('0xb'),auth[_0x5c77('0x9')](),controller['destroy']);module[_0x5c77('0x12')]=router;
\ No newline at end of file
+var _0xe430=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24e056,_0x257d1a){var _0x57b6ea=function(_0x2c9843){while(--_0x2c9843){_0x24e056['push'](_0x24e056['shift']());}};_0x57b6ea(++_0x257d1a);}(_0xe430,0x1da));var _0x0e43=function(_0x18edfe,_0x4060e1){_0x18edfe=_0x18edfe-0x0;var _0x31fabe=_0xe430[_0x18edfe];return _0x31fabe;};'use strict';var multer=require(_0x0e43('0x0'));var util=require(_0x0e43('0x1'));var path=require(_0x0e43('0x2'));var timeout=require(_0x0e43('0x3'));var express=require(_0x0e43('0x4'));var router=express[_0x0e43('0x5')]();var fs_extra=require(_0x0e43('0x6'));var auth=require(_0x0e43('0x7'));var interaction=require(_0x0e43('0x8'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x0e43('0x9')]('/',auth[_0x0e43('0xa')](),controller[_0x0e43('0xb')]);router[_0x0e43('0x9')](_0x0e43('0xc'),auth['isAuthenticated'](),controller[_0x0e43('0xd')]);router[_0x0e43('0x9')](_0x0e43('0xe'),auth[_0x0e43('0xa')](),controller[_0x0e43('0xf')]);router[_0x0e43('0x10')]('/',auth[_0x0e43('0xa')](),controller[_0x0e43('0x11')]);router[_0x0e43('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0e43('0x13')]);router[_0x0e43('0x14')]('/:id',auth[_0x0e43('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index cdc0681..a8dabe6 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 _0xa4bf=['TEXT','STRING','sequelize','exports'];(function(_0x24e73d,_0x4ae5c9){var _0x1a2199=function(_0x2c0c34){while(--_0x2c0c34){_0x24e73d['push'](_0x24e73d['shift']());}};_0x1a2199(++_0x4ae5c9);}(_0xa4bf,0x6a));var _0xfa4b=function(_0xc7a0cb,_0x389964){_0xc7a0cb=_0xc7a0cb-0x0;var _0x10ce8e=_0xa4bf[_0xc7a0cb];return _0x10ce8e;};'use strict';var Sequelize=require(_0xfa4b('0x0'));module[_0xfa4b('0x1')]={'field':{'type':Sequelize[_0xfa4b('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xfa4b('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa4b('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xebd8=['STRING','BOOLEAN','sequelize','exports'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xebd8,0xf2));var _0x8ebd=function(_0x5b7b11,_0x5833b0){_0x5b7b11=_0x5b7b11-0x0;var _0x31374a=_0xebd8[_0x5b7b11];return _0x31374a;};'use strict';var Sequelize=require(_0x8ebd('0x0'));module[_0x8ebd('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x8ebd('0x2')]},'groupBy':{'type':Sequelize[_0x8ebd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8ebd('0x2')]},'custom':{'type':Sequelize[_0x8ebd('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4a943ce..30e8317 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 _0x838c=['type','model','query','keys','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','filters','includeAll','find','catch','create','body','bulkCreate','params','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','map','AnalyticFieldReport','rawAttributes'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x838c,0xb1));var _0xc838=function(_0x37b35d,_0x405b32){_0x37b35d=_0x37b35d-0x0;var _0x5762f9=_0x838c[_0x37b35d];return _0x5762f9;};'use strict';var emlformat=require(_0xc838('0x0'));var rimraf=require(_0xc838('0x1'));var zipdir=require(_0xc838('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc838('0x3'));var Mustache=require('mustache');var util=require(_0xc838('0x4'));var path=require(_0xc838('0x5'));var sox=require(_0xc838('0x6'));var csv=require('to-csv');var ejs=require(_0xc838('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc838('0x8'));var squel=require('squel');var crypto=require(_0xc838('0x9'));var jsforce=require(_0xc838('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc838('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc838('0xc'));var as=require(_0xc838('0xd'));var hardwareService=require(_0xc838('0xe'));var logger=require(_0xc838('0xf'))(_0xc838('0x10'));var utils=require(_0xc838('0x11'));var config=require(_0xc838('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc838('0x13'))['db'];function respondWithStatusCode(_0x2607c6,_0x29bae6){_0x29bae6=_0x29bae6||0xcc;return function(_0x4ad5ed){if(_0x4ad5ed){return _0x2607c6[_0xc838('0x14')](_0x29bae6);}return _0x2607c6[_0xc838('0x15')](_0x29bae6)['end']();};}function respondWithResult(_0x3c5c98,_0x739d51){_0x739d51=_0x739d51||0xc8;return function(_0x17f902){if(_0x17f902){return _0x3c5c98[_0xc838('0x15')](_0x739d51)['json'](_0x17f902);}};}function respondWithFilteredResult(_0x102b29,_0x3ff8ae){return function(_0x937359){if(_0x937359){var _0x53ba92=typeof _0x3ff8ae['offset']===_0xc838('0x16')&&typeof _0x3ff8ae[_0xc838('0x17')]===_0xc838('0x16');var _0x5bfb71=_0x937359[_0xc838('0x18')];var _0x432537=_0x53ba92?0x0:_0x3ff8ae[_0xc838('0x19')];var _0x118cad=_0x53ba92?_0x937359['count']:_0x3ff8ae[_0xc838('0x19')]+_0x3ff8ae['limit'];var _0x45ad5b;if(_0x118cad>=_0x5bfb71){_0x118cad=_0x5bfb71;_0x45ad5b=0xc8;}else{_0x45ad5b=0xce;}_0x102b29[_0xc838('0x15')](_0x45ad5b);return _0x102b29[_0xc838('0x1a')](_0xc838('0x1b'),_0x432537+'-'+_0x118cad+'/'+_0x5bfb71)[_0xc838('0x1c')](_0x937359);}return null;};}function patchUpdates(_0x1cdbe3){return function(_0x1f22ea){try{jsonpatch[_0xc838('0x1d')](_0x1f22ea,_0x1cdbe3,!![]);}catch(_0x5e777e){return BPromise[_0xc838('0x1e')](_0x5e777e);}return _0x1f22ea[_0xc838('0x1f')]();};}function saveUpdates(_0x4af609,_0xe2c5a8){return function(_0x92e71e){if(_0x92e71e){return _0x92e71e['update'](_0x4af609)[_0xc838('0x20')](function(_0xb001ec){return _0xb001ec;});}return null;};}function removeEntity(_0x2725a2,_0x2d70af){return function(_0x3c39ac){if(_0x3c39ac){return _0x3c39ac[_0xc838('0x21')]()[_0xc838('0x20')](function(){_0x2725a2[_0xc838('0x15')](0xcc)[_0xc838('0x22')]();});}};}function handleEntityNotFound(_0xd613fb,_0x5880cb){return function(_0x37ba73){if(!_0x37ba73){_0xd613fb[_0xc838('0x14')](0x194);}return _0x37ba73;};}function handleError(_0x1b0452,_0x30391e){_0x30391e=_0x30391e||0x1f4;return function(_0xe4995f){logger[_0xc838('0x23')](_0xe4995f[_0xc838('0x24')]);if(_0xe4995f[_0xc838('0x25')]){delete _0xe4995f[_0xc838('0x25')];}_0x1b0452[_0xc838('0x15')](_0x30391e)[_0xc838('0x26')](_0xe4995f);};}exports['index']=function(_0x3f6a91,_0x42d5b6){var _0x1405fb={},_0x1fd114={},_0x17b560={'count':0x0,'rows':[]};var _0x147475=_[_0xc838('0x27')](db[_0xc838('0x28')][_0xc838('0x29')],function(_0x2fb217){return{'name':_0x2fb217['fieldName'],'type':_0x2fb217[_0xc838('0x2a')]['key']};});_0x1fd114[_0xc838('0x2b')]=_[_0xc838('0x27')](_0x147475,'name');_0x1fd114[_0xc838('0x2c')]=_[_0xc838('0x2d')](_0x3f6a91[_0xc838('0x2c')]);_0x1fd114['filters']=_[_0xc838('0x2e')](_0x1fd114[_0xc838('0x2b')],_0x1fd114[_0xc838('0x2c')]);_0x1405fb[_0xc838('0x2f')]=_[_0xc838('0x2e')](_0x1fd114[_0xc838('0x2b')],qs[_0xc838('0x30')](_0x3f6a91[_0xc838('0x2c')][_0xc838('0x30')]));_0x1405fb['attributes']=_0x1405fb[_0xc838('0x2f')][_0xc838('0x31')]?_0x1405fb[_0xc838('0x2f')]:_0x1fd114[_0xc838('0x2b')];if(!_0x3f6a91['query']['hasOwnProperty']('nolimit')){_0x1405fb[_0xc838('0x17')]=qs[_0xc838('0x17')](_0x3f6a91[_0xc838('0x2c')]['limit']);_0x1405fb['offset']=qs[_0xc838('0x19')](_0x3f6a91[_0xc838('0x2c')][_0xc838('0x19')]);}_0x1405fb[_0xc838('0x32')]=qs[_0xc838('0x33')](_0x3f6a91[_0xc838('0x2c')][_0xc838('0x33')]);_0x1405fb[_0xc838('0x34')]=qs['filters'](_[_0xc838('0x35')](_0x3f6a91[_0xc838('0x2c')],_0x1fd114['filters']),_0x147475);if(_0x3f6a91['query'][_0xc838('0x36')]){_0x1405fb[_0xc838('0x34')]=_[_0xc838('0x37')](_0x1405fb[_0xc838('0x34')],{'$or':_[_0xc838('0x27')](_0x147475,function(_0x145336){if(_0x145336[_0xc838('0x2a')]!=='VIRTUAL'){var _0x2857f6={};_0x2857f6[_0x145336['name']]={'$like':'%'+_0x3f6a91[_0xc838('0x2c')][_0xc838('0x36')]+'%'};return _0x2857f6;}})});}_0x1405fb=_['merge']({},_0x1405fb,_0x3f6a91[_0xc838('0x38')]);var _0x123d6e={'where':_0x1405fb[_0xc838('0x34')]};return db[_0xc838('0x28')]['count'](_0x123d6e)[_0xc838('0x20')](function(_0x2733bc){_0x17b560['count']=_0x2733bc;if(_0x3f6a91['query']['includeAll']){_0x1405fb[_0xc838('0x39')]=[{'all':!![]}];}return db[_0xc838('0x28')][_0xc838('0x3a')](_0x1405fb);})[_0xc838('0x20')](function(_0xd0d81b){_0x17b560[_0xc838('0x3b')]=_0xd0d81b;return _0x17b560;})[_0xc838('0x20')](respondWithFilteredResult(_0x42d5b6,_0x1405fb))['catch'](handleError(_0x42d5b6,null));};exports[_0xc838('0x3c')]=function(_0x5825fd,_0x3006da){var _0x3ba16b={'raw':![],'where':{'id':_0x5825fd['params']['id']}},_0x567345={};_0x567345[_0xc838('0x2b')]=_['keys'](db[_0xc838('0x28')][_0xc838('0x29')]);_0x567345['query']=_['keys'](_0x5825fd['query']);_0x567345[_0xc838('0x3d')]=_['intersection'](_0x567345[_0xc838('0x2b')],_0x567345['query']);_0x3ba16b[_0xc838('0x2f')]=_[_0xc838('0x2e')](_0x567345[_0xc838('0x2b')],qs[_0xc838('0x30')](_0x5825fd[_0xc838('0x2c')][_0xc838('0x30')]));_0x3ba16b[_0xc838('0x2f')]=_0x3ba16b[_0xc838('0x2f')][_0xc838('0x31')]?_0x3ba16b[_0xc838('0x2f')]:_0x567345[_0xc838('0x2b')];if(_0x5825fd['query'][_0xc838('0x3e')]){_0x3ba16b[_0xc838('0x39')]=[{'all':!![]}];}_0x3ba16b=_[_0xc838('0x37')]({},_0x3ba16b,_0x5825fd[_0xc838('0x38')]);return db[_0xc838('0x28')][_0xc838('0x3f')](_0x3ba16b)[_0xc838('0x20')](handleEntityNotFound(_0x3006da,null))[_0xc838('0x20')](respondWithResult(_0x3006da,null))[_0xc838('0x40')](handleError(_0x3006da,null));};exports[_0xc838('0x41')]=function(_0x5430b4,_0x966286){return db[_0xc838('0x28')]['create'](_0x5430b4[_0xc838('0x42')],{})[_0xc838('0x20')](respondWithResult(_0x966286,0xc9))[_0xc838('0x40')](handleError(_0x966286,null));};exports[_0xc838('0x43')]=function(_0x40b35b,_0x4800d0){return db[_0xc838('0x28')][_0xc838('0x43')](_0x40b35b[_0xc838('0x42')],{'raw':![],'individualHooks':!![]})[_0xc838('0x20')](respondWithResult(_0x4800d0,0xc9))[_0xc838('0x40')](handleError(_0x4800d0,null));};exports['update']=function(_0x569633,_0x2dcd9b){if(_0x569633[_0xc838('0x42')]['id']){delete _0x569633['body']['id'];}return db[_0xc838('0x28')][_0xc838('0x3f')]({'where':{'id':_0x569633[_0xc838('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcd9b,null))[_0xc838('0x20')](saveUpdates(_0x569633[_0xc838('0x42')],null))[_0xc838('0x20')](respondWithResult(_0x2dcd9b,null))[_0xc838('0x40')](handleError(_0x2dcd9b,null));};exports[_0xc838('0x21')]=function(_0x15ad39,_0x3fff48){return db[_0xc838('0x28')][_0xc838('0x3f')]({'where':{'id':_0x15ad39['params']['id']}})[_0xc838('0x20')](handleEntityNotFound(_0x3fff48,null))[_0xc838('0x20')](removeEntity(_0x3fff48,null))[_0xc838('0x40')](handleError(_0x3fff48,null));};exports['bulkDestroy']=function(_0x53d1e8,_0x2d07cf){return db[_0xc838('0x28')]['destroy']({'where':{'id':_0x53d1e8[_0xc838('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc838('0x20')](respondWithResult(_0x2d07cf,0xcc))[_0xc838('0x40')](handleError(_0x2d07cf,null));};exports[_0xc838('0x45')]=function(_0x3e2d36,_0x4629dc,_0x5ef09e){return db[_0xc838('0x46')]['findOne']({'where':{'id':_0x3e2d36[_0xc838('0x44')]['id']}})[_0xc838('0x20')](handleEntityNotFound(_0x4629dc,null))[_0xc838('0x20')](function(_0x18a64e){if(_0x18a64e){return db[_0xc838('0x47')][_0xc838('0x48')](function(_0x584dba){return db[_0xc838('0x28')][_0xc838('0x21')]({'where':{'CustomReportId':_0x3e2d36[_0xc838('0x44')]['id']},'transaction':_0x584dba})[_0xc838('0x20')](function(_0x1ebac6){var _0x23c907=_[_0xc838('0x27')](_0x3e2d36['body'],function(_0xd2d01a){delete _0xd2d01a['id'];_0xd2d01a['CustomReportId']=_0x3e2d36[_0xc838('0x44')]['id'];return _0xd2d01a;});return db['AnalyticFieldReport']['bulkCreate'](_0x23c907,{'transaction':_0x584dba});});})['then'](function(){return db[_0xc838('0x28')][_0xc838('0x3a')]({'where':{'CustomReportId':_0x3e2d36[_0xc838('0x44')]['id']}});});}})['then'](respondWithResult(_0x4629dc,null))[_0xc838('0x40')](handleError(_0x4629dc,null));};
\ No newline at end of file
+var _0x2dcd=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','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','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','merge','options','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x2dcd,0x15c));var _0xd2dc=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2dcd[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0xd2dc('0x0'));var rimraf=require(_0xd2dc('0x1'));var zipdir=require(_0xd2dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2dc('0x3'));var moment=require(_0xd2dc('0x4'));var BPromise=require(_0xd2dc('0x5'));var Mustache=require(_0xd2dc('0x6'));var util=require(_0xd2dc('0x7'));var path=require(_0xd2dc('0x8'));var sox=require(_0xd2dc('0x9'));var csv=require(_0xd2dc('0xa'));var ejs=require(_0xd2dc('0xb'));var fs=require('fs');var fs_extra=require(_0xd2dc('0xc'));var _=require(_0xd2dc('0xd'));var squel=require(_0xd2dc('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd2dc('0xf'));var toCsv=require(_0xd2dc('0xa'));var querystring=require(_0xd2dc('0x10'));var Papa=require('papaparse');var Redis=require(_0xd2dc('0x11'));var authService=require(_0xd2dc('0x12'));var qs=require(_0xd2dc('0x13'));var as=require(_0xd2dc('0x14'));var hardwareService=require(_0xd2dc('0x15'));var logger=require('../../config/logger')(_0xd2dc('0x16'));var utils=require(_0xd2dc('0x17'));var config=require(_0xd2dc('0x18'));var licenseUtil=require(_0xd2dc('0x19'));var db=require(_0xd2dc('0x1a'))['db'];function respondWithStatusCode(_0x107eeb,_0x27a59f){_0x27a59f=_0x27a59f||0xcc;return function(_0x300517){if(_0x300517){return _0x107eeb[_0xd2dc('0x1b')](_0x27a59f);}return _0x107eeb[_0xd2dc('0x1c')](_0x27a59f)[_0xd2dc('0x1d')]();};}function respondWithResult(_0x47f028,_0x12e486){_0x12e486=_0x12e486||0xc8;return function(_0xcab0d1){if(_0xcab0d1){return _0x47f028['status'](_0x12e486)[_0xd2dc('0x1e')](_0xcab0d1);}};}function respondWithFilteredResult(_0x49205f,_0x8d936f){return function(_0x3b9253){if(_0x3b9253){var _0x31d98d=typeof _0x8d936f[_0xd2dc('0x1f')]==='undefined'&&typeof _0x8d936f[_0xd2dc('0x20')]===_0xd2dc('0x21');var _0x2df5af=_0x3b9253[_0xd2dc('0x22')];var _0x363df1=_0x31d98d?0x0:_0x8d936f[_0xd2dc('0x1f')];var _0xa2bc4d=_0x31d98d?_0x3b9253[_0xd2dc('0x22')]:_0x8d936f[_0xd2dc('0x1f')]+_0x8d936f[_0xd2dc('0x20')];var _0xe80beb;if(_0xa2bc4d>=_0x2df5af){_0xa2bc4d=_0x2df5af;_0xe80beb=0xc8;}else{_0xe80beb=0xce;}_0x49205f['status'](_0xe80beb);return _0x49205f[_0xd2dc('0x23')](_0xd2dc('0x24'),_0x363df1+'-'+_0xa2bc4d+'/'+_0x2df5af)[_0xd2dc('0x1e')](_0x3b9253);}return null;};}function patchUpdates(_0x17b9e0){return function(_0x47ac50){try{jsonpatch[_0xd2dc('0x25')](_0x47ac50,_0x17b9e0,!![]);}catch(_0xdbbcba){return BPromise[_0xd2dc('0x26')](_0xdbbcba);}return _0x47ac50[_0xd2dc('0x27')]();};}function saveUpdates(_0x201bde,_0x541411){return function(_0x36dbe0){if(_0x36dbe0){return _0x36dbe0['update'](_0x201bde)[_0xd2dc('0x28')](function(_0x4c163b){return _0x4c163b;});}return null;};}function removeEntity(_0x2c89fb,_0x2f11d1){return function(_0xa21be6){if(_0xa21be6){return _0xa21be6[_0xd2dc('0x29')]()[_0xd2dc('0x28')](function(){_0x2c89fb[_0xd2dc('0x1c')](0xcc)[_0xd2dc('0x1d')]();});}};}function handleEntityNotFound(_0x2cce4a,_0x3db5f5){return function(_0x297d83){if(!_0x297d83){_0x2cce4a[_0xd2dc('0x1b')](0x194);}return _0x297d83;};}function handleError(_0x2c9617,_0x55427c){_0x55427c=_0x55427c||0x1f4;return function(_0x2073c5){logger[_0xd2dc('0x2a')](_0x2073c5[_0xd2dc('0x2b')]);if(_0x2073c5[_0xd2dc('0x2c')]){delete _0x2073c5[_0xd2dc('0x2c')];}_0x2c9617[_0xd2dc('0x1c')](_0x55427c)['send'](_0x2073c5);};}exports[_0xd2dc('0x2d')]=function(_0x5eb574,_0x45d0e3){var _0x31afa2={},_0x5c1868={},_0x1c735c={'count':0x0,'rows':[]};var _0x56a293=_[_0xd2dc('0x2e')](db[_0xd2dc('0x2f')][_0xd2dc('0x30')],function(_0x42c6c1){return{'name':_0x42c6c1[_0xd2dc('0x31')],'type':_0x42c6c1[_0xd2dc('0x32')][_0xd2dc('0x33')]};});_0x5c1868[_0xd2dc('0x34')]=_[_0xd2dc('0x2e')](_0x56a293,_0xd2dc('0x2c'));_0x5c1868[_0xd2dc('0x35')]=_[_0xd2dc('0x36')](_0x5eb574[_0xd2dc('0x35')]);_0x5c1868[_0xd2dc('0x37')]=_[_0xd2dc('0x38')](_0x5c1868[_0xd2dc('0x34')],_0x5c1868['query']);_0x31afa2[_0xd2dc('0x39')]=_[_0xd2dc('0x38')](_0x5c1868[_0xd2dc('0x34')],qs[_0xd2dc('0x3a')](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x3a')]));_0x31afa2[_0xd2dc('0x39')]=_0x31afa2[_0xd2dc('0x39')][_0xd2dc('0x3b')]?_0x31afa2[_0xd2dc('0x39')]:_0x5c1868[_0xd2dc('0x34')];if(!_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x3c')]('nolimit')){_0x31afa2[_0xd2dc('0x20')]=qs[_0xd2dc('0x20')](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x20')]);_0x31afa2[_0xd2dc('0x1f')]=qs[_0xd2dc('0x1f')](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x1f')]);}_0x31afa2[_0xd2dc('0x3d')]=qs['sort'](_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x3e')]);_0x31afa2[_0xd2dc('0x3f')]=qs[_0xd2dc('0x37')](_[_0xd2dc('0x40')](_0x5eb574[_0xd2dc('0x35')],_0x5c1868[_0xd2dc('0x37')]),_0x56a293);if(_0x5eb574['query']['filter']){_0x31afa2['where']=_['merge'](_0x31afa2[_0xd2dc('0x3f')],{'$or':_[_0xd2dc('0x2e')](_0x56a293,function(_0x26d5f0){if(_0x26d5f0[_0xd2dc('0x32')]!==_0xd2dc('0x41')){var _0x443707={};_0x443707[_0x26d5f0[_0xd2dc('0x2c')]]={'$like':'%'+_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x42')]+'%'};return _0x443707;}})});}_0x31afa2=_['merge']({},_0x31afa2,_0x5eb574['options']);var _0x130209={'where':_0x31afa2[_0xd2dc('0x3f')]};return db[_0xd2dc('0x2f')][_0xd2dc('0x22')](_0x130209)[_0xd2dc('0x28')](function(_0x537d30){_0x1c735c[_0xd2dc('0x22')]=_0x537d30;if(_0x5eb574[_0xd2dc('0x35')][_0xd2dc('0x43')]){_0x31afa2[_0xd2dc('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xd2dc('0x45')](_0x31afa2);})[_0xd2dc('0x28')](function(_0x2599ff){_0x1c735c[_0xd2dc('0x46')]=_0x2599ff;return _0x1c735c;})[_0xd2dc('0x28')](respondWithFilteredResult(_0x45d0e3,_0x31afa2))[_0xd2dc('0x47')](handleError(_0x45d0e3,null));};exports[_0xd2dc('0x48')]=function(_0x1fc92e,_0x4ac04f){var _0x2fbee6={'raw':![],'where':{'id':_0x1fc92e[_0xd2dc('0x49')]['id']}},_0x183bcf={};_0x183bcf[_0xd2dc('0x34')]=_['keys'](db[_0xd2dc('0x2f')]['rawAttributes']);_0x183bcf['query']=_[_0xd2dc('0x36')](_0x1fc92e[_0xd2dc('0x35')]);_0x183bcf[_0xd2dc('0x37')]=_['intersection'](_0x183bcf[_0xd2dc('0x34')],_0x183bcf['query']);_0x2fbee6[_0xd2dc('0x39')]=_[_0xd2dc('0x38')](_0x183bcf[_0xd2dc('0x34')],qs['fields'](_0x1fc92e[_0xd2dc('0x35')]['fields']));_0x2fbee6[_0xd2dc('0x39')]=_0x2fbee6[_0xd2dc('0x39')][_0xd2dc('0x3b')]?_0x2fbee6['attributes']:_0x183bcf[_0xd2dc('0x34')];if(_0x1fc92e[_0xd2dc('0x35')][_0xd2dc('0x43')]){_0x2fbee6[_0xd2dc('0x44')]=[{'all':!![]}];}_0x2fbee6=_[_0xd2dc('0x4a')]({},_0x2fbee6,_0x1fc92e[_0xd2dc('0x4b')]);return db[_0xd2dc('0x2f')]['find'](_0x2fbee6)[_0xd2dc('0x28')](handleEntityNotFound(_0x4ac04f,null))[_0xd2dc('0x28')](respondWithResult(_0x4ac04f,null))[_0xd2dc('0x47')](handleError(_0x4ac04f,null));};exports['create']=function(_0x55d49b,_0x14cc44){return db[_0xd2dc('0x2f')][_0xd2dc('0x4c')](_0x55d49b[_0xd2dc('0x4d')],{})['then'](respondWithResult(_0x14cc44,0xc9))['catch'](handleError(_0x14cc44,null));};exports[_0xd2dc('0x4e')]=function(_0x41721e,_0x535ab6){return db[_0xd2dc('0x2f')][_0xd2dc('0x4e')](_0x41721e[_0xd2dc('0x4d')],{'raw':![],'individualHooks':!![]})[_0xd2dc('0x28')](respondWithResult(_0x535ab6,0xc9))['catch'](handleError(_0x535ab6,null));};exports[_0xd2dc('0x4f')]=function(_0x4cd0bc,_0x1d51aa){if(_0x4cd0bc[_0xd2dc('0x4d')]['id']){delete _0x4cd0bc[_0xd2dc('0x4d')]['id'];}return db[_0xd2dc('0x2f')]['find']({'where':{'id':_0x4cd0bc[_0xd2dc('0x49')]['id']}})[_0xd2dc('0x28')](handleEntityNotFound(_0x1d51aa,null))['then'](saveUpdates(_0x4cd0bc[_0xd2dc('0x4d')],null))[_0xd2dc('0x28')](respondWithResult(_0x1d51aa,null))[_0xd2dc('0x47')](handleError(_0x1d51aa,null));};exports[_0xd2dc('0x29')]=function(_0x487d9c,_0x32fcae){return db['AnalyticFieldReport']['find']({'where':{'id':_0x487d9c['params']['id']}})['then'](handleEntityNotFound(_0x32fcae,null))[_0xd2dc('0x28')](removeEntity(_0x32fcae,null))['catch'](handleError(_0x32fcae,null));};exports[_0xd2dc('0x50')]=function(_0x2be009,_0x1eff21){return db[_0xd2dc('0x2f')][_0xd2dc('0x29')]({'where':{'id':_0x2be009['query'][_0xd2dc('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xd2dc('0x28')](respondWithResult(_0x1eff21,0xcc))[_0xd2dc('0x47')](handleError(_0x1eff21,null));};exports[_0xd2dc('0x52')]=function(_0x4ec65e,_0x50ce46,_0x24b663){return db[_0xd2dc('0x53')][_0xd2dc('0x54')]({'where':{'id':_0x4ec65e[_0xd2dc('0x49')]['id']}})[_0xd2dc('0x28')](handleEntityNotFound(_0x50ce46,null))[_0xd2dc('0x28')](function(_0x7fce3){if(_0x7fce3){return db[_0xd2dc('0x55')][_0xd2dc('0x56')](function(_0x2a955a){return db[_0xd2dc('0x2f')][_0xd2dc('0x29')]({'where':{'CustomReportId':_0x4ec65e[_0xd2dc('0x49')]['id']},'transaction':_0x2a955a})['then'](function(_0x531cb5){var _0x48697b=_[_0xd2dc('0x2e')](_0x4ec65e[_0xd2dc('0x4d')],function(_0x51722d){delete _0x51722d['id'];_0x51722d[_0xd2dc('0x57')]=_0x4ec65e[_0xd2dc('0x49')]['id'];return _0x51722d;});return db['AnalyticFieldReport']['bulkCreate'](_0x48697b,{'transaction':_0x2a955a});});})[_0xd2dc('0x28')](function(){return db[_0xd2dc('0x2f')][_0xd2dc('0x45')]({'where':{'CustomReportId':_0x4ec65e[_0xd2dc('0x49')]['id']}});});}})[_0xd2dc('0x28')](respondWithResult(_0x50ce46,null))['catch'](handleError(_0x50ce46,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index af320ae..caf7adb 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 _0x0e8e=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','request-promise'];(function(_0x5550b0,_0x4b5838){var _0x3c3370=function(_0x5c5cf9){while(--_0x5c5cf9){_0x5550b0['push'](_0x5550b0['shift']());}};_0x3c3370(++_0x4b5838);}(_0x0e8e,0x126));var _0xe0e8=function(_0x361ee1,_0x5c3d08){_0x361ee1=_0x361ee1-0x0;var _0x2202df=_0x0e8e[_0x361ee1];return _0x2202df;};'use strict';var _=require(_0xe0e8('0x0'));var util=require(_0xe0e8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0e8('0x2'));var fs=require('fs');var path=require(_0xe0e8('0x3'));var rimraf=require(_0xe0e8('0x4'));var config=require(_0xe0e8('0x5'));var attributes=require(_0xe0e8('0x6'));module[_0xe0e8('0x7')]=function(_0x3f2b9b,_0x58d93d){return _0x3f2b9b[_0xe0e8('0x8')](_0xe0e8('0x9'),attributes,{'tableName':_0xe0e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9d0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x5c2209,_0xb353c2){var _0x482463=function(_0x1d3a72){while(--_0x1d3a72){_0x5c2209['push'](_0x5c2209['shift']());}};_0x482463(++_0xb353c2);}(_0xc9d0,0x196));var _0x0c9d=function(_0x4f2679,_0x42bad2){_0x4f2679=_0x4f2679-0x0;var _0x573915=_0xc9d0[_0x4f2679];return _0x573915;};'use strict';var _=require(_0x0c9d('0x0'));var util=require(_0x0c9d('0x1'));var logger=require(_0x0c9d('0x2'))(_0x0c9d('0x3'));var moment=require(_0x0c9d('0x4'));var BPromise=require(_0x0c9d('0x5'));var rp=require(_0x0c9d('0x6'));var fs=require('fs');var path=require(_0x0c9d('0x7'));var rimraf=require(_0x0c9d('0x8'));var config=require('../../config/environment');var attributes=require(_0x0c9d('0x9'));module[_0x0c9d('0xa')]=function(_0x17cb94,_0x355ccc){return _0x17cb94[_0x0c9d('0xb')](_0x0c9d('0xc'),attributes,{'tableName':_0x0c9d('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 d77a4f2..02e1c5f 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 _0x44f0=['info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x24f870,_0x2c8a88){var _0x5d065b=function(_0x168247){while(--_0x168247){_0x24f870['push'](_0x24f870['shift']());}};_0x5d065b(++_0x2c8a88);}(_0x44f0,0x197));var _0x044f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x44f0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x044f('0x0'));var util=require('util');var moment=require(_0x044f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x044f('0x2'));var db=require(_0x044f('0x3'))['db'];var utils=require(_0x044f('0x4'));var logger=require(_0x044f('0x5'))(_0x044f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x044f('0x7')][_0x044f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d957b,_0x21c1c5,_0x367631){return new BPromise(function(_0x458f81,_0x572d87){return client[_0x044f('0x9')](_0x2d957b,_0x367631)[_0x044f('0xa')](function(_0x4b5aa6){logger[_0x044f('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x21c1c5,'request\x20sent');logger[_0x044f('0xc')](_0x044f('0xd'),_0x21c1c5,_0x044f('0xe'),JSON[_0x044f('0xf')](_0x4b5aa6));if(_0x4b5aa6[_0x044f('0x10')]){if(_0x4b5aa6[_0x044f('0x10')][_0x044f('0x11')]===0x1f4){logger[_0x044f('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x21c1c5,_0x4b5aa6[_0x044f('0x10')][_0x044f('0x12')]);return _0x572d87(_0x4b5aa6['error'][_0x044f('0x12')]);}logger[_0x044f('0x10')](_0x044f('0x13'),_0x21c1c5,_0x4b5aa6[_0x044f('0x10')][_0x044f('0x12')]);return _0x458f81(_0x4b5aa6[_0x044f('0x10')][_0x044f('0x12')]);}else{logger[_0x044f('0xb')](_0x044f('0x13'),_0x21c1c5,'request\x20sent');_0x458f81(_0x4b5aa6[_0x044f('0x14')][_0x044f('0x12')]);}})[_0x044f('0x15')](function(_0x3a69f7){logger[_0x044f('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x21c1c5,_0x3a69f7);_0x572d87(_0x3a69f7);});});}
\ No newline at end of file
+var _0x605f=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x5292fe,_0x1f2656){var _0x117c87=function(_0x3c32c9){while(--_0x3c32c9){_0x5292fe['push'](_0x5292fe['shift']());}};_0x117c87(++_0x1f2656);}(_0x605f,0x77));var _0xf605=function(_0x4b60fb,_0x36d36d){_0x4b60fb=_0x4b60fb-0x0;var _0x2d266a=_0x605f[_0x4b60fb];return _0x2d266a;};'use strict';var _=require(_0xf605('0x0'));var util=require(_0xf605('0x1'));var moment=require(_0xf605('0x2'));var BPromise=require(_0xf605('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf605('0x4'));var db=require(_0xf605('0x5'))['db'];var utils=require(_0xf605('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf605('0x7'));var client=jayson['client'][_0xf605('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35b72e,_0x558f7b,_0x5a1f16){return new BPromise(function(_0x2a70e8,_0x36771a){return client[_0xf605('0x9')](_0x35b72e,_0x5a1f16)['then'](function(_0x58d902){logger[_0xf605('0xa')](_0xf605('0xb'),_0x558f7b,'request\x20sent');logger[_0xf605('0xc')](_0xf605('0xd'),_0x558f7b,_0xf605('0xe'),JSON[_0xf605('0xf')](_0x58d902));if(_0x58d902[_0xf605('0x10')]){if(_0x58d902[_0xf605('0x10')]['code']===0x1f4){logger[_0xf605('0x10')](_0xf605('0xb'),_0x558f7b,_0x58d902['error'][_0xf605('0x11')]);return _0x36771a(_0x58d902['error'][_0xf605('0x11')]);}logger['error'](_0xf605('0xb'),_0x558f7b,_0x58d902['error']['message']);return _0x2a70e8(_0x58d902['error'][_0xf605('0x11')]);}else{logger[_0xf605('0xa')](_0xf605('0xb'),_0x558f7b,_0xf605('0xe'));_0x2a70e8(_0x58d902[_0xf605('0x12')][_0xf605('0x11')]);}})[_0xf605('0x13')](function(_0x4691e){logger['error'](_0xf605('0xb'),_0x558f7b,_0x4691e);_0x36771a(_0x4691e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 7818b77..04dd77d 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(_0x5c10bd,_0x445068){var _0x17cc9f=function(_0x47241e){while(--_0x47241e){_0x5c10bd['push'](_0x5c10bd['shift']());}};_0x17cc9f(++_0x445068);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x5decac,_0x24be8e){var _0x186fc8=function(_0x2b590f){while(--_0x2b590f){_0x5decac['push'](_0x5decac['shift']());}};_0x186fc8(++_0x24be8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 af0f82f..79bc785 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 _0x1ca7=['exports','TEXT','STRING','sequelize'];(function(_0x1001ff,_0x23f369){var _0x20dc38=function(_0x3f59dd){while(--_0x3f59dd){_0x1001ff['push'](_0x1001ff['shift']());}};_0x20dc38(++_0x23f369);}(_0x1ca7,0x157));var _0x71ca=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x1ca7[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x71ca('0x0'));module[_0x71ca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x71ca('0x2')]},'description':{'type':Sequelize[_0x71ca('0x3')]}};
\ No newline at end of file
+var _0x98e5=['name','STRING'];(function(_0x533a69,_0x23b7bf){var _0x24872a=function(_0x2d2340){while(--_0x2d2340){_0x533a69['push'](_0x533a69['shift']());}};_0x24872a(++_0x23b7bf);}(_0x98e5,0x8a));var _0x598e=function(_0x2d4d66,_0x4ebf90){_0x2d4d66=_0x2d4d66-0x0;var _0x441c64=_0x98e5[_0x2d4d66];return _0x441c64;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x598e('0x0')},'table':{'type':Sequelize[_0x598e('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x598e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index acaf23d..48d2d75 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x181d15,_0x567b26){var _0x4aa763=function(_0x138182){while(--_0x138182){_0x181d15['push'](_0x181d15['shift']());}};_0x4aa763(++_0x567b26);}(_0x425d,0x1e0));var _0xd425=function(_0x2ec4d3,_0x544043){_0x2ec4d3=_0x2ec4d3-0x0;var _0x4caf0b=_0x425d[_0x2ec4d3];return _0x4caf0b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,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(_0x5d2ee6,_0x172461){var _0x148dc1=function(_0x125b75){while(--_0x125b75){_0x5d2ee6['push'](_0x5d2ee6['shift']());}};_0x148dc1(++_0x172461);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1ad12c,_0x5bd618){_0x1ad12c=_0x1ad12c-0x0;var _0xb60e0f=_0xf2ca[_0x1ad12c];return _0xb60e0f;};'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 f8a8e78..fc41fec 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 _0x1488=['exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','path','../../config/environment','./analyticMetric.attributes'];(function(_0x4d9d40,_0x39f6ee){var _0x5bb24a=function(_0x2a836e){while(--_0x2a836e){_0x4d9d40['push'](_0x4d9d40['shift']());}};_0x5bb24a(++_0x39f6ee);}(_0x1488,0x88));var _0x8148=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x1488[_0x12ddb2];return _0x10b6dd;};'use strict';var _=require(_0x8148('0x0'));var util=require('util');var logger=require(_0x8148('0x1'))(_0x8148('0x2'));var moment=require(_0x8148('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8148('0x4'));var rimraf=require('rimraf');var config=require(_0x8148('0x5'));var attributes=require(_0x8148('0x6'));module[_0x8148('0x7')]=function(_0x153009,_0x173d87){return _0x153009[_0x8148('0x8')](_0x8148('0x9'),attributes,{'tableName':_0x8148('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc91=['analytics_metrics','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x4059a9,_0x4a82e1){var _0x179815=function(_0x67ddde){while(--_0x67ddde){_0x4059a9['push'](_0x4059a9['shift']());}};_0x179815(++_0x4a82e1);}(_0xfc91,0xb5));var _0x1fc9=function(_0x1c450e,_0x8cd2b5){_0x1c450e=_0x1c450e-0x0;var _0x3bc620=_0xfc91[_0x1c450e];return _0x3bc620;};'use strict';var _=require('lodash');var util=require(_0x1fc9('0x0'));var logger=require('../../config/logger')(_0x1fc9('0x1'));var moment=require(_0x1fc9('0x2'));var BPromise=require(_0x1fc9('0x3'));var rp=require(_0x1fc9('0x4'));var fs=require('fs');var path=require(_0x1fc9('0x5'));var rimraf=require(_0x1fc9('0x6'));var config=require(_0x1fc9('0x7'));var attributes=require(_0x1fc9('0x8'));module[_0x1fc9('0x9')]=function(_0xb6caac,_0xc81f3b){return _0xb6caac[_0x1fc9('0xa')]('AnalyticMetric',attributes,{'tableName':_0x1fc9('0xb'),'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 e84982c..8c24ea2 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 _0xd78e=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x429c79,_0x3d90c6){var _0x2dfeb1=function(_0x18da11){while(--_0x18da11){_0x429c79['push'](_0x429c79['shift']());}};_0x2dfeb1(++_0x3d90c6);}(_0xd78e,0x163));var _0xed78=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xd78e[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xed78('0x0'));var util=require(_0xed78('0x1'));var moment=require(_0xed78('0x2'));var BPromise=require(_0xed78('0x3'));var rs=require(_0xed78('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed78('0x5'))['db'];var utils=require(_0xed78('0x6'));var logger=require(_0xed78('0x7'))(_0xed78('0x8'));var config=require('../../config/environment');var jayson=require(_0xed78('0x9'));var client=jayson['client'][_0xed78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6f0d0,_0x30b5cc,_0x6ffc64){return new BPromise(function(_0x3838a9,_0x34c533){return client['request'](_0xf6f0d0,_0x6ffc64)['then'](function(_0xb468d1){logger[_0xed78('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x30b5cc,_0xed78('0xc'));logger[_0xed78('0xd')](_0xed78('0xe'),_0x30b5cc,'request\x20sent',JSON[_0xed78('0xf')](_0xb468d1));if(_0xb468d1[_0xed78('0x10')]){if(_0xb468d1[_0xed78('0x10')][_0xed78('0x11')]===0x1f4){logger[_0xed78('0x10')](_0xed78('0x12'),_0x30b5cc,_0xb468d1[_0xed78('0x10')]['message']);return _0x34c533(_0xb468d1[_0xed78('0x10')][_0xed78('0x13')]);}logger['error'](_0xed78('0x12'),_0x30b5cc,_0xb468d1[_0xed78('0x10')]['message']);return _0x3838a9(_0xb468d1[_0xed78('0x10')]['message']);}else{logger[_0xed78('0xb')](_0xed78('0x12'),_0x30b5cc,_0xed78('0xc'));_0x3838a9(_0xb468d1['result'][_0xed78('0x13')]);}})['catch'](function(_0x298fd2){logger[_0xed78('0x10')](_0xed78('0x12'),_0x30b5cc,_0x298fd2);_0x34c533(_0x298fd2);});});}
\ No newline at end of file
+var _0x18c8=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x18c8,0x8c));var _0x818c=function(_0x391f9c,_0xd6d758){_0x391f9c=_0x391f9c-0x0;var _0x20aee0=_0x18c8[_0x391f9c];return _0x20aee0;};'use strict';var _=require('lodash');var util=require(_0x818c('0x0'));var moment=require(_0x818c('0x1'));var BPromise=require(_0x818c('0x2'));var rs=require(_0x818c('0x3'));var fs=require('fs');var Redis=require(_0x818c('0x4'));var db=require(_0x818c('0x5'))['db'];var utils=require(_0x818c('0x6'));var logger=require(_0x818c('0x7'))(_0x818c('0x8'));var config=require(_0x818c('0x9'));var jayson=require(_0x818c('0xa'));var client=jayson['client'][_0x818c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x201ca9,_0x1e12b8,_0x555398){return new BPromise(function(_0x9c469b,_0x14b38c){return client[_0x818c('0xc')](_0x201ca9,_0x555398)[_0x818c('0xd')](function(_0x5e67c8){logger['info'](_0x818c('0xe'),_0x1e12b8,_0x818c('0xf'));logger[_0x818c('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1e12b8,_0x818c('0xf'),JSON['stringify'](_0x5e67c8));if(_0x5e67c8[_0x818c('0x11')]){if(_0x5e67c8[_0x818c('0x11')][_0x818c('0x12')]===0x1f4){logger[_0x818c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1e12b8,_0x5e67c8[_0x818c('0x11')][_0x818c('0x13')]);return _0x14b38c(_0x5e67c8[_0x818c('0x11')][_0x818c('0x13')]);}logger[_0x818c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1e12b8,_0x5e67c8[_0x818c('0x11')][_0x818c('0x13')]);return _0x9c469b(_0x5e67c8['error'][_0x818c('0x13')]);}else{logger[_0x818c('0x14')](_0x818c('0xe'),_0x1e12b8,_0x818c('0xf'));_0x9c469b(_0x5e67c8[_0x818c('0x15')]['message']);}})[_0x818c('0x16')](function(_0x4f5749){logger[_0x818c('0x11')](_0x818c('0xe'),_0x1e12b8,_0x4f5749);_0x14b38c(_0x4f5749);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 0df5295..171994a 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 _0xf873=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xf873,0xb2));var _0x3f87=function(_0xbb706f,_0x5a3200){_0xbb706f=_0xbb706f-0x0;var _0x4a3bb9=_0xf873[_0xbb706f];return _0x4a3bb9;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./analyticMetric.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0xe')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['put'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);module[_0x3f87('0x13')]=router;
\ No newline at end of file
+var _0x046b=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x58569d,_0x4dad03){var _0x5966d8=function(_0x48ac6){while(--_0x48ac6){_0x58569d['push'](_0x58569d['shift']());}};_0x5966d8(++_0x4dad03);}(_0x046b,0x147));var _0xb046=function(_0x41cf29,_0x216a99){_0x41cf29=_0x41cf29-0x0;var _0x566462=_0x046b[_0x41cf29];return _0x566462;};'use strict';var multer=require('multer');var util=require(_0xb046('0x0'));var path=require(_0xb046('0x1'));var timeout=require(_0xb046('0x2'));var express=require(_0xb046('0x3'));var router=express[_0xb046('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb046('0x5'));var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb046('0x9')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0xc')]);router[_0xb046('0xd')]('/',auth[_0xb046('0xb')](),controller[_0xb046('0xe')]);router[_0xb046('0xf')]('/:id',auth[_0xb046('0xb')](),controller['update']);router[_0xb046('0x10')](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0x11')]);module[_0xb046('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 2061a9d..13d90b0 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 _0x480c=['TEXT'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0x480c,0xcc));var _0xc480=function(_0x391db4,_0x5ef002){_0x391db4=_0x391db4-0x0;var _0x262d1a=_0x480c[_0x391db4];return _0x262d1a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xc480('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x411f=['TEXT','exports'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x411f,0xe1));var _0xf411=function(_0x559f79,_0x20583d){_0x559f79=_0x559f79-0x0;var _0x5a3148=_0x411f[_0x559f79];return _0x5a3148;};'use strict';var Sequelize=require('sequelize');module[_0xf411('0x0')]={'tree':{'type':Sequelize[_0xf411('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 d0482e2..85d4ff7 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 _0xecf4=['status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x389710,_0x336855){var _0x17a191=function(_0x39138c){while(--_0x39138c){_0x389710['push'](_0x389710['shift']());}};_0x17a191(++_0x336855);}(_0xecf4,0x79));var _0x4ecf=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xecf4[_0xfedc72];return _0x2c7c78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ecf('0x0'));var zipdir=require(_0x4ecf('0x1'));var jsonpatch=require(_0x4ecf('0x2'));var rp=require(_0x4ecf('0x3'));var moment=require(_0x4ecf('0x4'));var BPromise=require(_0x4ecf('0x5'));var Mustache=require('mustache');var util=require(_0x4ecf('0x6'));var path=require(_0x4ecf('0x7'));var sox=require(_0x4ecf('0x8'));var csv=require(_0x4ecf('0x9'));var ejs=require(_0x4ecf('0xa'));var fs=require('fs');var fs_extra=require(_0x4ecf('0xb'));var _=require(_0x4ecf('0xc'));var squel=require('squel');var crypto=require(_0x4ecf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4ecf('0xe'));var toCsv=require(_0x4ecf('0x9'));var querystring=require('querystring');var Papa=require(_0x4ecf('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4ecf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ecf('0x11'));var logger=require(_0x4ecf('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x4ecf('0x13'));var licenseUtil=require(_0x4ecf('0x14'));var db=require(_0x4ecf('0x15'))['db'];function respondWithStatusCode(_0x421e78,_0x21a6c3){_0x21a6c3=_0x21a6c3||0xcc;return function(_0x1092f0){if(_0x1092f0){return _0x421e78[_0x4ecf('0x16')](_0x21a6c3);}return _0x421e78[_0x4ecf('0x17')](_0x21a6c3)['end']();};}function respondWithResult(_0x4db499,_0x101c0e){_0x101c0e=_0x101c0e||0xc8;return function(_0x249a91){if(_0x249a91){return _0x4db499[_0x4ecf('0x17')](_0x101c0e)[_0x4ecf('0x18')](_0x249a91);}};}function respondWithFilteredResult(_0x59ce69,_0x76a64d){return function(_0x6144d4){if(_0x6144d4){var _0x620f3=typeof _0x76a64d['offset']===_0x4ecf('0x19')&&typeof _0x76a64d[_0x4ecf('0x1a')]===_0x4ecf('0x19');var _0x594f2a=_0x6144d4['count'];var _0x1e7648=_0x620f3?0x0:_0x76a64d[_0x4ecf('0x1b')];var _0xfa6aef=_0x620f3?_0x6144d4[_0x4ecf('0x1c')]:_0x76a64d['offset']+_0x76a64d[_0x4ecf('0x1a')];var _0x43bd8f;if(_0xfa6aef>=_0x594f2a){_0xfa6aef=_0x594f2a;_0x43bd8f=0xc8;}else{_0x43bd8f=0xce;}_0x59ce69[_0x4ecf('0x17')](_0x43bd8f);return _0x59ce69[_0x4ecf('0x1d')](_0x4ecf('0x1e'),_0x1e7648+'-'+_0xfa6aef+'/'+_0x594f2a)['json'](_0x6144d4);}return null;};}function patchUpdates(_0x41b48d){return function(_0x227d83){try{jsonpatch[_0x4ecf('0x1f')](_0x227d83,_0x41b48d,!![]);}catch(_0x304097){return BPromise['reject'](_0x304097);}return _0x227d83[_0x4ecf('0x20')]();};}function saveUpdates(_0x434f27,_0x3bff7b){return function(_0x394b93){if(_0x394b93){return _0x394b93[_0x4ecf('0x21')](_0x434f27)[_0x4ecf('0x22')](function(_0x225538){return _0x225538;});}return null;};}function removeEntity(_0x28c116,_0x1490b1){return function(_0x3bccd3){if(_0x3bccd3){return _0x3bccd3[_0x4ecf('0x23')]()['then'](function(){_0x28c116['status'](0xcc)[_0x4ecf('0x24')]();});}};}function handleEntityNotFound(_0x480122,_0x3dbf7c){return function(_0x1ea40d){if(!_0x1ea40d){_0x480122[_0x4ecf('0x16')](0x194);}return _0x1ea40d;};}function handleError(_0x58ea9a,_0x4fbee9){_0x4fbee9=_0x4fbee9||0x1f4;return function(_0x1c9d70){logger[_0x4ecf('0x25')](_0x1c9d70[_0x4ecf('0x26')]);if(_0x1c9d70[_0x4ecf('0x27')]){delete _0x1c9d70[_0x4ecf('0x27')];}_0x58ea9a[_0x4ecf('0x17')](_0x4fbee9)[_0x4ecf('0x28')](_0x1c9d70);};}exports[_0x4ecf('0x29')]=function(_0xbf68a4,_0xe2a7e4){var _0x531884={},_0x4beaad={},_0x41bf2f={'count':0x0,'rows':[]};var _0x4d6a9f=_[_0x4ecf('0x2a')](db['AnalyticTreeReport'][_0x4ecf('0x2b')],function(_0x55128b){return{'name':_0x55128b[_0x4ecf('0x2c')],'type':_0x55128b[_0x4ecf('0x2d')][_0x4ecf('0x2e')]};});_0x4beaad[_0x4ecf('0x2f')]=_[_0x4ecf('0x2a')](_0x4d6a9f,_0x4ecf('0x27'));_0x4beaad[_0x4ecf('0x30')]=_[_0x4ecf('0x31')](_0xbf68a4[_0x4ecf('0x30')]);_0x4beaad['filters']=_[_0x4ecf('0x32')](_0x4beaad['model'],_0x4beaad[_0x4ecf('0x30')]);_0x531884['attributes']=_[_0x4ecf('0x32')](_0x4beaad[_0x4ecf('0x2f')],qs['fields'](_0xbf68a4['query'][_0x4ecf('0x33')]));_0x531884[_0x4ecf('0x34')]=_0x531884[_0x4ecf('0x34')][_0x4ecf('0x35')]?_0x531884[_0x4ecf('0x34')]:_0x4beaad[_0x4ecf('0x2f')];if(!_0xbf68a4[_0x4ecf('0x30')]['hasOwnProperty'](_0x4ecf('0x36'))){_0x531884[_0x4ecf('0x1a')]=qs['limit'](_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x1a')]);_0x531884['offset']=qs['offset'](_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x1b')]);}_0x531884[_0x4ecf('0x37')]=qs['sort'](_0xbf68a4[_0x4ecf('0x30')]['sort']);_0x531884[_0x4ecf('0x38')]=qs[_0x4ecf('0x39')](_[_0x4ecf('0x3a')](_0xbf68a4['query'],_0x4beaad[_0x4ecf('0x39')]),_0x4d6a9f);if(_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x3b')]){_0x531884[_0x4ecf('0x38')]=_['merge'](_0x531884[_0x4ecf('0x38')],{'$or':_['map'](_0x4d6a9f,function(_0xc66c5a){if(_0xc66c5a[_0x4ecf('0x2d')]!==_0x4ecf('0x3c')){var _0x279f65={};_0x279f65[_0xc66c5a['name']]={'$like':'%'+_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x3b')]+'%'};return _0x279f65;}})});}_0x531884=_[_0x4ecf('0x3d')]({},_0x531884,_0xbf68a4[_0x4ecf('0x3e')]);var _0x173cf9={'where':_0x531884[_0x4ecf('0x38')]};return db[_0x4ecf('0x3f')][_0x4ecf('0x1c')](_0x173cf9)[_0x4ecf('0x22')](function(_0x175932){_0x41bf2f[_0x4ecf('0x1c')]=_0x175932;if(_0xbf68a4[_0x4ecf('0x30')][_0x4ecf('0x40')]){_0x531884[_0x4ecf('0x41')]=[{'all':!![]}];}return db[_0x4ecf('0x3f')][_0x4ecf('0x42')](_0x531884);})[_0x4ecf('0x22')](function(_0x22d797){_0x41bf2f['rows']=_0x22d797;return _0x41bf2f;})[_0x4ecf('0x22')](respondWithFilteredResult(_0xe2a7e4,_0x531884))[_0x4ecf('0x43')](handleError(_0xe2a7e4,null));};exports['show']=function(_0x220a38,_0x8cf10d){var _0x10a5c0={'raw':!![],'where':{'id':_0x220a38[_0x4ecf('0x44')]['id']}},_0x471122={};_0x471122[_0x4ecf('0x2f')]=_[_0x4ecf('0x31')](db['AnalyticTreeReport'][_0x4ecf('0x2b')]);_0x471122[_0x4ecf('0x30')]=_['keys'](_0x220a38[_0x4ecf('0x30')]);_0x471122[_0x4ecf('0x39')]=_[_0x4ecf('0x32')](_0x471122[_0x4ecf('0x2f')],_0x471122['query']);_0x10a5c0[_0x4ecf('0x34')]=_[_0x4ecf('0x32')](_0x471122[_0x4ecf('0x2f')],qs[_0x4ecf('0x33')](_0x220a38[_0x4ecf('0x30')][_0x4ecf('0x33')]));_0x10a5c0['attributes']=_0x10a5c0[_0x4ecf('0x34')][_0x4ecf('0x35')]?_0x10a5c0['attributes']:_0x471122['model'];if(_0x220a38[_0x4ecf('0x30')][_0x4ecf('0x40')]){_0x10a5c0[_0x4ecf('0x41')]=[{'all':!![]}];}_0x10a5c0=_[_0x4ecf('0x3d')]({},_0x10a5c0,_0x220a38[_0x4ecf('0x3e')]);return db[_0x4ecf('0x3f')][_0x4ecf('0x45')](_0x10a5c0)[_0x4ecf('0x22')](handleEntityNotFound(_0x8cf10d,null))['then'](respondWithResult(_0x8cf10d,null))[_0x4ecf('0x43')](handleError(_0x8cf10d,null));};exports[_0x4ecf('0x46')]=function(_0x3242de,_0x289672){return db[_0x4ecf('0x3f')][_0x4ecf('0x46')](_0x3242de['body'],{})[_0x4ecf('0x22')](respondWithResult(_0x289672,0xc9))[_0x4ecf('0x43')](handleError(_0x289672,null));};exports[_0x4ecf('0x21')]=function(_0x4a8b83,_0x1999bc){if(_0x4a8b83[_0x4ecf('0x47')]['id']){delete _0x4a8b83[_0x4ecf('0x47')]['id'];}return db[_0x4ecf('0x3f')][_0x4ecf('0x45')]({'where':{'id':_0x4a8b83[_0x4ecf('0x44')]['id']}})[_0x4ecf('0x22')](handleEntityNotFound(_0x1999bc,null))[_0x4ecf('0x22')](saveUpdates(_0x4a8b83['body'],null))[_0x4ecf('0x22')](respondWithResult(_0x1999bc,null))['catch'](handleError(_0x1999bc,null));};exports[_0x4ecf('0x23')]=function(_0x4aca45,_0x58da98){return db[_0x4ecf('0x3f')][_0x4ecf('0x45')]({'where':{'id':_0x4aca45[_0x4ecf('0x44')]['id']}})[_0x4ecf('0x22')](handleEntityNotFound(_0x58da98,null))[_0x4ecf('0x22')](removeEntity(_0x58da98,null))[_0x4ecf('0x43')](handleError(_0x58da98,null));};
\ No newline at end of file
+var _0x5fc6=['filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fc6,0x180));var _0x65fc=function(_0x5cdcf9,_0x3209ff){_0x5cdcf9=_0x5cdcf9-0x0;var _0x302f30=_0x5fc6[_0x5cdcf9];return _0x302f30;};'use strict';var emlformat=require(_0x65fc('0x0'));var rimraf=require(_0x65fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65fc('0x2'));var rp=require(_0x65fc('0x3'));var moment=require(_0x65fc('0x4'));var BPromise=require(_0x65fc('0x5'));var Mustache=require(_0x65fc('0x6'));var util=require(_0x65fc('0x7'));var path=require('path');var sox=require(_0x65fc('0x8'));var csv=require(_0x65fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65fc('0xa'));var squel=require(_0x65fc('0xb'));var crypto=require(_0x65fc('0xc'));var jsforce=require(_0x65fc('0xd'));var deskjs=require(_0x65fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x65fc('0xf'));var Papa=require(_0x65fc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65fc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65fc('0x12'));var utils=require(_0x65fc('0x13'));var config=require(_0x65fc('0x14'));var licenseUtil=require(_0x65fc('0x15'));var db=require(_0x65fc('0x16'))['db'];function respondWithStatusCode(_0x2f2159,_0x1a4641){_0x1a4641=_0x1a4641||0xcc;return function(_0x518366){if(_0x518366){return _0x2f2159[_0x65fc('0x17')](_0x1a4641);}return _0x2f2159['status'](_0x1a4641)[_0x65fc('0x18')]();};}function respondWithResult(_0x3eee11,_0x17c60f){_0x17c60f=_0x17c60f||0xc8;return function(_0x3772fe){if(_0x3772fe){return _0x3eee11[_0x65fc('0x19')](_0x17c60f)['json'](_0x3772fe);}};}function respondWithFilteredResult(_0x5c1c60,_0x2de192){return function(_0x435b76){if(_0x435b76){var _0x1f6555=typeof _0x2de192[_0x65fc('0x1a')]===_0x65fc('0x1b')&&typeof _0x2de192[_0x65fc('0x1c')]===_0x65fc('0x1b');var _0x3732d6=_0x435b76[_0x65fc('0x1d')];var _0x8dd5a5=_0x1f6555?0x0:_0x2de192[_0x65fc('0x1a')];var _0x3854cf=_0x1f6555?_0x435b76['count']:_0x2de192['offset']+_0x2de192[_0x65fc('0x1c')];var _0x4cd5c8;if(_0x3854cf>=_0x3732d6){_0x3854cf=_0x3732d6;_0x4cd5c8=0xc8;}else{_0x4cd5c8=0xce;}_0x5c1c60[_0x65fc('0x19')](_0x4cd5c8);return _0x5c1c60[_0x65fc('0x1e')](_0x65fc('0x1f'),_0x8dd5a5+'-'+_0x3854cf+'/'+_0x3732d6)['json'](_0x435b76);}return null;};}function patchUpdates(_0x522d73){return function(_0x29d70e){try{jsonpatch[_0x65fc('0x20')](_0x29d70e,_0x522d73,!![]);}catch(_0x408b5e){return BPromise[_0x65fc('0x21')](_0x408b5e);}return _0x29d70e['save']();};}function saveUpdates(_0x2a88c7,_0x4683ee){return function(_0x1477c0){if(_0x1477c0){return _0x1477c0[_0x65fc('0x22')](_0x2a88c7)[_0x65fc('0x23')](function(_0x8929f8){return _0x8929f8;});}return null;};}function removeEntity(_0x562507,_0x5d52b5){return function(_0x5c1c5e){if(_0x5c1c5e){return _0x5c1c5e[_0x65fc('0x24')]()['then'](function(){_0x562507['status'](0xcc)[_0x65fc('0x18')]();});}};}function handleEntityNotFound(_0x1fe245,_0x20ea4c){return function(_0x94d629){if(!_0x94d629){_0x1fe245[_0x65fc('0x17')](0x194);}return _0x94d629;};}function handleError(_0x2871d3,_0x28d1e3){_0x28d1e3=_0x28d1e3||0x1f4;return function(_0x503538){logger[_0x65fc('0x25')](_0x503538[_0x65fc('0x26')]);if(_0x503538[_0x65fc('0x27')]){delete _0x503538[_0x65fc('0x27')];}_0x2871d3[_0x65fc('0x19')](_0x28d1e3)[_0x65fc('0x28')](_0x503538);};}exports[_0x65fc('0x29')]=function(_0x563c86,_0x5de76d){var _0x51dc61={},_0x47b89d={},_0x498877={'count':0x0,'rows':[]};var _0x1e70dd=_[_0x65fc('0x2a')](db[_0x65fc('0x2b')][_0x65fc('0x2c')],function(_0x630d5a){return{'name':_0x630d5a[_0x65fc('0x2d')],'type':_0x630d5a[_0x65fc('0x2e')]['key']};});_0x47b89d[_0x65fc('0x2f')]=_[_0x65fc('0x2a')](_0x1e70dd,'name');_0x47b89d[_0x65fc('0x30')]=_['keys'](_0x563c86[_0x65fc('0x30')]);_0x47b89d[_0x65fc('0x31')]=_[_0x65fc('0x32')](_0x47b89d['model'],_0x47b89d[_0x65fc('0x30')]);_0x51dc61[_0x65fc('0x33')]=_['intersection'](_0x47b89d[_0x65fc('0x2f')],qs['fields'](_0x563c86[_0x65fc('0x30')][_0x65fc('0x34')]));_0x51dc61[_0x65fc('0x33')]=_0x51dc61['attributes'][_0x65fc('0x35')]?_0x51dc61[_0x65fc('0x33')]:_0x47b89d[_0x65fc('0x2f')];if(!_0x563c86['query'][_0x65fc('0x36')](_0x65fc('0x37'))){_0x51dc61[_0x65fc('0x1c')]=qs[_0x65fc('0x1c')](_0x563c86['query'][_0x65fc('0x1c')]);_0x51dc61[_0x65fc('0x1a')]=qs[_0x65fc('0x1a')](_0x563c86['query']['offset']);}_0x51dc61[_0x65fc('0x38')]=qs['sort'](_0x563c86[_0x65fc('0x30')][_0x65fc('0x39')]);_0x51dc61[_0x65fc('0x3a')]=qs[_0x65fc('0x31')](_[_0x65fc('0x3b')](_0x563c86[_0x65fc('0x30')],_0x47b89d[_0x65fc('0x31')]),_0x1e70dd);if(_0x563c86[_0x65fc('0x30')][_0x65fc('0x3c')]){_0x51dc61[_0x65fc('0x3a')]=_['merge'](_0x51dc61['where'],{'$or':_[_0x65fc('0x2a')](_0x1e70dd,function(_0x26e683){if(_0x26e683[_0x65fc('0x2e')]!==_0x65fc('0x3d')){var _0x2154de={};_0x2154de[_0x26e683['name']]={'$like':'%'+_0x563c86[_0x65fc('0x30')][_0x65fc('0x3c')]+'%'};return _0x2154de;}})});}_0x51dc61=_[_0x65fc('0x3e')]({},_0x51dc61,_0x563c86[_0x65fc('0x3f')]);var _0x1ddf7c={'where':_0x51dc61[_0x65fc('0x3a')]};return db['AnalyticTreeReport'][_0x65fc('0x1d')](_0x1ddf7c)['then'](function(_0x515cc9){_0x498877[_0x65fc('0x1d')]=_0x515cc9;if(_0x563c86[_0x65fc('0x30')][_0x65fc('0x40')]){_0x51dc61[_0x65fc('0x41')]=[{'all':!![]}];}return db[_0x65fc('0x2b')]['findAll'](_0x51dc61);})[_0x65fc('0x23')](function(_0x58c100){_0x498877[_0x65fc('0x42')]=_0x58c100;return _0x498877;})[_0x65fc('0x23')](respondWithFilteredResult(_0x5de76d,_0x51dc61))[_0x65fc('0x43')](handleError(_0x5de76d,null));};exports[_0x65fc('0x44')]=function(_0x1a6676,_0x472e5b){var _0x133f18={'raw':!![],'where':{'id':_0x1a6676[_0x65fc('0x45')]['id']}},_0x3c444d={};_0x3c444d[_0x65fc('0x2f')]=_['keys'](db[_0x65fc('0x2b')][_0x65fc('0x2c')]);_0x3c444d[_0x65fc('0x30')]=_[_0x65fc('0x46')](_0x1a6676[_0x65fc('0x30')]);_0x3c444d[_0x65fc('0x31')]=_[_0x65fc('0x32')](_0x3c444d[_0x65fc('0x2f')],_0x3c444d[_0x65fc('0x30')]);_0x133f18[_0x65fc('0x33')]=_[_0x65fc('0x32')](_0x3c444d[_0x65fc('0x2f')],qs['fields'](_0x1a6676[_0x65fc('0x30')][_0x65fc('0x34')]));_0x133f18[_0x65fc('0x33')]=_0x133f18[_0x65fc('0x33')][_0x65fc('0x35')]?_0x133f18[_0x65fc('0x33')]:_0x3c444d['model'];if(_0x1a6676[_0x65fc('0x30')][_0x65fc('0x40')]){_0x133f18[_0x65fc('0x41')]=[{'all':!![]}];}_0x133f18=_[_0x65fc('0x3e')]({},_0x133f18,_0x1a6676[_0x65fc('0x3f')]);return db['AnalyticTreeReport']['find'](_0x133f18)['then'](handleEntityNotFound(_0x472e5b,null))[_0x65fc('0x23')](respondWithResult(_0x472e5b,null))[_0x65fc('0x43')](handleError(_0x472e5b,null));};exports[_0x65fc('0x47')]=function(_0x5bad97,_0x38b7f8){return db['AnalyticTreeReport']['create'](_0x5bad97[_0x65fc('0x48')],{})[_0x65fc('0x23')](respondWithResult(_0x38b7f8,0xc9))[_0x65fc('0x43')](handleError(_0x38b7f8,null));};exports['update']=function(_0x5e0d07,_0x5c0be3){if(_0x5e0d07['body']['id']){delete _0x5e0d07[_0x65fc('0x48')]['id'];}return db[_0x65fc('0x2b')]['find']({'where':{'id':_0x5e0d07['params']['id']}})['then'](handleEntityNotFound(_0x5c0be3,null))['then'](saveUpdates(_0x5e0d07[_0x65fc('0x48')],null))[_0x65fc('0x23')](respondWithResult(_0x5c0be3,null))[_0x65fc('0x43')](handleError(_0x5c0be3,null));};exports['destroy']=function(_0x4df909,_0x461caa){return db[_0x65fc('0x2b')][_0x65fc('0x49')]({'where':{'id':_0x4df909['params']['id']}})[_0x65fc('0x23')](handleEntityNotFound(_0x461caa,null))[_0x65fc('0x23')](removeEntity(_0x461caa,null))[_0x65fc('0x43')](handleError(_0x461caa,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 855712b..432404a 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 _0x30d1=['path','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4ba774,_0x490dba){var _0x3bccb1=function(_0x4e56f5){while(--_0x4e56f5){_0x4ba774['push'](_0x4ba774['shift']());}};_0x3bccb1(++_0x490dba);}(_0x30d1,0x1e9));var _0x130d=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0x30d1[_0x1034ee];return _0x2922af;};'use strict';var _=require(_0x130d('0x0'));var util=require(_0x130d('0x1'));var logger=require(_0x130d('0x2'))(_0x130d('0x3'));var moment=require(_0x130d('0x4'));var BPromise=require(_0x130d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x130d('0x6'));var rimraf=require('rimraf');var config=require(_0x130d('0x7'));var attributes=require(_0x130d('0x8'));module['exports']=function(_0x32936c,_0x546f1e){return _0x32936c['define'](_0x130d('0x9'),attributes,{'tableName':_0x130d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3a8=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./analyticTreeReport.attributes','exports'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0xd3a8,0x1ba));var _0x8d3a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd3a8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x8d3a('0x0'));var util=require(_0x8d3a('0x1'));var logger=require(_0x8d3a('0x2'))(_0x8d3a('0x3'));var moment=require(_0x8d3a('0x4'));var BPromise=require(_0x8d3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d3a('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d3a('0x7'));module[_0x8d3a('0x8')]=function(_0x5d4fe0,_0x26eab5){return _0x5d4fe0['define'](_0x8d3a('0x9'),attributes,{'tableName':_0x8d3a('0xa'),'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 eb2984c..6eca58d 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x27f9d3,_0x54ee48){var _0x1d2c10=function(_0x591eae){while(--_0x591eae){_0x27f9d3['push'](_0x27f9d3['shift']());}};_0x1d2c10(++_0x54ee48);}(_0xadb5,0xad));var _0x5adb=function(_0x45e09c,_0x19bdf7){_0x45e09c=_0x45e09c-0x0;var _0x5118ec=_0xadb5[_0x45e09c];return _0x5118ec;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+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(_0x1e867a,_0x1e393c){var _0x1ecee6=function(_0xe87eb6){while(--_0xe87eb6){_0x1e867a['push'](_0x1e867a['shift']());}};_0x1ecee6(++_0x1e393c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x35b9e2,_0x502f41){_0x35b9e2=_0x35b9e2-0x0;var _0xa760d=_0x5f2f[_0x35b9e2];return _0xa760d;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 3097e33..0b2ca61 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 _0xf6bb=['get','isAuthenticated','index','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf6bb,0x117));var _0xbf6b=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xf6bb[_0x3f993e];return _0x39c135;};'use strict';var multer=require('multer');var util=require(_0xbf6b('0x0'));var path=require(_0xbf6b('0x1'));var timeout=require(_0xbf6b('0x2'));var express=require(_0xbf6b('0x3'));var router=express[_0xbf6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf6b('0x5'));var interaction=require(_0xbf6b('0x6'));var config=require(_0xbf6b('0x7'));var controller=require(_0xbf6b('0x8'));router[_0xbf6b('0x9')]('/',auth[_0xbf6b('0xa')](),controller[_0xbf6b('0xb')]);router[_0xbf6b('0x9')](_0xbf6b('0xc'),auth[_0xbf6b('0xa')](),controller[_0xbf6b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf6b('0xe')]);router[_0xbf6b('0xf')](_0xbf6b('0xc'),auth['isAuthenticated'](),controller[_0xbf6b('0x10')]);router[_0xbf6b('0x11')](_0xbf6b('0xc'),auth[_0xbf6b('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb46b=['post','update','delete','destroy','multer','util','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2e2617,_0x8400d4){var _0x41102c=function(_0x4d8589){while(--_0x4d8589){_0x2e2617['push'](_0x2e2617['shift']());}};_0x41102c(++_0x8400d4);}(_0xb46b,0x12a));var _0xbb46=function(_0x1c7103,_0x42e469){_0x1c7103=_0x1c7103-0x0;var _0x1ab05e=_0xb46b[_0x1c7103];return _0x1ab05e;};'use strict';var multer=require(_0xbb46('0x0'));var util=require(_0xbb46('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb46('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xbb46('0x3'));var controller=require(_0xbb46('0x4'));router[_0xbb46('0x5')]('/',auth[_0xbb46('0x6')](),controller[_0xbb46('0x7')]);router[_0xbb46('0x5')](_0xbb46('0x8'),auth[_0xbb46('0x6')](),controller[_0xbb46('0x9')]);router[_0xbb46('0xa')]('/',auth[_0xbb46('0x6')](),controller['create']);router['put']('/:id',auth[_0xbb46('0x6')](),controller[_0xbb46('0xb')]);router[_0xbb46('0xc')](_0xbb46('0x8'),auth[_0xbb46('0x6')](),controller[_0xbb46('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 01abbb7..ac0a3c4 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 _0x1306=['sequelize','exports','STRING'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x1306,0x17a));var _0x6130=function(_0x3dfbc7,_0x3f70af){_0x3dfbc7=_0x3dfbc7-0x0;var _0x871409=_0x1306[_0x3dfbc7];return _0x871409;};'use strict';var Sequelize=require(_0x6130('0x0'));module[_0x6130('0x1')]={'name':{'type':Sequelize[_0x6130('0x2')]},'basename':{'type':Sequelize[_0x6130('0x2')]},'type':{'type':Sequelize[_0x6130('0x2')]}};
\ No newline at end of file
+var _0x843b=['exports','STRING','sequelize'];(function(_0x3f560e,_0x289aa8){var _0x5bf213=function(_0xcc2f71){while(--_0xcc2f71){_0x3f560e['push'](_0x3f560e['shift']());}};_0x5bf213(++_0x289aa8);}(_0x843b,0xc5));var _0xb843=function(_0x19ba4f,_0xc3978f){_0x19ba4f=_0x19ba4f-0x0;var _0x4d0405=_0x843b[_0x19ba4f];return _0x4d0405;};'use strict';var Sequelize=require(_0xb843('0x0'));module[_0xb843('0x1')]={'name':{'type':Sequelize[_0xb843('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb843('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 00d844d..c6279c6 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 _0xd3a9=['save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','options','Attachment','include','findAll','rows','catch','show','params','includeAll','find','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject'];(function(_0x3c4e02,_0x173a9a){var _0x245482=function(_0x2f9c45){while(--_0x2f9c45){_0x3c4e02['push'](_0x3c4e02['shift']());}};_0x245482(++_0x173a9a);}(_0xd3a9,0x184));var _0x9d3a=function(_0x98d6e3,_0x43163b){_0x98d6e3=_0x98d6e3-0x0;var _0x204a44=_0xd3a9[_0x98d6e3];return _0x204a44;};'use strict';var emlformat=require(_0x9d3a('0x0'));var rimraf=require(_0x9d3a('0x1'));var zipdir=require(_0x9d3a('0x2'));var jsonpatch=require(_0x9d3a('0x3'));var rp=require(_0x9d3a('0x4'));var moment=require(_0x9d3a('0x5'));var BPromise=require(_0x9d3a('0x6'));var Mustache=require('mustache');var util=require(_0x9d3a('0x7'));var path=require(_0x9d3a('0x8'));var sox=require('sox');var csv=require(_0x9d3a('0x9'));var ejs=require(_0x9d3a('0xa'));var fs=require('fs');var fs_extra=require(_0x9d3a('0xb'));var _=require('lodash');var squel=require(_0x9d3a('0xc'));var crypto=require('crypto');var jsforce=require(_0x9d3a('0xd'));var deskjs=require(_0x9d3a('0xe'));var toCsv=require(_0x9d3a('0x9'));var querystring=require('querystring');var Papa=require(_0x9d3a('0xf'));var Redis=require('ioredis');var authService=require(_0x9d3a('0x10'));var qs=require(_0x9d3a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d3a('0x12'));var logger=require(_0x9d3a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d3a('0x14'));var db=require(_0x9d3a('0x15'))['db'];function respondWithStatusCode(_0x212832,_0xfa03e9){_0xfa03e9=_0xfa03e9||0xcc;return function(_0x6ad444){if(_0x6ad444){return _0x212832[_0x9d3a('0x16')](_0xfa03e9);}return _0x212832[_0x9d3a('0x17')](_0xfa03e9)[_0x9d3a('0x18')]();};}function respondWithResult(_0x49095a,_0x35cc32){_0x35cc32=_0x35cc32||0xc8;return function(_0x335081){if(_0x335081){return _0x49095a[_0x9d3a('0x17')](_0x35cc32)[_0x9d3a('0x19')](_0x335081);}};}function respondWithFilteredResult(_0x3b5442,_0x2b9550){return function(_0x20bfc9){if(_0x20bfc9){var _0x14cadb=typeof _0x2b9550[_0x9d3a('0x1a')]===_0x9d3a('0x1b')&&typeof _0x2b9550['limit']===_0x9d3a('0x1b');var _0x5c6b42=_0x20bfc9['count'];var _0x4f722a=_0x14cadb?0x0:_0x2b9550['offset'];var _0x4acc99=_0x14cadb?_0x20bfc9[_0x9d3a('0x1c')]:_0x2b9550[_0x9d3a('0x1a')]+_0x2b9550['limit'];var _0x1f46b6;if(_0x4acc99>=_0x5c6b42){_0x4acc99=_0x5c6b42;_0x1f46b6=0xc8;}else{_0x1f46b6=0xce;}_0x3b5442[_0x9d3a('0x17')](_0x1f46b6);return _0x3b5442[_0x9d3a('0x1d')](_0x9d3a('0x1e'),_0x4f722a+'-'+_0x4acc99+'/'+_0x5c6b42)[_0x9d3a('0x19')](_0x20bfc9);}return null;};}function patchUpdates(_0x14f1e9){return function(_0x1bf3d3){try{jsonpatch['apply'](_0x1bf3d3,_0x14f1e9,!![]);}catch(_0x20d610){return BPromise[_0x9d3a('0x1f')](_0x20d610);}return _0x1bf3d3[_0x9d3a('0x20')]();};}function saveUpdates(_0x5ea481,_0x494fd2){return function(_0x584717){if(_0x584717){return _0x584717[_0x9d3a('0x21')](_0x5ea481)[_0x9d3a('0x22')](function(_0x33004e){return _0x33004e;});}return null;};}function removeEntity(_0x384bb5,_0x546852){return function(_0x349fa0){if(_0x349fa0){return _0x349fa0[_0x9d3a('0x23')]()[_0x9d3a('0x22')](function(){_0x384bb5[_0x9d3a('0x17')](0xcc)[_0x9d3a('0x18')]();});}};}function handleEntityNotFound(_0x16e813,_0x349334){return function(_0x50e177){if(!_0x50e177){_0x16e813[_0x9d3a('0x16')](0x194);}return _0x50e177;};}function handleError(_0x423204,_0x5afa3a){_0x5afa3a=_0x5afa3a||0x1f4;return function(_0x2f5ce5){logger['error'](_0x2f5ce5['stack']);if(_0x2f5ce5[_0x9d3a('0x24')]){delete _0x2f5ce5[_0x9d3a('0x24')];}_0x423204[_0x9d3a('0x17')](_0x5afa3a)[_0x9d3a('0x25')](_0x2f5ce5);};}exports[_0x9d3a('0x26')]=function(_0x5bad7c,_0x54507c){var _0x8a1cd9={},_0x4fdf85={},_0x24210b={'count':0x0,'rows':[]};var _0x465f46=_[_0x9d3a('0x27')](db['Attachment'][_0x9d3a('0x28')],function(_0x876682){return{'name':_0x876682[_0x9d3a('0x29')],'type':_0x876682[_0x9d3a('0x2a')][_0x9d3a('0x2b')]};});_0x4fdf85[_0x9d3a('0x2c')]=_['map'](_0x465f46,_0x9d3a('0x24'));_0x4fdf85[_0x9d3a('0x2d')]=_[_0x9d3a('0x2e')](_0x5bad7c['query']);_0x4fdf85[_0x9d3a('0x2f')]=_['intersection'](_0x4fdf85['model'],_0x4fdf85[_0x9d3a('0x2d')]);_0x8a1cd9[_0x9d3a('0x30')]=_[_0x9d3a('0x31')](_0x4fdf85[_0x9d3a('0x2c')],qs[_0x9d3a('0x32')](_0x5bad7c['query'][_0x9d3a('0x32')]));_0x8a1cd9[_0x9d3a('0x30')]=_0x8a1cd9[_0x9d3a('0x30')][_0x9d3a('0x33')]?_0x8a1cd9[_0x9d3a('0x30')]:_0x4fdf85[_0x9d3a('0x2c')];if(!_0x5bad7c[_0x9d3a('0x2d')]['hasOwnProperty'](_0x9d3a('0x34'))){_0x8a1cd9['limit']=qs[_0x9d3a('0x35')](_0x5bad7c[_0x9d3a('0x2d')][_0x9d3a('0x35')]);_0x8a1cd9[_0x9d3a('0x1a')]=qs[_0x9d3a('0x1a')](_0x5bad7c[_0x9d3a('0x2d')][_0x9d3a('0x1a')]);}_0x8a1cd9[_0x9d3a('0x36')]=qs[_0x9d3a('0x37')](_0x5bad7c['query'][_0x9d3a('0x37')]);_0x8a1cd9['where']=qs[_0x9d3a('0x2f')](_[_0x9d3a('0x38')](_0x5bad7c['query'],_0x4fdf85[_0x9d3a('0x2f')]),_0x465f46);if(_0x5bad7c[_0x9d3a('0x2d')][_0x9d3a('0x39')]){_0x8a1cd9['where']=_['merge'](_0x8a1cd9[_0x9d3a('0x3a')],{'$or':_[_0x9d3a('0x27')](_0x465f46,function(_0x259064){if(_0x259064['type']!=='VIRTUAL'){var _0x3a2835={};_0x3a2835[_0x259064[_0x9d3a('0x24')]]={'$like':'%'+_0x5bad7c['query'][_0x9d3a('0x39')]+'%'};return _0x3a2835;}})});}_0x8a1cd9=_[_0x9d3a('0x3b')]({},_0x8a1cd9,_0x5bad7c[_0x9d3a('0x3c')]);var _0x292422={'where':_0x8a1cd9[_0x9d3a('0x3a')]};return db[_0x9d3a('0x3d')][_0x9d3a('0x1c')](_0x292422)[_0x9d3a('0x22')](function(_0xa0149b){_0x24210b[_0x9d3a('0x1c')]=_0xa0149b;if(_0x5bad7c[_0x9d3a('0x2d')]['includeAll']){_0x8a1cd9[_0x9d3a('0x3e')]=[{'all':!![]}];}return db[_0x9d3a('0x3d')][_0x9d3a('0x3f')](_0x8a1cd9);})['then'](function(_0x1b42b0){_0x24210b[_0x9d3a('0x40')]=_0x1b42b0;return _0x24210b;})['then'](respondWithFilteredResult(_0x54507c,_0x8a1cd9))[_0x9d3a('0x41')](handleError(_0x54507c,null));};exports[_0x9d3a('0x42')]=function(_0x4f5e19,_0x1e0804){var _0x47e945={'raw':!![],'where':{'id':_0x4f5e19[_0x9d3a('0x43')]['id']}},_0x1c3163={};_0x1c3163[_0x9d3a('0x2c')]=_[_0x9d3a('0x2e')](db['Attachment'][_0x9d3a('0x28')]);_0x1c3163['query']=_[_0x9d3a('0x2e')](_0x4f5e19[_0x9d3a('0x2d')]);_0x1c3163['filters']=_['intersection'](_0x1c3163[_0x9d3a('0x2c')],_0x1c3163[_0x9d3a('0x2d')]);_0x47e945['attributes']=_[_0x9d3a('0x31')](_0x1c3163[_0x9d3a('0x2c')],qs[_0x9d3a('0x32')](_0x4f5e19[_0x9d3a('0x2d')]['fields']));_0x47e945[_0x9d3a('0x30')]=_0x47e945['attributes'][_0x9d3a('0x33')]?_0x47e945[_0x9d3a('0x30')]:_0x1c3163[_0x9d3a('0x2c')];if(_0x4f5e19[_0x9d3a('0x2d')][_0x9d3a('0x44')]){_0x47e945[_0x9d3a('0x3e')]=[{'all':!![]}];}_0x47e945=_[_0x9d3a('0x3b')]({},_0x47e945,_0x4f5e19[_0x9d3a('0x3c')]);return db[_0x9d3a('0x3d')][_0x9d3a('0x45')](_0x47e945)[_0x9d3a('0x22')](handleEntityNotFound(_0x1e0804,null))['then'](respondWithResult(_0x1e0804,null))[_0x9d3a('0x41')](handleError(_0x1e0804,null));};exports['clone']=function(_0x12ff84,_0x4824d1){var _0x32e9cf={'where':{'id':_0x12ff84[_0x9d3a('0x43')]['id']}},_0x7900b7={};_0x7900b7['model']=_[_0x9d3a('0x2e')](db[_0x9d3a('0x3d')][_0x9d3a('0x28')]);_0x32e9cf[_0x9d3a('0x30')]=_[_0x9d3a('0x31')](_0x7900b7[_0x9d3a('0x2c')],qs[_0x9d3a('0x32')](_0x12ff84[_0x9d3a('0x2d')][_0x9d3a('0x32')]));_0x32e9cf[_0x9d3a('0x30')]=_0x32e9cf[_0x9d3a('0x30')][_0x9d3a('0x33')]?_0x32e9cf['attributes']:_0x7900b7[_0x9d3a('0x2c')];if(_0x12ff84[_0x9d3a('0x2d')][_0x9d3a('0x44')]){_0x32e9cf[_0x9d3a('0x3e')]=[{'all':!![]}];}_0x32e9cf=_['merge']({},_0x32e9cf,_0x12ff84[_0x9d3a('0x3c')]);return db['Attachment']['find'](_0x32e9cf)[_0x9d3a('0x22')](handleEntityNotFound(_0x4824d1,null))[_0x9d3a('0x22')](function(_0x33c8e0){if(_0x33c8e0){var _0x55a692=_0x33c8e0['get']({'plain':!![]});_0x55a692=qs[_0x9d3a('0x46')](_0x55a692,['id','createdAt',_0x9d3a('0x47')]);_0x12ff84[_0x9d3a('0x48')]=_[_0x9d3a('0x46')](_0x12ff84['body'],['id',_0x9d3a('0x49'),'updatedAt']);return db[_0x9d3a('0x3d')]['create'](_[_0x9d3a('0x3b')](_0x55a692,_0x12ff84['body']),{'include':_0x12ff84[_0x9d3a('0x2d')][_0x9d3a('0x44')]?[{'all':!![]}]:undefined});}})[_0x9d3a('0x22')](respondWithResult(_0x4824d1,0xc9))[_0x9d3a('0x41')](handleError(_0x4824d1,null));};exports[_0x9d3a('0x21')]=function(_0x2f256e,_0x2fbd00){if(_0x2f256e[_0x9d3a('0x48')]['id']){delete _0x2f256e[_0x9d3a('0x48')]['id'];}return db[_0x9d3a('0x3d')][_0x9d3a('0x45')]({'where':{'id':_0x2f256e[_0x9d3a('0x43')]['id']}})[_0x9d3a('0x22')](handleEntityNotFound(_0x2fbd00,null))[_0x9d3a('0x22')](saveUpdates(_0x2f256e[_0x9d3a('0x48')],null))[_0x9d3a('0x22')](respondWithResult(_0x2fbd00,null))[_0x9d3a('0x41')](handleError(_0x2fbd00,null));};exports[_0x9d3a('0x23')]=function(_0x4230b8,_0x1eab3c){return db[_0x9d3a('0x3d')][_0x9d3a('0x45')]({'where':{'id':_0x4230b8[_0x9d3a('0x43')]['id']}})[_0x9d3a('0x22')](handleEntityNotFound(_0x1eab3c,null))[_0x9d3a('0x22')](removeEntity(_0x1eab3c,null))[_0x9d3a('0x41')](handleError(_0x1eab3c,null));};exports[_0x9d3a('0x4a')]=function(_0xbf72f9,_0x42248,_0x4d7a22){_0xbf72f9[_0x9d3a('0x48')]['name']=_0xbf72f9[_0x9d3a('0x4b')][_0x9d3a('0x4c')];_0xbf72f9[_0x9d3a('0x48')]['basename']=_0xbf72f9[_0x9d3a('0x4b')][_0x9d3a('0x4d')];_0xbf72f9['body'][_0x9d3a('0x2a')]=_0xbf72f9['file'][_0x9d3a('0x4e')];return db[_0x9d3a('0x3d')]['create'](_0xbf72f9['body'])[_0x9d3a('0x22')](respondWithResult(_0x42248,0xc9))['catch'](handleError(_0x42248,null));};exports[_0x9d3a('0x4f')]=function(_0x6ecad2,_0x4fcd64,_0x1a0733){return db['Attachment'][_0x9d3a('0x50')]({'where':{'id':_0x6ecad2[_0x9d3a('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4fcd64,null))[_0x9d3a('0x22')](function(_0x2a7c8d){if(_0x2a7c8d){var _0x2ae3fe=_0x2a7c8d['ChatOfflineMessageId']!==null;var _0x2c29ab=path[_0x9d3a('0x51')](config[_0x9d3a('0x52')],'server/files/attachments/');if(_0x2ae3fe){_0x2c29ab=path[_0x9d3a('0x51')](_0x2c29ab,_0x9d3a('0x53'));}var _0x56a999=path[_0x9d3a('0x51')](_0x2c29ab,_0x2a7c8d['basename']);return _0x4fcd64[_0x9d3a('0x4f')](_0x56a999);}})['catch'](handleError(_0x4fcd64,null));};
\ No newline at end of file
+var _0x6155=['download','findOne','root','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','updatedAt','body','create','file','originalname','filename','mimetype'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0x6155,0x118));var _0x5615=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6155[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0x5615('0x0'));var rimraf=require(_0x5615('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5615('0x2'));var rp=require(_0x5615('0x3'));var moment=require(_0x5615('0x4'));var BPromise=require(_0x5615('0x5'));var Mustache=require('mustache');var util=require(_0x5615('0x6'));var path=require(_0x5615('0x7'));var sox=require('sox');var csv=require(_0x5615('0x8'));var ejs=require(_0x5615('0x9'));var fs=require('fs');var fs_extra=require(_0x5615('0xa'));var _=require(_0x5615('0xb'));var squel=require('squel');var crypto=require(_0x5615('0xc'));var jsforce=require(_0x5615('0xd'));var deskjs=require(_0x5615('0xe'));var toCsv=require(_0x5615('0x8'));var querystring=require(_0x5615('0xf'));var Papa=require(_0x5615('0x10'));var Redis=require('ioredis');var authService=require(_0x5615('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5615('0x12'));var hardwareService=require(_0x5615('0x13'));var logger=require(_0x5615('0x14'))('api');var utils=require(_0x5615('0x15'));var config=require(_0x5615('0x16'));var licenseUtil=require(_0x5615('0x17'));var db=require(_0x5615('0x18'))['db'];function respondWithStatusCode(_0x290f36,_0x56b413){_0x56b413=_0x56b413||0xcc;return function(_0x3fb5da){if(_0x3fb5da){return _0x290f36[_0x5615('0x19')](_0x56b413);}return _0x290f36[_0x5615('0x1a')](_0x56b413)[_0x5615('0x1b')]();};}function respondWithResult(_0x142393,_0x410b76){_0x410b76=_0x410b76||0xc8;return function(_0x39f59b){if(_0x39f59b){return _0x142393['status'](_0x410b76)[_0x5615('0x1c')](_0x39f59b);}};}function respondWithFilteredResult(_0x333249,_0xe53024){return function(_0x30e7a1){if(_0x30e7a1){var _0x56b06c=typeof _0xe53024[_0x5615('0x1d')]==='undefined'&&typeof _0xe53024[_0x5615('0x1e')]===_0x5615('0x1f');var _0x533ad3=_0x30e7a1[_0x5615('0x20')];var _0xc4a04a=_0x56b06c?0x0:_0xe53024[_0x5615('0x1d')];var _0x3f0386=_0x56b06c?_0x30e7a1[_0x5615('0x20')]:_0xe53024[_0x5615('0x1d')]+_0xe53024[_0x5615('0x1e')];var _0x1b29d8;if(_0x3f0386>=_0x533ad3){_0x3f0386=_0x533ad3;_0x1b29d8=0xc8;}else{_0x1b29d8=0xce;}_0x333249[_0x5615('0x1a')](_0x1b29d8);return _0x333249[_0x5615('0x21')](_0x5615('0x22'),_0xc4a04a+'-'+_0x3f0386+'/'+_0x533ad3)[_0x5615('0x1c')](_0x30e7a1);}return null;};}function patchUpdates(_0x1574e1){return function(_0x1f21e5){try{jsonpatch['apply'](_0x1f21e5,_0x1574e1,!![]);}catch(_0x4a6a78){return BPromise['reject'](_0x4a6a78);}return _0x1f21e5[_0x5615('0x23')]();};}function saveUpdates(_0x198e22,_0xea4d7e){return function(_0x9a61d6){if(_0x9a61d6){return _0x9a61d6[_0x5615('0x24')](_0x198e22)[_0x5615('0x25')](function(_0x57d827){return _0x57d827;});}return null;};}function removeEntity(_0x4f1bdc,_0x525402){return function(_0x9d5b2){if(_0x9d5b2){return _0x9d5b2[_0x5615('0x26')]()[_0x5615('0x25')](function(){_0x4f1bdc[_0x5615('0x1a')](0xcc)[_0x5615('0x1b')]();});}};}function handleEntityNotFound(_0x54efdb,_0x52f94b){return function(_0x1c6ed2){if(!_0x1c6ed2){_0x54efdb[_0x5615('0x19')](0x194);}return _0x1c6ed2;};}function handleError(_0x3e79d6,_0x4965e7){_0x4965e7=_0x4965e7||0x1f4;return function(_0x1de927){logger[_0x5615('0x27')](_0x1de927[_0x5615('0x28')]);if(_0x1de927[_0x5615('0x29')]){delete _0x1de927[_0x5615('0x29')];}_0x3e79d6['status'](_0x4965e7)[_0x5615('0x2a')](_0x1de927);};}exports[_0x5615('0x2b')]=function(_0x2ac617,_0x3b2c60){var _0x532dbe={},_0x43c25a={},_0x272ac9={'count':0x0,'rows':[]};var _0x22a4e2=_[_0x5615('0x2c')](db[_0x5615('0x2d')][_0x5615('0x2e')],function(_0x211687){return{'name':_0x211687[_0x5615('0x2f')],'type':_0x211687[_0x5615('0x30')]['key']};});_0x43c25a[_0x5615('0x31')]=_[_0x5615('0x2c')](_0x22a4e2,'name');_0x43c25a['query']=_[_0x5615('0x32')](_0x2ac617['query']);_0x43c25a[_0x5615('0x33')]=_[_0x5615('0x34')](_0x43c25a[_0x5615('0x31')],_0x43c25a['query']);_0x532dbe[_0x5615('0x35')]=_['intersection'](_0x43c25a['model'],qs[_0x5615('0x36')](_0x2ac617[_0x5615('0x37')]['fields']));_0x532dbe[_0x5615('0x35')]=_0x532dbe['attributes'][_0x5615('0x38')]?_0x532dbe[_0x5615('0x35')]:_0x43c25a[_0x5615('0x31')];if(!_0x2ac617[_0x5615('0x37')][_0x5615('0x39')](_0x5615('0x3a'))){_0x532dbe[_0x5615('0x1e')]=qs[_0x5615('0x1e')](_0x2ac617[_0x5615('0x37')][_0x5615('0x1e')]);_0x532dbe[_0x5615('0x1d')]=qs[_0x5615('0x1d')](_0x2ac617[_0x5615('0x37')]['offset']);}_0x532dbe[_0x5615('0x3b')]=qs[_0x5615('0x3c')](_0x2ac617[_0x5615('0x37')][_0x5615('0x3c')]);_0x532dbe[_0x5615('0x3d')]=qs[_0x5615('0x33')](_[_0x5615('0x3e')](_0x2ac617[_0x5615('0x37')],_0x43c25a['filters']),_0x22a4e2);if(_0x2ac617[_0x5615('0x37')][_0x5615('0x3f')]){_0x532dbe[_0x5615('0x3d')]=_['merge'](_0x532dbe['where'],{'$or':_[_0x5615('0x2c')](_0x22a4e2,function(_0x2395c5){if(_0x2395c5[_0x5615('0x30')]!=='VIRTUAL'){var _0x4c3832={};_0x4c3832[_0x2395c5['name']]={'$like':'%'+_0x2ac617[_0x5615('0x37')]['filter']+'%'};return _0x4c3832;}})});}_0x532dbe=_[_0x5615('0x40')]({},_0x532dbe,_0x2ac617[_0x5615('0x41')]);var _0x2d8d47={'where':_0x532dbe[_0x5615('0x3d')]};return db[_0x5615('0x2d')][_0x5615('0x20')](_0x2d8d47)[_0x5615('0x25')](function(_0x126393){_0x272ac9[_0x5615('0x20')]=_0x126393;if(_0x2ac617[_0x5615('0x37')][_0x5615('0x42')]){_0x532dbe[_0x5615('0x43')]=[{'all':!![]}];}return db[_0x5615('0x2d')][_0x5615('0x44')](_0x532dbe);})[_0x5615('0x25')](function(_0x2ca8ef){_0x272ac9[_0x5615('0x45')]=_0x2ca8ef;return _0x272ac9;})[_0x5615('0x25')](respondWithFilteredResult(_0x3b2c60,_0x532dbe))[_0x5615('0x46')](handleError(_0x3b2c60,null));};exports[_0x5615('0x47')]=function(_0x4826a9,_0x27c1f9){var _0x5cbc56={'raw':!![],'where':{'id':_0x4826a9[_0x5615('0x48')]['id']}},_0x113482={};_0x113482[_0x5615('0x31')]=_[_0x5615('0x32')](db[_0x5615('0x2d')][_0x5615('0x2e')]);_0x113482[_0x5615('0x37')]=_[_0x5615('0x32')](_0x4826a9['query']);_0x113482[_0x5615('0x33')]=_[_0x5615('0x34')](_0x113482[_0x5615('0x31')],_0x113482[_0x5615('0x37')]);_0x5cbc56[_0x5615('0x35')]=_[_0x5615('0x34')](_0x113482[_0x5615('0x31')],qs[_0x5615('0x36')](_0x4826a9['query'][_0x5615('0x36')]));_0x5cbc56['attributes']=_0x5cbc56[_0x5615('0x35')][_0x5615('0x38')]?_0x5cbc56[_0x5615('0x35')]:_0x113482[_0x5615('0x31')];if(_0x4826a9[_0x5615('0x37')][_0x5615('0x42')]){_0x5cbc56[_0x5615('0x43')]=[{'all':!![]}];}_0x5cbc56=_[_0x5615('0x40')]({},_0x5cbc56,_0x4826a9[_0x5615('0x41')]);return db[_0x5615('0x2d')][_0x5615('0x49')](_0x5cbc56)[_0x5615('0x25')](handleEntityNotFound(_0x27c1f9,null))[_0x5615('0x25')](respondWithResult(_0x27c1f9,null))[_0x5615('0x46')](handleError(_0x27c1f9,null));};exports[_0x5615('0x4a')]=function(_0x1c3d14,_0x314c8){var _0x59ba5e={'where':{'id':_0x1c3d14[_0x5615('0x48')]['id']}},_0x4572eb={};_0x4572eb[_0x5615('0x31')]=_[_0x5615('0x32')](db[_0x5615('0x2d')][_0x5615('0x2e')]);_0x59ba5e['attributes']=_[_0x5615('0x34')](_0x4572eb[_0x5615('0x31')],qs[_0x5615('0x36')](_0x1c3d14[_0x5615('0x37')][_0x5615('0x36')]));_0x59ba5e[_0x5615('0x35')]=_0x59ba5e['attributes']['length']?_0x59ba5e[_0x5615('0x35')]:_0x4572eb[_0x5615('0x31')];if(_0x1c3d14[_0x5615('0x37')]['includeAll']){_0x59ba5e['include']=[{'all':!![]}];}_0x59ba5e=_['merge']({},_0x59ba5e,_0x1c3d14[_0x5615('0x41')]);return db[_0x5615('0x2d')][_0x5615('0x49')](_0x59ba5e)[_0x5615('0x25')](handleEntityNotFound(_0x314c8,null))[_0x5615('0x25')](function(_0x2d0fe9){if(_0x2d0fe9){var _0x4eb887=_0x2d0fe9[_0x5615('0x4b')]({'plain':!![]});_0x4eb887=qs[_0x5615('0x4c')](_0x4eb887,['id','createdAt',_0x5615('0x4d')]);_0x1c3d14[_0x5615('0x4e')]=_[_0x5615('0x4c')](_0x1c3d14[_0x5615('0x4e')],['id','createdAt',_0x5615('0x4d')]);return db[_0x5615('0x2d')][_0x5615('0x4f')](_[_0x5615('0x40')](_0x4eb887,_0x1c3d14[_0x5615('0x4e')]),{'include':_0x1c3d14[_0x5615('0x37')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5615('0x25')](respondWithResult(_0x314c8,0xc9))[_0x5615('0x46')](handleError(_0x314c8,null));};exports[_0x5615('0x24')]=function(_0x482b0b,_0x31dada){if(_0x482b0b[_0x5615('0x4e')]['id']){delete _0x482b0b['body']['id'];}return db[_0x5615('0x2d')][_0x5615('0x49')]({'where':{'id':_0x482b0b[_0x5615('0x48')]['id']}})[_0x5615('0x25')](handleEntityNotFound(_0x31dada,null))[_0x5615('0x25')](saveUpdates(_0x482b0b[_0x5615('0x4e')],null))['then'](respondWithResult(_0x31dada,null))[_0x5615('0x46')](handleError(_0x31dada,null));};exports[_0x5615('0x26')]=function(_0x3f730a,_0x4871c9){return db[_0x5615('0x2d')][_0x5615('0x49')]({'where':{'id':_0x3f730a[_0x5615('0x48')]['id']}})[_0x5615('0x25')](handleEntityNotFound(_0x4871c9,null))[_0x5615('0x25')](removeEntity(_0x4871c9,null))[_0x5615('0x46')](handleError(_0x4871c9,null));};exports[_0x5615('0x4f')]=function(_0x160507,_0x542ba1,_0x47ccde){_0x160507[_0x5615('0x4e')]['name']=_0x160507[_0x5615('0x50')][_0x5615('0x51')];_0x160507[_0x5615('0x4e')]['basename']=_0x160507[_0x5615('0x50')][_0x5615('0x52')];_0x160507[_0x5615('0x4e')][_0x5615('0x30')]=_0x160507['file'][_0x5615('0x53')];return db['Attachment'][_0x5615('0x4f')](_0x160507['body'])[_0x5615('0x25')](respondWithResult(_0x542ba1,0xc9))['catch'](handleError(_0x542ba1,null));};exports[_0x5615('0x54')]=function(_0xe31db5,_0x1106b2,_0x1ffd73){return db[_0x5615('0x2d')][_0x5615('0x55')]({'where':{'id':_0xe31db5['params']['id']},'raw':!![]})[_0x5615('0x25')](handleEntityNotFound(_0x1106b2,null))[_0x5615('0x25')](function(_0x58b159){if(_0x58b159){var _0x5c09f0=_0x58b159['ChatOfflineMessageId']!==null;var _0x2ee9b1=path['join'](config[_0x5615('0x56')],_0x5615('0x57'));if(_0x5c09f0){_0x2ee9b1=path[_0x5615('0x58')](_0x2ee9b1,_0x5615('0x59'));}var _0x328730=path[_0x5615('0x58')](_0x2ee9b1,_0x58b159[_0x5615('0x5a')]);return _0x1106b2[_0x5615('0x54')](_0x328730);}})[_0x5615('0x46')](handleError(_0x1106b2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 6ac6469..97e9f03 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 _0xdc2c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Attachment','attachments','lodash','../../config/logger'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xdc2c,0xf0));var _0xcdc2=function(_0xbc0b4d,_0x48d139){_0xbc0b4d=_0xbc0b4d-0x0;var _0x5920d7=_0xdc2c[_0xbc0b4d];return _0x5920d7;};'use strict';var _=require(_0xcdc2('0x0'));var util=require('util');var logger=require(_0xcdc2('0x1'))('api');var moment=require(_0xcdc2('0x2'));var BPromise=require(_0xcdc2('0x3'));var rp=require(_0xcdc2('0x4'));var fs=require('fs');var path=require(_0xcdc2('0x5'));var rimraf=require(_0xcdc2('0x6'));var config=require(_0xcdc2('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x4826af,_0x21d511){return _0x4826af[_0xcdc2('0x8')](_0xcdc2('0x9'),attributes,{'tableName':_0xcdc2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfd4=['path','./attachment.attributes','define','Attachment','attachments','util','bluebird','request-promise'];(function(_0x1ba19c,_0x3975e2){var _0x4e069b=function(_0xd95964){while(--_0xd95964){_0x1ba19c['push'](_0x1ba19c['shift']());}};_0x4e069b(++_0x3975e2);}(_0xbfd4,0xfd));var _0x4bfd=function(_0x1db9df,_0x2965c4){_0x1db9df=_0x1db9df-0x0;var _0x509da3=_0xbfd4[_0x1db9df];return _0x509da3;};'use strict';var _=require('lodash');var util=require(_0x4bfd('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4bfd('0x1'));var rp=require(_0x4bfd('0x2'));var fs=require('fs');var path=require(_0x4bfd('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4bfd('0x4'));module['exports']=function(_0x4f4e1b,_0x1329cf){return _0x4f4e1b[_0x4bfd('0x5')](_0x4bfd('0x6'),attributes,{'tableName':_0x4bfd('0x7'),'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 38967ae..4227b72 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 _0xad95=['ioredis','../../mysqldb','rpc','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xad95,0x70));var _0x5ad9=function(_0x16ae0f,_0x3517b6){_0x16ae0f=_0x16ae0f-0x0;var _0x508a1f=_0xad95[_0x16ae0f];return _0x508a1f;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('Attachment,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('Attachment,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});}exports[_0x5ad9('0x11')]=function(_0x54f392){var _0x3d1c8f=this;return new Promise(function(_0x28682f,_0xe4171b){return db[_0x5ad9('0x12')][_0x5ad9('0x13')](_0x54f392[_0x5ad9('0x14')],{'raw':_0x54f392[_0x5ad9('0x15')]?_0x54f392['options'][_0x5ad9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x49363b){logger[_0x5ad9('0xe')]('CreateAttachment',_0x54f392);logger[_0x5ad9('0x9')](_0x5ad9('0x11'),_0x54f392,JSON[_0x5ad9('0xa')](_0x49363b));_0x28682f(_0x49363b);})[_0x5ad9('0x10')](function(_0x1274f7){logger['error'](_0x5ad9('0x11'),_0x1274f7['message'],_0x54f392);_0xe4171b(_0x3d1c8f[_0x5ad9('0xb')](0x1f4,_0x1274f7['message']));});});};
\ No newline at end of file
+var _0x4ea3=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','raw','debug'];(function(_0x3372dc,_0x18ff49){var _0x511d15=function(_0x310ffe){while(--_0x310ffe){_0x3372dc['push'](_0x3372dc['shift']());}};_0x511d15(++_0x18ff49);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('Attachment,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});}exports[_0x34ea('0x15')]=function(_0x34caea){var _0x5aeea3=this;return new Promise(function(_0x5340a4,_0x72fef0){return db[_0x34ea('0x16')][_0x34ea('0x17')](_0x34caea[_0x34ea('0x18')],{'raw':_0x34caea['options']?_0x34caea[_0x34ea('0x19')][_0x34ea('0x1a')]===undefined?!![]:![]:!![]})[_0x34ea('0xb')](function(_0x247ee7){logger['info']('CreateAttachment',_0x34caea);logger[_0x34ea('0x1b')](_0x34ea('0x15'),_0x34caea,JSON[_0x34ea('0x10')](_0x247ee7));_0x5340a4(_0x247ee7);})['catch'](function(_0x5197a2){logger[_0x34ea('0x11')](_0x34ea('0x15'),_0x5197a2[_0x34ea('0x13')],_0x34caea);_0x72fef0(_0x5aeea3[_0x34ea('0x11')](0x1f4,_0x5197a2[_0x34ea('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index e64cb1d..2c49cc5 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(_0x4482ff,_0x46609e){_0x4482ff=_0x4482ff-0x0;var _0x17b0c7=_0xdb28[_0x4482ff];return _0x17b0c7;};'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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x2e7b47,_0xc8447d){var _0x194a23=function(_0x3369d9){while(--_0x3369d9){_0x2e7b47['push'](_0x2e7b47['shift']());}};_0x194a23(++_0xc8447d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a6269,_0x5deea5){_0x1a6269=_0x1a6269-0x0;var _0x536f68=_0xb10b[_0x1a6269];return _0x536f68;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0e24a41..84608c4 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 _0x219b=['findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile','email','callback','clientSecret','Setting'];(function(_0x272728,_0x5cc52d){var _0x2b7d86=function(_0x4fb4a3){while(--_0x4fb4a3){_0x272728['push'](_0x272728['shift']());}};_0x2b7d86(++_0x5cc52d);}(_0x219b,0x1d0));var _0xb219=function(_0x3649d9,_0x486750){_0x3649d9=_0x3649d9-0x0;var _0x151977=_0x219b[_0x3649d9];return _0x151977;};'use strict';var _=require(_0xb219('0x0'));var passport=require(_0xb219('0x1'));var GoogleStrategy=require(_0xb219('0x2'))['Strategy'];var moment=require(_0xb219('0x3'));var db=require(_0xb219('0x4'))['db'];var config=require(_0xb219('0x5'));var signToken=require(_0xb219('0x6'))[_0xb219('0x7')];var utils=require(_0xb219('0x8'));exports['login']=passport[_0xb219('0x9')](_0xb219('0xa'),{'failureRedirect':_0xb219('0xb'),'scope':[_0xb219('0xc'),_0xb219('0xd')],'session':![]});exports[_0xb219('0xe')]=passport[_0xb219('0x9')]('google',{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xb219('0xa')]?config[_0xb219('0xa')]['clientID']:'id','clientSecret':config['google']?config['google'][_0xb219('0xf')]:'secret','callbackURL':config['google']?config['google']['callbackURL']:''},function(_0x49741f,_0x4311ae,_0x46e091,_0x45541b){var _0x1aedb5,_0x130bd5;return db[_0xb219('0x10')][_0xb219('0x11')]({'where':{'id':0x1},'attributes':[_0xb219('0x12'),_0xb219('0x13')],'raw':!![]})[_0xb219('0x14')](function(_0x455561){_0x1aedb5=_0x455561;return db[_0xb219('0x15')][_0xb219('0x16')]({'where':{'email':_[_0xb219('0x17')](_0x46e091[_0xb219('0x18')],_0xb219('0x19')),'role':{'$or':[_0xb219('0x1a'),_0xb219('0x1b'),_0xb219('0x1c')]}}});})[_0xb219('0x14')](function(_0x68dfee){_0x130bd5=_0x68dfee;if(_0x130bd5){if(_0x130bd5[_0xb219('0x1d')]){return _0x45541b(_0xb219('0x1e'));}else if(_0x1aedb5[_0xb219('0x13')]>0x0){if(_0x130bd5[_0xb219('0x1f')]){if(moment(_0x130bd5['blockedAt'])[_0xb219('0x20')](_0x1aedb5[_0xb219('0x13')],_0xb219('0x21'))>moment()){return _0x45541b(_0xb219('0x1e'));}else{return utils[_0xb219('0x22')](_0x130bd5,0x0,![],null)[_0xb219('0x14')](function(){return utils['getLicense'](_0x130bd5);})[_0xb219('0x14')](function(){return _0x45541b(null,_0x130bd5);});}}else{return utils[_0xb219('0x23')](_0x130bd5)[_0xb219('0x14')](function(){return _0x45541b(null,_0x130bd5);});}}else{return utils[_0xb219('0x23')](_0x130bd5)[_0xb219('0x14')](function(){return _0x45541b(null,_0x130bd5);});}}return _0x45541b(_0xb219('0x1e'));})[_0xb219('0x24')](function(_0x3ec0ba){_0x45541b(_0x3ec0ba);});}));
\ No newline at end of file
+var _0xce3e=['../../components/auth/service','signToken','login','authenticate','google','profile','email','/login','clientSecret','secret','callbackURL','Setting','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','getLicense','then','catch','lodash','../../config/environment'];(function(_0x59c0e9,_0xad6e56){var _0x1590a3=function(_0x386c08){while(--_0x386c08){_0x59c0e9['push'](_0x59c0e9['shift']());}};_0x1590a3(++_0xad6e56);}(_0xce3e,0x12a));var _0xece3=function(_0x419a9e,_0x283d06){_0x419a9e=_0x419a9e-0x0;var _0x18105d=_0xce3e[_0x419a9e];return _0x18105d;};'use strict';var _=require(_0xece3('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0xece3('0x1'));var signToken=require(_0xece3('0x2'))[_0xece3('0x3')];var utils=require('../../config/utils');exports[_0xece3('0x4')]=passport[_0xece3('0x5')](_0xece3('0x6'),{'failureRedirect':'/login','scope':[_0xece3('0x7'),_0xece3('0x8')],'session':![]});exports['callback']=passport[_0xece3('0x5')](_0xece3('0x6'),{'failureRedirect':_0xece3('0x9'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xece3('0x6')]?config[_0xece3('0x6')]['clientID']:'id','clientSecret':config['google']?config[_0xece3('0x6')][_0xece3('0xa')]:_0xece3('0xb'),'callbackURL':config[_0xece3('0x6')]?config['google'][_0xece3('0xc')]:''},function(_0x4504b5,_0x2f52fa,_0x5ed342,_0x18cea8){var _0x9b7c7c,_0x5774bd;return db[_0xece3('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x8ea343){_0x9b7c7c=_0x8ea343;return db[_0xece3('0xe')][_0xece3('0xf')]({'where':{'email':_[_0xece3('0x10')](_0x5ed342[_0xece3('0x11')],_0xece3('0x12')),'role':{'$or':[_0xece3('0x13'),'user',_0xece3('0x14')]}}});})['then'](function(_0x1eca6a){_0x5774bd=_0x1eca6a;if(_0x5774bd){if(_0x5774bd[_0xece3('0x15')]){return _0x18cea8(_0xece3('0x16'));}else if(_0x9b7c7c[_0xece3('0x17')]>0x0){if(_0x5774bd['blocked']){if(moment(_0x5774bd['blockedAt'])[_0xece3('0x18')](_0x9b7c7c['blockDuration'],_0xece3('0x19'))>moment()){return _0x18cea8(_0xece3('0x16'));}else{return utils[_0xece3('0x1a')](_0x5774bd,0x0,![],null)['then'](function(){return utils[_0xece3('0x1b')](_0x5774bd);})[_0xece3('0x1c')](function(){return _0x18cea8(null,_0x5774bd);});}}else{return utils['getLicense'](_0x5774bd)[_0xece3('0x1c')](function(){return _0x18cea8(null,_0x5774bd);});}}else{return utils[_0xece3('0x1b')](_0x5774bd)[_0xece3('0x1c')](function(){return _0x18cea8(null,_0x5774bd);});}}return _0x18cea8(_0xece3('0x16'));})[_0xece3('0x1d')](function(_0x2a22a1){_0x18cea8(_0x2a22a1);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index a3eb42a..b5fbe12 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 _0x784d=['express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','login','setTokenCookie','exports'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x784d,0x140));var _0xd784=function(_0x2045c6,_0x14b2de){_0x2045c6=_0x2045c6-0x0;var _0x4f6f04=_0x784d[_0x2045c6];return _0x4f6f04;};'use strict';var express=require(_0xd784('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xd784('0x1'));var userController=require(_0xd784('0x2'));var authService=require(_0xd784('0x3'));router[_0xd784('0x4')]('/',controller['login']);router[_0xd784('0x4')](_0xd784('0x5'),controller[_0xd784('0x6')],authService['isMiddleware'],userController[_0xd784('0x7')],authService[_0xd784('0x8')]);module[_0xd784('0x9')]=router;
\ No newline at end of file
+var _0xea89=['Router','./authGoogle.controller','../user/user.controller.js','get','callback','isMiddleware','login','setTokenCookie','exports','express','passport'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xea89,0x1e2));var _0x9ea8=function(_0x8447a,_0x16b3a1){_0x8447a=_0x8447a-0x0;var _0x565c94=_0xea89[_0x8447a];return _0x565c94;};'use strict';var express=require(_0x9ea8('0x0'));var passport=require(_0x9ea8('0x1'));var router=express[_0x9ea8('0x2')]();var controller=require(_0x9ea8('0x3'));var userController=require(_0x9ea8('0x4'));var authService=require('../../components/auth/service');router[_0x9ea8('0x5')]('/',controller['login']);router[_0x9ea8('0x5')]('/callback',controller[_0x9ea8('0x6')],authService[_0x9ea8('0x7')],userController[_0x9ea8('0x8')],authService[_0x9ea8('0x9')]);module[_0x9ea8('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index d87ab8c..2d159b6 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 _0x919c=['merge','format','SendMail','error','stringify','status','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','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://','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','Password\x20reset!','use','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','then','name','role','disabled','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','blockDuration','add','minutes','clearBlockUser','blockedAt','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass'];(function(_0x31ce94,_0x246777){var _0x16ca31=function(_0x1af663){while(--_0x1af663){_0x31ce94['push'](_0x31ce94['shift']());}};_0x16ca31(++_0x246777);}(_0x919c,0x7d));var _0xc919=function(_0x37b6f1,_0x4cb6fa){_0x37b6f1=_0x37b6f1-0x0;var _0x199d32=_0x919c[_0x37b6f1];return _0x199d32;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0xc919('0x0')];var jayson=require(_0xc919('0x1'));var _=require(_0xc919('0x2'));var rs=require(_0xc919('0x3'));var moment=require(_0xc919('0x4'));var db=require(_0xc919('0x5'))['db'];var authService=require(_0xc919('0x6'));var utils=require(_0xc919('0x7'));var client=jayson[_0xc919('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x2fd35f,_0x5e060e,_0x1c896e,_0x3522f0){var _0x15b44a,_0x263352;return db[_0xc919('0x9')][_0xc919('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xc919('0xb')](function(_0x19598d){_0x15b44a=_0x19598d;return _0x2fd35f[_0xc919('0xa')]({'attributes':['id',_0xc919('0xc'),'password','salt',_0xc919('0xd'),_0xc919('0xe'),'blocked','blockedAt',_0xc919('0xf')],'where':{'name':_0x5e060e,'role':{'$or':['admin',_0xc919('0x10'),_0xc919('0x11')]}}});})['then'](function(_0x4ef4dc){if(!_0x4ef4dc||_0x4ef4dc&&_0x4ef4dc[_0xc919('0xc')]!==_0x5e060e){throw new Error(_0xc919('0x12'));}else{_0x263352=_0x4ef4dc;return _0x263352;}})['then'](function(){_0x263352['authenticate'](_0x1c896e,function(_0x1597f0,_0x1f233c){var _0x721dc2=_0x263352[_0xc919('0xf')]+0x1;if(_0x1597f0){return _0x3522f0(_0x1597f0);}else if(!_0x1f233c){if(_0x263352[_0xc919('0xe')]){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else if(_0x15b44a[_0xc919('0x13')]>0x0){if(_0x263352[_0xc919('0x14')]){if(_0x15b44a[_0xc919('0x15')]>0x0){if(moment(_0x263352['blockedAt'])[_0xc919('0x16')](_0x15b44a[_0xc919('0x15')],_0xc919('0x17'))>moment()){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else{return utils[_0xc919('0x18')](_0x263352,_0x721dc2,![],null)[_0xc919('0xb')](function(){return _0x3522f0(null,![],{'message':_0xc919('0x12')});});}}else{return _0x3522f0(null,![],{'message':_0xc919('0x12')});}}else{if(_0x721dc2>=_0x15b44a[_0xc919('0x13')]){return utils[_0xc919('0x18')](_0x263352,0x0,!![],moment())[_0xc919('0xb')](function(){return _0x3522f0(null,![],{'message':_0xc919('0x12')});});}else{return utils[_0xc919('0x18')](_0x263352,_0x721dc2,![],null)[_0xc919('0xb')](function(){return _0x3522f0(null,![],{'message':_0xc919('0x12')});});}}}else{return _0x3522f0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x263352[_0xc919('0xe')]){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else if(_0x15b44a['allowedLoginAttempts']>0x0){if(_0x263352[_0xc919('0x14')]){if(_0x15b44a[_0xc919('0x15')]>0x0){if(moment(_0x263352[_0xc919('0x19')])[_0xc919('0x16')](_0x15b44a[_0xc919('0x15')],'minutes')>moment()){return _0x3522f0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc919('0x18')](_0x263352,0x0,![],null)[_0xc919('0xb')](function(){return utils['getLicense'](_0x263352);})[_0xc919('0xb')](function(){return _0x3522f0(null,_0x263352);});}}else{return _0x3522f0(null,![],{'message':_0xc919('0x12')});}}else{return utils[_0xc919('0x18')](_0x263352,0x0,![],null)[_0xc919('0xb')](function(){return utils['getLicense'](_0x263352);})[_0xc919('0xb')](function(){return _0x3522f0(null,_0x263352);})[_0xc919('0x1a')](function(_0x11bfdf){return _0x3522f0(null,![],_0x11bfdf);});}}else{if(_0x263352[_0xc919('0x14')]){return _0x3522f0(null,![],{'message':_0xc919('0x12')});}else{return utils['getLicense'](_0x263352)[_0xc919('0xb')](function(){return _0x3522f0(null,_0x263352);});}}}});})[_0xc919('0x1a')](function(_0x1605f8){return _0x3522f0(null,![],_0x1605f8);});}function sendServiceMail(_0x485551){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xc919('0xc'),_0xc919('0x1b')],'include':[{'model':db[_0xc919('0x1c')],'as':_0xc919('0x1d')}]})[_0xc919('0xb')](function(_0xdac85c){if(!_0xdac85c){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x262874={'tls':{'rejectUnauthorized':![]}};if(_0xdac85c[_0xc919('0x1d')][_0xc919('0x1e')]){_0x262874[_0xc919('0x1e')]=_0xdac85c[_0xc919('0x1d')]['service'];}else{_0x262874[_0xc919('0x1f')]=_0xdac85c[_0xc919('0x1d')][_0xc919('0x1f')];_0x262874['port']=_0xdac85c[_0xc919('0x1d')][_0xc919('0x20')];_0x262874[_0xc919('0x21')]=_0xdac85c[_0xc919('0x1d')][_0xc919('0x21')];}if(_0xdac85c['Smtp'][_0xc919('0x22')]){_0x262874[_0xc919('0x23')]={'user':_0xdac85c[_0xc919('0x1d')][_0xc919('0x10')],'pass':_0xdac85c[_0xc919('0x1d')][_0xc919('0x24')]};}var _0x2c2032={'account':_0x262874,'message':_[_0xc919('0x25')]({'from':util[_0xc919('0x26')]('\x22%s\x22\x20<%s>',_0xdac85c[_0xc919('0xc')],_0xdac85c['email']||_0xdac85c[_0xc919('0x1d')]['user'])},_0x485551)};return client['request'](_0xc919('0x27'),_0x2c2032);})['then'](function(_0xa4ebd6){if(_0xa4ebd6[_0xc919('0x28')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xa4ebd6[_0xc919('0x28')]['message']||JSON[_0xc919('0x29')](_0xa4ebd6[_0xc919('0x28')])));}return!![];});}function handleError(_0x55e725,_0x31421b,_0x3991e7){return _0x55e725[_0xc919('0x2a')](_0x31421b||0x1f4)[_0xc919('0x2b')]({'message':_0x3991e7?_0x3991e7[_0xc919('0x2c')]||_0x3991e7:''});}exports[_0xc919('0x2d')]=function(_0x49fb64,_0x35c83d,_0x1ff93b){passport['authenticate'](_0xc919('0x2e'),function(_0xe1b4bb,_0x252aa8,_0x2fc5ef){var _0x5c69c2=_0xe1b4bb||_0x2fc5ef;if(_0x5c69c2){return handleError(_0x35c83d,0x191,_0x5c69c2);}if(!_0x252aa8){return handleError(_0x35c83d,0x194,{'message':_0xc919('0x2f')});}else{var _0xd6a882={'payload':{'id':_0x252aa8['id'],'role':_0x252aa8['role']},'options':{'expiresIn':0x15180}};return authService[_0xc919('0x30')](_0xd6a882)[_0xc919('0xb')](function(_0x56fcf8){_0x35c83d['json']({'id':_0x252aa8['id'],'token':_0x56fcf8,'statusCall':'','isAlreadyLogged':_0x252aa8[_0xc919('0x31')]});});}})(_0x49fb64,_0x35c83d,_0x1ff93b);};exports[_0xc919('0x32')]=function(_0x7bb937,_0x3a9afe,_0xd56217){if(!_0x7bb937[_0xc919('0x33')][_0xc919('0x1b')]){return handleError(_0x3a9afe,0x1f4,{'message':_0xc919('0x34')});}var _0x2648e7=rs[_0xc919('0x35')]();_0x7bb937['body']['email']=_0x7bb937[_0xc919('0x33')][_0xc919('0x1b')][_0xc919('0x36')]()[_0xc919('0x37')]();var _0xb0e40d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc919('0x15')],'raw':!![]})[_0xc919('0xb')](function(_0x4a857f){_0xb0e40d=_0x4a857f;return db[_0xc919('0x38')][_0xc919('0x39')]({'where':{'email':_0x7bb937[_0xc919('0x33')][_0xc919('0x1b')]}});})[_0xc919('0xb')](function(_0x39380f){if(!_0x39380f){throw new Error(_0xc919('0x3a'));}if(_0x39380f['disabled']){throw new Error(_0xc919('0x3b'));}if(_0x39380f['blocked']){if(moment(_0x39380f[_0xc919('0x19')])['add'](_0xb0e40d[_0xc919('0x15')],'minutes')>moment()){throw new Error(_0xc919('0x3c'));}else{_0x39380f[_0xc919('0x14')]=![];_0x39380f[_0xc919('0x19')]=null;}}_0x39380f['resetPasswordToken']=_0x2648e7;_0x39380f[_0xc919('0x3d')]=Date[_0xc919('0x3e')]()+0x36ee80;return _0x39380f[_0xc919('0x3f')]();})[_0xc919('0xb')](function(){return sendServiceMail({'to':_0x7bb937[_0xc919('0x33')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc919('0x40')+_0xc919('0x41')+_0xc919('0x42')+_0x7bb937['headers'][_0xc919('0x1f')]+_0xc919('0x43')+_0x2648e7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc919('0xb')](function(){_0x3a9afe['status'](0xc8)[_0xc919('0x2b')]({'message':_0xc919('0x44')});})[_0xc919('0x1a')](function(_0xdc1a94){return handleError(_0x3a9afe,0x1f4,_0xdc1a94);});};exports[_0xc919('0x45')]=function(_0x226548,_0x226808,_0x56857b){return db['User'][_0xc919('0x39')]({'where':{'resetPasswordToken':_0x226548[_0xc919('0x46')][_0xc919('0x47')],'resetPasswordExpires':{'$gt':Date[_0xc919('0x3e')]()}}})[_0xc919('0xb')](function(_0x20a133){if(!_0x20a133){throw new Error(_0xc919('0x48'));}return db[_0xc919('0x9')][_0xc919('0xa')]({'attributes':['id','securePassword',_0xc919('0x49'),_0xc919('0x4a')]})['then'](function(_0x840b5a){if(_0x840b5a['securePassword'])authService[_0xc919('0x4b')](_0x226548['body'][_0xc919('0x4c')]);if(!_0x840b5a[_0xc919('0x49')]||!_0x20a133['previousPasswords'])return _0x20a133;authService['validatePasswordHistory'](_0x226548[_0xc919('0x33')][_0xc919('0x4c')],_0x20a133[_0xc919('0x4d')],_0x840b5a[_0xc919('0x4a')]);return _0x20a133;})['then'](function(){_0x20a133[_0xc919('0x4c')]=_0x226548[_0xc919('0x33')][_0xc919('0x4c')];_0x20a133[_0xc919('0x4e')]=null;_0x20a133[_0xc919('0x3d')]=null;return _0x20a133['save']();});})['then'](function(){_0x226808[_0xc919('0x2a')](0xc8)[_0xc919('0x2b')]({'message':_0xc919('0x4f')});})[_0xc919('0x1a')](function(_0x15f6b4){return handleError(_0x226808,0x1f4,_0x15f6b4);});};passport[_0xc919('0x50')](new LocalStrategy({'usernameField':_0xc919('0xc'),'passwordField':'password'},function(_0x525e0f,_0x1c3715,_0x25daea){return localAuthenticate(db['User'],_0x525e0f,_0x1c3715,_0x25daea);}));
\ No newline at end of file
+var _0x482f=['passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','client','findOne','blockDuration','then','salt','role','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','clearBlockUser','allowedLoginAttempts','disabled','add','minutes','getLicense','catch','MailAccount','find','name','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','stringify','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken'];(function(_0x24304c,_0x5c5332){var _0x457533=function(_0x340cdf){while(--_0x340cdf){_0x24304c['push'](_0x24304c['shift']());}};_0x457533(++_0x5c5332);}(_0x482f,0x144));var _0xf482=function(_0x13341b,_0x32a001){_0x13341b=_0x13341b-0x0;var _0x5a8e2a=_0x482f[_0x13341b];return _0x5a8e2a;};'use strict';var util=require('util');var passport=require(_0xf482('0x0'));var LocalStrategy=require(_0xf482('0x1'))[_0xf482('0x2')];var jayson=require('jayson/promise');var _=require(_0xf482('0x3'));var rs=require(_0xf482('0x4'));var moment=require(_0xf482('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xf482('0x6'));var utils=require('../../config/utils');var client=jayson[_0xf482('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x3d6b8a,_0x21c9fe,_0x3a369d,_0x58fa60){var _0x3f731a,_0x3009cc;return db['Setting'][_0xf482('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf482('0x9')],'raw':!![]})[_0xf482('0xa')](function(_0x1c7d0c){_0x3f731a=_0x1c7d0c;return _0x3d6b8a[_0xf482('0x8')]({'attributes':['id','name','password',_0xf482('0xb'),_0xf482('0xc'),'disabled',_0xf482('0xd'),_0xf482('0xe'),'loginAttempts'],'where':{'name':_0x21c9fe,'role':{'$or':[_0xf482('0xf'),'user',_0xf482('0x10')]}}});})[_0xf482('0xa')](function(_0x9286fd){if(!_0x9286fd||_0x9286fd&&_0x9286fd['name']!==_0x21c9fe){throw new Error(_0xf482('0x11'));}else{_0x3009cc=_0x9286fd;return _0x3009cc;}})[_0xf482('0xa')](function(){_0x3009cc[_0xf482('0x12')](_0x3a369d,function(_0x3992f1,_0x3bf982){var _0x399c31=_0x3009cc['loginAttempts']+0x1;if(_0x3992f1){return _0x58fa60(_0x3992f1);}else if(!_0x3bf982){if(_0x3009cc['disabled']){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else if(_0x3f731a['allowedLoginAttempts']>0x0){if(_0x3009cc[_0xf482('0xd')]){if(_0x3f731a[_0xf482('0x9')]>0x0){if(moment(_0x3009cc[_0xf482('0xe')])['add'](_0x3f731a[_0xf482('0x9')],'minutes')>moment()){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else{return utils[_0xf482('0x13')](_0x3009cc,_0x399c31,![],null)[_0xf482('0xa')](function(){return _0x58fa60(null,![],{'message':_0xf482('0x11')});});}}else{return _0x58fa60(null,![],{'message':_0xf482('0x11')});}}else{if(_0x399c31>=_0x3f731a[_0xf482('0x14')]){return utils[_0xf482('0x13')](_0x3009cc,0x0,!![],moment())[_0xf482('0xa')](function(){return _0x58fa60(null,![],{'message':_0xf482('0x11')});});}else{return utils[_0xf482('0x13')](_0x3009cc,_0x399c31,![],null)[_0xf482('0xa')](function(){return _0x58fa60(null,![],{'message':_0xf482('0x11')});});}}}else{return _0x58fa60(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3009cc[_0xf482('0x15')]){return _0x58fa60(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3f731a['allowedLoginAttempts']>0x0){if(_0x3009cc[_0xf482('0xd')]){if(_0x3f731a['blockDuration']>0x0){if(moment(_0x3009cc['blockedAt'])[_0xf482('0x16')](_0x3f731a[_0xf482('0x9')],_0xf482('0x17'))>moment()){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else{return utils[_0xf482('0x13')](_0x3009cc,0x0,![],null)[_0xf482('0xa')](function(){return utils[_0xf482('0x18')](_0x3009cc);})[_0xf482('0xa')](function(){return _0x58fa60(null,_0x3009cc);});}}else{return _0x58fa60(null,![],{'message':_0xf482('0x11')});}}else{return utils[_0xf482('0x13')](_0x3009cc,0x0,![],null)[_0xf482('0xa')](function(){return utils[_0xf482('0x18')](_0x3009cc);})[_0xf482('0xa')](function(){return _0x58fa60(null,_0x3009cc);})[_0xf482('0x19')](function(_0x3af175){return _0x58fa60(null,![],_0x3af175);});}}else{if(_0x3009cc[_0xf482('0xd')]){return _0x58fa60(null,![],{'message':_0xf482('0x11')});}else{return utils[_0xf482('0x18')](_0x3009cc)[_0xf482('0xa')](function(){return _0x58fa60(null,_0x3009cc);});}}}});})[_0xf482('0x19')](function(_0x409175){return _0x58fa60(null,![],_0x409175);});}function sendServiceMail(_0x53ac6b){return db[_0xf482('0x1a')][_0xf482('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xf482('0x1c'),_0xf482('0x1d')],'include':[{'model':db['MailServerOut'],'as':_0xf482('0x1e')}]})['then'](function(_0x2f9d20){if(!_0x2f9d20){throw new Error(_0xf482('0x1f'));}var _0x99b2f9={'tls':{'rejectUnauthorized':![]}};if(_0x2f9d20[_0xf482('0x1e')][_0xf482('0x20')]){_0x99b2f9[_0xf482('0x20')]=_0x2f9d20['Smtp']['service'];}else{_0x99b2f9[_0xf482('0x21')]=_0x2f9d20['Smtp'][_0xf482('0x21')];_0x99b2f9[_0xf482('0x22')]=_0x2f9d20[_0xf482('0x1e')][_0xf482('0x22')];_0x99b2f9[_0xf482('0x23')]=_0x2f9d20[_0xf482('0x1e')][_0xf482('0x23')];}if(_0x2f9d20[_0xf482('0x1e')][_0xf482('0x24')]){_0x99b2f9[_0xf482('0x25')]={'user':_0x2f9d20[_0xf482('0x1e')][_0xf482('0x26')],'pass':_0x2f9d20[_0xf482('0x1e')][_0xf482('0x27')]};}var _0x32a72b={'account':_0x99b2f9,'message':_[_0xf482('0x28')]({'from':util[_0xf482('0x29')](_0xf482('0x2a'),_0x2f9d20['name'],_0x2f9d20[_0xf482('0x1d')]||_0x2f9d20[_0xf482('0x1e')][_0xf482('0x26')])},_0x53ac6b)};return client['request'](_0xf482('0x2b'),_0x32a72b);})['then'](function(_0x162087){if(_0x162087['error']){throw new Error(util[_0xf482('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x162087[_0xf482('0x2c')]['message']||JSON[_0xf482('0x2d')](_0x162087[_0xf482('0x2c')])));}return!![];});}function handleError(_0x442251,_0x3e20e8,_0x3ebd5a){return _0x442251[_0xf482('0x2e')](_0x3e20e8||0x1f4)[_0xf482('0x2f')]({'message':_0x3ebd5a?_0x3ebd5a[_0xf482('0x30')]||_0x3ebd5a:''});}exports['login']=function(_0x32cf9d,_0xbe0a48,_0x31e637){passport[_0xf482('0x12')](_0xf482('0x31'),function(_0x562b0d,_0x13e1ed,_0x68ac67){var _0x51294d=_0x562b0d||_0x68ac67;if(_0x51294d){return handleError(_0xbe0a48,0x191,_0x51294d);}if(!_0x13e1ed){return handleError(_0xbe0a48,0x194,{'message':_0xf482('0x32')});}else{var _0x7e54a8={'payload':{'id':_0x13e1ed['id'],'role':_0x13e1ed[_0xf482('0xc')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x7e54a8)[_0xf482('0xa')](function(_0x331547){_0xbe0a48['json']({'id':_0x13e1ed['id'],'token':_0x331547,'statusCall':'','isAlreadyLogged':_0x13e1ed[_0xf482('0x33')]});});}})(_0x32cf9d,_0xbe0a48,_0x31e637);};exports['forgot']=function(_0x2098cc,_0xe3d34,_0x24a241){if(!_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')]){return handleError(_0xe3d34,0x1f4,{'message':_0xf482('0x35')});}var _0x32b6b4=rs[_0xf482('0x36')]();_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')]=_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')][_0xf482('0x37')]()['toLowerCase']();var _0x51604b;return db[_0xf482('0x38')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf482('0x9')],'raw':!![]})[_0xf482('0xa')](function(_0x49af06){_0x51604b=_0x49af06;return db['User'][_0xf482('0x1b')]({'where':{'email':_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')]}});})[_0xf482('0xa')](function(_0x467fc6){if(!_0x467fc6){throw new Error(_0xf482('0x39'));}if(_0x467fc6[_0xf482('0x15')]){throw new Error(_0xf482('0x3a'));}if(_0x467fc6[_0xf482('0xd')]){if(moment(_0x467fc6['blockedAt'])[_0xf482('0x16')](_0x51604b[_0xf482('0x9')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x467fc6[_0xf482('0xd')]=![];_0x467fc6['blockedAt']=null;}}_0x467fc6['resetPasswordToken']=_0x32b6b4;_0x467fc6[_0xf482('0x3b')]=Date[_0xf482('0x3c')]()+0x36ee80;return _0x467fc6[_0xf482('0x3d')]();})[_0xf482('0xa')](function(){return sendServiceMail({'to':_0x2098cc[_0xf482('0x34')][_0xf482('0x1d')],'subject':_0xf482('0x3e'),'text':_0xf482('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf482('0x40')+_0x2098cc[_0xf482('0x41')]['host']+_0xf482('0x42')+_0x32b6b4+'\x0a\x0a'+_0xf482('0x43')});})[_0xf482('0xa')](function(){_0xe3d34[_0xf482('0x2e')](0xc8)[_0xf482('0x2f')]({'message':_0xf482('0x44')});})[_0xf482('0x19')](function(_0x1fe7cf){return handleError(_0xe3d34,0x1f4,_0x1fe7cf);});};exports['reset']=function(_0x345d4a,_0x57c391,_0x2329a6){return db[_0xf482('0x45')]['find']({'where':{'resetPasswordToken':_0x345d4a[_0xf482('0x46')][_0xf482('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf482('0x3c')]()}}})[_0xf482('0xa')](function(_0x10d832){if(!_0x10d832){throw new Error(_0xf482('0x48'));}return db[_0xf482('0x38')][_0xf482('0x8')]({'attributes':['id',_0xf482('0x49'),_0xf482('0x4a'),'passwordHistoryLimit']})[_0xf482('0xa')](function(_0x25994c){if(_0x25994c[_0xf482('0x49')])authService[_0xf482('0x4b')](_0x345d4a[_0xf482('0x34')][_0xf482('0x4c')]);if(!_0x25994c[_0xf482('0x4a')]||!_0x10d832[_0xf482('0x4d')])return _0x10d832;authService[_0xf482('0x4e')](_0x345d4a[_0xf482('0x34')][_0xf482('0x4c')],_0x10d832[_0xf482('0x4d')],_0x25994c[_0xf482('0x4f')]);return _0x10d832;})[_0xf482('0xa')](function(){_0x10d832[_0xf482('0x4c')]=_0x345d4a[_0xf482('0x34')][_0xf482('0x4c')];_0x10d832[_0xf482('0x50')]=null;_0x10d832[_0xf482('0x3b')]=null;return _0x10d832[_0xf482('0x3d')]();});})[_0xf482('0xa')](function(){_0x57c391[_0xf482('0x2e')](0xc8)[_0xf482('0x2f')]({'message':'Password\x20reset!'});})[_0xf482('0x19')](function(_0x5356f8){return handleError(_0x57c391,0x1f4,_0x5356f8);});};passport['use'](new LocalStrategy({'usernameField':_0xf482('0x1c'),'passwordField':'password'},function(_0x159e69,_0x53bc8e,_0x1d80b1){return localAuthenticate(db[_0xf482('0x45')],_0x159e69,_0x53bc8e,_0x1d80b1);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 86d614c..ccb241e 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 _0x0f71=['forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x0f71,0x70));var _0x10f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f71[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x10f7('0x0'));var router=express[_0x10f7('0x1')]();var controller=require(_0x10f7('0x2'));router[_0x10f7('0x3')]('/',controller['login']);router[_0x10f7('0x3')](_0x10f7('0x4'),controller[_0x10f7('0x5')]);router[_0x10f7('0x3')](_0x10f7('0x6'),controller[_0x10f7('0x7')]);module[_0x10f7('0x8')]=router;
\ No newline at end of file
+var _0x49ea=['forgot','Router','./authLocal.controller','post','login','/forgot'];(function(_0x3c2741,_0x3e5ef2){var _0x5ed694=function(_0x4e24cb){while(--_0x4e24cb){_0x3c2741['push'](_0x3c2741['shift']());}};_0x5ed694(++_0x3e5ef2);}(_0x49ea,0x145));var _0xa49e=function(_0x28a170,_0x1c40be){_0x28a170=_0x28a170-0x0;var _0x4c4da4=_0x49ea[_0x28a170];return _0x4c4da4;};'use strict';var express=require('express');var router=express[_0xa49e('0x0')]();var controller=require(_0xa49e('0x1'));router[_0xa49e('0x2')]('/',controller[_0xa49e('0x3')]);router[_0xa49e('0x2')](_0xa49e('0x4'),controller[_0xa49e('0x5')]);router['post']('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index a1f4e54..e327d0a 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 _0x33b6=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x532574,_0x2ce799){var _0x2b4cbe=function(_0x555867){while(--_0x555867){_0x532574['push'](_0x532574['shift']());}};_0x2b4cbe(++_0x2ce799);}(_0x33b6,0xd0));var _0x633b=function(_0x4454c3,_0x24c130){_0x4454c3=_0x4454c3-0x0;var _0x195fa6=_0x33b6[_0x4454c3];return _0x195fa6;};'use strict';var Sequelize=require('sequelize');module[_0x633b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x633b('0x1')]},'description':{'type':Sequelize[_0x633b('0x1')]},'status':{'type':Sequelize[_0x633b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x633b('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x9120=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3861c4,_0x1602e4){var _0x28c921=function(_0x396ba6){while(--_0x396ba6){_0x3861c4['push'](_0x3861c4['shift']());}};_0x28c921(++_0x1602e4);}(_0x9120,0xe4));var _0x0912=function(_0x40680a,_0x5178a4){_0x40680a=_0x40680a-0x0;var _0x5d8e9f=_0x9120[_0x40680a];return _0x5d8e9f;};'use strict';var Sequelize=require(_0x0912('0x0'));module[_0x0912('0x1')]={'name':{'type':Sequelize[_0x0912('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0912('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0912('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 cd74e92..df30bc6 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 _0x209e=['includeAll','include','findAll','rows','catch','params','merge','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options'];(function(_0x29417c,_0x4afc30){var _0x40e15e=function(_0x306a55){while(--_0x306a55){_0x29417c['push'](_0x29417c['shift']());}};_0x40e15e(++_0x4afc30);}(_0x209e,0x65));var _0xe209=function(_0x21cf24,_0x4c1563){_0x21cf24=_0x21cf24-0x0;var _0x1aea27=_0x209e[_0x21cf24];return _0x1aea27;};'use strict';var emlformat=require(_0xe209('0x0'));var rimraf=require(_0xe209('0x1'));var zipdir=require(_0xe209('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe209('0x3'));var moment=require(_0xe209('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe209('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe209('0x6'));var ejs=require(_0xe209('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe209('0x8'));var crypto=require(_0xe209('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe209('0xa'));var toCsv=require(_0xe209('0x6'));var querystring=require('querystring');var Papa=require(_0xe209('0xb'));var Redis=require(_0xe209('0xc'));var authService=require(_0xe209('0xd'));var qs=require(_0xe209('0xe'));var as=require(_0xe209('0xf'));var hardwareService=require(_0xe209('0x10'));var logger=require(_0xe209('0x11'))('api');var utils=require(_0xe209('0x12'));var config=require(_0xe209('0x13'));var licenseUtil=require(_0xe209('0x14'));var db=require(_0xe209('0x15'))['db'];function respondWithStatusCode(_0x56dbc6,_0x14d03e){_0x14d03e=_0x14d03e||0xcc;return function(_0xd18542){if(_0xd18542){return _0x56dbc6[_0xe209('0x16')](_0x14d03e);}return _0x56dbc6['status'](_0x14d03e)[_0xe209('0x17')]();};}function respondWithResult(_0x505274,_0x4e408d){_0x4e408d=_0x4e408d||0xc8;return function(_0x2a2e4d){if(_0x2a2e4d){return _0x505274[_0xe209('0x18')](_0x4e408d)[_0xe209('0x19')](_0x2a2e4d);}};}function respondWithFilteredResult(_0x40560b,_0x218b03){return function(_0x41d348){if(_0x41d348){var _0x37d672=typeof _0x218b03[_0xe209('0x1a')]===_0xe209('0x1b')&&typeof _0x218b03[_0xe209('0x1c')]===_0xe209('0x1b');var _0x194c44=_0x41d348[_0xe209('0x1d')];var _0x2c91af=_0x37d672?0x0:_0x218b03[_0xe209('0x1a')];var _0x773d79=_0x37d672?_0x41d348[_0xe209('0x1d')]:_0x218b03[_0xe209('0x1a')]+_0x218b03[_0xe209('0x1c')];var _0x2c4bdd;if(_0x773d79>=_0x194c44){_0x773d79=_0x194c44;_0x2c4bdd=0xc8;}else{_0x2c4bdd=0xce;}_0x40560b['status'](_0x2c4bdd);return _0x40560b['set']('Content-Range',_0x2c91af+'-'+_0x773d79+'/'+_0x194c44)[_0xe209('0x19')](_0x41d348);}return null;};}function patchUpdates(_0x4956be){return function(_0x5ed75a){try{jsonpatch[_0xe209('0x1e')](_0x5ed75a,_0x4956be,!![]);}catch(_0x4b6f56){return BPromise[_0xe209('0x1f')](_0x4b6f56);}return _0x5ed75a[_0xe209('0x20')]();};}function saveUpdates(_0x21cfff,_0x2e932f){return function(_0x3e1c67){if(_0x3e1c67){return _0x3e1c67[_0xe209('0x21')](_0x21cfff)[_0xe209('0x22')](function(_0x4b7724){return _0x4b7724;});}return null;};}function removeEntity(_0x504f7b,_0x59b1b1){return function(_0x4f7980){if(_0x4f7980){return _0x4f7980[_0xe209('0x23')]()['then'](function(){_0x504f7b[_0xe209('0x18')](0xcc)[_0xe209('0x17')]();});}};}function handleEntityNotFound(_0x29519b,_0x4d6ca7){return function(_0x4ae88b){if(!_0x4ae88b){_0x29519b[_0xe209('0x16')](0x194);}return _0x4ae88b;};}function handleError(_0x2fe049,_0x30178b){_0x30178b=_0x30178b||0x1f4;return function(_0x172340){logger[_0xe209('0x24')](_0x172340[_0xe209('0x25')]);if(_0x172340[_0xe209('0x26')]){delete _0x172340[_0xe209('0x26')];}_0x2fe049[_0xe209('0x18')](_0x30178b)[_0xe209('0x27')](_0x172340);};}exports['index']=function(_0x132043,_0x212884){var _0x269560={},_0x440dcf={},_0x1288e9={'count':0x0,'rows':[]};var _0xfa0bfe=_['map'](db[_0xe209('0x28')][_0xe209('0x29')],function(_0x414b34){return{'name':_0x414b34[_0xe209('0x2a')],'type':_0x414b34[_0xe209('0x2b')][_0xe209('0x2c')]};});_0x440dcf['model']=_[_0xe209('0x2d')](_0xfa0bfe,_0xe209('0x26'));_0x440dcf[_0xe209('0x2e')]=_[_0xe209('0x2f')](_0x132043[_0xe209('0x2e')]);_0x440dcf[_0xe209('0x30')]=_['intersection'](_0x440dcf[_0xe209('0x31')],_0x440dcf['query']);_0x269560[_0xe209('0x32')]=_[_0xe209('0x33')](_0x440dcf[_0xe209('0x31')],qs[_0xe209('0x34')](_0x132043[_0xe209('0x2e')][_0xe209('0x34')]));_0x269560[_0xe209('0x32')]=_0x269560[_0xe209('0x32')][_0xe209('0x35')]?_0x269560[_0xe209('0x32')]:_0x440dcf[_0xe209('0x31')];if(!_0x132043[_0xe209('0x2e')][_0xe209('0x36')](_0xe209('0x37'))){_0x269560[_0xe209('0x1c')]=qs[_0xe209('0x1c')](_0x132043['query']['limit']);_0x269560[_0xe209('0x1a')]=qs[_0xe209('0x1a')](_0x132043[_0xe209('0x2e')][_0xe209('0x1a')]);}_0x269560[_0xe209('0x38')]=qs[_0xe209('0x39')](_0x132043['query']['sort']);_0x269560[_0xe209('0x3a')]=qs['filters'](_[_0xe209('0x3b')](_0x132043[_0xe209('0x2e')],_0x440dcf[_0xe209('0x30')]),_0xfa0bfe);if(_0x132043[_0xe209('0x2e')][_0xe209('0x3c')]){_0x269560[_0xe209('0x3a')]=_['merge'](_0x269560['where'],{'$or':_[_0xe209('0x2d')](_0xfa0bfe,function(_0x302809){if(_0x302809[_0xe209('0x2b')]!==_0xe209('0x3d')){var _0x2a34ce={};_0x2a34ce[_0x302809[_0xe209('0x26')]]={'$like':'%'+_0x132043['query'][_0xe209('0x3c')]+'%'};return _0x2a34ce;}})});}_0x269560=_['merge']({},_0x269560,_0x132043[_0xe209('0x3e')]);var _0x38dba2={'where':_0x269560[_0xe209('0x3a')]};return db[_0xe209('0x28')][_0xe209('0x1d')](_0x38dba2)[_0xe209('0x22')](function(_0x70b6a1){_0x1288e9['count']=_0x70b6a1;if(_0x132043['query'][_0xe209('0x3f')]){_0x269560[_0xe209('0x40')]=[{'all':!![]}];}return db[_0xe209('0x28')][_0xe209('0x41')](_0x269560);})[_0xe209('0x22')](function(_0x1573b7){_0x1288e9[_0xe209('0x42')]=_0x1573b7;return _0x1288e9;})['then'](respondWithFilteredResult(_0x212884,_0x269560))[_0xe209('0x43')](handleError(_0x212884,null));};exports['show']=function(_0x5d714e,_0x3d27f6){var _0x5bbd33={'raw':![],'where':{'id':_0x5d714e[_0xe209('0x44')]['id']}},_0x12c763={};_0x12c763[_0xe209('0x31')]=_['keys'](db['Automation']['rawAttributes']);_0x12c763[_0xe209('0x2e')]=_['keys'](_0x5d714e[_0xe209('0x2e')]);_0x12c763[_0xe209('0x30')]=_[_0xe209('0x33')](_0x12c763[_0xe209('0x31')],_0x12c763[_0xe209('0x2e')]);_0x5bbd33[_0xe209('0x32')]=_['intersection'](_0x12c763['model'],qs[_0xe209('0x34')](_0x5d714e['query'][_0xe209('0x34')]));_0x5bbd33[_0xe209('0x32')]=_0x5bbd33[_0xe209('0x32')][_0xe209('0x35')]?_0x5bbd33[_0xe209('0x32')]:_0x12c763['model'];if(_0x5d714e[_0xe209('0x2e')][_0xe209('0x3f')]){_0x5bbd33[_0xe209('0x40')]=[{'all':!![]}];}_0x5bbd33=_[_0xe209('0x45')]({},_0x5bbd33,_0x5d714e[_0xe209('0x3e')]);return db[_0xe209('0x28')][_0xe209('0x46')](_0x5bbd33)[_0xe209('0x22')](handleEntityNotFound(_0x3d27f6,null))[_0xe209('0x22')](respondWithResult(_0x3d27f6,null))['catch'](handleError(_0x3d27f6,null));};exports[_0xe209('0x47')]=function(_0x25f70d,_0x16286b){return db[_0xe209('0x28')]['create'](_0x25f70d['body'],{})[_0xe209('0x22')](respondWithResult(_0x16286b,0xc9))[_0xe209('0x43')](handleError(_0x16286b,null));};exports[_0xe209('0x21')]=function(_0x2dfa01,_0x2a0466){if(_0x2dfa01['body']['id']){delete _0x2dfa01[_0xe209('0x48')]['id'];}return db['Automation']['find']({'where':{'id':_0x2dfa01[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x2a0466,null))[_0xe209('0x22')](saveUpdates(_0x2dfa01[_0xe209('0x48')],null))[_0xe209('0x22')](respondWithResult(_0x2a0466,null))['catch'](handleError(_0x2a0466,null));};exports[_0xe209('0x23')]=function(_0x1c1e50,_0x4fb0b5){return db[_0xe209('0x28')][_0xe209('0x46')]({'where':{'id':_0x1c1e50[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x4fb0b5,null))['then'](removeEntity(_0x4fb0b5,null))[_0xe209('0x43')](handleError(_0x4fb0b5,null));};exports[_0xe209('0x49')]=function(_0x442f43,_0x321c6f,_0x4cf8bc){return db[_0xe209('0x4a')][_0xe209('0x46')]({'where':{'id':_0x442f43[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x321c6f,null))[_0xe209('0x22')](function(_0x4943e5){if(_0x4943e5){return _0x4943e5[_0xe209('0x49')](_0x442f43['body']['ids'],_[_0xe209('0x4b')](_0x442f43['body'],[_0xe209('0x4c'),'id'])||{});}})[_0xe209('0x22')](respondWithResult(_0x321c6f,null))['catch'](handleError(_0x321c6f,null));};exports[_0xe209('0x4d')]=function(_0x2b5705,_0x32afe1,_0x85efe1){var _0x12785c={};var _0x11e351={};var _0x55800b;var _0x5e4c0d;return db['Automation'][_0xe209('0x4e')]({'where':{'id':_0x2b5705['params']['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x32afe1,null))['then'](function(_0x1e6602){if(_0x1e6602){_0x55800b=_0x1e6602;_0x11e351[_0xe209('0x31')]=_[_0xe209('0x2f')](db['Condition']['rawAttributes']);_0x11e351['query']=_['keys'](_0x2b5705[_0xe209('0x2e')]);_0x11e351[_0xe209('0x30')]=_[_0xe209('0x33')](_0x11e351['model'],_0x11e351['query']);_0x12785c['attributes']=_[_0xe209('0x33')](_0x11e351[_0xe209('0x31')],qs[_0xe209('0x34')](_0x2b5705[_0xe209('0x2e')][_0xe209('0x34')]));_0x12785c['attributes']=_0x12785c[_0xe209('0x32')][_0xe209('0x35')]?_0x12785c[_0xe209('0x32')]:_0x11e351['model'];_0x12785c['order']=qs[_0xe209('0x39')](_0x2b5705[_0xe209('0x2e')]['sort']);_0x12785c[_0xe209('0x3a')]=qs[_0xe209('0x30')](_[_0xe209('0x3b')](_0x2b5705[_0xe209('0x2e')],_0x11e351[_0xe209('0x30')]));if(_0x2b5705[_0xe209('0x2e')][_0xe209('0x3c')]){_0x12785c['where']=_[_0xe209('0x45')](_0x12785c['where'],{'$or':_[_0xe209('0x2d')](_0x12785c[_0xe209('0x32')],function(_0x145fa3){var _0x2c116b={};_0x2c116b[_0x145fa3]={'$like':'%'+_0x2b5705[_0xe209('0x2e')]['filter']+'%'};return _0x2c116b;})});}_0x12785c=_[_0xe209('0x45')]({},_0x12785c,_0x2b5705[_0xe209('0x3e')]);return _0x55800b['getConditions'](_0x12785c);}})['then'](function(_0x21ca6e){if(_0x21ca6e){_0x5e4c0d=_0x21ca6e[_0xe209('0x35')];if(!_0x2b5705[_0xe209('0x2e')][_0xe209('0x36')](_0xe209('0x37'))){_0x12785c[_0xe209('0x1c')]=qs['limit'](_0x2b5705[_0xe209('0x2e')][_0xe209('0x1c')]);_0x12785c['offset']=qs['offset'](_0x2b5705[_0xe209('0x2e')][_0xe209('0x1a')]);}return _0x55800b['getConditions'](_0x12785c);}})['then'](function(_0x4cd68b){if(_0x4cd68b){return _0x4cd68b?{'count':_0x5e4c0d,'rows':_0x4cd68b}:null;}})[_0xe209('0x22')](respondWithResult(_0x32afe1,null))[_0xe209('0x43')](handleError(_0x32afe1,null));};exports[_0xe209('0x4f')]=function(_0x493a81,_0x32144f,_0x39beca){return db[_0xe209('0x50')][_0xe209('0x46')]({'where':{'id':_0x493a81[_0xe209('0x44')]['id']}})['then'](handleEntityNotFound(_0x32144f,null))[_0xe209('0x22')](function(_0x5e48ee){if(_0x5e48ee){return _0x5e48ee[_0xe209('0x4f')](_0x493a81['body'][_0xe209('0x4c')],_[_0xe209('0x4b')](_0x493a81[_0xe209('0x48')],[_0xe209('0x4c'),'id'])||{});}})[_0xe209('0x22')](respondWithResult(_0x32144f,null))[_0xe209('0x43')](handleError(_0x32144f,null));};exports[_0xe209('0x51')]=function(_0x4d45b9,_0x3ee6c0,_0xf56479){var _0x9d567f={};var _0xce1210={};var _0x41fd5f;var _0x5af69d;return db[_0xe209('0x28')]['findOne']({'where':{'id':_0x4d45b9[_0xe209('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ee6c0,null))[_0xe209('0x22')](function(_0x91b571){if(_0x91b571){_0x41fd5f=_0x91b571;_0xce1210[_0xe209('0x31')]=_[_0xe209('0x2f')](db[_0xe209('0x50')][_0xe209('0x29')]);_0xce1210[_0xe209('0x2e')]=_[_0xe209('0x2f')](_0x4d45b9[_0xe209('0x2e')]);_0xce1210[_0xe209('0x30')]=_[_0xe209('0x33')](_0xce1210[_0xe209('0x31')],_0xce1210[_0xe209('0x2e')]);_0x9d567f[_0xe209('0x32')]=_[_0xe209('0x33')](_0xce1210[_0xe209('0x31')],qs[_0xe209('0x34')](_0x4d45b9[_0xe209('0x2e')][_0xe209('0x34')]));_0x9d567f['attributes']=_0x9d567f[_0xe209('0x32')]['length']?_0x9d567f['attributes']:_0xce1210[_0xe209('0x31')];_0x9d567f[_0xe209('0x38')]=qs[_0xe209('0x39')](_0x4d45b9[_0xe209('0x2e')]['sort']);_0x9d567f[_0xe209('0x3a')]=qs['filters'](_[_0xe209('0x3b')](_0x4d45b9['query'],_0xce1210[_0xe209('0x30')]));if(_0x4d45b9[_0xe209('0x2e')][_0xe209('0x3c')]){_0x9d567f[_0xe209('0x3a')]=_[_0xe209('0x45')](_0x9d567f['where'],{'$or':_[_0xe209('0x2d')](_0x9d567f[_0xe209('0x32')],function(_0x34dd5c){var _0x4f12ae={};_0x4f12ae[_0x34dd5c]={'$like':'%'+_0x4d45b9[_0xe209('0x2e')][_0xe209('0x3c')]+'%'};return _0x4f12ae;})});}_0x9d567f=_[_0xe209('0x45')]({},_0x9d567f,_0x4d45b9[_0xe209('0x3e')]);return _0x41fd5f['getActions'](_0x9d567f);}})[_0xe209('0x22')](function(_0x37df0f){if(_0x37df0f){_0x5af69d=_0x37df0f['length'];if(!_0x4d45b9[_0xe209('0x2e')]['hasOwnProperty'](_0xe209('0x37'))){_0x9d567f['limit']=qs['limit'](_0x4d45b9[_0xe209('0x2e')][_0xe209('0x1c')]);_0x9d567f[_0xe209('0x1a')]=qs[_0xe209('0x1a')](_0x4d45b9[_0xe209('0x2e')]['offset']);}return _0x41fd5f[_0xe209('0x51')](_0x9d567f);}})[_0xe209('0x22')](function(_0x407e32){if(_0x407e32){return _0x407e32?{'count':_0x5af69d,'rows':_0x407e32}:null;}})[_0xe209('0x22')](respondWithResult(_0x3ee6c0,null))['catch'](handleError(_0x3ee6c0,null));};
\ No newline at end of file
+var _0x2c9a=['create','body','addConditions','Condition','omit','getConditions','findOne','pick','addActions','Action','ids','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','send','index','map','Automation','key','name','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','findAll','catch','show','params','keys','rawAttributes','includeAll','include','options','find'];(function(_0x1a8ca3,_0x4933d5){var _0xcb8262=function(_0x171e7c){while(--_0x171e7c){_0x1a8ca3['push'](_0x1a8ca3['shift']());}};_0xcb8262(++_0x4933d5);}(_0x2c9a,0xba));var _0xa2c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2c9a[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xa2c9('0x0'));var rimraf=require(_0xa2c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2c9('0x2'));var rp=require(_0xa2c9('0x3'));var moment=require(_0xa2c9('0x4'));var BPromise=require(_0xa2c9('0x5'));var Mustache=require(_0xa2c9('0x6'));var util=require(_0xa2c9('0x7'));var path=require('path');var sox=require(_0xa2c9('0x8'));var csv=require('to-csv');var ejs=require(_0xa2c9('0x9'));var fs=require('fs');var fs_extra=require(_0xa2c9('0xa'));var _=require(_0xa2c9('0xb'));var squel=require(_0xa2c9('0xc'));var crypto=require(_0xa2c9('0xd'));var jsforce=require(_0xa2c9('0xe'));var deskjs=require(_0xa2c9('0xf'));var toCsv=require(_0xa2c9('0x10'));var querystring=require(_0xa2c9('0x11'));var Papa=require('papaparse');var Redis=require(_0xa2c9('0x12'));var authService=require(_0xa2c9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa2c9('0x14'));var hardwareService=require(_0xa2c9('0x15'));var logger=require(_0xa2c9('0x16'))(_0xa2c9('0x17'));var utils=require(_0xa2c9('0x18'));var config=require(_0xa2c9('0x19'));var licenseUtil=require(_0xa2c9('0x1a'));var db=require(_0xa2c9('0x1b'))['db'];function respondWithStatusCode(_0x36b562,_0x144609){_0x144609=_0x144609||0xcc;return function(_0x433d68){if(_0x433d68){return _0x36b562[_0xa2c9('0x1c')](_0x144609);}return _0x36b562[_0xa2c9('0x1d')](_0x144609)[_0xa2c9('0x1e')]();};}function respondWithResult(_0x13c826,_0xcef99){_0xcef99=_0xcef99||0xc8;return function(_0x17eafd){if(_0x17eafd){return _0x13c826[_0xa2c9('0x1d')](_0xcef99)['json'](_0x17eafd);}};}function respondWithFilteredResult(_0x2cd0a8,_0x1d9108){return function(_0x2bef0b){if(_0x2bef0b){var _0x3d0f95=typeof _0x1d9108[_0xa2c9('0x1f')]===_0xa2c9('0x20')&&typeof _0x1d9108[_0xa2c9('0x21')]===_0xa2c9('0x20');var _0x119979=_0x2bef0b[_0xa2c9('0x22')];var _0x5ae468=_0x3d0f95?0x0:_0x1d9108[_0xa2c9('0x1f')];var _0x33bf61=_0x3d0f95?_0x2bef0b[_0xa2c9('0x22')]:_0x1d9108[_0xa2c9('0x1f')]+_0x1d9108[_0xa2c9('0x21')];var _0x1537e3;if(_0x33bf61>=_0x119979){_0x33bf61=_0x119979;_0x1537e3=0xc8;}else{_0x1537e3=0xce;}_0x2cd0a8[_0xa2c9('0x1d')](_0x1537e3);return _0x2cd0a8[_0xa2c9('0x23')](_0xa2c9('0x24'),_0x5ae468+'-'+_0x33bf61+'/'+_0x119979)[_0xa2c9('0x25')](_0x2bef0b);}return null;};}function patchUpdates(_0x42e66b){return function(_0x3c6f74){try{jsonpatch[_0xa2c9('0x26')](_0x3c6f74,_0x42e66b,!![]);}catch(_0x1a5f3c){return BPromise[_0xa2c9('0x27')](_0x1a5f3c);}return _0x3c6f74[_0xa2c9('0x28')]();};}function saveUpdates(_0x2075a5,_0xc393c7){return function(_0x19810d){if(_0x19810d){return _0x19810d[_0xa2c9('0x29')](_0x2075a5)[_0xa2c9('0x2a')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x1ec96a,_0x5eec9b){return function(_0x35c140){if(_0x35c140){return _0x35c140[_0xa2c9('0x2b')]()[_0xa2c9('0x2a')](function(){_0x1ec96a[_0xa2c9('0x1d')](0xcc)[_0xa2c9('0x1e')]();});}};}function handleEntityNotFound(_0x3c23c3,_0xbcfebb){return function(_0x6a520a){if(!_0x6a520a){_0x3c23c3[_0xa2c9('0x1c')](0x194);}return _0x6a520a;};}function handleError(_0x4b5827,_0x29c6be){_0x29c6be=_0x29c6be||0x1f4;return function(_0x1099ea){logger[_0xa2c9('0x2c')](_0x1099ea['stack']);if(_0x1099ea['name']){delete _0x1099ea['name'];}_0x4b5827[_0xa2c9('0x1d')](_0x29c6be)[_0xa2c9('0x2d')](_0x1099ea);};}exports[_0xa2c9('0x2e')]=function(_0x39e86e,_0x1dac76){var _0x2ff1c4={},_0x4a80a0={},_0x15c5f2={'count':0x0,'rows':[]};var _0x341767=_[_0xa2c9('0x2f')](db[_0xa2c9('0x30')]['rawAttributes'],function(_0x481b33){return{'name':_0x481b33['fieldName'],'type':_0x481b33['type'][_0xa2c9('0x31')]};});_0x4a80a0['model']=_[_0xa2c9('0x2f')](_0x341767,_0xa2c9('0x32'));_0x4a80a0[_0xa2c9('0x33')]=_['keys'](_0x39e86e[_0xa2c9('0x33')]);_0x4a80a0[_0xa2c9('0x34')]=_[_0xa2c9('0x35')](_0x4a80a0[_0xa2c9('0x36')],_0x4a80a0[_0xa2c9('0x33')]);_0x2ff1c4['attributes']=_[_0xa2c9('0x35')](_0x4a80a0[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x37')]));_0x2ff1c4['attributes']=_0x2ff1c4[_0xa2c9('0x38')][_0xa2c9('0x39')]?_0x2ff1c4['attributes']:_0x4a80a0[_0xa2c9('0x36')];if(!_0x39e86e['query']['hasOwnProperty'](_0xa2c9('0x3a'))){_0x2ff1c4[_0xa2c9('0x21')]=qs[_0xa2c9('0x21')](_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x21')]);_0x2ff1c4['offset']=qs[_0xa2c9('0x1f')](_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x1f')]);}_0x2ff1c4[_0xa2c9('0x3b')]=qs[_0xa2c9('0x3c')](_0x39e86e['query'][_0xa2c9('0x3c')]);_0x2ff1c4['where']=qs['filters'](_['pick'](_0x39e86e[_0xa2c9('0x33')],_0x4a80a0[_0xa2c9('0x34')]),_0x341767);if(_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x3d')]){_0x2ff1c4['where']=_[_0xa2c9('0x3e')](_0x2ff1c4[_0xa2c9('0x3f')],{'$or':_[_0xa2c9('0x2f')](_0x341767,function(_0x4fb6e4){if(_0x4fb6e4['type']!==_0xa2c9('0x40')){var _0x1d1daa={};_0x1d1daa[_0x4fb6e4[_0xa2c9('0x32')]]={'$like':'%'+_0x39e86e[_0xa2c9('0x33')][_0xa2c9('0x3d')]+'%'};return _0x1d1daa;}})});}_0x2ff1c4=_[_0xa2c9('0x3e')]({},_0x2ff1c4,_0x39e86e['options']);var _0x5b09aa={'where':_0x2ff1c4[_0xa2c9('0x3f')]};return db['Automation']['count'](_0x5b09aa)['then'](function(_0x57c907){_0x15c5f2['count']=_0x57c907;if(_0x39e86e['query']['includeAll']){_0x2ff1c4['include']=[{'all':!![]}];}return db['Automation'][_0xa2c9('0x41')](_0x2ff1c4);})['then'](function(_0x2a3f67){_0x15c5f2['rows']=_0x2a3f67;return _0x15c5f2;})[_0xa2c9('0x2a')](respondWithFilteredResult(_0x1dac76,_0x2ff1c4))[_0xa2c9('0x42')](handleError(_0x1dac76,null));};exports[_0xa2c9('0x43')]=function(_0x2c7972,_0x13bd27){var _0x349f74={'raw':![],'where':{'id':_0x2c7972[_0xa2c9('0x44')]['id']}},_0x4df7fc={};_0x4df7fc[_0xa2c9('0x36')]=_[_0xa2c9('0x45')](db[_0xa2c9('0x30')][_0xa2c9('0x46')]);_0x4df7fc[_0xa2c9('0x33')]=_[_0xa2c9('0x45')](_0x2c7972[_0xa2c9('0x33')]);_0x4df7fc[_0xa2c9('0x34')]=_['intersection'](_0x4df7fc[_0xa2c9('0x36')],_0x4df7fc[_0xa2c9('0x33')]);_0x349f74['attributes']=_['intersection'](_0x4df7fc[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x2c7972['query']['fields']));_0x349f74['attributes']=_0x349f74[_0xa2c9('0x38')]['length']?_0x349f74[_0xa2c9('0x38')]:_0x4df7fc[_0xa2c9('0x36')];if(_0x2c7972[_0xa2c9('0x33')][_0xa2c9('0x47')]){_0x349f74[_0xa2c9('0x48')]=[{'all':!![]}];}_0x349f74=_[_0xa2c9('0x3e')]({},_0x349f74,_0x2c7972[_0xa2c9('0x49')]);return db[_0xa2c9('0x30')][_0xa2c9('0x4a')](_0x349f74)[_0xa2c9('0x2a')](handleEntityNotFound(_0x13bd27,null))['then'](respondWithResult(_0x13bd27,null))['catch'](handleError(_0x13bd27,null));};exports[_0xa2c9('0x4b')]=function(_0x5c5534,_0x46d843){return db[_0xa2c9('0x30')][_0xa2c9('0x4b')](_0x5c5534[_0xa2c9('0x4c')],{})[_0xa2c9('0x2a')](respondWithResult(_0x46d843,0xc9))['catch'](handleError(_0x46d843,null));};exports['update']=function(_0x54a8b3,_0x417bc5){if(_0x54a8b3[_0xa2c9('0x4c')]['id']){delete _0x54a8b3['body']['id'];}return db[_0xa2c9('0x30')]['find']({'where':{'id':_0x54a8b3['params']['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x417bc5,null))['then'](saveUpdates(_0x54a8b3[_0xa2c9('0x4c')],null))[_0xa2c9('0x2a')](respondWithResult(_0x417bc5,null))['catch'](handleError(_0x417bc5,null));};exports['destroy']=function(_0x1bec77,_0x4b8e2f){return db[_0xa2c9('0x30')][_0xa2c9('0x4a')]({'where':{'id':_0x1bec77[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x4b8e2f,null))['then'](removeEntity(_0x4b8e2f,null))[_0xa2c9('0x42')](handleError(_0x4b8e2f,null));};exports[_0xa2c9('0x4d')]=function(_0x436595,_0x3a6096,_0x4b5104){return db[_0xa2c9('0x4e')][_0xa2c9('0x4a')]({'where':{'id':_0x436595[_0xa2c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a6096,null))[_0xa2c9('0x2a')](function(_0x58ff5d){if(_0x58ff5d){return _0x58ff5d['addConditions'](_0x436595[_0xa2c9('0x4c')]['ids'],_[_0xa2c9('0x4f')](_0x436595[_0xa2c9('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x3a6096,null))[_0xa2c9('0x42')](handleError(_0x3a6096,null));};exports[_0xa2c9('0x50')]=function(_0x22676c,_0xf8a291,_0x399ea5){var _0x150d2b={};var _0x23d87d={};var _0x6797f1;var _0x1ab07e;return db[_0xa2c9('0x30')][_0xa2c9('0x51')]({'where':{'id':_0x22676c[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0xf8a291,null))['then'](function(_0x1d78c5){if(_0x1d78c5){_0x6797f1=_0x1d78c5;_0x23d87d[_0xa2c9('0x36')]=_[_0xa2c9('0x45')](db['Condition'][_0xa2c9('0x46')]);_0x23d87d[_0xa2c9('0x33')]=_['keys'](_0x22676c[_0xa2c9('0x33')]);_0x23d87d['filters']=_[_0xa2c9('0x35')](_0x23d87d[_0xa2c9('0x36')],_0x23d87d[_0xa2c9('0x33')]);_0x150d2b[_0xa2c9('0x38')]=_[_0xa2c9('0x35')](_0x23d87d[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x37')]));_0x150d2b[_0xa2c9('0x38')]=_0x150d2b['attributes'][_0xa2c9('0x39')]?_0x150d2b[_0xa2c9('0x38')]:_0x23d87d[_0xa2c9('0x36')];_0x150d2b['order']=qs[_0xa2c9('0x3c')](_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x3c')]);_0x150d2b[_0xa2c9('0x3f')]=qs[_0xa2c9('0x34')](_[_0xa2c9('0x52')](_0x22676c[_0xa2c9('0x33')],_0x23d87d[_0xa2c9('0x34')]));if(_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x3d')]){_0x150d2b[_0xa2c9('0x3f')]=_[_0xa2c9('0x3e')](_0x150d2b['where'],{'$or':_[_0xa2c9('0x2f')](_0x150d2b[_0xa2c9('0x38')],function(_0x3a4430){var _0xb424fd={};_0xb424fd[_0x3a4430]={'$like':'%'+_0x22676c[_0xa2c9('0x33')]['filter']+'%'};return _0xb424fd;})});}_0x150d2b=_[_0xa2c9('0x3e')]({},_0x150d2b,_0x22676c[_0xa2c9('0x49')]);return _0x6797f1[_0xa2c9('0x50')](_0x150d2b);}})[_0xa2c9('0x2a')](function(_0x4179ff){if(_0x4179ff){_0x1ab07e=_0x4179ff['length'];if(!_0x22676c[_0xa2c9('0x33')]['hasOwnProperty'](_0xa2c9('0x3a'))){_0x150d2b[_0xa2c9('0x21')]=qs[_0xa2c9('0x21')](_0x22676c['query'][_0xa2c9('0x21')]);_0x150d2b['offset']=qs[_0xa2c9('0x1f')](_0x22676c[_0xa2c9('0x33')][_0xa2c9('0x1f')]);}return _0x6797f1[_0xa2c9('0x50')](_0x150d2b);}})['then'](function(_0x3b0fa6){if(_0x3b0fa6){return _0x3b0fa6?{'count':_0x1ab07e,'rows':_0x3b0fa6}:null;}})['then'](respondWithResult(_0xf8a291,null))[_0xa2c9('0x42')](handleError(_0xf8a291,null));};exports[_0xa2c9('0x53')]=function(_0x11ca9c,_0x48c47d,_0x3c7826){return db[_0xa2c9('0x54')]['find']({'where':{'id':_0x11ca9c[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x48c47d,null))[_0xa2c9('0x2a')](function(_0x35f328){if(_0x35f328){return _0x35f328[_0xa2c9('0x53')](_0x11ca9c[_0xa2c9('0x4c')][_0xa2c9('0x55')],_[_0xa2c9('0x4f')](_0x11ca9c[_0xa2c9('0x4c')],[_0xa2c9('0x55'),'id'])||{});}})[_0xa2c9('0x2a')](respondWithResult(_0x48c47d,null))[_0xa2c9('0x42')](handleError(_0x48c47d,null));};exports['getActions']=function(_0x161307,_0x2f377d,_0xb1d1fb){var _0x13e08b={};var _0x21c30c={};var _0x42fcb4;var _0x4a3f01;return db[_0xa2c9('0x30')][_0xa2c9('0x51')]({'where':{'id':_0x161307[_0xa2c9('0x44')]['id']}})[_0xa2c9('0x2a')](handleEntityNotFound(_0x2f377d,null))['then'](function(_0x3b0a75){if(_0x3b0a75){_0x42fcb4=_0x3b0a75;_0x21c30c[_0xa2c9('0x36')]=_['keys'](db['Action']['rawAttributes']);_0x21c30c[_0xa2c9('0x33')]=_[_0xa2c9('0x45')](_0x161307[_0xa2c9('0x33')]);_0x21c30c[_0xa2c9('0x34')]=_['intersection'](_0x21c30c[_0xa2c9('0x36')],_0x21c30c[_0xa2c9('0x33')]);_0x13e08b['attributes']=_[_0xa2c9('0x35')](_0x21c30c[_0xa2c9('0x36')],qs[_0xa2c9('0x37')](_0x161307['query']['fields']));_0x13e08b[_0xa2c9('0x38')]=_0x13e08b['attributes'][_0xa2c9('0x39')]?_0x13e08b[_0xa2c9('0x38')]:_0x21c30c['model'];_0x13e08b[_0xa2c9('0x3b')]=qs[_0xa2c9('0x3c')](_0x161307[_0xa2c9('0x33')][_0xa2c9('0x3c')]);_0x13e08b['where']=qs[_0xa2c9('0x34')](_[_0xa2c9('0x52')](_0x161307[_0xa2c9('0x33')],_0x21c30c['filters']));if(_0x161307['query'][_0xa2c9('0x3d')]){_0x13e08b[_0xa2c9('0x3f')]=_['merge'](_0x13e08b[_0xa2c9('0x3f')],{'$or':_['map'](_0x13e08b['attributes'],function(_0x4a5bd5){var _0x3779cf={};_0x3779cf[_0x4a5bd5]={'$like':'%'+_0x161307[_0xa2c9('0x33')]['filter']+'%'};return _0x3779cf;})});}_0x13e08b=_['merge']({},_0x13e08b,_0x161307['options']);return _0x42fcb4[_0xa2c9('0x56')](_0x13e08b);}})['then'](function(_0x52e172){if(_0x52e172){_0x4a3f01=_0x52e172[_0xa2c9('0x39')];if(!_0x161307[_0xa2c9('0x33')]['hasOwnProperty'](_0xa2c9('0x3a'))){_0x13e08b[_0xa2c9('0x21')]=qs[_0xa2c9('0x21')](_0x161307[_0xa2c9('0x33')][_0xa2c9('0x21')]);_0x13e08b['offset']=qs['offset'](_0x161307[_0xa2c9('0x33')][_0xa2c9('0x1f')]);}return _0x42fcb4[_0xa2c9('0x56')](_0x13e08b);}})[_0xa2c9('0x2a')](function(_0x2ea702){if(_0x2ea702){return _0x2ea702?{'count':_0x4a3f01,'rows':_0x2ea702}:null;}})[_0xa2c9('0x2a')](respondWithResult(_0x2f377d,null))[_0xa2c9('0x42')](handleError(_0x2f377d,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8785e39..d784f74 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 _0x4e29=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4e29,0x1db));var _0x94e2=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0x4e29[_0x5da27f];return _0x54a3fb;};'use strict';var _=require(_0x94e2('0x0'));var util=require(_0x94e2('0x1'));var logger=require(_0x94e2('0x2'))(_0x94e2('0x3'));var moment=require(_0x94e2('0x4'));var BPromise=require(_0x94e2('0x5'));var rp=require(_0x94e2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94e2('0x7'));var config=require(_0x94e2('0x8'));var attributes=require(_0x94e2('0x9'));module[_0x94e2('0xa')]=function(_0x10a5c2,_0xd87d1d){return _0x10a5c2[_0x94e2('0xb')](_0x94e2('0xc'),attributes,{'tableName':_0x94e2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9dbd=['request-promise','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x517bec,_0x5eb629){var _0x11b931=function(_0x39f607){while(--_0x39f607){_0x517bec['push'](_0x517bec['shift']());}};_0x11b931(++_0x5eb629);}(_0x9dbd,0xeb));var _0xd9db=function(_0x4664d3,_0xc0a20f){_0x4664d3=_0x4664d3-0x0;var _0x14329a=_0x9dbd[_0x4664d3];return _0x14329a;};'use strict';var _=require(_0xd9db('0x0'));var util=require(_0xd9db('0x1'));var logger=require(_0xd9db('0x2'))(_0xd9db('0x3'));var moment=require('moment');var BPromise=require(_0xd9db('0x4'));var rp=require(_0xd9db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd9db('0x6'));var attributes=require(_0xd9db('0x7'));module[_0xd9db('0x8')]=function(_0x3d0879,_0x554e0c){return _0x3d0879[_0xd9db('0x9')](_0xd9db('0xa'),attributes,{'tableName':_0xd9db('0xb'),'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 4365e05..f18f4cc 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 _0x4f7b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x16433f,_0x28b788){var _0x1d1574=function(_0x44004b){while(--_0x44004b){_0x16433f['push'](_0x16433f['shift']());}};_0x1d1574(++_0x28b788);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x81c405,_0x1ed388){_0x81c405=_0x81c405-0x0;var _0x537710=_0x4f7b[_0x81c405];return _0x537710;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}
\ No newline at end of file
+var _0x8c11=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x134e99,_0x1b7551){var _0xdbccbe=function(_0x1ed1aa){while(--_0x1ed1aa){_0x134e99['push'](_0x134e99['shift']());}};_0xdbccbe(++_0x1b7551);}(_0x8c11,0xf5));var _0x18c1=function(_0x10247f,_0x1a562e){_0x10247f=_0x10247f-0x0;var _0x4260a8=_0x8c11[_0x10247f];return _0x4260a8;};'use strict';var _=require(_0x18c1('0x0'));var util=require(_0x18c1('0x1'));var moment=require(_0x18c1('0x2'));var BPromise=require(_0x18c1('0x3'));var rs=require(_0x18c1('0x4'));var fs=require('fs');var Redis=require(_0x18c1('0x5'));var db=require(_0x18c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x18c1('0x7'))(_0x18c1('0x8'));var config=require(_0x18c1('0x9'));var jayson=require(_0x18c1('0xa'));var client=jayson[_0x18c1('0xb')][_0x18c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40bc72,_0x276eb7,_0x54519f){return new BPromise(function(_0x28fc68,_0x1477ca){return client['request'](_0x40bc72,_0x54519f)[_0x18c1('0xd')](function(_0x343480){logger[_0x18c1('0xe')]('Automation,\x20%s,\x20%s',_0x276eb7,_0x18c1('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x276eb7,_0x18c1('0xf'),JSON[_0x18c1('0x10')](_0x343480));if(_0x343480[_0x18c1('0x11')]){if(_0x343480[_0x18c1('0x11')][_0x18c1('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x276eb7,_0x343480[_0x18c1('0x11')][_0x18c1('0x13')]);return _0x1477ca(_0x343480['error']['message']);}logger[_0x18c1('0x11')](_0x18c1('0x14'),_0x276eb7,_0x343480[_0x18c1('0x11')]['message']);return _0x28fc68(_0x343480['error']['message']);}else{logger[_0x18c1('0xe')](_0x18c1('0x14'),_0x276eb7,_0x18c1('0xf'));_0x28fc68(_0x343480[_0x18c1('0x15')]['message']);}})[_0x18c1('0x16')](function(_0x6306f1){logger[_0x18c1('0x11')]('Automation,\x20%s,\x20%s',_0x276eb7,_0x6306f1);_0x1477ca(_0x6306f1);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 7d8e0d0..d892cc4 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 _0x25b0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x25b0,0x140));var _0x025b=function(_0xeb80c9,_0x3fe888){_0xeb80c9=_0xeb80c9-0x0;var _0x259c37=_0x25b0[_0xeb80c9];return _0x259c37;};'use strict';var multer=require(_0x025b('0x0'));var util=require(_0x025b('0x1'));var path=require(_0x025b('0x2'));var timeout=require(_0x025b('0x3'));var express=require(_0x025b('0x4'));var router=express[_0x025b('0x5')]();var fs_extra=require(_0x025b('0x6'));var auth=require(_0x025b('0x7'));var interaction=require(_0x025b('0x8'));var config=require(_0x025b('0x9'));var controller=require('./automation.controller');router[_0x025b('0xa')]('/',auth[_0x025b('0xb')](),controller[_0x025b('0xc')]);router['get'](_0x025b('0xd'),auth[_0x025b('0xb')](),controller[_0x025b('0xe')]);router[_0x025b('0xa')](_0x025b('0xf'),auth[_0x025b('0xb')](),controller[_0x025b('0x10')]);router['get'](_0x025b('0x11'),auth[_0x025b('0xb')](),controller[_0x025b('0x12')]);router[_0x025b('0x13')]('/',auth[_0x025b('0xb')](),controller[_0x025b('0x14')]);router[_0x025b('0x13')](_0x025b('0xf'),auth[_0x025b('0xb')](),controller['addConditions']);router[_0x025b('0x13')](_0x025b('0x11'),auth[_0x025b('0xb')](),controller[_0x025b('0x15')]);router[_0x025b('0x16')]('/:id',auth[_0x025b('0xb')](),controller[_0x025b('0x17')]);router[_0x025b('0x18')](_0x025b('0xd'),auth[_0x025b('0xb')](),controller[_0x025b('0x19')]);module[_0x025b('0x1a')]=router;
\ No newline at end of file
+var _0xd84b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/conditions','getActions','post','create','addConditions','/:id/actions','put','update','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x5495b3,_0x10cd9a){var _0x5e6721=function(_0x3d08c2){while(--_0x3d08c2){_0x5495b3['push'](_0x5495b3['shift']());}};_0x5e6721(++_0x10cd9a);}(_0xd84b,0x177));var _0xbd84=function(_0x316808,_0x33dcbe){_0x316808=_0x316808-0x0;var _0x31857f=_0xd84b[_0x316808];return _0x31857f;};'use strict';var multer=require('multer');var util=require(_0xbd84('0x0'));var path=require(_0xbd84('0x1'));var timeout=require(_0xbd84('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd84('0x3'));var auth=require(_0xbd84('0x4'));var interaction=require(_0xbd84('0x5'));var config=require(_0xbd84('0x6'));var controller=require('./automation.controller');router['get']('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0x8')]);router[_0xbd84('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xbd84('0xa'),auth['isAuthenticated'](),controller['getConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xbd84('0xb')]);router[_0xbd84('0xc')]('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0xd')]);router[_0xbd84('0xc')]('/:id/conditions',auth[_0xbd84('0x7')](),controller[_0xbd84('0xe')]);router[_0xbd84('0xc')](_0xbd84('0xf'),auth[_0xbd84('0x7')](),controller['addActions']);router[_0xbd84('0x10')]('/:id',auth[_0xbd84('0x7')](),controller[_0xbd84('0x11')]);router[_0xbd84('0x12')](_0xbd84('0x13'),auth[_0xbd84('0x7')](),controller[_0xbd84('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 2ad2894..2ab8b9e 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 _0x4dc7=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','#Machine\x20Retry\x20(min:1,\x20max:999)','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)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#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)'];(function(_0x58e423,_0x2d8c7d){var _0x5e2b98=function(_0x5a950f){while(--_0x5a950f){_0x58e423['push'](_0x58e423['shift']());}};_0x5e2b98(++_0x2d8c7d);}(_0x4dc7,0x131));var _0x74dc=function(_0x5b3393,_0x1bde99){_0x5b3393=_0x5b3393-0x0;var _0xd92143=_0x4dc7[_0x5b3393];return _0xd92143;};'use strict';var Sequelize=require(_0x74dc('0x0'));module[_0x74dc('0x1')]={'name':{'type':Sequelize[_0x74dc('0x2')],'unique':_0x74dc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x74dc('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x74dc('0x5')},'description':{'type':Sequelize[_0x74dc('0x2')]},'active':{'type':Sequelize[_0x74dc('0x6')],'defaultValue':0x0,'comment':_0x74dc('0x7')},'limitCalls':{'type':Sequelize[_0x74dc('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x74dc('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x74dc('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x74dc('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x74dc('0x12'),'onlyIfOpen'),'defaultValue':_0x74dc('0x13')},'dialAMDActive':{'type':Sequelize[_0x74dc('0x6')],'defaultValue':0x0,'comment':_0x74dc('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x74dc('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x74dc('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x74dc('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x74dc('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x74dc('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x74dc('0x8')](0x9)[_0x74dc('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x74dc('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x74dc('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x74dc('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x74dc('0x4')](_0x74dc('0x1b'),_0x74dc('0x1c')),'defaultValue':_0x74dc('0x1b')},'dialPrefix':{'type':Sequelize[_0x74dc('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x74dc('0x1d')},'dialCutDigit':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x74dc('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x74dc('0x8')](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x74dc('0x8')](0x3)[_0x74dc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x74dc('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x74dc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x74dc('0x27')}};
\ No newline at end of file
+var _0xc0e3=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\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\x20(min:1,\x20max:999)','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)','sequelize','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x54c516,_0x420575){_0x54c516=_0x54c516-0x0;var _0x2583c0=_0xc0e3[_0x54c516];return _0x2583c0;};'use strict';var Sequelize=require(_0x3c0e('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c0e('0x1')],'unique':_0x3c0e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3c0e('0x3')),'allowNull':![],'defaultValue':_0x3c0e('0x3')},'description':{'type':Sequelize[_0x3c0e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3c0e('0x4')},'limitCalls':{'type':Sequelize[_0x3c0e('0x5')](0x4)[_0x3c0e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3c0e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3c0e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3c0e('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3c0e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3c0e('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3c0e('0xd')},'dialTimezone':{'type':Sequelize[_0x3c0e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3c0e('0x1')],'defaultValue':_0x3c0e('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x3c0e('0xf')](_0x3c0e('0x10'),'never',_0x3c0e('0x11')),'defaultValue':_0x3c0e('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3c0e('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x3c0e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3c0e('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3c0e('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3c0e('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3c0e('0x5')](0x9)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3c0e('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3c0e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3c0e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3c0e('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x3c0e('0x18'),_0x3c0e('0x19')),'defaultValue':_0x3c0e('0x18')},'dialPrefix':{'type':Sequelize[_0x3c0e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3c0e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3c0e('0x1a')},'dialCutDigit':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3c0e('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3c0e('0x5')](0x3)[_0x3c0e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3c0e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3c0e('0x5')](0x5)[_0x3c0e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3c0e('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4bbc13a..aae2740 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 _0x8d0e=['Campaign','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','rows','catch','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','options','createdAt','updatedAt','body','omit','UserProfileSection','getHoppers','findOne','merge','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_contacts','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map'];(function(_0x166241,_0x227ee2){var _0x51fd00=function(_0x556fd9){while(--_0x556fd9){_0x166241['push'](_0x166241['shift']());}};_0x51fd00(++_0x227ee2);}(_0x8d0e,0xdb));var _0xe8d0=function(_0xbbde,_0x1f3f4a){_0xbbde=_0xbbde-0x0;var _0x5ef541=_0x8d0e[_0xbbde];return _0x5ef541;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require('request-promise');var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var Mustache=require('mustache');var util=require(_0xe8d0('0x6'));var path=require('path');var sox=require(_0xe8d0('0x7'));var csv=require('to-csv');var ejs=require(_0xe8d0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe8d0('0x9'));var deskjs=require(_0xe8d0('0xa'));var toCsv=require(_0xe8d0('0xb'));var querystring=require(_0xe8d0('0xc'));var Papa=require(_0xe8d0('0xd'));var Redis=require(_0xe8d0('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(_0xe8d0('0xf'))(_0xe8d0('0x10'));var utils=require(_0xe8d0('0x11'));var config=require(_0xe8d0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8d0('0x13'))['db'];function respondWithStatusCode(_0x43fbb9,_0x58325b){_0x58325b=_0x58325b||0xcc;return function(_0x4f6d16){if(_0x4f6d16){return _0x43fbb9[_0xe8d0('0x14')](_0x58325b);}return _0x43fbb9[_0xe8d0('0x15')](_0x58325b)[_0xe8d0('0x16')]();};}function respondWithResult(_0x21c1f0,_0x265bef){_0x265bef=_0x265bef||0xc8;return function(_0x380be6){if(_0x380be6){return _0x21c1f0[_0xe8d0('0x15')](_0x265bef)[_0xe8d0('0x17')](_0x380be6);}};}function respondWithFilteredResult(_0x12c583,_0x5786aa){return function(_0x694771){if(_0x694771){var _0x23efbc=typeof _0x5786aa[_0xe8d0('0x18')]===_0xe8d0('0x19')&&typeof _0x5786aa[_0xe8d0('0x1a')]===_0xe8d0('0x19');var _0x208db4=_0x694771[_0xe8d0('0x1b')];var _0x1ee035=_0x23efbc?0x0:_0x5786aa[_0xe8d0('0x18')];var _0x3a2c52=_0x23efbc?_0x694771[_0xe8d0('0x1b')]:_0x5786aa[_0xe8d0('0x18')]+_0x5786aa['limit'];var _0x45a441;if(_0x3a2c52>=_0x208db4){_0x3a2c52=_0x208db4;_0x45a441=0xc8;}else{_0x45a441=0xce;}_0x12c583[_0xe8d0('0x15')](_0x45a441);return _0x12c583[_0xe8d0('0x1c')](_0xe8d0('0x1d'),_0x1ee035+'-'+_0x3a2c52+'/'+_0x208db4)['json'](_0x694771);}return null;};}function patchUpdates(_0x423293){return function(_0x18bb18){try{jsonpatch['apply'](_0x18bb18,_0x423293,!![]);}catch(_0x2742a9){return BPromise[_0xe8d0('0x1e')](_0x2742a9);}return _0x18bb18['save']();};}function saveUpdates(_0x1e5592,_0x343921){return function(_0x5b4f50){if(_0x5b4f50){return _0x5b4f50['update'](_0x1e5592)[_0xe8d0('0x1f')](function(_0x19764b){return _0x19764b;});}return null;};}function removeEntity(_0x5afec7,_0x354d88){return function(_0x2595d8){if(_0x2595d8){return _0x2595d8[_0xe8d0('0x20')]()[_0xe8d0('0x1f')](function(){var _0x28b621=_0x2595d8[_0xe8d0('0x21')]({'plain':!![]});var _0x56b18c=_0xe8d0('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x56b18c,'resourceId':_0x28b621['id']}})[_0xe8d0('0x1f')](function(){return _0x2595d8;});})[_0xe8d0('0x1f')](function(){_0x5afec7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xca3b8e,_0x42b805){return function(_0x2a9c1f){if(!_0x2a9c1f){_0xca3b8e[_0xe8d0('0x14')](0x194);}return _0x2a9c1f;};}function handleError(_0x2a4a79,_0x1711ae){_0x1711ae=_0x1711ae||0x1f4;return function(_0x1c66cc){logger[_0xe8d0('0x23')](_0x1c66cc[_0xe8d0('0x24')]);if(_0x1c66cc[_0xe8d0('0x25')]){delete _0x1c66cc[_0xe8d0('0x25')];}_0x2a4a79[_0xe8d0('0x15')](_0x1711ae)[_0xe8d0('0x26')](_0x1c66cc);};}exports[_0xe8d0('0x27')]=function(_0x343e1a,_0x4aeead){var _0x3d3226={},_0x3d7864={},_0x5b8c13={'count':0x0,'rows':[]};var _0x320b68=_[_0xe8d0('0x28')](db[_0xe8d0('0x29')][_0xe8d0('0x2a')],function(_0x21240b){return{'name':_0x21240b['fieldName'],'type':_0x21240b[_0xe8d0('0x2b')][_0xe8d0('0x2c')]};});_0x3d7864[_0xe8d0('0x2d')]=_[_0xe8d0('0x28')](_0x320b68,_0xe8d0('0x25'));_0x3d7864[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x343e1a[_0xe8d0('0x2e')]);_0x3d7864['filters']=_[_0xe8d0('0x30')](_0x3d7864['model'],_0x3d7864[_0xe8d0('0x2e')]);_0x3d3226['attributes']=_['intersection'](_0x3d7864[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x343e1a[_0xe8d0('0x2e')]['fields']));_0x3d3226[_0xe8d0('0x32')]=_0x3d3226['attributes']['length']?_0x3d3226[_0xe8d0('0x32')]:_0x3d7864['model'];if(!_0x343e1a[_0xe8d0('0x2e')][_0xe8d0('0x33')](_0xe8d0('0x34'))){_0x3d3226['limit']=qs['limit'](_0x343e1a[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x3d3226[_0xe8d0('0x18')]=qs[_0xe8d0('0x18')](_0x343e1a[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}_0x3d3226[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x343e1a['query'][_0xe8d0('0x36')]);_0x3d3226[_0xe8d0('0x37')]=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x343e1a[_0xe8d0('0x2e')],_0x3d7864[_0xe8d0('0x38')]),_0x320b68);if(_0x343e1a['query'][_0xe8d0('0x3a')]){_0x3d3226[_0xe8d0('0x37')]=_['merge'](_0x3d3226[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x320b68,function(_0x449380){if(_0x449380[_0xe8d0('0x2b')]!==_0xe8d0('0x3b')){var _0x94ef9c={};_0x94ef9c[_0x449380[_0xe8d0('0x25')]]={'$like':'%'+_0x343e1a['query'][_0xe8d0('0x3a')]+'%'};return _0x94ef9c;}})});}_0x3d3226=_['merge']({},_0x3d3226,_0x343e1a['options']);var _0x577cb5={'where':_0x3d3226[_0xe8d0('0x37')]};return db[_0xe8d0('0x29')][_0xe8d0('0x1b')](_0x577cb5)[_0xe8d0('0x1f')](function(_0x3ba501){_0x5b8c13[_0xe8d0('0x1b')]=_0x3ba501;if(_0x343e1a[_0xe8d0('0x2e')]['includeAll']){_0x3d3226['include']=[{'all':!![]}];}return db[_0xe8d0('0x29')]['findAll'](_0x3d3226);})[_0xe8d0('0x1f')](function(_0x194908){_0x5b8c13[_0xe8d0('0x3c')]=_0x194908;return _0x5b8c13;})[_0xe8d0('0x1f')](respondWithFilteredResult(_0x4aeead,_0x3d3226))[_0xe8d0('0x3d')](handleError(_0x4aeead,null));};exports['show']=function(_0x134d7f,_0x5e6693){var _0x521fe4={'raw':![],'where':{'id':_0x134d7f[_0xe8d0('0x3e')]['id']}},_0x2f087d={};_0x2f087d[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x29')][_0xe8d0('0x2a')]);_0x2f087d[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x134d7f[_0xe8d0('0x2e')]);_0x2f087d[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x2f087d[_0xe8d0('0x2d')],_0x2f087d['query']);_0x521fe4[_0xe8d0('0x32')]=_['intersection'](_0x2f087d['model'],qs[_0xe8d0('0x31')](_0x134d7f[_0xe8d0('0x2e')]['fields']));_0x521fe4[_0xe8d0('0x32')]=_0x521fe4['attributes'][_0xe8d0('0x3f')]?_0x521fe4['attributes']:_0x2f087d['model'];if(_0x134d7f['query'][_0xe8d0('0x40')]){_0x521fe4['include']=[{'all':!![]}];}_0x521fe4=_['merge']({},_0x521fe4,_0x134d7f['options']);return db[_0xe8d0('0x29')][_0xe8d0('0x41')](_0x521fe4)[_0xe8d0('0x1f')](handleEntityNotFound(_0x5e6693,null))[_0xe8d0('0x1f')](respondWithResult(_0x5e6693,null))[_0xe8d0('0x3d')](handleError(_0x5e6693,null));};exports[_0xe8d0('0x42')]=function(_0x4b8f98,_0x2c7f4d){return db[_0xe8d0('0x29')]['create'](_0x4b8f98['body'],{})['then'](function(_0x3d2313){var _0x4d22ed=_0x4b8f98[_0xe8d0('0x43')][_0xe8d0('0x21')]({'plain':!![]});if(!_0x4d22ed)throw new Error(_0xe8d0('0x44'));if(_0x4d22ed[_0xe8d0('0x45')]===_0xe8d0('0x43')){var _0x9db633=_0x3d2313['get']({'plain':!![]});var _0x4affd7=_0xe8d0('0x22');return db['UserProfileSection'][_0xe8d0('0x41')]({'where':{'name':_0x4affd7,'userProfileId':_0x4d22ed[_0xe8d0('0x46')]},'raw':!![]})[_0xe8d0('0x1f')](function(_0x52b0ef){if(_0x52b0ef&&_0x52b0ef['autoAssociation']===0x0){return db[_0xe8d0('0x47')][_0xe8d0('0x42')]({'name':_0x9db633[_0xe8d0('0x25')],'resourceId':_0x9db633['id'],'type':_0x52b0ef[_0xe8d0('0x25')],'sectionId':_0x52b0ef['id']},{})[_0xe8d0('0x1f')](function(){return _0x3d2313;});}else{return _0x3d2313;}})[_0xe8d0('0x3d')](function(_0x218fde){logger[_0xe8d0('0x23')](_0xe8d0('0x48'),_0x218fde);throw _0x218fde;});}return _0x3d2313;})[_0xe8d0('0x1f')](respondWithResult(_0x2c7f4d,0xc9))[_0xe8d0('0x3d')](handleError(_0x2c7f4d,null));};exports[_0xe8d0('0x49')]=function(_0x296981,_0x46b15d){var _0x489451={'where':{'id':_0x296981[_0xe8d0('0x3e')]['id']}},_0x1a80cc={};_0x1a80cc[_0xe8d0('0x2d')]=_['keys'](db[_0xe8d0('0x29')][_0xe8d0('0x2a')]);_0x489451[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x1a80cc[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x296981[_0xe8d0('0x2e')]['fields']));_0x489451[_0xe8d0('0x32')]=_0x489451[_0xe8d0('0x32')]['length']?_0x489451[_0xe8d0('0x32')]:_0x1a80cc[_0xe8d0('0x2d')];if(_0x296981[_0xe8d0('0x2e')][_0xe8d0('0x40')]){_0x489451[_0xe8d0('0x4a')]=[{'all':!![]}];}_0x489451=_['merge']({},_0x489451,_0x296981[_0xe8d0('0x4b')]);return db['Campaign']['find'](_0x489451)['then'](handleEntityNotFound(_0x46b15d,null))[_0xe8d0('0x1f')](function(_0x4c729a){if(_0x4c729a){var _0x8631b9=_0x4c729a[_0xe8d0('0x21')]({'plain':!![]});_0x8631b9=qs['omit'](_0x8631b9,['id',_0xe8d0('0x4c'),_0xe8d0('0x4d')]);_0x296981[_0xe8d0('0x4e')]=_[_0xe8d0('0x4f')](_0x296981[_0xe8d0('0x4e')],['id',_0xe8d0('0x4c'),_0xe8d0('0x4d')]);return db[_0xe8d0('0x29')][_0xe8d0('0x42')](_['merge'](_0x8631b9,_0x296981[_0xe8d0('0x4e')]),{'include':_0x296981['query'][_0xe8d0('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x4f0208){var _0x4c482f=_0x296981[_0xe8d0('0x43')]['get']({'plain':!![]});if(!_0x4c482f)throw new Error(_0xe8d0('0x44'));if(_0x4c482f['role']===_0xe8d0('0x43')){var _0x24d0db=_0x4f0208[_0xe8d0('0x21')]({'plain':!![]});var _0x128b18='IvrCampaigns';return db[_0xe8d0('0x50')][_0xe8d0('0x41')]({'where':{'name':_0x128b18,'userProfileId':_0x4c482f[_0xe8d0('0x46')]},'raw':!![]})['then'](function(_0x2ffe98){if(_0x2ffe98&&_0x2ffe98['autoAssociation']===0x0){return db[_0xe8d0('0x47')][_0xe8d0('0x42')]({'name':_0x24d0db[_0xe8d0('0x25')],'resourceId':_0x24d0db['id'],'type':_0x2ffe98[_0xe8d0('0x25')],'sectionId':_0x2ffe98['id']},{})[_0xe8d0('0x1f')](function(){return _0x4f0208;});}else{return _0x4f0208;}})[_0xe8d0('0x3d')](function(_0x5bcc88){logger[_0xe8d0('0x23')](_0xe8d0('0x48'),_0x5bcc88);throw _0x5bcc88;});}return _0x4f0208;});}})[_0xe8d0('0x1f')](respondWithResult(_0x46b15d,0xc9))[_0xe8d0('0x3d')](handleError(_0x46b15d,null));};exports['update']=function(_0x312cba,_0x7a2f6a){if(_0x312cba[_0xe8d0('0x4e')]['id']){delete _0x312cba[_0xe8d0('0x4e')]['id'];}return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x312cba[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x7a2f6a,null))[_0xe8d0('0x1f')](saveUpdates(_0x312cba[_0xe8d0('0x4e')],null))['then'](respondWithResult(_0x7a2f6a,null))[_0xe8d0('0x3d')](handleError(_0x7a2f6a,null));};exports[_0xe8d0('0x20')]=function(_0x33218e,_0x29edd7){return db['Campaign'][_0xe8d0('0x41')]({'where':{'id':_0x33218e['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x29edd7,null))[_0xe8d0('0x1f')](removeEntity(_0x29edd7,null))[_0xe8d0('0x3d')](handleError(_0x29edd7,null));};exports[_0xe8d0('0x51')]=function(_0x43c854,_0x2a0d72,_0x460cc1){var _0x3246a7={'raw':!![],'where':{}};var _0x28d124={};var _0x90764={'count':0x0,'rows':[]};return db[_0xe8d0('0x29')][_0xe8d0('0x52')]({'where':{'id':_0x43c854[_0xe8d0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2a0d72,null))[_0xe8d0('0x1f')](function(_0x5064d4){if(_0x5064d4){_0x28d124[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db['CmHopper'][_0xe8d0('0x2a')]);_0x28d124['query']=_[_0xe8d0('0x2f')](_0x43c854[_0xe8d0('0x2e')]);_0x28d124[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x28d124[_0xe8d0('0x2d')],_0x28d124[_0xe8d0('0x2e')]);_0x3246a7[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x28d124[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x3246a7[_0xe8d0('0x32')]=_0x3246a7[_0xe8d0('0x32')][_0xe8d0('0x3f')]?_0x3246a7[_0xe8d0('0x32')]:_0x28d124[_0xe8d0('0x2d')];if(!_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x33')](_0xe8d0('0x34'))){_0x3246a7['limit']=qs['limit'](_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x3246a7['offset']=qs['offset'](_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}_0x3246a7[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x43c854['query'][_0xe8d0('0x36')]);_0x3246a7[_0xe8d0('0x37')]=qs[_0xe8d0('0x38')](_['pick'](_0x43c854['query'],_0x28d124[_0xe8d0('0x38')]));_0x3246a7[_0xe8d0('0x37')]['CampaignId']=_0x5064d4['id'];if(_0x43c854[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x3246a7[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x3246a7[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x3246a7[_0xe8d0('0x32')],function(_0x4ecfe4){var _0xcbf670={};_0xcbf670[_0x4ecfe4]={'$like':'%'+_0x43c854['query'][_0xe8d0('0x3a')]+'%'};return _0xcbf670;})});}_0x3246a7=_['merge']({},_0x3246a7,_0x43c854[_0xe8d0('0x4b')]);return db['CmHopper'][_0xe8d0('0x1b')]({'where':_0x3246a7[_0xe8d0('0x37')]})[_0xe8d0('0x1f')](function(_0x31fdb9){_0x90764['count']=_0x31fdb9;if(_0x43c854['query']['includeAll']){_0x3246a7[_0xe8d0('0x4a')]=[{'all':!![]}];}return db[_0xe8d0('0x54')]['findAll'](_0x3246a7);})[_0xe8d0('0x1f')](function(_0x2bd262){_0x90764['rows']=_0x2bd262;return _0x90764;});}})['then'](respondWithFilteredResult(_0x2a0d72,_0x3246a7))['catch'](handleError(_0x2a0d72,null));};exports[_0xe8d0('0x55')]=function(_0x19040d,_0x596b41,_0x350afd){var _0x256dfc={'raw':!![],'where':{}};var _0x2ac4a7={};var _0x1eeec0={'count':0x0,'rows':[]};return db[_0xe8d0('0x29')][_0xe8d0('0x52')]({'where':{'id':_0x19040d['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x596b41,null))[_0xe8d0('0x1f')](function(_0x5a09ca){if(_0x5a09ca){_0x2ac4a7[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x56')][_0xe8d0('0x2a')]);_0x2ac4a7[_0xe8d0('0x2e')]=_['keys'](_0x19040d[_0xe8d0('0x2e')]);_0x2ac4a7['filters']=_[_0xe8d0('0x30')](_0x2ac4a7['model'],_0x2ac4a7['query']);_0x256dfc[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x2ac4a7[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x19040d['query'][_0xe8d0('0x31')]));_0x256dfc[_0xe8d0('0x32')]=_0x256dfc[_0xe8d0('0x32')]['length']?_0x256dfc['attributes']:_0x2ac4a7[_0xe8d0('0x2d')];if(!_0x19040d['query'][_0xe8d0('0x33')](_0xe8d0('0x34'))){_0x256dfc[_0xe8d0('0x1a')]=qs[_0xe8d0('0x1a')](_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x256dfc[_0xe8d0('0x18')]=qs[_0xe8d0('0x18')](_0x19040d['query'][_0xe8d0('0x18')]);}_0x256dfc[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x256dfc['where']=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x19040d[_0xe8d0('0x2e')],_0x2ac4a7[_0xe8d0('0x38')]));_0x256dfc[_0xe8d0('0x37')][_0xe8d0('0x57')]=_0x5a09ca['id'];if(_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x256dfc[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x256dfc[_0xe8d0('0x37')],{'$or':_['map'](_0x256dfc[_0xe8d0('0x32')],function(_0x5373e3){var _0x49c1bb={};_0x49c1bb[_0x5373e3]={'$like':'%'+_0x19040d[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x49c1bb;})});}_0x256dfc=_['merge']({},_0x256dfc,_0x19040d[_0xe8d0('0x4b')]);return db[_0xe8d0('0x56')]['count']({'where':_0x256dfc['where']})[_0xe8d0('0x1f')](function(_0x1311a9){_0x1eeec0[_0xe8d0('0x1b')]=_0x1311a9;if(_0x19040d['query']['includeAll']){_0x256dfc[_0xe8d0('0x4a')]=[{'all':!![]}];}return db[_0xe8d0('0x56')][_0xe8d0('0x58')](_0x256dfc);})[_0xe8d0('0x1f')](function(_0x4c6e5b){_0x1eeec0[_0xe8d0('0x3c')]=_0x4c6e5b;return _0x1eeec0;});}})['then'](respondWithFilteredResult(_0x596b41,_0x256dfc))[_0xe8d0('0x3d')](handleError(_0x596b41,null));};exports[_0xe8d0('0x59')]=function(_0x1442f0,_0x1354fc,_0x41a272){var _0x56dce6={'raw':!![],'where':{}};var _0x6472b9={};var _0x1c5cb3={'count':0x0,'rows':[]};return db['Campaign'][_0xe8d0('0x52')]({'where':{'id':_0x1442f0['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x1354fc,null))[_0xe8d0('0x1f')](function(_0x3568a3){if(_0x3568a3){_0x6472b9[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x5a')][_0xe8d0('0x2a')]);_0x6472b9[_0xe8d0('0x2e')]=_['keys'](_0x1442f0[_0xe8d0('0x2e')]);_0x6472b9['filters']=_[_0xe8d0('0x30')](_0x6472b9[_0xe8d0('0x2d')],_0x6472b9[_0xe8d0('0x2e')]);_0x56dce6['attributes']=_[_0xe8d0('0x30')](_0x6472b9[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x56dce6[_0xe8d0('0x32')]=_0x56dce6[_0xe8d0('0x32')]['length']?_0x56dce6[_0xe8d0('0x32')]:_0x6472b9[_0xe8d0('0x2d')];if(!_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x33')]('nolimit')){_0x56dce6['limit']=qs['limit'](_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x56dce6[_0xe8d0('0x18')]=qs[_0xe8d0('0x18')](_0x1442f0['query'][_0xe8d0('0x18')]);}_0x56dce6[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x56dce6['where']=qs[_0xe8d0('0x38')](_['pick'](_0x1442f0[_0xe8d0('0x2e')],_0x6472b9[_0xe8d0('0x38')]));_0x56dce6[_0xe8d0('0x37')][_0xe8d0('0x57')]=_0x3568a3['id'];if(_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x56dce6[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x56dce6[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x56dce6['attributes'],function(_0x304d07){var _0x92afe8={};_0x92afe8[_0x304d07]={'$like':'%'+_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x92afe8;})});}_0x56dce6=_[_0xe8d0('0x53')]({},_0x56dce6,_0x1442f0[_0xe8d0('0x4b')]);return db['CmHopperFinal']['count']({'where':_0x56dce6[_0xe8d0('0x37')]})[_0xe8d0('0x1f')](function(_0x49905c){_0x1c5cb3[_0xe8d0('0x1b')]=_0x49905c;if(_0x1442f0[_0xe8d0('0x2e')][_0xe8d0('0x40')]){_0x56dce6['include']=[{'all':!![]}];}return db[_0xe8d0('0x5a')][_0xe8d0('0x58')](_0x56dce6);})[_0xe8d0('0x1f')](function(_0x194f47){_0x1c5cb3['rows']=_0x194f47;return _0x1c5cb3;});}})[_0xe8d0('0x1f')](respondWithFilteredResult(_0x1354fc,_0x56dce6))[_0xe8d0('0x3d')](handleError(_0x1354fc,null));};exports[_0xe8d0('0x5b')]=function(_0x2cae32,_0x20ddf9,_0x45905c){var _0x3ce138={'raw':!![],'where':{}};var _0x2434e6={};var _0x1a76f3={'count':0x0,'rows':[]};return db[_0xe8d0('0x29')]['findOne']({'where':{'id':_0x2cae32[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x20ddf9,null))[_0xe8d0('0x1f')](function(_0x2bcbc3){if(_0x2bcbc3){_0x2434e6[_0xe8d0('0x2d')]=_['keys'](db[_0xe8d0('0x5c')][_0xe8d0('0x2a')]);_0x2434e6[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x2cae32[_0xe8d0('0x2e')]);_0x2434e6[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x2434e6[_0xe8d0('0x2d')],_0x2434e6[_0xe8d0('0x2e')]);_0x3ce138['attributes']=_['intersection'](_0x2434e6[_0xe8d0('0x2d')],qs['fields'](_0x2cae32[_0xe8d0('0x2e')]['fields']));_0x3ce138[_0xe8d0('0x32')]=_0x3ce138[_0xe8d0('0x32')][_0xe8d0('0x3f')]?_0x3ce138[_0xe8d0('0x32')]:_0x2434e6[_0xe8d0('0x2d')];if(!_0x2cae32[_0xe8d0('0x2e')]['hasOwnProperty'](_0xe8d0('0x34'))){_0x3ce138[_0xe8d0('0x1a')]=qs[_0xe8d0('0x1a')](_0x2cae32[_0xe8d0('0x2e')]['limit']);_0x3ce138['offset']=qs['offset'](_0x2cae32[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}_0x3ce138[_0xe8d0('0x35')]=qs['sort'](_0x2cae32[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x3ce138['where']=qs['filters'](_[_0xe8d0('0x39')](_0x2cae32[_0xe8d0('0x2e')],_0x2434e6[_0xe8d0('0x38')]));_0x3ce138[_0xe8d0('0x37')][_0xe8d0('0x57')]=_0x2bcbc3['id'];if(_0x2cae32[_0xe8d0('0x2e')]['filter']){_0x3ce138[_0xe8d0('0x37')]=_['merge'](_0x3ce138[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x3ce138['attributes'],function(_0x2235ac){var _0x47b421={};_0x47b421[_0x2235ac]={'$like':'%'+_0x2cae32[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x47b421;})});}_0x3ce138=_[_0xe8d0('0x53')]({},_0x3ce138,_0x2cae32[_0xe8d0('0x4b')]);return db[_0xe8d0('0x5c')][_0xe8d0('0x1b')]({'where':_0x3ce138[_0xe8d0('0x37')]})[_0xe8d0('0x1f')](function(_0x4e7d40){_0x1a76f3[_0xe8d0('0x1b')]=_0x4e7d40;if(_0x2cae32['query']['includeAll']){_0x3ce138[_0xe8d0('0x4a')]=[{'all':!![]}];}return db[_0xe8d0('0x5c')][_0xe8d0('0x58')](_0x3ce138);})[_0xe8d0('0x1f')](function(_0x30d43b){_0x1a76f3[_0xe8d0('0x3c')]=_0x30d43b;return _0x1a76f3;});}})[_0xe8d0('0x1f')](respondWithFilteredResult(_0x20ddf9,_0x3ce138))[_0xe8d0('0x3d')](handleError(_0x20ddf9,null));};exports[_0xe8d0('0x5d')]=function(_0x520e6c,_0x4a2667,_0x54bf1e){var _0x4b8c59={};var _0x37a989={};var _0x390526;var _0x2f383f;return db[_0xe8d0('0x29')][_0xe8d0('0x52')]({'where':{'id':_0x520e6c[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x4a2667,null))['then'](function(_0x369cc1){if(_0x369cc1){_0x390526=_0x369cc1;_0x37a989[_0xe8d0('0x2d')]=_['keys'](db[_0xe8d0('0x5e')][_0xe8d0('0x2a')]);_0x37a989[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x520e6c[_0xe8d0('0x2e')]);_0x37a989[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x37a989[_0xe8d0('0x2d')],_0x37a989[_0xe8d0('0x2e')]);_0x4b8c59[_0xe8d0('0x32')]=_['intersection'](_0x37a989[_0xe8d0('0x2d')],qs[_0xe8d0('0x31')](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x4b8c59[_0xe8d0('0x32')]=_0x4b8c59[_0xe8d0('0x32')][_0xe8d0('0x3f')]?_0x4b8c59[_0xe8d0('0x32')]:_0x37a989['model'];_0x4b8c59[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x4b8c59['where']=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x520e6c[_0xe8d0('0x2e')],_0x37a989[_0xe8d0('0x38')]));if(_0x520e6c['query'][_0xe8d0('0x3a')]){_0x4b8c59[_0xe8d0('0x37')]=_[_0xe8d0('0x53')](_0x4b8c59[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x4b8c59[_0xe8d0('0x32')],function(_0x407cd9){var _0x5d1eb2={};_0x5d1eb2[_0x407cd9]={'$like':'%'+_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x3a')]+'%'};return _0x5d1eb2;})});}_0x4b8c59=_['merge']({},_0x4b8c59,_0x520e6c[_0xe8d0('0x4b')]);return _0x390526[_0xe8d0('0x5d')](_0x4b8c59);}})['then'](function(_0x555586){if(_0x555586){_0x2f383f=_0x555586['length'];if(!_0x520e6c[_0xe8d0('0x2e')]['hasOwnProperty'](_0xe8d0('0x34'))){_0x4b8c59['limit']=qs[_0xe8d0('0x1a')](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x1a')]);_0x4b8c59[_0xe8d0('0x18')]=qs['offset'](_0x520e6c[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}return _0x390526[_0xe8d0('0x5d')](_0x4b8c59);}})[_0xe8d0('0x1f')](function(_0x25bd68){if(_0x25bd68){return _0x25bd68?{'count':_0x2f383f,'rows':_0x25bd68}:null;}})[_0xe8d0('0x1f')](respondWithResult(_0x4a2667,null))['catch'](handleError(_0x4a2667,null));};exports[_0xe8d0('0x5f')]=function(_0x57d28a,_0x331c48,_0x1b39d9){var _0x5e02d1,_0x1d9725;return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x57d28a['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x331c48,null))[_0xe8d0('0x1f')](function(_0x3ee119){if(_0x3ee119){_0x1d9725=_0x3ee119;return _0x3ee119['addLists'](_0x57d28a['body'][_0xe8d0('0x60')],_[_0xe8d0('0x4f')](_0x57d28a[_0xe8d0('0x4e')],[_0xe8d0('0x60'),'id'])||{});}return null;})[_0xe8d0('0x61')](function(_0x44f143){var _0x55ce1c;_0x5e02d1=_0x44f143||[];var _0x12c286=[];if(_0x44f143){for(var _0x45c774=0x0;_0x45c774<_0x44f143[_0xe8d0('0x3f')];_0x45c774+=0x1){var _0x2dd5fc=_0x44f143[_0x45c774][_0xe8d0('0x21')]({'plain':!![]});_0x1d9725[_0xe8d0('0x62')]=_0x57d28a['body'][_0xe8d0('0x62')]?_0x57d28a['body'][_0xe8d0('0x62')]:_0x1d9725[_0xe8d0('0x62')];switch(_0x1d9725[_0xe8d0('0x62')]){case'always':_0x55ce1c=squel[_0xe8d0('0x63')]()[_0xe8d0('0x64')]('cm_hopper')[_0xe8d0('0x65')](['phone',_0xe8d0('0x66'),_0xe8d0('0x67'),_0xe8d0('0x68'),_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()['field'](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')](_0xe8d0('0x6b'),_0xe8d0('0x66'))[_0xe8d0('0x6a')]('id',_0xe8d0('0x67'))[_0xe8d0('0x6a')](_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')](),_0xe8d0('0x68'))[_0xe8d0('0x6a')](_0x57d28a[_0xe8d0('0x3e')]['id']['toString'](),_0xe8d0('0x57'))[_0xe8d0('0x6a')]('NOW()','createdAt')['field'](_0xe8d0('0x6b'),_0xe8d0('0x4d'))[_0xe8d0('0x6e')]('cm_contacts')[_0xe8d0('0x37')](_0xe8d0('0x6f'))[_0xe8d0('0x37')]('ListId\x20=\x20?',_0x2dd5fc['CmListId'][_0xe8d0('0x6d')]())[_0xe8d0('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0xe8d0('0x37')](_0xe8d0('0x70'),squel[_0xe8d0('0x71')]()[_0xe8d0('0x6a')](_0xe8d0('0x72'))[_0xe8d0('0x6e')](_0xe8d0('0x73'))['where'](_0xe8d0('0x74'),_0x57d28a[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')]()))[_0xe8d0('0x37')](_0xe8d0('0x70'),squel[_0xe8d0('0x71')]()[_0xe8d0('0x6a')](_0xe8d0('0x75'))['from'](_0xe8d0('0x76'))[_0xe8d0('0x37')](_0xe8d0('0x74'),_0x57d28a[_0xe8d0('0x3e')]['id']['toString']())))['toString']();break;case _0xe8d0('0x77'):_0x55ce1c=squel[_0xe8d0('0x63')]()['into'](_0xe8d0('0x76'))['fromQuery']([_0xe8d0('0x69'),_0xe8d0('0x66'),'ContactId',_0xe8d0('0x68'),_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()[_0xe8d0('0x6a')](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')]('NOW()',_0xe8d0('0x66'))['field']('id','ContactId')['field'](_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')](),_0xe8d0('0x68'))[_0xe8d0('0x6a')](_0x57d28a[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')](),_0xe8d0('0x57'))['field'](_0xe8d0('0x6b'),_0xe8d0('0x4c'))['field'](_0xe8d0('0x6b'),_0xe8d0('0x4d'))['from']('cm_contacts')[_0xe8d0('0x37')](_0xe8d0('0x6f'))['where'](_0xe8d0('0x78'),_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')]())['where'](_0xe8d0('0x79'))[_0xe8d0('0x37')](_0xe8d0('0x70'),squel['select']()[_0xe8d0('0x6a')]('COALESCE(phone,\x27\x27)')[_0xe8d0('0x6e')](_0xe8d0('0x76'))[_0xe8d0('0x37')]('CampaignId\x20=\x20?',_0x57d28a[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')]())))['toString']();break;default:_0x55ce1c=squel[_0xe8d0('0x63')]()[_0xe8d0('0x64')](_0xe8d0('0x76'))['fromQuery']([_0xe8d0('0x69'),_0xe8d0('0x66'),_0xe8d0('0x67'),'ListId',_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()['field'](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')](_0xe8d0('0x6b'),_0xe8d0('0x66'))[_0xe8d0('0x6a')]('id',_0xe8d0('0x67'))[_0xe8d0('0x6a')](_0x2dd5fc[_0xe8d0('0x6c')][_0xe8d0('0x6d')](),_0xe8d0('0x68'))['field'](_0x57d28a['params']['id']['toString'](),_0xe8d0('0x57'))['field']('NOW()',_0xe8d0('0x4c'))['field']('NOW()',_0xe8d0('0x4d'))[_0xe8d0('0x6e')](_0xe8d0('0x7a'))['where']('deletedAt\x20IS\x20NULL')[_0xe8d0('0x37')]('ListId\x20=\x20?',_0x2dd5fc[_0xe8d0('0x6c')]['toString']())['where'](_0xe8d0('0x79')))[_0xe8d0('0x6d')]();}_0x12c286['push'](db['sequelize']['query'](_0x55ce1c));}return BPromise[_0xe8d0('0x7b')](_0x12c286);}})[_0xe8d0('0x1f')](function(){return _0x5e02d1;})[_0xe8d0('0x1f')](respondWithResult(_0x331c48,null))[_0xe8d0('0x3d')](handleError(_0x331c48,null));};exports['removeLists']=function(_0x38a1e6,_0x137abc,_0x523c05){return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x38a1e6[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x137abc,null))[_0xe8d0('0x1f')](function(_0x4f3eb1){if(_0x4f3eb1){return _0x4f3eb1[_0xe8d0('0x7c')](_0x38a1e6[_0xe8d0('0x2e')][_0xe8d0('0x60')]);}})[_0xe8d0('0x1f')](function(_0x1beb8e){if(_0x1beb8e){return db[_0xe8d0('0x54')][_0xe8d0('0x20')]({'where':{'ListId':_0x38a1e6[_0xe8d0('0x2e')][_0xe8d0('0x60')],'CampaignId':_0x38a1e6['params']['id']}})[_0xe8d0('0x1f')](function(){return _0x1beb8e;});}})[_0xe8d0('0x1f')](respondWithStatusCode(_0x137abc,null))[_0xe8d0('0x3d')](handleError(_0x137abc,null));};exports['getBlackLists']=function(_0x1bce37,_0x8e204a,_0xec187d){var _0x6d09f0={};var _0x316da5={};var _0x4c8d92;var _0x2714fb;return db['Campaign'][_0xe8d0('0x52')]({'where':{'id':_0x1bce37[_0xe8d0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x8e204a,null))[_0xe8d0('0x1f')](function(_0x47c667){if(_0x47c667){_0x4c8d92=_0x47c667;_0x316da5[_0xe8d0('0x2d')]=_[_0xe8d0('0x2f')](db[_0xe8d0('0x5e')][_0xe8d0('0x2a')]);_0x316da5[_0xe8d0('0x2e')]=_[_0xe8d0('0x2f')](_0x1bce37[_0xe8d0('0x2e')]);_0x316da5[_0xe8d0('0x38')]=_[_0xe8d0('0x30')](_0x316da5[_0xe8d0('0x2d')],_0x316da5['query']);_0x6d09f0[_0xe8d0('0x32')]=_[_0xe8d0('0x30')](_0x316da5['model'],qs[_0xe8d0('0x31')](_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x31')]));_0x6d09f0[_0xe8d0('0x32')]=_0x6d09f0['attributes']['length']?_0x6d09f0[_0xe8d0('0x32')]:_0x316da5[_0xe8d0('0x2d')];_0x6d09f0[_0xe8d0('0x35')]=qs[_0xe8d0('0x36')](_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x36')]);_0x6d09f0['where']=qs[_0xe8d0('0x38')](_[_0xe8d0('0x39')](_0x1bce37[_0xe8d0('0x2e')],_0x316da5[_0xe8d0('0x38')]));if(_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x3a')]){_0x6d09f0['where']=_[_0xe8d0('0x53')](_0x6d09f0[_0xe8d0('0x37')],{'$or':_[_0xe8d0('0x28')](_0x6d09f0[_0xe8d0('0x32')],function(_0x23fbaa){var _0x44d249={};_0x44d249[_0x23fbaa]={'$like':'%'+_0x1bce37['query'][_0xe8d0('0x3a')]+'%'};return _0x44d249;})});}_0x6d09f0=_[_0xe8d0('0x53')]({},_0x6d09f0,_0x1bce37[_0xe8d0('0x4b')]);return _0x4c8d92['getBlackLists'](_0x6d09f0);}})[_0xe8d0('0x1f')](function(_0x12ac51){if(_0x12ac51){_0x2714fb=_0x12ac51[_0xe8d0('0x3f')];if(!_0x1bce37['query'][_0xe8d0('0x33')]('nolimit')){_0x6d09f0[_0xe8d0('0x1a')]=qs['limit'](_0x1bce37['query'][_0xe8d0('0x1a')]);_0x6d09f0['offset']=qs['offset'](_0x1bce37[_0xe8d0('0x2e')][_0xe8d0('0x18')]);}return _0x4c8d92[_0xe8d0('0x7d')](_0x6d09f0);}})[_0xe8d0('0x1f')](function(_0x101e19){if(_0x101e19){return _0x101e19?{'count':_0x2714fb,'rows':_0x101e19}:null;}})[_0xe8d0('0x1f')](respondWithResult(_0x8e204a,null))[_0xe8d0('0x3d')](handleError(_0x8e204a,null));};exports[_0xe8d0('0x7e')]=function(_0x1a90e9,_0x3a193e,_0xf72c73){var _0x109400,_0x202be1;return db['Campaign'][_0xe8d0('0x41')]({'where':{'id':_0x1a90e9['params']['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x3a193e,null))['then'](function(_0x459577){if(_0x459577){_0x202be1=_0x459577;return _0x459577[_0xe8d0('0x7e')](_0x1a90e9[_0xe8d0('0x4e')]['ids'],_[_0xe8d0('0x4f')](_0x1a90e9['body'],[_0xe8d0('0x60'),'id'])||{});}return null;})['spread'](function(_0x2ffaa1){var _0x292ffb;_0x109400=_0x2ffaa1||[];var _0x5d16e4=[];if(_0x2ffaa1){for(var _0x46eb8c=0x0;_0x46eb8c<_0x2ffaa1[_0xe8d0('0x3f')];_0x46eb8c+=0x1){var _0x10c4e1=_0x2ffaa1[_0x46eb8c][_0xe8d0('0x21')]({'plain':!![]});_0x292ffb=squel[_0xe8d0('0x63')]()['into'](_0xe8d0('0x7f'))['fromQuery']([_0xe8d0('0x69'),_0xe8d0('0x67'),_0xe8d0('0x68'),_0xe8d0('0x57'),_0xe8d0('0x4c'),_0xe8d0('0x4d')],squel['select']()[_0xe8d0('0x6a')](_0xe8d0('0x69'),_0xe8d0('0x69'))[_0xe8d0('0x6a')]('id',_0xe8d0('0x67'))[_0xe8d0('0x6a')](_0x10c4e1[_0xe8d0('0x6c')]['toString'](),_0xe8d0('0x68'))[_0xe8d0('0x6a')](_0x1a90e9[_0xe8d0('0x3e')]['id'][_0xe8d0('0x6d')](),_0xe8d0('0x57'))[_0xe8d0('0x6a')]('NOW()','createdAt')['field'](_0xe8d0('0x6b'),_0xe8d0('0x4d'))[_0xe8d0('0x6e')](_0xe8d0('0x7a'))[_0xe8d0('0x37')](_0xe8d0('0x6f'))[_0xe8d0('0x37')](_0xe8d0('0x78'),_0x10c4e1[_0xe8d0('0x6c')][_0xe8d0('0x6d')]())['where'](_0xe8d0('0x79')))[_0xe8d0('0x6d')]();_0x5d16e4[_0xe8d0('0x80')](db[_0xe8d0('0x81')]['query'](_0x292ffb));}return BPromise['all'](_0x5d16e4);}})[_0xe8d0('0x1f')](function(){return _0x109400;})['then'](respondWithResult(_0x3a193e,null))[_0xe8d0('0x3d')](handleError(_0x3a193e,null));};exports['removeBlackLists']=function(_0x5ba115,_0x28eeee,_0x7bb6b7){return db[_0xe8d0('0x29')][_0xe8d0('0x41')]({'where':{'id':_0x5ba115[_0xe8d0('0x3e')]['id']}})[_0xe8d0('0x1f')](handleEntityNotFound(_0x28eeee,null))['then'](function(_0x4ed7a5){if(_0x4ed7a5){return _0x4ed7a5['removeBlackLists'](_0x5ba115[_0xe8d0('0x2e')][_0xe8d0('0x60')]);}})['then'](function(_0x1c0d49){if(_0x1c0d49){return db[_0xe8d0('0x5c')][_0xe8d0('0x20')]({'where':{'ListId':_0x5ba115[_0xe8d0('0x2e')][_0xe8d0('0x60')],'CampaignId':_0x5ba115[_0xe8d0('0x3e')]['id']}})['then'](function(){return _0x1c0d49;});}})['then'](respondWithStatusCode(_0x28eeee,null))['catch'](handleError(_0x28eeee,null));};
\ No newline at end of file
+var _0x83bd=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','send','index','map','Campaign','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x250309,_0x457e10){var _0x3debd7=function(_0x2a6d1c){while(--_0x2a6d1c){_0x250309['push'](_0x250309['shift']());}};_0x3debd7(++_0x457e10);}(_0x83bd,0x13d));var _0xd83b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x83bd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd83b('0x0'));var zipdir=require(_0xd83b('0x1'));var jsonpatch=require(_0xd83b('0x2'));var rp=require(_0xd83b('0x3'));var moment=require('moment');var BPromise=require(_0xd83b('0x4'));var Mustache=require(_0xd83b('0x5'));var util=require(_0xd83b('0x6'));var path=require(_0xd83b('0x7'));var sox=require(_0xd83b('0x8'));var csv=require(_0xd83b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd83b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd83b('0xb'));var jsforce=require(_0xd83b('0xc'));var deskjs=require(_0xd83b('0xd'));var toCsv=require(_0xd83b('0x9'));var querystring=require(_0xd83b('0xe'));var Papa=require(_0xd83b('0xf'));var Redis=require(_0xd83b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd83b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd83b('0x12'))(_0xd83b('0x13'));var utils=require(_0xd83b('0x14'));var config=require(_0xd83b('0x15'));var licenseUtil=require(_0xd83b('0x16'));var db=require(_0xd83b('0x17'))['db'];function respondWithStatusCode(_0x2a4a62,_0x2165e7){_0x2165e7=_0x2165e7||0xcc;return function(_0x21b226){if(_0x21b226){return _0x2a4a62[_0xd83b('0x18')](_0x2165e7);}return _0x2a4a62[_0xd83b('0x19')](_0x2165e7)[_0xd83b('0x1a')]();};}function respondWithResult(_0x5809e4,_0x40fc21){_0x40fc21=_0x40fc21||0xc8;return function(_0x21d391){if(_0x21d391){return _0x5809e4[_0xd83b('0x19')](_0x40fc21)[_0xd83b('0x1b')](_0x21d391);}};}function respondWithFilteredResult(_0x1687c4,_0x3a2241){return function(_0xcbdcb3){if(_0xcbdcb3){var _0x992a10=typeof _0x3a2241['offset']===_0xd83b('0x1c')&&typeof _0x3a2241[_0xd83b('0x1d')]===_0xd83b('0x1c');var _0x11b777=_0xcbdcb3[_0xd83b('0x1e')];var _0x3a4287=_0x992a10?0x0:_0x3a2241[_0xd83b('0x1f')];var _0x41695d=_0x992a10?_0xcbdcb3[_0xd83b('0x1e')]:_0x3a2241[_0xd83b('0x1f')]+_0x3a2241['limit'];var _0x3e71b9;if(_0x41695d>=_0x11b777){_0x41695d=_0x11b777;_0x3e71b9=0xc8;}else{_0x3e71b9=0xce;}_0x1687c4[_0xd83b('0x19')](_0x3e71b9);return _0x1687c4[_0xd83b('0x20')](_0xd83b('0x21'),_0x3a4287+'-'+_0x41695d+'/'+_0x11b777)['json'](_0xcbdcb3);}return null;};}function patchUpdates(_0x162f63){return function(_0x3ce4e2){try{jsonpatch[_0xd83b('0x22')](_0x3ce4e2,_0x162f63,!![]);}catch(_0x39daf5){return BPromise[_0xd83b('0x23')](_0x39daf5);}return _0x3ce4e2['save']();};}function saveUpdates(_0x23618a,_0x431b7e){return function(_0x178de3){if(_0x178de3){return _0x178de3[_0xd83b('0x24')](_0x23618a)[_0xd83b('0x25')](function(_0x23a473){return _0x23a473;});}return null;};}function removeEntity(_0x2e7fa0,_0x565754){return function(_0x573bfa){if(_0x573bfa){return _0x573bfa[_0xd83b('0x26')]()[_0xd83b('0x25')](function(){var _0x1e069f=_0x573bfa[_0xd83b('0x27')]({'plain':!![]});var _0x49f1be=_0xd83b('0x28');return db[_0xd83b('0x29')]['destroy']({'where':{'type':_0x49f1be,'resourceId':_0x1e069f['id']}})['then'](function(){return _0x573bfa;});})['then'](function(){_0x2e7fa0[_0xd83b('0x19')](0xcc)[_0xd83b('0x1a')]();});}};}function handleEntityNotFound(_0x5bd3c8,_0x4fd9b5){return function(_0x2803d1){if(!_0x2803d1){_0x5bd3c8[_0xd83b('0x18')](0x194);}return _0x2803d1;};}function handleError(_0x562e5c,_0x403713){_0x403713=_0x403713||0x1f4;return function(_0x2b5812){logger[_0xd83b('0x2a')](_0x2b5812[_0xd83b('0x2b')]);if(_0x2b5812['name']){delete _0x2b5812['name'];}_0x562e5c[_0xd83b('0x19')](_0x403713)[_0xd83b('0x2c')](_0x2b5812);};}exports[_0xd83b('0x2d')]=function(_0x1de98e,_0x33910d){var _0x5c76f6={},_0x2dd2f7={},_0x3aea44={'count':0x0,'rows':[]};var _0x24915b=_[_0xd83b('0x2e')](db[_0xd83b('0x2f')][_0xd83b('0x30')],function(_0x452a5d){return{'name':_0x452a5d[_0xd83b('0x31')],'type':_0x452a5d[_0xd83b('0x32')][_0xd83b('0x33')]};});_0x2dd2f7['model']=_[_0xd83b('0x2e')](_0x24915b,_0xd83b('0x34'));_0x2dd2f7[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x1de98e[_0xd83b('0x35')]);_0x2dd2f7['filters']=_[_0xd83b('0x37')](_0x2dd2f7[_0xd83b('0x38')],_0x2dd2f7[_0xd83b('0x35')]);_0x5c76f6[_0xd83b('0x39')]=_['intersection'](_0x2dd2f7[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x1de98e[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x5c76f6[_0xd83b('0x39')]=_0x5c76f6[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x5c76f6[_0xd83b('0x39')]:_0x2dd2f7[_0xd83b('0x38')];if(!_0x1de98e['query'][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x5c76f6[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x1de98e['query'][_0xd83b('0x1d')]);_0x5c76f6[_0xd83b('0x1f')]=qs[_0xd83b('0x1f')](_0x1de98e[_0xd83b('0x35')][_0xd83b('0x1f')]);}_0x5c76f6[_0xd83b('0x3e')]=qs[_0xd83b('0x3f')](_0x1de98e['query'][_0xd83b('0x3f')]);_0x5c76f6['where']=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x1de98e[_0xd83b('0x35')],_0x2dd2f7[_0xd83b('0x40')]),_0x24915b);if(_0x1de98e[_0xd83b('0x35')][_0xd83b('0x42')]){_0x5c76f6[_0xd83b('0x43')]=_['merge'](_0x5c76f6['where'],{'$or':_[_0xd83b('0x2e')](_0x24915b,function(_0x2fe3d7){if(_0x2fe3d7['type']!=='VIRTUAL'){var _0x496a15={};_0x496a15[_0x2fe3d7[_0xd83b('0x34')]]={'$like':'%'+_0x1de98e['query']['filter']+'%'};return _0x496a15;}})});}_0x5c76f6=_[_0xd83b('0x44')]({},_0x5c76f6,_0x1de98e[_0xd83b('0x45')]);var _0x2c9325={'where':_0x5c76f6['where']};return db[_0xd83b('0x2f')][_0xd83b('0x1e')](_0x2c9325)['then'](function(_0x5735a6){_0x3aea44[_0xd83b('0x1e')]=_0x5735a6;if(_0x1de98e[_0xd83b('0x35')][_0xd83b('0x46')]){_0x5c76f6[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x2f')][_0xd83b('0x48')](_0x5c76f6);})['then'](function(_0x23a2af){_0x3aea44[_0xd83b('0x49')]=_0x23a2af;return _0x3aea44;})[_0xd83b('0x25')](respondWithFilteredResult(_0x33910d,_0x5c76f6))[_0xd83b('0x4a')](handleError(_0x33910d,null));};exports['show']=function(_0x507de1,_0x256438){var _0x51abc6={'raw':![],'where':{'id':_0x507de1[_0xd83b('0x4b')]['id']}},_0x43c0c7={};_0x43c0c7[_0xd83b('0x38')]=_['keys'](db[_0xd83b('0x2f')][_0xd83b('0x30')]);_0x43c0c7[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x507de1[_0xd83b('0x35')]);_0x43c0c7[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0x43c0c7[_0xd83b('0x38')],_0x43c0c7[_0xd83b('0x35')]);_0x51abc6['attributes']=_[_0xd83b('0x37')](_0x43c0c7['model'],qs[_0xd83b('0x3a')](_0x507de1[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x51abc6[_0xd83b('0x39')]=_0x51abc6[_0xd83b('0x39')]['length']?_0x51abc6[_0xd83b('0x39')]:_0x43c0c7[_0xd83b('0x38')];if(_0x507de1[_0xd83b('0x35')][_0xd83b('0x46')]){_0x51abc6[_0xd83b('0x47')]=[{'all':!![]}];}_0x51abc6=_['merge']({},_0x51abc6,_0x507de1['options']);return db['Campaign'][_0xd83b('0x4c')](_0x51abc6)[_0xd83b('0x25')](handleEntityNotFound(_0x256438,null))[_0xd83b('0x25')](respondWithResult(_0x256438,null))[_0xd83b('0x4a')](handleError(_0x256438,null));};exports[_0xd83b('0x4d')]=function(_0x28a8c,_0xd95f5c){return db['Campaign']['create'](_0x28a8c[_0xd83b('0x4e')],{})[_0xd83b('0x25')](function(_0x1dd60c){var _0x4cb310=_0x28a8c['user'][_0xd83b('0x27')]({'plain':!![]});if(!_0x4cb310)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cb310['role']===_0xd83b('0x4f')){var _0x1db1a9=_0x1dd60c[_0xd83b('0x27')]({'plain':!![]});var _0x58525c=_0xd83b('0x28');return db[_0xd83b('0x50')]['find']({'where':{'name':_0x58525c,'userProfileId':_0x4cb310[_0xd83b('0x51')]},'raw':!![]})[_0xd83b('0x25')](function(_0x277e63){if(_0x277e63&&_0x277e63[_0xd83b('0x52')]===0x0){return db[_0xd83b('0x29')][_0xd83b('0x4d')]({'name':_0x1db1a9['name'],'resourceId':_0x1db1a9['id'],'type':_0x277e63[_0xd83b('0x34')],'sectionId':_0x277e63['id']},{})[_0xd83b('0x25')](function(){return _0x1dd60c;});}else{return _0x1dd60c;}})[_0xd83b('0x4a')](function(_0x4623dd){logger[_0xd83b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4623dd);throw _0x4623dd;});}return _0x1dd60c;})[_0xd83b('0x25')](respondWithResult(_0xd95f5c,0xc9))[_0xd83b('0x4a')](handleError(_0xd95f5c,null));};exports[_0xd83b('0x53')]=function(_0x4b00f0,_0x3603c3){var _0x1d242c={'where':{'id':_0x4b00f0[_0xd83b('0x4b')]['id']}},_0xd50cd7={};_0xd50cd7[_0xd83b('0x38')]=_[_0xd83b('0x36')](db[_0xd83b('0x2f')]['rawAttributes']);_0x1d242c[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0xd50cd7[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x4b00f0[_0xd83b('0x35')]['fields']));_0x1d242c[_0xd83b('0x39')]=_0x1d242c[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x1d242c[_0xd83b('0x39')]:_0xd50cd7[_0xd83b('0x38')];if(_0x4b00f0[_0xd83b('0x35')][_0xd83b('0x46')]){_0x1d242c['include']=[{'all':!![]}];}_0x1d242c=_[_0xd83b('0x44')]({},_0x1d242c,_0x4b00f0[_0xd83b('0x45')]);return db['Campaign']['find'](_0x1d242c)[_0xd83b('0x25')](handleEntityNotFound(_0x3603c3,null))[_0xd83b('0x25')](function(_0x2bcaca){if(_0x2bcaca){var _0x50a4d8=_0x2bcaca[_0xd83b('0x27')]({'plain':!![]});_0x50a4d8=qs[_0xd83b('0x54')](_0x50a4d8,['id','createdAt',_0xd83b('0x55')]);_0x4b00f0[_0xd83b('0x4e')]=_['omit'](_0x4b00f0['body'],['id',_0xd83b('0x56'),_0xd83b('0x55')]);return db[_0xd83b('0x2f')][_0xd83b('0x4d')](_[_0xd83b('0x44')](_0x50a4d8,_0x4b00f0[_0xd83b('0x4e')]),{'include':_0x4b00f0[_0xd83b('0x35')][_0xd83b('0x46')]?[{'all':!![]}]:undefined})[_0xd83b('0x25')](function(_0x30dde0){var _0x44c0f2=_0x4b00f0[_0xd83b('0x4f')][_0xd83b('0x27')]({'plain':!![]});if(!_0x44c0f2)throw new Error(_0xd83b('0x57'));if(_0x44c0f2['role']===_0xd83b('0x4f')){var _0x29a192=_0x30dde0[_0xd83b('0x27')]({'plain':!![]});var _0x34bb4e=_0xd83b('0x28');return db[_0xd83b('0x50')][_0xd83b('0x4c')]({'where':{'name':_0x34bb4e,'userProfileId':_0x44c0f2[_0xd83b('0x51')]},'raw':!![]})[_0xd83b('0x25')](function(_0x68f19){if(_0x68f19&&_0x68f19[_0xd83b('0x52')]===0x0){return db['UserProfileResource'][_0xd83b('0x4d')]({'name':_0x29a192['name'],'resourceId':_0x29a192['id'],'type':_0x68f19[_0xd83b('0x34')],'sectionId':_0x68f19['id']},{})[_0xd83b('0x25')](function(){return _0x30dde0;});}else{return _0x30dde0;}})[_0xd83b('0x4a')](function(_0x2520cc){logger['error'](_0xd83b('0x58'),_0x2520cc);throw _0x2520cc;});}return _0x30dde0;});}})[_0xd83b('0x25')](respondWithResult(_0x3603c3,0xc9))[_0xd83b('0x4a')](handleError(_0x3603c3,null));};exports[_0xd83b('0x24')]=function(_0x2f2b4a,_0x798b5f){if(_0x2f2b4a[_0xd83b('0x4e')]['id']){delete _0x2f2b4a[_0xd83b('0x4e')]['id'];}return db[_0xd83b('0x2f')][_0xd83b('0x4c')]({'where':{'id':_0x2f2b4a[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x798b5f,null))['then'](saveUpdates(_0x2f2b4a[_0xd83b('0x4e')],null))[_0xd83b('0x25')](respondWithResult(_0x798b5f,null))[_0xd83b('0x4a')](handleError(_0x798b5f,null));};exports[_0xd83b('0x26')]=function(_0x509776,_0x1b83d8){return db[_0xd83b('0x2f')]['find']({'where':{'id':_0x509776['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x1b83d8,null))[_0xd83b('0x25')](removeEntity(_0x1b83d8,null))[_0xd83b('0x4a')](handleError(_0x1b83d8,null));};exports[_0xd83b('0x59')]=function(_0x15bfbf,_0x2ea401,_0xb3bdaa){var _0xd53741={'raw':!![],'where':{}};var _0xcdb9ee={};var _0x2b93db={'count':0x0,'rows':[]};return db['Campaign'][_0xd83b('0x5a')]({'where':{'id':_0x15bfbf['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x2ea401,null))[_0xd83b('0x25')](function(_0x4123c9){if(_0x4123c9){_0xcdb9ee[_0xd83b('0x38')]=_[_0xd83b('0x36')](db[_0xd83b('0x5b')][_0xd83b('0x30')]);_0xcdb9ee[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x15bfbf[_0xd83b('0x35')]);_0xcdb9ee[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0xcdb9ee['model'],_0xcdb9ee['query']);_0xd53741[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0xcdb9ee['model'],qs[_0xd83b('0x3a')](_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x3a')]));_0xd53741[_0xd83b('0x39')]=_0xd53741[_0xd83b('0x39')][_0xd83b('0x3b')]?_0xd53741[_0xd83b('0x39')]:_0xcdb9ee[_0xd83b('0x38')];if(!_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0xd53741[_0xd83b('0x1d')]=qs['limit'](_0x15bfbf['query'][_0xd83b('0x1d')]);_0xd53741['offset']=qs[_0xd83b('0x1f')](_0x15bfbf['query'][_0xd83b('0x1f')]);}_0xd53741['order']=qs['sort'](_0x15bfbf['query'][_0xd83b('0x3f')]);_0xd53741[_0xd83b('0x43')]=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x15bfbf[_0xd83b('0x35')],_0xcdb9ee['filters']));_0xd53741[_0xd83b('0x43')]['CampaignId']=_0x4123c9['id'];if(_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x42')]){_0xd53741[_0xd83b('0x43')]=_[_0xd83b('0x44')](_0xd53741[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0xd53741['attributes'],function(_0x4ed515){var _0x56ac2a={};_0x56ac2a[_0x4ed515]={'$like':'%'+_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x56ac2a;})});}_0xd53741=_[_0xd83b('0x44')]({},_0xd53741,_0x15bfbf[_0xd83b('0x45')]);return db[_0xd83b('0x5b')][_0xd83b('0x1e')]({'where':_0xd53741[_0xd83b('0x43')]})[_0xd83b('0x25')](function(_0x56cb54){_0x2b93db[_0xd83b('0x1e')]=_0x56cb54;if(_0x15bfbf[_0xd83b('0x35')][_0xd83b('0x46')]){_0xd53741['include']=[{'all':!![]}];}return db['CmHopper'][_0xd83b('0x48')](_0xd53741);})[_0xd83b('0x25')](function(_0x2a8c59){_0x2b93db['rows']=_0x2a8c59;return _0x2b93db;});}})[_0xd83b('0x25')](respondWithFilteredResult(_0x2ea401,_0xd53741))[_0xd83b('0x4a')](handleError(_0x2ea401,null));};exports[_0xd83b('0x5c')]=function(_0x5d9c53,_0x37f216,_0x47d47d){var _0x13cd0e={'raw':!![],'where':{}};var _0x50977d={};var _0x41cc9f={'count':0x0,'rows':[]};return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x5d9c53['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x37f216,null))[_0xd83b('0x25')](function(_0x26518f){if(_0x26518f){_0x50977d[_0xd83b('0x38')]=_['keys'](db[_0xd83b('0x5d')][_0xd83b('0x30')]);_0x50977d[_0xd83b('0x35')]=_['keys'](_0x5d9c53[_0xd83b('0x35')]);_0x50977d[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0x50977d[_0xd83b('0x38')],_0x50977d['query']);_0x13cd0e['attributes']=_[_0xd83b('0x37')](_0x50977d['model'],qs['fields'](_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x13cd0e[_0xd83b('0x39')]=_0x13cd0e['attributes']['length']?_0x13cd0e[_0xd83b('0x39')]:_0x50977d[_0xd83b('0x38')];if(!_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x3c')]('nolimit')){_0x13cd0e[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x5d9c53['query'][_0xd83b('0x1d')]);_0x13cd0e[_0xd83b('0x1f')]=qs[_0xd83b('0x1f')](_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x1f')]);}_0x13cd0e[_0xd83b('0x3e')]=qs[_0xd83b('0x3f')](_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x13cd0e[_0xd83b('0x43')]=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x5d9c53[_0xd83b('0x35')],_0x50977d[_0xd83b('0x40')]));_0x13cd0e[_0xd83b('0x43')][_0xd83b('0x5e')]=_0x26518f['id'];if(_0x5d9c53[_0xd83b('0x35')]['filter']){_0x13cd0e['where']=_[_0xd83b('0x44')](_0x13cd0e['where'],{'$or':_[_0xd83b('0x2e')](_0x13cd0e['attributes'],function(_0xb6e2da){var _0x4a9da3={};_0x4a9da3[_0xb6e2da]={'$like':'%'+_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x4a9da3;})});}_0x13cd0e=_[_0xd83b('0x44')]({},_0x13cd0e,_0x5d9c53[_0xd83b('0x45')]);return db[_0xd83b('0x5d')][_0xd83b('0x1e')]({'where':_0x13cd0e[_0xd83b('0x43')]})['then'](function(_0x5ee76b){_0x41cc9f[_0xd83b('0x1e')]=_0x5ee76b;if(_0x5d9c53[_0xd83b('0x35')][_0xd83b('0x46')]){_0x13cd0e[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x5d')][_0xd83b('0x48')](_0x13cd0e);})[_0xd83b('0x25')](function(_0xf76891){_0x41cc9f[_0xd83b('0x49')]=_0xf76891;return _0x41cc9f;});}})['then'](respondWithFilteredResult(_0x37f216,_0x13cd0e))[_0xd83b('0x4a')](handleError(_0x37f216,null));};exports[_0xd83b('0x5f')]=function(_0x365f0f,_0x4db6a6,_0x1fa6f4){var _0x27fc31={'raw':!![],'where':{}};var _0x233e41={};var _0x15900={'count':0x0,'rows':[]};return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x365f0f['params']['id']}})['then'](handleEntityNotFound(_0x4db6a6,null))[_0xd83b('0x25')](function(_0x7f84fc){if(_0x7f84fc){_0x233e41['model']=_[_0xd83b('0x36')](db['CmHopperFinal'][_0xd83b('0x30')]);_0x233e41[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x365f0f[_0xd83b('0x35')]);_0x233e41['filters']=_[_0xd83b('0x37')](_0x233e41[_0xd83b('0x38')],_0x233e41[_0xd83b('0x35')]);_0x27fc31['attributes']=_[_0xd83b('0x37')](_0x233e41[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x27fc31[_0xd83b('0x39')]=_0x27fc31[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x27fc31['attributes']:_0x233e41[_0xd83b('0x38')];if(!_0x365f0f[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x27fc31[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x1d')]);_0x27fc31['offset']=qs[_0xd83b('0x1f')](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x1f')]);}_0x27fc31['order']=qs['sort'](_0x365f0f[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x27fc31['where']=qs['filters'](_['pick'](_0x365f0f['query'],_0x233e41[_0xd83b('0x40')]));_0x27fc31['where']['CampaignId']=_0x7f84fc['id'];if(_0x365f0f['query'][_0xd83b('0x42')]){_0x27fc31['where']=_['merge'](_0x27fc31[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0x27fc31[_0xd83b('0x39')],function(_0x17b967){var _0x1abb03={};_0x1abb03[_0x17b967]={'$like':'%'+_0x365f0f[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x1abb03;})});}_0x27fc31=_[_0xd83b('0x44')]({},_0x27fc31,_0x365f0f[_0xd83b('0x45')]);return db[_0xd83b('0x60')][_0xd83b('0x1e')]({'where':_0x27fc31['where']})[_0xd83b('0x25')](function(_0x45f75b){_0x15900[_0xd83b('0x1e')]=_0x45f75b;if(_0x365f0f['query'][_0xd83b('0x46')]){_0x27fc31[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x60')][_0xd83b('0x48')](_0x27fc31);})[_0xd83b('0x25')](function(_0x3d53c0){_0x15900[_0xd83b('0x49')]=_0x3d53c0;return _0x15900;});}})[_0xd83b('0x25')](respondWithFilteredResult(_0x4db6a6,_0x27fc31))[_0xd83b('0x4a')](handleError(_0x4db6a6,null));};exports['getHopperBlacks']=function(_0x477d80,_0x518390,_0x2b74b9){var _0x180d1c={'raw':!![],'where':{}};var _0x1b24ad={};var _0x14e582={'count':0x0,'rows':[]};return db['Campaign'][_0xd83b('0x5a')]({'where':{'id':_0x477d80[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x518390,null))['then'](function(_0x28fb37){if(_0x28fb37){_0x1b24ad[_0xd83b('0x38')]=_[_0xd83b('0x36')](db[_0xd83b('0x61')][_0xd83b('0x30')]);_0x1b24ad[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x477d80[_0xd83b('0x35')]);_0x1b24ad[_0xd83b('0x40')]=_[_0xd83b('0x37')](_0x1b24ad[_0xd83b('0x38')],_0x1b24ad[_0xd83b('0x35')]);_0x180d1c[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0x1b24ad[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x477d80['query']['fields']));_0x180d1c[_0xd83b('0x39')]=_0x180d1c[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x180d1c['attributes']:_0x1b24ad['model'];if(!_0x477d80[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x180d1c[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x477d80[_0xd83b('0x35')][_0xd83b('0x1d')]);_0x180d1c['offset']=qs[_0xd83b('0x1f')](_0x477d80['query'][_0xd83b('0x1f')]);}_0x180d1c['order']=qs[_0xd83b('0x3f')](_0x477d80['query'][_0xd83b('0x3f')]);_0x180d1c['where']=qs[_0xd83b('0x40')](_[_0xd83b('0x41')](_0x477d80[_0xd83b('0x35')],_0x1b24ad[_0xd83b('0x40')]));_0x180d1c[_0xd83b('0x43')][_0xd83b('0x5e')]=_0x28fb37['id'];if(_0x477d80[_0xd83b('0x35')][_0xd83b('0x42')]){_0x180d1c['where']=_[_0xd83b('0x44')](_0x180d1c[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0x180d1c[_0xd83b('0x39')],function(_0x15a216){var _0x3814a8={};_0x3814a8[_0x15a216]={'$like':'%'+_0x477d80[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x3814a8;})});}_0x180d1c=_[_0xd83b('0x44')]({},_0x180d1c,_0x477d80[_0xd83b('0x45')]);return db[_0xd83b('0x61')][_0xd83b('0x1e')]({'where':_0x180d1c[_0xd83b('0x43')]})[_0xd83b('0x25')](function(_0x1fed15){_0x14e582[_0xd83b('0x1e')]=_0x1fed15;if(_0x477d80[_0xd83b('0x35')]['includeAll']){_0x180d1c[_0xd83b('0x47')]=[{'all':!![]}];}return db[_0xd83b('0x61')][_0xd83b('0x48')](_0x180d1c);})[_0xd83b('0x25')](function(_0x38b507){_0x14e582['rows']=_0x38b507;return _0x14e582;});}})[_0xd83b('0x25')](respondWithFilteredResult(_0x518390,_0x180d1c))[_0xd83b('0x4a')](handleError(_0x518390,null));};exports[_0xd83b('0x62')]=function(_0x239134,_0x22ae12,_0x1a5a31){var _0x2e65a8={};var _0x323d33={};var _0x3b4ac2;var _0x25403d;return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x239134[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x22ae12,null))[_0xd83b('0x25')](function(_0x26029c){if(_0x26029c){_0x3b4ac2=_0x26029c;_0x323d33[_0xd83b('0x38')]=_[_0xd83b('0x36')](db['CmList'][_0xd83b('0x30')]);_0x323d33[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x239134[_0xd83b('0x35')]);_0x323d33['filters']=_['intersection'](_0x323d33[_0xd83b('0x38')],_0x323d33[_0xd83b('0x35')]);_0x2e65a8[_0xd83b('0x39')]=_[_0xd83b('0x37')](_0x323d33['model'],qs[_0xd83b('0x3a')](_0x239134[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x2e65a8[_0xd83b('0x39')]=_0x2e65a8[_0xd83b('0x39')]['length']?_0x2e65a8[_0xd83b('0x39')]:_0x323d33['model'];_0x2e65a8['order']=qs[_0xd83b('0x3f')](_0x239134[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x2e65a8[_0xd83b('0x43')]=qs['filters'](_[_0xd83b('0x41')](_0x239134[_0xd83b('0x35')],_0x323d33[_0xd83b('0x40')]));if(_0x239134[_0xd83b('0x35')]['filter']){_0x2e65a8['where']=_[_0xd83b('0x44')](_0x2e65a8[_0xd83b('0x43')],{'$or':_[_0xd83b('0x2e')](_0x2e65a8['attributes'],function(_0x5598b8){var _0x4436e1={};_0x4436e1[_0x5598b8]={'$like':'%'+_0x239134[_0xd83b('0x35')][_0xd83b('0x42')]+'%'};return _0x4436e1;})});}_0x2e65a8=_[_0xd83b('0x44')]({},_0x2e65a8,_0x239134['options']);return _0x3b4ac2[_0xd83b('0x62')](_0x2e65a8);}})[_0xd83b('0x25')](function(_0x38bcfb){if(_0x38bcfb){_0x25403d=_0x38bcfb[_0xd83b('0x3b')];if(!_0x239134[_0xd83b('0x35')][_0xd83b('0x3c')](_0xd83b('0x3d'))){_0x2e65a8[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x239134['query'][_0xd83b('0x1d')]);_0x2e65a8[_0xd83b('0x1f')]=qs[_0xd83b('0x1f')](_0x239134['query'][_0xd83b('0x1f')]);}return _0x3b4ac2[_0xd83b('0x62')](_0x2e65a8);}})[_0xd83b('0x25')](function(_0x132147){if(_0x132147){return _0x132147?{'count':_0x25403d,'rows':_0x132147}:null;}})[_0xd83b('0x25')](respondWithResult(_0x22ae12,null))[_0xd83b('0x4a')](handleError(_0x22ae12,null));};exports[_0xd83b('0x63')]=function(_0x12aa81,_0x2b0900,_0x55b51c){var _0x37c5f7,_0x19b77d;return db['Campaign']['find']({'where':{'id':_0x12aa81['params']['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x2b0900,null))[_0xd83b('0x25')](function(_0x4b3e65){if(_0x4b3e65){_0x19b77d=_0x4b3e65;return _0x4b3e65[_0xd83b('0x63')](_0x12aa81['body'][_0xd83b('0x64')],_[_0xd83b('0x54')](_0x12aa81[_0xd83b('0x4e')],['ids','id'])||{});}return null;})[_0xd83b('0x65')](function(_0x300d1d){var _0x4e4543;_0x37c5f7=_0x300d1d||[];var _0x4e7f6e=[];if(_0x300d1d){for(var _0x54ce29=0x0;_0x54ce29<_0x300d1d[_0xd83b('0x3b')];_0x54ce29+=0x1){var _0x2b8a6f=_0x300d1d[_0x54ce29][_0xd83b('0x27')]({'plain':!![]});_0x19b77d[_0xd83b('0x66')]=_0x12aa81[_0xd83b('0x4e')][_0xd83b('0x66')]?_0x12aa81['body'][_0xd83b('0x66')]:_0x19b77d[_0xd83b('0x66')];switch(_0x19b77d['dialCheckDuplicateType']){case _0xd83b('0x67'):_0x4e4543=squel[_0xd83b('0x68')]()[_0xd83b('0x69')](_0xd83b('0x6a'))[_0xd83b('0x6b')](['phone',_0xd83b('0x6c'),_0xd83b('0x6d'),_0xd83b('0x6e'),_0xd83b('0x5e'),_0xd83b('0x56'),'updatedAt'],squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x70'),_0xd83b('0x70'))[_0xd83b('0x71')]('NOW()',_0xd83b('0x6c'))[_0xd83b('0x71')]('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')](),_0xd83b('0x6e'))[_0xd83b('0x71')](_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')](),'CampaignId')['field'](_0xd83b('0x74'),_0xd83b('0x56'))[_0xd83b('0x71')](_0xd83b('0x74'),_0xd83b('0x55'))['from'](_0xd83b('0x75'))[_0xd83b('0x43')](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')](_0xd83b('0x78'))['where'](_0xd83b('0x79'),squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x7a'))[_0xd83b('0x7b')](_0xd83b('0x7c'))[_0xd83b('0x43')](_0xd83b('0x7d'),_0x12aa81[_0xd83b('0x4b')]['id']['toString']()))[_0xd83b('0x43')](_0xd83b('0x79'),squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x7e'))[_0xd83b('0x7b')](_0xd83b('0x6a'))['where']('CampaignId\x20=\x20?',_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')]())))['toString']();break;case _0xd83b('0x7f'):_0x4e4543=squel[_0xd83b('0x68')]()[_0xd83b('0x69')]('cm_hopper')[_0xd83b('0x6b')]([_0xd83b('0x70'),_0xd83b('0x6c'),_0xd83b('0x6d'),_0xd83b('0x6e'),_0xd83b('0x5e'),_0xd83b('0x56'),_0xd83b('0x55')],squel[_0xd83b('0x6f')]()[_0xd83b('0x71')](_0xd83b('0x70'),'phone')['field'](_0xd83b('0x74'),_0xd83b('0x6c'))[_0xd83b('0x71')]('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x2b8a6f[_0xd83b('0x72')]['toString'](),'ListId')['field'](_0x12aa81[_0xd83b('0x4b')]['id']['toString'](),_0xd83b('0x5e'))[_0xd83b('0x71')]('NOW()',_0xd83b('0x56'))['field']('NOW()',_0xd83b('0x55'))[_0xd83b('0x7b')](_0xd83b('0x75'))[_0xd83b('0x43')](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd83b('0x79'),squel['select']()[_0xd83b('0x71')]('COALESCE(phone,\x27\x27)')[_0xd83b('0x7b')]('cm_hopper')[_0xd83b('0x43')](_0xd83b('0x7d'),_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')]())))[_0xd83b('0x73')]();break;default:_0x4e4543=squel[_0xd83b('0x68')]()[_0xd83b('0x69')](_0xd83b('0x6a'))[_0xd83b('0x6b')]([_0xd83b('0x70'),_0xd83b('0x6c'),_0xd83b('0x6d'),_0xd83b('0x6e'),_0xd83b('0x5e'),'createdAt',_0xd83b('0x55')],squel[_0xd83b('0x6f')]()[_0xd83b('0x71')](_0xd83b('0x70'),'phone')[_0xd83b('0x71')](_0xd83b('0x74'),'scheduledAt')[_0xd83b('0x71')]('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')](),'ListId')[_0xd83b('0x71')](_0x12aa81[_0xd83b('0x4b')]['id'][_0xd83b('0x73')](),_0xd83b('0x5e'))[_0xd83b('0x71')](_0xd83b('0x74'),'createdAt')['field'](_0xd83b('0x74'),'updatedAt')[_0xd83b('0x7b')](_0xd83b('0x75'))['where'](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x2b8a6f[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')](_0xd83b('0x78')))[_0xd83b('0x73')]();}_0x4e7f6e[_0xd83b('0x80')](db[_0xd83b('0x81')][_0xd83b('0x35')](_0x4e4543));}return BPromise[_0xd83b('0x82')](_0x4e7f6e);}})[_0xd83b('0x25')](function(){return _0x37c5f7;})[_0xd83b('0x25')](respondWithResult(_0x2b0900,null))[_0xd83b('0x4a')](handleError(_0x2b0900,null));};exports[_0xd83b('0x83')]=function(_0x630007,_0x41ca15,_0x483452){return db[_0xd83b('0x2f')][_0xd83b('0x4c')]({'where':{'id':_0x630007[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x41ca15,null))[_0xd83b('0x25')](function(_0x57f255){if(_0x57f255){return _0x57f255[_0xd83b('0x83')](_0x630007[_0xd83b('0x35')][_0xd83b('0x64')]);}})[_0xd83b('0x25')](function(_0x515637){if(_0x515637){return db[_0xd83b('0x5b')][_0xd83b('0x26')]({'where':{'ListId':_0x630007[_0xd83b('0x35')][_0xd83b('0x64')],'CampaignId':_0x630007['params']['id']}})['then'](function(){return _0x515637;});}})[_0xd83b('0x25')](respondWithStatusCode(_0x41ca15,null))['catch'](handleError(_0x41ca15,null));};exports[_0xd83b('0x84')]=function(_0x1b3c74,_0x507df2,_0x5ced33){var _0x36b540={};var _0x353e8c={};var _0x5dd3c1;var _0x729627;return db[_0xd83b('0x2f')][_0xd83b('0x5a')]({'where':{'id':_0x1b3c74[_0xd83b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x507df2,null))[_0xd83b('0x25')](function(_0xcf1a3e){if(_0xcf1a3e){_0x5dd3c1=_0xcf1a3e;_0x353e8c[_0xd83b('0x38')]=_['keys'](db['CmList']['rawAttributes']);_0x353e8c[_0xd83b('0x35')]=_[_0xd83b('0x36')](_0x1b3c74[_0xd83b('0x35')]);_0x353e8c[_0xd83b('0x40')]=_['intersection'](_0x353e8c['model'],_0x353e8c[_0xd83b('0x35')]);_0x36b540[_0xd83b('0x39')]=_['intersection'](_0x353e8c[_0xd83b('0x38')],qs[_0xd83b('0x3a')](_0x1b3c74[_0xd83b('0x35')][_0xd83b('0x3a')]));_0x36b540['attributes']=_0x36b540[_0xd83b('0x39')][_0xd83b('0x3b')]?_0x36b540[_0xd83b('0x39')]:_0x353e8c[_0xd83b('0x38')];_0x36b540[_0xd83b('0x3e')]=qs[_0xd83b('0x3f')](_0x1b3c74[_0xd83b('0x35')][_0xd83b('0x3f')]);_0x36b540[_0xd83b('0x43')]=qs[_0xd83b('0x40')](_['pick'](_0x1b3c74['query'],_0x353e8c[_0xd83b('0x40')]));if(_0x1b3c74['query']['filter']){_0x36b540[_0xd83b('0x43')]=_[_0xd83b('0x44')](_0x36b540['where'],{'$or':_[_0xd83b('0x2e')](_0x36b540['attributes'],function(_0x999473){var _0x4a940e={};_0x4a940e[_0x999473]={'$like':'%'+_0x1b3c74['query'][_0xd83b('0x42')]+'%'};return _0x4a940e;})});}_0x36b540=_[_0xd83b('0x44')]({},_0x36b540,_0x1b3c74[_0xd83b('0x45')]);return _0x5dd3c1[_0xd83b('0x84')](_0x36b540);}})['then'](function(_0x3730fd){if(_0x3730fd){_0x729627=_0x3730fd[_0xd83b('0x3b')];if(!_0x1b3c74['query'][_0xd83b('0x3c')]('nolimit')){_0x36b540['limit']=qs[_0xd83b('0x1d')](_0x1b3c74[_0xd83b('0x35')][_0xd83b('0x1d')]);_0x36b540[_0xd83b('0x1f')]=qs['offset'](_0x1b3c74['query'][_0xd83b('0x1f')]);}return _0x5dd3c1['getBlackLists'](_0x36b540);}})[_0xd83b('0x25')](function(_0x2b3a4b){if(_0x2b3a4b){return _0x2b3a4b?{'count':_0x729627,'rows':_0x2b3a4b}:null;}})[_0xd83b('0x25')](respondWithResult(_0x507df2,null))[_0xd83b('0x4a')](handleError(_0x507df2,null));};exports[_0xd83b('0x85')]=function(_0x15f652,_0x5bcae2,_0x4a107c){var _0x5a6c85,_0x209081;return db['Campaign']['find']({'where':{'id':_0x15f652[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x5bcae2,null))[_0xd83b('0x25')](function(_0x4263a9){if(_0x4263a9){_0x209081=_0x4263a9;return _0x4263a9[_0xd83b('0x85')](_0x15f652[_0xd83b('0x4e')][_0xd83b('0x64')],_[_0xd83b('0x54')](_0x15f652[_0xd83b('0x4e')],['ids','id'])||{});}return null;})[_0xd83b('0x65')](function(_0x16f8a8){var _0x28849a;_0x5a6c85=_0x16f8a8||[];var _0x487095=[];if(_0x16f8a8){for(var _0xb57bc1=0x0;_0xb57bc1<_0x16f8a8[_0xd83b('0x3b')];_0xb57bc1+=0x1){var _0x841bd8=_0x16f8a8[_0xb57bc1][_0xd83b('0x27')]({'plain':!![]});_0x28849a=squel[_0xd83b('0x68')]()['into']('cm_hopper_black')['fromQuery'](['phone',_0xd83b('0x6d'),'ListId',_0xd83b('0x5e'),_0xd83b('0x56'),_0xd83b('0x55')],squel[_0xd83b('0x6f')]()['field'](_0xd83b('0x70'),_0xd83b('0x70'))['field']('id',_0xd83b('0x6d'))[_0xd83b('0x71')](_0x841bd8[_0xd83b('0x72')]['toString'](),_0xd83b('0x6e'))[_0xd83b('0x71')](_0x15f652[_0xd83b('0x4b')]['id'][_0xd83b('0x73')](),_0xd83b('0x5e'))['field'](_0xd83b('0x74'),_0xd83b('0x56'))['field'](_0xd83b('0x74'),'updatedAt')[_0xd83b('0x7b')](_0xd83b('0x75'))[_0xd83b('0x43')](_0xd83b('0x76'))[_0xd83b('0x43')](_0xd83b('0x77'),_0x841bd8[_0xd83b('0x72')][_0xd83b('0x73')]())[_0xd83b('0x43')](_0xd83b('0x78')))[_0xd83b('0x73')]();_0x487095[_0xd83b('0x80')](db[_0xd83b('0x81')]['query'](_0x28849a));}return BPromise[_0xd83b('0x82')](_0x487095);}})[_0xd83b('0x25')](function(){return _0x5a6c85;})[_0xd83b('0x25')](respondWithResult(_0x5bcae2,null))['catch'](handleError(_0x5bcae2,null));};exports[_0xd83b('0x86')]=function(_0xf7bc9f,_0x1e616f,_0x5ca7ac){return db[_0xd83b('0x2f')][_0xd83b('0x4c')]({'where':{'id':_0xf7bc9f[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](handleEntityNotFound(_0x1e616f,null))['then'](function(_0x25b80d){if(_0x25b80d){return _0x25b80d[_0xd83b('0x86')](_0xf7bc9f[_0xd83b('0x35')]['ids']);}})[_0xd83b('0x25')](function(_0x20aa56){if(_0x20aa56){return db[_0xd83b('0x61')][_0xd83b('0x26')]({'where':{'ListId':_0xf7bc9f['query'][_0xd83b('0x64')],'CampaignId':_0xf7bc9f[_0xd83b('0x4b')]['id']}})[_0xd83b('0x25')](function(){return _0x20aa56;});}})[_0xd83b('0x25')](respondWithStatusCode(_0x1e616f,null))[_0xd83b('0x4a')](handleError(_0x1e616f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5534067..dc4cc33 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_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':'campaigns','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 44cb02e..2f2d105 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 _0xe644=['error','code','message','catch','GetCampaign','findAll','options','raw','where','limit','map','include','model','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a2718,_0x2b8edb){var _0x41cddf=function(_0x2924d7){while(--_0x2924d7){_0x4a2718['push'](_0x4a2718['shift']());}};_0x41cddf(++_0x2b8edb);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});}exports[_0x4e64('0x16')]=function(_0x135ffb){var _0x3961c5=this;return new Promise(function(_0x1be196,_0x2df16a){return db['Campaign'][_0x4e64('0x17')]({'raw':_0x135ffb[_0x4e64('0x18')]?_0x135ffb['options'][_0x4e64('0x19')]===undefined?!![]:![]:!![],'where':_0x135ffb['options']?_0x135ffb['options'][_0x4e64('0x1a')]||null:null,'attributes':_0x135ffb[_0x4e64('0x18')]?_0x135ffb[_0x4e64('0x18')]['attributes']||null:null,'limit':_0x135ffb[_0x4e64('0x18')]?_0x135ffb['options'][_0x4e64('0x1b')]||null:null,'include':_0x135ffb[_0x4e64('0x18')]?_0x135ffb[_0x4e64('0x18')]['include']?_[_0x4e64('0x1c')](_0x135ffb[_0x4e64('0x18')][_0x4e64('0x1d')],function(_0x27d33e){return{'model':db[_0x27d33e[_0x4e64('0x1e')]],'as':_0x27d33e['as'],'attributes':_0x27d33e[_0x4e64('0x1f')],'include':_0x27d33e[_0x4e64('0x1d')]?_['map'](_0x27d33e[_0x4e64('0x1d')],function(_0x29b4f8){return{'model':db[_0x29b4f8[_0x4e64('0x1e')]],'as':_0x29b4f8['as'],'attributes':_0x29b4f8['attributes'],'include':_0x29b4f8[_0x4e64('0x1d')]?_[_0x4e64('0x1c')](_0x29b4f8[_0x4e64('0x1d')],function(_0x457023){return{'model':db[_0x457023[_0x4e64('0x1e')]],'as':_0x457023['as'],'attributes':_0x457023['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e64('0x20')](function(_0x2b1f2b){logger[_0x4e64('0xc')](_0x4e64('0x16'),_0x135ffb);logger[_0x4e64('0xf')](_0x4e64('0x16'),_0x135ffb,JSON[_0x4e64('0x11')](_0x2b1f2b));_0x1be196(_0x2b1f2b);})[_0x4e64('0x15')](function(_0x5467a5){logger[_0x4e64('0x12')](_0x4e64('0x16'),_0x5467a5[_0x4e64('0x14')],_0x135ffb);_0x2df16a(_0x3961c5[_0x4e64('0x12')](0x1f4,_0x5467a5[_0x4e64('0x14')]));});});};
\ No newline at end of file
+var _0x7980=['where','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw'];(function(_0x5f31b0,_0x5d6223){var _0x5eb946=function(_0x12d002){while(--_0x12d002){_0x5f31b0['push'](_0x5f31b0['shift']());}};_0x5eb946(++_0x5d6223);}(_0x7980,0xab));var _0x0798=function(_0x981b3c,_0x57e72f){_0x981b3c=_0x981b3c-0x0;var _0x39d4ad=_0x7980[_0x981b3c];return _0x39d4ad;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('Campaign,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});}exports['GetCampaign']=function(_0x41e217){var _0x46e74c=this;return new Promise(function(_0x288f41,_0x145197){return db['Campaign'][_0x0798('0x18')]({'raw':_0x41e217[_0x0798('0x19')]?_0x41e217['options'][_0x0798('0x1a')]===undefined?!![]:![]:!![],'where':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')][_0x0798('0x1b')]||null:null,'attributes':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')][_0x0798('0x1c')]||null:null,'limit':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')]['limit']||null:null,'include':_0x41e217[_0x0798('0x19')]?_0x41e217[_0x0798('0x19')][_0x0798('0x1d')]?_[_0x0798('0x1e')](_0x41e217[_0x0798('0x19')][_0x0798('0x1d')],function(_0x52037c){return{'model':db[_0x52037c[_0x0798('0x1f')]],'as':_0x52037c['as'],'attributes':_0x52037c[_0x0798('0x1c')],'include':_0x52037c[_0x0798('0x1d')]?_[_0x0798('0x1e')](_0x52037c[_0x0798('0x1d')],function(_0x23d59c){return{'model':db[_0x23d59c['model']],'as':_0x23d59c['as'],'attributes':_0x23d59c[_0x0798('0x1c')],'include':_0x23d59c[_0x0798('0x1d')]?_[_0x0798('0x1e')](_0x23d59c['include'],function(_0x4bc3f3){return{'model':db[_0x4bc3f3['model']],'as':_0x4bc3f3['as'],'attributes':_0x4bc3f3['attributes']};}):[]};}):[]};}):[]:[]})[_0x0798('0xc')](function(_0x2dfbff){logger[_0x0798('0xd')](_0x0798('0x20'),_0x41e217);logger[_0x0798('0x10')](_0x0798('0x20'),_0x41e217,JSON[_0x0798('0x12')](_0x2dfbff));_0x288f41(_0x2dfbff);})[_0x0798('0x17')](function(_0x5bbe3d){logger[_0x0798('0x13')]('GetCampaign',_0x5bbe3d['message'],_0x41e217);_0x145197(_0x46e74c[_0x0798('0x13')](0x1f4,_0x5bbe3d['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 04fd70d..6b840ee 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 _0xa22a=['create','/:id/clone','addLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0xec722a,_0x354472){var _0xbb0f9e=function(_0x2a017b){while(--_0x2a017b){_0xec722a['push'](_0xec722a['shift']());}};_0xbb0f9e(++_0x354472);}(_0xa22a,0x153));var _0xaa22=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa22a[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xaa22('0x0'));var util=require(_0xaa22('0x1'));var path=require(_0xaa22('0x2'));var timeout=require(_0xaa22('0x3'));var express=require(_0xaa22('0x4'));var router=express['Router']();var fs_extra=require(_0xaa22('0x5'));var auth=require(_0xaa22('0x6'));var interaction=require(_0xaa22('0x7'));var config=require(_0xaa22('0x8'));var controller=require(_0xaa22('0x9'));router[_0xaa22('0xa')]('/',auth['isAuthenticated'](),controller[_0xaa22('0xb')]);router['get'](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0xe')]);router[_0xaa22('0xa')]('/:id/hoppers',auth[_0xaa22('0xd')](),controller['getHoppers']);router[_0xaa22('0xa')](_0xaa22('0xf'),auth['isAuthenticated'](),controller[_0xaa22('0x10')]);router['get']('/:id/hopper_finals',auth[_0xaa22('0xd')](),controller['getHopperFinals']);router[_0xaa22('0xa')](_0xaa22('0x11'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x12')]);router[_0xaa22('0xa')](_0xaa22('0x13'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x14')]);router[_0xaa22('0xa')](_0xaa22('0x15'),auth['isAuthenticated'](),controller[_0xaa22('0x16')]);router[_0xaa22('0x17')]('/',auth[_0xaa22('0xd')](),controller[_0xaa22('0x18')]);router[_0xaa22('0x17')](_0xaa22('0x19'),auth['isAuthenticated'](),controller['clone']);router[_0xaa22('0x17')](_0xaa22('0x13'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1a')]);router[_0xaa22('0x17')](_0xaa22('0x15'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xaa22('0x1b')](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1c')]);router[_0xaa22('0x1d')](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1e')]);router[_0xaa22('0x1d')](_0xaa22('0x13'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x1f')]);router[_0xaa22('0x1d')](_0xaa22('0x15'),auth[_0xaa22('0xd')](),controller['removeBlackLists']);module[_0xaa22('0x20')]=router;
\ No newline at end of file
+var _0xf31a=['/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0xf31a,0xaa));var _0xaf31=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xf31a[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require('multer');var util=require(_0xaf31('0x0'));var path=require(_0xaf31('0x1'));var timeout=require(_0xaf31('0x2'));var express=require('express');var router=express[_0xaf31('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf31('0x4'));var config=require(_0xaf31('0x5'));var controller=require('./campaign.controller');router['get']('/',auth[_0xaf31('0x6')](),controller[_0xaf31('0x7')]);router[_0xaf31('0x8')](_0xaf31('0x9'),auth[_0xaf31('0x6')](),controller['show']);router[_0xaf31('0x8')](_0xaf31('0xa'),auth[_0xaf31('0x6')](),controller[_0xaf31('0xb')]);router[_0xaf31('0x8')](_0xaf31('0xc'),auth[_0xaf31('0x6')](),controller['getHopperHistories']);router[_0xaf31('0x8')](_0xaf31('0xd'),auth[_0xaf31('0x6')](),controller[_0xaf31('0xe')]);router['get'](_0xaf31('0xf'),auth[_0xaf31('0x6')](),controller['getHopperBlacks']);router[_0xaf31('0x8')](_0xaf31('0x10'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x11')]);router[_0xaf31('0x8')](_0xaf31('0x12'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x13')]);router[_0xaf31('0x14')]('/',auth[_0xaf31('0x6')](),controller[_0xaf31('0x15')]);router['post'](_0xaf31('0x16'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x17')]);router[_0xaf31('0x14')](_0xaf31('0x10'),auth['isAuthenticated'](),controller[_0xaf31('0x18')]);router[_0xaf31('0x14')](_0xaf31('0x12'),auth['isAuthenticated'](),controller[_0xaf31('0x19')]);router[_0xaf31('0x1a')](_0xaf31('0x9'),auth[_0xaf31('0x6')](),controller['update']);router[_0xaf31('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xaf31('0x1c')]);router['delete'](_0xaf31('0x10'),auth['isAuthenticated'](),controller[_0xaf31('0x1d')]);router[_0xaf31('0x1b')](_0xaf31('0x12'),auth[_0xaf31('0x6')](),controller[_0xaf31('0x1e')]);module[_0xaf31('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 5fabab1..e797c59 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 _0x37c4=['sequelize','TEXT','VIRTUAL','getDataValue','key'];(function(_0x52f5bd,_0x5d3fda){var _0x2b7c6a=function(_0x1bfc8d){while(--_0x1bfc8d){_0x52f5bd['push'](_0x52f5bd['shift']());}};_0x2b7c6a(++_0x5d3fda);}(_0x37c4,0x190));var _0x437c=function(_0x401c1e,_0x37d694){_0x401c1e=_0x401c1e-0x0;var _0x28a94a=_0x37c4[_0x401c1e];return _0x28a94a;};'use strict';var Sequelize=require(_0x437c('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x437c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x437c('0x2')],'get':function(){return this[_0x437c('0x3')](_0x437c('0x4'));}}};
\ No newline at end of file
+var _0x0ea3=['TEXT','STRING','VIRTUAL','key','sequelize'];(function(_0x5bb876,_0x56be18){var _0x29ec93=function(_0x3e21a1){while(--_0x3e21a1){_0x5bb876['push'](_0x5bb876['shift']());}};_0x29ec93(++_0x56be18);}(_0x0ea3,0x81));var _0x30ea=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x0ea3[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0x30ea('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x30ea('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x30ea('0x2')]},'name':{'type':Sequelize[_0x30ea('0x3')],'get':function(){return this['getDataValue'](_0x30ea('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 914507f..969f2b6 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 _0xbb8a=['options','includeAll','include','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbb8a,0x1e0));var _0xabb8=function(_0x36ff0d,_0x4dad91){_0x36ff0d=_0x36ff0d-0x0;var _0x49ba07=_0xbb8a[_0x36ff0d];return _0x49ba07;};'use strict';var emlformat=require(_0xabb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabb8('0x2'));var moment=require('moment');var BPromise=require(_0xabb8('0x3'));var Mustache=require('mustache');var util=require(_0xabb8('0x4'));var path=require(_0xabb8('0x5'));var sox=require(_0xabb8('0x6'));var csv=require(_0xabb8('0x7'));var ejs=require(_0xabb8('0x8'));var fs=require('fs');var fs_extra=require(_0xabb8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xabb8('0xa'));var jsforce=require(_0xabb8('0xb'));var deskjs=require(_0xabb8('0xc'));var toCsv=require(_0xabb8('0x7'));var querystring=require(_0xabb8('0xd'));var Papa=require(_0xabb8('0xe'));var Redis=require(_0xabb8('0xf'));var authService=require(_0xabb8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xabb8('0x11'))('api');var utils=require(_0xabb8('0x12'));var config=require(_0xabb8('0x13'));var licenseUtil=require(_0xabb8('0x14'));var db=require(_0xabb8('0x15'))['db'];function respondWithStatusCode(_0x2050de,_0x13257f){_0x13257f=_0x13257f||0xcc;return function(_0x72242e){if(_0x72242e){return _0x2050de['sendStatus'](_0x13257f);}return _0x2050de[_0xabb8('0x16')](_0x13257f)[_0xabb8('0x17')]();};}function respondWithResult(_0x4078fc,_0xf646dc){_0xf646dc=_0xf646dc||0xc8;return function(_0x15322e){if(_0x15322e){return _0x4078fc[_0xabb8('0x16')](_0xf646dc)[_0xabb8('0x18')](_0x15322e);}};}function respondWithFilteredResult(_0x38acae,_0x3fd029){return function(_0x4d7f90){if(_0x4d7f90){var _0x4a396c=typeof _0x3fd029['offset']==='undefined'&&typeof _0x3fd029[_0xabb8('0x19')]===_0xabb8('0x1a');var _0x5926b3=_0x4d7f90[_0xabb8('0x1b')];var _0xe3bac3=_0x4a396c?0x0:_0x3fd029['offset'];var _0x284111=_0x4a396c?_0x4d7f90[_0xabb8('0x1b')]:_0x3fd029[_0xabb8('0x1c')]+_0x3fd029['limit'];var _0x36864f;if(_0x284111>=_0x5926b3){_0x284111=_0x5926b3;_0x36864f=0xc8;}else{_0x36864f=0xce;}_0x38acae[_0xabb8('0x16')](_0x36864f);return _0x38acae[_0xabb8('0x1d')](_0xabb8('0x1e'),_0xe3bac3+'-'+_0x284111+'/'+_0x5926b3)[_0xabb8('0x18')](_0x4d7f90);}return null;};}function patchUpdates(_0x27f9e){return function(_0x4938d3){try{jsonpatch[_0xabb8('0x1f')](_0x4938d3,_0x27f9e,!![]);}catch(_0x307c21){return BPromise['reject'](_0x307c21);}return _0x4938d3[_0xabb8('0x20')]();};}function saveUpdates(_0x2ea136,_0x5cb039){return function(_0x44293d){if(_0x44293d){return _0x44293d[_0xabb8('0x21')](_0x2ea136)[_0xabb8('0x22')](function(_0x375a4b){return _0x375a4b;});}return null;};}function removeEntity(_0x21fad4,_0x1dfb84){return function(_0x51e2bf){if(_0x51e2bf){return _0x51e2bf[_0xabb8('0x23')]()[_0xabb8('0x22')](function(){var _0x782105=_0x51e2bf[_0xabb8('0x24')]({'plain':!![]});var _0x428d70=_0xabb8('0x25');return db[_0xabb8('0x26')]['destroy']({'where':{'type':_0x428d70,'resourceId':_0x782105['id']}})[_0xabb8('0x22')](function(){return _0x51e2bf;});})[_0xabb8('0x22')](function(){_0x21fad4[_0xabb8('0x16')](0xcc)[_0xabb8('0x17')]();});}};}function handleEntityNotFound(_0x32381b,_0x2a7a31){return function(_0x577855){if(!_0x577855){_0x32381b[_0xabb8('0x27')](0x194);}return _0x577855;};}function handleError(_0x376de9,_0x303906){_0x303906=_0x303906||0x1f4;return function(_0x220cf4){logger[_0xabb8('0x28')](_0x220cf4[_0xabb8('0x29')]);if(_0x220cf4[_0xabb8('0x2a')]){delete _0x220cf4[_0xabb8('0x2a')];}_0x376de9[_0xabb8('0x16')](_0x303906)[_0xabb8('0x2b')](_0x220cf4);};}exports[_0xabb8('0x2c')]=function(_0x369eb9,_0x11fc4b){var _0xda507f={},_0x36c667={},_0x472d73={'count':0x0,'rows':[]};var _0x354614=_[_0xabb8('0x2d')](db[_0xabb8('0x2e')][_0xabb8('0x2f')],function(_0x21273b){return{'name':_0x21273b[_0xabb8('0x30')],'type':_0x21273b[_0xabb8('0x31')][_0xabb8('0x32')]};});_0x36c667[_0xabb8('0x33')]=_['map'](_0x354614,_0xabb8('0x2a'));_0x36c667[_0xabb8('0x34')]=_['keys'](_0x369eb9['query']);_0x36c667[_0xabb8('0x35')]=_['intersection'](_0x36c667[_0xabb8('0x33')],_0x36c667[_0xabb8('0x34')]);_0xda507f[_0xabb8('0x36')]=_[_0xabb8('0x37')](_0x36c667['model'],qs[_0xabb8('0x38')](_0x369eb9[_0xabb8('0x34')][_0xabb8('0x38')]));_0xda507f['attributes']=_0xda507f['attributes'][_0xabb8('0x39')]?_0xda507f['attributes']:_0x36c667['model'];if(!_0x369eb9[_0xabb8('0x34')][_0xabb8('0x3a')](_0xabb8('0x3b'))){_0xda507f['limit']=qs[_0xabb8('0x19')](_0x369eb9[_0xabb8('0x34')]['limit']);_0xda507f[_0xabb8('0x1c')]=qs[_0xabb8('0x1c')](_0x369eb9[_0xabb8('0x34')][_0xabb8('0x1c')]);}_0xda507f[_0xabb8('0x3c')]=qs[_0xabb8('0x3d')](_0x369eb9['query'][_0xabb8('0x3d')]);_0xda507f[_0xabb8('0x3e')]=qs['filters'](_[_0xabb8('0x3f')](_0x369eb9[_0xabb8('0x34')],_0x36c667[_0xabb8('0x35')]),_0x354614);if(_0x369eb9['query'][_0xabb8('0x40')]){_0xda507f['where']=_[_0xabb8('0x41')](_0xda507f[_0xabb8('0x3e')],{'$or':[{'key':{'$like':'%'+_0x369eb9['query'][_0xabb8('0x40')]+'%'}},{'value':{'$like':'%'+_0x369eb9[_0xabb8('0x34')][_0xabb8('0x40')]+'%'}}]});}_0xda507f=_[_0xabb8('0x41')]({},_0xda507f,_0x369eb9[_0xabb8('0x42')]);var _0x5f18b1={'where':_0xda507f[_0xabb8('0x3e')]};return db[_0xabb8('0x2e')]['count'](_0x5f18b1)[_0xabb8('0x22')](function(_0x44fda5){_0x472d73[_0xabb8('0x1b')]=_0x44fda5;if(_0x369eb9[_0xabb8('0x34')][_0xabb8('0x43')]){_0xda507f[_0xabb8('0x44')]=[{'all':!![]}];}return db[_0xabb8('0x2e')]['findAll'](_0xda507f);})[_0xabb8('0x22')](function(_0x5b6312){_0x472d73[_0xabb8('0x45')]=_0x5b6312;return _0x472d73;})[_0xabb8('0x22')](respondWithFilteredResult(_0x11fc4b,_0xda507f))[_0xabb8('0x46')](handleError(_0x11fc4b,null));};exports[_0xabb8('0x47')]=function(_0x471ee1,_0x314440){var _0x2495d3={'raw':!![],'where':{'id':_0x471ee1[_0xabb8('0x48')]['id']}},_0x257f82={};_0x257f82[_0xabb8('0x33')]=_[_0xabb8('0x49')](db[_0xabb8('0x2e')][_0xabb8('0x2f')]);_0x257f82[_0xabb8('0x34')]=_[_0xabb8('0x49')](_0x471ee1[_0xabb8('0x34')]);_0x257f82[_0xabb8('0x35')]=_[_0xabb8('0x37')](_0x257f82[_0xabb8('0x33')],_0x257f82[_0xabb8('0x34')]);_0x2495d3[_0xabb8('0x36')]=_['intersection'](_0x257f82[_0xabb8('0x33')],qs[_0xabb8('0x38')](_0x471ee1[_0xabb8('0x34')][_0xabb8('0x38')]));_0x2495d3[_0xabb8('0x36')]=_0x2495d3[_0xabb8('0x36')][_0xabb8('0x39')]?_0x2495d3[_0xabb8('0x36')]:_0x257f82['model'];if(_0x471ee1[_0xabb8('0x34')]['includeAll']){_0x2495d3[_0xabb8('0x44')]=[{'all':!![]}];}_0x2495d3=_[_0xabb8('0x41')]({},_0x2495d3,_0x471ee1[_0xabb8('0x42')]);return db[_0xabb8('0x2e')][_0xabb8('0x4a')](_0x2495d3)[_0xabb8('0x22')](handleEntityNotFound(_0x314440,null))[_0xabb8('0x22')](respondWithResult(_0x314440,null))[_0xabb8('0x46')](handleError(_0x314440,null));};exports['update']=function(_0x1c298c,_0x589b3d){if(_0x1c298c[_0xabb8('0x4b')]['id']){delete _0x1c298c[_0xabb8('0x4b')]['id'];}return db['CannedAnswer'][_0xabb8('0x4a')]({'where':{'id':_0x1c298c[_0xabb8('0x48')]['id']}})['then'](handleEntityNotFound(_0x589b3d,null))[_0xabb8('0x22')](saveUpdates(_0x1c298c[_0xabb8('0x4b')],null))[_0xabb8('0x22')](respondWithResult(_0x589b3d,null))[_0xabb8('0x46')](handleError(_0x589b3d,null));};exports[_0xabb8('0x23')]=function(_0x271c76,_0x1f8461){return db[_0xabb8('0x2e')][_0xabb8('0x4a')]({'where':{'id':_0x271c76[_0xabb8('0x48')]['id']}})[_0xabb8('0x22')](handleEntityNotFound(_0x1f8461,null))[_0xabb8('0x22')](removeEntity(_0x1f8461,null))['catch'](handleError(_0x1f8461,null));};exports[_0xabb8('0x4c')]=function(_0x3bc260,_0x97c149){var _0x323e4f={'key':_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x32')]};if(_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x4d')]){_0x323e4f[_0xabb8('0x4d')]=_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x4d')];}else if(_0x3bc260[_0xabb8('0x4b')]['SmsAccountId']){_0x323e4f[_0xabb8('0x4e')]=_0x3bc260[_0xabb8('0x4b')][_0xabb8('0x4e')];}else if(_0x3bc260[_0xabb8('0x4b')]['OpenchannelAccountId']){_0x323e4f[_0xabb8('0x4f')]=_0x3bc260[_0xabb8('0x4b')]['OpenchannelAccountId'];}else if(_0x3bc260['body'][_0xabb8('0x50')]){_0x323e4f[_0xabb8('0x50')]=_0x3bc260['body'][_0xabb8('0x50')];}return db['CannedAnswer'][_0xabb8('0x4a')]({'where':_0x323e4f})['then'](function(_0x22e423){if(_0x22e423){throw new db[(_0xabb8('0x51'))][(_0xabb8('0x52'))](_0xabb8('0x53'));}return db['CannedAnswer'][_0xabb8('0x4c')](_0x3bc260['body']);})[_0xabb8('0x22')](function(_0x4069e1){var _0x48dfcc=_0x3bc260[_0xabb8('0x54')][_0xabb8('0x24')]({'plain':!![]});if(!_0x48dfcc)throw new Error(_0xabb8('0x55'));if(_0x48dfcc[_0xabb8('0x56')]===_0xabb8('0x54')){var _0xabc1d8=_0x4069e1[_0xabb8('0x24')]({'plain':!![]});return db[_0xabb8('0x57')]['find']({'where':{'name':_0xabb8('0x25'),'userProfileId':_0x48dfcc[_0xabb8('0x58')]},'raw':!![]})['then'](function(_0x386dcd){if(_0x386dcd&&_0x386dcd[_0xabb8('0x59')]===0x0){return db[_0xabb8('0x26')][_0xabb8('0x4c')]({'name':_0xabc1d8[_0xabb8('0x2a')],'resourceId':_0xabc1d8['id'],'type':_0x386dcd[_0xabb8('0x2a')],'sectionId':_0x386dcd['id']},{})[_0xabb8('0x22')](function(){return _0x4069e1;});}else{return _0x4069e1;}})[_0xabb8('0x46')](function(_0x534b95){logger[_0xabb8('0x28')](_0xabb8('0x5a'),_0x534b95);throw _0x534b95;});}return _0x4069e1;})[_0xabb8('0x22')](respondWithResult(_0x97c149,0xc9))[_0xabb8('0x46')](handleError(_0x97c149,null));};
\ No newline at end of file
+var _0xa495=['query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','params','length','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','key'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa495,0xc7));var _0x5a49=function(_0x58b693,_0x14ee77){_0x58b693=_0x58b693-0x0;var _0x400350=_0xa495[_0x58b693];return _0x400350;};'use strict';var emlformat=require(_0x5a49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a49('0x1'));var jsonpatch=require(_0x5a49('0x2'));var rp=require(_0x5a49('0x3'));var moment=require(_0x5a49('0x4'));var BPromise=require(_0x5a49('0x5'));var Mustache=require(_0x5a49('0x6'));var util=require(_0x5a49('0x7'));var path=require(_0x5a49('0x8'));var sox=require(_0x5a49('0x9'));var csv=require(_0x5a49('0xa'));var ejs=require(_0x5a49('0xb'));var fs=require('fs');var fs_extra=require(_0x5a49('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a49('0xd'));var jsforce=require(_0x5a49('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5a49('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5a49('0x10'));var as=require(_0x5a49('0x11'));var hardwareService=require(_0x5a49('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5a49('0x13'));var config=require(_0x5a49('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a49('0x15'))['db'];function respondWithStatusCode(_0x1bfb35,_0x35f7ca){_0x35f7ca=_0x35f7ca||0xcc;return function(_0x380807){if(_0x380807){return _0x1bfb35[_0x5a49('0x16')](_0x35f7ca);}return _0x1bfb35['status'](_0x35f7ca)[_0x5a49('0x17')]();};}function respondWithResult(_0x2d217d,_0x5354b1){_0x5354b1=_0x5354b1||0xc8;return function(_0x9d406a){if(_0x9d406a){return _0x2d217d[_0x5a49('0x18')](_0x5354b1)[_0x5a49('0x19')](_0x9d406a);}};}function respondWithFilteredResult(_0x2a7a81,_0x5e62cc){return function(_0x52ca58){if(_0x52ca58){var _0x401383=typeof _0x5e62cc[_0x5a49('0x1a')]===_0x5a49('0x1b')&&typeof _0x5e62cc[_0x5a49('0x1c')]===_0x5a49('0x1b');var _0x20b740=_0x52ca58[_0x5a49('0x1d')];var _0x434a55=_0x401383?0x0:_0x5e62cc[_0x5a49('0x1a')];var _0x52874c=_0x401383?_0x52ca58[_0x5a49('0x1d')]:_0x5e62cc[_0x5a49('0x1a')]+_0x5e62cc[_0x5a49('0x1c')];var _0x17a68b;if(_0x52874c>=_0x20b740){_0x52874c=_0x20b740;_0x17a68b=0xc8;}else{_0x17a68b=0xce;}_0x2a7a81['status'](_0x17a68b);return _0x2a7a81[_0x5a49('0x1e')]('Content-Range',_0x434a55+'-'+_0x52874c+'/'+_0x20b740)['json'](_0x52ca58);}return null;};}function patchUpdates(_0x1db405){return function(_0x2abb42){try{jsonpatch['apply'](_0x2abb42,_0x1db405,!![]);}catch(_0x2096f5){return BPromise[_0x5a49('0x1f')](_0x2096f5);}return _0x2abb42[_0x5a49('0x20')]();};}function saveUpdates(_0x2d9bf5,_0x5b6c65){return function(_0x5afbdc){if(_0x5afbdc){return _0x5afbdc[_0x5a49('0x21')](_0x2d9bf5)['then'](function(_0x51377e){return _0x51377e;});}return null;};}function removeEntity(_0x1cc92e,_0x576ec2){return function(_0x52b9d4){if(_0x52b9d4){return _0x52b9d4[_0x5a49('0x22')]()[_0x5a49('0x23')](function(){var _0x26c24c=_0x52b9d4[_0x5a49('0x24')]({'plain':!![]});var _0x388615=_0x5a49('0x25');return db[_0x5a49('0x26')][_0x5a49('0x22')]({'where':{'type':_0x388615,'resourceId':_0x26c24c['id']}})['then'](function(){return _0x52b9d4;});})[_0x5a49('0x23')](function(){_0x1cc92e[_0x5a49('0x18')](0xcc)[_0x5a49('0x17')]();});}};}function handleEntityNotFound(_0x57fc1f,_0x887e42){return function(_0x52a2b9){if(!_0x52a2b9){_0x57fc1f['sendStatus'](0x194);}return _0x52a2b9;};}function handleError(_0x18d9be,_0x5d5e7a){_0x5d5e7a=_0x5d5e7a||0x1f4;return function(_0x4884eb){logger['error'](_0x4884eb[_0x5a49('0x27')]);if(_0x4884eb[_0x5a49('0x28')]){delete _0x4884eb['name'];}_0x18d9be[_0x5a49('0x18')](_0x5d5e7a)[_0x5a49('0x29')](_0x4884eb);};}exports[_0x5a49('0x2a')]=function(_0x3a0603,_0x539cee){var _0x3a25e7={},_0x523725={},_0x4a1b81={'count':0x0,'rows':[]};var _0x884660=_['map'](db[_0x5a49('0x2b')][_0x5a49('0x2c')],function(_0x546c28){return{'name':_0x546c28[_0x5a49('0x2d')],'type':_0x546c28['type'][_0x5a49('0x2e')]};});_0x523725['model']=_['map'](_0x884660,_0x5a49('0x28'));_0x523725[_0x5a49('0x2f')]=_[_0x5a49('0x30')](_0x3a0603['query']);_0x523725['filters']=_[_0x5a49('0x31')](_0x523725['model'],_0x523725['query']);_0x3a25e7[_0x5a49('0x32')]=_[_0x5a49('0x31')](_0x523725[_0x5a49('0x33')],qs[_0x5a49('0x34')](_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x34')]));_0x3a25e7[_0x5a49('0x32')]=_0x3a25e7['attributes']['length']?_0x3a25e7[_0x5a49('0x32')]:_0x523725[_0x5a49('0x33')];if(!_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x35')](_0x5a49('0x36'))){_0x3a25e7[_0x5a49('0x1c')]=qs[_0x5a49('0x1c')](_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x1c')]);_0x3a25e7[_0x5a49('0x1a')]=qs[_0x5a49('0x1a')](_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x1a')]);}_0x3a25e7[_0x5a49('0x37')]=qs[_0x5a49('0x38')](_0x3a0603['query'][_0x5a49('0x38')]);_0x3a25e7[_0x5a49('0x39')]=qs['filters'](_['pick'](_0x3a0603[_0x5a49('0x2f')],_0x523725[_0x5a49('0x3a')]),_0x884660);if(_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3b')]){_0x3a25e7[_0x5a49('0x39')]=_['merge'](_0x3a25e7[_0x5a49('0x39')],{'$or':[{'key':{'$like':'%'+_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3b')]+'%'}}]});}_0x3a25e7=_[_0x5a49('0x3c')]({},_0x3a25e7,_0x3a0603['options']);var _0x3daa86={'where':_0x3a25e7[_0x5a49('0x39')]};return db['CannedAnswer'][_0x5a49('0x1d')](_0x3daa86)['then'](function(_0x428d7a){_0x4a1b81[_0x5a49('0x1d')]=_0x428d7a;if(_0x3a0603[_0x5a49('0x2f')][_0x5a49('0x3d')]){_0x3a25e7[_0x5a49('0x3e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3a25e7);})['then'](function(_0x41ed37){_0x4a1b81['rows']=_0x41ed37;return _0x4a1b81;})['then'](respondWithFilteredResult(_0x539cee,_0x3a25e7))['catch'](handleError(_0x539cee,null));};exports['show']=function(_0x2bc01c,_0x8fb72c){var _0x357fef={'raw':!![],'where':{'id':_0x2bc01c[_0x5a49('0x3f')]['id']}},_0x3f23f3={};_0x3f23f3[_0x5a49('0x33')]=_[_0x5a49('0x30')](db['CannedAnswer'][_0x5a49('0x2c')]);_0x3f23f3[_0x5a49('0x2f')]=_[_0x5a49('0x30')](_0x2bc01c[_0x5a49('0x2f')]);_0x3f23f3['filters']=_[_0x5a49('0x31')](_0x3f23f3[_0x5a49('0x33')],_0x3f23f3[_0x5a49('0x2f')]);_0x357fef[_0x5a49('0x32')]=_['intersection'](_0x3f23f3[_0x5a49('0x33')],qs[_0x5a49('0x34')](_0x2bc01c[_0x5a49('0x2f')]['fields']));_0x357fef[_0x5a49('0x32')]=_0x357fef[_0x5a49('0x32')][_0x5a49('0x40')]?_0x357fef[_0x5a49('0x32')]:_0x3f23f3[_0x5a49('0x33')];if(_0x2bc01c['query'][_0x5a49('0x3d')]){_0x357fef['include']=[{'all':!![]}];}_0x357fef=_['merge']({},_0x357fef,_0x2bc01c[_0x5a49('0x41')]);return db['CannedAnswer'][_0x5a49('0x42')](_0x357fef)[_0x5a49('0x23')](handleEntityNotFound(_0x8fb72c,null))[_0x5a49('0x23')](respondWithResult(_0x8fb72c,null))['catch'](handleError(_0x8fb72c,null));};exports['update']=function(_0x4187d8,_0x3c57b4){if(_0x4187d8[_0x5a49('0x43')]['id']){delete _0x4187d8[_0x5a49('0x43')]['id'];}return db[_0x5a49('0x2b')][_0x5a49('0x42')]({'where':{'id':_0x4187d8[_0x5a49('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c57b4,null))[_0x5a49('0x23')](saveUpdates(_0x4187d8[_0x5a49('0x43')],null))['then'](respondWithResult(_0x3c57b4,null))['catch'](handleError(_0x3c57b4,null));};exports['destroy']=function(_0x146053,_0x182007){return db['CannedAnswer'][_0x5a49('0x42')]({'where':{'id':_0x146053['params']['id']}})['then'](handleEntityNotFound(_0x182007,null))[_0x5a49('0x23')](removeEntity(_0x182007,null))['catch'](handleError(_0x182007,null));};exports[_0x5a49('0x44')]=function(_0x297467,_0x5a0d49){var _0x5c8fc9={'key':_0x297467[_0x5a49('0x43')][_0x5a49('0x2e')]};if(_0x297467[_0x5a49('0x43')]['MailAccountId']){_0x5c8fc9[_0x5a49('0x45')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x45')];}else if(_0x297467[_0x5a49('0x43')][_0x5a49('0x46')]){_0x5c8fc9[_0x5a49('0x46')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x46')];}else if(_0x297467['body']['OpenchannelAccountId']){_0x5c8fc9[_0x5a49('0x47')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x47')];}else if(_0x297467[_0x5a49('0x43')]['ChatWebsiteId']){_0x5c8fc9[_0x5a49('0x48')]=_0x297467[_0x5a49('0x43')][_0x5a49('0x48')];}return db[_0x5a49('0x2b')][_0x5a49('0x42')]({'where':_0x5c8fc9})[_0x5a49('0x23')](function(_0x20f7b9){if(_0x20f7b9){throw new db[(_0x5a49('0x49'))]['ValidationError'](_0x5a49('0x4a'));}return db[_0x5a49('0x2b')][_0x5a49('0x44')](_0x297467['body']);})[_0x5a49('0x23')](function(_0x132802){var _0x2023c9=_0x297467[_0x5a49('0x4b')][_0x5a49('0x24')]({'plain':!![]});if(!_0x2023c9)throw new Error(_0x5a49('0x4c'));if(_0x2023c9[_0x5a49('0x4d')]===_0x5a49('0x4b')){var _0x39df3c=_0x132802[_0x5a49('0x24')]({'plain':!![]});return db[_0x5a49('0x4e')][_0x5a49('0x42')]({'where':{'name':'CannedAnswers','userProfileId':_0x2023c9['userProfileId']},'raw':!![]})['then'](function(_0x449462){if(_0x449462&&_0x449462[_0x5a49('0x4f')]===0x0){return db[_0x5a49('0x26')][_0x5a49('0x44')]({'name':_0x39df3c[_0x5a49('0x28')],'resourceId':_0x39df3c['id'],'type':_0x449462[_0x5a49('0x28')],'sectionId':_0x449462['id']},{})[_0x5a49('0x23')](function(){return _0x132802;});}else{return _0x132802;}})[_0x5a49('0x50')](function(_0xa9ea39){logger['error'](_0x5a49('0x51'),_0xa9ea39);throw _0xa9ea39;});}return _0x132802;})[_0x5a49('0x23')](respondWithResult(_0x5a0d49,0xc9))[_0x5a49('0x50')](handleError(_0x5a0d49,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 2780875..02ecccc 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 _0xa7f3=['moment','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa7f3,0x82));var _0x3a7f=function(_0x166294,_0x175bc9){_0x166294=_0x166294-0x0;var _0x304968=_0xa7f3[_0x166294];return _0x304968;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3a7f('0x0'))(_0x3a7f('0x1'));var moment=require(_0x3a7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x3a7f('0x3'));var fs=require('fs');var path=require(_0x3a7f('0x4'));var rimraf=require(_0x3a7f('0x5'));var config=require(_0x3a7f('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x3a7f('0x7')]=function(_0x5b109a,_0x2b240b){return _0x5b109a[_0x3a7f('0x8')](_0x3a7f('0x9'),attributes,{'tableName':_0x3a7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a7f('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6a47=['../../config/logger','api','moment','request-promise','path','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x5cbc6e,_0x14aa6e){var _0x3692b2=function(_0xc8d180){while(--_0xc8d180){_0x5cbc6e['push'](_0x5cbc6e['shift']());}};_0x3692b2(++_0x14aa6e);}(_0x6a47,0x112));var _0x76a4=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x6a47[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x76a4('0x0'));var util=require(_0x76a4('0x1'));var logger=require(_0x76a4('0x2'))(_0x76a4('0x3'));var moment=require(_0x76a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x76a4('0x5'));var fs=require('fs');var path=require(_0x76a4('0x6'));var rimraf=require('rimraf');var config=require(_0x76a4('0x7'));var attributes=require(_0x76a4('0x8'));module['exports']=function(_0x3c179a,_0xf49643){return _0x3c179a['define'](_0x76a4('0x9'),attributes,{'tableName':_0x76a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x76a4('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index b42367a..8f39446 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(_0x5c1eec,_0x3c72c9){var _0x1496fb=function(_0x5e0e44){while(--_0x5e0e44){_0x5c1eec['push'](_0x5c1eec['shift']());}};_0x1496fb(++_0x3c72c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x472216,_0x1f82c9){var _0x53322c=function(_0x37c26d){while(--_0x37c26d){_0x472216['push'](_0x472216['shift']());}};_0x53322c(++_0x1f82c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 a580510..19e1a9e 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 _0x4cdf=['/:id','create','put','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x4cdf,0x122));var _0xf4cd=function(_0x68fe95,_0x1dc817){_0x68fe95=_0x68fe95-0x0;var _0x441dfd=_0x4cdf[_0x68fe95];return _0x441dfd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf4cd('0x0'));var timeout=require(_0xf4cd('0x1'));var express=require(_0xf4cd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf4cd('0x3'));var interaction=require(_0xf4cd('0x4'));var config=require(_0xf4cd('0x5'));var controller=require(_0xf4cd('0x6'));router['get']('/',auth[_0xf4cd('0x7')](),controller[_0xf4cd('0x8')]);router[_0xf4cd('0x9')](_0xf4cd('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf4cd('0x7')](),controller[_0xf4cd('0xb')]);router[_0xf4cd('0xc')]('/:id',auth[_0xf4cd('0x7')](),controller['update']);router['delete']('/:id',auth[_0xf4cd('0x7')](),controller[_0xf4cd('0xd')]);module[_0xf4cd('0xe')]=router;
\ No newline at end of file
+var _0x4928=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports'];(function(_0x56c1cc,_0x111a6c){var _0x1bab95=function(_0x43e320){while(--_0x43e320){_0x56c1cc['push'](_0x56c1cc['shift']());}};_0x1bab95(++_0x111a6c);}(_0x4928,0x10a));var _0x8492=function(_0x5192e8,_0x254ca4){_0x5192e8=_0x5192e8-0x0;var _0x9f0941=_0x4928[_0x5192e8];return _0x9f0941;};'use strict';var multer=require(_0x8492('0x0'));var util=require(_0x8492('0x1'));var path=require(_0x8492('0x2'));var timeout=require(_0x8492('0x3'));var express=require('express');var router=express[_0x8492('0x4')]();var fs_extra=require(_0x8492('0x5'));var auth=require(_0x8492('0x6'));var interaction=require(_0x8492('0x7'));var config=require(_0x8492('0x8'));var controller=require(_0x8492('0x9'));router[_0x8492('0xa')]('/',auth[_0x8492('0xb')](),controller['index']);router[_0x8492('0xa')](_0x8492('0xc'),auth['isAuthenticated'](),controller[_0x8492('0xd')]);router[_0x8492('0xe')]('/',auth[_0x8492('0xb')](),controller[_0x8492('0xf')]);router[_0x8492('0x10')]('/:id',auth[_0x8492('0xb')](),controller['update']);router['delete'](_0x8492('0xc'),auth[_0x8492('0xb')](),controller[_0x8492('0x11')]);module[_0x8492('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 0d3088e..2269cb8 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 _0xc6fe=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x502662,_0x2a759d){var _0x413217=function(_0x1b9542){while(--_0x1b9542){_0x502662['push'](_0x502662['shift']());}};_0x413217(++_0x2a759d);}(_0xc6fe,0xbc));var _0xec6f=function(_0x14a9b0,_0x1e68ec){_0x14a9b0=_0x14a9b0-0x0;var _0x292de8=_0xc6fe[_0x14a9b0];return _0x292de8;};'use strict';var Sequelize=require(_0xec6f('0x0'));module[_0xec6f('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xec6f('0x2')},'clid':{'type':Sequelize[_0xec6f('0x3')]},'src':{'type':Sequelize[_0xec6f('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xec6f('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xec6f('0x3')]},'lastapp':{'type':Sequelize[_0xec6f('0x3')]},'lastdata':{'type':Sequelize[_0xec6f('0x3')]},'duration':{'type':Sequelize[_0xec6f('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xec6f('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xec6f('0x3')]},'amaflags':{'type':Sequelize[_0xec6f('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xec6f('0x3')]},'userfield':{'type':Sequelize[_0xec6f('0x3')]},'uniqueid':{'type':Sequelize[_0xec6f('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xec6f('0x3')]},'peeraccount':{'type':Sequelize[_0xec6f('0x3')]},'type':{'type':Sequelize[_0xec6f('0x3')]},'tag':{'type':Sequelize[_0xec6f('0x3')]}};
\ No newline at end of file
+var _0x22a4=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x172789,_0x44450f){var _0xca1a41=function(_0x27cf95){while(--_0x27cf95){_0x172789['push'](_0x172789['shift']());}};_0xca1a41(++_0x44450f);}(_0x22a4,0x1cb));var _0x422a=function(_0x316b61,_0x395d65){_0x316b61=_0x316b61-0x0;var _0x945283=_0x22a4[_0x316b61];return _0x945283;};'use strict';var Sequelize=require(_0x422a('0x0'));module[_0x422a('0x1')]={'calldate':{'type':Sequelize[_0x422a('0x2')],'allowNull':![],'defaultValue':_0x422a('0x3')},'clid':{'type':Sequelize[_0x422a('0x4')]},'src':{'type':Sequelize[_0x422a('0x4')]},'dst':{'type':Sequelize[_0x422a('0x4')]},'dcontext':{'type':Sequelize[_0x422a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x422a('0x4')]},'lastapp':{'type':Sequelize[_0x422a('0x4')]},'lastdata':{'type':Sequelize[_0x422a('0x4')]},'duration':{'type':Sequelize[_0x422a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x422a('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x422a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x422a('0x4')]},'userfield':{'type':Sequelize[_0x422a('0x4')]},'uniqueid':{'type':Sequelize[_0x422a('0x4')]},'linkedid':{'type':Sequelize[_0x422a('0x4')]},'sequence':{'type':Sequelize[_0x422a('0x4')]},'peeraccount':{'type':Sequelize[_0x422a('0x4')]},'type':{'type':Sequelize[_0x422a('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0cf9d06..17a8038 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 _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x390a9c,_0x2df333){var _0x11c6e8=function(_0x15e8b0){while(--_0x15e8b0){_0x390a9c['push'](_0x390a9c['shift']());}};_0x11c6e8(++_0x2df333);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));};
\ No newline at end of file
+var _0xab86=['fieldName','type','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','filters','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','map','Cdr','rawAttributes'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xab86,0x13e));var _0x6ab8=function(_0x451e93,_0x319002){_0x451e93=_0x451e93-0x0;var _0x3af049=_0xab86[_0x451e93];return _0x3af049;};'use strict';var emlformat=require(_0x6ab8('0x0'));var rimraf=require(_0x6ab8('0x1'));var zipdir=require(_0x6ab8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ab8('0x4'));var util=require('util');var path=require(_0x6ab8('0x5'));var sox=require(_0x6ab8('0x6'));var csv=require(_0x6ab8('0x7'));var ejs=require(_0x6ab8('0x8'));var fs=require('fs');var fs_extra=require(_0x6ab8('0x9'));var _=require(_0x6ab8('0xa'));var squel=require(_0x6ab8('0xb'));var crypto=require(_0x6ab8('0xc'));var jsforce=require(_0x6ab8('0xd'));var deskjs=require(_0x6ab8('0xe'));var toCsv=require(_0x6ab8('0x7'));var querystring=require(_0x6ab8('0xf'));var Papa=require(_0x6ab8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ab8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ab8('0x12'));var logger=require(_0x6ab8('0x13'))(_0x6ab8('0x14'));var utils=require('../../config/utils');var config=require(_0x6ab8('0x15'));var licenseUtil=require(_0x6ab8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44d1d9,_0x1b9b34){_0x1b9b34=_0x1b9b34||0xcc;return function(_0x408ce1){if(_0x408ce1){return _0x44d1d9['sendStatus'](_0x1b9b34);}return _0x44d1d9[_0x6ab8('0x17')](_0x1b9b34)[_0x6ab8('0x18')]();};}function respondWithResult(_0x60b50,_0x968bac){_0x968bac=_0x968bac||0xc8;return function(_0x1c83a1){if(_0x1c83a1){return _0x60b50[_0x6ab8('0x17')](_0x968bac)[_0x6ab8('0x19')](_0x1c83a1);}};}function respondWithFilteredResult(_0x2043bb,_0x293389){return function(_0x5218e9){if(_0x5218e9){var _0x1f64a3=typeof _0x293389[_0x6ab8('0x1a')]===_0x6ab8('0x1b')&&typeof _0x293389['limit']===_0x6ab8('0x1b');var _0x35b790=_0x5218e9['count'];var _0x543726=_0x1f64a3?0x0:_0x293389[_0x6ab8('0x1a')];var _0x57cd18=_0x1f64a3?_0x5218e9[_0x6ab8('0x1c')]:_0x293389[_0x6ab8('0x1a')]+_0x293389[_0x6ab8('0x1d')];var _0x4e0fbd;if(_0x57cd18>=_0x35b790){_0x57cd18=_0x35b790;_0x4e0fbd=0xc8;}else{_0x4e0fbd=0xce;}_0x2043bb[_0x6ab8('0x17')](_0x4e0fbd);return _0x2043bb[_0x6ab8('0x1e')](_0x6ab8('0x1f'),_0x543726+'-'+_0x57cd18+'/'+_0x35b790)[_0x6ab8('0x19')](_0x5218e9);}return null;};}function patchUpdates(_0x5227c6){return function(_0x301004){try{jsonpatch[_0x6ab8('0x20')](_0x301004,_0x5227c6,!![]);}catch(_0x520cd8){return BPromise['reject'](_0x520cd8);}return _0x301004['save']();};}function saveUpdates(_0x190af2,_0x46cfdc){return function(_0xe2d5d8){if(_0xe2d5d8){return _0xe2d5d8['update'](_0x190af2)[_0x6ab8('0x21')](function(_0x433f37){return _0x433f37;});}return null;};}function removeEntity(_0x50fc50,_0x503f94){return function(_0x8af7e9){if(_0x8af7e9){return _0x8af7e9[_0x6ab8('0x22')]()['then'](function(){_0x50fc50[_0x6ab8('0x17')](0xcc)[_0x6ab8('0x18')]();});}};}function handleEntityNotFound(_0x24e400,_0x3d614b){return function(_0x3ddaeb){if(!_0x3ddaeb){_0x24e400[_0x6ab8('0x23')](0x194);}return _0x3ddaeb;};}function handleError(_0x2e098f,_0x1e26ed){_0x1e26ed=_0x1e26ed||0x1f4;return function(_0x5a1be3){logger['error'](_0x5a1be3[_0x6ab8('0x24')]);if(_0x5a1be3['name']){delete _0x5a1be3[_0x6ab8('0x25')];}_0x2e098f[_0x6ab8('0x17')](_0x1e26ed)[_0x6ab8('0x26')](_0x5a1be3);};}exports['index']=function(_0x525687,_0x4871e3){var _0x79dbd3={},_0x14e822={},_0x3723a7={'count':0x0,'rows':[]};var _0x2f14ea=_[_0x6ab8('0x27')](db[_0x6ab8('0x28')][_0x6ab8('0x29')],function(_0x4eda0b){return{'name':_0x4eda0b[_0x6ab8('0x2a')],'type':_0x4eda0b[_0x6ab8('0x2b')][_0x6ab8('0x2c')]};});_0x14e822[_0x6ab8('0x2d')]=_[_0x6ab8('0x27')](_0x2f14ea,'name');_0x14e822['query']=_[_0x6ab8('0x2e')](_0x525687['query']);_0x14e822['filters']=_[_0x6ab8('0x2f')](_0x14e822[_0x6ab8('0x2d')],_0x14e822['query']);_0x79dbd3[_0x6ab8('0x30')]=_['intersection'](_0x14e822[_0x6ab8('0x2d')],qs[_0x6ab8('0x31')](_0x525687['query']['fields']));_0x79dbd3[_0x6ab8('0x30')]=_0x79dbd3[_0x6ab8('0x30')][_0x6ab8('0x32')]?_0x79dbd3[_0x6ab8('0x30')]:_0x14e822[_0x6ab8('0x2d')];if(!_0x525687[_0x6ab8('0x33')][_0x6ab8('0x34')](_0x6ab8('0x35'))){_0x79dbd3['limit']=qs[_0x6ab8('0x1d')](_0x525687[_0x6ab8('0x33')][_0x6ab8('0x1d')]);_0x79dbd3[_0x6ab8('0x1a')]=qs[_0x6ab8('0x1a')](_0x525687[_0x6ab8('0x33')]['offset']);}_0x79dbd3[_0x6ab8('0x36')]=qs[_0x6ab8('0x37')](_0x525687[_0x6ab8('0x33')]['sort']);_0x79dbd3['where']=qs[_0x6ab8('0x38')](_[_0x6ab8('0x39')](_0x525687[_0x6ab8('0x33')],_0x14e822[_0x6ab8('0x38')]),_0x2f14ea);if(_0x525687[_0x6ab8('0x33')]['filter']){_0x79dbd3['where']=_[_0x6ab8('0x3a')](_0x79dbd3['where'],{'$or':_[_0x6ab8('0x27')](_0x2f14ea,function(_0x9ca6ed){if(_0x9ca6ed['type']!=='VIRTUAL'){var _0x8d76aa={};_0x8d76aa[_0x9ca6ed[_0x6ab8('0x25')]]={'$like':'%'+_0x525687[_0x6ab8('0x33')][_0x6ab8('0x3b')]+'%'};return _0x8d76aa;}})});}_0x79dbd3=_[_0x6ab8('0x3a')]({},_0x79dbd3,_0x525687[_0x6ab8('0x3c')]);var _0xef0ce5={'where':_0x79dbd3['where']};return db['Cdr'][_0x6ab8('0x1c')](_0xef0ce5)[_0x6ab8('0x21')](function(_0x146f43){_0x3723a7[_0x6ab8('0x1c')]=_0x146f43;if(_0x525687['query'][_0x6ab8('0x3d')]){_0x79dbd3['include']=[{'all':!![]}];}return db['Cdr'][_0x6ab8('0x3e')](_0x79dbd3);})[_0x6ab8('0x21')](function(_0x45735d){_0x3723a7[_0x6ab8('0x3f')]=_0x45735d;return _0x3723a7;})[_0x6ab8('0x21')](respondWithFilteredResult(_0x4871e3,_0x79dbd3))[_0x6ab8('0x40')](handleError(_0x4871e3,null));};exports[_0x6ab8('0x41')]=function(_0xf3abb8,_0x2494c3){var _0x45c70d={'raw':!![],'where':{'id':_0xf3abb8[_0x6ab8('0x42')]['id']}},_0xc32c6e={};_0xc32c6e['model']=_[_0x6ab8('0x2e')](db[_0x6ab8('0x28')][_0x6ab8('0x29')]);_0xc32c6e[_0x6ab8('0x33')]=_['keys'](_0xf3abb8[_0x6ab8('0x33')]);_0xc32c6e['filters']=_[_0x6ab8('0x2f')](_0xc32c6e[_0x6ab8('0x2d')],_0xc32c6e['query']);_0x45c70d[_0x6ab8('0x30')]=_[_0x6ab8('0x2f')](_0xc32c6e['model'],qs[_0x6ab8('0x31')](_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x31')]));_0x45c70d[_0x6ab8('0x30')]=_0x45c70d[_0x6ab8('0x30')]['length']?_0x45c70d['attributes']:_0xc32c6e['model'];if(_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x3d')]){_0x45c70d['include']=[{'all':!![]}];}_0x45c70d=_[_0x6ab8('0x3a')]({},_0x45c70d,_0xf3abb8[_0x6ab8('0x3c')]);return db[_0x6ab8('0x28')][_0x6ab8('0x43')](_0x45c70d)[_0x6ab8('0x21')](handleEntityNotFound(_0x2494c3,null))[_0x6ab8('0x21')](respondWithResult(_0x2494c3,null))['catch'](handleError(_0x2494c3,null));};exports[_0x6ab8('0x44')]=function(_0x74de32,_0x4b00cc){return db[_0x6ab8('0x28')][_0x6ab8('0x44')](_0x74de32[_0x6ab8('0x45')],{})['then'](respondWithResult(_0x4b00cc,0xc9))['catch'](handleError(_0x4b00cc,null));};exports[_0x6ab8('0x46')]=function(_0x4c27fa,_0x31965e){if(_0x4c27fa['body']['id']){delete _0x4c27fa[_0x6ab8('0x45')]['id'];}return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x4c27fa[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0x31965e,null))[_0x6ab8('0x21')](saveUpdates(_0x4c27fa['body'],null))['then'](respondWithResult(_0x31965e,null))['catch'](handleError(_0x31965e,null));};exports[_0x6ab8('0x22')]=function(_0x54708b,_0xce83a3){return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x54708b[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0xce83a3,null))[_0x6ab8('0x21')](removeEntity(_0xce83a3,null))[_0x6ab8('0x40')](handleError(_0xce83a3,null));};exports[_0x6ab8('0x47')]=function(_0x4d4e88,_0x1a372b){return db[_0x6ab8('0x28')][_0x6ab8('0x47')]()[_0x6ab8('0x21')](respondWithResult(_0x1a372b,null))['catch'](handleError(_0x1a372b,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 946a1b2..c272ff2 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(_0x1e7fc9,_0x1b738a){var _0x1d44b3=function(_0x4300a4){while(--_0x4300a4){_0x1e7fc9['push'](_0x1e7fc9['shift']());}};_0x1d44b3(++_0x1b738a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x15c979,_0x529aee){var _0x3f396c=function(_0x4cd41c){while(--_0x4cd41c){_0x15c979['push'](_0x15c979['shift']());}};_0x3f396c(++_0x529aee);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index cf416af..e74584d 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 _0xc608=['code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x174faa,_0x2555b7){var _0x50e033=function(_0xca5821){while(--_0xca5821){_0x174faa['push'](_0x174faa['shift']());}};_0x50e033(++_0x2555b7);}(_0xc608,0x18c));var _0x8c60=function(_0xf740cf,_0x5f1b1e){_0xf740cf=_0xf740cf-0x0;var _0x4ec1ab=_0xc608[_0xf740cf];return _0x4ec1ab;};'use strict';var _=require('lodash');var util=require(_0x8c60('0x0'));var moment=require(_0x8c60('0x1'));var BPromise=require(_0x8c60('0x2'));var rs=require(_0x8c60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c60('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c60('0x5'));var config=require(_0x8c60('0x6'));var jayson=require(_0x8c60('0x7'));var client=jayson[_0x8c60('0x8')][_0x8c60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2009de,_0x2ba190,_0x3f0cd6){return new BPromise(function(_0x147107,_0x53fad5){return client[_0x8c60('0xa')](_0x2009de,_0x3f0cd6)[_0x8c60('0xb')](function(_0x18f04b){logger['info'](_0x8c60('0xc'),_0x2ba190,_0x8c60('0xd'));logger[_0x8c60('0xe')](_0x8c60('0xf'),_0x2ba190,_0x8c60('0xd'),JSON[_0x8c60('0x10')](_0x18f04b));if(_0x18f04b[_0x8c60('0x11')]){if(_0x18f04b[_0x8c60('0x11')][_0x8c60('0x12')]===0x1f4){logger['error'](_0x8c60('0xc'),_0x2ba190,_0x18f04b['error'][_0x8c60('0x13')]);return _0x53fad5(_0x18f04b[_0x8c60('0x11')][_0x8c60('0x13')]);}logger[_0x8c60('0x11')](_0x8c60('0xc'),_0x2ba190,_0x18f04b[_0x8c60('0x11')][_0x8c60('0x13')]);return _0x147107(_0x18f04b[_0x8c60('0x11')][_0x8c60('0x13')]);}else{logger[_0x8c60('0x14')](_0x8c60('0xc'),_0x2ba190,_0x8c60('0xd'));_0x147107(_0x18f04b[_0x8c60('0x15')][_0x8c60('0x13')]);}})[_0x8c60('0x16')](function(_0x269b9c){logger[_0x8c60('0x11')](_0x8c60('0xc'),_0x2ba190,_0x269b9c);_0x53fad5(_0x269b9c);});});}
\ No newline at end of file
+var _0x3af1=['then','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','Cdr,\x20%s,\x20%s','message','error','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x37b670,_0x4a1ae8){var _0x224d4f=function(_0x195cd5){while(--_0x195cd5){_0x37b670['push'](_0x37b670['shift']());}};_0x224d4f(++_0x4a1ae8);}(_0x3af1,0x1ba));var _0x13af=function(_0x3566ee,_0x352119){_0x3566ee=_0x3566ee-0x0;var _0x5bf901=_0x3af1[_0x3566ee];return _0x5bf901;};'use strict';var _=require(_0x13af('0x0'));var util=require(_0x13af('0x1'));var moment=require(_0x13af('0x2'));var BPromise=require(_0x13af('0x3'));var rs=require(_0x13af('0x4'));var fs=require('fs');var Redis=require(_0x13af('0x5'));var db=require(_0x13af('0x6'))['db'];var utils=require(_0x13af('0x7'));var logger=require('../../config/logger')(_0x13af('0x8'));var config=require(_0x13af('0x9'));var jayson=require(_0x13af('0xa'));var client=jayson[_0x13af('0xb')][_0x13af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x249fd0,_0x34333c,_0x59262f){return new BPromise(function(_0x400e50,_0x42958c){return client[_0x13af('0xd')](_0x249fd0,_0x59262f)[_0x13af('0xe')](function(_0x5c2748){logger['info']('Cdr,\x20%s,\x20%s',_0x34333c,_0x13af('0xf'));logger['debug'](_0x13af('0x10'),_0x34333c,_0x13af('0xf'),JSON[_0x13af('0x11')](_0x5c2748));if(_0x5c2748['error']){if(_0x5c2748['error'][_0x13af('0x12')]===0x1f4){logger['error'](_0x13af('0x13'),_0x34333c,_0x5c2748['error'][_0x13af('0x14')]);return _0x42958c(_0x5c2748[_0x13af('0x15')][_0x13af('0x14')]);}logger['error'](_0x13af('0x13'),_0x34333c,_0x5c2748['error']['message']);return _0x400e50(_0x5c2748[_0x13af('0x15')][_0x13af('0x14')]);}else{logger[_0x13af('0x16')](_0x13af('0x13'),_0x34333c,_0x13af('0xf'));_0x400e50(_0x5c2748['result'][_0x13af('0x14')]);}})[_0x13af('0x17')](function(_0x4d296f){logger[_0x13af('0x15')](_0x13af('0x13'),_0x34333c,_0x4d296f);_0x42958c(_0x4d296f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 427e52e..cb706dc 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('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(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 1bd8582..e0ff616 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 _0xd89c=['STRING','sequelize','exports'];(function(_0xd46c02,_0x2b2aa2){var _0x8a93d9=function(_0x3bc8d9){while(--_0x3bc8d9){_0xd46c02['push'](_0xd46c02['shift']());}};_0x8a93d9(++_0x2b2aa2);}(_0xd89c,0xac));var _0xcd89=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd89c[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0xcd89('0x0'));module[_0xcd89('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcd89('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcd89('0x2')]},'interval':{'type':Sequelize[_0xcd89('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xda5c=['*,*,*,*','sequelize','exports','STRING'];(function(_0xce68df,_0x30be17){var _0x636d26=function(_0x136195){while(--_0x136195){_0xce68df['push'](_0xce68df['shift']());}};_0x636d26(++_0x30be17);}(_0xda5c,0x111));var _0xcda5=function(_0x1a0b43,_0x175f26){_0x1a0b43=_0x1a0b43-0x0;var _0x23d163=_0xda5c[_0x1a0b43];return _0x23d163;};'use strict';var Sequelize=require(_0xcda5('0x0'));module[_0xcda5('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcda5('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcda5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcda5('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ce8234e..b1adb9c 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 _0x3140=['catch','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','update','then','end','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','ChatApplication','find'];(function(_0x65eae,_0x32dc5f){var _0x18e82b=function(_0x2b3bed){while(--_0x2b3bed){_0x65eae['push'](_0x65eae['shift']());}};_0x18e82b(++_0x32dc5f);}(_0x3140,0xaf));var _0x0314=function(_0x18ea8a,_0x32f09f){_0x18ea8a=_0x18ea8a-0x0;var _0x19c99a=_0x3140[_0x18ea8a];return _0x19c99a;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require(_0x0314('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0314('0x4'));var Mustache=require(_0x0314('0x5'));var util=require(_0x0314('0x6'));var path=require(_0x0314('0x7'));var sox=require(_0x0314('0x8'));var csv=require(_0x0314('0x9'));var ejs=require(_0x0314('0xa'));var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0314('0xf'));var toCsv=require(_0x0314('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0314('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0314('0x11'));var as=require(_0x0314('0x12'));var hardwareService=require(_0x0314('0x13'));var logger=require(_0x0314('0x14'))(_0x0314('0x15'));var utils=require(_0x0314('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x17'));var db=require(_0x0314('0x18'))['db'];function respondWithStatusCode(_0xd85ddf,_0x4602ec){_0x4602ec=_0x4602ec||0xcc;return function(_0x153077){if(_0x153077){return _0xd85ddf[_0x0314('0x19')](_0x4602ec);}return _0xd85ddf[_0x0314('0x1a')](_0x4602ec)['end']();};}function respondWithResult(_0x1c26ff,_0xbe0b07){_0xbe0b07=_0xbe0b07||0xc8;return function(_0x1316a0){if(_0x1316a0){return _0x1c26ff[_0x0314('0x1a')](_0xbe0b07)[_0x0314('0x1b')](_0x1316a0);}};}function respondWithFilteredResult(_0x398c91,_0x413bfa){return function(_0x3ea356){if(_0x3ea356){var _0x5e460f=typeof _0x413bfa[_0x0314('0x1c')]===_0x0314('0x1d')&&typeof _0x413bfa[_0x0314('0x1e')]==='undefined';var _0x6c48cb=_0x3ea356['count'];var _0x575b68=_0x5e460f?0x0:_0x413bfa[_0x0314('0x1c')];var _0x329679=_0x5e460f?_0x3ea356['count']:_0x413bfa[_0x0314('0x1c')]+_0x413bfa[_0x0314('0x1e')];var _0x583ffa;if(_0x329679>=_0x6c48cb){_0x329679=_0x6c48cb;_0x583ffa=0xc8;}else{_0x583ffa=0xce;}_0x398c91[_0x0314('0x1a')](_0x583ffa);return _0x398c91['set'](_0x0314('0x1f'),_0x575b68+'-'+_0x329679+'/'+_0x6c48cb)[_0x0314('0x1b')](_0x3ea356);}return null;};}function patchUpdates(_0x16d273){return function(_0x77ddfd){try{jsonpatch[_0x0314('0x20')](_0x77ddfd,_0x16d273,!![]);}catch(_0xdfad84){return BPromise['reject'](_0xdfad84);}return _0x77ddfd['save']();};}function saveUpdates(_0x20305b,_0xbd3ad0){return function(_0x1945f8){if(_0x1945f8){return _0x1945f8[_0x0314('0x21')](_0x20305b)[_0x0314('0x22')](function(_0xd7638b){return _0xd7638b;});}return null;};}function removeEntity(_0x58a1c9,_0x3c743e){return function(_0x43fb0e){if(_0x43fb0e){return _0x43fb0e['destroy']()[_0x0314('0x22')](function(){_0x58a1c9[_0x0314('0x1a')](0xcc)[_0x0314('0x23')]();});}};}function handleEntityNotFound(_0x26c6a4,_0x867cf7){return function(_0x3af9d3){if(!_0x3af9d3){_0x26c6a4['sendStatus'](0x194);}return _0x3af9d3;};}function handleError(_0x1a5947,_0x2e0c77){_0x2e0c77=_0x2e0c77||0x1f4;return function(_0x2d636b){logger['error'](_0x2d636b[_0x0314('0x24')]);if(_0x2d636b[_0x0314('0x25')]){delete _0x2d636b['name'];}_0x1a5947['status'](_0x2e0c77)[_0x0314('0x26')](_0x2d636b);};}exports[_0x0314('0x27')]=function(_0x550dc4,_0x1c3dfd){var _0x288535={'raw':!![],'where':{'id':_0x550dc4['params']['id']}},_0x5291c2={};_0x5291c2[_0x0314('0x28')]=_[_0x0314('0x29')](db['ChatApplication'][_0x0314('0x2a')]);_0x5291c2[_0x0314('0x2b')]=_[_0x0314('0x29')](_0x550dc4['query']);_0x5291c2[_0x0314('0x2c')]=_[_0x0314('0x2d')](_0x5291c2[_0x0314('0x28')],_0x5291c2[_0x0314('0x2b')]);_0x288535['attributes']=_[_0x0314('0x2d')](_0x5291c2['model'],qs['fields'](_0x550dc4[_0x0314('0x2b')][_0x0314('0x2e')]));_0x288535[_0x0314('0x2f')]=_0x288535['attributes'][_0x0314('0x30')]?_0x288535['attributes']:_0x5291c2[_0x0314('0x28')];if(_0x550dc4['query']['includeAll']){_0x288535[_0x0314('0x31')]=[{'all':!![]}];}_0x288535=_['merge']({},_0x288535,_0x550dc4[_0x0314('0x32')]);return db[_0x0314('0x33')][_0x0314('0x34')](_0x288535)[_0x0314('0x22')](handleEntityNotFound(_0x1c3dfd,null))[_0x0314('0x22')](respondWithResult(_0x1c3dfd,null))[_0x0314('0x35')](handleError(_0x1c3dfd,null));};exports[_0x0314('0x21')]=function(_0x4c763e,_0xf52c24){if(_0x4c763e[_0x0314('0x36')]['id']){delete _0x4c763e[_0x0314('0x36')]['id'];}return db[_0x0314('0x33')][_0x0314('0x34')]({'where':{'id':_0x4c763e[_0x0314('0x37')]['id']}})['then'](handleEntityNotFound(_0xf52c24,null))[_0x0314('0x22')](saveUpdates(_0x4c763e['body'],null))[_0x0314('0x22')](respondWithResult(_0xf52c24,null))['catch'](handleError(_0xf52c24,null));};exports[_0x0314('0x38')]=function(_0x531dde,_0x487c8d){return db['ChatApplication'][_0x0314('0x34')]({'where':{'id':_0x531dde[_0x0314('0x37')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0x487c8d,null))[_0x0314('0x22')](removeEntity(_0x487c8d,null))[_0x0314('0x35')](handleError(_0x487c8d,null));};
\ No newline at end of file
+var _0xd87e=['status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','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','sendStatus'];(function(_0x3e573a,_0x7a5247){var _0x275831=function(_0x558790){while(--_0x558790){_0x3e573a['push'](_0x3e573a['shift']());}};_0x275831(++_0x7a5247);}(_0xd87e,0x1bf));var _0xed87=function(_0x4f3579,_0x22c620){_0x4f3579=_0x4f3579-0x0;var _0x166fdc=_0xd87e[_0x4f3579];return _0x166fdc;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['show']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={'raw':!![],'where':{'id':_0xb32b1c[_0xed87('0x29')]['id']}},_0x3dff74={};_0x3dff74[_0xed87('0x2a')]=_['keys'](db['ChatApplication'][_0xed87('0x2b')]);_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0xb32b1c['query']);_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x3dff74[_0xed87('0x2a')],_0x3dff74[_0xed87('0x2c')]);_0x4eaa44[_0xed87('0x30')]=_[_0xed87('0x2f')](_0x3dff74[_0xed87('0x2a')],qs[_0xed87('0x31')](_0xb32b1c[_0xed87('0x2c')]['fields']));_0x4eaa44[_0xed87('0x30')]=_0x4eaa44[_0xed87('0x30')]['length']?_0x4eaa44[_0xed87('0x30')]:_0x3dff74['model'];if(_0xb32b1c[_0xed87('0x2c')][_0xed87('0x32')]){_0x4eaa44[_0xed87('0x33')]=[{'all':!![]}];}_0x4eaa44=_[_0xed87('0x34')]({},_0x4eaa44,_0xb32b1c[_0xed87('0x35')]);return db[_0xed87('0x36')][_0xed87('0x37')](_0x4eaa44)[_0xed87('0x23')](handleEntityNotFound(_0x1c4a65,null))[_0xed87('0x23')](respondWithResult(_0x1c4a65,null))[_0xed87('0x38')](handleError(_0x1c4a65,null));};exports[_0xed87('0x39')]=function(_0x544247,_0x3763a9){if(_0x544247[_0xed87('0x3a')]['id']){delete _0x544247['body']['id'];}return db[_0xed87('0x36')]['find']({'where':{'id':_0x544247[_0xed87('0x29')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3763a9,null))['then'](saveUpdates(_0x544247[_0xed87('0x3a')],null))[_0xed87('0x23')](respondWithResult(_0x3763a9,null))[_0xed87('0x38')](handleError(_0x3763a9,null));};exports[_0xed87('0x24')]=function(_0x1384e4,_0x5014fe){return db[_0xed87('0x36')]['find']({'where':{'id':_0x1384e4[_0xed87('0x29')]['id']}})['then'](handleEntityNotFound(_0x5014fe,null))[_0xed87('0x23')](removeEntity(_0x5014fe,null))[_0xed87('0x38')](handleError(_0x5014fe,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 23af84a..7dae466 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 _0x47f4=['define','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1f5873,_0x1497be){var _0x2a75d9=function(_0x16c497){while(--_0x16c497){_0x1f5873['push'](_0x1f5873['shift']());}};_0x2a75d9(++_0x1497be);}(_0x47f4,0x86));var _0x447f=function(_0xe07f00,_0x5107ad){_0xe07f00=_0xe07f00-0x0;var _0x4157b3=_0x47f4[_0xe07f00];return _0x4157b3;};'use strict';var _=require('lodash');var util=require(_0x447f('0x0'));var logger=require(_0x447f('0x1'))(_0x447f('0x2'));var moment=require('moment');var BPromise=require(_0x447f('0x3'));var rp=require(_0x447f('0x4'));var fs=require('fs');var path=require(_0x447f('0x5'));var rimraf=require(_0x447f('0x6'));var config=require(_0x447f('0x7'));var attributes=require('./chatApplication.attributes');module[_0x447f('0x8')]=function(_0x3008de,_0x5c0fe2){return _0x3008de[_0x447f('0x9')](_0x447f('0xa'),attributes,{'tableName':_0x447f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x447f('0xc')});};
\ No newline at end of file
+var _0xc8c3=['util','../../config/logger','bluebird','request-promise','path','./chatApplication.attributes','exports','chat_applications','utf8mb4','lodash'];(function(_0x32085b,_0x2ac2fd){var _0x1421d9=function(_0xc2c11b){while(--_0xc2c11b){_0x32085b['push'](_0x32085b['shift']());}};_0x1421d9(++_0x2ac2fd);}(_0xc8c3,0x1c1));var _0x3c8c=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xc8c3[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require(_0x3c8c('0x0'));var util=require(_0x3c8c('0x1'));var logger=require(_0x3c8c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3c8c('0x3'));var rp=require(_0x3c8c('0x4'));var fs=require('fs');var path=require(_0x3c8c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3c8c('0x6'));module[_0x3c8c('0x7')]=function(_0xa99947,_0x5e1173){return _0xa99947['define']('ChatApplication',attributes,{'tableName':_0x3c8c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c8c('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0a6ee56..21cca2f 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 _0xc9e0=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3a8697,_0x4e39e8){var _0xa4c873=function(_0x3479aa){while(--_0x3479aa){_0x3a8697['push'](_0x3a8697['shift']());}};_0xa4c873(++_0x4e39e8);}(_0xc9e0,0x69));var _0x0c9e=function(_0xfd46cf,_0x23c059){_0xfd46cf=_0xfd46cf-0x0;var _0x4166c0=_0xc9e0[_0xfd46cf];return _0x4166c0;};'use strict';var _=require(_0x0c9e('0x0'));var util=require('util');var moment=require(_0x0c9e('0x1'));var BPromise=require(_0x0c9e('0x2'));var rs=require(_0x0c9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c9e('0x4'))['db'];var utils=require(_0x0c9e('0x5'));var logger=require(_0x0c9e('0x6'))('rpc');var config=require(_0x0c9e('0x7'));var jayson=require(_0x0c9e('0x8'));var client=jayson[_0x0c9e('0x9')][_0x0c9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29e6b1,_0x50b33d,_0x48917b){return new BPromise(function(_0x3ba4ec,_0x3ca3cd){return client[_0x0c9e('0xb')](_0x29e6b1,_0x48917b)[_0x0c9e('0xc')](function(_0x3828d2){logger['info'](_0x0c9e('0xd'),_0x50b33d,'request\x20sent');logger[_0x0c9e('0xe')](_0x0c9e('0xf'),_0x50b33d,_0x0c9e('0x10'),JSON[_0x0c9e('0x11')](_0x3828d2));if(_0x3828d2[_0x0c9e('0x12')]){if(_0x3828d2[_0x0c9e('0x12')]['code']===0x1f4){logger['error'](_0x0c9e('0xd'),_0x50b33d,_0x3828d2[_0x0c9e('0x12')][_0x0c9e('0x13')]);return _0x3ca3cd(_0x3828d2[_0x0c9e('0x12')][_0x0c9e('0x13')]);}logger[_0x0c9e('0x12')](_0x0c9e('0xd'),_0x50b33d,_0x3828d2[_0x0c9e('0x12')]['message']);return _0x3ba4ec(_0x3828d2[_0x0c9e('0x12')]['message']);}else{logger[_0x0c9e('0x14')]('ChatApplication,\x20%s,\x20%s',_0x50b33d,_0x0c9e('0x10'));_0x3ba4ec(_0x3828d2[_0x0c9e('0x15')][_0x0c9e('0x13')]);}})['catch'](function(_0x403fe7){logger[_0x0c9e('0x12')]('ChatApplication,\x20%s,\x20%s',_0x50b33d,_0x403fe7);_0x3ca3cd(_0x403fe7);});});}
\ No newline at end of file
+var _0xef2f=['rpc','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ba1e8,_0xba5705){var _0x157c6b=function(_0x5c7d09){while(--_0x5c7d09){_0x5ba1e8['push'](_0x5ba1e8['shift']());}};_0x157c6b(++_0xba5705);}(_0xef2f,0x1a8));var _0xfef2=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xef2f[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xfef2('0x0'));var util=require(_0xfef2('0x1'));var moment=require(_0xfef2('0x2'));var BPromise=require(_0xfef2('0x3'));var rs=require(_0xfef2('0x4'));var fs=require('fs');var Redis=require(_0xfef2('0x5'));var db=require(_0xfef2('0x6'))['db'];var utils=require(_0xfef2('0x7'));var logger=require('../../config/logger')(_0xfef2('0x8'));var config=require('../../config/environment');var jayson=require(_0xfef2('0x9'));var client=jayson[_0xfef2('0xa')][_0xfef2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bb23e,_0x2ce403,_0x5c3941){return new BPromise(function(_0x1a3945,_0x171a12){return client[_0xfef2('0xc')](_0x2bb23e,_0x5c3941)[_0xfef2('0xd')](function(_0x9012e2){logger[_0xfef2('0xe')]('ChatApplication,\x20%s,\x20%s',_0x2ce403,'request\x20sent');logger[_0xfef2('0xf')](_0xfef2('0x10'),_0x2ce403,_0xfef2('0x11'),JSON[_0xfef2('0x12')](_0x9012e2));if(_0x9012e2['error']){if(_0x9012e2['error'][_0xfef2('0x13')]===0x1f4){logger[_0xfef2('0x14')](_0xfef2('0x15'),_0x2ce403,_0x9012e2[_0xfef2('0x14')]['message']);return _0x171a12(_0x9012e2[_0xfef2('0x14')][_0xfef2('0x16')]);}logger[_0xfef2('0x14')]('ChatApplication,\x20%s,\x20%s',_0x2ce403,_0x9012e2[_0xfef2('0x14')]['message']);return _0x1a3945(_0x9012e2[_0xfef2('0x14')][_0xfef2('0x16')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2ce403,_0xfef2('0x11'));_0x1a3945(_0x9012e2['result'][_0xfef2('0x16')]);}})[_0xfef2('0x17')](function(_0x25e729){logger['error'](_0xfef2('0x15'),_0x2ce403,_0x25e729);_0x171a12(_0x25e729);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3dcc354..81bfd73 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 _0xcb0b=['../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x4b9ac2,_0x1c9186){var _0x497723=function(_0x361fd0){while(--_0x361fd0){_0x4b9ac2['push'](_0x4b9ac2['shift']());}};_0x497723(++_0x1c9186);}(_0xcb0b,0x7b));var _0xbcb0=function(_0x2c80bc,_0xcd0e94){_0x2c80bc=_0x2c80bc-0x0;var _0x2cf25b=_0xcb0b[_0x2c80bc];return _0x2cf25b;};'use strict';var multer=require('multer');var util=require(_0xbcb0('0x0'));var path=require(_0xbcb0('0x1'));var timeout=require(_0xbcb0('0x2'));var express=require(_0xbcb0('0x3'));var router=express[_0xbcb0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbcb0('0x5'));var interaction=require(_0xbcb0('0x6'));var config=require('../../config/environment');var controller=require(_0xbcb0('0x7'));router[_0xbcb0('0x8')](_0xbcb0('0x9'),auth[_0xbcb0('0xa')](),controller[_0xbcb0('0xb')]);router[_0xbcb0('0xc')](_0xbcb0('0x9'),auth[_0xbcb0('0xa')](),controller[_0xbcb0('0xd')]);router[_0xbcb0('0xe')](_0xbcb0('0x9'),auth[_0xbcb0('0xa')](),controller['destroy']);module[_0xbcb0('0xf')]=router;
\ No newline at end of file
+var _0x05a8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','update','delete','/:id','destroy','exports','util'];(function(_0xa1e030,_0x579969){var _0x1619bb=function(_0x108f53){while(--_0x108f53){_0xa1e030['push'](_0xa1e030['shift']());}};_0x1619bb(++_0x579969);}(_0x05a8,0x1cf));var _0x805a=function(_0x2adb04,_0x4d4356){_0x2adb04=_0x2adb04-0x0;var _0x3c1bca=_0x05a8[_0x2adb04];return _0x3c1bca;};'use strict';var multer=require('multer');var util=require(_0x805a('0x0'));var path=require('path');var timeout=require(_0x805a('0x1'));var express=require(_0x805a('0x2'));var router=express[_0x805a('0x3')]();var fs_extra=require(_0x805a('0x4'));var auth=require(_0x805a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x805a('0x6'));var controller=require(_0x805a('0x7'));router[_0x805a('0x8')]('/:id',auth[_0x805a('0x9')](),controller[_0x805a('0xa')]);router['put']('/:id',auth[_0x805a('0x9')](),controller[_0x805a('0xb')]);router[_0x805a('0xc')](_0x805a('0xd'),auth['isAuthenticated'](),controller[_0x805a('0xe')]);module[_0x805a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 5b67bee..08ff359 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 _0xd050=['exports','STRING','BOOLEAN','sequelize'];(function(_0x7d5b1b,_0x20e692){var _0x51988c=function(_0x4b8e77){while(--_0x4b8e77){_0x7d5b1b['push'](_0x7d5b1b['shift']());}};_0x51988c(++_0x20e692);}(_0xd050,0x11f));var _0x0d05=function(_0x107e91,_0x5e8760){_0x107e91=_0x107e91-0x0;var _0x962f7a=_0xd050[_0x107e91];return _0x962f7a;};'use strict';var Sequelize=require(_0x0d05('0x0'));module[_0x0d05('0x1')]={'name':{'type':Sequelize[_0x0d05('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0d05('0x2')]},'write':{'type':Sequelize[_0x0d05('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x62f1=['BOOLEAN','sequelize','STRING'];(function(_0x3ec0dd,_0x3a5e67){var _0x2818c7=function(_0x1f8166){while(--_0x1f8166){_0x3ec0dd['push'](_0x3ec0dd['shift']());}};_0x2818c7(++_0x3a5e67);}(_0x62f1,0x112));var _0x162f=function(_0x2d2a1a,_0x106fa7){_0x2d2a1a=_0x2d2a1a-0x0;var _0x5b1508=_0x62f1[_0x2d2a1a];return _0x5b1508;};'use strict';var Sequelize=require(_0x162f('0x0'));module['exports']={'name':{'type':Sequelize[_0x162f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x162f('0x1')]},'write':{'type':Sequelize[_0x162f('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 461d9b0..9e1cc43 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 _0xf83a=['intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','merge','options','where','findAll','rows','params','keys','length','includeAll','include','find','catch','create','body','describe','ChatInternalMessage','user','addMembers','omit','ids','getMembers','findOne','User','sort','map','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','query','filters'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xf83a,0x1b6));var _0xaf83=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xf83a[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0xaf83('0x0'));var rimraf=require(_0xaf83('0x1'));var zipdir=require(_0xaf83('0x2'));var jsonpatch=require(_0xaf83('0x3'));var rp=require(_0xaf83('0x4'));var moment=require('moment');var BPromise=require(_0xaf83('0x5'));var Mustache=require(_0xaf83('0x6'));var util=require(_0xaf83('0x7'));var path=require(_0xaf83('0x8'));var sox=require(_0xaf83('0x9'));var csv=require(_0xaf83('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf83('0xb'));var squel=require(_0xaf83('0xc'));var crypto=require(_0xaf83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaf83('0xe'));var toCsv=require(_0xaf83('0xa'));var querystring=require(_0xaf83('0xf'));var Papa=require('papaparse');var Redis=require(_0xaf83('0x10'));var authService=require(_0xaf83('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf83('0x12'));var hardwareService=require(_0xaf83('0x13'));var logger=require('../../config/logger')(_0xaf83('0x14'));var utils=require(_0xaf83('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf83('0x16'));var db=require(_0xaf83('0x17'))['db'];config[_0xaf83('0x18')]=_[_0xaf83('0x19')](config[_0xaf83('0x18')],{'host':_0xaf83('0x1a'),'port':0x18eb});var socket=require(_0xaf83('0x1b'))(new Redis(config[_0xaf83('0x18')]));require(_0xaf83('0x1c'))[_0xaf83('0x1d')](socket);function respondWithStatusCode(_0x285542,_0x478a50){_0x478a50=_0x478a50||0xcc;return function(_0x493827){if(_0x493827){return _0x285542[_0xaf83('0x1e')](_0x478a50);}return _0x285542['status'](_0x478a50)[_0xaf83('0x1f')]();};}function respondWithResult(_0x19df11,_0x4d8d08){_0x4d8d08=_0x4d8d08||0xc8;return function(_0x1f56ab){if(_0x1f56ab){return _0x19df11['status'](_0x4d8d08)[_0xaf83('0x20')](_0x1f56ab);}};}function respondWithFilteredResult(_0x3b9f03,_0x4b4cb3){return function(_0x31f9a3){if(_0x31f9a3){var _0x29f2e6=typeof _0x4b4cb3[_0xaf83('0x21')]===_0xaf83('0x22')&&typeof _0x4b4cb3[_0xaf83('0x23')]===_0xaf83('0x22');var _0x36fb05=_0x31f9a3['count'];var _0x42b784=_0x29f2e6?0x0:_0x4b4cb3[_0xaf83('0x21')];var _0x239958=_0x29f2e6?_0x31f9a3[_0xaf83('0x24')]:_0x4b4cb3['offset']+_0x4b4cb3[_0xaf83('0x23')];var _0x5d76c3;if(_0x239958>=_0x36fb05){_0x239958=_0x36fb05;_0x5d76c3=0xc8;}else{_0x5d76c3=0xce;}_0x3b9f03[_0xaf83('0x25')](_0x5d76c3);return _0x3b9f03[_0xaf83('0x26')](_0xaf83('0x27'),_0x42b784+'-'+_0x239958+'/'+_0x36fb05)[_0xaf83('0x20')](_0x31f9a3);}return null;};}function patchUpdates(_0x322e58){return function(_0x36ec74){try{jsonpatch[_0xaf83('0x28')](_0x36ec74,_0x322e58,!![]);}catch(_0x307e49){return BPromise[_0xaf83('0x29')](_0x307e49);}return _0x36ec74['save']();};}function saveUpdates(_0x3d06ef,_0x20fa29){return function(_0x1d8fac){if(_0x1d8fac){return _0x1d8fac[_0xaf83('0x2a')](_0x3d06ef)['then'](function(_0x391925){return _0x391925;});}return null;};}function removeEntity(_0x1c1f50,_0x512249){return function(_0xdca149){if(_0xdca149){return _0xdca149[_0xaf83('0x2b')]()[_0xaf83('0x2c')](function(){_0x1c1f50['status'](0xcc)[_0xaf83('0x1f')]();});}};}function handleEntityNotFound(_0x798087,_0x36e2f3){return function(_0x25156e){if(!_0x25156e){_0x798087[_0xaf83('0x1e')](0x194);}return _0x25156e;};}function handleError(_0x16703a,_0x3ed681){_0x3ed681=_0x3ed681||0x1f4;return function(_0x104e5a){logger[_0xaf83('0x2d')](_0x104e5a[_0xaf83('0x2e')]);if(_0x104e5a['name']){delete _0x104e5a[_0xaf83('0x2f')];}_0x16703a['status'](_0x3ed681)[_0xaf83('0x30')](_0x104e5a);};}exports[_0xaf83('0x31')]=function(_0x18fc8f,_0x45663d){var _0x36912c={},_0x4d32a5={},_0x32198e={'count':0x0,'rows':[]};var _0x4ece2d=_['map'](db[_0xaf83('0x32')][_0xaf83('0x33')],function(_0x503d6c){return{'name':_0x503d6c[_0xaf83('0x34')],'type':_0x503d6c[_0xaf83('0x35')][_0xaf83('0x36')]};});_0x4d32a5['model']=_['map'](_0x4ece2d,'name');_0x4d32a5[_0xaf83('0x37')]=_['keys'](_0x18fc8f['query']);_0x4d32a5[_0xaf83('0x38')]=_[_0xaf83('0x39')](_0x4d32a5[_0xaf83('0x3a')],_0x4d32a5[_0xaf83('0x37')]);_0x36912c[_0xaf83('0x3b')]=_['intersection'](_0x4d32a5['model'],qs[_0xaf83('0x3c')](_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x3c')]));_0x36912c[_0xaf83('0x3b')]=_0x36912c['attributes']['length']?_0x36912c[_0xaf83('0x3b')]:_0x4d32a5[_0xaf83('0x3a')];if(!_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x3d')](_0xaf83('0x3e'))){_0x36912c[_0xaf83('0x23')]=qs['limit'](_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x23')]);_0x36912c[_0xaf83('0x21')]=qs['offset'](_0x18fc8f['query'][_0xaf83('0x21')]);}_0x36912c[_0xaf83('0x3f')]=qs['sort'](_0x18fc8f['query']['sort']);_0x36912c['where']=qs['filters'](_[_0xaf83('0x40')](_0x18fc8f[_0xaf83('0x37')],_0x4d32a5[_0xaf83('0x38')]),_0x4ece2d);if(_0x18fc8f[_0xaf83('0x37')][_0xaf83('0x41')]){_0x36912c['where']=_['merge'](_0x36912c['where'],{'$or':_['map'](_0x4ece2d,function(_0x16308b){if(_0x16308b[_0xaf83('0x35')]!=='VIRTUAL'){var _0x19b56f={};_0x19b56f[_0x16308b['name']]={'$like':'%'+_0x18fc8f['query'][_0xaf83('0x41')]+'%'};return _0x19b56f;}})});}_0x36912c=_[_0xaf83('0x42')]({},_0x36912c,_0x18fc8f[_0xaf83('0x43')]);var _0x4f2fc7={'where':_0x36912c[_0xaf83('0x44')]};return db[_0xaf83('0x32')]['count'](_0x4f2fc7)[_0xaf83('0x2c')](function(_0x488e50){_0x32198e[_0xaf83('0x24')]=_0x488e50;if(_0x18fc8f[_0xaf83('0x37')]['includeAll']){_0x36912c['include']=[{'all':!![]}];}return db['ChatGroup'][_0xaf83('0x45')](_0x36912c);})[_0xaf83('0x2c')](function(_0xa86fdf){_0x32198e[_0xaf83('0x46')]=_0xa86fdf;return _0x32198e;})['then'](respondWithFilteredResult(_0x45663d,_0x36912c))['catch'](handleError(_0x45663d,null));};exports['show']=function(_0x451435,_0x4b0f6e){var _0xfe897c={'raw':!![],'where':{'id':_0x451435[_0xaf83('0x47')]['id']}},_0x49d9ff={};_0x49d9ff['model']=_[_0xaf83('0x48')](db['ChatGroup']['rawAttributes']);_0x49d9ff['query']=_[_0xaf83('0x48')](_0x451435['query']);_0x49d9ff[_0xaf83('0x38')]=_['intersection'](_0x49d9ff[_0xaf83('0x3a')],_0x49d9ff['query']);_0xfe897c[_0xaf83('0x3b')]=_[_0xaf83('0x39')](_0x49d9ff[_0xaf83('0x3a')],qs[_0xaf83('0x3c')](_0x451435['query'][_0xaf83('0x3c')]));_0xfe897c[_0xaf83('0x3b')]=_0xfe897c['attributes'][_0xaf83('0x49')]?_0xfe897c[_0xaf83('0x3b')]:_0x49d9ff[_0xaf83('0x3a')];if(_0x451435[_0xaf83('0x37')][_0xaf83('0x4a')]){_0xfe897c[_0xaf83('0x4b')]=[{'all':!![]}];}_0xfe897c=_[_0xaf83('0x42')]({},_0xfe897c,_0x451435['options']);return db[_0xaf83('0x32')][_0xaf83('0x4c')](_0xfe897c)['then'](handleEntityNotFound(_0x4b0f6e,null))[_0xaf83('0x2c')](respondWithResult(_0x4b0f6e,null))[_0xaf83('0x4d')](handleError(_0x4b0f6e,null));};exports[_0xaf83('0x4e')]=function(_0x5dbead,_0x1cdbf5){return db['ChatGroup'][_0xaf83('0x4e')](_0x5dbead['body'],{})[_0xaf83('0x2c')](respondWithResult(_0x1cdbf5,0xc9))[_0xaf83('0x4d')](handleError(_0x1cdbf5,null));};exports[_0xaf83('0x2a')]=function(_0x5991ea,_0x7397a3){if(_0x5991ea['body']['id']){delete _0x5991ea[_0xaf83('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5991ea[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x7397a3,null))[_0xaf83('0x2c')](saveUpdates(_0x5991ea[_0xaf83('0x4f')],null))[_0xaf83('0x2c')](respondWithResult(_0x7397a3,null))[_0xaf83('0x4d')](handleError(_0x7397a3,null));};exports[_0xaf83('0x2b')]=function(_0x46d2bb,_0x1f6726){return db[_0xaf83('0x32')]['find']({'where':{'id':_0x46d2bb['params']['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x1f6726,null))[_0xaf83('0x2c')](removeEntity(_0x1f6726,null))['catch'](handleError(_0x1f6726,null));};exports[_0xaf83('0x50')]=function(_0x3d9724,_0x13769f){return db[_0xaf83('0x32')][_0xaf83('0x50')]()['then'](respondWithResult(_0x13769f,null))[_0xaf83('0x4d')](handleError(_0x13769f,null));};exports['getUnread']=function(_0x3b9a85,_0x434f29,_0x107b1f){return db[_0xaf83('0x51')]['count']({'where':{'ChatGroupId':_0x3b9a85[_0xaf83('0x47')]['id'],'ToId':_0x3b9a85[_0xaf83('0x52')]['id'],'read':![]}})[_0xaf83('0x2c')](function(_0x4f76c1){return{'id':_['toInteger'](_0x3b9a85[_0xaf83('0x47')]['id']),'count':_0x4f76c1};})[_0xaf83('0x2c')](respondWithResult(_0x434f29,null))[_0xaf83('0x4d')](handleError(_0x434f29,null));};exports['addMembers']=function(_0x5f5d97,_0x37a737,_0x2d3fd5){return db[_0xaf83('0x32')][_0xaf83('0x4c')]({'where':{'id':_0x5f5d97[_0xaf83('0x47')]['id']}})['then'](handleEntityNotFound(_0x37a737,null))[_0xaf83('0x2c')](function(_0x5594b0){if(_0x5594b0){return _0x5594b0[_0xaf83('0x53')](_0x5f5d97[_0xaf83('0x4f')]['ids'],_[_0xaf83('0x54')](_0x5f5d97[_0xaf83('0x4f')],[_0xaf83('0x55'),'id'])||{});}})[_0xaf83('0x2c')](respondWithResult(_0x37a737,null))[_0xaf83('0x4d')](handleError(_0x37a737,null));};exports[_0xaf83('0x56')]=function(_0x137066,_0x2629fb,_0x21bfd5){var _0xe6a46a={};var _0x1dfc34={};var _0x4b56f5;var _0x7380d;return db['ChatGroup'][_0xaf83('0x57')]({'where':{'id':_0x137066[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x2629fb,null))[_0xaf83('0x2c')](function(_0x5b1682){if(_0x5b1682){_0x4b56f5=_0x5b1682;_0x1dfc34[_0xaf83('0x3a')]=_['keys'](db[_0xaf83('0x58')][_0xaf83('0x33')]);_0x1dfc34[_0xaf83('0x37')]=_[_0xaf83('0x48')](_0x137066[_0xaf83('0x37')]);_0x1dfc34[_0xaf83('0x38')]=_[_0xaf83('0x39')](_0x1dfc34[_0xaf83('0x3a')],_0x1dfc34[_0xaf83('0x37')]);_0xe6a46a[_0xaf83('0x3b')]=_[_0xaf83('0x39')](_0x1dfc34[_0xaf83('0x3a')],qs['fields'](_0x137066[_0xaf83('0x37')][_0xaf83('0x3c')]));_0xe6a46a[_0xaf83('0x3b')]=_0xe6a46a[_0xaf83('0x3b')]['length']?_0xe6a46a[_0xaf83('0x3b')]:_0x1dfc34['model'];_0xe6a46a[_0xaf83('0x3f')]=qs[_0xaf83('0x59')](_0x137066[_0xaf83('0x37')][_0xaf83('0x59')]);_0xe6a46a['where']=qs[_0xaf83('0x38')](_[_0xaf83('0x40')](_0x137066[_0xaf83('0x37')],_0x1dfc34['filters']));if(_0x137066[_0xaf83('0x37')][_0xaf83('0x41')]){_0xe6a46a[_0xaf83('0x44')]=_[_0xaf83('0x42')](_0xe6a46a[_0xaf83('0x44')],{'$or':_[_0xaf83('0x5a')](_0xe6a46a[_0xaf83('0x3b')],function(_0x115d15){var _0x330c19={};_0x330c19[_0x115d15]={'$like':'%'+_0x137066['query']['filter']+'%'};return _0x330c19;})});}_0xe6a46a=_['merge']({},_0xe6a46a,_0x137066[_0xaf83('0x43')]);return _0x4b56f5['getMembers'](_0xe6a46a);}})[_0xaf83('0x2c')](function(_0x64eb24){if(_0x64eb24){_0x7380d=_0x64eb24['length'];if(!_0x137066[_0xaf83('0x37')][_0xaf83('0x3d')]('nolimit')){_0xe6a46a[_0xaf83('0x23')]=qs[_0xaf83('0x23')](_0x137066[_0xaf83('0x37')][_0xaf83('0x23')]);_0xe6a46a['offset']=qs[_0xaf83('0x21')](_0x137066[_0xaf83('0x37')][_0xaf83('0x21')]);}return _0x4b56f5[_0xaf83('0x56')](_0xe6a46a);}})['then'](function(_0x57a811){if(_0x57a811){return _0x57a811?{'count':_0x7380d,'rows':_0x57a811}:null;}})['then'](respondWithResult(_0x2629fb,null))[_0xaf83('0x4d')](handleError(_0x2629fb,null));};exports[_0xaf83('0x5b')]=function(_0x51b478,_0x43e026,_0x69d31c){return db[_0xaf83('0x32')][_0xaf83('0x4c')]({'where':{'id':_0x51b478[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x43e026,null))[_0xaf83('0x2c')](function(_0x10b63f){if(_0x10b63f){return _0x10b63f[_0xaf83('0x5b')](_0x51b478['query'][_0xaf83('0x55')]);}})[_0xaf83('0x2c')](respondWithStatusCode(_0x43e026,null))[_0xaf83('0x4d')](handleError(_0x43e026,null));};exports[_0xaf83('0x5c')]=function(_0x257e58,_0x3dc420,_0x4a1228){if(_0x257e58['body']['id']){delete _0x257e58[_0xaf83('0x4f')]['id'];}return db[_0xaf83('0x32')][_0xaf83('0x4c')]({'where':{'id':_0x257e58[_0xaf83('0x47')]['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x3dc420,null))['then'](function(_0x2e4cd7){if(_0x2e4cd7){_0x257e58[_0xaf83('0x4f')][_0xaf83('0x5d')]=_0x2e4cd7['id'];return db[_0xaf83('0x51')][_0xaf83('0x4e')](_0x257e58[_0xaf83('0x4f')]);}})[_0xaf83('0x2c')](respondWithResult(_0x3dc420,null))[_0xaf83('0x4d')](handleError(_0x3dc420,null));};exports[_0xaf83('0x5e')]=function(_0x2bd959,_0x3b8fdf,_0x527645){var _0xb773a1={};var _0x59d987={};var _0x3d86de;var _0x82bb07;return db[_0xaf83('0x32')]['findOne']({'where':{'id':_0x2bd959['params']['id']}})[_0xaf83('0x2c')](handleEntityNotFound(_0x3b8fdf,null))[_0xaf83('0x2c')](function(_0x2d77fd){if(_0x2d77fd){_0x3d86de=_0x2d77fd;_0x59d987['model']=_[_0xaf83('0x48')](db[_0xaf83('0x51')][_0xaf83('0x33')]);_0x59d987[_0xaf83('0x37')]=_['keys'](_0x2bd959['query']);_0x59d987[_0xaf83('0x38')]=_['intersection'](_0x59d987[_0xaf83('0x3a')],_0x59d987[_0xaf83('0x37')]);_0xb773a1[_0xaf83('0x3b')]=_[_0xaf83('0x39')](_0x59d987['model'],qs[_0xaf83('0x3c')](_0x2bd959[_0xaf83('0x37')]['fields']));_0xb773a1[_0xaf83('0x3b')]=_0xb773a1[_0xaf83('0x3b')]['length']?_0xb773a1['attributes']:_0x59d987[_0xaf83('0x3a')];_0xb773a1['order']=qs[_0xaf83('0x59')](_0x2bd959['query'][_0xaf83('0x59')]);_0xb773a1['where']=qs[_0xaf83('0x38')](_['pick'](_0x2bd959[_0xaf83('0x37')],_0x59d987['filters']));if(_0x2bd959[_0xaf83('0x37')]['filter']){_0xb773a1[_0xaf83('0x44')]=_['merge'](_0xb773a1[_0xaf83('0x44')],{'$or':_[_0xaf83('0x5a')](_0xb773a1['attributes'],function(_0x4d5ff2){var _0xc16ddc={};_0xc16ddc[_0x4d5ff2]={'$like':'%'+_0x2bd959[_0xaf83('0x37')][_0xaf83('0x41')]+'%'};return _0xc16ddc;})});}if(_0x2bd959[_0xaf83('0x37')]['$gte']){var _0x2905fe=_0x2bd959['query'][_0xaf83('0x5f')][_0xaf83('0x60')](',');var _0x4d95ad={};_0x4d95ad[_0x2905fe[0x0]]={'$gte':moment(_0x2905fe[0x1])[_0xaf83('0x61')](_0xaf83('0x62'))};_0xb773a1['where']=_['merge'](_0xb773a1[_0xaf83('0x44')],_0x4d95ad);}_0xb773a1=_[_0xaf83('0x42')]({},_0xb773a1,_0x2bd959['options']);return _0x3d86de[_0xaf83('0x5e')](_0xb773a1);}})[_0xaf83('0x2c')](function(_0x3ef90b){if(_0x3ef90b){_0x82bb07=_0x3ef90b['length'];if(!_0x2bd959['query']['hasOwnProperty'](_0xaf83('0x3e'))){_0xb773a1[_0xaf83('0x23')]=qs['limit'](_0x2bd959['query'][_0xaf83('0x23')]);_0xb773a1[_0xaf83('0x21')]=qs[_0xaf83('0x21')](_0x2bd959[_0xaf83('0x37')]['offset']);}return _0x3d86de[_0xaf83('0x5e')](_0xb773a1);}})['then'](function(_0x1455fa){if(_0x1455fa){return _0x1455fa?{'count':_0x82bb07,'rows':_0x1455fa}:null;}})[_0xaf83('0x2c')](respondWithResult(_0x3b8fdf,null))[_0xaf83('0x4d')](handleError(_0x3b8fdf,null));};
\ No newline at end of file
+var _0x27b9=['ChatGroup','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','options','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','error','name','send','map'];(function(_0x185ce6,_0x80b049){var _0xb2b554=function(_0x132348){while(--_0x132348){_0x185ce6['push'](_0x185ce6['shift']());}};_0xb2b554(++_0x80b049);}(_0x27b9,0x1b4));var _0x927b=function(_0x28038f,_0x492076){_0x28038f=_0x28038f-0x0;var _0x3b16b8=_0x27b9[_0x28038f];return _0x3b16b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x927b('0x0'));var zipdir=require(_0x927b('0x1'));var jsonpatch=require(_0x927b('0x2'));var rp=require(_0x927b('0x3'));var moment=require(_0x927b('0x4'));var BPromise=require(_0x927b('0x5'));var Mustache=require(_0x927b('0x6'));var util=require(_0x927b('0x7'));var path=require(_0x927b('0x8'));var sox=require(_0x927b('0x9'));var csv=require(_0x927b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x927b('0xb'));var _=require(_0x927b('0xc'));var squel=require(_0x927b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x927b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x927b('0xf'));var Papa=require(_0x927b('0x10'));var Redis=require('ioredis');var authService=require(_0x927b('0x11'));var qs=require(_0x927b('0x12'));var as=require(_0x927b('0x13'));var hardwareService=require(_0x927b('0x14'));var logger=require(_0x927b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x927b('0x16'));var licenseUtil=require(_0x927b('0x17'));var db=require(_0x927b('0x18'))['db'];config[_0x927b('0x19')]=_[_0x927b('0x1a')](config[_0x927b('0x19')],{'host':_0x927b('0x1b'),'port':0x18eb});var socket=require(_0x927b('0x1c'))(new Redis(config['redis']));require(_0x927b('0x1d'))[_0x927b('0x1e')](socket);function respondWithStatusCode(_0x570210,_0x199703){_0x199703=_0x199703||0xcc;return function(_0x36da10){if(_0x36da10){return _0x570210[_0x927b('0x1f')](_0x199703);}return _0x570210[_0x927b('0x20')](_0x199703)['end']();};}function respondWithResult(_0xd79cef,_0x74bdb3){_0x74bdb3=_0x74bdb3||0xc8;return function(_0x2dda33){if(_0x2dda33){return _0xd79cef[_0x927b('0x20')](_0x74bdb3)[_0x927b('0x21')](_0x2dda33);}};}function respondWithFilteredResult(_0x39a672,_0x31f601){return function(_0x1c90a2){if(_0x1c90a2){var _0x4a1857=typeof _0x31f601[_0x927b('0x22')]===_0x927b('0x23')&&typeof _0x31f601[_0x927b('0x24')]==='undefined';var _0xa4f28d=_0x1c90a2[_0x927b('0x25')];var _0x2fc4c2=_0x4a1857?0x0:_0x31f601[_0x927b('0x22')];var _0x26dea2=_0x4a1857?_0x1c90a2[_0x927b('0x25')]:_0x31f601[_0x927b('0x22')]+_0x31f601[_0x927b('0x24')];var _0x3ee984;if(_0x26dea2>=_0xa4f28d){_0x26dea2=_0xa4f28d;_0x3ee984=0xc8;}else{_0x3ee984=0xce;}_0x39a672['status'](_0x3ee984);return _0x39a672['set'](_0x927b('0x26'),_0x2fc4c2+'-'+_0x26dea2+'/'+_0xa4f28d)[_0x927b('0x21')](_0x1c90a2);}return null;};}function patchUpdates(_0x1d14c7){return function(_0x351fed){try{jsonpatch[_0x927b('0x27')](_0x351fed,_0x1d14c7,!![]);}catch(_0x147ee2){return BPromise[_0x927b('0x28')](_0x147ee2);}return _0x351fed['save']();};}function saveUpdates(_0x158d32,_0x2dcdf8){return function(_0x11b5b9){if(_0x11b5b9){return _0x11b5b9[_0x927b('0x29')](_0x158d32)['then'](function(_0x5b1e6b){return _0x5b1e6b;});}return null;};}function removeEntity(_0x131836,_0x2a43ab){return function(_0x3af4df){if(_0x3af4df){return _0x3af4df[_0x927b('0x2a')]()[_0x927b('0x2b')](function(){_0x131836[_0x927b('0x20')](0xcc)[_0x927b('0x2c')]();});}};}function handleEntityNotFound(_0x5df266,_0x212943){return function(_0x3e5d99){if(!_0x3e5d99){_0x5df266[_0x927b('0x1f')](0x194);}return _0x3e5d99;};}function handleError(_0x631734,_0x26e644){_0x26e644=_0x26e644||0x1f4;return function(_0x143e56){logger[_0x927b('0x2d')](_0x143e56['stack']);if(_0x143e56[_0x927b('0x2e')]){delete _0x143e56[_0x927b('0x2e')];}_0x631734[_0x927b('0x20')](_0x26e644)[_0x927b('0x2f')](_0x143e56);};}exports['index']=function(_0x27775a,_0x185369){var _0x44155e={},_0x2333e0={},_0x499996={'count':0x0,'rows':[]};var _0x4691e1=_[_0x927b('0x30')](db[_0x927b('0x31')][_0x927b('0x32')],function(_0x188f91){return{'name':_0x188f91[_0x927b('0x33')],'type':_0x188f91[_0x927b('0x34')][_0x927b('0x35')]};});_0x2333e0['model']=_['map'](_0x4691e1,_0x927b('0x2e'));_0x2333e0['query']=_[_0x927b('0x36')](_0x27775a[_0x927b('0x37')]);_0x2333e0[_0x927b('0x38')]=_[_0x927b('0x39')](_0x2333e0[_0x927b('0x3a')],_0x2333e0['query']);_0x44155e['attributes']=_[_0x927b('0x39')](_0x2333e0[_0x927b('0x3a')],qs[_0x927b('0x3b')](_0x27775a['query'][_0x927b('0x3b')]));_0x44155e[_0x927b('0x3c')]=_0x44155e['attributes'][_0x927b('0x3d')]?_0x44155e[_0x927b('0x3c')]:_0x2333e0['model'];if(!_0x27775a[_0x927b('0x37')]['hasOwnProperty'](_0x927b('0x3e'))){_0x44155e[_0x927b('0x24')]=qs['limit'](_0x27775a[_0x927b('0x37')][_0x927b('0x24')]);_0x44155e[_0x927b('0x22')]=qs[_0x927b('0x22')](_0x27775a['query'][_0x927b('0x22')]);}_0x44155e[_0x927b('0x3f')]=qs[_0x927b('0x40')](_0x27775a[_0x927b('0x37')][_0x927b('0x40')]);_0x44155e[_0x927b('0x41')]=qs[_0x927b('0x38')](_['pick'](_0x27775a['query'],_0x2333e0[_0x927b('0x38')]),_0x4691e1);if(_0x27775a[_0x927b('0x37')]['filter']){_0x44155e[_0x927b('0x41')]=_[_0x927b('0x42')](_0x44155e[_0x927b('0x41')],{'$or':_[_0x927b('0x30')](_0x4691e1,function(_0x443254){if(_0x443254[_0x927b('0x34')]!==_0x927b('0x43')){var _0x629242={};_0x629242[_0x443254['name']]={'$like':'%'+_0x27775a['query'][_0x927b('0x44')]+'%'};return _0x629242;}})});}_0x44155e=_['merge']({},_0x44155e,_0x27775a['options']);var _0x64ea59={'where':_0x44155e['where']};return db[_0x927b('0x31')]['count'](_0x64ea59)[_0x927b('0x2b')](function(_0x239d4d){_0x499996['count']=_0x239d4d;if(_0x27775a[_0x927b('0x37')][_0x927b('0x45')]){_0x44155e[_0x927b('0x46')]=[{'all':!![]}];}return db[_0x927b('0x31')][_0x927b('0x47')](_0x44155e);})[_0x927b('0x2b')](function(_0x3dc4de){_0x499996[_0x927b('0x48')]=_0x3dc4de;return _0x499996;})[_0x927b('0x2b')](respondWithFilteredResult(_0x185369,_0x44155e))[_0x927b('0x49')](handleError(_0x185369,null));};exports['show']=function(_0x1987d3,_0x1b56f5){var _0x4c8647={'raw':!![],'where':{'id':_0x1987d3[_0x927b('0x4a')]['id']}},_0x2154e9={};_0x2154e9[_0x927b('0x3a')]=_[_0x927b('0x36')](db['ChatGroup'][_0x927b('0x32')]);_0x2154e9[_0x927b('0x37')]=_[_0x927b('0x36')](_0x1987d3['query']);_0x2154e9[_0x927b('0x38')]=_['intersection'](_0x2154e9[_0x927b('0x3a')],_0x2154e9['query']);_0x4c8647[_0x927b('0x3c')]=_[_0x927b('0x39')](_0x2154e9[_0x927b('0x3a')],qs[_0x927b('0x3b')](_0x1987d3['query']['fields']));_0x4c8647[_0x927b('0x3c')]=_0x4c8647[_0x927b('0x3c')][_0x927b('0x3d')]?_0x4c8647[_0x927b('0x3c')]:_0x2154e9[_0x927b('0x3a')];if(_0x1987d3['query'][_0x927b('0x45')]){_0x4c8647[_0x927b('0x46')]=[{'all':!![]}];}_0x4c8647=_[_0x927b('0x42')]({},_0x4c8647,_0x1987d3['options']);return db[_0x927b('0x31')]['find'](_0x4c8647)[_0x927b('0x2b')](handleEntityNotFound(_0x1b56f5,null))['then'](respondWithResult(_0x1b56f5,null))[_0x927b('0x49')](handleError(_0x1b56f5,null));};exports[_0x927b('0x4b')]=function(_0xc62228,_0xf2dadc){return db[_0x927b('0x31')][_0x927b('0x4b')](_0xc62228[_0x927b('0x4c')],{})[_0x927b('0x2b')](respondWithResult(_0xf2dadc,0xc9))['catch'](handleError(_0xf2dadc,null));};exports[_0x927b('0x29')]=function(_0x50ef8f,_0x49dcd2){if(_0x50ef8f[_0x927b('0x4c')]['id']){delete _0x50ef8f['body']['id'];}return db['ChatGroup'][_0x927b('0x4d')]({'where':{'id':_0x50ef8f[_0x927b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49dcd2,null))[_0x927b('0x2b')](saveUpdates(_0x50ef8f['body'],null))[_0x927b('0x2b')](respondWithResult(_0x49dcd2,null))['catch'](handleError(_0x49dcd2,null));};exports[_0x927b('0x2a')]=function(_0x3e85da,_0x41f90d){return db[_0x927b('0x31')][_0x927b('0x4d')]({'where':{'id':_0x3e85da[_0x927b('0x4a')]['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x41f90d,null))['then'](removeEntity(_0x41f90d,null))[_0x927b('0x49')](handleError(_0x41f90d,null));};exports[_0x927b('0x4e')]=function(_0x57ce48,_0x1f34bd){return db[_0x927b('0x31')][_0x927b('0x4e')]()['then'](respondWithResult(_0x1f34bd,null))[_0x927b('0x49')](handleError(_0x1f34bd,null));};exports[_0x927b('0x4f')]=function(_0xa2fa3,_0x1bffd9,_0x414fc7){return db[_0x927b('0x50')]['count']({'where':{'ChatGroupId':_0xa2fa3[_0x927b('0x4a')]['id'],'ToId':_0xa2fa3[_0x927b('0x51')]['id'],'read':![]}})[_0x927b('0x2b')](function(_0x16c365){return{'id':_[_0x927b('0x52')](_0xa2fa3[_0x927b('0x4a')]['id']),'count':_0x16c365};})[_0x927b('0x2b')](respondWithResult(_0x1bffd9,null))['catch'](handleError(_0x1bffd9,null));};exports[_0x927b('0x53')]=function(_0x1fc7e0,_0x2c9903,_0x52c597){return db[_0x927b('0x31')]['find']({'where':{'id':_0x1fc7e0[_0x927b('0x4a')]['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x2c9903,null))[_0x927b('0x2b')](function(_0x2467e4){if(_0x2467e4){return _0x2467e4[_0x927b('0x53')](_0x1fc7e0['body'][_0x927b('0x54')],_[_0x927b('0x55')](_0x1fc7e0[_0x927b('0x4c')],[_0x927b('0x54'),'id'])||{});}})['then'](respondWithResult(_0x2c9903,null))[_0x927b('0x49')](handleError(_0x2c9903,null));};exports[_0x927b('0x56')]=function(_0x3fcec8,_0x2f8e7c,_0x4ee55d){var _0x2f8427={};var _0x3e09f0={};var _0x2f8491;var _0x26de80;return db[_0x927b('0x31')][_0x927b('0x57')]({'where':{'id':_0x3fcec8[_0x927b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f8e7c,null))[_0x927b('0x2b')](function(_0x22fd30){if(_0x22fd30){_0x2f8491=_0x22fd30;_0x3e09f0[_0x927b('0x3a')]=_['keys'](db[_0x927b('0x58')][_0x927b('0x32')]);_0x3e09f0[_0x927b('0x37')]=_[_0x927b('0x36')](_0x3fcec8['query']);_0x3e09f0[_0x927b('0x38')]=_[_0x927b('0x39')](_0x3e09f0[_0x927b('0x3a')],_0x3e09f0['query']);_0x2f8427[_0x927b('0x3c')]=_[_0x927b('0x39')](_0x3e09f0['model'],qs[_0x927b('0x3b')](_0x3fcec8['query'][_0x927b('0x3b')]));_0x2f8427[_0x927b('0x3c')]=_0x2f8427['attributes'][_0x927b('0x3d')]?_0x2f8427[_0x927b('0x3c')]:_0x3e09f0['model'];_0x2f8427['order']=qs[_0x927b('0x40')](_0x3fcec8[_0x927b('0x37')][_0x927b('0x40')]);_0x2f8427[_0x927b('0x41')]=qs[_0x927b('0x38')](_[_0x927b('0x59')](_0x3fcec8[_0x927b('0x37')],_0x3e09f0[_0x927b('0x38')]));if(_0x3fcec8[_0x927b('0x37')]['filter']){_0x2f8427[_0x927b('0x41')]=_[_0x927b('0x42')](_0x2f8427[_0x927b('0x41')],{'$or':_[_0x927b('0x30')](_0x2f8427[_0x927b('0x3c')],function(_0x5c31b2){var _0x4d4135={};_0x4d4135[_0x5c31b2]={'$like':'%'+_0x3fcec8['query'][_0x927b('0x44')]+'%'};return _0x4d4135;})});}_0x2f8427=_[_0x927b('0x42')]({},_0x2f8427,_0x3fcec8[_0x927b('0x5a')]);return _0x2f8491[_0x927b('0x56')](_0x2f8427);}})[_0x927b('0x2b')](function(_0x363194){if(_0x363194){_0x26de80=_0x363194['length'];if(!_0x3fcec8['query'][_0x927b('0x5b')](_0x927b('0x3e'))){_0x2f8427['limit']=qs[_0x927b('0x24')](_0x3fcec8[_0x927b('0x37')][_0x927b('0x24')]);_0x2f8427[_0x927b('0x22')]=qs[_0x927b('0x22')](_0x3fcec8['query'][_0x927b('0x22')]);}return _0x2f8491[_0x927b('0x56')](_0x2f8427);}})[_0x927b('0x2b')](function(_0x627ace){if(_0x627ace){return _0x627ace?{'count':_0x26de80,'rows':_0x627ace}:null;}})[_0x927b('0x2b')](respondWithResult(_0x2f8e7c,null))[_0x927b('0x49')](handleError(_0x2f8e7c,null));};exports['removeMembers']=function(_0x4903ea,_0x2c86b4,_0x568ecb){return db[_0x927b('0x31')][_0x927b('0x4d')]({'where':{'id':_0x4903ea['params']['id']}})['then'](handleEntityNotFound(_0x2c86b4,null))[_0x927b('0x2b')](function(_0x3ada69){if(_0x3ada69){return _0x3ada69[_0x927b('0x5c')](_0x4903ea[_0x927b('0x37')][_0x927b('0x54')]);}})[_0x927b('0x2b')](respondWithStatusCode(_0x2c86b4,null))[_0x927b('0x49')](handleError(_0x2c86b4,null));};exports[_0x927b('0x5d')]=function(_0x441594,_0x4660c7,_0x156d3c){if(_0x441594[_0x927b('0x4c')]['id']){delete _0x441594['body']['id'];}return db[_0x927b('0x31')]['find']({'where':{'id':_0x441594[_0x927b('0x4a')]['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x4660c7,null))[_0x927b('0x2b')](function(_0x3d72a3){if(_0x3d72a3){_0x441594[_0x927b('0x4c')][_0x927b('0x5e')]=_0x3d72a3['id'];return db[_0x927b('0x50')][_0x927b('0x4b')](_0x441594[_0x927b('0x4c')]);}})['then'](respondWithResult(_0x4660c7,null))[_0x927b('0x49')](handleError(_0x4660c7,null));};exports[_0x927b('0x5f')]=function(_0x46c4e1,_0x575e4e,_0x34e9de){var _0x2b78b6={};var _0x95f7c4={};var _0x1fdf67;var _0x29b5fc;return db['ChatGroup']['findOne']({'where':{'id':_0x46c4e1['params']['id']}})[_0x927b('0x2b')](handleEntityNotFound(_0x575e4e,null))['then'](function(_0x2004ab){if(_0x2004ab){_0x1fdf67=_0x2004ab;_0x95f7c4[_0x927b('0x3a')]=_[_0x927b('0x36')](db[_0x927b('0x50')]['rawAttributes']);_0x95f7c4[_0x927b('0x37')]=_['keys'](_0x46c4e1['query']);_0x95f7c4[_0x927b('0x38')]=_[_0x927b('0x39')](_0x95f7c4[_0x927b('0x3a')],_0x95f7c4[_0x927b('0x37')]);_0x2b78b6[_0x927b('0x3c')]=_['intersection'](_0x95f7c4[_0x927b('0x3a')],qs[_0x927b('0x3b')](_0x46c4e1['query'][_0x927b('0x3b')]));_0x2b78b6[_0x927b('0x3c')]=_0x2b78b6[_0x927b('0x3c')][_0x927b('0x3d')]?_0x2b78b6[_0x927b('0x3c')]:_0x95f7c4['model'];_0x2b78b6[_0x927b('0x3f')]=qs[_0x927b('0x40')](_0x46c4e1[_0x927b('0x37')][_0x927b('0x40')]);_0x2b78b6['where']=qs[_0x927b('0x38')](_['pick'](_0x46c4e1['query'],_0x95f7c4[_0x927b('0x38')]));if(_0x46c4e1['query'][_0x927b('0x44')]){_0x2b78b6[_0x927b('0x41')]=_[_0x927b('0x42')](_0x2b78b6['where'],{'$or':_[_0x927b('0x30')](_0x2b78b6[_0x927b('0x3c')],function(_0x574986){var _0x38db8e={};_0x38db8e[_0x574986]={'$like':'%'+_0x46c4e1[_0x927b('0x37')][_0x927b('0x44')]+'%'};return _0x38db8e;})});}if(_0x46c4e1[_0x927b('0x37')]['$gte']){var _0x72de80=_0x46c4e1[_0x927b('0x37')]['$gte']['split'](',');var _0x277e68={};_0x277e68[_0x72de80[0x0]]={'$gte':moment(_0x72de80[0x1])['format'](_0x927b('0x60'))};_0x2b78b6[_0x927b('0x41')]=_['merge'](_0x2b78b6['where'],_0x277e68);}_0x2b78b6=_['merge']({},_0x2b78b6,_0x46c4e1['options']);return _0x1fdf67['getMessages'](_0x2b78b6);}})[_0x927b('0x2b')](function(_0x106a0f){if(_0x106a0f){_0x29b5fc=_0x106a0f[_0x927b('0x3d')];if(!_0x46c4e1[_0x927b('0x37')][_0x927b('0x5b')](_0x927b('0x3e'))){_0x2b78b6['limit']=qs[_0x927b('0x24')](_0x46c4e1[_0x927b('0x37')][_0x927b('0x24')]);_0x2b78b6[_0x927b('0x22')]=qs[_0x927b('0x22')](_0x46c4e1[_0x927b('0x37')][_0x927b('0x22')]);}return _0x1fdf67['getMessages'](_0x2b78b6);}})['then'](function(_0x42a619){if(_0x42a619){return _0x42a619?{'count':_0x29b5fc,'rows':_0x42a619}:null;}})[_0x927b('0x2b')](respondWithResult(_0x575e4e,null))[_0x927b('0x49')](handleError(_0x575e4e,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index dbda01c..4c9cc79 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 _0x18b8=['save','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x18b8,0x1bf));var _0x818b=function(_0x1fced6,_0x41b4a4){_0x1fced6=_0x1fced6-0x0;var _0x5de0d0=_0x18b8[_0x1fced6];return _0x5de0d0;};'use strict';var EventEmitter=require(_0x818b('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x818b('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x818b('0x2')](0x0);var events={'afterCreate':_0x818b('0x3'),'afterUpdate':'update','afterDestroy':_0x818b('0x4')};function emitEvent(_0x3da6e5){return function(_0x4d5086,_0x3302a1,_0x1bffd1){ChatGroupEvents[_0x818b('0x5')](_0x3da6e5+':'+_0x4d5086['id'],_0x4d5086);ChatGroupEvents[_0x818b('0x5')](_0x3da6e5,_0x4d5086);_0x1bffd1(null);};}for(var e in events){if(events[_0x818b('0x6')](e)){var event=events[e];ChatGroup[_0x818b('0x7')](e,emitEvent(event));}}module[_0x818b('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xc4a6=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hook'];(function(_0x15cbd4,_0x443ef9){var _0x32fc1e=function(_0x59ac74){while(--_0x59ac74){_0x15cbd4['push'](_0x15cbd4['shift']());}};_0x32fc1e(++_0x443ef9);}(_0xc4a6,0x106));var _0x6c4a=function(_0x5cc450,_0xbc6fa8){_0x5cc450=_0x5cc450-0x0;var _0x781ec6=_0xc4a6[_0x5cc450];return _0x781ec6;};'use strict';var EventEmitter=require(_0x6c4a('0x0'));var ChatGroup=require(_0x6c4a('0x1'))['db'][_0x6c4a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6c4a('0x3')](0x0);var events={'afterCreate':_0x6c4a('0x4'),'afterUpdate':'update','afterDestroy':_0x6c4a('0x5')};function emitEvent(_0x36ccd2){return function(_0x12f185,_0x7e185d,_0x223522){ChatGroupEvents[_0x6c4a('0x6')](_0x36ccd2+':'+_0x12f185['id'],_0x12f185);ChatGroupEvents[_0x6c4a('0x6')](_0x36ccd2,_0x12f185);_0x223522(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x6c4a('0x7')](e,emitEvent(event));}}module[_0x6c4a('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 3af3a09..6a787bb 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 _0x8150=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird'];(function(_0xec8826,_0x373d98){var _0x3499a5=function(_0x1fc71c){while(--_0x1fc71c){_0xec8826['push'](_0xec8826['shift']());}};_0x3499a5(++_0x373d98);}(_0x8150,0xf7));var _0x0815=function(_0x4ab010,_0x506ef0){_0x4ab010=_0x4ab010-0x0;var _0x1b4dc8=_0x8150[_0x4ab010];return _0x1b4dc8;};'use strict';var _=require(_0x0815('0x0'));var util=require('util');var logger=require(_0x0815('0x1'))(_0x0815('0x2'));var moment=require(_0x0815('0x3'));var BPromise=require(_0x0815('0x4'));var rp=require(_0x0815('0x5'));var fs=require('fs');var path=require(_0x0815('0x6'));var rimraf=require(_0x0815('0x7'));var config=require(_0x0815('0x8'));var attributes=require(_0x0815('0x9'));module['exports']=function(_0x3989fd,_0x2b2793){return _0x3989fd['define'](_0x0815('0xa'),attributes,{'tableName':_0x0815('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51e2=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5f0d25,_0x5c0e51){var _0x51e3af=function(_0xdf071){while(--_0xdf071){_0x5f0d25['push'](_0x5f0d25['shift']());}};_0x51e3af(++_0x5c0e51);}(_0x51e2,0xc8));var _0x251e=function(_0x5c2cd8,_0x27f96c){_0x5c2cd8=_0x5c2cd8-0x0;var _0x46c2ff=_0x51e2[_0x5c2cd8];return _0x46c2ff;};'use strict';var _=require(_0x251e('0x0'));var util=require('util');var logger=require(_0x251e('0x1'))(_0x251e('0x2'));var moment=require('moment');var BPromise=require(_0x251e('0x3'));var rp=require(_0x251e('0x4'));var fs=require('fs');var path=require(_0x251e('0x5'));var rimraf=require(_0x251e('0x6'));var config=require(_0x251e('0x7'));var attributes=require(_0x251e('0x8'));module[_0x251e('0x9')]=function(_0x1969bf,_0x37cd23){return _0x1969bf[_0x251e('0xa')](_0x251e('0xb'),attributes,{'tableName':_0x251e('0xc'),'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 17753f0..5ca4bac 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 _0x9c5b=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash'];(function(_0x5b57a3,_0xe935ea){var _0x343622=function(_0xc0c6ea){while(--_0xc0c6ea){_0x5b57a3['push'](_0x5b57a3['shift']());}};_0x343622(++_0xe935ea);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x1a2318,_0x3d1585){_0x1a2318=_0x1a2318-0x0;var _0xd987dd=_0x9c5b[_0x1a2318];return _0xd987dd;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var moment=require(_0xb9c5('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9c5('0x2'));var fs=require('fs');var Redis=require(_0xb9c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9c5('0x4'));var logger=require(_0xb9c5('0x5'))(_0xb9c5('0x6'));var config=require(_0xb9c5('0x7'));var jayson=require(_0xb9c5('0x8'));var client=jayson['client'][_0xb9c5('0x9')]({'port':0x232a});config[_0xb9c5('0xa')]=_['defaults'](config[_0xb9c5('0xa')],{'host':_0xb9c5('0xb'),'port':0x18eb});var socket=require(_0xb9c5('0xc'))(new Redis(config['redis']));require(_0xb9c5('0xd'))['register'](socket);function respondWithRpcPromise(_0x543987,_0x25f973,_0x5107cf){return new BPromise(function(_0x4118df,_0x354f57){return client[_0xb9c5('0xe')](_0x543987,_0x5107cf)['then'](function(_0x380357){logger[_0xb9c5('0xf')](_0xb9c5('0x10'),_0x25f973,_0xb9c5('0x11'));logger[_0xb9c5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x25f973,_0xb9c5('0x11'),JSON['stringify'](_0x380357));if(_0x380357[_0xb9c5('0x13')]){if(_0x380357[_0xb9c5('0x13')][_0xb9c5('0x14')]===0x1f4){logger[_0xb9c5('0x13')](_0xb9c5('0x10'),_0x25f973,_0x380357[_0xb9c5('0x13')]['message']);return _0x354f57(_0x380357[_0xb9c5('0x13')][_0xb9c5('0x15')]);}logger[_0xb9c5('0x13')](_0xb9c5('0x10'),_0x25f973,_0x380357[_0xb9c5('0x13')][_0xb9c5('0x15')]);return _0x4118df(_0x380357[_0xb9c5('0x13')]['message']);}else{logger[_0xb9c5('0xf')](_0xb9c5('0x10'),_0x25f973,_0xb9c5('0x11'));_0x4118df(_0x380357['result'][_0xb9c5('0x15')]);}})[_0xb9c5('0x16')](function(_0x3d8adf){logger[_0xb9c5('0x13')]('ChatGroup,\x20%s,\x20%s',_0x25f973,_0x3d8adf);_0x354f57(_0x3d8adf);});});}
\ No newline at end of file
+var _0xc92f=['socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis'];(function(_0x5921e8,_0x2ecbb1){var _0x1767b1=function(_0x125922){while(--_0x125922){_0x5921e8['push'](_0x5921e8['shift']());}};_0x1767b1(++_0x2ecbb1);}(_0xc92f,0xf3));var _0xfc92=function(_0x28ae0f,_0x3c0034){_0x28ae0f=_0x28ae0f-0x0;var _0x5f4b3e=_0xc92f[_0x28ae0f];return _0x5f4b3e;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require('moment');var BPromise=require(_0xfc92('0x2'));var rs=require(_0xfc92('0x3'));var fs=require('fs');var Redis=require(_0xfc92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x5'));var logger=require(_0xfc92('0x6'))(_0xfc92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')]['http']({'port':0x232a});config[_0xfc92('0x9')]=_['defaults'](config[_0xfc92('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc92('0xa'))(new Redis(config[_0xfc92('0x9')]));require(_0xfc92('0xb'))['register'](socket);function respondWithRpcPromise(_0x18a53b,_0x379756,_0x213ed0){return new BPromise(function(_0x552eab,_0x66d993){return client[_0xfc92('0xc')](_0x18a53b,_0x213ed0)[_0xfc92('0xd')](function(_0x5dee97){logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));logger[_0xfc92('0x11')](_0xfc92('0x12'),_0x379756,_0xfc92('0x10'),JSON[_0xfc92('0x13')](_0x5dee97));if(_0x5dee97[_0xfc92('0x14')]){if(_0x5dee97['error']['code']===0x1f4){logger['error'](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')]['message']);return _0x66d993(_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);}logger[_0xfc92('0x14')](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);return _0x552eab(_0x5dee97['error'][_0xfc92('0x15')]);}else{logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));_0x552eab(_0x5dee97['result']['message']);}})[_0xfc92('0x16')](function(_0x328345){logger['error'](_0xfc92('0xf'),_0x379756,_0x328345);_0x66d993(_0x328345);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 21775bc..c5f0508 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 _0x720e=['register','length','save','remove','update','emit'];(function(_0x2aa5b7,_0x198ec7){var _0x38e6a3=function(_0x49a90e){while(--_0x49a90e){_0x2aa5b7['push'](_0x2aa5b7['shift']());}};_0x38e6a3(++_0x198ec7);}(_0x720e,0x1a6));var _0xe720=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x720e[_0xf2662b];return _0x257dc7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xe720('0x0'),_0xe720('0x1'),_0xe720('0x2')];function createListener(_0x3247aa,_0x86b1ca){return function(_0x137b99){_0x86b1ca[_0xe720('0x3')](_0x3247aa,_0x137b99);};}function removeListener(_0x2dba3e,_0x5c5aad){return function(){ChatGroupEvents['removeListener'](_0x2dba3e,_0x5c5aad);};}exports[_0xe720('0x4')]=function(_0x3e873b){for(var _0x2eb106=0x0,_0xe35c38=events[_0xe720('0x5')];_0x2eb106<_0xe35c38;_0x2eb106++){var _0x41e8f8=events[_0x2eb106];var _0x46f735=createListener('chatGroup:'+_0x41e8f8,_0x3e873b);ChatGroupEvents['on'](_0x41e8f8,_0x46f735);}};
\ No newline at end of file
+var _0xf12f=['remove','update','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x197e53,_0x1b13f7){var _0x2cdb98=function(_0x5a2926){while(--_0x5a2926){_0x197e53['push'](_0x197e53['shift']());}};_0x2cdb98(++_0x1b13f7);}(_0xf12f,0x7e));var _0xff12=function(_0x3a226b,_0x3f0e03){_0x3a226b=_0x3a226b-0x0;var _0x29b01c=_0xf12f[_0x3a226b];return _0x29b01c;};'use strict';var ChatGroupEvents=require(_0xff12('0x0'));var events=[_0xff12('0x1'),_0xff12('0x2'),_0xff12('0x3')];function createListener(_0x42c8cf,_0x3e9c6b){return function(_0x36955e){_0x3e9c6b[_0xff12('0x4')](_0x42c8cf,_0x36955e);};}function removeListener(_0x4e7fbd,_0x13668d){return function(){ChatGroupEvents['removeListener'](_0x4e7fbd,_0x13668d);};}exports[_0xff12('0x5')]=function(_0x326ce0){for(var _0x392715=0x0,_0x26fcb0=events[_0xff12('0x6')];_0x392715<_0x26fcb0;_0x392715++){var _0x314ebd=events[_0x392715];var _0x8335e6=createListener(_0xff12('0x7')+_0x314ebd,_0x326ce0);ChatGroupEvents['on'](_0x314ebd,_0x8335e6);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0343bef..890ea9c 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 _0xcf9f=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/:id','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','update','delete','destroy','removeMembers','exports'];(function(_0x3b0b07,_0xc927c6){var _0x198e38=function(_0x19377d){while(--_0x19377d){_0x3b0b07['push'](_0x3b0b07['shift']());}};_0x198e38(++_0xc927c6);}(_0xcf9f,0x6c));var _0xfcf9=function(_0x5b54de,_0x4a0432){_0x5b54de=_0x5b54de-0x0;var _0x4d8131=_0xcf9f[_0x5b54de];return _0x4d8131;};'use strict';var multer=require(_0xfcf9('0x0'));var util=require(_0xfcf9('0x1'));var path=require(_0xfcf9('0x2'));var timeout=require('connect-timeout');var express=require(_0xfcf9('0x3'));var router=express[_0xfcf9('0x4')]();var fs_extra=require(_0xfcf9('0x5'));var auth=require(_0xfcf9('0x6'));var interaction=require(_0xfcf9('0x7'));var config=require('../../config/environment');var controller=require(_0xfcf9('0x8'));router[_0xfcf9('0x9')]('/',auth[_0xfcf9('0xa')](),controller[_0xfcf9('0xb')]);router['get']('/describe',auth[_0xfcf9('0xa')](),controller['describe']);router['get'](_0xfcf9('0xc'),auth[_0xfcf9('0xa')](),controller['show']);router['get'](_0xfcf9('0xd'),auth['isAuthenticated'](),controller[_0xfcf9('0xe')]);router['get'](_0xfcf9('0xf'),auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x10')]);router['get']('/:id/messages',auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x11')]);router[_0xfcf9('0x12')]('/',auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x13')]);router[_0xfcf9('0x12')](_0xfcf9('0xf'),auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x14')]);router[_0xfcf9('0x12')](_0xfcf9('0x15'),auth[_0xfcf9('0xa')](),controller['addMessage']);router['put'](_0xfcf9('0xc'),auth['isAuthenticated'](),controller[_0xfcf9('0x16')]);router[_0xfcf9('0x17')](_0xfcf9('0xc'),auth['isAuthenticated'](),controller[_0xfcf9('0x18')]);router[_0xfcf9('0x17')](_0xfcf9('0xf'),auth[_0xfcf9('0xa')](),controller[_0xfcf9('0x19')]);module[_0xfcf9('0x1a')]=router;
\ No newline at end of file
+var _0x7b5f=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','connect-timeout','express','Router'];(function(_0x61d891,_0x8478d6){var _0x1c3b3b=function(_0x4b2e99){while(--_0x4b2e99){_0x61d891['push'](_0x61d891['shift']());}};_0x1c3b3b(++_0x8478d6);}(_0x7b5f,0x101));var _0xf7b5=function(_0x5039b1,_0x32f067){_0x5039b1=_0x5039b1-0x0;var _0x588a3a=_0x7b5f[_0x5039b1];return _0x588a3a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf7b5('0x0'));var express=require(_0xf7b5('0x1'));var router=express[_0xf7b5('0x2')]();var fs_extra=require(_0xf7b5('0x3'));var auth=require(_0xf7b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b5('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x7')]);router['get']('/describe',auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x8')]);router[_0xf7b5('0x9')](_0xf7b5('0xa'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0xb')]);router[_0xf7b5('0x9')](_0xf7b5('0xc'),auth['isAuthenticated'](),controller[_0xf7b5('0xd')]);router[_0xf7b5('0x9')](_0xf7b5('0xe'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0xf')]);router[_0xf7b5('0x9')](_0xf7b5('0x10'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x11')]);router[_0xf7b5('0x12')]('/',auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x13')]);router[_0xf7b5('0x12')](_0xf7b5('0xe'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x14')]);router[_0xf7b5('0x12')](_0xf7b5('0x10'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x15')]);router[_0xf7b5('0x16')](_0xf7b5('0xa'),auth[_0xf7b5('0x6')](),controller['update']);router[_0xf7b5('0x17')](_0xf7b5('0xa'),auth[_0xf7b5('0x6')](),controller['destroy']);router[_0xf7b5('0x17')](_0xf7b5('0xe'),auth[_0xf7b5('0x6')](),controller[_0xf7b5('0x18')]);module[_0xf7b5('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index df4e16c..102c700 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 _0xb9be=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','sequelize','exports','BOOLEAN'];(function(_0x5321b5,_0x143137){var _0x32b203=function(_0x57007f){while(--_0x57007f){_0x5321b5['push'](_0x5321b5['shift']());}};_0x32b203(++_0x143137);}(_0xb9be,0xc5));var _0xeb9b=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xb9be[_0x58a4fe];return _0x697de2;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'closed':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb9b('0x3')]},'ratingType':{'type':Sequelize[_0xeb9b('0x4')](_0xeb9b('0x5'),_0xeb9b('0x6')),'defaultValue':_0xeb9b('0x5')},'ratingMessage':{'type':Sequelize[_0xeb9b('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeb9b('0x8')]},'disposition':{'type':Sequelize[_0xeb9b('0x9')]},'secondDisposition':{'type':Sequelize[_0xeb9b('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xeb9b('0x9')]},'browserName':{'type':Sequelize[_0xeb9b('0x9')]},'browserVersion':{'type':Sequelize[_0xeb9b('0x9')]},'osName':{'type':Sequelize[_0xeb9b('0x9')]},'osVersion':{'type':Sequelize[_0xeb9b('0x9')]},'deviceModel':{'type':Sequelize[_0xeb9b('0x9')]},'deviceVendor':{'type':Sequelize[_0xeb9b('0x9')]},'deviceType':{'type':Sequelize[_0xeb9b('0x9')]},'referer':{'type':Sequelize[_0xeb9b('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeb9b('0x7')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xeb9b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeb9b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb9b('0x9')]},'customerPort':{'type':Sequelize[_0xeb9b('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xeb9b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6947=['DATE','long','out','BOOLEAN','exports','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x2cea0e,_0x533e56){var _0x236406=function(_0x4dce1d){while(--_0x4dce1d){_0x2cea0e['push'](_0x2cea0e['shift']());}};_0x236406(++_0x533e56);}(_0x6947,0x72));var _0x7694=function(_0x93ffe0,_0x4619d8){_0x93ffe0=_0x93ffe0-0x0;var _0x1758a9=_0x6947[_0x93ffe0];return _0x1758a9;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7694('0x1')]},'ratingType':{'type':Sequelize[_0x7694('0x2')](_0x7694('0x3'),_0x7694('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7694('0x5')]},'mailTranscript':{'type':Sequelize[_0x7694('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7694('0x7')]},'disposition':{'type':Sequelize[_0x7694('0x6')]},'secondDisposition':{'type':Sequelize[_0x7694('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7694('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7694('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7694('0x6')]},'osVersion':{'type':Sequelize[_0x7694('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7694('0x6')]},'deviceType':{'type':Sequelize[_0x7694('0x6')]},'referer':{'type':Sequelize[_0x7694('0x5')]},'customerIp':{'type':Sequelize[_0x7694('0x6')]},'formData':{'type':Sequelize[_0x7694('0x5')](_0x7694('0x8'))},'read1stAt':{'type':Sequelize[_0x7694('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7694('0x2')]('in',_0x7694('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7694('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7694('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7694('0xa')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index f5c32c4..dbbac13 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 _0x9f0e=['error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','stack','name','send','render','merge','contact','interaction','fullname','TagIds','Tags','split','forEach','index','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','`\x20=\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.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','push','show','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','agentAlias','System','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','intersection','sort','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','alias','rows','addTags','spread','emit','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','Account','Owner','mkdirSync','closedAt','browserName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','lastName','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d227a,_0xa2a2be){var _0x1788a2=function(_0x6391f0){while(--_0x6391f0){_0x2d227a['push'](_0x2d227a['shift']());}};_0x1788a2(++_0xa2a2be);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3366e2,_0x1109bc){_0x3366e2=_0x3366e2-0x0;var _0x2711da=_0x9f0e[_0x3366e2];return _0x2711da;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var pdf=require(_0xe9f0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9f0('0x15'))(_0xe9f0('0x16'));var utils=require(_0xe9f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe9f0('0x18'));var db=require('../../mysqldb')['db'];config[_0xe9f0('0x19')]=_[_0xe9f0('0x1a')](config[_0xe9f0('0x19')],{'host':_0xe9f0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9f0('0x19')]));require('./chatInteraction.socket')[_0xe9f0('0x1c')](socket);var jayson=require(_0xe9f0('0x1d'));var client=jayson[_0xe9f0('0x1e')]['http']({'port':0x232b});var client9004=jayson[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2e68ef,_0x598eee,_0xaa7aa6,_0x1e16e0){return new BPromise(function(_0xcd2042,_0xd71ac8){var _0x3ed69a=_0x1e16e0||client;return _0x3ed69a[_0xe9f0('0x20')](_0x2e68ef,_0xaa7aa6)[_0xe9f0('0x21')](function(_0x59bf5a){logger[_0xe9f0('0x22')](_0xe9f0('0x23'),_0x598eee,_0xe9f0('0x24'));logger['debug'](_0xe9f0('0x25'),_0x598eee,_0xe9f0('0x24'),JSON[_0xe9f0('0x26')](_0x59bf5a));if(_0x59bf5a[_0xe9f0('0x27')]){if(_0x59bf5a['error'][_0xe9f0('0x28')]===0x1f4){logger[_0xe9f0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x598eee,_0x59bf5a['error']['message']);return _0xd71ac8(_0x59bf5a[_0xe9f0('0x27')][_0xe9f0('0x29')]);}logger[_0xe9f0('0x27')](_0xe9f0('0x23'),_0x598eee,_0x59bf5a[_0xe9f0('0x27')]['message']);return _0xcd2042(_0x59bf5a[_0xe9f0('0x27')][_0xe9f0('0x29')]);}else{logger[_0xe9f0('0x22')](_0xe9f0('0x23'),_0x598eee,_0xe9f0('0x24'));_0xcd2042(_0x59bf5a[_0xe9f0('0x2a')][_0xe9f0('0x29')]);}})[_0xe9f0('0x2b')](function(_0x3c4ba9){logger[_0xe9f0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x598eee,_0x3c4ba9);_0xd71ac8(_0x3c4ba9);});});}function respondWithStatusCode(_0x371095,_0x27541f){_0x27541f=_0x27541f||0xcc;return function(_0x2ddfba){if(_0x2ddfba){return _0x371095[_0xe9f0('0x2c')](_0x27541f);}return _0x371095['status'](_0x27541f)[_0xe9f0('0x2d')]();};}function respondWithResult(_0x2613fd,_0x856ac8){_0x856ac8=_0x856ac8||0xc8;return function(_0x1f98a7){if(_0x1f98a7){return _0x2613fd[_0xe9f0('0x2e')](_0x856ac8)['json'](_0x1f98a7);}};}function respondWithFilteredResult(_0x130f96,_0xdc16bc){return function(_0x44fb5b){if(_0x44fb5b){var _0xab3d81=typeof _0xdc16bc[_0xe9f0('0x2f')]===_0xe9f0('0x30')&&typeof _0xdc16bc[_0xe9f0('0x31')]===_0xe9f0('0x30');var _0x2b6503=_0x44fb5b[_0xe9f0('0x32')];var _0x22806c=_0xab3d81?0x0:_0xdc16bc[_0xe9f0('0x2f')];var _0x445ad0=_0xab3d81?_0x44fb5b[_0xe9f0('0x32')]:_0xdc16bc[_0xe9f0('0x2f')]+_0xdc16bc[_0xe9f0('0x31')];var _0x80e3ac;if(_0x445ad0>=_0x2b6503){_0x445ad0=_0x2b6503;_0x80e3ac=0xc8;}else{_0x80e3ac=0xce;}_0x130f96[_0xe9f0('0x2e')](_0x80e3ac);return _0x130f96[_0xe9f0('0x33')](_0xe9f0('0x34'),_0x22806c+'-'+_0x445ad0+'/'+_0x2b6503)[_0xe9f0('0x35')](_0x44fb5b);}return null;};}function patchUpdates(_0x589803){return function(_0x1c394){try{jsonpatch[_0xe9f0('0x36')](_0x1c394,_0x589803,!![]);}catch(_0x5480ce){return BPromise['reject'](_0x5480ce);}return _0x1c394['save']();};}function saveUpdates(_0x191a39,_0x585742){return function(_0x9bf61d){if(_0x9bf61d){return _0x9bf61d[_0xe9f0('0x37')](_0x191a39)['then'](function(_0x285457){return _0x285457;});}return null;};}function removeEntity(_0x4c181d,_0x576a7a){return function(_0x59024e){if(_0x59024e){return _0x59024e[_0xe9f0('0x38')]()[_0xe9f0('0x21')](function(){_0x4c181d['status'](0xcc)[_0xe9f0('0x2d')]();});}};}function handleEntityNotFound(_0xb0cfc,_0x1d4748){return function(_0x4d4186){if(!_0x4d4186){_0xb0cfc['sendStatus'](0x194);}return _0x4d4186;};}function handleError(_0x3fb04e,_0x3ff42d){_0x3ff42d=_0x3ff42d||0x1f4;return function(_0x1917c8){logger['error'](_0x1917c8[_0xe9f0('0x39')]);if(_0x1917c8[_0xe9f0('0x3a')]){delete _0x1917c8[_0xe9f0('0x3a')];}_0x3fb04e[_0xe9f0('0x2e')](_0x3ff42d)[_0xe9f0('0x3b')](_0x1917c8);};}function getMustacheRender(_0x552ec2,_0x2ab492){return Mustache[_0xe9f0('0x3c')](_0x552ec2,_[_0xe9f0('0x3d')](_0x2ab492['body'],{'contact':_0x2ab492[_0xe9f0('0x3e')],'message':_0x2ab492[_0xe9f0('0x29')],'agent':_0x2ab492['agent'],'interaction':_0x2ab492[_0xe9f0('0x3f')],'account':_0x2ab492['account']}))||'';}function getInteractionUsers(_0x56c03e,_0x55c0bd){return new BPromise(function(_0x5dcbeb,_0x51eda3){try{if(_0x55c0bd[_0x56c03e['id']]){_0x56c03e['Users']=_['map'](_0x55c0bd[_0x56c03e['id']],function(_0x35062f){return{'id':_0x35062f['id'],'fullname':_0x35062f[_0xe9f0('0x40')]};});}}catch(_0x2d8f93){_0x51eda3(_0x2d8f93);}_0x5dcbeb(_0x56c03e);});}function getInteractionTags(_0x40c2c6,_0x2560c6){return new BPromise(function(_0xd9b61b,_0x3d4eb7){try{if(_0x40c2c6[_0xe9f0('0x41')]){_0x40c2c6[_0xe9f0('0x42')]=[];_0x40c2c6['TagIds'][_0xe9f0('0x43')](',')[_0xe9f0('0x44')](function(_0x36b00a){_0x40c2c6['Tags']['push'](_0x2560c6[_0x36b00a]);});}delete _0x40c2c6[_0xe9f0('0x41')];}catch(_0x515fa6){_0x3d4eb7(_0x515fa6);}_0xd9b61b(_0x40c2c6);});}function updateChatInteraction(_0x297689,_0x52613a,_0x314f0e){return new BPromise(function(_0x42d9d2,_0x4f1663){return getInteractionUsers(_0x297689,_0x314f0e)[_0xe9f0('0x21')](function(_0x3f5255){return getInteractionTags(_0x3f5255,_0x52613a);})[_0xe9f0('0x21')](function(_0x18faaf){_0x42d9d2(_0x18faaf);})[_0xe9f0('0x2b')](function(_0x59378a){_0x4f1663(_0x59378a);});});}exports[_0xe9f0('0x45')]=function(_0x2941a0,_0x30141e){var _0x319380={},_0xf75ffb={},_0x4ffc17={'count':0x0,'rows':[]};var _0x3a8d1d=_['map'](db['ChatInteraction'][_0xe9f0('0x46')],function(_0x17b832){return{'name':_0x17b832['fieldName'],'type':_0x17b832[_0xe9f0('0x47')][_0xe9f0('0x48')]};});_0xf75ffb[_0xe9f0('0x49')]=_[_0xe9f0('0x4a')](_0x3a8d1d,_0xe9f0('0x3a'));_0xf75ffb[_0xe9f0('0x4b')]=_[_0xe9f0('0x4c')](_0x2941a0['query']);_0xf75ffb[_0xe9f0('0x4d')]=_['intersection'](_0xf75ffb[_0xe9f0('0x49')],_0xf75ffb['query']);_0x319380[_0xe9f0('0x4e')]=_['intersection'](_0xf75ffb[_0xe9f0('0x49')],qs[_0xe9f0('0x4f')](_0x2941a0[_0xe9f0('0x4b')]['fields']));_0x319380[_0xe9f0('0x4e')]=_0x319380[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x319380[_0xe9f0('0x4e')]:_0xf75ffb[_0xe9f0('0x49')];if(!_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x51')](_0xe9f0('0x52'))){_0x319380[_0xe9f0('0x31')]=qs[_0xe9f0('0x31')](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0x319380['offset']=qs['offset'](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0x319380[_0xe9f0('0x53')]=qs['sort'](_0x2941a0[_0xe9f0('0x4b')]['sort']);_0x319380[_0xe9f0('0x54')]=qs[_0xe9f0('0x4d')](_[_0xe9f0('0x55')](_0x2941a0[_0xe9f0('0x4b')],_0xf75ffb['filters']),_0x3a8d1d);var _0xb18f13=[];var _0x3fa271=squel['select']()[_0xe9f0('0x56')]('id')[_0xe9f0('0x56')](_0xe9f0('0x3a'))[_0xe9f0('0x56')]('color')[_0xe9f0('0x57')](_0xe9f0('0x58'));var _0x3dd40d=squel[_0xe9f0('0x59')]()[_0xe9f0('0x56')](_0xe9f0('0x5a'))[_0xe9f0('0x56')](_0xe9f0('0x5b'))['field'](_0xe9f0('0x5c'))[_0xe9f0('0x57')](_0xe9f0('0x5d'),'ui')[_0xe9f0('0x5e')](_0xe9f0('0x5f'),'u',_0xe9f0('0x60'));var _0x28fe47=squel[_0xe9f0('0x59')]()[_0xe9f0('0x57')](_0xe9f0('0x61'),'i')[_0xe9f0('0x5e')](_0xe9f0('0x62'),'c',_0xe9f0('0x63'))[_0xe9f0('0x5e')]('users','o',_0xe9f0('0x64'))[_0xe9f0('0x5e')](_0xe9f0('0x65'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xe9f0('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xe9f0('0x5e')](_0xe9f0('0x67'),'it',_0xe9f0('0x68'))['left_join'](_0xe9f0('0x58'),'t',_0xe9f0('0x69'));var _0x954616=squel[_0xe9f0('0x6a')]();var _0x4bb39d=[];var _0x392eae=squel[_0xe9f0('0x6a')]();var _0x28a66e;if(_0x2941a0[_0xe9f0('0x4b')]['search']){_0x28a66e=as['parseSearch'](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x6b')]);var _0x29286b=_0x28a66e[_0xe9f0('0x6c')];for(var _0x7cbe71=0x0;_0x7cbe71<_0x28a66e['conditions'][_0xe9f0('0x50')];_0x7cbe71++){var _0x55ce2d=_0x28a66e[_0xe9f0('0x6d')][_0x7cbe71];var _0x5858a9='i';var _0x7c05aa=_[_0xe9f0('0x6e')](_0x3a8d1d,[_0xe9f0('0x3a'),_0x55ce2d[_0xe9f0('0x56')]]);if(!_0x7c05aa){switch(_0x55ce2d[_0xe9f0('0x56')]){case'unreadMessages':if(_0x55ce2d['value']==0x1){_0x28fe47['having']('`'+_0x55ce2d[_0xe9f0('0x56')]+_0xe9f0('0x6f'));}else{_0x28fe47['having']('`'+_0x55ce2d[_0xe9f0('0x56')]+'`\x20>\x200');}break;case'Contact':if(_0x55ce2d[_0xe9f0('0x70')]===_0xe9f0('0x71')){if(_0x55ce2d[_0xe9f0('0x72')][_0xe9f0('0x43')]('\x20')[_0xe9f0('0x50')]>0x1){_0x954616[_0x29286b](_0xe9f0('0x73'),qs['getFullTextValue'](_0x55ce2d['value']),null);}else{var _0x1255e6='%'+_0x55ce2d[_0xe9f0('0x72')]+'%';_0x954616[_0x29286b](_0xe9f0('0x74'),_0x1255e6,_0x1255e6,_0x1255e6);}}else{_0x7c05aa=_[_0xe9f0('0x6e')](_0x3a8d1d,['name',_0xe9f0('0x75')]);_0x55ce2d[_0xe9f0('0x56')]=_0xe9f0('0x75');_0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa[_0xe9f0('0x47')],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')][_0xe9f0('0x2d')]);}break;case _0xe9f0('0x79'):var _0xb6e75d=_0x55ce2d['value'][_0xe9f0('0x43')](',')[_0xe9f0('0x4a')](function(_0x388091){return Number(_0x388091);});_0xb6e75d[_0xe9f0('0x44')](function(_0x214ac0){_0x392eae['or'](_0xe9f0('0x7a'),'%,'+_0x214ac0+',%');});_0x4bb39d=_[_0xe9f0('0x7b')](_0x4bb39d,_0xb6e75d);break;case _0xe9f0('0x7c'):if(_0x55ce2d[_0xe9f0('0x70')]===_0xe9f0('0x71')){_0x954616[_0x29286b](_0xe9f0('0x7d'),'%'+_0x55ce2d[_0xe9f0('0x72')]+'%',null);}else{_0x7c05aa=_['find'](_0x3a8d1d,[_0xe9f0('0x3a'),_0xe9f0('0x7e')]);_0x55ce2d[_0xe9f0('0x56')]=_0xe9f0('0x7e');_0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa[_0xe9f0('0x47')],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')]['end']);}break;case _0xe9f0('0x7f'):_0x2cd0c1=as[_0xe9f0('0x76')]('me',null,_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')]['end']);break;}}else{var _0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa['type'],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1['text'],_0x2cd0c1[_0xe9f0('0x72')]['start'],_0x2cd0c1[_0xe9f0('0x72')][_0xe9f0('0x2d')]);}}}else{var _0x56d052=_(_0x2941a0[_0xe9f0('0x4b')])[_0xe9f0('0x4c')]()[_0xe9f0('0x4a')](function(_0x300fae){return _[_0xe9f0('0x80')](_0x3a8d1d,[_0xe9f0('0x3a'),_0x300fae])?_0x300fae:undefined;})[_0xe9f0('0x81')]()[_0xe9f0('0x72')]();if(!_[_0xe9f0('0x82')](_0x56d052)){_0x56d052['forEach'](function(_0x2e15f9){if(_0x2e15f9===_0xe9f0('0x83')){_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0x84'),[][_0xe9f0('0x85')](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9]));}else if(_0x2e15f9===_0xe9f0('0x86')){var _0x114033=JSON['parse'](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9])[_0xe9f0('0x87')];var _0x2ce60c=JSON[_0xe9f0('0x88')](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9])[_0xe9f0('0x89')];_0x28fe47['where'](_0xe9f0('0x8a'),_0x114033,_0x2ce60c);}else{if(_0x2941a0['query'][_0x2e15f9]==='null'){_0x28fe47['where']('i.'+_0x2e15f9+_0xe9f0('0x8b'));}else{_0x28fe47[_0xe9f0('0x54')]('i.'+_0x2e15f9+_0xe9f0('0x8c'),_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9]);}}});}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x8d')]){if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x8d')]==0x1){_0x28fe47[_0xe9f0('0x8e')]('`unreadMessages`\x20=\x200');}else{_0x28fe47[_0xe9f0('0x8e')](_0xe9f0('0x8f'));}}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')]){_0x4bb39d=_[_0xe9f0('0x91')](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')])?_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')]:new Array(_0x2941a0[_0xe9f0('0x4b')]['tag']);_0x4bb39d['forEach'](function(_0x23c9e8){_0x392eae['or'](_0xe9f0('0x7a'),'%,'+_0x23c9e8+',%');});}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x92')]){var _0xdaf9e3=_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x92')][_0xe9f0('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xdaf9e3)){_0x954616['or'](_0xe9f0('0x94'),_0xdaf9e3+'%');}else{_0x954616['or'](_0xe9f0('0x95'),qs['getFullTextValue'](_0xdaf9e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xdaf9e3+'%');}}}_0x28fe47[_0xe9f0('0x54')](_0x954616);_0x28fe47[_0xe9f0('0x96')](_0xe9f0('0x97'));var _0xab92b={'type':db[_0xe9f0('0x98')]['QueryTypes'][_0xe9f0('0x99')],'raw':!![]};var _0x21eba3=_0x28fe47[_0xe9f0('0x9a')]();_0x21eba3[_0xe9f0('0x56')](_0xe9f0('0x97'));_0x21eba3[_0xe9f0('0x56')](_0xe9f0('0x9b'),'unreadMessages');if(_0x319380['order']){_0x319380['order'][_0xe9f0('0x44')](function(_0x3c95f4){var _0x245458=_0x3c95f4[0x0]===_0xe9f0('0x9c')?_0x3c95f4[0x0]:'i.'+_0x3c95f4[0x0];_0x28fe47['order'](_0x245458,_0x3c95f4[0x1]===_0xe9f0('0x9d')?![]:!![]);});}if(!_['isEmpty'](_0x4bb39d)){_0x28fe47[_0xe9f0('0x8e')](_0x392eae);_0x21eba3['where'](_0xe9f0('0x9e'),_0x4bb39d);}BPromise[_0xe9f0('0x9f')]()[_0xe9f0('0x21')](function(){if(!_0x28a66e){if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x83')])return;_0x21eba3[_0xe9f0('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0xa0'));return;}if(_0x2941a0[_0xe9f0('0xa1')][_0xe9f0('0xa2')]!==_0xe9f0('0xa3'))return;return _0x2941a0['user'][_0xe9f0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xe9f0('0x21')](function(_0x4c9808){if(_[_0xe9f0('0x82')](_0x4c9808)){_0x21eba3['where'](_0xe9f0('0xa5'));_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0xa5'));}else{_0x21eba3['where'](_0xe9f0('0x84'),_[_0xe9f0('0x4a')](_0x4c9808,'id'));_0x28fe47[_0xe9f0('0x54')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe9f0('0x4a')](_0x4c9808,'id'));}});})[_0xe9f0('0x21')](function(){if(_0x2941a0[_0xe9f0('0xa1')][_0xe9f0('0xa2')]===_0xe9f0('0xa3')&&!_0x28a66e&&!_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x83')])return[];return db['sequelize']['query'](_0x21eba3[_0xe9f0('0xa6')](),_0xab92b);})[_0xe9f0('0x21')](function(_0x1a7549){_0x4ffc17['count']=_0x1a7549[_0xe9f0('0x50')];if(_0x4ffc17[_0xe9f0('0x32')]===0x0)return[];return db[_0xe9f0('0xa7')][_0xe9f0('0x4b')](_0x3fa271['toString'](),_0xab92b)['then'](function(_0x20436f){_0xb18f13=_[_0xe9f0('0xa8')](_0x20436f,'id');_0xab92b=_['merge'](_0xab92b,{'model':db[_0xe9f0('0xa9')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2941a0['query']['fields']){_0x319380[_0xe9f0('0x4e')][_0xe9f0('0x44')](function(_0x77b59d){_0x28fe47[_0xe9f0('0x56')]('i.'+_0x77b59d);});}else{_0x28fe47[_0xe9f0('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xaa'),_0xe9f0('0xab'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xac'),'Account.mandatoryDisposition');_0x28fe47['field']('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',_0xe9f0('0x9c'));_0x28fe47['field'](_0xe9f0('0xad'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xae'),_0xe9f0('0xaf'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb0'),'Contact.lastName');_0x28fe47['field'](_0xe9f0('0xb1'),_0xe9f0('0xb2'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb3'),_0xe9f0('0xb4'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb5'),_0xe9f0('0xb6'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb7'),_0xe9f0('0xb8'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb9'),_0xe9f0('0xba'));_0x28fe47['field'](_0xe9f0('0xbb'),_0xe9f0('0xbc'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xbd'),_0xe9f0('0x41'));}if(_0x319380[_0xe9f0('0x31')])_0x28fe47[_0xe9f0('0x31')](_0x319380[_0xe9f0('0x31')]);if(_0x319380[_0xe9f0('0x2f')])_0x28fe47[_0xe9f0('0x2f')](_0x319380[_0xe9f0('0x2f')]);return db['sequelize'][_0xe9f0('0x4b')](_0x28fe47[_0xe9f0('0xa6')](),_0xab92b);})[_0xe9f0('0x21')](function(_0x2af661){if(_0x2af661[_0xe9f0('0x50')]>0x0)_0x3dd40d[_0xe9f0('0x54')](_0xe9f0('0xbe'),_[_0xe9f0('0x4a')](_0x2af661,'id'));return db['sequelize']['query'](_0x3dd40d[_0xe9f0('0xa6')](),_0xab92b)[_0xe9f0('0x21')](function(_0x4e7f22){var _0x583c4c=_[_0xe9f0('0xbf')](_0x4e7f22,_0xe9f0('0xc0'));var _0x37a080=[];_0x2af661[_0xe9f0('0x44')](function(_0x21d159){_0x37a080[_0xe9f0('0xc1')](updateChatInteraction(_0x21d159,_0xb18f13,_0x583c4c));});return BPromise['all'](_0x37a080);});});})[_0xe9f0('0x21')](function(_0x2f1584){_0x4ffc17['rows']=_0x2f1584;return _0x4ffc17;})['then'](respondWithFilteredResult(_0x30141e,_0x319380))[_0xe9f0('0x2b')](handleError(_0x30141e,null));};exports[_0xe9f0('0xc2')]=function(_0x4b668a,_0x17013a){var _0x63e374={'raw':![],'where':{'id':_0x4b668a['params']['id']}},_0x34eda8={};_0x34eda8[_0xe9f0('0x49')]=_[_0xe9f0('0x4c')](db[_0xe9f0('0xa9')][_0xe9f0('0x46')]);_0x34eda8['query']=_[_0xe9f0('0x4c')](_0x4b668a[_0xe9f0('0x4b')]);_0x34eda8[_0xe9f0('0x4d')]=_['intersection'](_0x34eda8['model'],_0x34eda8['query']);_0x63e374[_0xe9f0('0x4e')]=_['intersection'](_0x34eda8['model'],qs[_0xe9f0('0x4f')](_0x4b668a['query'][_0xe9f0('0x4f')]));_0x63e374[_0xe9f0('0x4e')]=_0x63e374[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x63e374['attributes']:_0x34eda8[_0xe9f0('0x49')];if(_0x4b668a[_0xe9f0('0x4b')][_0xe9f0('0xc3')]){_0x63e374[_0xe9f0('0xc4')]=[{'all':!![]}];}_0x63e374=_[_0xe9f0('0x3d')]({},_0x63e374,_0x4b668a[_0xe9f0('0xc5')]);return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')](_0x63e374)[_0xe9f0('0x21')](handleEntityNotFound(_0x17013a,null))[_0xe9f0('0x21')](respondWithResult(_0x17013a,null))[_0xe9f0('0x2b')](handleError(_0x17013a,null));};exports[_0xe9f0('0xc6')]=function(_0x27c9f5,_0x56b64b){return db[_0xe9f0('0xa9')][_0xe9f0('0xc6')](_0x27c9f5['body'],{})['then'](respondWithResult(_0x56b64b,0xc9))[_0xe9f0('0x2b')](handleError(_0x56b64b,null));};exports[_0xe9f0('0x37')]=function(_0xef63f8,_0x1c0db4){if(_0xef63f8['body']['id']){delete _0xef63f8[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0xef63f8['params']['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x1c0db4,null))[_0xe9f0('0x21')](saveUpdates(_0xef63f8[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](respondWithResult(_0x1c0db4,null))[_0xe9f0('0x2b')](handleError(_0x1c0db4,null));};exports['destroy']=function(_0x5cbea8,_0x19f96b){return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x5cbea8[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x19f96b,null))[_0xe9f0('0x21')](removeEntity(_0x19f96b,null))[_0xe9f0('0x2b')](handleError(_0x19f96b,null));};exports[_0xe9f0('0xc8')]=function(_0x5ae9f1,_0x1aacfa){return db['ChatInteraction']['describe']()[_0xe9f0('0x21')](respondWithResult(_0x1aacfa,null))[_0xe9f0('0x2b')](handleError(_0x1aacfa,null));};exports[_0xe9f0('0xc9')]=function(_0x59396b,_0x564755){var _0x174e49=_0x59396b['params']['id'];var _0x3f2f29;var _0x18abe2;var _0x14e369;return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0x174e49}})[_0xe9f0('0x21')](function(_0x5108d3){_0x3f2f29=_0x5108d3;return db[_0xe9f0('0xca')]['findOne']({'where':{'id':_0x5108d3['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xe9f0('0xcb'),_0xe9f0('0xcc'),'vidaooNote',_0xe9f0('0xcd')],'raw':!![]});})[_0xe9f0('0x21')](function(_0x250bfe){if(_0x250bfe&&_0x250bfe[_0xe9f0('0xce')]&&_0x250bfe[_0xe9f0('0xcb')]){_0x18abe2=_0x250bfe;var _0x40306a={'interaction':{'id':_0x174e49},'agent':{'id':_0x59396b[_0xe9f0('0xa1')]['id'],'name':_0x59396b['user'][_0xe9f0('0x3a')],'fullname':_0x59396b[_0xe9f0('0xa1')][_0xe9f0('0x40')],'email':_0x59396b['user'][_0xe9f0('0xcf')]},'contact':_0x59396b[_0xe9f0('0x7f')][_0xe9f0('0x3e')],'account':_0x59396b['body'][_0xe9f0('0xd0')]};var _0x35456b={'rejectUnauthorized':![],'method':'POST','url':_0xe9f0('0xd1'),'headers':{'X-APIKEY':_0x250bfe['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x59396b[_0xe9f0('0xa1')][_0xe9f0('0xcf')]],'buttons':null,'topic':_0x18abe2[_0xe9f0('0xcc')],'note':_[_0xe9f0('0xd2')](_0x18abe2[_0xe9f0('0xd3')])?null:getMustacheRender(_0x18abe2[_0xe9f0('0xd3')],_0x40306a),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe9f0('0xd2')](_0x18abe2[_0xe9f0('0xcd')])){var _0xfe329a=getMustacheRender(_0x18abe2[_0xe9f0('0xcd')],_0x40306a);var _0x358cda=JSON[_0xe9f0('0x88')](_0xfe329a);_0x35456b[_0xe9f0('0x7f')]['metadata']=_0x358cda;}}catch(_0x5b9074){throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35456b);}else{throw new db[(_0xe9f0('0x98'))]['ValidationError'](_0xe9f0('0xd5'));}})[_0xe9f0('0x21')](function(_0x557b90){_0x14e369=_0x557b90;if(_0x14e369['id']){var _0x4aa320={'body':_0x14e369[_0xe9f0('0xd6')],'ChatWebsiteId':_0x18abe2['id'],'ChatInteractionId':_0x3f2f29['id'],'direction':_0xe9f0('0xd7'),'UserId':_0x59396b[_0xe9f0('0xa1')]['id']};return db['ChatMessage']['create'](_0x4aa320,{});}else{throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))](_0xe9f0('0xd8'));}})[_0xe9f0('0x21')](function(){return _0x3f2f29[_0xe9f0('0xd9')]({'vidaooSessionId':_0x14e369['id']});})[_0xe9f0('0x21')](respondWithResult(_0x564755,null))[_0xe9f0('0x2b')](handleError(_0x564755,null));};exports[_0xe9f0('0xda')]=function(_0x2f65a6,_0x45edd9){if(_0x2f65a6[_0xe9f0('0x7f')]['id']){delete _0x2f65a6[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x2f65a6['params']['id']},'include':[{'model':db[_0xe9f0('0xdb')],'as':'Contact'}]})[_0xe9f0('0x21')](handleEntityNotFound(_0x45edd9,null))[_0xe9f0('0x21')](saveUpdates(_0x2f65a6[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](respondWithResult(_0x45edd9,null))[_0xe9f0('0x2b')](handleError(_0x45edd9,null));};exports[_0xe9f0('0xdc')]=function(_0x297e2b,_0x114c65,_0x5df944){if(_0x297e2b[_0xe9f0('0x7f')]['id']){delete _0x297e2b[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x297e2b[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](function(_0x1095d8){if(!_0x1095d8){logger[_0xe9f0('0x27')](_0xe9f0('0xdd'),_0xe9f0('0xdc'),0x194,_0xe9f0('0xde'));_0x114c65[_0xe9f0('0x2c')](0x194);}else{if(_0x1095d8[_0xe9f0('0x7e')]){throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))](_0xe9f0('0xdf'));}}return _0x1095d8;})['then'](function(_0x430b27){if(_0x430b27){return _0x430b27[_0xe9f0('0x37')]({'closed':_0x297e2b['body'][_0xe9f0('0xe0')],'disposition':_0x297e2b[_0xe9f0('0x7f')][_0xe9f0('0xe1')]})[_0xe9f0('0x21')](function(_0x5c34fa){return _0x5c34fa;});}})[_0xe9f0('0x21')](function(_0x3c80a4){return respondWithRpcPromise(_0xe9f0('0xe2'),_0xe9f0('0xdc'),_0x297e2b['body'],client9004);})[_0xe9f0('0x21')](respondWithResult(_0x114c65,null))['catch'](handleError(_0x114c65,null));};exports['attachmentUpload']=function(_0x14cad3,_0x4a98e8,_0x5cba30){_0x14cad3[_0xe9f0('0x7f')][_0xe9f0('0x3a')]=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe4')];_0x14cad3[_0xe9f0('0x7f')]['basename']=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe5')];_0x14cad3['body'][_0xe9f0('0x47')]=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe6')];return db[_0xe9f0('0xe7')][_0xe9f0('0xc6')](_0x14cad3[_0xe9f0('0x7f')])[_0xe9f0('0x21')](respondWithResult(_0x4a98e8,0xc9))[_0xe9f0('0x2b')](handleError(_0x4a98e8,null));};exports[_0xe9f0('0xe8')]=function(_0x5b2c15,_0x2446b3,_0x3a3c7c){return db['ChatInteraction'][_0xe9f0('0xe9')]({'where':{'id':_0x5b2c15[_0xe9f0('0xc7')]['id']},'raw':!![]})[_0xe9f0('0x21')](handleEntityNotFound(_0x2446b3,null))[_0xe9f0('0x21')](function(_0x327d68){if(_0x327d68){if(_0x327d68['closed']){return _0x2446b3['status'](0x193)[_0xe9f0('0x35')]({'status':0x193,'message':_0xe9f0('0xea')});}return db[_0xe9f0('0xe7')]['findOne']({'where':{'id':_0x5b2c15[_0xe9f0('0x4b')][_0xe9f0('0xeb')]},'raw':!![]})[_0xe9f0('0x21')](handleEntityNotFound(_0x2446b3,null));}})[_0xe9f0('0x21')](function(_0x48ba5a){if(_0x48ba5a){var _0xac14ad=_0x48ba5a[_0xe9f0('0xec')]!==null;var _0x123951=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],_0xe9f0('0xef'));if(_0xac14ad){_0x123951=path[_0xe9f0('0xed')](_0x123951,_0xe9f0('0xf0'));}var _0x302279=path[_0xe9f0('0xed')](_0x123951,_0x48ba5a[_0xe9f0('0xf1')]);return _0x2446b3[_0xe9f0('0xf2')](_0x302279);}})['catch'](handleError(_0x2446b3,null));};exports[_0xe9f0('0xf3')]=function(_0x473602,_0x3cadbd){var _0x58fe38=null;var _0x1b37f7=null;var _0x4a3765=null;var _0x5964af=null;if(_0x473602[_0xe9f0('0x7f')]['id']){delete _0x473602['body']['id'];}if(_0x473602[_0xe9f0('0x7f')]['mailTranscript']){_0x5964af=path['join'](config[_0xe9f0('0xee')],_0xe9f0('0xf4'),util[_0xe9f0('0xf5')]('transcript-%s.txt',Date[_0xe9f0('0xf6')]()));_0x473602[_0xe9f0('0x7f')][_0xe9f0('0xf7')]=_0x5964af;}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x473602[_0xe9f0('0xc7')]['id']},'include':[{'model':db[_0xe9f0('0xf8')],'as':_0xe9f0('0xf9'),'include':[{'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x7c')}]}]})[_0xe9f0('0x21')](handleEntityNotFound(_0x3cadbd,null))[_0xe9f0('0x21')](saveUpdates(_0x473602[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](function(_0x56a50c){if(_0x56a50c){_0x58fe38=_0x56a50c;return db[_0xe9f0('0xca')][_0xe9f0('0x6e')]({'where':{'id':_0x58fe38[_0xe9f0('0x83')]}});}})[_0xe9f0('0x21')](function(_0x2136dc){if(_0x2136dc){_0x4a3765=_0x2136dc;return db[_0xe9f0('0xdb')][_0xe9f0('0x6e')]({'where':{'id':_0x58fe38[_0xe9f0('0x75')]}});}})['then'](function(_0x296efe){if(_0x296efe){_0x1b37f7=_0x296efe;if(_0x5964af){var _0x504875=null;for(var _0x46e2fe=0x1;_0x46e2fe<_0x58fe38[_0xe9f0('0xf9')][_0xe9f0('0x50')];++_0x46e2fe){_0x504875=_0x58fe38[_0xe9f0('0xf9')][_0x46e2fe];var _0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')]('%s%d',_0x4a3765[_0xe9f0('0xfa')],_0x504875['UserId']):_0xe9f0('0xfb');var _0x419fdf=_0x473602['body']['customer']||util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0xe9f0('0xfd'),_0x504875[_0xe9f0('0x75')]);switch(_0x4a3765[_0xe9f0('0xfe')]){case _0xe9f0('0xff'):_0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0x4a3765[_0xe9f0('0xfa')],_0x504875[_0xe9f0('0x7e')]):_0xe9f0('0xfb');break;case _0xe9f0('0x100'):_0x329aa8=_0x504875['UserId']?_0x504875[_0xe9f0('0x7c')]['alias']||_0x504875['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb');break;case _0xe9f0('0x101'):_0x329aa8=_0x504875[_0xe9f0('0x7e')]?_0x504875['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb');break;default:_0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0x4a3765['agentAlias'],_0x504875[_0xe9f0('0x7e')]):_0xe9f0('0xfb');}var _0x5293e4=util[_0xe9f0('0xf5')]('[%s]\x20%s:\x20%s\x0a',moment(_0x504875[_0xe9f0('0x86')])[_0xe9f0('0xf5')](_0xe9f0('0x102')),_0x504875[_0xe9f0('0x103')]==='in'?_0x419fdf:_0x329aa8,_0x504875[_0xe9f0('0x7f')]);if(!_0x504875[_0xe9f0('0x104')]){fs[_0xe9f0('0x105')](_0x5964af,_0x5293e4);}}return db[_0xe9f0('0x106')][_0xe9f0('0xe9')]({'where':{'service':!![]},'include':[{'model':db[_0xe9f0('0x107')],'as':'Smtp','raw':!![]}]});}}})[_0xe9f0('0x21')](function(_0x52919a){if(_0x52919a&&_0x52919a[_0xe9f0('0x108')]&&_0x473602[_0xe9f0('0x7f')]){var _0x509bb7={'tls':{'rejectUnauthorized':![]}};if(_0x52919a['Smtp']['service']){_0x509bb7[_0xe9f0('0x109')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x109')];}else{_0x509bb7[_0xe9f0('0x10a')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x10a')];_0x509bb7[_0xe9f0('0x10b')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x10b')];_0x509bb7['secure']=_0x52919a['Smtp'][_0xe9f0('0x10c')];}if(_0x52919a['Smtp'][_0xe9f0('0x10d')]){_0x509bb7[_0xe9f0('0x10e')]={'user':_0x52919a[_0xe9f0('0x108')][_0xe9f0('0xa1')],'pass':_0x52919a[_0xe9f0('0x108')]['pass']};}return respondWithRpcPromise(_0xe9f0('0x10f'),_0xe9f0('0x110'),{'account':_0x509bb7,'message':{'from':util[_0xe9f0('0xf5')](_0xe9f0('0x111'),_0x52919a[_0xe9f0('0x3a')],_0x52919a['email']||_0x52919a[_0xe9f0('0x108')][_0xe9f0('0xa1')]),'to':_0x473602['body'][_0xe9f0('0x112')],'subject':_0xe9f0('0x113'),'text':util[_0xe9f0('0xf5')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x473602['body'][_0xe9f0('0x112')]),'attachments':[{'path':_0x5964af}]}})[_0xe9f0('0x21')](function(){return _0x58fe38;})[_0xe9f0('0x2b')](function(_0x4e4045){console['error'](_0x4e4045);});}else{return _0x58fe38;}})[_0xe9f0('0x21')](respondWithStatusCode(_0x3cadbd,0xc8))[_0xe9f0('0x2b')](handleError(_0x3cadbd,null));};exports[_0xe9f0('0x114')]=function(_0x4ee4f9,_0x3d4e42,_0x108042){return db[_0xe9f0('0xf8')][_0xe9f0('0x6e')]({'where':{'id':_0x4ee4f9[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x3d4e42,null))['then'](function(_0x218ee5){if(_0x218ee5){return _0x218ee5[_0xe9f0('0x114')](_0x4ee4f9[_0xe9f0('0x7f')][_0xe9f0('0x115')],_[_0xe9f0('0x116')](_0x4ee4f9[_0xe9f0('0x7f')],[_0xe9f0('0x115'),'id'])||{});}})[_0xe9f0('0x21')](respondWithResult(_0x3d4e42,null))[_0xe9f0('0x2b')](handleError(_0x3d4e42,null));};exports[_0xe9f0('0x117')]=function(_0x302ea1,_0x267c6d,_0x6f6f84){var _0xa4fd68={'raw':![],'where':{}};var _0x444df7={};var _0xd6a343={'count':0x0,'rows':[]};return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0x302ea1['params']['id']}})['then'](handleEntityNotFound(_0x267c6d,null))[_0xe9f0('0x21')](function(_0xfa1b2){if(_0xfa1b2){_0x444df7['model']=_[_0xe9f0('0x4c')](db['ChatMessage'][_0xe9f0('0x46')]);_0x444df7[_0xe9f0('0x4b')]=_['keys'](_0x302ea1[_0xe9f0('0x4b')]);_0x444df7['filters']=_[_0xe9f0('0x118')](_0x444df7['model'],_0x444df7['query']);_0xa4fd68[_0xe9f0('0x4e')]=_[_0xe9f0('0x118')](_0x444df7['model'],qs[_0xe9f0('0x4f')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x4f')]));_0xa4fd68[_0xe9f0('0x4e')]=_0xa4fd68[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0xa4fd68['attributes']:_0x444df7[_0xe9f0('0x49')];if(!_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x51')](_0xe9f0('0x52'))){_0xa4fd68['limit']=qs[_0xe9f0('0x31')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0xa4fd68[_0xe9f0('0x2f')]=qs[_0xe9f0('0x2f')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0xa4fd68[_0xe9f0('0x53')]=qs[_0xe9f0('0x119')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x119')]);_0xa4fd68[_0xe9f0('0x54')]=qs['filters'](_[_0xe9f0('0x55')](_0x302ea1[_0xe9f0('0x4b')],_0x444df7[_0xe9f0('0x4d')]));_0xa4fd68['where'][_0xe9f0('0xc0')]=_0xfa1b2['id'];if(_0x302ea1[_0xe9f0('0x4b')]['filter']){_0xa4fd68[_0xe9f0('0x54')]=_[_0xe9f0('0x3d')](_0xa4fd68[_0xe9f0('0x54')],{'$or':_[_0xe9f0('0x4a')](_0xa4fd68[_0xe9f0('0x4e')],function(_0x40b24c){var _0x71ea35={};_0x71ea35[_0x40b24c]={'$like':'%'+_0x302ea1['query']['filter']+'%'};return _0x71ea35;})});}if(_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x87')]){var _0x2ecef9=_0x302ea1['query'][_0xe9f0('0x87')]['split'](',');var _0x52a628={};_0x52a628[_0x2ecef9[0x0]]={'$gte':moment(_0x2ecef9[0x1])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))};_0xa4fd68['where']=_[_0xe9f0('0x3d')](_0xa4fd68[_0xe9f0('0x54')],_0x52a628);}_0xa4fd68=_[_0xe9f0('0x3d')]({},_0xa4fd68,_0x302ea1[_0xe9f0('0xc5')]);return db[_0xe9f0('0xf8')][_0xe9f0('0x32')]({'where':_0xa4fd68[_0xe9f0('0x54')]})[_0xe9f0('0x21')](function(_0x90b257){_0xd6a343[_0xe9f0('0x32')]=_0x90b257;if(_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0xc3')]){_0xa4fd68[_0xe9f0('0xc4')]=[{'all':!![]}];}return db[_0xe9f0('0xf8')][_0xe9f0('0x11b')](_0xa4fd68);})[_0xe9f0('0x21')](function(_0x48e968){_0xd6a343['rows']=_0x48e968;return _0xd6a343;});}})[_0xe9f0('0x21')](respondWithFilteredResult(_0x267c6d,_0xa4fd68))[_0xe9f0('0x2b')](handleError(_0x267c6d,null));};exports['getMyMessages']=function(_0xc39799,_0x5efe58,_0x216fe9){var _0x7cc418={'where':{}},_0x32805e={},_0x4a3225={'count':0x0,'rows':[]};return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0xc39799[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x5efe58,null))[_0xe9f0('0x21')](function(_0x2391b7){if(_0x2391b7){_0x32805e[_0xe9f0('0x49')]=_[_0xe9f0('0x4c')](db[_0xe9f0('0xf8')]['rawAttributes']);_0x32805e['query']=_[_0xe9f0('0x4c')](_0xc39799[_0xe9f0('0x4b')]);_0x32805e['filters']=_[_0xe9f0('0x118')](_0x32805e['model'],_0x32805e[_0xe9f0('0x4b')]);_0x7cc418[_0xe9f0('0x4e')]=_[_0xe9f0('0x118')](_0x32805e[_0xe9f0('0x49')],qs['fields'](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x4f')]));_0x7cc418[_0xe9f0('0x4e')]=_0x7cc418[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x7cc418[_0xe9f0('0x4e')]:_0x32805e[_0xe9f0('0x49')];if(!_0xc39799[_0xe9f0('0x4b')]['hasOwnProperty']('nolimit')){_0x7cc418[_0xe9f0('0x31')]=qs[_0xe9f0('0x31')](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0x7cc418['offset']=qs[_0xe9f0('0x2f')](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0x7cc418['order']=qs[_0xe9f0('0x119')](_0xc39799[_0xe9f0('0x4b')]['sort']);_0x7cc418[_0xe9f0('0x54')]=qs[_0xe9f0('0x4d')](_[_0xe9f0('0x55')](_0xc39799[_0xe9f0('0x4b')],_0x32805e[_0xe9f0('0x4d')]));_0x7cc418[_0xe9f0('0x54')]['ChatInteractionId']=_0x2391b7['id'];if(_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x92')]){_0x7cc418[_0xe9f0('0x54')]=_[_0xe9f0('0x3d')](_0x7cc418['where'],{'$or':_[_0xe9f0('0x4a')](_0x7cc418['attributes'],function(_0x1ad83c){var _0x388dad={};_0x388dad[_0x1ad83c]={'$like':'%'+_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x92')]+'%'};return _0x388dad;})});}_0x7cc418[_0xe9f0('0x54')][_0xe9f0('0x104')]=![];if(_0xc39799[_0xe9f0('0x4b')]['id']){_0x7cc418[_0xe9f0('0x54')]['id']={'$gt':_0xc39799['query']['id']};}_0x7cc418=_[_0xe9f0('0x3d')]({},_0x7cc418,_0xc39799[_0xe9f0('0xc5')]);return db[_0xe9f0('0xf8')][_0xe9f0('0x32')]({'where':_0x7cc418[_0xe9f0('0x54')]})['then'](function(_0x198900){_0x4a3225[_0xe9f0('0x32')]=_0x198900;_0x7cc418['include']=[];if(_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x11c')]){_0x7cc418['include'][_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':'User','attributes':['id',_0xe9f0('0x40'),_0xe9f0('0x11d')]});}if(_0xc39799['query']['includeAll']){_0x7cc418['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x7cc418);})[_0xe9f0('0x21')](function(_0x266c0f){_0x4a3225[_0xe9f0('0x11e')]=_0x266c0f;return _0x4a3225;});}})['then'](respondWithFilteredResult(_0x5efe58,_0x7cc418))[_0xe9f0('0x2b')](handleError(_0x5efe58,null));};exports[_0xe9f0('0x11f')]=function(_0x548542,_0xdd7ded,_0x16b798){return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x548542['params']['id']}})['then'](handleEntityNotFound(_0xdd7ded,null))['then'](function(_0x2ebe48){if(_0x2ebe48){return _0x2ebe48['setTags'](_0x548542[_0xe9f0('0x7f')]['ids'],_['omit'](_0x548542[_0xe9f0('0x7f')],['ids','id'])||{})[_0xe9f0('0x120')](function(){return db[_0xe9f0('0x79')][_0xe9f0('0x11b')]({'attributes':['id',_0xe9f0('0x3a'),'color'],'where':{'id':_0x548542[_0xe9f0('0x7f')]['ids']}});})[_0xe9f0('0x21')](function(_0x107363){socket[_0xe9f0('0x121')]('chatInteractionTags:save',{'id':Number(_0x548542[_0xe9f0('0xc7')]['id']),'tags':_0x107363||[]});return{'id':Number(_0x548542[_0xe9f0('0xc7')]['id']),'tags':_0x107363||[]};});}})[_0xe9f0('0x21')](respondWithResult(_0xdd7ded,null))['catch'](handleError(_0xdd7ded,null));};exports['removeTags']=function(_0x257fc2,_0x58c366,_0x306620){return db['ChatInteraction'][_0xe9f0('0x6e')]({'where':{'id':_0x257fc2[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x58c366,null))[_0xe9f0('0x21')](function(_0x13e1bd){if(_0x13e1bd){return _0x13e1bd[_0xe9f0('0x122')](_0x257fc2[_0xe9f0('0x4b')]['ids']);}})[_0xe9f0('0x21')](respondWithStatusCode(_0x58c366,null))['catch'](handleError(_0x58c366,null));};exports[_0xe9f0('0xf2')]=function(_0x37d384,_0x35de8c){var _0x1da405=moment()['unix']()[_0xe9f0('0xa6')]();var _0x1e3715=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],_0xe9f0('0x123'),'files',_0xe9f0('0x124'));var _0x31a744=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],'server',_0xe9f0('0x125'),_0xe9f0('0x126'));var _0x1cc3b2=path[_0xe9f0('0xed')](_0x1e3715,_0x1da405);var _0x450684=util[_0xe9f0('0xf5')](_0xe9f0('0x127'),_0x37d384['params']['id'],_0x1da405);var _0x2163d8=path[_0xe9f0('0xed')](_0x1e3715,_0x450684);var _0x2dd6d1=[];_0x2dd6d1[_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x7c'),'attributes':['id',_0xe9f0('0x40')],'raw':!![]});_0x2dd6d1[_0xe9f0('0xc1')]({'model':db['CmContact'],'as':_0xe9f0('0x128'),'attributes':['id',_0xe9f0('0x129'),'lastName'],'raw':!![]});if(_0x37d384[_0xe9f0('0x4b')][_0xe9f0('0x126')]){_0x2dd6d1[_0xe9f0('0xc1')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x36e6b0=[{'model':db['ChatMessage'],'as':_0xe9f0('0xf9'),'attributes':['id',_0xe9f0('0x7f'),_0xe9f0('0x86'),_0xe9f0('0x103'),'secret',_0xe9f0('0x8d')],'include':_0x2dd6d1}];_0x36e6b0['push']({'model':db['ChatWebsite'],'as':_0xe9f0('0x12a'),'attributes':['id',_0xe9f0('0x3a')]});_0x36e6b0[_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x12b'),'attributes':['id',_0xe9f0('0x40')]});return db['ChatInteraction'][_0xe9f0('0x6e')]({'where':{'id':_0x37d384['params']['id']},'include':_0x36e6b0})[_0xe9f0('0x21')](handleEntityNotFound(_0x35de8c,null))[_0xe9f0('0x21')](function(_0x193cb2){if(_0x193cb2){var _0x3cb18a=_0x193cb2['get']({'plain':!![]});fs[_0xe9f0('0x12c')](_0x1cc3b2);var _0x3e49a0={'channel':'Chat','account':_0x3cb18a[_0xe9f0('0x12a')][_0xe9f0('0x3a')],'agent':_0x3cb18a[_0xe9f0('0x12b')]?_0x3cb18a['Owner']['fullname']:'N.A.','createdAt':moment(_0x3cb18a[_0xe9f0('0x86')])[_0xe9f0('0xf5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9f0('0xa6')](),'closedAt':_0x3cb18a[_0xe9f0('0xe0')]?moment(_0x3cb18a[_0xe9f0('0x12d')])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))[_0xe9f0('0xa6')]():'','disposition':_0x3cb18a[_0xe9f0('0xe1')],'chatInfo':{'browser':_0x3cb18a[_0xe9f0('0x12e')],'os':_0x3cb18a['osName'],'referer':_0x3cb18a[_0xe9f0('0x12f')],'customerIp':_0x3cb18a[_0xe9f0('0x130')],'customerPort':_0x3cb18a[_0xe9f0('0x131')]?_0x3cb18a[_0xe9f0('0x131')]:_0xe9f0('0x132')},'messages':_(_0x3cb18a['Messages'])[_0xe9f0('0x133')]()['filter']({'secret':![]})[_0xe9f0('0x4a')](function(_0xa78163){if(_0xa78163[_0xe9f0('0xe7')]){var _0x3b422c=path[_0xe9f0('0xed')](_0x31a744,_0xa78163['Attachment'][_0xe9f0('0xf1')]);if(fs[_0xe9f0('0x134')](_0x3b422c)){fs['createReadStream'](_0x3b422c)[_0xe9f0('0x135')](fs[_0xe9f0('0x136')](path['join'](_0x1cc3b2,_0xa78163[_0xe9f0('0xe7')][_0xe9f0('0xf1')])));}}return{'date':moment(_0xa78163[_0xe9f0('0x86')])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))[_0xe9f0('0xa6')](),'sender':_0xa78163[_0xe9f0('0x103')]===_0xe9f0('0xd7')?_0xa78163[_0xe9f0('0x7c')]?_0xa78163['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb'):_0xa78163[_0xe9f0('0x128')]['firstName']+(_0xa78163['Contact'][_0xe9f0('0x137')]?'\x20'+_0xa78163[_0xe9f0('0x128')]['lastName']:''),'body':_0xa78163[_0xe9f0('0xe7')]?_0xa78163['Attachment']['basename']:_0xa78163['body'],'direction':_0xa78163['direction']===_0xe9f0('0xd7')?'A':'C','secret':_0xa78163[_0xe9f0('0x104')],'read':_0xa78163['read'],'attachment':_0xa78163[_0xe9f0('0xe7')]};})[_0xe9f0('0x72')]()};return ejs['renderFile'](path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],'server','views',_0xe9f0('0x138')),{'interaction':_0x3e49a0})['then'](function(_0x27f0d9){var _0x296c10=path[_0xe9f0('0xed')](_0x1cc3b2,_0xe9f0('0x139')+_0x3cb18a['id']+'-'+_0x1da405+'.pdf');var _0x484e2d={'path':_0x296c10,'channel':_0xe9f0('0x13a'),'interactionId':_0x3cb18a['id']};return pdf[_0xe9f0('0x13b')](_0x27f0d9,_0x484e2d);})[_0xe9f0('0x21')](function(){return new BPromise(function(_0x1cf653,_0x571169){zipdir(_0x1cc3b2,{'saveTo':_0x2163d8},function(_0x1f25ea,_0x524711){if(_0x1f25ea)return _0x571169(_0x1f25ea);return _0x1cf653(_0x524711);});})[_0xe9f0('0x21')](function(){return new BPromise(function(_0xbb7e33,_0x2e2fb9){rimraf(_0x1cc3b2,function(_0x51d788){if(_0x51d788)_0x2e2fb9(_0x51d788);return _0xbb7e33();});});})[_0xe9f0('0x21')](function(){return _0x35de8c[_0xe9f0('0xf2')](_0x2163d8,_0x450684,function(_0x4da74e){if(_0x4da74e){console['log'](_0xe9f0('0x13c'),_0x4da74e);}else{fs['unlinkSync'](_0x2163d8);}});});});}else{return _0x35de8c['sendStatus'](0xc8);}})[_0xe9f0('0x2b')](handleError(_0x35de8c,null));};
\ No newline at end of file
+var _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x40c4dd,_0x5b3f96){var _0x3f2776=function(_0x1eb9cf){while(--_0x1eb9cf){_0x40c4dd['push'](_0x40c4dd['shift']());}};_0x3f2776(++_0x5b3f96);}(_0x4fc2,0x111));var _0x24fc=function(_0x4bfedd,_0xddfbf8){_0x4bfedd=_0x4bfedd-0x0;var _0x2e925c=_0x4fc2[_0x4bfedd];return _0x2e925c;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 1e38fec..422aea3 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 _0x8088=['exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x8088,0x101));var _0x8808=function(_0x3dd087,_0x176b99){_0x3dd087=_0x3dd087-0x0;var _0x54ef1d=_0x8088[_0x3dd087];return _0x54ef1d;};'use strict';var EventEmitter=require(_0x8808('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x8808('0x1')];var ChatMessage=require(_0x8808('0x2'))['db'][_0x8808('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8808('0x4')](0x0);var events={'afterCreate':_0x8808('0x5'),'afterUpdate':_0x8808('0x6'),'afterDestroy':'remove'};function emitEvent(_0x240d75){return function(_0x5a53fa,_0x22ef86,_0x216b49){_0x5a53fa['getUsers']({'attributes':['id'],'raw':!![]})[_0x8808('0x7')](function(_0x3140c1){_0x5a53fa[_0x8808('0x8')]('Users',_0x3140c1['map'](function(_0xb2bcad){return{'id':_0xb2bcad['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5a53fa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8808('0x7')](function(_0x4c1127){_0x5a53fa[_0x8808('0x8')](_0x8808('0x9'),_0x4c1127[_0x8808('0xa')]);ChatInteractionEvents[_0x8808('0xb')](_0x240d75+':'+_0x5a53fa['id'],_0x5a53fa);ChatInteractionEvents[_0x8808('0xb')](_0x240d75,_0x5a53fa);_0x216b49(null);})[_0x8808('0xc')](_0x216b49(null));};}for(var e in events){if(events[_0x8808('0xd')](e)){var event=events[e];ChatInteraction[_0x8808('0xe')](e,emitEvent(event));}}module[_0x8808('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9d2b=['exports','events','../../mysqldb','ChatMessage','save','update','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x27fa65,_0x4e02ee){var _0x456594=function(_0x43b6da){while(--_0x43b6da){_0x27fa65['push'](_0x27fa65['shift']());}};_0x456594(++_0x4e02ee);}(_0x9d2b,0x79));var _0xb9d2=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9d2b[_0x56916d];return _0x2b7f1f;};'use strict';var EventEmitter=require(_0xb9d2('0x0'));var ChatInteraction=require(_0xb9d2('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xb9d2('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb9d2('0x3'),'afterUpdate':_0xb9d2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x292098){return function(_0x405623,_0x286ad0,_0x1e5796){_0x405623['getUsers']({'attributes':['id'],'raw':!![]})[_0xb9d2('0x5')](function(_0x5a7bc9){_0x405623[_0xb9d2('0x6')]('Users',_0x5a7bc9[_0xb9d2('0x7')](function(_0x4a93cd){return{'id':_0x4a93cd['id']};}));return ChatMessage[_0xb9d2('0x8')]({'where':{'ChatInteractionId':_0x405623['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb9d2('0x5')](function(_0x1f4458){_0x405623[_0xb9d2('0x6')]('unreadMessages',_0x1f4458[_0xb9d2('0x9')]);ChatInteractionEvents[_0xb9d2('0xa')](_0x292098+':'+_0x405623['id'],_0x405623);ChatInteractionEvents[_0xb9d2('0xa')](_0x292098,_0x405623);_0x1e5796(null);})[_0xb9d2('0xb')](_0x1e5796(null));};}for(var e in events){if(events[_0xb9d2('0xc')](e)){var event=events[e];ChatInteraction[_0xb9d2('0xd')](e,emitEvent(event));}}module[_0xb9d2('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 8fa6a9b..c740556 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 _0xdeb5=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xdeb5,0x70));var _0x5deb=function(_0xb40054,_0x54b30e){_0xb40054=_0xb40054-0x0;var _0x15cc8e=_0xdeb5[_0xb40054];return _0x15cc8e;};'use strict';var _=require(_0x5deb('0x0'));var util=require(_0x5deb('0x1'));var logger=require(_0x5deb('0x2'))(_0x5deb('0x3'));var moment=require('moment');var BPromise=require(_0x5deb('0x4'));var rp=require(_0x5deb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5deb('0x6'));var config=require(_0x5deb('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x5deb('0x8')]=function(_0x31bad7,_0x6aeefe){return _0x31bad7[_0x5deb('0x9')](_0x5deb('0xa'),attributes,{'tableName':_0x5deb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29acee,_0x5f0af1,_0x56c160){if(_0x29acee[_0x5deb('0xc')](_0x5deb('0xd'))){_0x29acee['closedAt']=moment()['format'](_0x5deb('0xe'));}_0x56c160(null,_0x29acee);}},'charset':_0x5deb('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6b9c=['lodash','util','api','moment','bluebird','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x465cb7,_0x4d1e5e){var _0x2f9ae5=function(_0x5cda38){while(--_0x5cda38){_0x465cb7['push'](_0x465cb7['shift']());}};_0x2f9ae5(++_0x4d1e5e);}(_0x6b9c,0x190));var _0xc6b9=function(_0x4b17c5,_0x5710d4){_0x4b17c5=_0x4b17c5-0x0;var _0x5eed8c=_0x6b9c[_0x4b17c5];return _0x5eed8c;};'use strict';var _=require(_0xc6b9('0x0'));var util=require(_0xc6b9('0x1'));var logger=require('../../config/logger')(_0xc6b9('0x2'));var moment=require(_0xc6b9('0x3'));var BPromise=require(_0xc6b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6b9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc6b9('0x6'));module[_0xc6b9('0x7')]=function(_0x4d809b,_0x58a615){return _0x4d809b[_0xc6b9('0x8')](_0xc6b9('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d787a,_0x1b7de7,_0x109a42){if(_0x2d787a[_0xc6b9('0xa')](_0xc6b9('0xb'))){_0x2d787a[_0xc6b9('0xc')]=moment()['format'](_0xc6b9('0xd'));}_0x109a42(null,_0x2d787a);}},'charset':_0xc6b9('0xe'),'collate':_0xc6b9('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index c0cd5c2..15b1bff 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 _0x275a=['bluebird','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','info','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x275a,0x6c));var _0xa275=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x275a[_0x28611e];return _0x530f69;};'use strict';var _=require(_0xa275('0x0'));var util=require(_0xa275('0x1'));var moment=require(_0xa275('0x2'));var BPromise=require(_0xa275('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa275('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa275('0x5'));var jayson=require(_0xa275('0x6'));var client=jayson['client'][_0xa275('0x7')]({'port':0x232a});config['redis']=_[_0xa275('0x8')](config[_0xa275('0x9')],{'host':_0xa275('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa275('0xb'))[_0xa275('0xc')](socket);function respondWithRpcPromise(_0x594fe3,_0x539fe6,_0x52c958){return new BPromise(function(_0x2d2d86,_0x5e4f90){return client['request'](_0x594fe3,_0x52c958)[_0xa275('0xd')](function(_0x5509d8){logger['info'](_0xa275('0xe'),_0x539fe6,_0xa275('0xf'));logger[_0xa275('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x539fe6,_0xa275('0xf'),JSON[_0xa275('0x11')](_0x5509d8));if(_0x5509d8[_0xa275('0x12')]){if(_0x5509d8[_0xa275('0x12')]['code']===0x1f4){logger['error'](_0xa275('0xe'),_0x539fe6,_0x5509d8[_0xa275('0x12')][_0xa275('0x13')]);return _0x5e4f90(_0x5509d8['error']['message']);}logger[_0xa275('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x539fe6,_0x5509d8[_0xa275('0x12')]['message']);return _0x2d2d86(_0x5509d8['error'][_0xa275('0x13')]);}else{logger['info'](_0xa275('0xe'),_0x539fe6,'request\x20sent');_0x2d2d86(_0x5509d8['result'][_0xa275('0x13')]);}})[_0xa275('0x14')](function(_0xdcfd58){logger[_0xa275('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x539fe6,_0xdcfd58);_0x5e4f90(_0xdcfd58);});});}exports[_0xa275('0x15')]=function(_0x579bc5){var _0x57ee0b=this;return new Promise(function(_0x36f369,_0x5192e9){return db[_0xa275('0x16')][_0xa275('0x17')](_0x579bc5[_0xa275('0x18')],{'raw':_0x579bc5[_0xa275('0x19')]?_0x579bc5[_0xa275('0x19')][_0xa275('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579bc5[_0xa275('0x19')]?_0x579bc5['options'][_0xa275('0x1b')]||null:null,'attributes':_0x579bc5[_0xa275('0x19')]?_0x579bc5[_0xa275('0x19')]['attributes']||null:null,'limit':_0x579bc5[_0xa275('0x19')]?_0x579bc5[_0xa275('0x19')][_0xa275('0x1c')]||null:null})[_0xa275('0xd')](function(_0x515b4d){logger[_0xa275('0x1d')](_0xa275('0x15'),_0x579bc5);logger['debug'](_0xa275('0x15'),_0x579bc5,JSON[_0xa275('0x11')](_0x515b4d));_0x36f369(_0x515b4d);})['catch'](function(_0x3f2e30){logger[_0xa275('0x12')](_0xa275('0x15'),_0x3f2e30[_0xa275('0x13')],_0x579bc5);_0x5192e9(_0x57ee0b['error'](0x1f4,_0x3f2e30[_0xa275('0x13')]));});});};exports[_0xa275('0x1e')]=function(_0x3d8530){return new Promise(function(_0x289c17,_0x8205a0){return db[_0xa275('0x16')][_0xa275('0x1f')]({'where':_0x3d8530[_0xa275('0x19')]?_0x3d8530['options'][_0xa275('0x1b')]||null:null})[_0xa275('0xd')](function(_0x363667){if(_0x363667){return _0x363667[_0xa275('0x20')](_0x3d8530['body'][_0xa275('0x21')],_[_0xa275('0x22')](_0x3d8530[_0xa275('0x18')],[_0xa275('0x21'),'id'])||{});}})[_0xa275('0x23')](function(_0x17d7c1){logger['info']('AddTags',_0x3d8530);logger[_0xa275('0x10')](_0xa275('0x24'),_0x3d8530,JSON[_0xa275('0x11')](_0x17d7c1));_0x289c17(_0x17d7c1);})[_0xa275('0x14')](function(_0x39cad1){logger[_0xa275('0x12')]('AddTags',_0x39cad1['message'],_0x3d8530);_0x8205a0(_this['error'](0x1f4,_0x39cad1[_0xa275('0x13')]));});});};
\ No newline at end of file
+var _0xd925=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateChatInteraction','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','omit','spread','debug','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x52c53e,_0xc63215){var _0x1f8c9b=function(_0x13d07a){while(--_0x13d07a){_0x52c53e['push'](_0x52c53e['shift']());}};_0x1f8c9b(++_0xc63215);}(_0xd925,0xf0));var _0x5d92=function(_0x13efa4,_0x432c5c){_0x13efa4=_0x13efa4-0x0;var _0x592491=_0xd925[_0x13efa4];return _0x592491;};'use strict';var _=require(_0x5d92('0x0'));var util=require(_0x5d92('0x1'));var moment=require('moment');var BPromise=require(_0x5d92('0x2'));var rs=require(_0x5d92('0x3'));var fs=require('fs');var Redis=require(_0x5d92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d92('0x5'));var logger=require(_0x5d92('0x6'))(_0x5d92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d92('0x8')][_0x5d92('0x9')]({'port':0x232a});config[_0x5d92('0xa')]=_[_0x5d92('0xb')](config['redis'],{'host':_0x5d92('0xc'),'port':0x18eb});var socket=require(_0x5d92('0xd'))(new Redis(config[_0x5d92('0xa')]));require(_0x5d92('0xe'))[_0x5d92('0xf')](socket);function respondWithRpcPromise(_0x466d26,_0x39de36,_0x5891dc){return new BPromise(function(_0x5c581d,_0x5ba44b){return client[_0x5d92('0x10')](_0x466d26,_0x5891dc)[_0x5d92('0x11')](function(_0x40668c){logger[_0x5d92('0x12')](_0x5d92('0x13'),_0x39de36,_0x5d92('0x14'));logger['debug'](_0x5d92('0x15'),_0x39de36,_0x5d92('0x14'),JSON['stringify'](_0x40668c));if(_0x40668c[_0x5d92('0x16')]){if(_0x40668c[_0x5d92('0x16')][_0x5d92('0x17')]===0x1f4){logger[_0x5d92('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x39de36,_0x40668c[_0x5d92('0x16')][_0x5d92('0x18')]);return _0x5ba44b(_0x40668c[_0x5d92('0x16')][_0x5d92('0x18')]);}logger[_0x5d92('0x16')](_0x5d92('0x13'),_0x39de36,_0x40668c[_0x5d92('0x16')]['message']);return _0x5c581d(_0x40668c[_0x5d92('0x16')][_0x5d92('0x18')]);}else{logger[_0x5d92('0x12')](_0x5d92('0x13'),_0x39de36,_0x5d92('0x14'));_0x5c581d(_0x40668c['result'][_0x5d92('0x18')]);}})['catch'](function(_0x236e52){logger[_0x5d92('0x16')](_0x5d92('0x13'),_0x39de36,_0x236e52);_0x5ba44b(_0x236e52);});});}exports[_0x5d92('0x19')]=function(_0xb15641){var _0x570635=this;return new Promise(function(_0x47e739,_0x18f981){return db['ChatInteraction']['update'](_0xb15641['body'],{'raw':_0xb15641[_0x5d92('0x1a')]?_0xb15641[_0x5d92('0x1a')][_0x5d92('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb15641[_0x5d92('0x1a')]?_0xb15641[_0x5d92('0x1a')][_0x5d92('0x1c')]||null:null,'attributes':_0xb15641[_0x5d92('0x1a')]?_0xb15641[_0x5d92('0x1a')][_0x5d92('0x1d')]||null:null,'limit':_0xb15641[_0x5d92('0x1a')]?_0xb15641['options'][_0x5d92('0x1e')]||null:null})[_0x5d92('0x11')](function(_0x338d53){logger[_0x5d92('0x12')](_0x5d92('0x19'),_0xb15641);logger['debug']('UpdateChatInteraction',_0xb15641,JSON['stringify'](_0x338d53));_0x47e739(_0x338d53);})[_0x5d92('0x1f')](function(_0x5a9a94){logger[_0x5d92('0x16')](_0x5d92('0x19'),_0x5a9a94[_0x5d92('0x18')],_0xb15641);_0x18f981(_0x570635[_0x5d92('0x16')](0x1f4,_0x5a9a94['message']));});});};exports[_0x5d92('0x20')]=function(_0xcf46c1){return new Promise(function(_0x5c811d,_0x2294e8){return db[_0x5d92('0x21')][_0x5d92('0x22')]({'where':_0xcf46c1['options']?_0xcf46c1[_0x5d92('0x1a')][_0x5d92('0x1c')]||null:null})[_0x5d92('0x11')](function(_0x552b1d){if(_0x552b1d){return _0x552b1d[_0x5d92('0x23')](_0xcf46c1[_0x5d92('0x24')][_0x5d92('0x25')],_[_0x5d92('0x26')](_0xcf46c1[_0x5d92('0x24')],[_0x5d92('0x25'),'id'])||{});}})[_0x5d92('0x27')](function(_0x32fabc){logger[_0x5d92('0x12')]('AddTags',_0xcf46c1);logger[_0x5d92('0x28')](_0x5d92('0x29'),_0xcf46c1,JSON[_0x5d92('0x2a')](_0x32fabc));_0x5c811d(_0x32fabc);})[_0x5d92('0x1f')](function(_0x2e80e8){logger[_0x5d92('0x16')](_0x5d92('0x29'),_0x2e80e8[_0x5d92('0x18')],_0xcf46c1);_0x2294e8(_this['error'](0x1f4,_0x2e80e8[_0x5d92('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0add4c3..fbbe5ce 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 _0xa26a=['remove','update','emit','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x53e90d,_0x3546fc){var _0x443b0f=function(_0x46ccbd){while(--_0x46ccbd){_0x53e90d['push'](_0x53e90d['shift']());}};_0x443b0f(++_0x3546fc);}(_0xa26a,0x1e6));var _0xaa26=function(_0x1d3eae,_0x5cd263){_0x1d3eae=_0x1d3eae-0x0;var _0x432dd0=_0xa26a[_0x1d3eae];return _0x432dd0;};'use strict';var ChatInteractionEvents=require(_0xaa26('0x0'));var events=[_0xaa26('0x1'),_0xaa26('0x2'),_0xaa26('0x3')];function createListener(_0x290dae,_0x32248c){return function(_0x4a3f31){_0x32248c[_0xaa26('0x4')](_0x290dae,_0x4a3f31);};}function removeListener(_0x13d122,_0x3ccedd){return function(){ChatInteractionEvents['removeListener'](_0x13d122,_0x3ccedd);};}exports[_0xaa26('0x5')]=function(_0x52b54d){for(var _0x1be84a=0x0,_0x4ec5a=events[_0xaa26('0x6')];_0x1be84a<_0x4ec5a;_0x1be84a++){var _0x59e2a3=events[_0x1be84a];var _0x2135ff=createListener(_0xaa26('0x7')+_0x59e2a3,_0x52b54d);ChatInteractionEvents['on'](_0x59e2a3,_0x2135ff);}};
\ No newline at end of file
+var _0x3ec1=['update','emit','removeListener','chatInteraction:','./chatInteraction.events','save'];(function(_0xefca73,_0x2d7ab4){var _0x198ee5=function(_0x13117b){while(--_0x13117b){_0xefca73['push'](_0xefca73['shift']());}};_0x198ee5(++_0x2d7ab4);}(_0x3ec1,0x9a));var _0x13ec=function(_0x482bd9,_0x59faf1){_0x482bd9=_0x482bd9-0x0;var _0x2354b2=_0x3ec1[_0x482bd9];return _0x2354b2;};'use strict';var ChatInteractionEvents=require(_0x13ec('0x0'));var events=[_0x13ec('0x1'),'remove',_0x13ec('0x2')];function createListener(_0x5522c9,_0x33d941){return function(_0x59c325){_0x33d941[_0x13ec('0x3')](_0x5522c9,_0x59c325);};}function removeListener(_0x22dcd7,_0x1c09bb){return function(){ChatInteractionEvents[_0x13ec('0x4')](_0x22dcd7,_0x1c09bb);};}exports['register']=function(_0x57061){for(var _0x3e8693=0x0,_0x68a4af=events['length'];_0x3e8693<_0x68a4af;_0x3e8693++){var _0x2ccaf2=events[_0x3e8693];var _0x18d614=createListener(_0x13ec('0x5')+_0x2ccaf2,_0x57061);ChatInteractionEvents['on'](_0x2ccaf2,_0x18d614);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 827a221..461e2f1 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 _0x45cd=['getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','isAuthenticated'];(function(_0x47990f,_0x4e96d0){var _0x4b3674=function(_0x430320){while(--_0x430320){_0x47990f['push'](_0x47990f['shift']());}};_0x4b3674(++_0x4e96d0);}(_0x45cd,0xc7));var _0xd45c=function(_0x8e6d4d,_0x4f222c){_0x8e6d4d=_0x8e6d4d-0x0;var _0x9ae241=_0x45cd[_0x8e6d4d];return _0x9ae241;};'use strict';var multer=require(_0xd45c('0x0'));var util=require(_0xd45c('0x1'));var path=require(_0xd45c('0x2'));var timeout=require(_0xd45c('0x3'));var express=require(_0xd45c('0x4'));var router=express[_0xd45c('0x5')]();var fs_extra=require(_0xd45c('0x6'));var auth=require(_0xd45c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd45c('0x8'));router[_0xd45c('0x9')]('/',auth['isAuthenticated'](),controller[_0xd45c('0xa')]);router[_0xd45c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xd45c('0xb')]);router[_0xd45c('0x9')](_0xd45c('0xc'),auth[_0xd45c('0xd')](),controller[_0xd45c('0xe')]);router[_0xd45c('0x9')]('/:id/attachment_download',auth[_0xd45c('0xd')](),controller[_0xd45c('0xf')]);router[_0xd45c('0x9')]('/:id/messages',auth[_0xd45c('0x10')](),controller[_0xd45c('0x11')]);router['get'](_0xd45c('0x12'),auth[_0xd45c('0xd')](),controller[_0xd45c('0x13')]);router['get'](_0xd45c('0x14'),auth[_0xd45c('0x10')](),controller[_0xd45c('0x15')]);router[_0xd45c('0x16')]('/',auth[_0xd45c('0x10')](),controller['create']);router[_0xd45c('0x16')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xd45c('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x411c60,_0x525a82,_0x5d3101){_0x5d3101(null,path[_0xd45c('0x18')](config[_0xd45c('0x19')],_0xd45c('0x1a')));},'filename':function(_0x20bb8c,_0x5ee6a5,_0x39b9fc){_0x39b9fc(null,util[_0xd45c('0x1b')](_0xd45c('0x1c'),Date[_0xd45c('0x1d')](),_0x5ee6a5['originalname'][_0xd45c('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd45c('0x16')](_0xd45c('0x1f'),upload[_0xd45c('0x20')](_0xd45c('0x21')),controller[_0xd45c('0x22')]);router['post'](_0xd45c('0x23'),auth[_0xd45c('0xd')](),controller[_0xd45c('0x24')]);router[_0xd45c('0x16')](_0xd45c('0x25'),auth[_0xd45c('0x10')](),interaction[_0xd45c('0x26')](_0xd45c('0x27'),_0xd45c('0x28')),controller[_0xd45c('0x29')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked']('chat',_0xd45c('0x2a')),controller['update']);router[_0xd45c('0x2b')](_0xd45c('0x2c'),controller[_0xd45c('0x2d')]);router[_0xd45c('0x2b')](_0xd45c('0x2e'),auth[_0xd45c('0xd')](),controller[_0xd45c('0x2f')]);router[_0xd45c('0x2b')](_0xd45c('0x30'),controller[_0xd45c('0x31')]);router[_0xd45c('0x32')](_0xd45c('0xc'),auth[_0xd45c('0x10')](),interaction[_0xd45c('0x26')]('chat','chatinteraction:destroy'),controller[_0xd45c('0x33')]);router['delete'](_0xd45c('0x25'),auth[_0xd45c('0x10')](),controller[_0xd45c('0x34')]);module[_0xd45c('0x35')]=router;
\ No newline at end of file
+var _0x1e79=['../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4526f4,_0x46019f){var _0x51cd7a=function(_0x420c96){while(--_0x420c96){_0x4526f4['push'](_0x4526f4['shift']());}};_0x51cd7a(++_0x46019f);}(_0x1e79,0xd8));var _0x91e7=function(_0x4d8fc1,_0x1cd044){_0x4d8fc1=_0x4d8fc1-0x0;var _0x3bf05a=_0x1e79[_0x4d8fc1];return _0x3bf05a;};'use strict';var multer=require('multer');var util=require(_0x91e7('0x0'));var path=require(_0x91e7('0x1'));var timeout=require(_0x91e7('0x2'));var express=require(_0x91e7('0x3'));var router=express[_0x91e7('0x4')]();var fs_extra=require(_0x91e7('0x5'));var auth=require(_0x91e7('0x6'));var interaction=require(_0x91e7('0x7'));var config=require(_0x91e7('0x8'));var controller=require(_0x91e7('0x9'));router[_0x91e7('0xa')]('/',auth['isAuthenticated'](),controller[_0x91e7('0xb')]);router[_0x91e7('0xa')](_0x91e7('0xc'),auth[_0x91e7('0xd')](),controller[_0x91e7('0xe')]);router[_0x91e7('0xa')](_0x91e7('0xf'),auth[_0x91e7('0x10')](),controller[_0x91e7('0x11')]);router[_0x91e7('0xa')]('/:id/attachment_download',auth[_0x91e7('0x10')](),controller[_0x91e7('0x12')]);router[_0x91e7('0xa')](_0x91e7('0x13'),auth['isAuthenticated'](),controller[_0x91e7('0x14')]);router['get'](_0x91e7('0x15'),auth[_0x91e7('0x10')](),controller['getMyMessages']);router[_0x91e7('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x91e7('0x16')]);router[_0x91e7('0x17')]('/',auth[_0x91e7('0xd')](),controller[_0x91e7('0x18')]);router[_0x91e7('0x17')](_0x91e7('0x19'),auth[_0x91e7('0xd')](),controller[_0x91e7('0x1a')]);var upload=multer({'storage':multer[_0x91e7('0x1b')]({'destination':function(_0x34d6ac,_0x5be7e1,_0x10f01f){_0x10f01f(null,path[_0x91e7('0x1c')](config[_0x91e7('0x1d')],_0x91e7('0x1e')));},'filename':function(_0x1bf2d6,_0x4c7b8d,_0x4416b3){_0x4416b3(null,util[_0x91e7('0x1f')](_0x91e7('0x20'),Date[_0x91e7('0x21')](),_0x4c7b8d[_0x91e7('0x22')][_0x91e7('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x91e7('0x24')](_0x91e7('0x25')),controller['attachmentUpload']);router['post'](_0x91e7('0x13'),auth[_0x91e7('0x10')](),controller[_0x91e7('0x26')]);router[_0x91e7('0x17')](_0x91e7('0x27'),auth[_0x91e7('0xd')](),interaction['tracked']('chat',_0x91e7('0x28')),controller[_0x91e7('0x29')]);router[_0x91e7('0x2a')](_0x91e7('0xf'),auth[_0x91e7('0xd')](),interaction[_0x91e7('0x2b')](_0x91e7('0x2c'),_0x91e7('0x2d')),controller[_0x91e7('0x2e')]);router[_0x91e7('0x2a')](_0x91e7('0x2f'),controller[_0x91e7('0x30')]);router[_0x91e7('0x2a')](_0x91e7('0x31'),auth['isChatInteractionAuthorized'](),controller[_0x91e7('0x32')]);router[_0x91e7('0x2a')]('/:id/close',controller[_0x91e7('0x33')]);router[_0x91e7('0x34')](_0x91e7('0xf'),auth[_0x91e7('0xd')](),interaction[_0x91e7('0x2b')](_0x91e7('0x2c'),'chatinteraction:destroy'),controller[_0x91e7('0x35')]);router[_0x91e7('0x34')](_0x91e7('0x27'),auth[_0x91e7('0xd')](),controller[_0x91e7('0x36')]);module[_0x91e7('0x37')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f8b6551..b33c601 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 _0xaf3d=['medium','BOOLEAN','sequelize','exports'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xaf3d,0xfe));var _0xdaf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf3d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdaf3('0x0'));module[_0xdaf3('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdaf3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdaf3('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xef4d=['sequelize','exports','medium','INTEGER'];(function(_0x219379,_0x53362a){var _0x57fa33=function(_0x98d5d3){while(--_0x98d5d3){_0x219379['push'](_0x219379['shift']());}};_0x57fa33(++_0x53362a);}(_0xef4d,0x17c));var _0xdef4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xef4d[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdef4('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdef4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 00e27c7..a00069c 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 _0x5ca5=['online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','isEmpty','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','internal'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x5ca5,0xf8));var _0x55ca=function(_0x24de68,_0x409b0c){_0x24de68=_0x24de68-0x0;var _0x2f32a4=_0x5ca5[_0x24de68];return _0x2f32a4;};'use strict';var emlformat=require(_0x55ca('0x0'));var rimraf=require(_0x55ca('0x1'));var zipdir=require(_0x55ca('0x2'));var jsonpatch=require(_0x55ca('0x3'));var rp=require(_0x55ca('0x4'));var moment=require(_0x55ca('0x5'));var BPromise=require(_0x55ca('0x6'));var Mustache=require(_0x55ca('0x7'));var util=require(_0x55ca('0x8'));var path=require(_0x55ca('0x9'));var sox=require('sox');var csv=require(_0x55ca('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55ca('0xb'));var _=require(_0x55ca('0xc'));var squel=require(_0x55ca('0xd'));var crypto=require(_0x55ca('0xe'));var jsforce=require(_0x55ca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x55ca('0xa'));var querystring=require('querystring');var Papa=require(_0x55ca('0x10'));var Redis=require(_0x55ca('0x11'));var authService=require(_0x55ca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x55ca('0x13'));var hardwareService=require(_0x55ca('0x14'));var logger=require(_0x55ca('0x15'))(_0x55ca('0x16'));var utils=require(_0x55ca('0x17'));var config=require(_0x55ca('0x18'));var licenseUtil=require(_0x55ca('0x19'));var db=require(_0x55ca('0x1a'))['db'];config[_0x55ca('0x1b')]=_[_0x55ca('0x1c')](config['redis'],{'host':_0x55ca('0x1d'),'port':0x18eb});var socket=require(_0x55ca('0x1e'))(new Redis(config['redis']));require(_0x55ca('0x1f'))['register'](socket);function respondWithStatusCode(_0x4d91ba,_0x3c4682){_0x3c4682=_0x3c4682||0xcc;return function(_0x3b9a25){if(_0x3b9a25){return _0x4d91ba['sendStatus'](_0x3c4682);}return _0x4d91ba[_0x55ca('0x20')](_0x3c4682)[_0x55ca('0x21')]();};}function respondWithResult(_0x55d8df,_0xe6e48c){_0xe6e48c=_0xe6e48c||0xc8;return function(_0x3d61eb){if(_0x3d61eb){return _0x55d8df[_0x55ca('0x20')](_0xe6e48c)[_0x55ca('0x22')](_0x3d61eb);}};}function respondWithFilteredResult(_0xef4a61,_0x551a38){return function(_0x1e53a6){if(_0x1e53a6){var _0x5c28ec=typeof _0x551a38[_0x55ca('0x23')]===_0x55ca('0x24')&&typeof _0x551a38['limit']===_0x55ca('0x24');var _0x546da6=_0x1e53a6[_0x55ca('0x25')];var _0x3fcdc6=_0x5c28ec?0x0:_0x551a38[_0x55ca('0x23')];var _0x383d5a=_0x5c28ec?_0x1e53a6[_0x55ca('0x25')]:_0x551a38[_0x55ca('0x23')]+_0x551a38[_0x55ca('0x26')];var _0x2ebd2e;if(_0x383d5a>=_0x546da6){_0x383d5a=_0x546da6;_0x2ebd2e=0xc8;}else{_0x2ebd2e=0xce;}_0xef4a61[_0x55ca('0x20')](_0x2ebd2e);return _0xef4a61[_0x55ca('0x27')]('Content-Range',_0x3fcdc6+'-'+_0x383d5a+'/'+_0x546da6)[_0x55ca('0x22')](_0x1e53a6);}return null;};}function patchUpdates(_0x1df9c2){return function(_0x3ec35a){try{jsonpatch[_0x55ca('0x28')](_0x3ec35a,_0x1df9c2,!![]);}catch(_0x1a1560){return BPromise[_0x55ca('0x29')](_0x1a1560);}return _0x3ec35a[_0x55ca('0x2a')]();};}function saveUpdates(_0x11da87,_0xe2251d){return function(_0x2b34df){if(_0x2b34df){return _0x2b34df[_0x55ca('0x2b')](_0x11da87)[_0x55ca('0x2c')](function(_0x526d21){return _0x526d21;});}return null;};}function removeEntity(_0x40cc11,_0x5aaf76){return function(_0xec628b){if(_0xec628b){return _0xec628b[_0x55ca('0x2d')]()[_0x55ca('0x2c')](function(){_0x40cc11[_0x55ca('0x20')](0xcc)[_0x55ca('0x21')]();});}};}function handleEntityNotFound(_0x4e0f24,_0x1af53b){return function(_0x14fadb){if(!_0x14fadb){_0x4e0f24[_0x55ca('0x2e')](0x194);}return _0x14fadb;};}function handleError(_0x5c9dfc,_0x272059){_0x272059=_0x272059||0x1f4;return function(_0x708cf3){logger[_0x55ca('0x2f')](_0x708cf3['stack']);if(_0x708cf3[_0x55ca('0x30')]){delete _0x708cf3[_0x55ca('0x30')];}_0x5c9dfc[_0x55ca('0x20')](_0x272059)[_0x55ca('0x31')](_0x708cf3);};}exports[_0x55ca('0x32')]=function(_0x4caef3,_0x2d6f68){var _0x32e365={},_0x18dd35={},_0x1fd54a={'count':0x0,'rows':[]};var _0x1a67a0=_[_0x55ca('0x33')](db[_0x55ca('0x34')][_0x55ca('0x35')],function(_0x1dc328){return{'name':_0x1dc328['fieldName'],'type':_0x1dc328[_0x55ca('0x36')][_0x55ca('0x37')]};});_0x18dd35['model']=_['map'](_0x1a67a0,'name');_0x18dd35['query']=_[_0x55ca('0x38')](_0x4caef3[_0x55ca('0x39')]);_0x18dd35[_0x55ca('0x3a')]=_['intersection'](_0x18dd35[_0x55ca('0x3b')],_0x18dd35[_0x55ca('0x39')]);_0x32e365[_0x55ca('0x3c')]=_[_0x55ca('0x3d')](_0x18dd35[_0x55ca('0x3b')],qs['fields'](_0x4caef3[_0x55ca('0x39')][_0x55ca('0x3e')]));_0x32e365[_0x55ca('0x3c')]=_0x32e365[_0x55ca('0x3c')][_0x55ca('0x3f')]?_0x32e365['attributes']:_0x18dd35['model'];if(!_0x4caef3[_0x55ca('0x39')][_0x55ca('0x40')](_0x55ca('0x41'))){_0x32e365[_0x55ca('0x26')]=qs['limit'](_0x4caef3[_0x55ca('0x39')][_0x55ca('0x26')]);_0x32e365['offset']=qs[_0x55ca('0x23')](_0x4caef3[_0x55ca('0x39')][_0x55ca('0x23')]);}_0x32e365['order']=qs['sort'](_0x4caef3[_0x55ca('0x39')]['sort']);_0x32e365[_0x55ca('0x42')]=qs['filters'](_[_0x55ca('0x43')](_0x4caef3[_0x55ca('0x39')],_0x18dd35['filters']),_0x1a67a0);if(_0x4caef3[_0x55ca('0x39')]['filter']){_0x32e365[_0x55ca('0x42')]=_['merge'](_0x32e365[_0x55ca('0x42')],{'$or':_[_0x55ca('0x33')](_0x1a67a0,function(_0x1a6565){if(_0x1a6565[_0x55ca('0x36')]!=='VIRTUAL'){var _0x271bd0={};_0x271bd0[_0x1a6565['name']]={'$like':'%'+_0x4caef3[_0x55ca('0x39')][_0x55ca('0x44')]+'%'};return _0x271bd0;}})});}_0x32e365=_[_0x55ca('0x45')]({},_0x32e365,_0x4caef3[_0x55ca('0x46')]);var _0x57a8ed={'where':_0x32e365['where']};return db[_0x55ca('0x34')][_0x55ca('0x25')](_0x57a8ed)[_0x55ca('0x2c')](function(_0x432d64){_0x1fd54a[_0x55ca('0x25')]=_0x432d64;if(_0x4caef3[_0x55ca('0x39')][_0x55ca('0x47')]){_0x32e365[_0x55ca('0x48')]=[{'all':!![]}];}return db[_0x55ca('0x34')][_0x55ca('0x49')](_0x32e365);})[_0x55ca('0x2c')](function(_0x446228){_0x1fd54a[_0x55ca('0x4a')]=_0x446228;return _0x1fd54a;})['then'](respondWithFilteredResult(_0x2d6f68,_0x32e365))[_0x55ca('0x4b')](handleError(_0x2d6f68,null));};exports[_0x55ca('0x4c')]=function(_0x4b5896,_0x1fe567){var _0x37c519={'raw':!![],'where':{'id':_0x4b5896['params']['id']}},_0x2e1145={};_0x2e1145[_0x55ca('0x3b')]=_[_0x55ca('0x38')](db[_0x55ca('0x34')][_0x55ca('0x35')]);_0x2e1145['query']=_['keys'](_0x4b5896[_0x55ca('0x39')]);_0x2e1145[_0x55ca('0x3a')]=_['intersection'](_0x2e1145[_0x55ca('0x3b')],_0x2e1145[_0x55ca('0x39')]);_0x37c519[_0x55ca('0x3c')]=_['intersection'](_0x2e1145[_0x55ca('0x3b')],qs['fields'](_0x4b5896[_0x55ca('0x39')]['fields']));_0x37c519[_0x55ca('0x3c')]=_0x37c519[_0x55ca('0x3c')][_0x55ca('0x3f')]?_0x37c519[_0x55ca('0x3c')]:_0x2e1145[_0x55ca('0x3b')];if(_0x4b5896[_0x55ca('0x39')][_0x55ca('0x47')]){_0x37c519[_0x55ca('0x48')]=[{'all':!![]}];}_0x37c519=_[_0x55ca('0x45')]({},_0x37c519,_0x4b5896[_0x55ca('0x46')]);return db[_0x55ca('0x34')][_0x55ca('0x4d')](_0x37c519)[_0x55ca('0x2c')](handleEntityNotFound(_0x1fe567,null))[_0x55ca('0x2c')](respondWithResult(_0x1fe567,null))[_0x55ca('0x4b')](handleError(_0x1fe567,null));};exports['create']=function(_0x5bb601,_0x5c01eb){return db[_0x55ca('0x34')][_0x55ca('0x4e')](_0x5bb601[_0x55ca('0x4f')],{})[_0x55ca('0x2c')](respondWithResult(_0x5c01eb,0xc9))[_0x55ca('0x4b')](handleError(_0x5c01eb,null));};exports[_0x55ca('0x2b')]=function(_0x38902f,_0xe3f880){if(_0x38902f[_0x55ca('0x4f')]['id']){delete _0x38902f[_0x55ca('0x4f')]['id'];}return db[_0x55ca('0x34')]['find']({'where':{'id':_0x38902f[_0x55ca('0x50')]['id']}})[_0x55ca('0x2c')](handleEntityNotFound(_0xe3f880,null))['then'](saveUpdates(_0x38902f[_0x55ca('0x4f')],null))[_0x55ca('0x2c')](respondWithResult(_0xe3f880,null))[_0x55ca('0x4b')](handleError(_0xe3f880,null));};exports[_0x55ca('0x2d')]=function(_0x38c66e,_0x4d5449){return db['ChatInternalMessage'][_0x55ca('0x4d')]({'where':{'id':_0x38c66e[_0x55ca('0x50')]['id']}})[_0x55ca('0x2c')](handleEntityNotFound(_0x4d5449,null))[_0x55ca('0x2c')](removeEntity(_0x4d5449,null))[_0x55ca('0x4b')](handleError(_0x4d5449,null));};exports[_0x55ca('0x51')]=function(_0x6d35b6,_0x1b3e3d){return db[_0x55ca('0x34')][_0x55ca('0x51')]()[_0x55ca('0x2c')](respondWithResult(_0x1b3e3d,null))[_0x55ca('0x4b')](handleError(_0x1b3e3d,null));};function wrapUser(_0x138a97){return function(_0x4980b2){var _0x56f2ec=_0x138a97['get']({'plain':!![]});_0x56f2ec[_0x55ca('0x52')]=[];if(_0x4980b2){_0x56f2ec['lastMessageAt']=_0x4980b2[_0x55ca('0x53')];_0x56f2ec[_0x55ca('0x54')]=_0x4980b2;}else{_0x56f2ec[_0x55ca('0x55')]=moment(0x0)[_0x55ca('0x56')](_0x55ca('0x57'));_0x56f2ec['lastMessage']={};}return _0x56f2ec;};}exports[_0x55ca('0x58')]=function(_0x59b08f,_0x44cd18,_0x5e8374){var _0x4cc33c=[];return db['User'][_0x55ca('0x49')]({'where':{'role':[_0x55ca('0x59'),_0x55ca('0x5a'),_0x55ca('0x5b')]},'attributes':['id',_0x55ca('0x5c'),_0x55ca('0x30'),'role','userpic',_0x55ca('0x5d'),_0x55ca('0x5e'),_0x55ca('0x5f'),_0x55ca('0x60'),_0x55ca('0x61')],'order':qs[_0x55ca('0x62')](_0x55ca('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x55ca('0x64'),'attributes':['id',_0x55ca('0x30'),_0x55ca('0x36')],'through':{'attributes':[]}}]})[_0x55ca('0x2c')](function(_0x37edc0){if(_0x37edc0){var _0x52a828=_0x59b08f['user'][_0x55ca('0x65')]({'plain':!![]});if(!_0x52a828)throw new Error(_0x55ca('0x66'));if(_0x52a828[_0x55ca('0x67')]===_0x55ca('0x5b')){return db[_0x55ca('0x68')][_0x55ca('0x4d')]({'where':{'name':'Agents','userProfileId':_0x52a828[_0x55ca('0x69')]},'raw':!![]})[_0x55ca('0x2c')](function(_0x190224){if(_0x190224){if(_0x190224['autoAssociation']===0x0){return db[_0x55ca('0x6a')][_0x55ca('0x49')]({'where':{'sectionId':_0x190224['id']},'raw':!![]})[_0x55ca('0x2c')](function(_0x1d058a){var _0x131c1f=[];if(_[_0x55ca('0x6b')](_0x1d058a)){_0x131c1f=_[_0x55ca('0x44')](_0x37edc0,function(_0x281145){if(_0x281145[_0x55ca('0x67')]!=='agent'){return _0x281145;}});return _0x131c1f;}else{for(var _0x21e3f7=0x0;_0x21e3f7<_0x37edc0[_0x55ca('0x3f')];_0x21e3f7++){var _0x14d7ee=_0x37edc0[_0x21e3f7];if(_0x14d7ee['role']===_0x55ca('0x59')){var _0xe981cc=_[_0x55ca('0x4d')](_0x1d058a,function(_0x4b9933){return _0x4b9933['resourceId']===_0x14d7ee['id'];});if(_0xe981cc)_0x131c1f[_0x55ca('0x6c')](_0x14d7ee);}else{_0x131c1f[_0x55ca('0x6c')](_0x14d7ee);}}return _0x131c1f;}});}else{return _0x37edc0;}}else{var _0x1ce241=_[_0x55ca('0x44')](_0x37edc0,function(_0x4f9499){if(_0x4f9499[_0x55ca('0x67')]!==_0x55ca('0x59')){return _0x4f9499;}});return _0x1ce241;}});}else{return _0x37edc0;}}})[_0x55ca('0x2c')](function(_0x2ae5ca){var _0x39639a=[];if(_0x2ae5ca){_0x4cc33c=_0x2ae5ca;for(var _0x48f5d1=0x0;_0x48f5d1<_0x2ae5ca[_0x55ca('0x3f')];_0x48f5d1+=0x1){_0x4cc33c[_0x48f5d1]['messages']=[];_0x39639a[_0x55ca('0x6c')](db['ChatInternalMessage'][_0x55ca('0x4d')]({'where':{'FromId':[_0x59b08f[_0x55ca('0x5b')]['id'],_0x2ae5ca[_0x48f5d1]['id']],'ToId':[_0x59b08f['user']['id'],_0x2ae5ca[_0x48f5d1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x55ca('0x6d'),_0x55ca('0x6e'),_0x55ca('0x6f'),'body'],'order':qs[_0x55ca('0x62')](_0x55ca('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x55ca('0x2c')](wrapUser(_0x2ae5ca[_0x48f5d1])));}return BPromise[_0x55ca('0x71')](_0x39639a);}return[];})[_0x55ca('0x2c')](function(_0x28eaf2){return{'rows':_0x28eaf2,'count':_0x28eaf2[_0x55ca('0x3f')]};})['then'](respondWithResult(_0x44cd18,null))[_0x55ca('0x4b')](handleError(_0x44cd18,null));};
\ No newline at end of file
+var _0x4f7d=['allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','push','FromId','read','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','merge','find','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','internal','lastLoginAt'];(function(_0x470c73,_0x56fbb0){var _0x42d2f3=function(_0x2a88ab){while(--_0x2a88ab){_0x470c73['push'](_0x470c73['shift']());}};_0x42d2f3(++_0x56fbb0);}(_0x4f7d,0xf6));var _0xd4f7=function(_0x231875,_0x5ca90a){_0x231875=_0x231875-0x0;var _0x222ac2=_0x4f7d[_0x231875];return _0x222ac2;};'use strict';var emlformat=require(_0xd4f7('0x0'));var rimraf=require(_0xd4f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4f7('0x2'));var rp=require(_0xd4f7('0x3'));var moment=require(_0xd4f7('0x4'));var BPromise=require(_0xd4f7('0x5'));var Mustache=require(_0xd4f7('0x6'));var util=require(_0xd4f7('0x7'));var path=require(_0xd4f7('0x8'));var sox=require(_0xd4f7('0x9'));var csv=require('to-csv');var ejs=require(_0xd4f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f7('0xb'));var squel=require(_0xd4f7('0xc'));var crypto=require(_0xd4f7('0xd'));var jsforce=require(_0xd4f7('0xe'));var deskjs=require(_0xd4f7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd4f7('0x10'));var Papa=require(_0xd4f7('0x11'));var Redis=require('ioredis');var authService=require(_0xd4f7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd4f7('0x13'));var hardwareService=require(_0xd4f7('0x14'));var logger=require(_0xd4f7('0x15'))(_0xd4f7('0x16'));var utils=require(_0xd4f7('0x17'));var config=require(_0xd4f7('0x18'));var licenseUtil=require(_0xd4f7('0x19'));var db=require(_0xd4f7('0x1a'))['db'];config['redis']=_[_0xd4f7('0x1b')](config[_0xd4f7('0x1c')],{'host':_0xd4f7('0x1d'),'port':0x18eb});var socket=require(_0xd4f7('0x1e'))(new Redis(config['redis']));require(_0xd4f7('0x1f'))[_0xd4f7('0x20')](socket);function respondWithStatusCode(_0x4ccb9e,_0x59c5d5){_0x59c5d5=_0x59c5d5||0xcc;return function(_0x475073){if(_0x475073){return _0x4ccb9e[_0xd4f7('0x21')](_0x59c5d5);}return _0x4ccb9e[_0xd4f7('0x22')](_0x59c5d5)['end']();};}function respondWithResult(_0x3cb16e,_0x31e549){_0x31e549=_0x31e549||0xc8;return function(_0x38dcdb){if(_0x38dcdb){return _0x3cb16e[_0xd4f7('0x22')](_0x31e549)[_0xd4f7('0x23')](_0x38dcdb);}};}function respondWithFilteredResult(_0x4e8912,_0x32863d){return function(_0x45b048){if(_0x45b048){var _0xa2e8cb=typeof _0x32863d[_0xd4f7('0x24')]===_0xd4f7('0x25')&&typeof _0x32863d['limit']===_0xd4f7('0x25');var _0x3c9669=_0x45b048['count'];var _0x608a76=_0xa2e8cb?0x0:_0x32863d[_0xd4f7('0x24')];var _0x40b9ce=_0xa2e8cb?_0x45b048[_0xd4f7('0x26')]:_0x32863d[_0xd4f7('0x24')]+_0x32863d['limit'];var _0x3bf796;if(_0x40b9ce>=_0x3c9669){_0x40b9ce=_0x3c9669;_0x3bf796=0xc8;}else{_0x3bf796=0xce;}_0x4e8912[_0xd4f7('0x22')](_0x3bf796);return _0x4e8912[_0xd4f7('0x27')]('Content-Range',_0x608a76+'-'+_0x40b9ce+'/'+_0x3c9669)['json'](_0x45b048);}return null;};}function patchUpdates(_0x19a958){return function(_0x5cead1){try{jsonpatch['apply'](_0x5cead1,_0x19a958,!![]);}catch(_0xb6270d){return BPromise[_0xd4f7('0x28')](_0xb6270d);}return _0x5cead1[_0xd4f7('0x29')]();};}function saveUpdates(_0x489aa4,_0x578e5c){return function(_0xef7c4e){if(_0xef7c4e){return _0xef7c4e[_0xd4f7('0x2a')](_0x489aa4)[_0xd4f7('0x2b')](function(_0xfcb8d3){return _0xfcb8d3;});}return null;};}function removeEntity(_0x4cb436,_0x1a1a11){return function(_0x70f58e){if(_0x70f58e){return _0x70f58e[_0xd4f7('0x2c')]()[_0xd4f7('0x2b')](function(){_0x4cb436[_0xd4f7('0x22')](0xcc)[_0xd4f7('0x2d')]();});}};}function handleEntityNotFound(_0x53f3f6,_0x145378){return function(_0x5536db){if(!_0x5536db){_0x53f3f6[_0xd4f7('0x21')](0x194);}return _0x5536db;};}function handleError(_0x371c6c,_0x471865){_0x471865=_0x471865||0x1f4;return function(_0x53dba3){logger['error'](_0x53dba3[_0xd4f7('0x2e')]);if(_0x53dba3[_0xd4f7('0x2f')]){delete _0x53dba3[_0xd4f7('0x2f')];}_0x371c6c[_0xd4f7('0x22')](_0x471865)[_0xd4f7('0x30')](_0x53dba3);};}exports[_0xd4f7('0x31')]=function(_0x3521e8,_0x492cdb){var _0x4b29ad={},_0x3df93f={},_0x11ac1d={'count':0x0,'rows':[]};var _0x1903f6=_[_0xd4f7('0x32')](db[_0xd4f7('0x33')][_0xd4f7('0x34')],function(_0x4731a3){return{'name':_0x4731a3[_0xd4f7('0x35')],'type':_0x4731a3[_0xd4f7('0x36')][_0xd4f7('0x37')]};});_0x3df93f[_0xd4f7('0x38')]=_[_0xd4f7('0x32')](_0x1903f6,_0xd4f7('0x2f'));_0x3df93f[_0xd4f7('0x39')]=_[_0xd4f7('0x3a')](_0x3521e8[_0xd4f7('0x39')]);_0x3df93f[_0xd4f7('0x3b')]=_[_0xd4f7('0x3c')](_0x3df93f[_0xd4f7('0x38')],_0x3df93f[_0xd4f7('0x39')]);_0x4b29ad[_0xd4f7('0x3d')]=_[_0xd4f7('0x3c')](_0x3df93f['model'],qs[_0xd4f7('0x3e')](_0x3521e8[_0xd4f7('0x39')]['fields']));_0x4b29ad['attributes']=_0x4b29ad[_0xd4f7('0x3d')][_0xd4f7('0x3f')]?_0x4b29ad[_0xd4f7('0x3d')]:_0x3df93f['model'];if(!_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x40')](_0xd4f7('0x41'))){_0x4b29ad[_0xd4f7('0x42')]=qs[_0xd4f7('0x42')](_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x42')]);_0x4b29ad[_0xd4f7('0x24')]=qs[_0xd4f7('0x24')](_0x3521e8[_0xd4f7('0x39')]['offset']);}_0x4b29ad[_0xd4f7('0x43')]=qs[_0xd4f7('0x44')](_0x3521e8['query'][_0xd4f7('0x44')]);_0x4b29ad[_0xd4f7('0x45')]=qs[_0xd4f7('0x3b')](_[_0xd4f7('0x46')](_0x3521e8['query'],_0x3df93f[_0xd4f7('0x3b')]),_0x1903f6);if(_0x3521e8['query']['filter']){_0x4b29ad[_0xd4f7('0x45')]=_['merge'](_0x4b29ad[_0xd4f7('0x45')],{'$or':_[_0xd4f7('0x32')](_0x1903f6,function(_0x490801){if(_0x490801[_0xd4f7('0x36')]!==_0xd4f7('0x47')){var _0x30612f={};_0x30612f[_0x490801[_0xd4f7('0x2f')]]={'$like':'%'+_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x48')]+'%'};return _0x30612f;}})});}_0x4b29ad=_['merge']({},_0x4b29ad,_0x3521e8[_0xd4f7('0x49')]);var _0x4fd0df={'where':_0x4b29ad[_0xd4f7('0x45')]};return db[_0xd4f7('0x33')][_0xd4f7('0x26')](_0x4fd0df)[_0xd4f7('0x2b')](function(_0x3e5a82){_0x11ac1d[_0xd4f7('0x26')]=_0x3e5a82;if(_0x3521e8[_0xd4f7('0x39')][_0xd4f7('0x4a')]){_0x4b29ad['include']=[{'all':!![]}];}return db[_0xd4f7('0x33')][_0xd4f7('0x4b')](_0x4b29ad);})['then'](function(_0x2cff6){_0x11ac1d[_0xd4f7('0x4c')]=_0x2cff6;return _0x11ac1d;})[_0xd4f7('0x2b')](respondWithFilteredResult(_0x492cdb,_0x4b29ad))[_0xd4f7('0x4d')](handleError(_0x492cdb,null));};exports[_0xd4f7('0x4e')]=function(_0x30870b,_0x4c3dae){var _0x15e3aa={'raw':!![],'where':{'id':_0x30870b[_0xd4f7('0x4f')]['id']}},_0x5ddb4e={};_0x5ddb4e[_0xd4f7('0x38')]=_[_0xd4f7('0x3a')](db[_0xd4f7('0x33')]['rawAttributes']);_0x5ddb4e[_0xd4f7('0x39')]=_[_0xd4f7('0x3a')](_0x30870b[_0xd4f7('0x39')]);_0x5ddb4e['filters']=_['intersection'](_0x5ddb4e['model'],_0x5ddb4e[_0xd4f7('0x39')]);_0x15e3aa[_0xd4f7('0x3d')]=_['intersection'](_0x5ddb4e[_0xd4f7('0x38')],qs[_0xd4f7('0x3e')](_0x30870b[_0xd4f7('0x39')][_0xd4f7('0x3e')]));_0x15e3aa['attributes']=_0x15e3aa['attributes'][_0xd4f7('0x3f')]?_0x15e3aa[_0xd4f7('0x3d')]:_0x5ddb4e['model'];if(_0x30870b['query'][_0xd4f7('0x4a')]){_0x15e3aa['include']=[{'all':!![]}];}_0x15e3aa=_[_0xd4f7('0x50')]({},_0x15e3aa,_0x30870b[_0xd4f7('0x49')]);return db[_0xd4f7('0x33')][_0xd4f7('0x51')](_0x15e3aa)[_0xd4f7('0x2b')](handleEntityNotFound(_0x4c3dae,null))[_0xd4f7('0x2b')](respondWithResult(_0x4c3dae,null))[_0xd4f7('0x4d')](handleError(_0x4c3dae,null));};exports[_0xd4f7('0x52')]=function(_0x518d49,_0x4a8fbc){return db[_0xd4f7('0x33')][_0xd4f7('0x52')](_0x518d49[_0xd4f7('0x53')],{})[_0xd4f7('0x2b')](respondWithResult(_0x4a8fbc,0xc9))[_0xd4f7('0x4d')](handleError(_0x4a8fbc,null));};exports['update']=function(_0x4c63a8,_0x34a6a8){if(_0x4c63a8[_0xd4f7('0x53')]['id']){delete _0x4c63a8[_0xd4f7('0x53')]['id'];}return db[_0xd4f7('0x33')][_0xd4f7('0x51')]({'where':{'id':_0x4c63a8['params']['id']}})['then'](handleEntityNotFound(_0x34a6a8,null))[_0xd4f7('0x2b')](saveUpdates(_0x4c63a8[_0xd4f7('0x53')],null))['then'](respondWithResult(_0x34a6a8,null))[_0xd4f7('0x4d')](handleError(_0x34a6a8,null));};exports['destroy']=function(_0x2ce480,_0x5157a){return db[_0xd4f7('0x33')]['find']({'where':{'id':_0x2ce480[_0xd4f7('0x4f')]['id']}})[_0xd4f7('0x2b')](handleEntityNotFound(_0x5157a,null))[_0xd4f7('0x2b')](removeEntity(_0x5157a,null))[_0xd4f7('0x4d')](handleError(_0x5157a,null));};exports[_0xd4f7('0x54')]=function(_0xd17b5d,_0x368363){return db[_0xd4f7('0x33')][_0xd4f7('0x54')]()['then'](respondWithResult(_0x368363,null))[_0xd4f7('0x4d')](handleError(_0x368363,null));};function wrapUser(_0x44db8a){return function(_0x47f520){var _0x25c503=_0x44db8a[_0xd4f7('0x55')]({'plain':!![]});_0x25c503['messages']=[];if(_0x47f520){_0x25c503[_0xd4f7('0x56')]=_0x47f520[_0xd4f7('0x57')];_0x25c503['lastMessage']=_0x47f520;}else{_0x25c503[_0xd4f7('0x56')]=moment(0x0)[_0xd4f7('0x58')](_0xd4f7('0x59'));_0x25c503[_0xd4f7('0x5a')]={};}return _0x25c503;};}exports[_0xd4f7('0x5b')]=function(_0x4a249d,_0x137c5c,_0x209a66){var _0xeb4410=[];return db[_0xd4f7('0x5c')][_0xd4f7('0x4b')]({'where':{'role':[_0xd4f7('0x5d'),_0xd4f7('0x5e'),_0xd4f7('0x5f')]},'attributes':['id',_0xd4f7('0x60'),_0xd4f7('0x2f'),'role','userpic',_0xd4f7('0x61'),'online',_0xd4f7('0x62'),_0xd4f7('0x63'),_0xd4f7('0x64')],'order':qs[_0xd4f7('0x44')](_0xd4f7('0x65')),'include':[{'model':db[_0xd4f7('0x66')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x53aff0){if(_0x53aff0){var _0x1119ba=_0x4a249d[_0xd4f7('0x5f')][_0xd4f7('0x55')]({'plain':!![]});if(!_0x1119ba)throw new Error(_0xd4f7('0x67'));if(_0x1119ba['role']===_0xd4f7('0x5f')){return db[_0xd4f7('0x68')][_0xd4f7('0x51')]({'where':{'name':_0xd4f7('0x69'),'userProfileId':_0x1119ba[_0xd4f7('0x6a')]},'raw':!![]})['then'](function(_0x284fe5){if(_0x284fe5){if(_0x284fe5[_0xd4f7('0x6b')]===0x0){return db[_0xd4f7('0x6c')][_0xd4f7('0x4b')]({'where':{'sectionId':_0x284fe5['id']},'raw':!![]})[_0xd4f7('0x2b')](function(_0x3e9009){var _0x102e61=[];if(_[_0xd4f7('0x6d')](_0x3e9009)){_0x102e61=_[_0xd4f7('0x48')](_0x53aff0,function(_0x170cd9){if(_0x170cd9[_0xd4f7('0x6e')]!==_0xd4f7('0x5d')){return _0x170cd9;}});return _0x102e61;}else{for(var _0x55bfae=0x0;_0x55bfae<_0x53aff0[_0xd4f7('0x3f')];_0x55bfae++){var _0x462f06=_0x53aff0[_0x55bfae];if(_0x462f06[_0xd4f7('0x6e')]===_0xd4f7('0x5d')){var _0x466b01=_[_0xd4f7('0x51')](_0x3e9009,function(_0xaf2af2){return _0xaf2af2['resourceId']===_0x462f06['id'];});if(_0x466b01)_0x102e61[_0xd4f7('0x6f')](_0x462f06);}else{_0x102e61['push'](_0x462f06);}}return _0x102e61;}});}else{return _0x53aff0;}}else{var _0x3f993e=_[_0xd4f7('0x48')](_0x53aff0,function(_0x53d2d7){if(_0x53d2d7[_0xd4f7('0x6e')]!==_0xd4f7('0x5d')){return _0x53d2d7;}});return _0x3f993e;}});}else{return _0x53aff0;}}})[_0xd4f7('0x2b')](function(_0x1846d3){var _0x298fa9=[];if(_0x1846d3){_0xeb4410=_0x1846d3;for(var _0x2c92f4=0x0;_0x2c92f4<_0x1846d3[_0xd4f7('0x3f')];_0x2c92f4+=0x1){_0xeb4410[_0x2c92f4]['messages']=[];_0x298fa9[_0xd4f7('0x6f')](db[_0xd4f7('0x33')]['find']({'where':{'FromId':[_0x4a249d['user']['id'],_0x1846d3[_0x2c92f4]['id']],'ToId':[_0x4a249d[_0xd4f7('0x5f')]['id'],_0x1846d3[_0x2c92f4]['id']],'ChatGroupId':null},'attributes':['id',_0xd4f7('0x57'),_0xd4f7('0x70'),'ToId',_0xd4f7('0x71'),'body'],'order':qs[_0xd4f7('0x44')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1846d3[_0x2c92f4])));}return BPromise[_0xd4f7('0x72')](_0x298fa9);}return[];})[_0xd4f7('0x2b')](function(_0xfea3a4){return{'rows':_0xfea3a4,'count':_0xfea3a4[_0xd4f7('0x3f')]};})['then'](respondWithResult(_0x137c5c,null))[_0xd4f7('0x4d')](handleError(_0x137c5c,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ee89fe7..4dbc626 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 _0x367b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x58dc50,_0x2af0b7){var _0x1fda34=function(_0x5cf61b){while(--_0x5cf61b){_0x58dc50['push'](_0x58dc50['shift']());}};_0x1fda34(++_0x2af0b7);}(_0x367b,0xad));var _0xb367=function(_0x239d19,_0x2e325a){_0x239d19=_0x239d19-0x0;var _0x3bcad0=_0x367b[_0x239d19];return _0x3bcad0;};'use strict';var EventEmitter=require(_0xb367('0x0'));var ChatInternalMessage=require(_0xb367('0x1'))['db'][_0xb367('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb367('0x3')](0x0);var events={'afterCreate':_0xb367('0x4'),'afterUpdate':_0xb367('0x5'),'afterDestroy':_0xb367('0x6')};function emitEvent(_0x4d7a69){return function(_0x4d055a,_0x52a909,_0x29b757){ChatInternalMessageEvents[_0xb367('0x7')](_0x4d7a69+':'+_0x4d055a['id'],_0x4d055a);ChatInternalMessageEvents['emit'](_0x4d7a69,_0x4d055a);_0x29b757(null);};}for(var e in events){if(events[_0xb367('0x8')](e)){var event=events[e];ChatInternalMessage[_0xb367('0x9')](e,emitEvent(event));}}module[_0xb367('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x014b=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x014b,0x1a8));var _0xb014=function(_0x52851e,_0x535d7a){_0x52851e=_0x52851e-0x0;var _0x1c581e=_0x014b[_0x52851e];return _0x1c581e;};'use strict';var EventEmitter=require(_0xb014('0x0'));var ChatInternalMessage=require(_0xb014('0x1'))['db'][_0xb014('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb014('0x3')](0x0);var events={'afterCreate':_0xb014('0x4'),'afterUpdate':_0xb014('0x5'),'afterDestroy':_0xb014('0x6')};function emitEvent(_0x15dcd3){return function(_0xa9af8b,_0x2be87d,_0x2985bb){ChatInternalMessageEvents[_0xb014('0x7')](_0x15dcd3+':'+_0xa9af8b['id'],_0xa9af8b);ChatInternalMessageEvents['emit'](_0x15dcd3,_0xa9af8b);_0x2985bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb014('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 9986455..522d21f 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 _0x7acc=['request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x376482,_0x57bb69){var _0x365c80=function(_0x282d08){while(--_0x282d08){_0x376482['push'](_0x376482['shift']());}};_0x365c80(++_0x57bb69);}(_0x7acc,0x82));var _0xc7ac=function(_0x2acae5,_0x3a76cb){_0x2acae5=_0x2acae5-0x0;var _0x5c221f=_0x7acc[_0x2acae5];return _0x5c221f;};'use strict';var _=require(_0xc7ac('0x0'));var util=require('util');var logger=require(_0xc7ac('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc7ac('0x2'));var fs=require('fs');var path=require(_0xc7ac('0x3'));var rimraf=require('rimraf');var config=require(_0xc7ac('0x4'));var attributes=require(_0xc7ac('0x5'));module[_0xc7ac('0x6')]=function(_0x524db9,_0x5c9926){return _0x524db9[_0xc7ac('0x7')](_0xc7ac('0x8'),attributes,{'tableName':_0xc7ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc7ac('0xa')});};
\ No newline at end of file
+var _0xc37b=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','util','../../config/logger','moment'];(function(_0x19c3d2,_0x59f8e2){var _0x8a8c9e=function(_0x48ddbe){while(--_0x48ddbe){_0x19c3d2['push'](_0x19c3d2['shift']());}};_0x8a8c9e(++_0x59f8e2);}(_0xc37b,0xcc));var _0xbc37=function(_0x406f08,_0x38a7a4){_0x406f08=_0x406f08-0x0;var _0x375701=_0xc37b[_0x406f08];return _0x375701;};'use strict';var _=require('lodash');var util=require(_0xbc37('0x0'));var logger=require(_0xbc37('0x1'))('api');var moment=require(_0xbc37('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc37('0x3'));var config=require(_0xbc37('0x4'));var attributes=require(_0xbc37('0x5'));module['exports']=function(_0x5d6401,_0x4cd6c0){return _0x5d6401[_0xbc37('0x6')](_0xbc37('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc37('0x8'),'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 1c49ec1..453676b 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 _0xc743=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3bb954,_0x5173dd){var _0x3d96a3=function(_0x16688c){while(--_0x16688c){_0x3bb954['push'](_0x3bb954['shift']());}};_0x3d96a3(++_0x5173dd);}(_0xc743,0x103));var _0x3c74=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0xc743[_0x47199b];return _0x390911;};'use strict';var _=require(_0x3c74('0x0'));var util=require(_0x3c74('0x1'));var moment=require(_0x3c74('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c74('0x3'));var fs=require('fs');var Redis=require(_0x3c74('0x4'));var db=require(_0x3c74('0x5'))['db'];var utils=require(_0x3c74('0x6'));var logger=require(_0x3c74('0x7'))(_0x3c74('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c74('0x9')][_0x3c74('0xa')]({'port':0x232a});config[_0x3c74('0xb')]=_['defaults'](config[_0x3c74('0xb')],{'host':_0x3c74('0xc'),'port':0x18eb});var socket=require(_0x3c74('0xd'))(new Redis(config['redis']));require(_0x3c74('0xe'))['register'](socket);function respondWithRpcPromise(_0x206b75,_0x521d30,_0x30ea64){return new BPromise(function(_0x2cc591,_0x1212ec){return client[_0x3c74('0xf')](_0x206b75,_0x30ea64)['then'](function(_0x29a5cc){logger[_0x3c74('0x10')](_0x3c74('0x11'),_0x521d30,_0x3c74('0x12'));logger[_0x3c74('0x13')](_0x3c74('0x14'),_0x521d30,'request\x20sent',JSON[_0x3c74('0x15')](_0x29a5cc));if(_0x29a5cc['error']){if(_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x17')]===0x1f4){logger[_0x3c74('0x16')](_0x3c74('0x11'),_0x521d30,_0x29a5cc[_0x3c74('0x16')]['message']);return _0x1212ec(_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x18')]);}logger[_0x3c74('0x16')](_0x3c74('0x11'),_0x521d30,_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x18')]);return _0x2cc591(_0x29a5cc[_0x3c74('0x16')][_0x3c74('0x18')]);}else{logger[_0x3c74('0x10')](_0x3c74('0x11'),_0x521d30,'request\x20sent');_0x2cc591(_0x29a5cc[_0x3c74('0x19')][_0x3c74('0x18')]);}})[_0x3c74('0x1a')](function(_0x2380b3){logger['error'](_0x3c74('0x11'),_0x521d30,_0x2380b3);_0x1212ec(_0x2380b3);});});}
\ No newline at end of file
+var _0x35f9=['error','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x273fa0,_0x1aabbc){var _0xde4793=function(_0x1b5611){while(--_0x1b5611){_0x273fa0['push'](_0x273fa0['shift']());}};_0xde4793(++_0x1aabbc);}(_0x35f9,0x1df));var _0x935f=function(_0x2aba1d,_0x589dac){_0x2aba1d=_0x2aba1d-0x0;var _0x20c616=_0x35f9[_0x2aba1d];return _0x20c616;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var moment=require(_0x935f('0x2'));var BPromise=require(_0x935f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x935f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x935f('0x5'))(_0x935f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x935f('0x7')][_0x935f('0x8')]({'port':0x232a});config[_0x935f('0x9')]=_[_0x935f('0xa')](config[_0x935f('0x9')],{'host':_0x935f('0xb'),'port':0x18eb});var socket=require(_0x935f('0xc'))(new Redis(config['redis']));require(_0x935f('0xd'))[_0x935f('0xe')](socket);function respondWithRpcPromise(_0x50675c,_0x318fc4,_0x1099bd){return new BPromise(function(_0x2fd9a4,_0x16c3e5){return client[_0x935f('0xf')](_0x50675c,_0x1099bd)[_0x935f('0x10')](function(_0x5e01d9){logger['info'](_0x935f('0x11'),_0x318fc4,_0x935f('0x12'));logger[_0x935f('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x318fc4,'request\x20sent',JSON[_0x935f('0x14')](_0x5e01d9));if(_0x5e01d9[_0x935f('0x15')]){if(_0x5e01d9['error']['code']===0x1f4){logger[_0x935f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x318fc4,_0x5e01d9[_0x935f('0x15')][_0x935f('0x16')]);return _0x16c3e5(_0x5e01d9[_0x935f('0x15')][_0x935f('0x16')]);}logger[_0x935f('0x15')](_0x935f('0x11'),_0x318fc4,_0x5e01d9[_0x935f('0x15')][_0x935f('0x16')]);return _0x2fd9a4(_0x5e01d9['error'][_0x935f('0x16')]);}else{logger[_0x935f('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x318fc4,_0x935f('0x12'));_0x2fd9a4(_0x5e01d9[_0x935f('0x18')][_0x935f('0x16')]);}})['catch'](function(_0x393063){logger[_0x935f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x318fc4,_0x393063);_0x16c3e5(_0x393063);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index c36cf87..17de6a4 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 _0x55fa=['update','removeListener','register','length','./chatInternalMessage.events','remove'];(function(_0x53534a,_0x3a3fef){var _0x6be3ec=function(_0xcabdf8){while(--_0xcabdf8){_0x53534a['push'](_0x53534a['shift']());}};_0x6be3ec(++_0x3a3fef);}(_0x55fa,0xfa));var _0xa55f=function(_0x19cc31,_0x15ecfd){_0x19cc31=_0x19cc31-0x0;var _0x550c19=_0x55fa[_0x19cc31];return _0x550c19;};'use strict';var ChatInternalMessageEvents=require(_0xa55f('0x0'));var events=['save',_0xa55f('0x1'),_0xa55f('0x2')];function createListener(_0x35444a,_0x5f49b2){return function(_0x3d9b52){_0x5f49b2['emit'](_0x35444a,_0x3d9b52);};}function removeListener(_0x2a1480,_0x4a64fe){return function(){ChatInternalMessageEvents[_0xa55f('0x3')](_0x2a1480,_0x4a64fe);};}exports[_0xa55f('0x4')]=function(_0x19ed51){for(var _0x286c37=0x0,_0x5667da=events[_0xa55f('0x5')];_0x286c37<_0x5667da;_0x286c37++){var _0x5b48d8=events[_0x286c37];var _0x3130b8=createListener('chatInternalMessage:'+_0x5b48d8,_0x19ed51);ChatInternalMessageEvents['on'](_0x5b48d8,_0x3130b8);}};
\ No newline at end of file
+var _0xfd8b=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0xfd8b,0x1c1));var _0xbfd8=function(_0x4d40f8,_0x4f88de){_0x4d40f8=_0x4d40f8-0x0;var _0x193eeb=_0xfd8b[_0x4d40f8];return _0x193eeb;};'use strict';var ChatInternalMessageEvents=require(_0xbfd8('0x0'));var events=[_0xbfd8('0x1'),_0xbfd8('0x2'),_0xbfd8('0x3')];function createListener(_0x1110d2,_0x518f41){return function(_0x42f94d){_0x518f41[_0xbfd8('0x4')](_0x1110d2,_0x42f94d);};}function removeListener(_0x4b45ae,_0x4c9bd9){return function(){ChatInternalMessageEvents['removeListener'](_0x4b45ae,_0x4c9bd9);};}exports[_0xbfd8('0x5')]=function(_0x295b3a){for(var _0xaabbd8=0x0,_0x2c23eb=events['length'];_0xaabbd8<_0x2c23eb;_0xaabbd8++){var _0x412355=events[_0xaabbd8];var _0x454d89=createListener(_0xbfd8('0x6')+_0x412355,_0x295b3a);ChatInternalMessageEvents['on'](_0x412355,_0x454d89);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d5de75f..a9f8696 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 _0x5702=['/describe','describe','/users','/:id','show','post','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x4b8408,_0x1bd0e2){var _0xde9378=function(_0x14e7cb){while(--_0x14e7cb){_0x4b8408['push'](_0x4b8408['shift']());}};_0xde9378(++_0x1bd0e2);}(_0x5702,0xc7));var _0x2570=function(_0x210e47,_0x576a9d){_0x210e47=_0x210e47-0x0;var _0x4a6ff1=_0x5702[_0x210e47];return _0x4a6ff1;};'use strict';var multer=require(_0x2570('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2570('0x1'));var express=require(_0x2570('0x2'));var router=express[_0x2570('0x3')]();var fs_extra=require(_0x2570('0x4'));var auth=require(_0x2570('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2570('0x6'));var controller=require(_0x2570('0x7'));router[_0x2570('0x8')]('/',auth[_0x2570('0x9')](),controller[_0x2570('0xa')]);router[_0x2570('0x8')](_0x2570('0xb'),auth[_0x2570('0x9')](),controller[_0x2570('0xc')]);router['get'](_0x2570('0xd'),auth[_0x2570('0x9')](),controller['getUsers']);router['get'](_0x2570('0xe'),auth[_0x2570('0x9')](),controller[_0x2570('0xf')]);router[_0x2570('0x10')]('/',auth[_0x2570('0x9')](),controller['create']);router[_0x2570('0x11')](_0x2570('0xe'),controller['update']);router[_0x2570('0x12')](_0x2570('0xe'),auth[_0x2570('0x9')](),controller[_0x2570('0x13')]);module[_0x2570('0x14')]=router;
\ No newline at end of file
+var _0xef4f=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','create','put','destroy'];(function(_0x19ae54,_0xacef8d){var _0x294c84=function(_0x12bea0){while(--_0x12bea0){_0x19ae54['push'](_0x19ae54['shift']());}};_0x294c84(++_0xacef8d);}(_0xef4f,0x105));var _0xfef4=function(_0x58e9d6,_0x840f76){_0x58e9d6=_0x58e9d6-0x0;var _0x10b2c0=_0xef4f[_0x58e9d6];return _0x10b2c0;};'use strict';var multer=require('multer');var util=require(_0xfef4('0x0'));var path=require(_0xfef4('0x1'));var timeout=require(_0xfef4('0x2'));var express=require('express');var router=express[_0xfef4('0x3')]();var fs_extra=require(_0xfef4('0x4'));var auth=require(_0xfef4('0x5'));var interaction=require(_0xfef4('0x6'));var config=require(_0xfef4('0x7'));var controller=require(_0xfef4('0x8'));router[_0xfef4('0x9')]('/',auth[_0xfef4('0xa')](),controller['index']);router[_0xfef4('0x9')](_0xfef4('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xfef4('0x9')](_0xfef4('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0xfef4('0x9')](_0xfef4('0xd'),auth[_0xfef4('0xa')](),controller[_0xfef4('0xe')]);router[_0xfef4('0xf')]('/',auth[_0xfef4('0xa')](),controller[_0xfef4('0x10')]);router[_0xfef4('0x11')](_0xfef4('0xd'),controller['update']);router['delete']('/:id',auth[_0xfef4('0xa')](),controller[_0xfef4('0x12')]);module[_0xfef4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index a2322c1..55f08d7 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 _0xf4f4=['out','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x128582,_0xe61dba){var _0x38db19=function(_0x36c512){while(--_0x36c512){_0x128582['push'](_0x128582['shift']());}};_0x38db19(++_0xe61dba);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x26b4e8,_0x1c1a98){_0x26b4e8=_0x26b4e8-0x0;var _0x448057=_0xf4f4[_0x26b4e8];return _0x448057;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4f4f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4f4f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4f4f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f4f('0x4')]('in',_0x4f4f('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4f4f('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4f4f('0x7')]}};
\ No newline at end of file
+var _0x4fc2=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4fc2,0x111));var _0x24fc=function(_0x58836f,_0x5351e2){_0x58836f=_0x58836f-0x0;var _0x28f9b1=_0x4fc2[_0x58836f];return _0x28f9b1;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'body':{'type':Sequelize[_0x24fc('0x2')](_0x24fc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x24fc('0x5')]('in',_0x24fc('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x24fc('0x7')]},'providerName':{'type':Sequelize[_0x24fc('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index d6cfc91..984556f 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 _0x8a6c=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','destroy','describe','../../config/logger','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','format','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x8a6c,0xfc));var _0xc8a6=function(_0x523d34,_0x5e8c35){_0x523d34=_0x523d34-0x0;var _0x1d044a=_0x8a6c[_0x523d34];return _0x1d044a;};'use strict';var emlformat=require(_0xc8a6('0x0'));var rimraf=require(_0xc8a6('0x1'));var zipdir=require(_0xc8a6('0x2'));var jsonpatch=require(_0xc8a6('0x3'));var rp=require('request-promise');var moment=require(_0xc8a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8a6('0x5'));var util=require(_0xc8a6('0x6'));var path=require(_0xc8a6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc8a6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8a6('0x9'));var squel=require(_0xc8a6('0xa'));var crypto=require(_0xc8a6('0xb'));var jsforce=require(_0xc8a6('0xc'));var deskjs=require(_0xc8a6('0xd'));var toCsv=require(_0xc8a6('0xe'));var querystring=require(_0xc8a6('0xf'));var Papa=require(_0xc8a6('0x10'));var Redis=require(_0xc8a6('0x11'));var authService=require(_0xc8a6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8a6('0x13'));var utils=require(_0xc8a6('0x14'));var config=require(_0xc8a6('0x15'));var licenseUtil=require(_0xc8a6('0x16'));var db=require(_0xc8a6('0x17'))['db'];config[_0xc8a6('0x18')]=_[_0xc8a6('0x19')](config[_0xc8a6('0x18')],{'host':_0xc8a6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8a6('0x18')]));require(_0xc8a6('0x1b'))['register'](socket);var jayson=require(_0xc8a6('0x1c'));var client=jayson[_0xc8a6('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xc8a6('0x1d')][_0xc8a6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4fe8e4,_0x3c03d6,_0x36cd31,_0x38de72){return new BPromise(function(_0x3ec154,_0xc378b4){var _0x43b0db=_0x38de72||client;return _0x43b0db['request'](_0x4fe8e4,_0x36cd31)['then'](function(_0x178bc1){logger[_0xc8a6('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x3c03d6,_0xc8a6('0x20'));logger[_0xc8a6('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c03d6,'request\x20sent',JSON[_0xc8a6('0x22')](_0x178bc1));if(_0x178bc1[_0xc8a6('0x23')]){if(_0x178bc1[_0xc8a6('0x23')][_0xc8a6('0x24')]===0x1f4){logger[_0xc8a6('0x23')](_0xc8a6('0x25'),_0x3c03d6,_0x178bc1[_0xc8a6('0x23')][_0xc8a6('0x26')]);return _0xc378b4(_0x178bc1[_0xc8a6('0x23')]['message']);}logger[_0xc8a6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3c03d6,_0x178bc1[_0xc8a6('0x23')][_0xc8a6('0x26')]);return _0x3ec154(_0x178bc1['error'][_0xc8a6('0x26')]);}else{logger[_0xc8a6('0x1f')](_0xc8a6('0x25'),_0x3c03d6,_0xc8a6('0x20'));_0x3ec154(_0x178bc1[_0xc8a6('0x27')][_0xc8a6('0x26')]);}})[_0xc8a6('0x28')](function(_0x1f8b43){logger['error'](_0xc8a6('0x25'),_0x3c03d6,_0x1f8b43);_0xc378b4(_0x1f8b43);});});}function respondWithStatusCode(_0x5f36ba,_0x288058){_0x288058=_0x288058||0xcc;return function(_0x3a87aa){if(_0x3a87aa){return _0x5f36ba[_0xc8a6('0x29')](_0x288058);}return _0x5f36ba['status'](_0x288058)[_0xc8a6('0x2a')]();};}function respondWithResult(_0x5457f3,_0x1b76b3){_0x1b76b3=_0x1b76b3||0xc8;return function(_0x87bf5c){if(_0x87bf5c){return _0x5457f3[_0xc8a6('0x2b')](_0x1b76b3)['json'](_0x87bf5c);}};}function respondWithFilteredResult(_0x28211f,_0x558b00){return function(_0x1c1021){if(_0x1c1021){var _0xa43397=typeof _0x558b00[_0xc8a6('0x2c')]===_0xc8a6('0x2d')&&typeof _0x558b00[_0xc8a6('0x2e')]==='undefined';var _0x3712df=_0x1c1021[_0xc8a6('0x2f')];var _0x4f606c=_0xa43397?0x0:_0x558b00['offset'];var _0x3998aa=_0xa43397?_0x1c1021[_0xc8a6('0x2f')]:_0x558b00[_0xc8a6('0x2c')]+_0x558b00['limit'];var _0x2f12cc;if(_0x3998aa>=_0x3712df){_0x3998aa=_0x3712df;_0x2f12cc=0xc8;}else{_0x2f12cc=0xce;}_0x28211f[_0xc8a6('0x2b')](_0x2f12cc);return _0x28211f['set'](_0xc8a6('0x30'),_0x4f606c+'-'+_0x3998aa+'/'+_0x3712df)[_0xc8a6('0x31')](_0x1c1021);}return null;};}function patchUpdates(_0x2daba3){return function(_0x21006e){try{jsonpatch[_0xc8a6('0x32')](_0x21006e,_0x2daba3,!![]);}catch(_0x5759c4){return BPromise[_0xc8a6('0x33')](_0x5759c4);}return _0x21006e[_0xc8a6('0x34')]();};}function saveUpdates(_0x3ef1ee,_0x376c74){return function(_0x36a193){if(_0x36a193){return _0x36a193[_0xc8a6('0x35')](_0x3ef1ee)[_0xc8a6('0x36')](function(_0xad4675){return _0xad4675;});}return null;};}function removeEntity(_0x267231,_0x5ac870){return function(_0x138650){if(_0x138650){return _0x138650['destroy']()['then'](function(){_0x267231['status'](0xcc)[_0xc8a6('0x2a')]();});}};}function handleEntityNotFound(_0x4c553e,_0x1baa54){return function(_0x1e7950){if(!_0x1e7950){_0x4c553e[_0xc8a6('0x29')](0x194);}return _0x1e7950;};}function handleError(_0x4e04a9,_0x1826f7){_0x1826f7=_0x1826f7||0x1f4;return function(_0xb65be5){logger[_0xc8a6('0x23')](_0xb65be5[_0xc8a6('0x37')]);if(_0xb65be5[_0xc8a6('0x38')]){delete _0xb65be5[_0xc8a6('0x38')];}_0x4e04a9[_0xc8a6('0x2b')](_0x1826f7)['send'](_0xb65be5);};}exports['index']=function(_0x5ef202,_0x1d18f7){var _0x516c80={},_0x249424={},_0x12c86e={'count':0x0,'rows':[]};var _0x27098b=_[_0xc8a6('0x39')](db[_0xc8a6('0x3a')][_0xc8a6('0x3b')],function(_0x555a3f){return{'name':_0x555a3f['fieldName'],'type':_0x555a3f[_0xc8a6('0x3c')][_0xc8a6('0x3d')]};});_0x249424[_0xc8a6('0x3e')]=_[_0xc8a6('0x39')](_0x27098b,'name');_0x249424[_0xc8a6('0x3f')]=_[_0xc8a6('0x40')](_0x5ef202[_0xc8a6('0x3f')]);_0x249424[_0xc8a6('0x41')]=_[_0xc8a6('0x42')](_0x249424['model'],_0x249424[_0xc8a6('0x3f')]);_0x516c80[_0xc8a6('0x43')]=_[_0xc8a6('0x42')](_0x249424['model'],qs[_0xc8a6('0x44')](_0x5ef202[_0xc8a6('0x3f')]['fields']));_0x516c80[_0xc8a6('0x43')]=_0x516c80['attributes']['length']?_0x516c80[_0xc8a6('0x43')]:_0x249424[_0xc8a6('0x3e')];if(!_0x5ef202[_0xc8a6('0x3f')]['hasOwnProperty']('nolimit')){_0x516c80[_0xc8a6('0x2e')]=qs[_0xc8a6('0x2e')](_0x5ef202['query'][_0xc8a6('0x2e')]);_0x516c80[_0xc8a6('0x2c')]=qs[_0xc8a6('0x2c')](_0x5ef202[_0xc8a6('0x3f')]['offset']);}_0x516c80[_0xc8a6('0x45')]=qs[_0xc8a6('0x46')](_0x5ef202[_0xc8a6('0x3f')][_0xc8a6('0x46')]);_0x516c80[_0xc8a6('0x47')]=qs['filters'](_[_0xc8a6('0x48')](_0x5ef202['query'],_0x249424[_0xc8a6('0x41')]),_0x27098b);if(_0x5ef202['query'][_0xc8a6('0x49')]){_0x516c80['where']=_[_0xc8a6('0x4a')](_0x516c80[_0xc8a6('0x47')],{'$or':_[_0xc8a6('0x39')](_0x27098b,function(_0x50415d){if(_0x50415d[_0xc8a6('0x3c')]!==_0xc8a6('0x4b')){var _0x1addf7={};_0x1addf7[_0x50415d['name']]={'$like':'%'+_0x5ef202[_0xc8a6('0x3f')]['filter']+'%'};return _0x1addf7;}})});}_0x516c80=_['merge']({},_0x516c80,_0x5ef202[_0xc8a6('0x4c')]);var _0x3a7b94={'where':_0x516c80[_0xc8a6('0x47')]};return db[_0xc8a6('0x3a')][_0xc8a6('0x2f')](_0x3a7b94)[_0xc8a6('0x36')](function(_0x262a86){_0x12c86e['count']=_0x262a86;if(_0x5ef202['query'][_0xc8a6('0x4d')]){_0x516c80['include']=[{'all':!![]}];}return db[_0xc8a6('0x3a')][_0xc8a6('0x4e')](_0x516c80);})['then'](function(_0x9f3d13){_0x12c86e[_0xc8a6('0x4f')]=_0x9f3d13;return _0x12c86e;})[_0xc8a6('0x36')](respondWithFilteredResult(_0x1d18f7,_0x516c80))[_0xc8a6('0x28')](handleError(_0x1d18f7,null));};exports[_0xc8a6('0x50')]=function(_0x453471,_0x48f864){var _0x173e8c={'raw':!![],'where':{'id':_0x453471[_0xc8a6('0x51')]['id']}},_0x3fed5d={};_0x3fed5d['model']=_[_0xc8a6('0x40')](db[_0xc8a6('0x3a')][_0xc8a6('0x3b')]);_0x3fed5d[_0xc8a6('0x3f')]=_['keys'](_0x453471['query']);_0x3fed5d['filters']=_[_0xc8a6('0x42')](_0x3fed5d['model'],_0x3fed5d[_0xc8a6('0x3f')]);_0x173e8c[_0xc8a6('0x43')]=_[_0xc8a6('0x42')](_0x3fed5d['model'],qs['fields'](_0x453471[_0xc8a6('0x3f')][_0xc8a6('0x44')]));_0x173e8c['attributes']=_0x173e8c[_0xc8a6('0x43')][_0xc8a6('0x52')]?_0x173e8c[_0xc8a6('0x43')]:_0x3fed5d[_0xc8a6('0x3e')];if(_0x453471[_0xc8a6('0x3f')][_0xc8a6('0x4d')]){_0x173e8c[_0xc8a6('0x53')]=[{'all':!![]}];}_0x173e8c=_[_0xc8a6('0x4a')]({},_0x173e8c,_0x453471[_0xc8a6('0x4c')]);return db[_0xc8a6('0x3a')][_0xc8a6('0x54')](_0x173e8c)[_0xc8a6('0x36')](handleEntityNotFound(_0x48f864,null))[_0xc8a6('0x36')](respondWithResult(_0x48f864,null))[_0xc8a6('0x28')](handleError(_0x48f864,null));};exports[_0xc8a6('0x55')]=function(_0x21c638,_0x3622c2){return db[_0xc8a6('0x3a')]['create'](_0x21c638[_0xc8a6('0x56')],{})[_0xc8a6('0x36')](respondWithResult(_0x3622c2,0xc9))['catch'](handleError(_0x3622c2,null));};exports[_0xc8a6('0x35')]=function(_0x2f7705,_0x237437){if(_0x2f7705[_0xc8a6('0x56')]['id']){delete _0x2f7705[_0xc8a6('0x56')]['id'];}return db[_0xc8a6('0x3a')]['find']({'where':{'id':_0x2f7705[_0xc8a6('0x51')]['id']}})[_0xc8a6('0x36')](handleEntityNotFound(_0x237437,null))[_0xc8a6('0x36')](saveUpdates(_0x2f7705[_0xc8a6('0x56')],null))['then'](respondWithResult(_0x237437,null))[_0xc8a6('0x28')](handleError(_0x237437,null));};exports[_0xc8a6('0x57')]=function(_0x1a018a,_0x1968c8){return db['ChatMessage'][_0xc8a6('0x54')]({'where':{'id':_0x1a018a[_0xc8a6('0x51')]['id']}})[_0xc8a6('0x36')](handleEntityNotFound(_0x1968c8,null))[_0xc8a6('0x36')](removeEntity(_0x1968c8,null))['catch'](handleError(_0x1968c8,null));};exports[_0xc8a6('0x58')]=function(_0x4ad395,_0x1138f3){return db[_0xc8a6('0x3a')]['describe']()[_0xc8a6('0x36')](respondWithResult(_0x1138f3,null))['catch'](handleError(_0x1138f3,null));};var interaction_log=require(_0xc8a6('0x59'))('chat-interactions');exports[_0xc8a6('0x5a')]=function(_0x115611,_0x15e9cd,_0x550402){var _0x5d6632={'agent':{},'channel':_0xc8a6('0x5b')};if(_0x115611[_0xc8a6('0x56')]['id']){delete _0x115611[_0xc8a6('0x56')]['id'];}_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5c')]=!![];_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5d')]=moment()['format'](_0xc8a6('0x5e'));_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')]=_0x115611[_0xc8a6('0x56')]['UserId']||_0x115611[_0xc8a6('0x60')]['id'];_0x5d6632[_0xc8a6('0x61')]['id']=_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')];return db[_0xc8a6('0x3a')][_0xc8a6('0x54')]({'where':{'id':_0x115611[_0xc8a6('0x51')]['id'],'UserId':null}})[_0xc8a6('0x36')](handleEntityNotFound(_0x15e9cd,null))['then'](saveUpdates(_0x115611[_0xc8a6('0x56')],null))[_0xc8a6('0x36')](function(_0x1db4f4){if(_0x1db4f4){_0x5d6632['message']=_0x1db4f4['get']({'plain':!![]});return db[_0xc8a6('0x62')]['find']({'where':{'id':_0x1db4f4[_0xc8a6('0x63')]}});}return null;})[_0xc8a6('0x36')](handleEntityNotFound(_0x15e9cd,null))[_0xc8a6('0x36')](function(_0x1d8a14){if(_0x1d8a14){return _0x1d8a14[_0xc8a6('0x35')]({'UserId':_0x115611['body']['UserId'],'read1stAt':_[_0xc8a6('0x64')](_0x1d8a14['read1stAt'])?moment()[_0xc8a6('0x65')](_0xc8a6('0x5e')):undefined});}return null;})[_0xc8a6('0x36')](function(_0x363363){if(_0x363363){_0x5d6632['interaction']=_0x363363[_0xc8a6('0x66')]({'plain':!![]});interaction_log[_0xc8a6('0x1f')](_0xc8a6('0x67'),_0x115611[_0xc8a6('0x60')]['id'],_0x115611[_0xc8a6('0x60')][_0xc8a6('0x38')],_0x115611['user'][_0xc8a6('0x68')],_0x5d6632[_0xc8a6('0x69')]['id'],_0x115611[_0xc8a6('0x56')]?JSON['stringify'](_0x115611[_0xc8a6('0x56')]):_0xc8a6('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xc8a6('0x6b'),_0x5d6632);}return null;})[_0xc8a6('0x36')](function(_0x556197){var _0x761c37=_0xc8a6('0x6c')+_0x556197[_0xc8a6('0x26')][_0xc8a6('0x6d')];return db[_0xc8a6('0x6e')][_0xc8a6('0x3f')](_0x761c37,{'type':db[_0xc8a6('0x6f')]['QueryTypes'][_0xc8a6('0x70')],'raw':!![]})[_0xc8a6('0x36')](function(_0x49d2ea){return _0x49d2ea;});})[_0xc8a6('0x36')](function(_0x31dd4c){if(_0x31dd4c){_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x71')]=_0x31dd4c[0x0];if(!_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')])return;return db['User']['find']({'where':{'id':_0x115611[_0xc8a6('0x56')][_0xc8a6('0x5f')],'role':_0xc8a6('0x61')},'attributes':['id',_0xc8a6('0x38'),_0xc8a6('0x72'),_0xc8a6('0x73'),_0xc8a6('0x74')],'raw':!![]});}return null;})['then'](function(_0x799856){if(!_0x799856)return null;_0x5d6632[_0xc8a6('0x26')]['agent']=_0x799856;return _0x5d6632;})[_0xc8a6('0x36')](function(_0x2e5dca){if(_0x2e5dca){if(_0x115611[_0xc8a6('0x56')]['manual']){_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x75')]=util[_0xc8a6('0x65')](_0xc8a6('0x76'),_0x115611['user'][_0xc8a6('0x38')]);_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x77')]=_0x5d6632['channel'];_0x5d6632[_0xc8a6('0x26')][_0xc8a6('0x78')]=_0x5d6632[_0xc8a6('0x77')];_0x5d6632['message']['event']=_0xc8a6('0x5a');return respondWithRpcPromise(_0xc8a6('0x79'),'EventManager',{'event':_0xc8a6('0x7a'),'message':_['merge'](_0x5d6632['message'],JSON['parse'](_0x5d6632['interaction']['formData']))},client9002)[_0xc8a6('0x36')](function(){return _0x5d6632;});}return _0x5d6632;}return null;})['then'](respondWithResult(_0x15e9cd,null))[_0xc8a6('0x28')](handleError(_0x15e9cd,null));};var interaction_log=require(_0xc8a6('0x59'))(_0xc8a6('0x7b'));exports[_0xc8a6('0x33')]=function(_0x367c5e,_0x2b74de,_0x1000f6){var _0x20fe9d={'agent':{},'channel':'chat'};if(_0x367c5e[_0xc8a6('0x56')]['id']){delete _0x367c5e['body']['id'];}_0x367c5e['body']['UserId']=_0x367c5e[_0xc8a6('0x56')][_0xc8a6('0x5f')]||_0x367c5e[_0xc8a6('0x60')]['id'];_0x20fe9d[_0xc8a6('0x61')]['id']=_0x367c5e[_0xc8a6('0x56')]['UserId'];return db[_0xc8a6('0x3a')][_0xc8a6('0x54')]({'where':{'id':_0x367c5e['params']['id'],'UserId':null}})[_0xc8a6('0x36')](handleEntityNotFound(_0x2b74de,null))[_0xc8a6('0x36')](function(_0x4d5cc4){if(_0x4d5cc4){_0x20fe9d[_0xc8a6('0x26')]=_0x4d5cc4[_0xc8a6('0x66')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4d5cc4[_0xc8a6('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2b74de,null))[_0xc8a6('0x36')](function(_0x278fe1){if(_0x278fe1){_0x20fe9d[_0xc8a6('0x69')]=_0x278fe1[_0xc8a6('0x66')]({'plain':!![]});interaction_log[_0xc8a6('0x1f')](_0xc8a6('0x7c'),_0x367c5e[_0xc8a6('0x60')]['id'],_0x367c5e['user'][_0xc8a6('0x38')],_0x367c5e[_0xc8a6('0x60')][_0xc8a6('0x68')],_0x20fe9d[_0xc8a6('0x69')]['id'],_0x367c5e[_0xc8a6('0x56')]?JSON[_0xc8a6('0x22')](_0x367c5e[_0xc8a6('0x56')]):_0xc8a6('0x6a'));return respondWithRpcPromise(_0xc8a6('0x7d'),_0xc8a6('0x7e'),_0x20fe9d);}return null;})['then'](function(_0x2916c1){var _0x2e7d55=_0xc8a6('0x6c')+_0x2916c1['message'][_0xc8a6('0x6d')];return db[_0xc8a6('0x6e')][_0xc8a6('0x3f')](_0x2e7d55,{'type':db[_0xc8a6('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc8a6('0x36')](function(_0xab39ed){return _0xab39ed;});})['then'](function(_0x4d763e){if(_0x4d763e){_0x20fe9d[_0xc8a6('0x26')]['contact']=_0x4d763e[0x0];if(!_0x367c5e[_0xc8a6('0x56')][_0xc8a6('0x5f')])return;return db[_0xc8a6('0x7f')][_0xc8a6('0x54')]({'where':{'id':_0x367c5e[_0xc8a6('0x56')][_0xc8a6('0x5f')],'role':_0xc8a6('0x61')},'attributes':['id','name',_0xc8a6('0x72'),'email',_0xc8a6('0x74')],'raw':!![]});}return null;})[_0xc8a6('0x36')](function(_0x3cb766){if(!_0x3cb766)return null;_0x20fe9d[_0xc8a6('0x26')][_0xc8a6('0x61')]=_0x3cb766;return _0x20fe9d;})[_0xc8a6('0x36')](function(_0x121655){if(_0x121655){_0x121655[_0xc8a6('0x26')][_0xc8a6('0x75')]=util[_0xc8a6('0x65')](_0xc8a6('0x76'),_0x367c5e[_0xc8a6('0x60')][_0xc8a6('0x38')]);_0x121655['message']['channel']=_0x20fe9d[_0xc8a6('0x77')];_0x121655[_0xc8a6('0x26')][_0xc8a6('0x78')]=_0x20fe9d['channel'];_0x121655[_0xc8a6('0x26')][_0xc8a6('0x80')]='reject';respondWithRpcPromise(_0xc8a6('0x79'),'EventManager',{'event':_0xc8a6('0x81'),'message':_['merge'](_0x20fe9d[_0xc8a6('0x26')],JSON['parse'](_0x20fe9d[_0xc8a6('0x69')]['formData']))},client9002);return _0x20fe9d;}return null;})[_0xc8a6('0x36')](respondWithResult(_0x2b74de,null))[_0xc8a6('0x28')](handleError(_0x2b74de,null));};
\ No newline at end of file
+var _0x0923=['role','stringify','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','rejectmessage','formData','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','catch','status','json','undefined','count','offset','limit','set','reject','save','then','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','show','params','include','find','body','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','update','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2332ed,_0x1780ec){var _0x2be002=function(_0x198730){while(--_0x198730){_0x2332ed['push'](_0x2332ed['shift']());}};_0x2be002(++_0x1780ec);}(_0x0923,0x184));var _0x3092=function(_0x283001,_0x412b3a){_0x283001=_0x283001-0x0;var _0x57915e=_0x0923[_0x283001];return _0x57915e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3092('0x0'));var BPromise=require(_0x3092('0x1'));var Mustache=require(_0x3092('0x2'));var util=require(_0x3092('0x3'));var path=require('path');var sox=require(_0x3092('0x4'));var csv=require('to-csv');var ejs=require(_0x3092('0x5'));var fs=require('fs');var fs_extra=require(_0x3092('0x6'));var _=require(_0x3092('0x7'));var squel=require('squel');var crypto=require(_0x3092('0x8'));var jsforce=require(_0x3092('0x9'));var deskjs=require(_0x3092('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3092('0xb'));var qs=require(_0x3092('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3092('0xd'))('api');var utils=require(_0x3092('0xe'));var config=require(_0x3092('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x3092('0x10'))['db'];config[_0x3092('0x11')]=_[_0x3092('0x12')](config[_0x3092('0x11')],{'host':_0x3092('0x13'),'port':0x18eb});var socket=require(_0x3092('0x14'))(new Redis(config[_0x3092('0x11')]));require(_0x3092('0x15'))[_0x3092('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3092('0x17')][_0x3092('0x18')]({'port':0x232c});var client9002=jayson[_0x3092('0x17')][_0x3092('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x515242,_0x3241d0,_0x5a8cd6,_0x32576e){return new BPromise(function(_0x458351,_0x26fc1d){var _0x7f4fd=_0x32576e||client;return _0x7f4fd[_0x3092('0x19')](_0x515242,_0x5a8cd6)['then'](function(_0x8e6399){logger[_0x3092('0x1a')](_0x3092('0x1b'),_0x3241d0,_0x3092('0x1c'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3241d0,_0x3092('0x1c'),JSON['stringify'](_0x8e6399));if(_0x8e6399[_0x3092('0x1d')]){if(_0x8e6399[_0x3092('0x1d')]['code']===0x1f4){logger['error'](_0x3092('0x1b'),_0x3241d0,_0x8e6399[_0x3092('0x1d')]['message']);return _0x26fc1d(_0x8e6399[_0x3092('0x1d')][_0x3092('0x1e')]);}logger[_0x3092('0x1d')](_0x3092('0x1b'),_0x3241d0,_0x8e6399[_0x3092('0x1d')][_0x3092('0x1e')]);return _0x458351(_0x8e6399['error']['message']);}else{logger['info'](_0x3092('0x1b'),_0x3241d0,_0x3092('0x1c'));_0x458351(_0x8e6399['result']['message']);}})[_0x3092('0x1f')](function(_0x268ee3){logger[_0x3092('0x1d')](_0x3092('0x1b'),_0x3241d0,_0x268ee3);_0x26fc1d(_0x268ee3);});});}function respondWithStatusCode(_0x37ffac,_0x5f1435){_0x5f1435=_0x5f1435||0xcc;return function(_0x2cd339){if(_0x2cd339){return _0x37ffac['sendStatus'](_0x5f1435);}return _0x37ffac[_0x3092('0x20')](_0x5f1435)['end']();};}function respondWithResult(_0x445664,_0x33b9c4){_0x33b9c4=_0x33b9c4||0xc8;return function(_0x589ccd){if(_0x589ccd){return _0x445664[_0x3092('0x20')](_0x33b9c4)[_0x3092('0x21')](_0x589ccd);}};}function respondWithFilteredResult(_0xc67999,_0x1b3962){return function(_0x4159ee){if(_0x4159ee){var _0x10c4ac=typeof _0x1b3962['offset']===_0x3092('0x22')&&typeof _0x1b3962['limit']===_0x3092('0x22');var _0x279ed6=_0x4159ee[_0x3092('0x23')];var _0x6b8ab5=_0x10c4ac?0x0:_0x1b3962[_0x3092('0x24')];var _0x341762=_0x10c4ac?_0x4159ee['count']:_0x1b3962[_0x3092('0x24')]+_0x1b3962[_0x3092('0x25')];var _0xb0e69;if(_0x341762>=_0x279ed6){_0x341762=_0x279ed6;_0xb0e69=0xc8;}else{_0xb0e69=0xce;}_0xc67999[_0x3092('0x20')](_0xb0e69);return _0xc67999[_0x3092('0x26')]('Content-Range',_0x6b8ab5+'-'+_0x341762+'/'+_0x279ed6)[_0x3092('0x21')](_0x4159ee);}return null;};}function patchUpdates(_0x456196){return function(_0x301afd){try{jsonpatch['apply'](_0x301afd,_0x456196,!![]);}catch(_0x998243){return BPromise[_0x3092('0x27')](_0x998243);}return _0x301afd[_0x3092('0x28')]();};}function saveUpdates(_0x2951e9,_0x242e72){return function(_0xd5f9b9){if(_0xd5f9b9){return _0xd5f9b9['update'](_0x2951e9)[_0x3092('0x29')](function(_0x1e3500){return _0x1e3500;});}return null;};}function removeEntity(_0x1824a9,_0x580ca7){return function(_0x4d1110){if(_0x4d1110){return _0x4d1110[_0x3092('0x2a')]()[_0x3092('0x29')](function(){_0x1824a9[_0x3092('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ed5a,_0x3d89e2){return function(_0x9a3784){if(!_0x9a3784){_0x29ed5a['sendStatus'](0x194);}return _0x9a3784;};}function handleError(_0x5625a6,_0x1ab428){_0x1ab428=_0x1ab428||0x1f4;return function(_0x258690){logger['error'](_0x258690[_0x3092('0x2b')]);if(_0x258690['name']){delete _0x258690[_0x3092('0x2c')];}_0x5625a6[_0x3092('0x20')](_0x1ab428)['send'](_0x258690);};}exports[_0x3092('0x2d')]=function(_0x39a447,_0xf6575f){var _0x379b12={},_0x4dc81b={},_0x5c75f1={'count':0x0,'rows':[]};var _0x2aae1d=_[_0x3092('0x2e')](db[_0x3092('0x2f')][_0x3092('0x30')],function(_0x5b6ea8){return{'name':_0x5b6ea8[_0x3092('0x31')],'type':_0x5b6ea8[_0x3092('0x32')]['key']};});_0x4dc81b[_0x3092('0x33')]=_[_0x3092('0x2e')](_0x2aae1d,_0x3092('0x2c'));_0x4dc81b[_0x3092('0x34')]=_[_0x3092('0x35')](_0x39a447[_0x3092('0x34')]);_0x4dc81b[_0x3092('0x36')]=_['intersection'](_0x4dc81b[_0x3092('0x33')],_0x4dc81b[_0x3092('0x34')]);_0x379b12[_0x3092('0x37')]=_[_0x3092('0x38')](_0x4dc81b[_0x3092('0x33')],qs[_0x3092('0x39')](_0x39a447[_0x3092('0x34')]['fields']));_0x379b12['attributes']=_0x379b12[_0x3092('0x37')][_0x3092('0x3a')]?_0x379b12[_0x3092('0x37')]:_0x4dc81b[_0x3092('0x33')];if(!_0x39a447[_0x3092('0x34')][_0x3092('0x3b')](_0x3092('0x3c'))){_0x379b12['limit']=qs[_0x3092('0x25')](_0x39a447['query'][_0x3092('0x25')]);_0x379b12[_0x3092('0x24')]=qs[_0x3092('0x24')](_0x39a447['query'][_0x3092('0x24')]);}_0x379b12[_0x3092('0x3d')]=qs['sort'](_0x39a447[_0x3092('0x34')][_0x3092('0x3e')]);_0x379b12[_0x3092('0x3f')]=qs[_0x3092('0x36')](_['pick'](_0x39a447[_0x3092('0x34')],_0x4dc81b['filters']),_0x2aae1d);if(_0x39a447[_0x3092('0x34')][_0x3092('0x40')]){_0x379b12[_0x3092('0x3f')]=_[_0x3092('0x41')](_0x379b12['where'],{'$or':_[_0x3092('0x2e')](_0x2aae1d,function(_0x383f0f){if(_0x383f0f[_0x3092('0x32')]!==_0x3092('0x42')){var _0x4e1f38={};_0x4e1f38[_0x383f0f[_0x3092('0x2c')]]={'$like':'%'+_0x39a447[_0x3092('0x34')][_0x3092('0x40')]+'%'};return _0x4e1f38;}})});}_0x379b12=_[_0x3092('0x41')]({},_0x379b12,_0x39a447[_0x3092('0x43')]);var _0x1b2438={'where':_0x379b12[_0x3092('0x3f')]};return db[_0x3092('0x2f')][_0x3092('0x23')](_0x1b2438)[_0x3092('0x29')](function(_0x268f9c){_0x5c75f1[_0x3092('0x23')]=_0x268f9c;if(_0x39a447['query'][_0x3092('0x44')]){_0x379b12['include']=[{'all':!![]}];}return db[_0x3092('0x2f')]['findAll'](_0x379b12);})[_0x3092('0x29')](function(_0x3acce5){_0x5c75f1['rows']=_0x3acce5;return _0x5c75f1;})[_0x3092('0x29')](respondWithFilteredResult(_0xf6575f,_0x379b12))[_0x3092('0x1f')](handleError(_0xf6575f,null));};exports[_0x3092('0x45')]=function(_0x2b9afc,_0x710403){var _0x3f0973={'raw':!![],'where':{'id':_0x2b9afc[_0x3092('0x46')]['id']}},_0x392a88={};_0x392a88['model']=_[_0x3092('0x35')](db[_0x3092('0x2f')][_0x3092('0x30')]);_0x392a88[_0x3092('0x34')]=_[_0x3092('0x35')](_0x2b9afc[_0x3092('0x34')]);_0x392a88['filters']=_[_0x3092('0x38')](_0x392a88[_0x3092('0x33')],_0x392a88[_0x3092('0x34')]);_0x3f0973[_0x3092('0x37')]=_[_0x3092('0x38')](_0x392a88[_0x3092('0x33')],qs[_0x3092('0x39')](_0x2b9afc[_0x3092('0x34')]['fields']));_0x3f0973['attributes']=_0x3f0973['attributes'][_0x3092('0x3a')]?_0x3f0973['attributes']:_0x392a88[_0x3092('0x33')];if(_0x2b9afc[_0x3092('0x34')][_0x3092('0x44')]){_0x3f0973[_0x3092('0x47')]=[{'all':!![]}];}_0x3f0973=_[_0x3092('0x41')]({},_0x3f0973,_0x2b9afc[_0x3092('0x43')]);return db['ChatMessage'][_0x3092('0x48')](_0x3f0973)[_0x3092('0x29')](handleEntityNotFound(_0x710403,null))[_0x3092('0x29')](respondWithResult(_0x710403,null))[_0x3092('0x1f')](handleError(_0x710403,null));};exports['create']=function(_0xae1b30,_0x2f82c2){return db[_0x3092('0x2f')]['create'](_0xae1b30[_0x3092('0x49')],{})[_0x3092('0x29')](respondWithResult(_0x2f82c2,0xc9))['catch'](handleError(_0x2f82c2,null));};exports['update']=function(_0xbd25c1,_0x341358){if(_0xbd25c1['body']['id']){delete _0xbd25c1['body']['id'];}return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0xbd25c1[_0x3092('0x46')]['id']}})['then'](handleEntityNotFound(_0x341358,null))[_0x3092('0x29')](saveUpdates(_0xbd25c1['body'],null))['then'](respondWithResult(_0x341358,null))[_0x3092('0x1f')](handleError(_0x341358,null));};exports[_0x3092('0x2a')]=function(_0x42030c,_0x482263){return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0x42030c[_0x3092('0x46')]['id']}})[_0x3092('0x29')](handleEntityNotFound(_0x482263,null))[_0x3092('0x29')](removeEntity(_0x482263,null))[_0x3092('0x1f')](handleError(_0x482263,null));};exports[_0x3092('0x4a')]=function(_0x5b898e,_0x598f80){return db[_0x3092('0x2f')][_0x3092('0x4a')]()[_0x3092('0x29')](respondWithResult(_0x598f80,null))['catch'](handleError(_0x598f80,null));};var interaction_log=require(_0x3092('0xd'))(_0x3092('0x4b'));exports['accept']=function(_0x1109bd,_0x3292ad,_0x2ba227){var _0x26401a={'agent':{},'channel':'chat'};if(_0x1109bd[_0x3092('0x49')]['id']){delete _0x1109bd[_0x3092('0x49')]['id'];}_0x1109bd[_0x3092('0x49')][_0x3092('0x4c')]=!![];_0x1109bd[_0x3092('0x49')][_0x3092('0x4d')]=moment()[_0x3092('0x4e')](_0x3092('0x4f'));_0x1109bd['body']['UserId']=_0x1109bd[_0x3092('0x49')][_0x3092('0x50')]||_0x1109bd[_0x3092('0x51')]['id'];_0x26401a[_0x3092('0x52')]['id']=_0x1109bd['body'][_0x3092('0x50')];return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0x1109bd[_0x3092('0x46')]['id'],'UserId':null}})[_0x3092('0x29')](handleEntityNotFound(_0x3292ad,null))[_0x3092('0x29')](saveUpdates(_0x1109bd[_0x3092('0x49')],null))[_0x3092('0x29')](function(_0x39568f){if(_0x39568f){_0x26401a[_0x3092('0x1e')]=_0x39568f['get']({'plain':!![]});return db[_0x3092('0x53')]['find']({'where':{'id':_0x39568f['ChatInteractionId']}});}return null;})[_0x3092('0x29')](handleEntityNotFound(_0x3292ad,null))[_0x3092('0x29')](function(_0x5b3b95){if(_0x5b3b95){return _0x5b3b95[_0x3092('0x54')]({'UserId':_0x1109bd[_0x3092('0x49')][_0x3092('0x50')],'read1stAt':_[_0x3092('0x55')](_0x5b3b95['read1stAt'])?moment()[_0x3092('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3092('0x29')](function(_0x59bcde){if(_0x59bcde){_0x26401a[_0x3092('0x56')]=_0x59bcde['get']({'plain':!![]});interaction_log[_0x3092('0x1a')](_0x3092('0x57'),_0x1109bd[_0x3092('0x51')]['id'],_0x1109bd[_0x3092('0x51')]['name'],_0x1109bd['user'][_0x3092('0x58')],_0x26401a[_0x3092('0x56')]['id'],_0x1109bd['body']?JSON[_0x3092('0x59')](_0x1109bd[_0x3092('0x49')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3092('0x5a'),_0x26401a);}return null;})['then'](function(_0xedd0ce){var _0x5a128a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xedd0ce[_0x3092('0x1e')][_0x3092('0x5b')];return db[_0x3092('0x5c')][_0x3092('0x34')](_0x5a128a,{'type':db[_0x3092('0x5d')]['QueryTypes'][_0x3092('0x5e')],'raw':!![]})[_0x3092('0x29')](function(_0x61b92b){return _0x61b92b;});})[_0x3092('0x29')](function(_0x3e3bbf){if(_0x3e3bbf){_0x26401a['message'][_0x3092('0x5f')]=_0x3e3bbf[0x0];if(!_0x1109bd[_0x3092('0x49')][_0x3092('0x50')])return;return db[_0x3092('0x60')][_0x3092('0x48')]({'where':{'id':_0x1109bd[_0x3092('0x49')][_0x3092('0x50')],'role':_0x3092('0x52')},'attributes':['id',_0x3092('0x2c'),_0x3092('0x61'),_0x3092('0x62'),_0x3092('0x63')],'raw':!![]});}return null;})[_0x3092('0x29')](function(_0x53a6e7){if(!_0x53a6e7)return null;_0x26401a['message'][_0x3092('0x52')]=_0x53a6e7;return _0x26401a;})[_0x3092('0x29')](function(_0x304768){if(_0x304768){if(_0x1109bd[_0x3092('0x49')][_0x3092('0x64')]){_0x26401a[_0x3092('0x1e')][_0x3092('0x65')]=util['format'](_0x3092('0x66'),_0x1109bd[_0x3092('0x51')][_0x3092('0x2c')]);_0x26401a['message'][_0x3092('0x67')]=_0x26401a['channel'];_0x26401a[_0x3092('0x1e')][_0x3092('0x68')]=_0x26401a[_0x3092('0x67')];_0x26401a['message'][_0x3092('0x69')]=_0x3092('0x6a');return respondWithRpcPromise(_0x3092('0x6b'),_0x3092('0x6b'),{'event':_0x3092('0x6c'),'message':_['merge'](_0x26401a['message'],JSON[_0x3092('0x6d')](_0x26401a['interaction']['formData']))},client9002)['then'](function(){return _0x26401a;});}return _0x26401a;}return null;})[_0x3092('0x29')](respondWithResult(_0x3292ad,null))['catch'](handleError(_0x3292ad,null));};var interaction_log=require(_0x3092('0xd'))(_0x3092('0x4b'));exports['reject']=function(_0x4842af,_0x35d182,_0x3c95fb){var _0x5b87f5={'agent':{},'channel':'chat'};if(_0x4842af['body']['id']){delete _0x4842af['body']['id'];}_0x4842af[_0x3092('0x49')][_0x3092('0x50')]=_0x4842af[_0x3092('0x49')]['UserId']||_0x4842af['user']['id'];_0x5b87f5[_0x3092('0x52')]['id']=_0x4842af[_0x3092('0x49')]['UserId'];return db[_0x3092('0x2f')][_0x3092('0x48')]({'where':{'id':_0x4842af[_0x3092('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35d182,null))[_0x3092('0x29')](function(_0x1fe6d7){if(_0x1fe6d7){_0x5b87f5[_0x3092('0x1e')]=_0x1fe6d7[_0x3092('0x6e')]({'plain':!![]});return db[_0x3092('0x53')][_0x3092('0x48')]({'where':{'id':_0x1fe6d7[_0x3092('0x6f')]}});}return null;})[_0x3092('0x29')](handleEntityNotFound(_0x35d182,null))[_0x3092('0x29')](function(_0x510e3f){if(_0x510e3f){_0x5b87f5[_0x3092('0x56')]=_0x510e3f[_0x3092('0x6e')]({'plain':!![]});interaction_log[_0x3092('0x1a')](_0x3092('0x70'),_0x4842af[_0x3092('0x51')]['id'],_0x4842af[_0x3092('0x51')][_0x3092('0x2c')],_0x4842af[_0x3092('0x51')][_0x3092('0x58')],_0x5b87f5['interaction']['id'],_0x4842af[_0x3092('0x49')]?JSON[_0x3092('0x59')](_0x4842af[_0x3092('0x49')]):_0x3092('0x71'));return respondWithRpcPromise('RejectMessage',_0x3092('0x72'),_0x5b87f5);}return null;})[_0x3092('0x29')](function(_0x11ddf9){var _0x4f84a4=_0x3092('0x73')+_0x11ddf9[_0x3092('0x1e')][_0x3092('0x5b')];return db[_0x3092('0x5c')][_0x3092('0x34')](_0x4f84a4,{'type':db[_0x3092('0x5d')][_0x3092('0x74')][_0x3092('0x5e')],'raw':!![]})[_0x3092('0x29')](function(_0x3d862e){return _0x3d862e;});})[_0x3092('0x29')](function(_0x5a7dde){if(_0x5a7dde){_0x5b87f5['message'][_0x3092('0x5f')]=_0x5a7dde[0x0];if(!_0x4842af[_0x3092('0x49')][_0x3092('0x50')])return;return db['User'][_0x3092('0x48')]({'where':{'id':_0x4842af['body']['UserId'],'role':'agent'},'attributes':['id',_0x3092('0x2c'),_0x3092('0x61'),_0x3092('0x62'),_0x3092('0x63')],'raw':!![]});}return null;})[_0x3092('0x29')](function(_0x9cf8c1){if(!_0x9cf8c1)return null;_0x5b87f5[_0x3092('0x1e')][_0x3092('0x52')]=_0x9cf8c1;return _0x5b87f5;})[_0x3092('0x29')](function(_0xe48ce7){if(_0xe48ce7){_0xe48ce7[_0x3092('0x1e')][_0x3092('0x65')]=util[_0x3092('0x4e')](_0x3092('0x66'),_0x4842af['user'][_0x3092('0x2c')]);_0xe48ce7['message'][_0x3092('0x67')]=_0x5b87f5[_0x3092('0x67')];_0xe48ce7[_0x3092('0x1e')]['motionChannel']=_0x5b87f5['channel'];_0xe48ce7[_0x3092('0x1e')][_0x3092('0x69')]=_0x3092('0x27');respondWithRpcPromise(_0x3092('0x6b'),_0x3092('0x6b'),{'event':_0x3092('0x75'),'message':_['merge'](_0x5b87f5[_0x3092('0x1e')],JSON[_0x3092('0x6d')](_0x5b87f5[_0x3092('0x56')][_0x3092('0x76')]))},client9002);return _0x5b87f5;}return null;})['then'](respondWithResult(_0x35d182,null))[_0x3092('0x1f')](handleError(_0x35d182,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index fdcc4a1..4708151 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 _0x013f=['emit','hook','exports','events','setMaxListeners','update','remove'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0x013f,0x1e6));var _0xf013=function(_0x5ac5c7,_0x346df2){_0x5ac5c7=_0x5ac5c7-0x0;var _0x1b4560=_0x013f[_0x5ac5c7];return _0x1b4560;};'use strict';var EventEmitter=require(_0xf013('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf013('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf013('0x2'),'afterDestroy':_0xf013('0x3')};function emitEvent(_0x2285ab){return function(_0x37bd4f,_0x24cf6d,_0x4fb3e6){ChatMessageEvents[_0xf013('0x4')](_0x2285ab+':'+_0x37bd4f['id'],_0x37bd4f);ChatMessageEvents[_0xf013('0x4')](_0x2285ab,_0x37bd4f);_0x4fb3e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf013('0x5')](e,emitEvent(event));}}module[_0xf013('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb047=['update','remove','emit','hook','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb047,0x1c4));var _0x7b04=function(_0x213e14,_0x3f4564){_0x213e14=_0x213e14-0x0;var _0xe1d980=_0xb047[_0x213e14];return _0xe1d980;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7b04('0x0'))['db'][_0x7b04('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7b04('0x2')](0x0);var events={'afterCreate':_0x7b04('0x3'),'afterUpdate':_0x7b04('0x4'),'afterDestroy':_0x7b04('0x5')};function emitEvent(_0x297442){return function(_0x419af9,_0x4fd200,_0x3e81b9){ChatMessageEvents[_0x7b04('0x6')](_0x297442+':'+_0x419af9['id'],_0x419af9);ChatMessageEvents[_0x7b04('0x6')](_0x297442,_0x419af9);_0x3e81b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7b04('0x7')](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 6de7c1b..8881a52 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 _0xbcb8=['secret','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','toLowerCase','direction','out'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xbcb8,0x1c9));var _0x8bcb=function(_0x2138bf,_0x2f01cf){_0x2138bf=_0x2138bf-0x0;var _0x129a73=_0xbcb8[_0x2138bf];return _0x129a73;};'use strict';var _=require(_0x8bcb('0x0'));var util=require(_0x8bcb('0x1'));var logger=require(_0x8bcb('0x2'))('api');var moment=require(_0x8bcb('0x3'));var BPromise=require(_0x8bcb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bcb('0x5'));var rimraf=require(_0x8bcb('0x6'));var config=require(_0x8bcb('0x7'));var attributes=require(_0x8bcb('0x8'));module['exports']=function(_0x2d2247,_0x22281f){return _0x2d2247[_0x8bcb('0x9')](_0x8bcb('0xa'),attributes,{'tableName':_0x8bcb('0xb'),'paranoid':![],'indexes':[{'name':_0x8bcb('0xc'),'fields':[_0x8bcb('0xd')],'type':_0x8bcb('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dfcdf,_0x63a31f,_0x1429c0){var _0x5e366e=_0x2d2247['models'];var _0x371e63=_0x3dfcdf[_0x8bcb('0xf')]({'plain':!![]});if(_0x371e63['direction'][_0x8bcb('0x10')]()==='in'||_0x371e63[_0x8bcb('0x11')]['toLowerCase']()===_0x8bcb('0x12')&&!_0x371e63[_0x8bcb('0x13')]&&!_['isNil'](_0x371e63['UserId'])){_0x5e366e['ChatInteraction'][_0x8bcb('0x14')]({'where':{'id':_0x371e63[_0x8bcb('0x15')]}})['then'](function(_0x26ee77){if(_0x26ee77){_0x26ee77[_0x8bcb('0x16')]({'lastMsgAt':_0x371e63[_0x8bcb('0x17')],'lastMsgDirection':_0x371e63['direction']['toLowerCase']()});}})[_0x8bcb('0x18')](function(_0x20c833){console[_0x8bcb('0x19')](_0x20c833);});}_0x1429c0();}},'charset':_0x8bcb('0x1a'),'collate':_0x8bcb('0x1b')});};
\ No newline at end of file
+var _0xda3f=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','get','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','update','direction','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1dece2,_0x3e6adf){var _0x3a1cfc=function(_0x413d6a){while(--_0x413d6a){_0x1dece2['push'](_0x1dece2['shift']());}};_0x3a1cfc(++_0x3e6adf);}(_0xda3f,0x120));var _0xfda3=function(_0x45233b,_0x68aeee){_0x45233b=_0x45233b-0x0;var _0x188c4b=_0xda3f[_0x45233b];return _0x188c4b;};'use strict';var _=require(_0xfda3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfda3('0x1'));var moment=require(_0xfda3('0x2'));var BPromise=require(_0xfda3('0x3'));var rp=require(_0xfda3('0x4'));var fs=require('fs');var path=require(_0xfda3('0x5'));var rimraf=require('rimraf');var config=require(_0xfda3('0x6'));var attributes=require(_0xfda3('0x7'));module['exports']=function(_0x3462b5,_0x4c26c6){return _0x3462b5[_0xfda3('0x8')](_0xfda3('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfe44a,_0x506d0c,_0x1b1a6c){var _0x3e1245=_0x3462b5['models'];var _0xe3db39=_0xfe44a[_0xfda3('0xa')]({'plain':!![]});if(_0xe3db39['direction'][_0xfda3('0xb')]()==='in'||_0xe3db39['direction'][_0xfda3('0xb')]()===_0xfda3('0xc')&&!_0xe3db39[_0xfda3('0xd')]&&!_[_0xfda3('0xe')](_0xe3db39[_0xfda3('0xf')])){_0x3e1245[_0xfda3('0x10')][_0xfda3('0x11')]({'where':{'id':_0xe3db39['ChatInteractionId']}})['then'](function(_0x5b6ddd){if(_0x5b6ddd){_0x5b6ddd[_0xfda3('0x12')]({'lastMsgAt':_0xe3db39['createdAt'],'lastMsgDirection':_0xe3db39[_0xfda3('0x13')][_0xfda3('0xb')]()});}})[_0xfda3('0x14')](function(_0x56f6c2){console[_0xfda3('0x15')](_0x56f6c2);});}_0x1b1a6c();}},'charset':_0xfda3('0x16'),'collate':_0xfda3('0x17')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e382805..b253907 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 _0x0b3b=['request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateChatMessage','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','request','then','ChatMessage,\x20%s,\x20%s'];(function(_0x2703fd,_0x3b5705){var _0x584a20=function(_0x15297f){while(--_0x15297f){_0x2703fd['push'](_0x2703fd['shift']());}};_0x584a20(++_0x3b5705);}(_0x0b3b,0xcd));var _0xb0b3=function(_0xb36a60,_0x5c2659){_0xb36a60=_0xb36a60-0x0;var _0x5e5aad=_0x0b3b[_0xb36a60];return _0x5e5aad;};'use strict';var _=require('lodash');var util=require(_0xb0b3('0x0'));var moment=require(_0xb0b3('0x1'));var BPromise=require(_0xb0b3('0x2'));var rs=require(_0xb0b3('0x3'));var fs=require('fs');var Redis=require(_0xb0b3('0x4'));var db=require(_0xb0b3('0x5'))['db'];var utils=require(_0xb0b3('0x6'));var logger=require(_0xb0b3('0x7'))(_0xb0b3('0x8'));var config=require(_0xb0b3('0x9'));var jayson=require(_0xb0b3('0xa'));var client=jayson['client'][_0xb0b3('0xb')]({'port':0x232a});config['redis']=_[_0xb0b3('0xc')](config[_0xb0b3('0xd')],{'host':_0xb0b3('0xe'),'port':0x18eb});var socket=require(_0xb0b3('0xf'))(new Redis(config[_0xb0b3('0xd')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x546ada,_0x323dac,_0xf13f89){return new BPromise(function(_0x1bd4fe,_0x4593ed){return client[_0xb0b3('0x10')](_0x546ada,_0xf13f89)[_0xb0b3('0x11')](function(_0x41bac7){logger['info'](_0xb0b3('0x12'),_0x323dac,_0xb0b3('0x13'));logger['debug'](_0xb0b3('0x14'),_0x323dac,'request\x20sent',JSON[_0xb0b3('0x15')](_0x41bac7));if(_0x41bac7[_0xb0b3('0x16')]){if(_0x41bac7[_0xb0b3('0x16')][_0xb0b3('0x17')]===0x1f4){logger[_0xb0b3('0x16')](_0xb0b3('0x12'),_0x323dac,_0x41bac7[_0xb0b3('0x16')][_0xb0b3('0x18')]);return _0x4593ed(_0x41bac7[_0xb0b3('0x16')]['message']);}logger[_0xb0b3('0x16')](_0xb0b3('0x12'),_0x323dac,_0x41bac7['error'][_0xb0b3('0x18')]);return _0x1bd4fe(_0x41bac7[_0xb0b3('0x16')]['message']);}else{logger[_0xb0b3('0x19')](_0xb0b3('0x12'),_0x323dac,'request\x20sent');_0x1bd4fe(_0x41bac7['result'][_0xb0b3('0x18')]);}})['catch'](function(_0x55a2b3){logger[_0xb0b3('0x16')](_0xb0b3('0x12'),_0x323dac,_0x55a2b3);_0x4593ed(_0x55a2b3);});});}exports[_0xb0b3('0x1a')]=function(_0x6ac39){var _0x3bbbf7=this;return new Promise(function(_0x1a5ee2,_0x3b48bf){return db['ChatMessage'][_0xb0b3('0x1b')](_0x6ac39[_0xb0b3('0x1c')],{'raw':_0x6ac39['options']?_0x6ac39[_0xb0b3('0x1d')][_0xb0b3('0x1e')]===undefined?!![]:![]:!![]})[_0xb0b3('0x11')](function(_0x1f52f2){logger[_0xb0b3('0x19')]('CreateChatMessage',_0x6ac39);logger['debug'](_0xb0b3('0x1a'),_0x6ac39,JSON[_0xb0b3('0x15')](_0x1f52f2));_0x1a5ee2(_0x1f52f2);})[_0xb0b3('0x1f')](function(_0x4f7dda){logger[_0xb0b3('0x16')](_0xb0b3('0x1a'),_0x4f7dda['message'],_0x6ac39);_0x3b48bf(_0x3bbbf7['error'](0x1f4,_0x4f7dda[_0xb0b3('0x18')]));});});};
\ No newline at end of file
+var _0x8297=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x54ae7b,_0x12be0a){var _0x337021=function(_0x40c38f){while(--_0x40c38f){_0x54ae7b['push'](_0x54ae7b['shift']());}};_0x337021(++_0x12be0a);}(_0x8297,0x18c));var _0x7829=function(_0x39dbf9,_0x3118ab){_0x39dbf9=_0x39dbf9-0x0;var _0x49785c=_0x8297[_0x39dbf9];return _0x49785c;};'use strict';var _=require(_0x7829('0x0'));var util=require(_0x7829('0x1'));var moment=require(_0x7829('0x2'));var BPromise=require(_0x7829('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7829('0x4'));var db=require(_0x7829('0x5'))['db'];var utils=require(_0x7829('0x6'));var logger=require(_0x7829('0x7'))(_0x7829('0x8'));var config=require(_0x7829('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7829('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7829('0xb')](config[_0x7829('0xc')],{'host':_0x7829('0xd'),'port':0x18eb});var socket=require(_0x7829('0xe'))(new Redis(config[_0x7829('0xc')]));require(_0x7829('0xf'))[_0x7829('0x10')](socket);function respondWithRpcPromise(_0x474d4d,_0x3ba981,_0x305f01){return new BPromise(function(_0x3639db,_0xa8550f){return client[_0x7829('0x11')](_0x474d4d,_0x305f01)[_0x7829('0x12')](function(_0x52317a){logger['info'](_0x7829('0x13'),_0x3ba981,_0x7829('0x14'));logger[_0x7829('0x15')](_0x7829('0x16'),_0x3ba981,'request\x20sent',JSON[_0x7829('0x17')](_0x52317a));if(_0x52317a['error']){if(_0x52317a[_0x7829('0x18')]['code']===0x1f4){logger[_0x7829('0x18')](_0x7829('0x13'),_0x3ba981,_0x52317a['error']['message']);return _0xa8550f(_0x52317a[_0x7829('0x18')][_0x7829('0x19')]);}logger[_0x7829('0x18')](_0x7829('0x13'),_0x3ba981,_0x52317a[_0x7829('0x18')][_0x7829('0x19')]);return _0x3639db(_0x52317a[_0x7829('0x18')]['message']);}else{logger[_0x7829('0x1a')](_0x7829('0x13'),_0x3ba981,'request\x20sent');_0x3639db(_0x52317a['result'][_0x7829('0x19')]);}})[_0x7829('0x1b')](function(_0x566e19){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3ba981,_0x566e19);_0xa8550f(_0x566e19);});});}exports[_0x7829('0x1c')]=function(_0x58ee11){var _0x384d18=this;return new Promise(function(_0x226135,_0x26dae0){return db[_0x7829('0x1d')]['create'](_0x58ee11[_0x7829('0x1e')],{'raw':_0x58ee11[_0x7829('0x1f')]?_0x58ee11[_0x7829('0x1f')][_0x7829('0x20')]===undefined?!![]:![]:!![]})[_0x7829('0x12')](function(_0x223512){logger['info'](_0x7829('0x1c'),_0x58ee11);logger['debug'](_0x7829('0x1c'),_0x58ee11,JSON[_0x7829('0x17')](_0x223512));_0x226135(_0x223512);})['catch'](function(_0x379061){logger['error'](_0x7829('0x1c'),_0x379061['message'],_0x58ee11);_0x26dae0(_0x384d18[_0x7829('0x18')](0x1f4,_0x379061[_0x7829('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ad3f2fc..fa74057 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 _0x4b84=['./chatMessage.events','save','emit','length'];(function(_0x4564f6,_0x5b5064){var _0x50005b=function(_0xb856bd){while(--_0xb856bd){_0x4564f6['push'](_0x4564f6['shift']());}};_0x50005b(++_0x5b5064);}(_0x4b84,0x1cc));var _0x44b8=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x4b84[_0x328b1c];return _0x4dbeaa;};'use strict';var ChatMessageEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatMessageEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatMessage:'+_0x5947f7,_0x55f25d);ChatMessageEvents['on'](_0x5947f7,_0x3e87c5);}};
\ No newline at end of file
+var _0x72b1=['register','length','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x72b1,0x16e));var _0x172b=function(_0x41048d,_0x25d4f4){_0x41048d=_0x41048d-0x0;var _0x1284ee=_0x72b1[_0x41048d];return _0x1284ee;};'use strict';var ChatMessageEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatMessageEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatMessage:'+_0x517363,_0x475fd6);ChatMessageEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 659db57..efd9c65 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 _0x519b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x519b,0x7d));var _0xb519=function(_0x362057,_0x448ff9){_0x362057=_0x362057-0x0;var _0x397f79=_0x519b[_0x362057];return _0x397f79;};'use strict';var multer=require(_0xb519('0x0'));var util=require(_0xb519('0x1'));var path=require(_0xb519('0x2'));var timeout=require(_0xb519('0x3'));var express=require(_0xb519('0x4'));var router=express[_0xb519('0x5')]();var fs_extra=require(_0xb519('0x6'));var auth=require(_0xb519('0x7'));var interaction=require(_0xb519('0x8'));var config=require(_0xb519('0x9'));var controller=require('./chatMessage.controller');router[_0xb519('0xa')]('/',auth[_0xb519('0xb')](),controller[_0xb519('0xc')]);router['get'](_0xb519('0xd'),auth[_0xb519('0xb')](),controller['describe']);router[_0xb519('0xa')](_0xb519('0xe'),auth[_0xb519('0xb')](),controller[_0xb519('0xf')]);router[_0xb519('0x10')]('/',auth[_0xb519('0xb')](),interaction[_0xb519('0x11')]('chat',_0xb519('0x12')),controller[_0xb519('0x13')]);router[_0xb519('0x14')](_0xb519('0xe'),controller['update']);router[_0xb519('0x14')](_0xb519('0x15'),auth[_0xb519('0xb')](),controller[_0xb519('0x16')]);router[_0xb519('0x14')](_0xb519('0x17'),auth[_0xb519('0xb')](),controller['reject']);router[_0xb519('0x18')]('/:id',auth[_0xb519('0xb')](),controller['destroy']);module[_0xb519('0x19')]=router;
\ No newline at end of file
+var _0x72ed=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','chatmessage:create','/:id','update','put','/:id/accept','accept','/:id/reject'];(function(_0x5d2e9d,_0xf6d965){var _0x4e0a11=function(_0x419594){while(--_0x419594){_0x5d2e9d['push'](_0x5d2e9d['shift']());}};_0x4e0a11(++_0xf6d965);}(_0x72ed,0x15b));var _0xd72e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x72ed[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0xd72e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd72e('0x1'));var express=require(_0xd72e('0x2'));var router=express[_0xd72e('0x3')]();var fs_extra=require(_0xd72e('0x4'));var auth=require(_0xd72e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd72e('0x6'));router[_0xd72e('0x7')]('/',auth[_0xd72e('0x8')](),controller[_0xd72e('0x9')]);router[_0xd72e('0x7')](_0xd72e('0xa'),auth[_0xd72e('0x8')](),controller['describe']);router[_0xd72e('0x7')]('/:id',auth[_0xd72e('0x8')](),controller[_0xd72e('0xb')]);router[_0xd72e('0xc')]('/',auth['isAuthenticated'](),interaction[_0xd72e('0xd')]('chat',_0xd72e('0xe')),controller['create']);router['put'](_0xd72e('0xf'),controller[_0xd72e('0x10')]);router[_0xd72e('0x11')](_0xd72e('0x12'),auth['isAuthenticated'](),controller[_0xd72e('0x13')]);router[_0xd72e('0x11')](_0xd72e('0x14'),auth['isAuthenticated'](),controller['reject']);router['delete']('/:id',auth[_0xd72e('0x8')](),controller[_0xd72e('0x15')]);module[_0xd72e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f7e4a2f..a161875 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 _0x761f=['TEXT','medium','sequelize','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x761f,0x11e));var _0xf761=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x761f[_0x261522];return _0x98a25a;};'use strict';var Sequelize=require(_0xf761('0x0'));module[_0xf761('0x1')]={'body':{'type':Sequelize[_0xf761('0x2')](_0xf761('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x4806=['exports','TEXT','sequelize'];(function(_0x2fc5d4,_0x514199){var _0x3b273c=function(_0x46665a){while(--_0x46665a){_0x2fc5d4['push'](_0x2fc5d4['shift']());}};_0x3b273c(++_0x514199);}(_0x4806,0xb3));var _0x6480=function(_0x434bab,_0x17d564){_0x434bab=_0x434bab-0x0;var _0x39db99=_0x4806[_0x434bab];return _0x39db99;};'use strict';var Sequelize=require(_0x6480('0x0'));module[_0x6480('0x1')]={'body':{'type':Sequelize[_0x6480('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 3a02518..71486ef 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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x51750f,_0x4326bd){_0x51750f=_0x51750f-0x0;var _0x478421=_0x7a54[_0x51750f];return _0x478421;};'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(_0x811d27,_0x4eaa4f){var _0x150234=function(_0x4d2cb1){while(--_0x4d2cb1){_0x811d27['push'](_0x811d27['shift']());}};_0x150234(++_0x4eaa4f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index b580372..98fa741 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 _0xf55e=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x3b2596,_0x20becd){var _0x59fe32=function(_0x4369c1){while(--_0x4369c1){_0x3b2596['push'](_0x3b2596['shift']());}};_0x59fe32(++_0x20becd);}(_0xf55e,0xe5));var _0xef55=function(_0x244992,_0x5b22f6){_0x244992=_0x244992-0x0;var _0x386912=_0xf55e[_0x244992];return _0x386912;};'use strict';var _=require(_0xef55('0x0'));var util=require(_0xef55('0x1'));var logger=require(_0xef55('0x2'))('api');var moment=require('moment');var BPromise=require(_0xef55('0x3'));var rp=require(_0xef55('0x4'));var fs=require('fs');var path=require(_0xef55('0x5'));var rimraf=require(_0xef55('0x6'));var config=require(_0xef55('0x7'));var attributes=require(_0xef55('0x8'));module[_0xef55('0x9')]=function(_0x1db6e5,_0x5a109d){return _0x1db6e5[_0xef55('0xa')](_0xef55('0xb'),attributes,{'tableName':_0xef55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef55('0xd'),'collate':_0xef55('0xe')});};
\ No newline at end of file
+var _0xf2a3=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x9dc752,_0x49e38e){var _0x4e051b=function(_0x5087dc){while(--_0x5087dc){_0x9dc752['push'](_0x9dc752['shift']());}};_0x4e051b(++_0x49e38e);}(_0xf2a3,0x118));var _0x3f2a=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xf2a3[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x3f2a('0x0'));var util=require(_0x3f2a('0x1'));var logger=require(_0x3f2a('0x2'))(_0x3f2a('0x3'));var moment=require('moment');var BPromise=require(_0x3f2a('0x4'));var rp=require(_0x3f2a('0x5'));var fs=require('fs');var path=require(_0x3f2a('0x6'));var rimraf=require('rimraf');var config=require(_0x3f2a('0x7'));var attributes=require(_0x3f2a('0x8'));module['exports']=function(_0x565af1,_0xa0bf36){return _0x565af1[_0x3f2a('0x9')](_0x3f2a('0xa'),attributes,{'tableName':_0x3f2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f2a('0xc'),'collate':_0x3f2a('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f7248db..4d8ccde 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 _0x5cb5=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xd976c2,_0x1cd473){var _0x3dac6a=function(_0x557616){while(--_0x557616){_0xd976c2['push'](_0xd976c2['shift']());}};_0x3dac6a(++_0x1cd473);}(_0x5cb5,0xd9));var _0x55cb=function(_0x5ab7b8,_0xdee83f){_0x5ab7b8=_0x5ab7b8-0x0;var _0x1fa78e=_0x5cb5[_0x5ab7b8];return _0x1fa78e;};'use strict';var _=require(_0x55cb('0x0'));var util=require('util');var moment=require(_0x55cb('0x1'));var BPromise=require(_0x55cb('0x2'));var rs=require(_0x55cb('0x3'));var fs=require('fs');var Redis=require(_0x55cb('0x4'));var db=require(_0x55cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x55cb('0x6'))(_0x55cb('0x7'));var config=require(_0x55cb('0x8'));var jayson=require(_0x55cb('0x9'));var client=jayson[_0x55cb('0xa')][_0x55cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c6108,_0x272089,_0x2b0084){return new BPromise(function(_0x1082ef,_0x2b744e){return client[_0x55cb('0xc')](_0x2c6108,_0x2b0084)[_0x55cb('0xd')](function(_0x315bc0){logger[_0x55cb('0xe')](_0x55cb('0xf'),_0x272089,_0x55cb('0x10'));logger[_0x55cb('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x272089,_0x55cb('0x10'),JSON[_0x55cb('0x12')](_0x315bc0));if(_0x315bc0['error']){if(_0x315bc0[_0x55cb('0x13')][_0x55cb('0x14')]===0x1f4){logger[_0x55cb('0x13')](_0x55cb('0xf'),_0x272089,_0x315bc0[_0x55cb('0x13')][_0x55cb('0x15')]);return _0x2b744e(_0x315bc0[_0x55cb('0x13')][_0x55cb('0x15')]);}logger[_0x55cb('0x13')](_0x55cb('0xf'),_0x272089,_0x315bc0[_0x55cb('0x13')][_0x55cb('0x15')]);return _0x1082ef(_0x315bc0['error'][_0x55cb('0x15')]);}else{logger['info'](_0x55cb('0xf'),_0x272089,_0x55cb('0x10'));_0x1082ef(_0x315bc0['result'][_0x55cb('0x15')]);}})[_0x55cb('0x16')](function(_0x588433){logger[_0x55cb('0x13')](_0x55cb('0xf'),_0x272089,_0x588433);_0x2b744e(_0x588433);});});}
\ No newline at end of file
+var _0x72bb=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x72bb,0x14a));var _0xb72b=function(_0x47f719,_0x2e559d){_0x47f719=_0x47f719-0x0;var _0x407f4e=_0x72bb[_0x47f719];return _0x407f4e;};'use strict';var _=require(_0xb72b('0x0'));var util=require(_0xb72b('0x1'));var moment=require(_0xb72b('0x2'));var BPromise=require(_0xb72b('0x3'));var rs=require(_0xb72b('0x4'));var fs=require('fs');var Redis=require(_0xb72b('0x5'));var db=require(_0xb72b('0x6'))['db'];var utils=require(_0xb72b('0x7'));var logger=require(_0xb72b('0x8'))(_0xb72b('0x9'));var config=require(_0xb72b('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1385b9,_0x3940cd,_0x21b085){return new BPromise(function(_0x303f45,_0x3e0768){return client[_0xb72b('0xb')](_0x1385b9,_0x21b085)[_0xb72b('0xc')](function(_0x3c922e){logger['info'](_0xb72b('0xd'),_0x3940cd,_0xb72b('0xe'));logger[_0xb72b('0xf')](_0xb72b('0x10'),_0x3940cd,'request\x20sent',JSON[_0xb72b('0x11')](_0x3c922e));if(_0x3c922e['error']){if(_0x3c922e['error']['code']===0x1f4){logger[_0xb72b('0x12')](_0xb72b('0xd'),_0x3940cd,_0x3c922e[_0xb72b('0x12')][_0xb72b('0x13')]);return _0x3e0768(_0x3c922e['error'][_0xb72b('0x13')]);}logger[_0xb72b('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3940cd,_0x3c922e[_0xb72b('0x12')][_0xb72b('0x13')]);return _0x303f45(_0x3c922e[_0xb72b('0x12')][_0xb72b('0x13')]);}else{logger[_0xb72b('0x14')](_0xb72b('0xd'),_0x3940cd,_0xb72b('0xe'));_0x303f45(_0x3c922e[_0xb72b('0x15')][_0xb72b('0x13')]);}})[_0xb72b('0x16')](function(_0x53c05d){logger[_0xb72b('0x12')](_0xb72b('0xd'),_0x3940cd,_0x53c05d);_0x3e0768(_0x53c05d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 52a24c2..86a0b97 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 _0x5b25=['../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','describe','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5b25,0x1a4));var _0x55b2=function(_0x4a890a,_0x27a853){_0x4a890a=_0x4a890a-0x0;var _0x1860ba=_0x5b25[_0x4a890a];return _0x1860ba;};'use strict';var multer=require(_0x55b2('0x0'));var util=require(_0x55b2('0x1'));var path=require(_0x55b2('0x2'));var timeout=require(_0x55b2('0x3'));var express=require('express');var router=express[_0x55b2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x55b2('0x5'));var config=require('../../config/environment');var controller=require(_0x55b2('0x6'));router['get']('/',auth[_0x55b2('0x7')](),controller[_0x55b2('0x8')]);router[_0x55b2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x55b2('0xa')]);router['get']('/:id',auth[_0x55b2('0x7')](),controller[_0x55b2('0xb')]);router['post']('/',auth[_0x55b2('0x7')](),controller['create']);router[_0x55b2('0xc')](_0x55b2('0xd'),auth[_0x55b2('0x7')](),controller[_0x55b2('0xe')]);router['delete']('/:id',auth[_0x55b2('0x7')](),controller[_0x55b2('0xf')]);module[_0x55b2('0x10')]=router;
\ No newline at end of file
+var _0xb417=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4568a4,_0x1cbef0){var _0x48b612=function(_0x37671a){while(--_0x37671a){_0x4568a4['push'](_0x4568a4['shift']());}};_0x48b612(++_0x1cbef0);}(_0xb417,0xba));var _0x7b41=function(_0x362256,_0x4f8638){_0x362256=_0x362256-0x0;var _0xfa7997=_0xb417[_0x362256];return _0xfa7997;};'use strict';var multer=require(_0x7b41('0x0'));var util=require(_0x7b41('0x1'));var path=require(_0x7b41('0x2'));var timeout=require(_0x7b41('0x3'));var express=require(_0x7b41('0x4'));var router=express['Router']();var fs_extra=require(_0x7b41('0x5'));var auth=require(_0x7b41('0x6'));var interaction=require(_0x7b41('0x7'));var config=require('../../config/environment');var controller=require(_0x7b41('0x8'));router[_0x7b41('0x9')]('/',auth[_0x7b41('0xa')](),controller[_0x7b41('0xb')]);router[_0x7b41('0x9')]('/describe',auth[_0x7b41('0xa')](),controller[_0x7b41('0xc')]);router['get']('/:id',auth[_0x7b41('0xa')](),controller[_0x7b41('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b41('0xe')]);router[_0x7b41('0xf')](_0x7b41('0x10'),auth[_0x7b41('0xa')](),controller[_0x7b41('0x11')]);router[_0x7b41('0x12')](_0x7b41('0x10'),auth[_0x7b41('0xa')](),controller[_0x7b41('0x13')]);module[_0x7b41('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 6d183ca..2279bbc 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 _0x1271=['exports','STRING','ENUM','mouseOver','INTEGER'];(function(_0x3ec8e4,_0x46c2bd){var _0x401828=function(_0x3f8cc6){while(--_0x3f8cc6){_0x3ec8e4['push'](_0x3ec8e4['shift']());}};_0x401828(++_0x46c2bd);}(_0x1271,0xc8));var _0x1127=function(_0x133a81,_0x31e6c7){_0x133a81=_0x133a81-0x0;var _0x3adcab=_0x1271[_0x133a81];return _0x3adcab;};'use strict';var Sequelize=require('sequelize');module[_0x1127('0x0')]={'name':{'type':Sequelize[_0x1127('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1127('0x2')](_0x1127('0x3'),'timeout'),'defaultValue':_0x1127('0x3')},'selector':{'type':Sequelize[_0x1127('0x1')]},'timeout':{'type':Sequelize[_0x1127('0x4')]}};
\ No newline at end of file
+var _0x1d8f=['STRING','ENUM','timeout','mouseOver','INTEGER','sequelize','exports'];(function(_0x3382e2,_0x2e26ba){var _0x3b000b=function(_0x2cdff3){while(--_0x2cdff3){_0x3382e2['push'](_0x3382e2['shift']());}};_0x3b000b(++_0x2e26ba);}(_0x1d8f,0x75));var _0xf1d8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1d8f[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0xf1d8('0x0'));module[_0xf1d8('0x1')]={'name':{'type':Sequelize[_0xf1d8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf1d8('0x3')]('mouseOver',_0xf1d8('0x4')),'defaultValue':_0xf1d8('0x5')},'selector':{'type':Sequelize[_0xf1d8('0x2')]},'timeout':{'type':Sequelize[_0xf1d8('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 443d29a..72166fa 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 _0x1696=['catch','body','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','end','error','send','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','merge'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x1696,0x79));var _0x6169=function(_0x327efb,_0xcd8cae){_0x327efb=_0x327efb-0x0;var _0x2b4fb5=_0x1696[_0x327efb];return _0x2b4fb5;};'use strict';var emlformat=require(_0x6169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6169('0x1'));var jsonpatch=require(_0x6169('0x2'));var rp=require(_0x6169('0x3'));var moment=require(_0x6169('0x4'));var BPromise=require(_0x6169('0x5'));var Mustache=require(_0x6169('0x6'));var util=require(_0x6169('0x7'));var path=require(_0x6169('0x8'));var sox=require(_0x6169('0x9'));var csv=require('to-csv');var ejs=require(_0x6169('0xa'));var fs=require('fs');var fs_extra=require(_0x6169('0xb'));var _=require(_0x6169('0xc'));var squel=require(_0x6169('0xd'));var crypto=require(_0x6169('0xe'));var jsforce=require(_0x6169('0xf'));var deskjs=require(_0x6169('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6169('0x11'));var Papa=require('papaparse');var Redis=require(_0x6169('0x12'));var authService=require(_0x6169('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6169('0x14'));var hardwareService=require(_0x6169('0x15'));var logger=require(_0x6169('0x16'))(_0x6169('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6169('0x18'));var db=require(_0x6169('0x19'))['db'];function respondWithStatusCode(_0x5f342e,_0x9288c4){_0x9288c4=_0x9288c4||0xcc;return function(_0x2d6570){if(_0x2d6570){return _0x5f342e[_0x6169('0x1a')](_0x9288c4);}return _0x5f342e['status'](_0x9288c4)['end']();};}function respondWithResult(_0x4ba7bf,_0x2829cf){_0x2829cf=_0x2829cf||0xc8;return function(_0x2171d1){if(_0x2171d1){return _0x4ba7bf[_0x6169('0x1b')](_0x2829cf)[_0x6169('0x1c')](_0x2171d1);}};}function respondWithFilteredResult(_0x3ffa76,_0x5837d8){return function(_0x461294){if(_0x461294){var _0x3e2eb4=typeof _0x5837d8['offset']===_0x6169('0x1d')&&typeof _0x5837d8['limit']===_0x6169('0x1d');var _0x1e3b4e=_0x461294['count'];var _0xdfe11e=_0x3e2eb4?0x0:_0x5837d8[_0x6169('0x1e')];var _0xd47fea=_0x3e2eb4?_0x461294[_0x6169('0x1f')]:_0x5837d8[_0x6169('0x1e')]+_0x5837d8[_0x6169('0x20')];var _0x2b2e20;if(_0xd47fea>=_0x1e3b4e){_0xd47fea=_0x1e3b4e;_0x2b2e20=0xc8;}else{_0x2b2e20=0xce;}_0x3ffa76['status'](_0x2b2e20);return _0x3ffa76['set'](_0x6169('0x21'),_0xdfe11e+'-'+_0xd47fea+'/'+_0x1e3b4e)[_0x6169('0x1c')](_0x461294);}return null;};}function patchUpdates(_0x486186){return function(_0x34675a){try{jsonpatch[_0x6169('0x22')](_0x34675a,_0x486186,!![]);}catch(_0x2f3ef3){return BPromise[_0x6169('0x23')](_0x2f3ef3);}return _0x34675a[_0x6169('0x24')]();};}function saveUpdates(_0x51598d,_0x2506bb){return function(_0x5579b9){if(_0x5579b9){return _0x5579b9[_0x6169('0x25')](_0x51598d)[_0x6169('0x26')](function(_0x13e390){return _0x13e390;});}return null;};}function removeEntity(_0x4b35ca,_0x3b0e8a){return function(_0x1f90aa){if(_0x1f90aa){return _0x1f90aa['destroy']()['then'](function(){_0x4b35ca[_0x6169('0x1b')](0xcc)[_0x6169('0x27')]();});}};}function handleEntityNotFound(_0x3e706c,_0x20b40c){return function(_0x1b207e){if(!_0x1b207e){_0x3e706c[_0x6169('0x1a')](0x194);}return _0x1b207e;};}function handleError(_0x647f57,_0x3010f7){_0x3010f7=_0x3010f7||0x1f4;return function(_0x5f2e3b){logger[_0x6169('0x28')](_0x5f2e3b['stack']);if(_0x5f2e3b['name']){delete _0x5f2e3b['name'];}_0x647f57['status'](_0x3010f7)[_0x6169('0x29')](_0x5f2e3b);};}exports['show']=function(_0x4466f3,_0x136d11){var _0x15bef9={'raw':!![],'where':{'id':_0x4466f3['params']['id']}},_0x512977={};_0x512977['model']=_[_0x6169('0x2a')](db[_0x6169('0x2b')]['rawAttributes']);_0x512977['query']=_[_0x6169('0x2a')](_0x4466f3[_0x6169('0x2c')]);_0x512977['filters']=_[_0x6169('0x2d')](_0x512977[_0x6169('0x2e')],_0x512977['query']);_0x15bef9['attributes']=_[_0x6169('0x2d')](_0x512977['model'],qs['fields'](_0x4466f3['query'][_0x6169('0x2f')]));_0x15bef9['attributes']=_0x15bef9[_0x6169('0x30')][_0x6169('0x31')]?_0x15bef9['attributes']:_0x512977[_0x6169('0x2e')];if(_0x4466f3['query'][_0x6169('0x32')]){_0x15bef9[_0x6169('0x33')]=[{'all':!![]}];}_0x15bef9=_[_0x6169('0x34')]({},_0x15bef9,_0x4466f3['options']);return db['ChatProactiveAction']['find'](_0x15bef9)['then'](handleEntityNotFound(_0x136d11,null))[_0x6169('0x26')](respondWithResult(_0x136d11,null))[_0x6169('0x35')](handleError(_0x136d11,null));};exports['create']=function(_0x3a4dd0,_0x1335e8){return db[_0x6169('0x2b')]['create'](_0x3a4dd0[_0x6169('0x36')],{})[_0x6169('0x26')](respondWithResult(_0x1335e8,0xc9))[_0x6169('0x35')](handleError(_0x1335e8,null));};exports[_0x6169('0x25')]=function(_0x153339,_0x19ab2b){if(_0x153339[_0x6169('0x36')]['id']){delete _0x153339[_0x6169('0x36')]['id'];}return db[_0x6169('0x2b')][_0x6169('0x37')]({'where':{'id':_0x153339[_0x6169('0x38')]['id']}})['then'](handleEntityNotFound(_0x19ab2b,null))[_0x6169('0x26')](saveUpdates(_0x153339[_0x6169('0x36')],null))['then'](respondWithResult(_0x19ab2b,null))[_0x6169('0x35')](handleError(_0x19ab2b,null));};exports[_0x6169('0x39')]=function(_0x308b5a,_0xdfce5f){return db[_0x6169('0x2b')][_0x6169('0x37')]({'where':{'id':_0x308b5a[_0x6169('0x38')]['id']}})[_0x6169('0x26')](handleEntityNotFound(_0xdfce5f,null))[_0x6169('0x26')](removeEntity(_0xdfce5f,null))['catch'](handleError(_0xdfce5f,null));};
\ No newline at end of file
+var _0xf767=['catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json','apply','save','then','error','stack','name','params','model','keys','ChatProactiveAction','query','filters','attributes','fields','length','includeAll','include','merge','find'];(function(_0x1f8cbf,_0x5b4e66){var _0x5e6c05=function(_0x5dcc5a){while(--_0x5dcc5a){_0x1f8cbf['push'](_0x1f8cbf['shift']());}};_0x5e6c05(++_0x5b4e66);}(_0xf767,0x76));var _0x7f76=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0xf767[_0x39a2d6];return _0x23af66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['show']=function(_0xe459de,_0x58829a){var _0x1dd664={'raw':!![],'where':{'id':_0xe459de[_0x7f76('0x28')]['id']}},_0x3542e3={};_0x3542e3[_0x7f76('0x29')]=_[_0x7f76('0x2a')](db[_0x7f76('0x2b')]['rawAttributes']);_0x3542e3[_0x7f76('0x2c')]=_[_0x7f76('0x2a')](_0xe459de[_0x7f76('0x2c')]);_0x3542e3[_0x7f76('0x2d')]=_['intersection'](_0x3542e3[_0x7f76('0x29')],_0x3542e3[_0x7f76('0x2c')]);_0x1dd664[_0x7f76('0x2e')]=_['intersection'](_0x3542e3[_0x7f76('0x29')],qs[_0x7f76('0x2f')](_0xe459de[_0x7f76('0x2c')][_0x7f76('0x2f')]));_0x1dd664[_0x7f76('0x2e')]=_0x1dd664[_0x7f76('0x2e')][_0x7f76('0x30')]?_0x1dd664[_0x7f76('0x2e')]:_0x3542e3[_0x7f76('0x29')];if(_0xe459de[_0x7f76('0x2c')][_0x7f76('0x31')]){_0x1dd664[_0x7f76('0x32')]=[{'all':!![]}];}_0x1dd664=_[_0x7f76('0x33')]({},_0x1dd664,_0xe459de['options']);return db[_0x7f76('0x2b')][_0x7f76('0x34')](_0x1dd664)[_0x7f76('0x24')](handleEntityNotFound(_0x58829a,null))[_0x7f76('0x24')](respondWithResult(_0x58829a,null))[_0x7f76('0x35')](handleError(_0x58829a,null));};exports[_0x7f76('0x36')]=function(_0x21cb09,_0xa02fb3){return db['ChatProactiveAction'][_0x7f76('0x36')](_0x21cb09['body'],{})['then'](respondWithResult(_0xa02fb3,0xc9))[_0x7f76('0x35')](handleError(_0xa02fb3,null));};exports['update']=function(_0x37b9d7,_0x165a1e){if(_0x37b9d7['body']['id']){delete _0x37b9d7[_0x7f76('0x37')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x37b9d7[_0x7f76('0x28')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x165a1e,null))[_0x7f76('0x24')](saveUpdates(_0x37b9d7[_0x7f76('0x37')],null))[_0x7f76('0x24')](respondWithResult(_0x165a1e,null))['catch'](handleError(_0x165a1e,null));};exports[_0x7f76('0x38')]=function(_0x42ff86,_0x4edf74){return db['ChatProactiveAction'][_0x7f76('0x34')]({'where':{'id':_0x42ff86['params']['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x4edf74,null))[_0x7f76('0x24')](removeEntity(_0x4edf74,null))[_0x7f76('0x35')](handleError(_0x4edf74,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index d5998c1..271c838 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 _0x5304=['exports','ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x258c83,_0x32fce8){var _0x108d39=function(_0x1766ef){while(--_0x1766ef){_0x258c83['push'](_0x258c83['shift']());}};_0x108d39(++_0x32fce8);}(_0x5304,0x87));var _0x4530=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x5304[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x4530('0x0'));var util=require(_0x4530('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4530('0x2'));var BPromise=require(_0x4530('0x3'));var rp=require(_0x4530('0x4'));var fs=require('fs');var path=require(_0x4530('0x5'));var rimraf=require(_0x4530('0x6'));var config=require(_0x4530('0x7'));var attributes=require(_0x4530('0x8'));module[_0x4530('0x9')]=function(_0x461059,_0x2cbc62){return _0x461059['define'](_0x4530('0xa'),attributes,{'tableName':_0x4530('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd953=['path','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xd953,0x17a));var _0x3d95=function(_0x4aaba4,_0x25709d){_0x4aaba4=_0x4aaba4-0x0;var _0x3eec4c=_0xd953[_0x4aaba4];return _0x3eec4c;};'use strict';var _=require('lodash');var util=require(_0x3d95('0x0'));var logger=require(_0x3d95('0x1'))(_0x3d95('0x2'));var moment=require(_0x3d95('0x3'));var BPromise=require(_0x3d95('0x4'));var rp=require(_0x3d95('0x5'));var fs=require('fs');var path=require(_0x3d95('0x6'));var rimraf=require(_0x3d95('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d95('0x8'));module[_0x3d95('0x9')]=function(_0x40f9db,_0x118281){return _0x40f9db['define'](_0x3d95('0xa'),attributes,{'tableName':_0x3d95('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 a89f31e..1f8667b 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 _0xa19b=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x113fe4,_0x5ebae1){var _0x25a898=function(_0x460d57){while(--_0x460d57){_0x113fe4['push'](_0x113fe4['shift']());}};_0x25a898(++_0x5ebae1);}(_0xa19b,0x6c));var _0xba19=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa19b[_0x432682];return _0x463d05;};'use strict';var _=require(_0xba19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba19('0x1'));var rs=require(_0xba19('0x2'));var fs=require('fs');var Redis=require(_0xba19('0x3'));var db=require(_0xba19('0x4'))['db'];var utils=require(_0xba19('0x5'));var logger=require(_0xba19('0x6'))('rpc');var config=require(_0xba19('0x7'));var jayson=require(_0xba19('0x8'));var client=jayson[_0xba19('0x9')][_0xba19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cda9e,_0x8c3da0,_0x34d490){return new BPromise(function(_0x59e905,_0x15fa82){return client[_0xba19('0xb')](_0x1cda9e,_0x34d490)[_0xba19('0xc')](function(_0x54dfe6){logger[_0xba19('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x8c3da0,_0xba19('0xe'));logger['debug'](_0xba19('0xf'),_0x8c3da0,_0xba19('0xe'),JSON[_0xba19('0x10')](_0x54dfe6));if(_0x54dfe6[_0xba19('0x11')]){if(_0x54dfe6['error'][_0xba19('0x12')]===0x1f4){logger[_0xba19('0x11')](_0xba19('0x13'),_0x8c3da0,_0x54dfe6[_0xba19('0x11')][_0xba19('0x14')]);return _0x15fa82(_0x54dfe6[_0xba19('0x11')][_0xba19('0x14')]);}logger[_0xba19('0x11')](_0xba19('0x13'),_0x8c3da0,_0x54dfe6[_0xba19('0x11')][_0xba19('0x14')]);return _0x59e905(_0x54dfe6['error'][_0xba19('0x14')]);}else{logger['info'](_0xba19('0x13'),_0x8c3da0,_0xba19('0xe'));_0x59e905(_0x54dfe6[_0xba19('0x15')][_0xba19('0x14')]);}})[_0xba19('0x16')](function(_0x153994){logger[_0xba19('0x11')](_0xba19('0x13'),_0x8c3da0,_0x153994);_0x15fa82(_0x153994);});});}
\ No newline at end of file
+var _0x4510=['stringify','ChatProactiveAction,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x11c6cd,_0x54ed63){var _0x2c7387=function(_0xda038d){while(--_0xda038d){_0x11c6cd['push'](_0x11c6cd['shift']());}};_0x2c7387(++_0x54ed63);}(_0x4510,0xe1));var _0x0451=function(_0x12c9df,_0x29f364){_0x12c9df=_0x12c9df-0x0;var _0x3b8549=_0x4510[_0x12c9df];return _0x3b8549;};'use strict';var _=require(_0x0451('0x0'));var util=require(_0x0451('0x1'));var moment=require(_0x0451('0x2'));var BPromise=require(_0x0451('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0451('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0451('0x5'))(_0x0451('0x6'));var config=require(_0x0451('0x7'));var jayson=require(_0x0451('0x8'));var client=jayson[_0x0451('0x9')][_0x0451('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110df4,_0x5d4136,_0x19cef2){return new BPromise(function(_0x5f5288,_0xa67aca){return client[_0x0451('0xb')](_0x110df4,_0x19cef2)[_0x0451('0xc')](function(_0x11c36d){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5d4136,_0x0451('0xd'));logger['debug'](_0x0451('0xe'),_0x5d4136,_0x0451('0xd'),JSON[_0x0451('0xf')](_0x11c36d));if(_0x11c36d['error']){if(_0x11c36d['error']['code']===0x1f4){logger['error'](_0x0451('0x10'),_0x5d4136,_0x11c36d[_0x0451('0x11')]['message']);return _0xa67aca(_0x11c36d[_0x0451('0x11')]['message']);}logger[_0x0451('0x11')](_0x0451('0x10'),_0x5d4136,_0x11c36d[_0x0451('0x11')][_0x0451('0x12')]);return _0x5f5288(_0x11c36d['error'][_0x0451('0x12')]);}else{logger['info'](_0x0451('0x10'),_0x5d4136,'request\x20sent');_0x5f5288(_0x11c36d[_0x0451('0x13')][_0x0451('0x12')]);}})['catch'](function(_0x516123){logger[_0x0451('0x11')](_0x0451('0x10'),_0x5d4136,_0x516123);_0xa67aca(_0x516123);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7530565..57ee6b5 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 _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(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xeff8,0x186));var _0x8eff=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xeff8[_0x310504];return _0x5b36d0;};'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
+var _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x4d499a,_0xa00579){var _0x10f2b4=function(_0x2f63f0){while(--_0x2f63f0){_0x4d499a['push'](_0x4d499a['shift']());}};_0x10f2b4(++_0xa00579);}(_0x5fc3,0xa8));var _0x35fc=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x5fc3[_0x15fc7a];return _0x3aa9f4;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);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 d361976..b5f19da 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 _0xf195=['ENUM','rrmemory','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x4935b1,_0x2c6114){var _0x3354c1=function(_0x2cc551){while(--_0x2cc551){_0x4935b1['push'](_0x4935b1['shift']());}};_0x3354c1(++_0x2c6114);}(_0xf195,0x14c));var _0x5f19=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xf195[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require(_0x5f19('0x0'));module['exports']={'name':{'type':Sequelize[_0x5f19('0x1')],'unique':_0x5f19('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5f19('0x1')]},'timeout':{'type':Sequelize[_0x5f19('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5f19('0x4')](_0x5f19('0x5'),'beepall',_0x5f19('0x6'))}};
\ No newline at end of file
+var _0x80b3=['roundrobin','sequelize','STRING','name','rrmemory','beepall'];(function(_0x8abaf7,_0x253aa8){var _0x40345e=function(_0x49ee99){while(--_0x49ee99){_0x8abaf7['push'](_0x8abaf7['shift']());}};_0x40345e(++_0x253aa8);}(_0x80b3,0x13f));var _0x380b=function(_0x2c7921,_0x435ce5){_0x2c7921=_0x2c7921-0x0;var _0x37827f=_0x80b3[_0x2c7921];return _0x37827f;};'use strict';var Sequelize=require(_0x380b('0x0'));module['exports']={'name':{'type':Sequelize[_0x380b('0x1')],'unique':_0x380b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x380b('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x380b('0x3'),_0x380b('0x4'),_0x380b('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 2eaccc6..61ace1b 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 _0x6e94=['ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','body','destroy','getMembers','findOne','hasOwnProperty','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','transaction','each','UserChatQueue','findOrCreate','emit','removeTeams','ids','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','ChatQueues','end','sendStatus','name','send','index','map'];(function(_0x236c13,_0x50cc9f){var _0x35aa66=function(_0x251e3c){while(--_0x251e3c){_0x236c13['push'](_0x236c13['shift']());}};_0x35aa66(++_0x50cc9f);}(_0x6e94,0xf6));var _0x46e9=function(_0x21fc80,_0x4bd215){_0x21fc80=_0x21fc80-0x0;var _0x4b44ea=_0x6e94[_0x21fc80];return _0x4b44ea;};'use strict';var emlformat=require(_0x46e9('0x0'));var rimraf=require(_0x46e9('0x1'));var zipdir=require(_0x46e9('0x2'));var jsonpatch=require(_0x46e9('0x3'));var rp=require('request-promise');var moment=require(_0x46e9('0x4'));var BPromise=require(_0x46e9('0x5'));var Mustache=require(_0x46e9('0x6'));var util=require(_0x46e9('0x7'));var path=require(_0x46e9('0x8'));var sox=require(_0x46e9('0x9'));var csv=require('to-csv');var ejs=require(_0x46e9('0xa'));var fs=require('fs');var fs_extra=require(_0x46e9('0xb'));var _=require('lodash');var squel=require(_0x46e9('0xc'));var crypto=require(_0x46e9('0xd'));var jsforce=require(_0x46e9('0xe'));var deskjs=require(_0x46e9('0xf'));var toCsv=require(_0x46e9('0x10'));var querystring=require(_0x46e9('0x11'));var Papa=require(_0x46e9('0x12'));var Redis=require(_0x46e9('0x13'));var authService=require(_0x46e9('0x14'));var qs=require(_0x46e9('0x15'));var as=require(_0x46e9('0x16'));var hardwareService=require(_0x46e9('0x17'));var logger=require(_0x46e9('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x46e9('0x19'));var licenseUtil=require(_0x46e9('0x1a'));var db=require('../../mysqldb')['db'];config[_0x46e9('0x1b')]=_['defaults'](config['redis'],{'host':_0x46e9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46e9('0x1b')]));require(_0x46e9('0x1d'))[_0x46e9('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x46e9('0x1f')][_0x46e9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x44eafd,_0x2ba04f,_0x543fab,_0xfb40f0){return new BPromise(function(_0x585b9c,_0x22946d){var _0x89c195=_0xfb40f0||client;return _0x89c195[_0x46e9('0x21')](_0x44eafd,_0x543fab)[_0x46e9('0x22')](function(_0x13c4c5){logger[_0x46e9('0x23')](_0x46e9('0x24'),_0x2ba04f,'request\x20sent');logger[_0x46e9('0x25')](_0x46e9('0x26'),_0x2ba04f,_0x46e9('0x27'),JSON[_0x46e9('0x28')](_0x13c4c5));if(_0x13c4c5['error']){if(_0x13c4c5[_0x46e9('0x29')][_0x46e9('0x2a')]===0x1f4){logger[_0x46e9('0x29')](_0x46e9('0x24'),_0x2ba04f,_0x13c4c5[_0x46e9('0x29')][_0x46e9('0x2b')]);return _0x22946d(_0x13c4c5['error'][_0x46e9('0x2b')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2ba04f,_0x13c4c5['error'][_0x46e9('0x2b')]);return _0x585b9c(_0x13c4c5['error'][_0x46e9('0x2b')]);}else{logger[_0x46e9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2ba04f,'request\x20sent');_0x585b9c(_0x13c4c5[_0x46e9('0x2c')][_0x46e9('0x2b')]);}})['catch'](function(_0x16f42f){logger['error'](_0x46e9('0x24'),_0x2ba04f,_0x16f42f);_0x22946d(_0x16f42f);});});}function respondWithStatusCode(_0x2d5d9e,_0x37d05f){_0x37d05f=_0x37d05f||0xcc;return function(_0x2ea6fd){if(_0x2ea6fd){return _0x2d5d9e['sendStatus'](_0x37d05f);}return _0x2d5d9e['status'](_0x37d05f)['end']();};}function respondWithResult(_0x441567,_0x130a43){_0x130a43=_0x130a43||0xc8;return function(_0x4b5d67){if(_0x4b5d67){return _0x441567['status'](_0x130a43)[_0x46e9('0x2d')](_0x4b5d67);}};}function respondWithFilteredResult(_0xc3d157,_0x5885cd){return function(_0x29b956){if(_0x29b956){var _0x2a15a8=typeof _0x5885cd[_0x46e9('0x2e')]===_0x46e9('0x2f')&&typeof _0x5885cd[_0x46e9('0x30')]===_0x46e9('0x2f');var _0xbec5cd=_0x29b956[_0x46e9('0x31')];var _0x49a4ab=_0x2a15a8?0x0:_0x5885cd[_0x46e9('0x2e')];var _0x5e306a=_0x2a15a8?_0x29b956[_0x46e9('0x31')]:_0x5885cd[_0x46e9('0x2e')]+_0x5885cd[_0x46e9('0x30')];var _0x41afe2;if(_0x5e306a>=_0xbec5cd){_0x5e306a=_0xbec5cd;_0x41afe2=0xc8;}else{_0x41afe2=0xce;}_0xc3d157[_0x46e9('0x32')](_0x41afe2);return _0xc3d157[_0x46e9('0x33')](_0x46e9('0x34'),_0x49a4ab+'-'+_0x5e306a+'/'+_0xbec5cd)[_0x46e9('0x2d')](_0x29b956);}return null;};}function patchUpdates(_0x2b5dca){return function(_0x2d1e10){try{jsonpatch[_0x46e9('0x35')](_0x2d1e10,_0x2b5dca,!![]);}catch(_0x5a74b3){return BPromise[_0x46e9('0x36')](_0x5a74b3);}return _0x2d1e10['save']();};}function saveUpdates(_0x187fc9,_0x2fbdd8){return function(_0x255609){if(_0x255609){return _0x255609['update'](_0x187fc9)['then'](function(_0x56c972){return _0x56c972;});}return null;};}function removeEntity(_0xd50ab4,_0xd65bf){return function(_0x5e098c){if(_0x5e098c){return _0x5e098c['destroy']()[_0x46e9('0x22')](function(){var _0xba0272=_0x5e098c['get']({'plain':!![]});var _0x79efa7=_0x46e9('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x79efa7,'resourceId':_0xba0272['id']}})[_0x46e9('0x22')](function(){return _0x5e098c;});})[_0x46e9('0x22')](function(){_0xd50ab4[_0x46e9('0x32')](0xcc)[_0x46e9('0x38')]();});}};}function handleEntityNotFound(_0x2084d8,_0x30e2e6){return function(_0x378681){if(!_0x378681){_0x2084d8[_0x46e9('0x39')](0x194);}return _0x378681;};}function handleError(_0x1bb306,_0x244db0){_0x244db0=_0x244db0||0x1f4;return function(_0x144540){logger[_0x46e9('0x29')](_0x144540['stack']);if(_0x144540['name']){delete _0x144540[_0x46e9('0x3a')];}_0x1bb306[_0x46e9('0x32')](_0x244db0)[_0x46e9('0x3b')](_0x144540);};}exports[_0x46e9('0x3c')]=function(_0x15961f,_0x20148e){var _0x52eb1a={},_0x106fcd={},_0x3e2e02={'count':0x0,'rows':[]};var _0x3bb14f=_[_0x46e9('0x3d')](db[_0x46e9('0x3e')][_0x46e9('0x3f')],function(_0x5ab17e){return{'name':_0x5ab17e[_0x46e9('0x40')],'type':_0x5ab17e['type'][_0x46e9('0x41')]};});_0x106fcd[_0x46e9('0x42')]=_[_0x46e9('0x3d')](_0x3bb14f,_0x46e9('0x3a'));_0x106fcd[_0x46e9('0x43')]=_[_0x46e9('0x44')](_0x15961f[_0x46e9('0x43')]);_0x106fcd[_0x46e9('0x45')]=_[_0x46e9('0x46')](_0x106fcd[_0x46e9('0x42')],_0x106fcd[_0x46e9('0x43')]);_0x52eb1a[_0x46e9('0x47')]=_[_0x46e9('0x46')](_0x106fcd[_0x46e9('0x42')],qs[_0x46e9('0x48')](_0x15961f[_0x46e9('0x43')][_0x46e9('0x48')]));_0x52eb1a[_0x46e9('0x47')]=_0x52eb1a[_0x46e9('0x47')][_0x46e9('0x49')]?_0x52eb1a[_0x46e9('0x47')]:_0x106fcd[_0x46e9('0x42')];if(!_0x15961f[_0x46e9('0x43')]['hasOwnProperty'](_0x46e9('0x4a'))){_0x52eb1a[_0x46e9('0x30')]=qs[_0x46e9('0x30')](_0x15961f[_0x46e9('0x43')]['limit']);_0x52eb1a[_0x46e9('0x2e')]=qs['offset'](_0x15961f[_0x46e9('0x43')]['offset']);}_0x52eb1a[_0x46e9('0x4b')]=qs[_0x46e9('0x4c')](_0x15961f[_0x46e9('0x43')][_0x46e9('0x4c')]);_0x52eb1a[_0x46e9('0x4d')]=qs[_0x46e9('0x45')](_[_0x46e9('0x4e')](_0x15961f[_0x46e9('0x43')],_0x106fcd[_0x46e9('0x45')]),_0x3bb14f);if(_0x15961f[_0x46e9('0x43')][_0x46e9('0x4f')]){_0x52eb1a[_0x46e9('0x4d')]=_['merge'](_0x52eb1a[_0x46e9('0x4d')],{'$or':_[_0x46e9('0x3d')](_0x3bb14f,function(_0x3dc997){if(_0x3dc997['type']!=='VIRTUAL'){var _0x5b8cec={};_0x5b8cec[_0x3dc997[_0x46e9('0x3a')]]={'$like':'%'+_0x15961f[_0x46e9('0x43')][_0x46e9('0x4f')]+'%'};return _0x5b8cec;}})});}_0x52eb1a=_[_0x46e9('0x50')]({},_0x52eb1a,_0x15961f[_0x46e9('0x51')]);var _0x10bb0a={'where':_0x52eb1a['where']};return db[_0x46e9('0x3e')][_0x46e9('0x31')](_0x10bb0a)[_0x46e9('0x22')](function(_0x4292f0){_0x3e2e02[_0x46e9('0x31')]=_0x4292f0;if(_0x15961f['query'][_0x46e9('0x52')]){_0x52eb1a[_0x46e9('0x53')]=[{'all':!![]}];}return db[_0x46e9('0x3e')][_0x46e9('0x54')](_0x52eb1a);})[_0x46e9('0x22')](function(_0x5501c3){_0x3e2e02[_0x46e9('0x55')]=_0x5501c3;return _0x3e2e02;})[_0x46e9('0x22')](respondWithFilteredResult(_0x20148e,_0x52eb1a))[_0x46e9('0x56')](handleError(_0x20148e,null));};exports[_0x46e9('0x57')]=function(_0x2331b8,_0x474533){var _0x2b18ba={'raw':!![],'where':{'id':_0x2331b8[_0x46e9('0x58')]['id']}},_0x12e569={};_0x12e569[_0x46e9('0x42')]=_[_0x46e9('0x44')](db[_0x46e9('0x3e')][_0x46e9('0x3f')]);_0x12e569[_0x46e9('0x43')]=_['keys'](_0x2331b8[_0x46e9('0x43')]);_0x12e569[_0x46e9('0x45')]=_[_0x46e9('0x46')](_0x12e569[_0x46e9('0x42')],_0x12e569['query']);_0x2b18ba[_0x46e9('0x47')]=_[_0x46e9('0x46')](_0x12e569['model'],qs[_0x46e9('0x48')](_0x2331b8[_0x46e9('0x43')][_0x46e9('0x48')]));_0x2b18ba[_0x46e9('0x47')]=_0x2b18ba[_0x46e9('0x47')][_0x46e9('0x49')]?_0x2b18ba[_0x46e9('0x47')]:_0x12e569[_0x46e9('0x42')];if(_0x2331b8['query']['includeAll']){_0x2b18ba[_0x46e9('0x53')]=[{'all':!![]}];}_0x2b18ba=_[_0x46e9('0x50')]({},_0x2b18ba,_0x2331b8['options']);return db['ChatQueue'][_0x46e9('0x59')](_0x2b18ba)['then'](handleEntityNotFound(_0x474533,null))[_0x46e9('0x22')](respondWithResult(_0x474533,null))[_0x46e9('0x56')](handleError(_0x474533,null));};exports[_0x46e9('0x5a')]=function(_0x408ab8,_0x53a8d8){return db[_0x46e9('0x3e')][_0x46e9('0x5a')](_0x408ab8['body'],{})[_0x46e9('0x22')](function(_0x12b4ce){var _0x254e9c=_0x408ab8[_0x46e9('0x5b')]['get']({'plain':!![]});if(!_0x254e9c)throw new Error(_0x46e9('0x5c'));if(_0x254e9c[_0x46e9('0x5d')]===_0x46e9('0x5b')){var _0x25a43b=_0x12b4ce[_0x46e9('0x5e')]({'plain':!![]});var _0x13f933=_0x46e9('0x37');return db[_0x46e9('0x5f')][_0x46e9('0x59')]({'where':{'name':_0x13f933,'userProfileId':_0x254e9c[_0x46e9('0x60')]},'raw':!![]})[_0x46e9('0x22')](function(_0x508b8f){if(_0x508b8f&&_0x508b8f[_0x46e9('0x61')]===0x0){return db[_0x46e9('0x62')][_0x46e9('0x5a')]({'name':_0x25a43b[_0x46e9('0x3a')],'resourceId':_0x25a43b['id'],'type':_0x508b8f[_0x46e9('0x3a')],'sectionId':_0x508b8f['id']},{})[_0x46e9('0x22')](function(){return _0x12b4ce;});}else{return _0x12b4ce;}})[_0x46e9('0x56')](function(_0x1ccbb2){logger[_0x46e9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ccbb2);throw _0x1ccbb2;});}return _0x12b4ce;})[_0x46e9('0x22')](respondWithResult(_0x53a8d8,0xc9))[_0x46e9('0x56')](handleError(_0x53a8d8,null));};exports[_0x46e9('0x63')]=function(_0x37df4b,_0x27e44f){if(_0x37df4b[_0x46e9('0x64')]['id']){delete _0x37df4b[_0x46e9('0x64')]['id'];}return db['ChatQueue'][_0x46e9('0x59')]({'where':{'id':_0x37df4b[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x27e44f,null))['then'](saveUpdates(_0x37df4b[_0x46e9('0x64')],null))['then'](respondWithResult(_0x27e44f,null))[_0x46e9('0x56')](handleError(_0x27e44f,null));};exports[_0x46e9('0x65')]=function(_0x41437e,_0x3e41eb){return db[_0x46e9('0x3e')][_0x46e9('0x59')]({'where':{'id':_0x41437e[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x3e41eb,null))[_0x46e9('0x22')](removeEntity(_0x3e41eb,null))[_0x46e9('0x56')](handleError(_0x3e41eb,null));};exports['describe']=function(_0x2c000e,_0x495647){return db[_0x46e9('0x3e')]['describe']()[_0x46e9('0x22')](respondWithResult(_0x495647,null))[_0x46e9('0x56')](handleError(_0x495647,null));};exports[_0x46e9('0x66')]=function(_0x4adcee,_0x11fa62,_0x53c72e){var _0x2b119b={'raw':!![],'where':{}},_0x16b0e0={},_0x419762;return db[_0x46e9('0x3e')][_0x46e9('0x67')]({'where':{'id':_0x4adcee[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x11fa62,null))[_0x46e9('0x22')](function(_0x1355f0){if(_0x1355f0){_0x419762=_0x1355f0[_0x46e9('0x5e')]({'plain':!![]});_0x16b0e0[_0x46e9('0x42')]=_[_0x46e9('0x44')](db['UserChatQueue'][_0x46e9('0x3f')]);_0x16b0e0[_0x46e9('0x43')]=_[_0x46e9('0x44')](_0x4adcee[_0x46e9('0x43')]);_0x16b0e0['filters']=_[_0x46e9('0x46')](_0x16b0e0[_0x46e9('0x42')],_0x16b0e0[_0x46e9('0x43')]);_0x2b119b[_0x46e9('0x47')]=_['intersection'](_0x16b0e0['model'],qs['fields'](_0x4adcee[_0x46e9('0x43')][_0x46e9('0x48')]));_0x2b119b[_0x46e9('0x47')]=_0x2b119b[_0x46e9('0x47')][_0x46e9('0x49')]?_0x2b119b[_0x46e9('0x47')]:_0x16b0e0[_0x46e9('0x42')];if(!_0x4adcee['query'][_0x46e9('0x68')](_0x46e9('0x4a'))){_0x2b119b['limit']=qs[_0x46e9('0x30')](_0x4adcee[_0x46e9('0x43')][_0x46e9('0x30')]);_0x2b119b['offset']=qs[_0x46e9('0x2e')](_0x4adcee[_0x46e9('0x43')]['offset']);}_0x2b119b[_0x46e9('0x4b')]=qs['sort'](_0x4adcee[_0x46e9('0x43')][_0x46e9('0x4c')]);_0x2b119b[_0x46e9('0x4d')]=qs['filters'](_[_0x46e9('0x4e')](_0x4adcee['query'],_0x16b0e0[_0x46e9('0x45')]));_0x2b119b[_0x46e9('0x4d')]['ChatQueueId']=_0x1355f0['id'];if(_0x4adcee[_0x46e9('0x43')][_0x46e9('0x4f')]){_0x2b119b[_0x46e9('0x4d')]=_[_0x46e9('0x50')](_0x2b119b['where'],{'$or':_[_0x46e9('0x3d')](_0x2b119b[_0x46e9('0x47')],function(_0x1d0e6f){var _0x33b6ed={};_0x33b6ed[_0x1d0e6f]={'$like':'%'+_0x4adcee['query'][_0x46e9('0x4f')]+'%'};return _0x33b6ed;})});}_0x2b119b=_[_0x46e9('0x50')]({},_0x2b119b,_0x4adcee[_0x46e9('0x51')]);return db['UserChatQueue'][_0x46e9('0x54')](_0x2b119b);}})[_0x46e9('0x22')](function(_0x5efed9){if(_0x5efed9){return db[_0x46e9('0x69')][_0x46e9('0x6a')]({'where':{'id':_['map'](_0x5efed9,'UserId'),'role':_0x46e9('0x6b')},'attributes':['id',_0x46e9('0x3a'),_0x46e9('0x6c'),_0x46e9('0x6d'),_0x46e9('0x6e')]});}})['then'](function(_0x50f68c){if(_0x50f68c){return{'count':_0x50f68c[_0x46e9('0x31')],'rows':_['map'](_0x50f68c[_0x46e9('0x55')],function(_0x5b3649){return{'membername':_0x5b3649[_0x46e9('0x3a')],'UserId':_0x5b3649['id'],'queue_name':_0x419762[_0x46e9('0x3a')],'ChatQueueId':_0x419762['id'],'interface':util[_0x46e9('0x6f')](_0x46e9('0x70'),_0x46e9('0x71'),_0x5b3649[_0x46e9('0x3a')]),'penalty':0x0,'paused':_0x5b3649[_0x46e9('0x6c')],'createdAt':_0x5b3649['createdAt'],'updatedAt':_0x5b3649[_0x46e9('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x46e9('0x22')](respondWithFilteredResult(_0x11fa62,_0x2b119b))[_0x46e9('0x56')](handleError(_0x11fa62,null));};exports[_0x46e9('0x72')]=function(_0x3bb90d,_0x140198,_0x1a8ef3){var _0x2ac02a={};var _0x4e71e6={};var _0x5cdbdb;var _0x58f9ea;return db['ChatQueue'][_0x46e9('0x67')]({'where':{'id':_0x3bb90d['params']['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x140198,null))[_0x46e9('0x22')](function(_0x354237){if(_0x354237){_0x5cdbdb=_0x354237;_0x4e71e6[_0x46e9('0x42')]=_[_0x46e9('0x44')](db[_0x46e9('0x73')]['rawAttributes']);_0x4e71e6[_0x46e9('0x43')]=_[_0x46e9('0x44')](_0x3bb90d[_0x46e9('0x43')]);_0x4e71e6['filters']=_[_0x46e9('0x46')](_0x4e71e6[_0x46e9('0x42')],_0x4e71e6[_0x46e9('0x43')]);_0x2ac02a[_0x46e9('0x47')]=_['intersection'](_0x4e71e6[_0x46e9('0x42')],qs[_0x46e9('0x48')](_0x3bb90d['query']['fields']));_0x2ac02a[_0x46e9('0x47')]=_0x2ac02a[_0x46e9('0x47')][_0x46e9('0x49')]?_0x2ac02a[_0x46e9('0x47')]:_0x4e71e6[_0x46e9('0x42')];_0x2ac02a[_0x46e9('0x4b')]=qs[_0x46e9('0x4c')](_0x3bb90d[_0x46e9('0x43')][_0x46e9('0x4c')]);_0x2ac02a['where']=qs['filters'](_[_0x46e9('0x4e')](_0x3bb90d[_0x46e9('0x43')],_0x4e71e6['filters']));if(_0x3bb90d[_0x46e9('0x43')]['filter']){_0x2ac02a['where']=_[_0x46e9('0x50')](_0x2ac02a[_0x46e9('0x4d')],{'$or':_[_0x46e9('0x3d')](_0x2ac02a['attributes'],function(_0x546713){var _0x37e4ea={};_0x37e4ea[_0x546713]={'$like':'%'+_0x3bb90d[_0x46e9('0x43')][_0x46e9('0x4f')]+'%'};return _0x37e4ea;})});}_0x2ac02a=_[_0x46e9('0x50')]({},_0x2ac02a,_0x3bb90d[_0x46e9('0x51')]);return _0x5cdbdb['getTeams'](_0x2ac02a);}})[_0x46e9('0x22')](function(_0x55b000){if(_0x55b000){_0x58f9ea=_0x55b000['length'];if(!_0x3bb90d['query'][_0x46e9('0x68')](_0x46e9('0x4a'))){_0x2ac02a[_0x46e9('0x30')]=qs[_0x46e9('0x30')](_0x3bb90d['query'][_0x46e9('0x30')]);_0x2ac02a[_0x46e9('0x2e')]=qs[_0x46e9('0x2e')](_0x3bb90d['query'][_0x46e9('0x2e')]);}return _0x5cdbdb[_0x46e9('0x72')](_0x2ac02a);}})[_0x46e9('0x22')](function(_0x42c3c7){if(_0x42c3c7){return _0x42c3c7?{'count':_0x58f9ea,'rows':_0x42c3c7}:null;}})[_0x46e9('0x22')](respondWithResult(_0x140198,null))[_0x46e9('0x56')](handleError(_0x140198,null));};exports[_0x46e9('0x74')]=function(_0x5cf1ef,_0xa36e74,_0x3f2863){var _0x36e4ab=_0x5cf1ef['body']['ids'];return db['Team'][_0x46e9('0x54')]({'where':{'id':_0x36e4ab},'attributes':['id'],'include':[{'model':db['User'],'as':_0x46e9('0x75'),'attributes':['id',_0x46e9('0x3a'),'online',_0x46e9('0x76'),_0x46e9('0x77')],'raw':!![]}]})['then'](function(_0x4af3d0){if(_0x4af3d0){var _0x1218c6=_[_0x46e9('0x78')](_0x4af3d0,function(_0x1ffa32){var _0x42c960=_0x1ffa32[_0x46e9('0x5e')]({'plain':!![]});return _0x42c960[_0x46e9('0x75')];});return db[_0x46e9('0x3e')]['find']({'where':{'id':_0x5cf1ef['params']['id']}})['then'](function(_0x7a5e7f){return db['sequelize'][_0x46e9('0x79')](function(_0x5c2de0){return _0x7a5e7f[_0x46e9('0x74')](_0x36e4ab,{'transaction':_0x5c2de0})['then'](function(){return BPromise[_0x46e9('0x7a')](_0x1218c6,function(_0x52471d){return db[_0x46e9('0x7b')][_0x46e9('0x7c')]({'where':{'UserId':_0x52471d['id'],'ChatQueueId':_0x5cf1ef[_0x46e9('0x58')]['id']},'transaction':_0x5c2de0});});})[_0x46e9('0x22')](function(){_0x1218c6['forEach'](function(_0x4d4f7c){socket[_0x46e9('0x7d')]('userChatQueue:save',{'UserId':_0x4d4f7c['id'],'ChatQueueId':_0x7a5e7f['id']});});});});});}})['then'](respondWithStatusCode(_0xa36e74,null))[_0x46e9('0x56')](handleError(_0xa36e74,null));};exports[_0x46e9('0x7e')]=function(_0xd224a1,_0x1bc607,_0xe10332){return db['Team'][_0x46e9('0x54')]({'where':{'id':_0xd224a1['query'][_0x46e9('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x46e9('0x22')](handleEntityNotFound(_0x1bc607,null))[_0x46e9('0x22')](function(_0x5d9525){var _0x25d14a=_['map'](_0x5d9525,'id');var _0x5dd879=[];var _0x4f5f29=[];var _0x700e9b=squel[_0x46e9('0x80')]();_0x700e9b['field'](_0x46e9('0x81'))[_0x46e9('0x82')](_0x46e9('0x83'),'tq')[_0x46e9('0x84')]('user_has_teams','ut',_0x46e9('0x85'))[_0x46e9('0x4d')](_0x46e9('0x86'),_0xd224a1['params']['id']);for(var _0x56b008=0x0;_0x56b008<_0x5d9525[_0x46e9('0x49')];_0x56b008+=0x1){let _0x252a1b=_0x5d9525[_0x56b008];for(var _0x46af9d=0x0;_0x46af9d<_0x252a1b[_0x46e9('0x75')]['length'];_0x46af9d+=0x1){let _0x4670a4=_0x252a1b[_0x46e9('0x75')][_0x46af9d];var _0x496c24=_0x700e9b['clone']();_0x496c24[_0x46e9('0x4d')]('ut.UserId\x20=\x20?',_0x4670a4['id']);_0x4f5f29[_0x46e9('0x87')](db['sequelize'][_0x46e9('0x43')](_0x496c24['toString'](),{'type':db[_0x46e9('0x88')][_0x46e9('0x89')][_0x46e9('0x8a')]})[_0x46e9('0x22')](function(_0x5d4c1e){if(_0x5d4c1e[_0x46e9('0x49')]===0x1){return _0x4670a4['id'];}else{var _0x2402a2=_[_0x46e9('0x8b')](_['map'](_0x5d4c1e,_0x46e9('0x8c')),function(_0x3001f7){return _[_0x46e9('0x8d')](_0x25d14a,_0x3001f7);});if(_0x2402a2){return _0x4670a4['id'];}}}));}}return BPromise['all'](_0x4f5f29)[_0x46e9('0x22')](function(_0x15b924){_0x5dd879=_(_0x5dd879)[_0x46e9('0x8e')](_0x15b924)[_0x46e9('0x8f')]()['value']();return db[_0x46e9('0x3e')][_0x46e9('0x59')]({'where':{'id':_0xd224a1[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](function(_0x4fe5b1){return db[_0x46e9('0x88')][_0x46e9('0x79')](function(_0xd85ec){return _0x4fe5b1[_0x46e9('0x7e')](_0xd224a1['query'][_0x46e9('0x7f')],{'transaction':_0xd85ec})[_0x46e9('0x22')](function(){if(!_[_0x46e9('0x90')](_0x5dd879)){return _0x4fe5b1[_0x46e9('0x91')](_0x5dd879,{'transaction':_0xd85ec});}})[_0x46e9('0x22')](function(){_0x5dd879[_0x46e9('0x92')](function(_0x4a88cc){socket['emit'](_0x46e9('0x93'),{'UserId':_0x4a88cc,'ChatQueueId':_0x4fe5b1['id']});});});});});});})[_0x46e9('0x22')](respondWithStatusCode(_0x1bc607,null))[_0x46e9('0x56')](handleError(_0x1bc607,null));};exports['addAgents']=function(_0x2a6507,_0x241d5c,_0x36f11b){return db['ChatQueue'][_0x46e9('0x59')]({'where':{'id':_0x2a6507[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x241d5c,null))[_0x46e9('0x22')](function(_0x1289ad){if(_0x1289ad){return _0x1289ad[_0x46e9('0x94')](_0x2a6507[_0x46e9('0x64')]['ids'],_[_0x46e9('0x95')](_0x2a6507[_0x46e9('0x64')],[_0x46e9('0x7f'),'id'])||{})[_0x46e9('0x96')](function(_0x39226f){for(var _0xe89b3e=0x0;_0xe89b3e<_0x2a6507['body'][_0x46e9('0x7f')][_0x46e9('0x49')];_0xe89b3e+=0x1){socket[_0x46e9('0x7d')](_0x46e9('0x97'),{'UserId':Number(_0x2a6507['body'][_0x46e9('0x7f')][_0xe89b3e]),'ChatQueueId':Number(_0x2a6507[_0x46e9('0x58')]['id'])});}return _0x39226f;});}})[_0x46e9('0x22')](respondWithResult(_0x241d5c,null))[_0x46e9('0x56')](handleError(_0x241d5c,null));};exports[_0x46e9('0x91')]=function(_0x18933b,_0x53791c,_0x222ea8){return db[_0x46e9('0x3e')][_0x46e9('0x59')]({'where':{'id':_0x18933b[_0x46e9('0x58')]['id']}})[_0x46e9('0x22')](handleEntityNotFound(_0x53791c,null))[_0x46e9('0x22')](function(_0x12d24c){if(_0x12d24c){return _0x12d24c[_0x46e9('0x91')](_0x18933b[_0x46e9('0x43')][_0x46e9('0x7f')])['then'](function(){if(_[_0x46e9('0x98')](_0x18933b['query'][_0x46e9('0x7f')])){for(var _0x5aa2e8=0x0;_0x5aa2e8<_0x18933b[_0x46e9('0x43')][_0x46e9('0x7f')]['length'];_0x5aa2e8+=0x1){socket[_0x46e9('0x7d')](_0x46e9('0x93'),{'UserId':Number(_0x18933b['query'][_0x46e9('0x7f')][_0x5aa2e8]),'ChatQueueId':Number(_0x18933b[_0x46e9('0x58')]['id'])});}}else{socket['emit'](_0x46e9('0x93'),{'UserId':Number(_0x18933b[_0x46e9('0x43')][_0x46e9('0x7f')]),'ChatQueueId':Number(_0x18933b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x53791c,null))['catch'](handleError(_0x53791c,null));};exports[_0x46e9('0x99')]=function(_0x4532f0,_0x152eb2,_0x4bcf2a){var _0x155d80={};var _0x416a94={};var _0x3e80ed;var _0x2fc156;return db[_0x46e9('0x3e')][_0x46e9('0x67')]({'where':{'id':_0x4532f0[_0x46e9('0x58')]['id']}})['then'](handleEntityNotFound(_0x152eb2,null))[_0x46e9('0x22')](function(_0xe15e8e){if(_0xe15e8e){_0x3e80ed=_0xe15e8e;_0x416a94[_0x46e9('0x42')]=_['keys'](db[_0x46e9('0x69')]['rawAttributes']);_0x416a94[_0x46e9('0x43')]=_['keys'](_0x4532f0[_0x46e9('0x43')]);_0x416a94[_0x46e9('0x45')]=_['intersection'](_0x416a94[_0x46e9('0x42')],_0x416a94[_0x46e9('0x43')]);_0x155d80['attributes']=_['intersection'](_0x416a94[_0x46e9('0x42')],qs[_0x46e9('0x48')](_0x4532f0['query'][_0x46e9('0x48')]));_0x155d80[_0x46e9('0x47')]=_0x155d80[_0x46e9('0x47')][_0x46e9('0x49')]?_0x155d80[_0x46e9('0x47')]:_0x416a94[_0x46e9('0x42')];_0x155d80[_0x46e9('0x4b')]=qs[_0x46e9('0x4c')](_0x4532f0['query'][_0x46e9('0x4c')]);_0x155d80[_0x46e9('0x4d')]=qs['filters'](_[_0x46e9('0x4e')](_0x4532f0[_0x46e9('0x43')],_0x416a94['filters']));if(_0x4532f0[_0x46e9('0x43')][_0x46e9('0x4f')]){_0x155d80[_0x46e9('0x4d')]=_[_0x46e9('0x50')](_0x155d80[_0x46e9('0x4d')],{'$or':_[_0x46e9('0x3d')](_0x155d80[_0x46e9('0x47')],function(_0xf76ee3){var _0xb7402c={};_0xb7402c[_0xf76ee3]={'$like':'%'+_0x4532f0[_0x46e9('0x43')][_0x46e9('0x4f')]+'%'};return _0xb7402c;})});}_0x155d80=_['merge']({},_0x155d80,_0x4532f0[_0x46e9('0x51')]);return _0x3e80ed[_0x46e9('0x99')](_0x155d80);}})['then'](function(_0x1d2d82){if(_0x1d2d82){_0x2fc156=_0x1d2d82[_0x46e9('0x49')];if(!_0x4532f0[_0x46e9('0x43')][_0x46e9('0x68')]('nolimit')){_0x155d80[_0x46e9('0x30')]=qs[_0x46e9('0x30')](_0x4532f0[_0x46e9('0x43')][_0x46e9('0x30')]);_0x155d80['offset']=qs[_0x46e9('0x2e')](_0x4532f0[_0x46e9('0x43')][_0x46e9('0x2e')]);}return _0x3e80ed[_0x46e9('0x99')](_0x155d80);}})[_0x46e9('0x22')](function(_0x387f13){if(_0x387f13){return _0x387f13?{'count':_0x2fc156,'rows':_0x387f13}:null;}})[_0x46e9('0x22')](respondWithResult(_0x152eb2,null))[_0x46e9('0x56')](handleError(_0x152eb2,null));};
\ No newline at end of file
+var _0x8ab2=['addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','sendStatus','status','json','undefined','limit','count','set','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','name','send','index','ChatQueue','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','offset','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','hasOwnProperty','nolimit','ChatQueueId','UserChatQueue','findAndCountAll','UserId','agent','chatPause','rows','format','updatedAt','getTeams','findOne','Team','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x8ab2,0x1b0));var _0x28ab=function(_0x452c64,_0x3de96e){_0x452c64=_0x452c64-0x0;var _0x2c7e6d=_0x8ab2[_0x452c64];return _0x2c7e6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ab('0x0'));var zipdir=require(_0x28ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x28ab('0x2'));var BPromise=require(_0x28ab('0x3'));var Mustache=require(_0x28ab('0x4'));var util=require(_0x28ab('0x5'));var path=require(_0x28ab('0x6'));var sox=require(_0x28ab('0x7'));var csv=require('to-csv');var ejs=require(_0x28ab('0x8'));var fs=require('fs');var fs_extra=require(_0x28ab('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x28ab('0xa'));var jsforce=require(_0x28ab('0xb'));var deskjs=require(_0x28ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28ab('0xd'));var Papa=require('papaparse');var Redis=require(_0x28ab('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x28ab('0xf'));var as=require(_0x28ab('0x10'));var hardwareService=require(_0x28ab('0x11'));var logger=require(_0x28ab('0x12'))('api');var utils=require(_0x28ab('0x13'));var config=require(_0x28ab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ab('0x15'))['db'];config[_0x28ab('0x16')]=_['defaults'](config[_0x28ab('0x16')],{'host':_0x28ab('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x28ab('0x16')]));require('./chatQueue.socket')[_0x28ab('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x28ab('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4e9c,_0x220901,_0x35ad4b,_0x9caacf){return new BPromise(function(_0x38ece9,_0x39fa18){var _0x3b372f=_0x9caacf||client;return _0x3b372f[_0x28ab('0x1a')](_0x4c4e9c,_0x35ad4b)[_0x28ab('0x1b')](function(_0xd47b28){logger[_0x28ab('0x1c')](_0x28ab('0x1d'),_0x220901,'request\x20sent');logger[_0x28ab('0x1e')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x220901,_0x28ab('0x1f'),JSON['stringify'](_0xd47b28));if(_0xd47b28['error']){if(_0xd47b28[_0x28ab('0x20')]['code']===0x1f4){logger[_0x28ab('0x20')](_0x28ab('0x1d'),_0x220901,_0xd47b28[_0x28ab('0x20')][_0x28ab('0x21')]);return _0x39fa18(_0xd47b28[_0x28ab('0x20')][_0x28ab('0x21')]);}logger[_0x28ab('0x20')]('ChatQueue,\x20%s,\x20%s',_0x220901,_0xd47b28[_0x28ab('0x20')][_0x28ab('0x21')]);return _0x38ece9(_0xd47b28['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x220901,_0x28ab('0x1f'));_0x38ece9(_0xd47b28['result'][_0x28ab('0x21')]);}})['catch'](function(_0x27d0a8){logger[_0x28ab('0x20')](_0x28ab('0x1d'),_0x220901,_0x27d0a8);_0x39fa18(_0x27d0a8);});});}function respondWithStatusCode(_0x33205,_0x403d48){_0x403d48=_0x403d48||0xcc;return function(_0x209ae4){if(_0x209ae4){return _0x33205[_0x28ab('0x22')](_0x403d48);}return _0x33205[_0x28ab('0x23')](_0x403d48)['end']();};}function respondWithResult(_0x49be56,_0x6a749a){_0x6a749a=_0x6a749a||0xc8;return function(_0x1a9052){if(_0x1a9052){return _0x49be56[_0x28ab('0x23')](_0x6a749a)[_0x28ab('0x24')](_0x1a9052);}};}function respondWithFilteredResult(_0x3d8147,_0x4ca97d){return function(_0x11f304){if(_0x11f304){var _0x1b3948=typeof _0x4ca97d['offset']===_0x28ab('0x25')&&typeof _0x4ca97d[_0x28ab('0x26')]==='undefined';var _0x3a4fdf=_0x11f304[_0x28ab('0x27')];var _0x52fdc7=_0x1b3948?0x0:_0x4ca97d['offset'];var _0x2231b0=_0x1b3948?_0x11f304['count']:_0x4ca97d['offset']+_0x4ca97d[_0x28ab('0x26')];var _0x5947cf;if(_0x2231b0>=_0x3a4fdf){_0x2231b0=_0x3a4fdf;_0x5947cf=0xc8;}else{_0x5947cf=0xce;}_0x3d8147[_0x28ab('0x23')](_0x5947cf);return _0x3d8147[_0x28ab('0x28')]('Content-Range',_0x52fdc7+'-'+_0x2231b0+'/'+_0x3a4fdf)[_0x28ab('0x24')](_0x11f304);}return null;};}function patchUpdates(_0x2ba4aa){return function(_0x5d0379){try{jsonpatch[_0x28ab('0x29')](_0x5d0379,_0x2ba4aa,!![]);}catch(_0x5c481e){return BPromise[_0x28ab('0x2a')](_0x5c481e);}return _0x5d0379[_0x28ab('0x2b')]();};}function saveUpdates(_0x279179,_0x35aa29){return function(_0x51d357){if(_0x51d357){return _0x51d357[_0x28ab('0x2c')](_0x279179)['then'](function(_0x49f08b){return _0x49f08b;});}return null;};}function removeEntity(_0x448b81,_0x7fe6e8){return function(_0x522a5c){if(_0x522a5c){return _0x522a5c[_0x28ab('0x2d')]()[_0x28ab('0x1b')](function(){var _0x583df8=_0x522a5c[_0x28ab('0x2e')]({'plain':!![]});var _0x1b75d5=_0x28ab('0x2f');return db[_0x28ab('0x30')][_0x28ab('0x2d')]({'where':{'type':_0x1b75d5,'resourceId':_0x583df8['id']}})['then'](function(){return _0x522a5c;});})[_0x28ab('0x1b')](function(){_0x448b81[_0x28ab('0x23')](0xcc)[_0x28ab('0x31')]();});}};}function handleEntityNotFound(_0x1d41cf,_0x52bcfe){return function(_0x36e9ae){if(!_0x36e9ae){_0x1d41cf[_0x28ab('0x22')](0x194);}return _0x36e9ae;};}function handleError(_0x35550f,_0x29c39c){_0x29c39c=_0x29c39c||0x1f4;return function(_0x561836){logger[_0x28ab('0x20')](_0x561836['stack']);if(_0x561836[_0x28ab('0x32')]){delete _0x561836[_0x28ab('0x32')];}_0x35550f[_0x28ab('0x23')](_0x29c39c)[_0x28ab('0x33')](_0x561836);};}exports[_0x28ab('0x34')]=function(_0xe6c4b1,_0x414d89){var _0x78d9b1={},_0x5346fc={},_0x444a2a={'count':0x0,'rows':[]};var _0x4f9414=_['map'](db[_0x28ab('0x35')][_0x28ab('0x36')],function(_0xbd5520){return{'name':_0xbd5520['fieldName'],'type':_0xbd5520['type'][_0x28ab('0x37')]};});_0x5346fc[_0x28ab('0x38')]=_[_0x28ab('0x39')](_0x4f9414,_0x28ab('0x32'));_0x5346fc[_0x28ab('0x3a')]=_[_0x28ab('0x3b')](_0xe6c4b1[_0x28ab('0x3a')]);_0x5346fc['filters']=_[_0x28ab('0x3c')](_0x5346fc[_0x28ab('0x38')],_0x5346fc[_0x28ab('0x3a')]);_0x78d9b1[_0x28ab('0x3d')]=_[_0x28ab('0x3c')](_0x5346fc[_0x28ab('0x38')],qs[_0x28ab('0x3e')](_0xe6c4b1[_0x28ab('0x3a')]['fields']));_0x78d9b1[_0x28ab('0x3d')]=_0x78d9b1['attributes'][_0x28ab('0x3f')]?_0x78d9b1[_0x28ab('0x3d')]:_0x5346fc[_0x28ab('0x38')];if(!_0xe6c4b1[_0x28ab('0x3a')]['hasOwnProperty']('nolimit')){_0x78d9b1[_0x28ab('0x26')]=qs[_0x28ab('0x26')](_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x26')]);_0x78d9b1['offset']=qs[_0x28ab('0x40')](_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x40')]);}_0x78d9b1[_0x28ab('0x41')]=qs[_0x28ab('0x42')](_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x78d9b1[_0x28ab('0x43')]=qs['filters'](_[_0x28ab('0x44')](_0xe6c4b1[_0x28ab('0x3a')],_0x5346fc[_0x28ab('0x45')]),_0x4f9414);if(_0xe6c4b1['query'][_0x28ab('0x46')]){_0x78d9b1[_0x28ab('0x43')]=_[_0x28ab('0x47')](_0x78d9b1[_0x28ab('0x43')],{'$or':_['map'](_0x4f9414,function(_0x47afea){if(_0x47afea[_0x28ab('0x48')]!==_0x28ab('0x49')){var _0x1ba138={};_0x1ba138[_0x47afea[_0x28ab('0x32')]]={'$like':'%'+_0xe6c4b1[_0x28ab('0x3a')]['filter']+'%'};return _0x1ba138;}})});}_0x78d9b1=_['merge']({},_0x78d9b1,_0xe6c4b1[_0x28ab('0x4a')]);var _0x1ceda8={'where':_0x78d9b1[_0x28ab('0x43')]};return db[_0x28ab('0x35')]['count'](_0x1ceda8)[_0x28ab('0x1b')](function(_0x3a8214){_0x444a2a[_0x28ab('0x27')]=_0x3a8214;if(_0xe6c4b1[_0x28ab('0x3a')][_0x28ab('0x4b')]){_0x78d9b1[_0x28ab('0x4c')]=[{'all':!![]}];}return db[_0x28ab('0x35')][_0x28ab('0x4d')](_0x78d9b1);})['then'](function(_0x360e45){_0x444a2a['rows']=_0x360e45;return _0x444a2a;})[_0x28ab('0x1b')](respondWithFilteredResult(_0x414d89,_0x78d9b1))['catch'](handleError(_0x414d89,null));};exports[_0x28ab('0x4e')]=function(_0x657cd4,_0x36a071){var _0x327a00={'raw':!![],'where':{'id':_0x657cd4[_0x28ab('0x4f')]['id']}},_0x395d94={};_0x395d94['model']=_[_0x28ab('0x3b')](db['ChatQueue'][_0x28ab('0x36')]);_0x395d94[_0x28ab('0x3a')]=_[_0x28ab('0x3b')](_0x657cd4[_0x28ab('0x3a')]);_0x395d94[_0x28ab('0x45')]=_[_0x28ab('0x3c')](_0x395d94['model'],_0x395d94[_0x28ab('0x3a')]);_0x327a00['attributes']=_[_0x28ab('0x3c')](_0x395d94[_0x28ab('0x38')],qs[_0x28ab('0x3e')](_0x657cd4[_0x28ab('0x3a')][_0x28ab('0x3e')]));_0x327a00[_0x28ab('0x3d')]=_0x327a00[_0x28ab('0x3d')]['length']?_0x327a00[_0x28ab('0x3d')]:_0x395d94['model'];if(_0x657cd4[_0x28ab('0x3a')][_0x28ab('0x4b')]){_0x327a00[_0x28ab('0x4c')]=[{'all':!![]}];}_0x327a00=_[_0x28ab('0x47')]({},_0x327a00,_0x657cd4[_0x28ab('0x4a')]);return db[_0x28ab('0x35')][_0x28ab('0x50')](_0x327a00)[_0x28ab('0x1b')](handleEntityNotFound(_0x36a071,null))[_0x28ab('0x1b')](respondWithResult(_0x36a071,null))[_0x28ab('0x51')](handleError(_0x36a071,null));};exports[_0x28ab('0x52')]=function(_0x3f066c,_0x26351d){return db[_0x28ab('0x35')]['create'](_0x3f066c[_0x28ab('0x53')],{})['then'](function(_0x57bc5d){var _0x1686e2=_0x3f066c[_0x28ab('0x54')][_0x28ab('0x2e')]({'plain':!![]});if(!_0x1686e2)throw new Error(_0x28ab('0x55'));if(_0x1686e2[_0x28ab('0x56')]==='user'){var _0x1e3736=_0x57bc5d['get']({'plain':!![]});var _0x4210c6=_0x28ab('0x2f');return db[_0x28ab('0x57')][_0x28ab('0x50')]({'where':{'name':_0x4210c6,'userProfileId':_0x1686e2[_0x28ab('0x58')]},'raw':!![]})['then'](function(_0x392c12){if(_0x392c12&&_0x392c12[_0x28ab('0x59')]===0x0){return db[_0x28ab('0x30')][_0x28ab('0x52')]({'name':_0x1e3736[_0x28ab('0x32')],'resourceId':_0x1e3736['id'],'type':_0x392c12['name'],'sectionId':_0x392c12['id']},{})['then'](function(){return _0x57bc5d;});}else{return _0x57bc5d;}})[_0x28ab('0x51')](function(_0x250ac1){logger['error'](_0x28ab('0x5a'),_0x250ac1);throw _0x250ac1;});}return _0x57bc5d;})[_0x28ab('0x1b')](respondWithResult(_0x26351d,0xc9))[_0x28ab('0x51')](handleError(_0x26351d,null));};exports[_0x28ab('0x2c')]=function(_0x34be62,_0xa8a2e9){if(_0x34be62[_0x28ab('0x53')]['id']){delete _0x34be62[_0x28ab('0x53')]['id'];}return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x34be62[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0xa8a2e9,null))[_0x28ab('0x1b')](saveUpdates(_0x34be62[_0x28ab('0x53')],null))['then'](respondWithResult(_0xa8a2e9,null))['catch'](handleError(_0xa8a2e9,null));};exports[_0x28ab('0x2d')]=function(_0x5009be,_0x14454e){return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x5009be[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x14454e,null))['then'](removeEntity(_0x14454e,null))[_0x28ab('0x51')](handleError(_0x14454e,null));};exports['describe']=function(_0x30bc6b,_0x384e1c){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x384e1c,null))['catch'](handleError(_0x384e1c,null));};exports[_0x28ab('0x5b')]=function(_0x5e6bd1,_0x4aa3e7,_0x5b9726){var _0x21e77e={'raw':!![],'where':{}},_0x24ca6a={},_0x1f96ec;return db[_0x28ab('0x35')]['findOne']({'where':{'id':_0x5e6bd1[_0x28ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4aa3e7,null))[_0x28ab('0x1b')](function(_0x427c2f){if(_0x427c2f){_0x1f96ec=_0x427c2f[_0x28ab('0x2e')]({'plain':!![]});_0x24ca6a[_0x28ab('0x38')]=_[_0x28ab('0x3b')](db['UserChatQueue'][_0x28ab('0x36')]);_0x24ca6a['query']=_[_0x28ab('0x3b')](_0x5e6bd1['query']);_0x24ca6a[_0x28ab('0x45')]=_[_0x28ab('0x3c')](_0x24ca6a[_0x28ab('0x38')],_0x24ca6a[_0x28ab('0x3a')]);_0x21e77e[_0x28ab('0x3d')]=_[_0x28ab('0x3c')](_0x24ca6a[_0x28ab('0x38')],qs[_0x28ab('0x3e')](_0x5e6bd1['query']['fields']));_0x21e77e[_0x28ab('0x3d')]=_0x21e77e['attributes']['length']?_0x21e77e[_0x28ab('0x3d')]:_0x24ca6a[_0x28ab('0x38')];if(!_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x5c')](_0x28ab('0x5d'))){_0x21e77e['limit']=qs['limit'](_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x26')]);_0x21e77e[_0x28ab('0x40')]=qs[_0x28ab('0x40')](_0x5e6bd1[_0x28ab('0x3a')]['offset']);}_0x21e77e['order']=qs['sort'](_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x21e77e['where']=qs[_0x28ab('0x45')](_['pick'](_0x5e6bd1['query'],_0x24ca6a[_0x28ab('0x45')]));_0x21e77e[_0x28ab('0x43')][_0x28ab('0x5e')]=_0x427c2f['id'];if(_0x5e6bd1[_0x28ab('0x3a')][_0x28ab('0x46')]){_0x21e77e[_0x28ab('0x43')]=_['merge'](_0x21e77e['where'],{'$or':_['map'](_0x21e77e[_0x28ab('0x3d')],function(_0x2bb845){var _0x3229f3={};_0x3229f3[_0x2bb845]={'$like':'%'+_0x5e6bd1['query'][_0x28ab('0x46')]+'%'};return _0x3229f3;})});}_0x21e77e=_[_0x28ab('0x47')]({},_0x21e77e,_0x5e6bd1['options']);return db[_0x28ab('0x5f')]['findAll'](_0x21e77e);}})[_0x28ab('0x1b')](function(_0x2280d6){if(_0x2280d6){return db['User'][_0x28ab('0x60')]({'where':{'id':_[_0x28ab('0x39')](_0x2280d6,_0x28ab('0x61')),'role':_0x28ab('0x62')},'attributes':['id',_0x28ab('0x32'),_0x28ab('0x63'),'updatedAt','createdAt']});}})[_0x28ab('0x1b')](function(_0x155f35){if(_0x155f35){return{'count':_0x155f35[_0x28ab('0x27')],'rows':_['map'](_0x155f35[_0x28ab('0x64')],function(_0x2e2f5a){return{'membername':_0x2e2f5a[_0x28ab('0x32')],'UserId':_0x2e2f5a['id'],'queue_name':_0x1f96ec[_0x28ab('0x32')],'ChatQueueId':_0x1f96ec['id'],'interface':util[_0x28ab('0x65')]('%s/%s','SIP',_0x2e2f5a[_0x28ab('0x32')]),'penalty':0x0,'paused':_0x2e2f5a[_0x28ab('0x63')],'createdAt':_0x2e2f5a['createdAt'],'updatedAt':_0x2e2f5a[_0x28ab('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x28ab('0x1b')](respondWithFilteredResult(_0x4aa3e7,_0x21e77e))['catch'](handleError(_0x4aa3e7,null));};exports[_0x28ab('0x67')]=function(_0x102c47,_0x574663,_0x16de02){var _0x3e9caa={};var _0x32f1c4={};var _0x150eb0;var _0x12723e;return db['ChatQueue'][_0x28ab('0x68')]({'where':{'id':_0x102c47[_0x28ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x574663,null))[_0x28ab('0x1b')](function(_0x236093){if(_0x236093){_0x150eb0=_0x236093;_0x32f1c4[_0x28ab('0x38')]=_['keys'](db[_0x28ab('0x69')]['rawAttributes']);_0x32f1c4['query']=_[_0x28ab('0x3b')](_0x102c47['query']);_0x32f1c4[_0x28ab('0x45')]=_[_0x28ab('0x3c')](_0x32f1c4[_0x28ab('0x38')],_0x32f1c4['query']);_0x3e9caa[_0x28ab('0x3d')]=_[_0x28ab('0x3c')](_0x32f1c4['model'],qs[_0x28ab('0x3e')](_0x102c47[_0x28ab('0x3a')][_0x28ab('0x3e')]));_0x3e9caa[_0x28ab('0x3d')]=_0x3e9caa['attributes'][_0x28ab('0x3f')]?_0x3e9caa[_0x28ab('0x3d')]:_0x32f1c4[_0x28ab('0x38')];_0x3e9caa[_0x28ab('0x41')]=qs[_0x28ab('0x42')](_0x102c47[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x3e9caa[_0x28ab('0x43')]=qs[_0x28ab('0x45')](_[_0x28ab('0x44')](_0x102c47['query'],_0x32f1c4['filters']));if(_0x102c47['query']['filter']){_0x3e9caa[_0x28ab('0x43')]=_[_0x28ab('0x47')](_0x3e9caa[_0x28ab('0x43')],{'$or':_[_0x28ab('0x39')](_0x3e9caa[_0x28ab('0x3d')],function(_0x41735a){var _0x3affe6={};_0x3affe6[_0x41735a]={'$like':'%'+_0x102c47[_0x28ab('0x3a')][_0x28ab('0x46')]+'%'};return _0x3affe6;})});}_0x3e9caa=_[_0x28ab('0x47')]({},_0x3e9caa,_0x102c47[_0x28ab('0x4a')]);return _0x150eb0[_0x28ab('0x67')](_0x3e9caa);}})['then'](function(_0x3ed273){if(_0x3ed273){_0x12723e=_0x3ed273[_0x28ab('0x3f')];if(!_0x102c47[_0x28ab('0x3a')][_0x28ab('0x5c')]('nolimit')){_0x3e9caa[_0x28ab('0x26')]=qs[_0x28ab('0x26')](_0x102c47[_0x28ab('0x3a')]['limit']);_0x3e9caa[_0x28ab('0x40')]=qs['offset'](_0x102c47['query'][_0x28ab('0x40')]);}return _0x150eb0[_0x28ab('0x67')](_0x3e9caa);}})[_0x28ab('0x1b')](function(_0x39731a){if(_0x39731a){return _0x39731a?{'count':_0x12723e,'rows':_0x39731a}:null;}})[_0x28ab('0x1b')](respondWithResult(_0x574663,null))[_0x28ab('0x51')](handleError(_0x574663,null));};exports['addTeams']=function(_0xd25adc,_0x5775d4,_0x2c1de4){var _0x2b859e=_0xd25adc[_0x28ab('0x53')][_0x28ab('0x6a')];return db[_0x28ab('0x69')][_0x28ab('0x4d')]({'where':{'id':_0x2b859e},'attributes':['id'],'include':[{'model':db[_0x28ab('0x6b')],'as':_0x28ab('0x6c'),'attributes':['id',_0x28ab('0x32'),_0x28ab('0x6d'),_0x28ab('0x6e'),_0x28ab('0x6f')],'raw':!![]}]})[_0x28ab('0x1b')](function(_0x56b098){if(_0x56b098){var _0x5d9ba1=_[_0x28ab('0x70')](_0x56b098,function(_0xa355e7){var _0x3c8223=_0xa355e7[_0x28ab('0x2e')]({'plain':!![]});return _0x3c8223[_0x28ab('0x6c')];});return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0xd25adc[_0x28ab('0x4f')]['id']}})['then'](function(_0x1b1ad9){return db[_0x28ab('0x71')]['transaction'](function(_0x45ff27){return _0x1b1ad9[_0x28ab('0x72')](_0x2b859e,{'transaction':_0x45ff27})[_0x28ab('0x1b')](function(){return BPromise[_0x28ab('0x73')](_0x5d9ba1,function(_0x2671f6){return db['UserChatQueue'][_0x28ab('0x74')]({'where':{'UserId':_0x2671f6['id'],'ChatQueueId':_0xd25adc[_0x28ab('0x4f')]['id']},'transaction':_0x45ff27});});})[_0x28ab('0x1b')](function(){_0x5d9ba1[_0x28ab('0x75')](function(_0x5b9a1a){socket[_0x28ab('0x76')](_0x28ab('0x77'),{'UserId':_0x5b9a1a['id'],'ChatQueueId':_0x1b1ad9['id']});});});});});}})[_0x28ab('0x1b')](respondWithStatusCode(_0x5775d4,null))[_0x28ab('0x51')](handleError(_0x5775d4,null));};exports[_0x28ab('0x78')]=function(_0x2c8e96,_0x4ddf90,_0x5e3531){return db[_0x28ab('0x69')]['findAll']({'where':{'id':_0x2c8e96[_0x28ab('0x3a')][_0x28ab('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x28ab('0x6b')],'as':_0x28ab('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x28ab('0x1b')](handleEntityNotFound(_0x4ddf90,null))[_0x28ab('0x1b')](function(_0x96d1b8){var _0x37754e=_[_0x28ab('0x39')](_0x96d1b8,'id');var _0x288f2e=[];var _0x330ee5=[];var _0xf4de45=squel['select']();_0xf4de45[_0x28ab('0x79')]('tq.TeamId')['from'](_0x28ab('0x7a'),'tq')[_0x28ab('0x7b')]('user_has_teams','ut',_0x28ab('0x7c'))[_0x28ab('0x43')]('ChatQueueId\x20=\x20?',_0x2c8e96[_0x28ab('0x4f')]['id']);for(var _0x492b6e=0x0;_0x492b6e<_0x96d1b8[_0x28ab('0x3f')];_0x492b6e+=0x1){let _0x3f5e40=_0x96d1b8[_0x492b6e];for(var _0x2b417a=0x0;_0x2b417a<_0x3f5e40[_0x28ab('0x6c')][_0x28ab('0x3f')];_0x2b417a+=0x1){let _0xfdd783=_0x3f5e40[_0x28ab('0x6c')][_0x2b417a];var _0x1e3631=_0xf4de45['clone']();_0x1e3631['where'](_0x28ab('0x7d'),_0xfdd783['id']);_0x330ee5['push'](db[_0x28ab('0x71')]['query'](_0x1e3631[_0x28ab('0x7e')](),{'type':db[_0x28ab('0x71')]['QueryTypes']['SELECT']})[_0x28ab('0x1b')](function(_0x508c48){if(_0x508c48[_0x28ab('0x3f')]===0x1){return _0xfdd783['id'];}else{var _0x363b64=_[_0x28ab('0x7f')](_[_0x28ab('0x39')](_0x508c48,_0x28ab('0x80')),function(_0xf71991){return _[_0x28ab('0x81')](_0x37754e,_0xf71991);});if(_0x363b64){return _0xfdd783['id'];}}}));}}return BPromise[_0x28ab('0x82')](_0x330ee5)[_0x28ab('0x1b')](function(_0x221102){_0x288f2e=_(_0x288f2e)[_0x28ab('0x83')](_0x221102)[_0x28ab('0x84')]()[_0x28ab('0x85')]();return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x2c8e96[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](function(_0x21faab){return db[_0x28ab('0x71')]['transaction'](function(_0x217993){return _0x21faab[_0x28ab('0x78')](_0x2c8e96[_0x28ab('0x3a')]['ids'],{'transaction':_0x217993})[_0x28ab('0x1b')](function(){if(!_[_0x28ab('0x86')](_0x288f2e)){return _0x21faab['removeAgents'](_0x288f2e,{'transaction':_0x217993});}})[_0x28ab('0x1b')](function(){_0x288f2e[_0x28ab('0x75')](function(_0x1b407c){socket[_0x28ab('0x76')](_0x28ab('0x87'),{'UserId':_0x1b407c,'ChatQueueId':_0x21faab['id']});});});});});});})[_0x28ab('0x1b')](respondWithStatusCode(_0x4ddf90,null))[_0x28ab('0x51')](handleError(_0x4ddf90,null));};exports[_0x28ab('0x88')]=function(_0x456364,_0x4455d,_0x5aad8d){return db[_0x28ab('0x35')][_0x28ab('0x50')]({'where':{'id':_0x456364[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x4455d,null))['then'](function(_0x27ddfb){if(_0x27ddfb){return _0x27ddfb[_0x28ab('0x88')](_0x456364[_0x28ab('0x53')]['ids'],_[_0x28ab('0x89')](_0x456364['body'],[_0x28ab('0x6a'),'id'])||{})[_0x28ab('0x8a')](function(_0x37f99b){for(var _0x1a9861=0x0;_0x1a9861<_0x456364['body'][_0x28ab('0x6a')][_0x28ab('0x3f')];_0x1a9861+=0x1){socket[_0x28ab('0x76')](_0x28ab('0x77'),{'UserId':Number(_0x456364['body'][_0x28ab('0x6a')][_0x1a9861]),'ChatQueueId':Number(_0x456364[_0x28ab('0x4f')]['id'])});}return _0x37f99b;});}})[_0x28ab('0x1b')](respondWithResult(_0x4455d,null))['catch'](handleError(_0x4455d,null));};exports[_0x28ab('0x8b')]=function(_0x1804a8,_0x3644a5,_0x36a254){return db['ChatQueue'][_0x28ab('0x50')]({'where':{'id':_0x1804a8[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x3644a5,null))[_0x28ab('0x1b')](function(_0x5a3b0d){if(_0x5a3b0d){return _0x5a3b0d[_0x28ab('0x8b')](_0x1804a8[_0x28ab('0x3a')][_0x28ab('0x6a')])['then'](function(){if(_[_0x28ab('0x8c')](_0x1804a8['query'][_0x28ab('0x6a')])){for(var _0x3b2ef0=0x0;_0x3b2ef0<_0x1804a8[_0x28ab('0x3a')]['ids'][_0x28ab('0x3f')];_0x3b2ef0+=0x1){socket[_0x28ab('0x76')](_0x28ab('0x87'),{'UserId':Number(_0x1804a8[_0x28ab('0x3a')][_0x28ab('0x6a')][_0x3b2ef0]),'ChatQueueId':Number(_0x1804a8[_0x28ab('0x4f')]['id'])});}}else{socket[_0x28ab('0x76')](_0x28ab('0x87'),{'UserId':Number(_0x1804a8[_0x28ab('0x3a')][_0x28ab('0x6a')]),'ChatQueueId':Number(_0x1804a8[_0x28ab('0x4f')]['id'])});}});}})[_0x28ab('0x1b')](respondWithStatusCode(_0x3644a5,null))[_0x28ab('0x51')](handleError(_0x3644a5,null));};exports[_0x28ab('0x8d')]=function(_0x2d6c82,_0x1a10f3,_0x2191b3){var _0x374d70={};var _0x5e82d0={};var _0x4c773a;var _0x2c3fad;return db[_0x28ab('0x35')]['findOne']({'where':{'id':_0x2d6c82[_0x28ab('0x4f')]['id']}})[_0x28ab('0x1b')](handleEntityNotFound(_0x1a10f3,null))['then'](function(_0x589443){if(_0x589443){_0x4c773a=_0x589443;_0x5e82d0[_0x28ab('0x38')]=_['keys'](db[_0x28ab('0x6b')][_0x28ab('0x36')]);_0x5e82d0[_0x28ab('0x3a')]=_[_0x28ab('0x3b')](_0x2d6c82[_0x28ab('0x3a')]);_0x5e82d0[_0x28ab('0x45')]=_['intersection'](_0x5e82d0[_0x28ab('0x38')],_0x5e82d0[_0x28ab('0x3a')]);_0x374d70[_0x28ab('0x3d')]=_['intersection'](_0x5e82d0['model'],qs[_0x28ab('0x3e')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x3e')]));_0x374d70[_0x28ab('0x3d')]=_0x374d70[_0x28ab('0x3d')][_0x28ab('0x3f')]?_0x374d70[_0x28ab('0x3d')]:_0x5e82d0[_0x28ab('0x38')];_0x374d70[_0x28ab('0x41')]=qs[_0x28ab('0x42')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x42')]);_0x374d70['where']=qs[_0x28ab('0x45')](_[_0x28ab('0x44')](_0x2d6c82[_0x28ab('0x3a')],_0x5e82d0[_0x28ab('0x45')]));if(_0x2d6c82[_0x28ab('0x3a')]['filter']){_0x374d70[_0x28ab('0x43')]=_['merge'](_0x374d70[_0x28ab('0x43')],{'$or':_['map'](_0x374d70[_0x28ab('0x3d')],function(_0x474ac1){var _0x13f4b1={};_0x13f4b1[_0x474ac1]={'$like':'%'+_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x46')]+'%'};return _0x13f4b1;})});}_0x374d70=_[_0x28ab('0x47')]({},_0x374d70,_0x2d6c82['options']);return _0x4c773a['getAgents'](_0x374d70);}})['then'](function(_0x4cc3ed){if(_0x4cc3ed){_0x2c3fad=_0x4cc3ed['length'];if(!_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x5c')](_0x28ab('0x5d'))){_0x374d70['limit']=qs[_0x28ab('0x26')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x26')]);_0x374d70[_0x28ab('0x40')]=qs[_0x28ab('0x40')](_0x2d6c82[_0x28ab('0x3a')][_0x28ab('0x40')]);}return _0x4c773a[_0x28ab('0x8d')](_0x374d70);}})[_0x28ab('0x1b')](function(_0x3ff82f){if(_0x3ff82f){return _0x3ff82f?{'count':_0x2c3fad,'rows':_0x3ff82f}:null;}})[_0x28ab('0x1b')](respondWithResult(_0x1a10f3,null))[_0x28ab('0x51')](handleError(_0x1a10f3,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f0c505d..4c3f2ea 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 _0x6ea5=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x4f2d8e,_0x478943){var _0x2fa062=function(_0x257b5a){while(--_0x257b5a){_0x4f2d8e['push'](_0x4f2d8e['shift']());}};_0x2fa062(++_0x478943);}(_0x6ea5,0xa5));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x56ea('0x0'));var ChatQueue=require(_0x56ea('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x56ea('0x2')](0x0);var events={'afterCreate':_0x56ea('0x3'),'afterUpdate':'update','afterDestroy':_0x56ea('0x4')};function emitEvent(_0x514fec){return function(_0x4d590f,_0x3cee31,_0x4f349b){ChatQueueEvents[_0x56ea('0x5')](_0x514fec+':'+_0x4d590f['id'],_0x4d590f);ChatQueueEvents[_0x56ea('0x5')](_0x514fec,_0x4d590f);_0x4f349b(null);};}for(var e in events){if(events[_0x56ea('0x6')](e)){var event=events[e];ChatQueue[_0x56ea('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x3a9a=['events','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x534258,_0x1d171d){var _0x47aff8=function(_0x2471f3){while(--_0x2471f3){_0x534258['push'](_0x534258['shift']());}};_0x47aff8(++_0x1d171d);}(_0x3a9a,0x122));var _0xa3a9=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x3a9a[_0x541260];return _0x1dd2b5;};'use strict';var EventEmitter=require(_0xa3a9('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xa3a9('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa3a9('0x2')](0x0);var events={'afterCreate':_0xa3a9('0x3'),'afterUpdate':_0xa3a9('0x4'),'afterDestroy':_0xa3a9('0x5')};function emitEvent(_0xb8cce8){return function(_0x58e3f9,_0x3a0d2c,_0x5dd0d2){ChatQueueEvents[_0xa3a9('0x6')](_0xb8cce8+':'+_0x58e3f9['id'],_0x58e3f9);ChatQueueEvents['emit'](_0xb8cce8,_0x58e3f9);_0x5dd0d2(null);};}for(var e in events){if(events[_0xa3a9('0x7')](e)){var event=events[e];ChatQueue[_0xa3a9('0x8')](e,emitEvent(event));}}module[_0xa3a9('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 9b3f8cf..6cfb1ef 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 _0x26d7=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues'];(function(_0x527d44,_0x1dcd67){var _0x1374e2=function(_0x4c77d3){while(--_0x4c77d3){_0x527d44['push'](_0x527d44['shift']());}};_0x1374e2(++_0x1dcd67);}(_0x26d7,0xfd));var _0x726d=function(_0x44e18a,_0x198ce9){_0x44e18a=_0x44e18a-0x0;var _0x38af78=_0x26d7[_0x44e18a];return _0x38af78;};'use strict';var _=require(_0x726d('0x0'));var util=require(_0x726d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x726d('0x2'));var BPromise=require('bluebird');var rp=require(_0x726d('0x3'));var fs=require('fs');var path=require(_0x726d('0x4'));var rimraf=require(_0x726d('0x5'));var config=require(_0x726d('0x6'));var attributes=require(_0x726d('0x7'));module[_0x726d('0x8')]=function(_0x5bbb46,_0x23b31e){return _0x5bbb46[_0x726d('0x9')]('ChatQueue',attributes,{'tableName':_0x726d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48d4=['moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x48d4,0x99));var _0x448d=function(_0xef01a2,_0x426962){_0xef01a2=_0xef01a2-0x0;var _0x88a2bc=_0x48d4[_0xef01a2];return _0x88a2bc;};'use strict';var _=require(_0x448d('0x0'));var util=require(_0x448d('0x1'));var logger=require(_0x448d('0x2'))('api');var moment=require(_0x448d('0x3'));var BPromise=require(_0x448d('0x4'));var rp=require(_0x448d('0x5'));var fs=require('fs');var path=require(_0x448d('0x6'));var rimraf=require(_0x448d('0x7'));var config=require('../../config/environment');var attributes=require(_0x448d('0x8'));module[_0x448d('0x9')]=function(_0x8587d1,_0x248763){return _0x8587d1[_0x448d('0xa')](_0x448d('0xb'),attributes,{'tableName':_0x448d('0xc'),'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 6f08ea1..97187bb 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 _0xcf2f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowChatQueue','find','where','lodash'];(function(_0x97a971,_0x540bbe){var _0x1dff74=function(_0x4aa3f4){while(--_0x4aa3f4){_0x97a971['push'](_0x97a971['shift']());}};_0x1dff74(++_0x540bbe);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x553aa1,_0x512f29){_0x553aa1=_0x553aa1-0x0;var _0x1216a7=_0xcf2f[_0x553aa1];return _0x1216a7;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});config[_0xfcf2('0xd')]=_[_0xfcf2('0xe')](config[_0xfcf2('0xd')],{'host':_0xfcf2('0xf'),'port':0x18eb});var socket=require(_0xfcf2('0x10'))(new Redis(config[_0xfcf2('0xd')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4d6fc9,_0x91b579,_0x2a9ecb){return new BPromise(function(_0x481e38,_0xf38eab){return client[_0xfcf2('0x11')](_0x4d6fc9,_0x2a9ecb)[_0xfcf2('0x12')](function(_0x29e649){logger['info']('ChatQueue,\x20%s,\x20%s',_0x91b579,_0xfcf2('0x13'));logger[_0xfcf2('0x14')](_0xfcf2('0x15'),_0x91b579,_0xfcf2('0x13'),JSON['stringify'](_0x29e649));if(_0x29e649[_0xfcf2('0x16')]){if(_0x29e649['error']['code']===0x1f4){logger['error'](_0xfcf2('0x17'),_0x91b579,_0x29e649['error'][_0xfcf2('0x18')]);return _0xf38eab(_0x29e649[_0xfcf2('0x16')][_0xfcf2('0x18')]);}logger[_0xfcf2('0x16')](_0xfcf2('0x17'),_0x91b579,_0x29e649[_0xfcf2('0x16')][_0xfcf2('0x18')]);return _0x481e38(_0x29e649['error'][_0xfcf2('0x18')]);}else{logger[_0xfcf2('0x19')](_0xfcf2('0x17'),_0x91b579,'request\x20sent');_0x481e38(_0x29e649[_0xfcf2('0x1a')][_0xfcf2('0x18')]);}})[_0xfcf2('0x1b')](function(_0x1cc67e){logger[_0xfcf2('0x16')]('ChatQueue,\x20%s,\x20%s',_0x91b579,_0x1cc67e);_0xf38eab(_0x1cc67e);});});}exports[_0xfcf2('0x1c')]=function(_0x11c34f){var _0x4939e4=this;return new Promise(function(_0x9a1d9f,_0x23c079){return db[_0xfcf2('0x1d')][_0xfcf2('0x1e')]({'raw':_0x11c34f[_0xfcf2('0x1f')]?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x20')]===undefined?!![]:![]:!![],'where':_0x11c34f[_0xfcf2('0x1f')]?_0x11c34f[_0xfcf2('0x1f')]['where']||null:null,'attributes':_0x11c34f[_0xfcf2('0x1f')]?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x21')]||null:null,'limit':_0x11c34f['options']?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x22')]||null:null,'include':_0x11c34f['options']?_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x23')]?_['map'](_0x11c34f[_0xfcf2('0x1f')][_0xfcf2('0x23')],function(_0x1f0f07){return{'model':db[_0x1f0f07[_0xfcf2('0x24')]],'as':_0x1f0f07['as'],'attributes':_0x1f0f07['attributes'],'include':_0x1f0f07[_0xfcf2('0x23')]?_[_0xfcf2('0x25')](_0x1f0f07[_0xfcf2('0x23')],function(_0x3779ee){return{'model':db[_0x3779ee[_0xfcf2('0x24')]],'as':_0x3779ee['as'],'attributes':_0x3779ee[_0xfcf2('0x21')],'include':_0x3779ee[_0xfcf2('0x23')]?_[_0xfcf2('0x25')](_0x3779ee[_0xfcf2('0x23')],function(_0x56f839){return{'model':db[_0x56f839['model']],'as':_0x56f839['as'],'attributes':_0x56f839[_0xfcf2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfcf2('0x12')](function(_0x3308c3){logger['info'](_0xfcf2('0x1c'),_0x11c34f);logger['debug'](_0xfcf2('0x1c'),_0x11c34f,JSON[_0xfcf2('0x26')](_0x3308c3));_0x9a1d9f(_0x3308c3);})[_0xfcf2('0x1b')](function(_0x1a4485){logger[_0xfcf2('0x16')](_0xfcf2('0x1c'),_0x1a4485[_0xfcf2('0x18')],_0x11c34f);_0x23c079(_0x4939e4['error'](0x1f4,_0x1a4485['message']));});});};exports[_0xfcf2('0x27')]=function(_0x1acbea){var _0x147ed2=this;return new Promise(function(_0xd76c56,_0x4913fc){return db['ChatQueue'][_0xfcf2('0x28')]({'raw':_0x1acbea['options']?_0x1acbea[_0xfcf2('0x1f')][_0xfcf2('0x20')]===undefined?!![]:![]:!![],'where':_0x1acbea['options']?_0x1acbea[_0xfcf2('0x1f')][_0xfcf2('0x29')]||null:null,'attributes':_0x1acbea[_0xfcf2('0x1f')]?_0x1acbea[_0xfcf2('0x1f')][_0xfcf2('0x21')]||null:null,'include':_0x1acbea[_0xfcf2('0x1f')]?_0x1acbea[_0xfcf2('0x1f')]['include']?_[_0xfcf2('0x25')](_0x1acbea[_0xfcf2('0x1f')]['include'],function(_0x101561){return{'model':db[_0x101561[_0xfcf2('0x24')]],'as':_0x101561['as'],'attributes':_0x101561['attributes'],'include':_0x101561[_0xfcf2('0x23')]?_[_0xfcf2('0x25')](_0x101561['include'],function(_0x34a518){return{'model':db[_0x34a518[_0xfcf2('0x24')]],'as':_0x34a518['as'],'attributes':_0x34a518[_0xfcf2('0x21')],'include':_0x34a518[_0xfcf2('0x23')]?_['map'](_0x34a518[_0xfcf2('0x23')],function(_0x2dbabb){return{'model':db[_0x2dbabb[_0xfcf2('0x24')]],'as':_0x2dbabb['as'],'attributes':_0x2dbabb[_0xfcf2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfcf2('0x12')](function(_0x5722be){logger[_0xfcf2('0x19')](_0xfcf2('0x27'),_0x1acbea);logger[_0xfcf2('0x14')](_0xfcf2('0x27'),_0x1acbea,JSON[_0xfcf2('0x26')](_0x5722be));_0xd76c56(_0x5722be);})['catch'](function(_0xc38622){logger['error'](_0xfcf2('0x27'),_0xc38622[_0xfcf2('0x18')],_0x1acbea);_0x4913fc(_0x147ed2[_0xfcf2('0x16')](0x1f4,_0xc38622[_0xfcf2('0x18')]));});});};
\ No newline at end of file
+var _0x145d=['model','ShowChatQueue','find','raw','where','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','options','limit','map','include','attributes'];(function(_0x27afb9,_0x291d1f){var _0x406866=function(_0x4639e8){while(--_0x4639e8){_0x27afb9['push'](_0x27afb9['shift']());}};_0x406866(++_0x291d1f);}(_0x145d,0xc9));var _0xd145=function(_0x195d50,_0x19816a){_0x195d50=_0x195d50-0x0;var _0x2f74ea=_0x145d[_0x195d50];return _0x2f74ea;};'use strict';var _=require('lodash');var util=require(_0xd145('0x0'));var moment=require(_0xd145('0x1'));var BPromise=require(_0xd145('0x2'));var rs=require(_0xd145('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd145('0x4'))['db'];var utils=require(_0xd145('0x5'));var logger=require(_0xd145('0x6'))('rpc');var config=require(_0xd145('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd145('0x8')][_0xd145('0x9')]({'port':0x232a});config[_0xd145('0xa')]=_[_0xd145('0xb')](config['redis'],{'host':_0xd145('0xc'),'port':0x18eb});var socket=require(_0xd145('0xd'))(new Redis(config[_0xd145('0xa')]));require(_0xd145('0xe'))[_0xd145('0xf')](socket);function respondWithRpcPromise(_0x30385d,_0x5d927e,_0x547317){return new BPromise(function(_0x46be49,_0x344a59){return client[_0xd145('0x10')](_0x30385d,_0x547317)['then'](function(_0x151615){logger[_0xd145('0x11')](_0xd145('0x12'),_0x5d927e,_0xd145('0x13'));logger[_0xd145('0x14')](_0xd145('0x15'),_0x5d927e,_0xd145('0x13'),JSON[_0xd145('0x16')](_0x151615));if(_0x151615[_0xd145('0x17')]){if(_0x151615[_0xd145('0x17')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5d927e,_0x151615[_0xd145('0x17')][_0xd145('0x18')]);return _0x344a59(_0x151615[_0xd145('0x17')][_0xd145('0x18')]);}logger[_0xd145('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5d927e,_0x151615['error'][_0xd145('0x18')]);return _0x46be49(_0x151615[_0xd145('0x17')][_0xd145('0x18')]);}else{logger[_0xd145('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5d927e,_0xd145('0x13'));_0x46be49(_0x151615['result'][_0xd145('0x18')]);}})[_0xd145('0x19')](function(_0x275c08){logger[_0xd145('0x17')](_0xd145('0x12'),_0x5d927e,_0x275c08);_0x344a59(_0x275c08);});});}exports[_0xd145('0x1a')]=function(_0x32061d){var _0x1feceb=this;return new Promise(function(_0x4ec45e,_0x25b041){return db[_0xd145('0x1b')]['findAll']({'raw':_0x32061d[_0xd145('0x1c')]?_0x32061d[_0xd145('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32061d[_0xd145('0x1c')]?_0x32061d[_0xd145('0x1c')]['where']||null:null,'attributes':_0x32061d[_0xd145('0x1c')]?_0x32061d['options']['attributes']||null:null,'limit':_0x32061d[_0xd145('0x1c')]?_0x32061d['options'][_0xd145('0x1d')]||null:null,'include':_0x32061d[_0xd145('0x1c')]?_0x32061d[_0xd145('0x1c')]['include']?_[_0xd145('0x1e')](_0x32061d[_0xd145('0x1c')][_0xd145('0x1f')],function(_0x1812c5){return{'model':db[_0x1812c5['model']],'as':_0x1812c5['as'],'attributes':_0x1812c5[_0xd145('0x20')],'include':_0x1812c5[_0xd145('0x1f')]?_['map'](_0x1812c5[_0xd145('0x1f')],function(_0xbdbbfc){return{'model':db[_0xbdbbfc[_0xd145('0x21')]],'as':_0xbdbbfc['as'],'attributes':_0xbdbbfc[_0xd145('0x20')],'include':_0xbdbbfc[_0xd145('0x1f')]?_['map'](_0xbdbbfc[_0xd145('0x1f')],function(_0x285665){return{'model':db[_0x285665['model']],'as':_0x285665['as'],'attributes':_0x285665[_0xd145('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x233186){logger[_0xd145('0x11')](_0xd145('0x1a'),_0x32061d);logger[_0xd145('0x14')](_0xd145('0x1a'),_0x32061d,JSON[_0xd145('0x16')](_0x233186));_0x4ec45e(_0x233186);})[_0xd145('0x19')](function(_0x2e7815){logger[_0xd145('0x17')]('GetChatQueue',_0x2e7815[_0xd145('0x18')],_0x32061d);_0x25b041(_0x1feceb['error'](0x1f4,_0x2e7815[_0xd145('0x18')]));});});};exports[_0xd145('0x22')]=function(_0x4f1e83){var _0x52a35a=this;return new Promise(function(_0x53061b,_0x19e9db){return db['ChatQueue'][_0xd145('0x23')]({'raw':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x24')]===undefined?!![]:![]:!![],'where':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x25')]||null:null,'attributes':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x20')]||null:null,'include':_0x4f1e83[_0xd145('0x1c')]?_0x4f1e83[_0xd145('0x1c')][_0xd145('0x1f')]?_[_0xd145('0x1e')](_0x4f1e83[_0xd145('0x1c')]['include'],function(_0x401801){return{'model':db[_0x401801[_0xd145('0x21')]],'as':_0x401801['as'],'attributes':_0x401801['attributes'],'include':_0x401801['include']?_[_0xd145('0x1e')](_0x401801['include'],function(_0x5dc23e){return{'model':db[_0x5dc23e['model']],'as':_0x5dc23e['as'],'attributes':_0x5dc23e['attributes'],'include':_0x5dc23e['include']?_['map'](_0x5dc23e['include'],function(_0x293e22){return{'model':db[_0x293e22[_0xd145('0x21')]],'as':_0x293e22['as'],'attributes':_0x293e22[_0xd145('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd145('0x26')](function(_0xcf6c3e){logger[_0xd145('0x11')](_0xd145('0x22'),_0x4f1e83);logger[_0xd145('0x14')](_0xd145('0x22'),_0x4f1e83,JSON[_0xd145('0x16')](_0xcf6c3e));_0x53061b(_0xcf6c3e);})['catch'](function(_0x1534f0){logger[_0xd145('0x17')](_0xd145('0x22'),_0x1534f0[_0xd145('0x18')],_0x4f1e83);_0x19e9db(_0x52a35a[_0xd145('0x17')](0x1f4,_0x1534f0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index fdcd4de..89fa15b 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 _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xed1f[_0x5a9c0c];return _0x53c77d;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}};
\ No newline at end of file
+var _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x5a79d8,_0x504a38){var _0x3edab8=function(_0x455d5b){while(--_0x455d5b){_0x5a79d8['push'](_0x5a79d8['shift']());}};_0x3edab8(++_0x504a38);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5637a6,_0x445c91){_0x5637a6=_0x5637a6-0x0;var _0x54a1c0=_0x8d0e[_0x5637a6];return _0x54a1c0;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1628ace..c2213d3 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x5fc3[_0x52096b];return _0x2b1cc7;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x46b8aa,_0x246d21){var _0x5a3d61=function(_0x5c748d){while(--_0x5c748d){_0x46b8aa['push'](_0x46b8aa['shift']());}};_0x5a3d61(++_0x246d21);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ff48a24..405dfca 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 _0x06d7=['STRING','DATE','moment','sequelize','exports'];(function(_0x2bf9b5,_0x6d057b){var _0x48afb3=function(_0x294530){while(--_0x294530){_0x2bf9b5['push'](_0x2bf9b5['shift']());}};_0x48afb3(++_0x6d057b);}(_0x06d7,0x19c));var _0x706d=function(_0x4e63cf,_0x49b7ca){_0x4e63cf=_0x4e63cf-0x0;var _0x38e54e=_0x06d7[_0x4e63cf];return _0x38e54e;};'use strict';var moment=require(_0x706d('0x0'));var Sequelize=require(_0x706d('0x1'));module[_0x706d('0x2')]={'uniqueid':{'type':Sequelize[_0x706d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x706d('0x3')]},'joinAt':{'type':Sequelize[_0x706d('0x4')]},'leaveAt':{'type':Sequelize[_0x706d('0x4')]},'acceptAt':{'type':Sequelize[_0x706d('0x4')]},'exitAt':{'type':Sequelize[_0x706d('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc741=['DATE','moment','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc741,0xe7));var _0x1c74=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc741[_0x88cd7b];return _0x56fcc8;};'use strict';var moment=require(_0x1c74('0x0'));var Sequelize=require(_0x1c74('0x1'));module[_0x1c74('0x2')]={'uniqueid':{'type':Sequelize[_0x1c74('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1c74('0x3')]},'joinAt':{'type':Sequelize[_0x1c74('0x4')]},'leaveAt':{'type':Sequelize[_0x1c74('0x4')]},'acceptAt':{'type':Sequelize[_0x1c74('0x4')]},'exitAt':{'type':Sequelize[_0x1c74('0x4')]},'reason':{'type':Sequelize[_0x1c74('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ff0b638..08c1292 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 _0xf446=['type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','index','map','ChatQueueReport','fieldName'];(function(_0x284d96,_0x2cd706){var _0x371303=function(_0x436a9b){while(--_0x436a9b){_0x284d96['push'](_0x284d96['shift']());}};_0x371303(++_0x2cd706);}(_0xf446,0x1c0));var _0x6f44=function(_0x4cab36,_0x27aa8f){_0x4cab36=_0x4cab36-0x0;var _0x1eca64=_0xf446[_0x4cab36];return _0x1eca64;};'use strict';var emlformat=require(_0x6f44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f44('0x1'));var jsonpatch=require(_0x6f44('0x2'));var rp=require('request-promise');var moment=require(_0x6f44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f44('0x4'));var util=require(_0x6f44('0x5'));var path=require('path');var sox=require(_0x6f44('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var licenseUtil=require(_0x6f44('0x13'));var db=require(_0x6f44('0x14'))['db'];function respondWithStatusCode(_0x4bacc0,_0x305757){_0x305757=_0x305757||0xcc;return function(_0x381112){if(_0x381112){return _0x4bacc0[_0x6f44('0x15')](_0x305757);}return _0x4bacc0[_0x6f44('0x16')](_0x305757)['end']();};}function respondWithResult(_0x82c009,_0x4f1b19){_0x4f1b19=_0x4f1b19||0xc8;return function(_0x310dec){if(_0x310dec){return _0x82c009['status'](_0x4f1b19)['json'](_0x310dec);}};}function respondWithFilteredResult(_0x33e088,_0xe5c968){return function(_0x33a130){if(_0x33a130){var _0x22200e=typeof _0xe5c968[_0x6f44('0x17')]===_0x6f44('0x18')&&typeof _0xe5c968[_0x6f44('0x19')]===_0x6f44('0x18');var _0x16021b=_0x33a130[_0x6f44('0x1a')];var _0x27062e=_0x22200e?0x0:_0xe5c968['offset'];var _0x11b488=_0x22200e?_0x33a130[_0x6f44('0x1a')]:_0xe5c968[_0x6f44('0x17')]+_0xe5c968[_0x6f44('0x19')];var _0x46c693;if(_0x11b488>=_0x16021b){_0x11b488=_0x16021b;_0x46c693=0xc8;}else{_0x46c693=0xce;}_0x33e088['status'](_0x46c693);return _0x33e088[_0x6f44('0x1b')]('Content-Range',_0x27062e+'-'+_0x11b488+'/'+_0x16021b)[_0x6f44('0x1c')](_0x33a130);}return null;};}function patchUpdates(_0x57d6a2){return function(_0x3c1265){try{jsonpatch['apply'](_0x3c1265,_0x57d6a2,!![]);}catch(_0x415cce){return BPromise[_0x6f44('0x1d')](_0x415cce);}return _0x3c1265[_0x6f44('0x1e')]();};}function saveUpdates(_0xf1a57c,_0x1137db){return function(_0x1418e1){if(_0x1418e1){return _0x1418e1[_0x6f44('0x1f')](_0xf1a57c)[_0x6f44('0x20')](function(_0x3e121e){return _0x3e121e;});}return null;};}function removeEntity(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(_0x3583c7){return _0x3583c7[_0x6f44('0x21')]()[_0x6f44('0x20')](function(){_0x50bbad[_0x6f44('0x16')](0xcc)[_0x6f44('0x22')]();});}};}function handleEntityNotFound(_0x2681a9,_0x5d19d8){return function(_0x17ebd2){if(!_0x17ebd2){_0x2681a9[_0x6f44('0x15')](0x194);}return _0x17ebd2;};}function handleError(_0x58351a,_0x568f8b){_0x568f8b=_0x568f8b||0x1f4;return function(_0x430b93){logger[_0x6f44('0x23')](_0x430b93[_0x6f44('0x24')]);if(_0x430b93[_0x6f44('0x25')]){delete _0x430b93[_0x6f44('0x25')];}_0x58351a[_0x6f44('0x16')](_0x568f8b)['send'](_0x430b93);};}exports[_0x6f44('0x26')]=function(_0x47feea,_0x33ec71){var _0x6784ce={},_0x1cb57d={},_0x4b275b={'count':0x0,'rows':[]};var _0x477a0f=_[_0x6f44('0x27')](db[_0x6f44('0x28')]['rawAttributes'],function(_0x5e7651){return{'name':_0x5e7651[_0x6f44('0x29')],'type':_0x5e7651[_0x6f44('0x2a')][_0x6f44('0x2b')]};});_0x1cb57d['model']=_[_0x6f44('0x27')](_0x477a0f,_0x6f44('0x25'));_0x1cb57d[_0x6f44('0x2c')]=_[_0x6f44('0x2d')](_0x47feea[_0x6f44('0x2c')]);_0x1cb57d[_0x6f44('0x2e')]=_[_0x6f44('0x2f')](_0x1cb57d[_0x6f44('0x30')],_0x1cb57d[_0x6f44('0x2c')]);_0x6784ce[_0x6f44('0x31')]=_[_0x6f44('0x2f')](_0x1cb57d[_0x6f44('0x30')],qs['fields'](_0x47feea['query'][_0x6f44('0x32')]));_0x6784ce[_0x6f44('0x31')]=_0x6784ce[_0x6f44('0x31')]['length']?_0x6784ce[_0x6f44('0x31')]:_0x1cb57d[_0x6f44('0x30')];if(!_0x47feea[_0x6f44('0x2c')][_0x6f44('0x33')](_0x6f44('0x34'))){_0x6784ce[_0x6f44('0x19')]=qs[_0x6f44('0x19')](_0x47feea[_0x6f44('0x2c')][_0x6f44('0x19')]);_0x6784ce['offset']=qs[_0x6f44('0x17')](_0x47feea['query']['offset']);}_0x6784ce['order']=qs[_0x6f44('0x35')](_0x47feea[_0x6f44('0x2c')][_0x6f44('0x35')]);_0x6784ce[_0x6f44('0x36')]=qs[_0x6f44('0x2e')](_['pick'](_0x47feea[_0x6f44('0x2c')],_0x1cb57d[_0x6f44('0x2e')]),_0x477a0f);if(_0x47feea[_0x6f44('0x2c')]['filter']){_0x6784ce[_0x6f44('0x36')]=_[_0x6f44('0x37')](_0x6784ce[_0x6f44('0x36')],{'$or':_[_0x6f44('0x27')](_0x477a0f,function(_0x27968a){if(_0x27968a['type']!==_0x6f44('0x38')){var _0x44c6c6={};_0x44c6c6[_0x27968a[_0x6f44('0x25')]]={'$like':'%'+_0x47feea['query']['filter']+'%'};return _0x44c6c6;}})});}_0x6784ce=_['merge']({},_0x6784ce,_0x47feea[_0x6f44('0x39')]);var _0x5e34ef={'where':_0x6784ce[_0x6f44('0x36')]};return db['ChatQueueReport'][_0x6f44('0x1a')](_0x5e34ef)[_0x6f44('0x20')](function(_0x3a3ca1){_0x4b275b[_0x6f44('0x1a')]=_0x3a3ca1;if(_0x47feea[_0x6f44('0x2c')][_0x6f44('0x3a')]){_0x6784ce['include']=[{'all':!![]}];}return db[_0x6f44('0x28')][_0x6f44('0x3b')](_0x6784ce);})[_0x6f44('0x20')](function(_0x297999){_0x4b275b[_0x6f44('0x3c')]=_0x297999;return _0x4b275b;})['then'](respondWithFilteredResult(_0x33ec71,_0x6784ce))[_0x6f44('0x3d')](handleError(_0x33ec71,null));};exports[_0x6f44('0x3e')]=function(_0x3c4dcb,_0x47052d){var _0xadfbd6={'raw':!![],'where':{'id':_0x3c4dcb[_0x6f44('0x3f')]['id']}},_0x3d1162={};_0x3d1162[_0x6f44('0x30')]=_[_0x6f44('0x2d')](db['ChatQueueReport'][_0x6f44('0x40')]);_0x3d1162['query']=_[_0x6f44('0x2d')](_0x3c4dcb[_0x6f44('0x2c')]);_0x3d1162[_0x6f44('0x2e')]=_[_0x6f44('0x2f')](_0x3d1162['model'],_0x3d1162[_0x6f44('0x2c')]);_0xadfbd6[_0x6f44('0x31')]=_['intersection'](_0x3d1162[_0x6f44('0x30')],qs[_0x6f44('0x32')](_0x3c4dcb[_0x6f44('0x2c')][_0x6f44('0x32')]));_0xadfbd6[_0x6f44('0x31')]=_0xadfbd6[_0x6f44('0x31')][_0x6f44('0x41')]?_0xadfbd6[_0x6f44('0x31')]:_0x3d1162['model'];if(_0x3c4dcb[_0x6f44('0x2c')][_0x6f44('0x3a')]){_0xadfbd6['include']=[{'all':!![]}];}_0xadfbd6=_[_0x6f44('0x37')]({},_0xadfbd6,_0x3c4dcb['options']);return db['ChatQueueReport']['find'](_0xadfbd6)[_0x6f44('0x20')](handleEntityNotFound(_0x47052d,null))['then'](respondWithResult(_0x47052d,null))['catch'](handleError(_0x47052d,null));};exports[_0x6f44('0x42')]=function(_0x3b3585,_0x3e1a61){return db[_0x6f44('0x28')][_0x6f44('0x42')](_0x3b3585['body'],{})[_0x6f44('0x20')](respondWithResult(_0x3e1a61,0xc9))[_0x6f44('0x3d')](handleError(_0x3e1a61,null));};exports[_0x6f44('0x1f')]=function(_0x35668c,_0x1fe022){if(_0x35668c['body']['id']){delete _0x35668c[_0x6f44('0x43')]['id'];}return db[_0x6f44('0x28')][_0x6f44('0x44')]({'where':{'id':_0x35668c[_0x6f44('0x3f')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x1fe022,null))['then'](saveUpdates(_0x35668c['body'],null))[_0x6f44('0x20')](respondWithResult(_0x1fe022,null))['catch'](handleError(_0x1fe022,null));};exports[_0x6f44('0x21')]=function(_0x55bda4,_0x5c3305){return db[_0x6f44('0x28')][_0x6f44('0x44')]({'where':{'id':_0x55bda4[_0x6f44('0x3f')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x5c3305,null))[_0x6f44('0x20')](removeEntity(_0x5c3305,null))['catch'](handleError(_0x5c3305,null));};exports[_0x6f44('0x45')]=function(_0x6f1cb5,_0xb97acf){return db[_0x6f44('0x28')]['describe']()[_0x6f44('0x20')](respondWithResult(_0xb97acf,null))[_0x6f44('0x3d')](handleError(_0xb97acf,null));};
\ No newline at end of file
+var _0xc1db=['show','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','limit','Content-Range','json','reject','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','merge','VIRTUAL','options','where','ChatQueueReport','includeAll','findAll','rows'];(function(_0x3a355d,_0x26de2a){var _0x37aa3b=function(_0x42c21a){while(--_0x42c21a){_0x3a355d['push'](_0x3a355d['shift']());}};_0x37aa3b(++_0x26de2a);}(_0xc1db,0x120));var _0xbc1d=function(_0x414416,_0x19916a){_0x414416=_0x414416-0x0;var _0x13b218=_0xc1db[_0x414416];return _0x13b218;};'use strict';var emlformat=require(_0xbc1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc1d('0x1'));var jsonpatch=require(_0xbc1d('0x2'));var rp=require(_0xbc1d('0x3'));var moment=require(_0xbc1d('0x4'));var BPromise=require(_0xbc1d('0x5'));var Mustache=require('mustache');var util=require(_0xbc1d('0x6'));var path=require(_0xbc1d('0x7'));var sox=require(_0xbc1d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc1d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbc1d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbc1d('0xb'));var toCsv=require(_0xbc1d('0xc'));var querystring=require('querystring');var Papa=require(_0xbc1d('0xd'));var Redis=require('ioredis');var authService=require(_0xbc1d('0xe'));var qs=require(_0xbc1d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc1d('0x10'));var logger=require(_0xbc1d('0x11'))(_0xbc1d('0x12'));var utils=require(_0xbc1d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbc1d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3801b9,_0x112284){_0x112284=_0x112284||0xcc;return function(_0x50982e){if(_0x50982e){return _0x3801b9[_0xbc1d('0x15')](_0x112284);}return _0x3801b9[_0xbc1d('0x16')](_0x112284)['end']();};}function respondWithResult(_0x373f20,_0x35d81d){_0x35d81d=_0x35d81d||0xc8;return function(_0x58e7f4){if(_0x58e7f4){return _0x373f20[_0xbc1d('0x16')](_0x35d81d)['json'](_0x58e7f4);}};}function respondWithFilteredResult(_0x4142e4,_0x238c0d){return function(_0xfe7015){if(_0xfe7015){var _0xf56647=typeof _0x238c0d[_0xbc1d('0x17')]===_0xbc1d('0x18')&&typeof _0x238c0d['limit']===_0xbc1d('0x18');var _0x57cb2a=_0xfe7015[_0xbc1d('0x19')];var _0x225310=_0xf56647?0x0:_0x238c0d['offset'];var _0x58c56e=_0xf56647?_0xfe7015['count']:_0x238c0d[_0xbc1d('0x17')]+_0x238c0d[_0xbc1d('0x1a')];var _0x44887e;if(_0x58c56e>=_0x57cb2a){_0x58c56e=_0x57cb2a;_0x44887e=0xc8;}else{_0x44887e=0xce;}_0x4142e4[_0xbc1d('0x16')](_0x44887e);return _0x4142e4['set'](_0xbc1d('0x1b'),_0x225310+'-'+_0x58c56e+'/'+_0x57cb2a)[_0xbc1d('0x1c')](_0xfe7015);}return null;};}function patchUpdates(_0x59f362){return function(_0xd5886c){try{jsonpatch['apply'](_0xd5886c,_0x59f362,!![]);}catch(_0x5ab558){return BPromise[_0xbc1d('0x1d')](_0x5ab558);}return _0xd5886c['save']();};}function saveUpdates(_0x25fa75,_0x52c7c9){return function(_0x1b065e){if(_0x1b065e){return _0x1b065e[_0xbc1d('0x1e')](_0x25fa75)['then'](function(_0x1951a1){return _0x1951a1;});}return null;};}function removeEntity(_0x1890c0,_0x3955ab){return function(_0x4a0579){if(_0x4a0579){return _0x4a0579['destroy']()[_0xbc1d('0x1f')](function(){_0x1890c0['status'](0xcc)[_0xbc1d('0x20')]();});}};}function handleEntityNotFound(_0x13ce62,_0x59fd2e){return function(_0x4d959a){if(!_0x4d959a){_0x13ce62[_0xbc1d('0x15')](0x194);}return _0x4d959a;};}function handleError(_0x970e66,_0x5896d1){_0x5896d1=_0x5896d1||0x1f4;return function(_0x7b37c3){logger[_0xbc1d('0x21')](_0x7b37c3[_0xbc1d('0x22')]);if(_0x7b37c3[_0xbc1d('0x23')]){delete _0x7b37c3[_0xbc1d('0x23')];}_0x970e66[_0xbc1d('0x16')](_0x5896d1)[_0xbc1d('0x24')](_0x7b37c3);};}exports['index']=function(_0x363afd,_0x5e97e3){var _0x584fa5={},_0x40d1e2={},_0x420f28={'count':0x0,'rows':[]};var _0x238a4d=_[_0xbc1d('0x25')](db['ChatQueueReport'][_0xbc1d('0x26')],function(_0x292504){return{'name':_0x292504[_0xbc1d('0x27')],'type':_0x292504[_0xbc1d('0x28')][_0xbc1d('0x29')]};});_0x40d1e2[_0xbc1d('0x2a')]=_[_0xbc1d('0x25')](_0x238a4d,_0xbc1d('0x23'));_0x40d1e2[_0xbc1d('0x2b')]=_[_0xbc1d('0x2c')](_0x363afd[_0xbc1d('0x2b')]);_0x40d1e2[_0xbc1d('0x2d')]=_[_0xbc1d('0x2e')](_0x40d1e2['model'],_0x40d1e2[_0xbc1d('0x2b')]);_0x584fa5[_0xbc1d('0x2f')]=_[_0xbc1d('0x2e')](_0x40d1e2[_0xbc1d('0x2a')],qs[_0xbc1d('0x30')](_0x363afd[_0xbc1d('0x2b')]['fields']));_0x584fa5[_0xbc1d('0x2f')]=_0x584fa5[_0xbc1d('0x2f')][_0xbc1d('0x31')]?_0x584fa5['attributes']:_0x40d1e2[_0xbc1d('0x2a')];if(!_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x32')]('nolimit')){_0x584fa5[_0xbc1d('0x1a')]=qs[_0xbc1d('0x1a')](_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x1a')]);_0x584fa5['offset']=qs['offset'](_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x17')]);}_0x584fa5[_0xbc1d('0x33')]=qs['sort'](_0x363afd['query']['sort']);_0x584fa5['where']=qs[_0xbc1d('0x2d')](_[_0xbc1d('0x34')](_0x363afd[_0xbc1d('0x2b')],_0x40d1e2[_0xbc1d('0x2d')]),_0x238a4d);if(_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x35')]){_0x584fa5['where']=_[_0xbc1d('0x36')](_0x584fa5['where'],{'$or':_[_0xbc1d('0x25')](_0x238a4d,function(_0x560a7c){if(_0x560a7c[_0xbc1d('0x28')]!==_0xbc1d('0x37')){var _0xddc19b={};_0xddc19b[_0x560a7c['name']]={'$like':'%'+_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x35')]+'%'};return _0xddc19b;}})});}_0x584fa5=_[_0xbc1d('0x36')]({},_0x584fa5,_0x363afd[_0xbc1d('0x38')]);var _0x512a88={'where':_0x584fa5[_0xbc1d('0x39')]};return db[_0xbc1d('0x3a')][_0xbc1d('0x19')](_0x512a88)[_0xbc1d('0x1f')](function(_0x107e00){_0x420f28[_0xbc1d('0x19')]=_0x107e00;if(_0x363afd[_0xbc1d('0x2b')][_0xbc1d('0x3b')]){_0x584fa5['include']=[{'all':!![]}];}return db[_0xbc1d('0x3a')][_0xbc1d('0x3c')](_0x584fa5);})['then'](function(_0xbf378){_0x420f28[_0xbc1d('0x3d')]=_0xbf378;return _0x420f28;})['then'](respondWithFilteredResult(_0x5e97e3,_0x584fa5))['catch'](handleError(_0x5e97e3,null));};exports[_0xbc1d('0x3e')]=function(_0x371f25,_0x3e09f9){var _0x4a9006={'raw':!![],'where':{'id':_0x371f25[_0xbc1d('0x3f')]['id']}},_0x2475cb={};_0x2475cb[_0xbc1d('0x2a')]=_[_0xbc1d('0x2c')](db['ChatQueueReport'][_0xbc1d('0x26')]);_0x2475cb['query']=_[_0xbc1d('0x2c')](_0x371f25[_0xbc1d('0x2b')]);_0x2475cb['filters']=_[_0xbc1d('0x2e')](_0x2475cb[_0xbc1d('0x2a')],_0x2475cb[_0xbc1d('0x2b')]);_0x4a9006[_0xbc1d('0x2f')]=_['intersection'](_0x2475cb[_0xbc1d('0x2a')],qs['fields'](_0x371f25[_0xbc1d('0x2b')]['fields']));_0x4a9006[_0xbc1d('0x2f')]=_0x4a9006['attributes'][_0xbc1d('0x31')]?_0x4a9006[_0xbc1d('0x2f')]:_0x2475cb[_0xbc1d('0x2a')];if(_0x371f25[_0xbc1d('0x2b')][_0xbc1d('0x3b')]){_0x4a9006['include']=[{'all':!![]}];}_0x4a9006=_[_0xbc1d('0x36')]({},_0x4a9006,_0x371f25['options']);return db['ChatQueueReport'][_0xbc1d('0x40')](_0x4a9006)[_0xbc1d('0x1f')](handleEntityNotFound(_0x3e09f9,null))[_0xbc1d('0x1f')](respondWithResult(_0x3e09f9,null))[_0xbc1d('0x41')](handleError(_0x3e09f9,null));};exports[_0xbc1d('0x42')]=function(_0x567be6,_0x5be3d4){return db[_0xbc1d('0x3a')][_0xbc1d('0x42')](_0x567be6['body'],{})[_0xbc1d('0x1f')](respondWithResult(_0x5be3d4,0xc9))[_0xbc1d('0x41')](handleError(_0x5be3d4,null));};exports[_0xbc1d('0x1e')]=function(_0x1238b3,_0x3b0472){if(_0x1238b3[_0xbc1d('0x43')]['id']){delete _0x1238b3[_0xbc1d('0x43')]['id'];}return db[_0xbc1d('0x3a')][_0xbc1d('0x40')]({'where':{'id':_0x1238b3[_0xbc1d('0x3f')]['id']}})[_0xbc1d('0x1f')](handleEntityNotFound(_0x3b0472,null))[_0xbc1d('0x1f')](saveUpdates(_0x1238b3[_0xbc1d('0x43')],null))[_0xbc1d('0x1f')](respondWithResult(_0x3b0472,null))[_0xbc1d('0x41')](handleError(_0x3b0472,null));};exports[_0xbc1d('0x44')]=function(_0x413918,_0xfcd402){return db['ChatQueueReport'][_0xbc1d('0x40')]({'where':{'id':_0x413918[_0xbc1d('0x3f')]['id']}})[_0xbc1d('0x1f')](handleEntityNotFound(_0xfcd402,null))[_0xbc1d('0x1f')](removeEntity(_0xfcd402,null))[_0xbc1d('0x41')](handleError(_0xfcd402,null));};exports[_0xbc1d('0x45')]=function(_0x3114bb,_0x54448f){return db['ChatQueueReport'][_0xbc1d('0x45')]()[_0xbc1d('0x1f')](respondWithResult(_0x54448f,null))[_0xbc1d('0x41')](handleError(_0x54448f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 6d929b4..7e63202 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3fc75a,_0x1a125c){var _0x1d3083=function(_0x27ee51){while(--_0x27ee51){_0x3fc75a['push'](_0x3fc75a['shift']());}};_0x1d3083(++_0x1a125c);}(_0xe706,0xa3));var _0x6e70=function(_0xeea5ca,_0x2d569b){_0xeea5ca=_0xeea5ca-0x0;var _0x1fdf07=_0xe706[_0xeea5ca];return _0x1fdf07;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'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(_0x5acedb,_0x4c5967){var _0x283f72=function(_0x446861){while(--_0x446861){_0x5acedb['push'](_0x5acedb['shift']());}};_0x283f72(++_0x4c5967);}(_0x757a,0xde));var _0xa757=function(_0x5320bf,_0x70099a){_0x5320bf=_0x5320bf-0x0;var _0x246709=_0x757a[_0x5320bf];return _0x246709;};'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 4c66757..d044821 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 _0x2cd5=['../../config/logger','rpc','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','limit','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4a4cc8,_0x5606d7){var _0x9854bb=function(_0x1fa78b){while(--_0x1fa78b){_0x4a4cc8['push'](_0x4a4cc8['shift']());}};_0x9854bb(++_0x5606d7);}(_0x2cd5,0x9b));var _0x52cd=function(_0x4dd90d,_0x567ac7){_0x4dd90d=_0x4dd90d-0x0;var _0x13eedb=_0x2cd5[_0x4dd90d];return _0x13eedb;};'use strict';var _=require('lodash');var util=require(_0x52cd('0x0'));var moment=require('moment');var BPromise=require(_0x52cd('0x1'));var rs=require(_0x52cd('0x2'));var fs=require('fs');var Redis=require(_0x52cd('0x3'));var db=require(_0x52cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52cd('0x5'))(_0x52cd('0x6'));var config=require(_0x52cd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x52cd('0x8')][_0x52cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47d0a5,_0x271320,_0x1a8307){return new BPromise(function(_0x18f775,_0x20b8c9){return client[_0x52cd('0xa')](_0x47d0a5,_0x1a8307)[_0x52cd('0xb')](function(_0x1393fd){logger['info'](_0x52cd('0xc'),_0x271320,_0x52cd('0xd'));logger[_0x52cd('0xe')](_0x52cd('0xf'),_0x271320,_0x52cd('0xd'),JSON['stringify'](_0x1393fd));if(_0x1393fd[_0x52cd('0x10')]){if(_0x1393fd[_0x52cd('0x10')][_0x52cd('0x11')]===0x1f4){logger[_0x52cd('0x10')](_0x52cd('0xc'),_0x271320,_0x1393fd[_0x52cd('0x10')][_0x52cd('0x12')]);return _0x20b8c9(_0x1393fd[_0x52cd('0x10')][_0x52cd('0x12')]);}logger[_0x52cd('0x10')](_0x52cd('0xc'),_0x271320,_0x1393fd[_0x52cd('0x10')]['message']);return _0x18f775(_0x1393fd[_0x52cd('0x10')][_0x52cd('0x12')]);}else{logger[_0x52cd('0x13')](_0x52cd('0xc'),_0x271320,_0x52cd('0xd'));_0x18f775(_0x1393fd['result'][_0x52cd('0x12')]);}})['catch'](function(_0x32ce48){logger['error'](_0x52cd('0xc'),_0x271320,_0x32ce48);_0x20b8c9(_0x32ce48);});});}exports[_0x52cd('0x14')]=function(_0x11804a){var _0x2155bd=this;return new Promise(function(_0x2f18e0,_0x2a4edd){return db[_0x52cd('0x15')][_0x52cd('0x16')](_0x11804a[_0x52cd('0x17')],{'raw':_0x11804a['options']?_0x11804a[_0x52cd('0x18')][_0x52cd('0x19')]===undefined?!![]:![]:!![]})[_0x52cd('0xb')](function(_0x4f32a4){logger[_0x52cd('0x13')]('CreateChatQueueReport',_0x11804a);logger[_0x52cd('0xe')](_0x52cd('0x14'),_0x11804a,JSON[_0x52cd('0x1a')](_0x4f32a4));_0x2f18e0(_0x4f32a4);})[_0x52cd('0x1b')](function(_0x4b445e){logger[_0x52cd('0x10')](_0x52cd('0x14'),_0x4b445e[_0x52cd('0x12')],_0x11804a);_0x2a4edd(_0x2155bd[_0x52cd('0x10')](0x1f4,_0x4b445e[_0x52cd('0x12')]));});});};exports[_0x52cd('0x1c')]=function(_0x554d44){var _0x3cad12=this;return new Promise(function(_0x151701,_0x5530e9){return db[_0x52cd('0x15')][_0x52cd('0x1d')](_0x554d44[_0x52cd('0x17')],{'raw':_0x554d44[_0x52cd('0x18')]?_0x554d44['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x554d44['options']?_0x554d44[_0x52cd('0x18')][_0x52cd('0x1e')]||null:null,'attributes':_0x554d44[_0x52cd('0x18')]?_0x554d44[_0x52cd('0x18')]['attributes']||null:null,'limit':_0x554d44[_0x52cd('0x18')]?_0x554d44[_0x52cd('0x18')][_0x52cd('0x1f')]||null:null})[_0x52cd('0xb')](function(_0x1e4088){logger[_0x52cd('0x13')]('UpdateChatQueueReport',_0x554d44);logger[_0x52cd('0xe')](_0x52cd('0x1c'),_0x554d44,JSON[_0x52cd('0x1a')](_0x1e4088));_0x151701(_0x1e4088);})['catch'](function(_0x523706){logger[_0x52cd('0x10')](_0x52cd('0x1c'),_0x523706[_0x52cd('0x12')],_0x554d44);_0x5530e9(_0x3cad12[_0x52cd('0x10')](0x1f4,_0x523706['message']));});});};
\ No newline at end of file
+var _0x152f=['stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x214ef4,_0x4a62c0){var _0x3b1112=function(_0x28eec9){while(--_0x28eec9){_0x214ef4['push'](_0x214ef4['shift']());}};_0x3b1112(++_0x4a62c0);}(_0x152f,0x144));var _0xf152=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x152f[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xf152('0x0'));var util=require(_0xf152('0x1'));var moment=require(_0xf152('0x2'));var BPromise=require(_0xf152('0x3'));var rs=require(_0xf152('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf152('0x5'))['db'];var utils=require(_0xf152('0x6'));var logger=require(_0xf152('0x7'))(_0xf152('0x8'));var config=require('../../config/environment');var jayson=require(_0xf152('0x9'));var client=jayson['client'][_0xf152('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504fb6,_0x36498a,_0x5ec158){return new BPromise(function(_0x5206b3,_0x3190e3){return client[_0xf152('0xb')](_0x504fb6,_0x5ec158)['then'](function(_0x133f44){logger[_0xf152('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x36498a,_0xf152('0xd'));logger[_0xf152('0xe')](_0xf152('0xf'),_0x36498a,_0xf152('0xd'),JSON[_0xf152('0x10')](_0x133f44));if(_0x133f44[_0xf152('0x11')]){if(_0x133f44[_0xf152('0x11')][_0xf152('0x12')]===0x1f4){logger[_0xf152('0x11')](_0xf152('0x13'),_0x36498a,_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);return _0x3190e3(_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);}logger['error'](_0xf152('0x13'),_0x36498a,_0x133f44[_0xf152('0x11')]['message']);return _0x5206b3(_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);}else{logger[_0xf152('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x36498a,_0xf152('0xd'));_0x5206b3(_0x133f44[_0xf152('0x15')]['message']);}})[_0xf152('0x16')](function(_0x29bad9){logger[_0xf152('0x11')](_0xf152('0x13'),_0x36498a,_0x29bad9);_0x3190e3(_0x29bad9);});});}exports['CreateChatQueueReport']=function(_0x3d732e){var _0x5872d9=this;return new Promise(function(_0x18bd0f,_0x58ef45){return db[_0xf152('0x17')][_0xf152('0x18')](_0x3d732e[_0xf152('0x19')],{'raw':_0x3d732e[_0xf152('0x1a')]?_0x3d732e[_0xf152('0x1a')][_0xf152('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2488a6){logger[_0xf152('0xc')](_0xf152('0x1c'),_0x3d732e);logger['debug'](_0xf152('0x1c'),_0x3d732e,JSON[_0xf152('0x10')](_0x2488a6));_0x18bd0f(_0x2488a6);})[_0xf152('0x16')](function(_0x35442a){logger[_0xf152('0x11')](_0xf152('0x1c'),_0x35442a['message'],_0x3d732e);_0x58ef45(_0x5872d9['error'](0x1f4,_0x35442a[_0xf152('0x14')]));});});};exports[_0xf152('0x1d')]=function(_0x201fcb){var _0x363379=this;return new Promise(function(_0x4f53d2,_0x36d624){return db[_0xf152('0x17')][_0xf152('0x1e')](_0x201fcb['body'],{'raw':_0x201fcb[_0xf152('0x1a')]?_0x201fcb[_0xf152('0x1a')][_0xf152('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201fcb['options']?_0x201fcb[_0xf152('0x1a')][_0xf152('0x1f')]||null:null,'attributes':_0x201fcb[_0xf152('0x1a')]?_0x201fcb[_0xf152('0x1a')][_0xf152('0x20')]||null:null,'limit':_0x201fcb[_0xf152('0x1a')]?_0x201fcb[_0xf152('0x1a')][_0xf152('0x21')]||null:null})['then'](function(_0x340d61){logger['info'](_0xf152('0x1d'),_0x201fcb);logger['debug'](_0xf152('0x1d'),_0x201fcb,JSON[_0xf152('0x10')](_0x340d61));_0x4f53d2(_0x340d61);})[_0xf152('0x16')](function(_0x2bdf10){logger[_0xf152('0x11')](_0xf152('0x1d'),_0x2bdf10[_0xf152('0x14')],_0x201fcb);_0x36d624(_0x363379['error'](0x1f4,_0x2bdf10[_0xf152('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a6a3441..2a0411d 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 _0xc202=['express','Router','fs-extra','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xc202,0xd4));var _0x2c20=function(_0x155f27,_0x164989){_0x155f27=_0x155f27-0x0;var _0x48b237=_0xc202[_0x155f27];return _0x48b237;};'use strict';var multer=require(_0x2c20('0x0'));var util=require(_0x2c20('0x1'));var path=require(_0x2c20('0x2'));var timeout=require(_0x2c20('0x3'));var express=require(_0x2c20('0x4'));var router=express[_0x2c20('0x5')]();var fs_extra=require(_0x2c20('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c20('0x7'));router['get']('/',auth[_0x2c20('0x8')](),controller[_0x2c20('0x9')]);router[_0x2c20('0xa')](_0x2c20('0xb'),auth[_0x2c20('0x8')](),controller['describe']);router['get'](_0x2c20('0xc'),auth['isAuthenticated'](),controller[_0x2c20('0xd')]);router[_0x2c20('0xe')]('/',auth[_0x2c20('0x8')](),controller[_0x2c20('0xf')]);router['put']('/:id',auth[_0x2c20('0x8')](),controller['update']);router[_0x2c20('0x10')](_0x2c20('0xc'),auth[_0x2c20('0x8')](),controller[_0x2c20('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7dad=['show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x287ba8,_0x45608b){var _0x308ab1=function(_0x8024bf){while(--_0x8024bf){_0x287ba8['push'](_0x287ba8['shift']());}};_0x308ab1(++_0x45608b);}(_0x7dad,0x16b));var _0xd7da=function(_0x95a4d8,_0x3c555e){_0x95a4d8=_0x95a4d8-0x0;var _0x20f078=_0x7dad[_0x95a4d8];return _0x20f078;};'use strict';var multer=require(_0xd7da('0x0'));var util=require(_0xd7da('0x1'));var path=require(_0xd7da('0x2'));var timeout=require(_0xd7da('0x3'));var express=require(_0xd7da('0x4'));var router=express[_0xd7da('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd7da('0x6'));var interaction=require(_0xd7da('0x7'));var config=require('../../config/environment');var controller=require(_0xd7da('0x8'));router['get']('/',auth[_0xd7da('0x9')](),controller[_0xd7da('0xa')]);router[_0xd7da('0xb')](_0xd7da('0xc'),auth[_0xd7da('0x9')](),controller[_0xd7da('0xd')]);router[_0xd7da('0xb')](_0xd7da('0xe'),auth[_0xd7da('0x9')](),controller[_0xd7da('0xf')]);router[_0xd7da('0x10')]('/',auth[_0xd7da('0x9')](),controller['create']);router[_0xd7da('0x11')](_0xd7da('0xe'),auth[_0xd7da('0x9')](),controller[_0xd7da('0x12')]);router[_0xd7da('0x13')](_0xd7da('0xe'),auth[_0xd7da('0x9')](),controller[_0xd7da('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c063153..88886bd 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x466316,_0x46d342){var _0xcfa4a1=function(_0x1c621f){while(--_0x1c621f){_0x466316['push'](_0x466316['shift']());}};_0xcfa4a1(++_0x46d342);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x4b84[_0x2b8077];return _0x308091;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x25fb78,_0xea1a5f){var _0x91fe44=function(_0x52f357){while(--_0x52f357){_0x25fb78['push'](_0x25fb78['shift']());}};_0x91fe44(++_0xea1a5f);}(_0x70e0,0x17b));var _0x070e=function(_0x4a3172,_0x542ff7){_0x4a3172=_0x4a3172-0x0;var _0x1fd35f=_0x70e0[_0x4a3172];return _0x1fd35f;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index e98ec32..6b64f14 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 _0x5b2b=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','Content-Range','apply','then','destroy','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','filters','filter','merge','where','VIRTUAL','options','count','findAll','rows','catch','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x237a57,_0x271db9){var _0xc8643f=function(_0x19b089){while(--_0x19b089){_0x237a57['push'](_0x237a57['shift']());}};_0xc8643f(++_0x271db9);}(_0x5b2b,0x17f));var _0xb5b2=function(_0x489168,_0x6c5f3b){_0x489168=_0x489168-0x0;var _0x189c0c=_0x5b2b[_0x489168];return _0x189c0c;};'use strict';var emlformat=require(_0xb5b2('0x0'));var rimraf=require(_0xb5b2('0x1'));var zipdir=require(_0xb5b2('0x2'));var jsonpatch=require(_0xb5b2('0x3'));var rp=require(_0xb5b2('0x4'));var moment=require(_0xb5b2('0x5'));var BPromise=require(_0xb5b2('0x6'));var Mustache=require('mustache');var util=require(_0xb5b2('0x7'));var path=require(_0xb5b2('0x8'));var sox=require(_0xb5b2('0x9'));var csv=require('to-csv');var ejs=require(_0xb5b2('0xa'));var fs=require('fs');var fs_extra=require(_0xb5b2('0xb'));var _=require(_0xb5b2('0xc'));var squel=require(_0xb5b2('0xd'));var crypto=require(_0xb5b2('0xe'));var jsforce=require(_0xb5b2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5b2('0x10'));var Papa=require(_0xb5b2('0x11'));var Redis=require(_0xb5b2('0x12'));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(_0xb5b2('0x13'))(_0xb5b2('0x14'));var utils=require(_0xb5b2('0x15'));var config=require(_0xb5b2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26fa32,_0x40bf4e){_0x40bf4e=_0x40bf4e||0xcc;return function(_0x2661b8){if(_0x2661b8){return _0x26fa32[_0xb5b2('0x17')](_0x40bf4e);}return _0x26fa32['status'](_0x40bf4e)[_0xb5b2('0x18')]();};}function respondWithResult(_0x10843f,_0x37cbf4){_0x37cbf4=_0x37cbf4||0xc8;return function(_0x5517aa){if(_0x5517aa){return _0x10843f[_0xb5b2('0x19')](_0x37cbf4)['json'](_0x5517aa);}};}function respondWithFilteredResult(_0xfc1587,_0x327cd9){return function(_0x3a32ee){if(_0x3a32ee){var _0xa11b29=typeof _0x327cd9[_0xb5b2('0x1a')]===_0xb5b2('0x1b')&&typeof _0x327cd9[_0xb5b2('0x1c')]===_0xb5b2('0x1b');var _0x27f58c=_0x3a32ee['count'];var _0x929059=_0xa11b29?0x0:_0x327cd9['offset'];var _0x7f7063=_0xa11b29?_0x3a32ee['count']:_0x327cd9[_0xb5b2('0x1a')]+_0x327cd9[_0xb5b2('0x1c')];var _0x4b8e5e;if(_0x7f7063>=_0x27f58c){_0x7f7063=_0x27f58c;_0x4b8e5e=0xc8;}else{_0x4b8e5e=0xce;}_0xfc1587[_0xb5b2('0x19')](_0x4b8e5e);return _0xfc1587['set'](_0xb5b2('0x1d'),_0x929059+'-'+_0x7f7063+'/'+_0x27f58c)['json'](_0x3a32ee);}return null;};}function patchUpdates(_0x46cebc){return function(_0x593303){try{jsonpatch[_0xb5b2('0x1e')](_0x593303,_0x46cebc,!![]);}catch(_0x2acf50){return BPromise['reject'](_0x2acf50);}return _0x593303['save']();};}function saveUpdates(_0xdf12db,_0x2966f7){return function(_0xa3182f){if(_0xa3182f){return _0xa3182f['update'](_0xdf12db)[_0xb5b2('0x1f')](function(_0x11fb45){return _0x11fb45;});}return null;};}function removeEntity(_0x24580f,_0x2903c2){return function(_0x14ca35){if(_0x14ca35){return _0x14ca35[_0xb5b2('0x20')]()[_0xb5b2('0x1f')](function(){_0x24580f[_0xb5b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346a58,_0x3fc8c7){return function(_0x2157f8){if(!_0x2157f8){_0x346a58[_0xb5b2('0x17')](0x194);}return _0x2157f8;};}function handleError(_0x530e1d,_0x56c228){_0x56c228=_0x56c228||0x1f4;return function(_0x4901a2){logger['error'](_0x4901a2['stack']);if(_0x4901a2[_0xb5b2('0x21')]){delete _0x4901a2[_0xb5b2('0x21')];}_0x530e1d[_0xb5b2('0x19')](_0x56c228)[_0xb5b2('0x22')](_0x4901a2);};}exports['index']=function(_0x3444cf,_0xdc38e6){var _0x321a14={},_0x318a57={},_0x4687b3={'count':0x0,'rows':[]};var _0x5f0345=_[_0xb5b2('0x23')](db[_0xb5b2('0x24')][_0xb5b2('0x25')],function(_0x224ba1){return{'name':_0x224ba1[_0xb5b2('0x26')],'type':_0x224ba1[_0xb5b2('0x27')][_0xb5b2('0x28')]};});_0x318a57['model']=_[_0xb5b2('0x23')](_0x5f0345,_0xb5b2('0x21'));_0x318a57[_0xb5b2('0x29')]=_[_0xb5b2('0x2a')](_0x3444cf[_0xb5b2('0x29')]);_0x318a57['filters']=_[_0xb5b2('0x2b')](_0x318a57[_0xb5b2('0x2c')],_0x318a57[_0xb5b2('0x29')]);_0x321a14[_0xb5b2('0x2d')]=_[_0xb5b2('0x2b')](_0x318a57[_0xb5b2('0x2c')],qs[_0xb5b2('0x2e')](_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x2e')]));_0x321a14['attributes']=_0x321a14[_0xb5b2('0x2d')][_0xb5b2('0x2f')]?_0x321a14[_0xb5b2('0x2d')]:_0x318a57[_0xb5b2('0x2c')];if(!_0x3444cf['query']['hasOwnProperty']('nolimit')){_0x321a14[_0xb5b2('0x1c')]=qs['limit'](_0x3444cf['query'][_0xb5b2('0x1c')]);_0x321a14[_0xb5b2('0x1a')]=qs['offset'](_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x1a')]);}_0x321a14[_0xb5b2('0x30')]=qs[_0xb5b2('0x31')](_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x31')]);_0x321a14['where']=qs[_0xb5b2('0x32')](_['pick'](_0x3444cf[_0xb5b2('0x29')],_0x318a57['filters']),_0x5f0345);if(_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x33')]){_0x321a14['where']=_[_0xb5b2('0x34')](_0x321a14[_0xb5b2('0x35')],{'$or':_[_0xb5b2('0x23')](_0x5f0345,function(_0x35681f){if(_0x35681f[_0xb5b2('0x27')]!==_0xb5b2('0x36')){var _0x6e0e66={};_0x6e0e66[_0x35681f[_0xb5b2('0x21')]]={'$like':'%'+_0x3444cf[_0xb5b2('0x29')][_0xb5b2('0x33')]+'%'};return _0x6e0e66;}})});}_0x321a14=_['merge']({},_0x321a14,_0x3444cf[_0xb5b2('0x37')]);var _0x35775f={'where':_0x321a14[_0xb5b2('0x35')]};return db[_0xb5b2('0x24')][_0xb5b2('0x38')](_0x35775f)[_0xb5b2('0x1f')](function(_0x44a432){_0x4687b3[_0xb5b2('0x38')]=_0x44a432;if(_0x3444cf[_0xb5b2('0x29')]['includeAll']){_0x321a14['include']=[{'all':!![]}];}return db[_0xb5b2('0x24')][_0xb5b2('0x39')](_0x321a14);})['then'](function(_0x10348d){_0x4687b3[_0xb5b2('0x3a')]=_0x10348d;return _0x4687b3;})[_0xb5b2('0x1f')](respondWithFilteredResult(_0xdc38e6,_0x321a14))[_0xb5b2('0x3b')](handleError(_0xdc38e6,null));};exports['show']=function(_0x2ea99f,_0x3fe20d){var _0x323fb3={'raw':!![],'where':{'id':_0x2ea99f[_0xb5b2('0x3c')]['id']}},_0x58a65a={};_0x58a65a['model']=_[_0xb5b2('0x2a')](db[_0xb5b2('0x24')][_0xb5b2('0x25')]);_0x58a65a['query']=_['keys'](_0x2ea99f[_0xb5b2('0x29')]);_0x58a65a[_0xb5b2('0x32')]=_[_0xb5b2('0x2b')](_0x58a65a[_0xb5b2('0x2c')],_0x58a65a['query']);_0x323fb3[_0xb5b2('0x2d')]=_[_0xb5b2('0x2b')](_0x58a65a[_0xb5b2('0x2c')],qs[_0xb5b2('0x2e')](_0x2ea99f['query']['fields']));_0x323fb3[_0xb5b2('0x2d')]=_0x323fb3[_0xb5b2('0x2d')]['length']?_0x323fb3[_0xb5b2('0x2d')]:_0x58a65a[_0xb5b2('0x2c')];if(_0x2ea99f[_0xb5b2('0x29')][_0xb5b2('0x3d')]){_0x323fb3[_0xb5b2('0x3e')]=[{'all':!![]}];}_0x323fb3=_[_0xb5b2('0x34')]({},_0x323fb3,_0x2ea99f[_0xb5b2('0x37')]);return db['ChatTransferReport'][_0xb5b2('0x3f')](_0x323fb3)[_0xb5b2('0x1f')](handleEntityNotFound(_0x3fe20d,null))[_0xb5b2('0x1f')](respondWithResult(_0x3fe20d,null))['catch'](handleError(_0x3fe20d,null));};exports[_0xb5b2('0x40')]=function(_0x3d58fc,_0x26c54b){return db[_0xb5b2('0x24')][_0xb5b2('0x40')](_0x3d58fc['body'],{})[_0xb5b2('0x1f')](respondWithResult(_0x26c54b,0xc9))[_0xb5b2('0x3b')](handleError(_0x26c54b,null));};exports['update']=function(_0x3aca18,_0x572046){if(_0x3aca18['body']['id']){delete _0x3aca18[_0xb5b2('0x41')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x3aca18[_0xb5b2('0x3c')]['id']}})['then'](handleEntityNotFound(_0x572046,null))[_0xb5b2('0x1f')](saveUpdates(_0x3aca18['body'],null))['then'](respondWithResult(_0x572046,null))['catch'](handleError(_0x572046,null));};exports[_0xb5b2('0x20')]=function(_0x5619cc,_0xfe04cc){return db['ChatTransferReport'][_0xb5b2('0x3f')]({'where':{'id':_0x5619cc[_0xb5b2('0x3c')]['id']}})['then'](handleEntityNotFound(_0xfe04cc,null))[_0xb5b2('0x1f')](removeEntity(_0xfe04cc,null))[_0xb5b2('0x3b')](handleError(_0xfe04cc,null));};exports[_0xb5b2('0x42')]=function(_0x4baaf3,_0x55359c){return db[_0xb5b2('0x24')][_0xb5b2('0x42')]()[_0xb5b2('0x1f')](respondWithResult(_0x55359c,null))[_0xb5b2('0x3b')](handleError(_0x55359c,null));};
\ No newline at end of file
+var _0xcd03=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','filter','includeAll','include','rows','show','params','length','find','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit'];(function(_0x93be8f,_0x597b00){var _0x5a990a=function(_0x12877a){while(--_0x12877a){_0x93be8f['push'](_0x93be8f['shift']());}};_0x5a990a(++_0x597b00);}(_0xcd03,0x14f));var _0x3cd0=function(_0x3175fd,_0x58119f){_0x3175fd=_0x3175fd-0x0;var _0x53e28b=_0xcd03[_0x3175fd];return _0x53e28b;};'use strict';var emlformat=require(_0x3cd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3cd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cd0('0x2'));var moment=require(_0x3cd0('0x3'));var BPromise=require(_0x3cd0('0x4'));var Mustache=require(_0x3cd0('0x5'));var util=require(_0x3cd0('0x6'));var path=require('path');var sox=require(_0x3cd0('0x7'));var csv=require(_0x3cd0('0x8'));var ejs=require(_0x3cd0('0x9'));var fs=require('fs');var fs_extra=require(_0x3cd0('0xa'));var _=require(_0x3cd0('0xb'));var squel=require(_0x3cd0('0xc'));var crypto=require(_0x3cd0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3cd0('0xe'));var Papa=require(_0x3cd0('0xf'));var Redis=require(_0x3cd0('0x10'));var authService=require(_0x3cd0('0x11'));var qs=require(_0x3cd0('0x12'));var as=require(_0x3cd0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cd0('0x14'))('api');var utils=require(_0x3cd0('0x15'));var config=require(_0x3cd0('0x16'));var licenseUtil=require(_0x3cd0('0x17'));var db=require(_0x3cd0('0x18'))['db'];function respondWithStatusCode(_0x24dd2b,_0x41151f){_0x41151f=_0x41151f||0xcc;return function(_0xc90cc){if(_0xc90cc){return _0x24dd2b[_0x3cd0('0x19')](_0x41151f);}return _0x24dd2b[_0x3cd0('0x1a')](_0x41151f)['end']();};}function respondWithResult(_0x1d7ec9,_0x5c2f7a){_0x5c2f7a=_0x5c2f7a||0xc8;return function(_0xc4efeb){if(_0xc4efeb){return _0x1d7ec9['status'](_0x5c2f7a)[_0x3cd0('0x1b')](_0xc4efeb);}};}function respondWithFilteredResult(_0x5ee296,_0x39786d){return function(_0x247da3){if(_0x247da3){var _0x4faa81=typeof _0x39786d[_0x3cd0('0x1c')]==='undefined'&&typeof _0x39786d[_0x3cd0('0x1d')]===_0x3cd0('0x1e');var _0x1177c8=_0x247da3[_0x3cd0('0x1f')];var _0x3f6b70=_0x4faa81?0x0:_0x39786d[_0x3cd0('0x1c')];var _0x212aef=_0x4faa81?_0x247da3[_0x3cd0('0x1f')]:_0x39786d[_0x3cd0('0x1c')]+_0x39786d[_0x3cd0('0x1d')];var _0x436d65;if(_0x212aef>=_0x1177c8){_0x212aef=_0x1177c8;_0x436d65=0xc8;}else{_0x436d65=0xce;}_0x5ee296[_0x3cd0('0x1a')](_0x436d65);return _0x5ee296[_0x3cd0('0x20')](_0x3cd0('0x21'),_0x3f6b70+'-'+_0x212aef+'/'+_0x1177c8)[_0x3cd0('0x1b')](_0x247da3);}return null;};}function patchUpdates(_0x3e9d43){return function(_0x57b786){try{jsonpatch[_0x3cd0('0x22')](_0x57b786,_0x3e9d43,!![]);}catch(_0x595125){return BPromise[_0x3cd0('0x23')](_0x595125);}return _0x57b786[_0x3cd0('0x24')]();};}function saveUpdates(_0x129551,_0x4d10bc){return function(_0x43f485){if(_0x43f485){return _0x43f485[_0x3cd0('0x25')](_0x129551)[_0x3cd0('0x26')](function(_0x3a9bbe){return _0x3a9bbe;});}return null;};}function removeEntity(_0x1612a3,_0x248f90){return function(_0x19ceaf){if(_0x19ceaf){return _0x19ceaf[_0x3cd0('0x27')]()['then'](function(){_0x1612a3[_0x3cd0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x883e22,_0x50c300){return function(_0x7d493d){if(!_0x7d493d){_0x883e22[_0x3cd0('0x19')](0x194);}return _0x7d493d;};}function handleError(_0x53bceb,_0x24475a){_0x24475a=_0x24475a||0x1f4;return function(_0x989651){logger[_0x3cd0('0x28')](_0x989651[_0x3cd0('0x29')]);if(_0x989651[_0x3cd0('0x2a')]){delete _0x989651[_0x3cd0('0x2a')];}_0x53bceb[_0x3cd0('0x1a')](_0x24475a)[_0x3cd0('0x2b')](_0x989651);};}exports['index']=function(_0x537a62,_0x335196){var _0x375448={},_0x2904fa={},_0x897836={'count':0x0,'rows':[]};var _0x57c28c=_[_0x3cd0('0x2c')](db[_0x3cd0('0x2d')][_0x3cd0('0x2e')],function(_0x2fcefe){return{'name':_0x2fcefe['fieldName'],'type':_0x2fcefe['type'][_0x3cd0('0x2f')]};});_0x2904fa[_0x3cd0('0x30')]=_[_0x3cd0('0x2c')](_0x57c28c,_0x3cd0('0x2a'));_0x2904fa[_0x3cd0('0x31')]=_[_0x3cd0('0x32')](_0x537a62['query']);_0x2904fa[_0x3cd0('0x33')]=_['intersection'](_0x2904fa['model'],_0x2904fa[_0x3cd0('0x31')]);_0x375448[_0x3cd0('0x34')]=_[_0x3cd0('0x35')](_0x2904fa[_0x3cd0('0x30')],qs[_0x3cd0('0x36')](_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x36')]));_0x375448['attributes']=_0x375448[_0x3cd0('0x34')]['length']?_0x375448[_0x3cd0('0x34')]:_0x2904fa[_0x3cd0('0x30')];if(!_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x37')]('nolimit')){_0x375448[_0x3cd0('0x1d')]=qs[_0x3cd0('0x1d')](_0x537a62['query'][_0x3cd0('0x1d')]);_0x375448[_0x3cd0('0x1c')]=qs[_0x3cd0('0x1c')](_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x1c')]);}_0x375448[_0x3cd0('0x38')]=qs[_0x3cd0('0x39')](_0x537a62[_0x3cd0('0x31')]['sort']);_0x375448[_0x3cd0('0x3a')]=qs['filters'](_[_0x3cd0('0x3b')](_0x537a62[_0x3cd0('0x31')],_0x2904fa[_0x3cd0('0x33')]),_0x57c28c);if(_0x537a62['query']['filter']){_0x375448[_0x3cd0('0x3a')]=_[_0x3cd0('0x3c')](_0x375448[_0x3cd0('0x3a')],{'$or':_[_0x3cd0('0x2c')](_0x57c28c,function(_0x51bcc4){if(_0x51bcc4[_0x3cd0('0x3d')]!=='VIRTUAL'){var _0x42a572={};_0x42a572[_0x51bcc4[_0x3cd0('0x2a')]]={'$like':'%'+_0x537a62['query'][_0x3cd0('0x3e')]+'%'};return _0x42a572;}})});}_0x375448=_[_0x3cd0('0x3c')]({},_0x375448,_0x537a62['options']);var _0x4455ff={'where':_0x375448['where']};return db[_0x3cd0('0x2d')][_0x3cd0('0x1f')](_0x4455ff)[_0x3cd0('0x26')](function(_0x15c5fb){_0x897836[_0x3cd0('0x1f')]=_0x15c5fb;if(_0x537a62[_0x3cd0('0x31')][_0x3cd0('0x3f')]){_0x375448[_0x3cd0('0x40')]=[{'all':!![]}];}return db[_0x3cd0('0x2d')]['findAll'](_0x375448);})[_0x3cd0('0x26')](function(_0x43dba6){_0x897836[_0x3cd0('0x41')]=_0x43dba6;return _0x897836;})[_0x3cd0('0x26')](respondWithFilteredResult(_0x335196,_0x375448))['catch'](handleError(_0x335196,null));};exports[_0x3cd0('0x42')]=function(_0x6cfe87,_0x5c4593){var _0x4aeeac={'raw':!![],'where':{'id':_0x6cfe87[_0x3cd0('0x43')]['id']}},_0x29b430={};_0x29b430[_0x3cd0('0x30')]=_['keys'](db[_0x3cd0('0x2d')][_0x3cd0('0x2e')]);_0x29b430[_0x3cd0('0x31')]=_[_0x3cd0('0x32')](_0x6cfe87[_0x3cd0('0x31')]);_0x29b430[_0x3cd0('0x33')]=_[_0x3cd0('0x35')](_0x29b430[_0x3cd0('0x30')],_0x29b430['query']);_0x4aeeac[_0x3cd0('0x34')]=_[_0x3cd0('0x35')](_0x29b430['model'],qs[_0x3cd0('0x36')](_0x6cfe87[_0x3cd0('0x31')]['fields']));_0x4aeeac[_0x3cd0('0x34')]=_0x4aeeac['attributes'][_0x3cd0('0x44')]?_0x4aeeac[_0x3cd0('0x34')]:_0x29b430[_0x3cd0('0x30')];if(_0x6cfe87['query'][_0x3cd0('0x3f')]){_0x4aeeac[_0x3cd0('0x40')]=[{'all':!![]}];}_0x4aeeac=_[_0x3cd0('0x3c')]({},_0x4aeeac,_0x6cfe87['options']);return db[_0x3cd0('0x2d')][_0x3cd0('0x45')](_0x4aeeac)[_0x3cd0('0x26')](handleEntityNotFound(_0x5c4593,null))[_0x3cd0('0x26')](respondWithResult(_0x5c4593,null))['catch'](handleError(_0x5c4593,null));};exports['create']=function(_0x5bf2d4,_0x2abf45){return db['ChatTransferReport']['create'](_0x5bf2d4[_0x3cd0('0x46')],{})[_0x3cd0('0x26')](respondWithResult(_0x2abf45,0xc9))[_0x3cd0('0x47')](handleError(_0x2abf45,null));};exports[_0x3cd0('0x25')]=function(_0x39cd9f,_0x3ea01e){if(_0x39cd9f['body']['id']){delete _0x39cd9f[_0x3cd0('0x46')]['id'];}return db['ChatTransferReport'][_0x3cd0('0x45')]({'where':{'id':_0x39cd9f[_0x3cd0('0x43')]['id']}})[_0x3cd0('0x26')](handleEntityNotFound(_0x3ea01e,null))[_0x3cd0('0x26')](saveUpdates(_0x39cd9f[_0x3cd0('0x46')],null))[_0x3cd0('0x26')](respondWithResult(_0x3ea01e,null))['catch'](handleError(_0x3ea01e,null));};exports[_0x3cd0('0x27')]=function(_0x31b213,_0x278e0a){return db['ChatTransferReport'][_0x3cd0('0x45')]({'where':{'id':_0x31b213[_0x3cd0('0x43')]['id']}})['then'](handleEntityNotFound(_0x278e0a,null))[_0x3cd0('0x26')](removeEntity(_0x278e0a,null))[_0x3cd0('0x47')](handleError(_0x278e0a,null));};exports[_0x3cd0('0x48')]=function(_0x11ecf4,_0x567cc7){return db[_0x3cd0('0x2d')][_0x3cd0('0x48')]()[_0x3cd0('0x26')](respondWithResult(_0x567cc7,null))['catch'](handleError(_0x567cc7,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c6b59f2..594a9a4 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 _0xdbdd=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0xdbdd,0x1e9));var _0xddbd=function(_0x193f14,_0x176feb){_0x193f14=_0x193f14-0x0;var _0x5b5216=_0xdbdd[_0x193f14];return _0x5b5216;};'use strict';var _=require(_0xddbd('0x0'));var util=require(_0xddbd('0x1'));var logger=require(_0xddbd('0x2'))(_0xddbd('0x3'));var moment=require(_0xddbd('0x4'));var BPromise=require('bluebird');var rp=require(_0xddbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddbd('0x6'));var config=require(_0xddbd('0x7'));var attributes=require(_0xddbd('0x8'));module[_0xddbd('0x9')]=function(_0x76a987,_0x392ee3){return _0x76a987[_0xddbd('0xa')](_0xddbd('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xddbd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e8a=['path','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d21c7,_0x19f6a8){var _0x592dad=function(_0x5d2d91){while(--_0x5d2d91){_0x2d21c7['push'](_0x2d21c7['shift']());}};_0x592dad(++_0x19f6a8);}(_0x8e8a,0x132));var _0xa8e8=function(_0x3ab66e,_0x2055d8){_0x3ab66e=_0x3ab66e-0x0;var _0x21449a=_0x8e8a[_0x3ab66e];return _0x21449a;};'use strict';var _=require(_0xa8e8('0x0'));var util=require('util');var logger=require(_0xa8e8('0x1'))(_0xa8e8('0x2'));var moment=require(_0xa8e8('0x3'));var BPromise=require(_0xa8e8('0x4'));var rp=require(_0xa8e8('0x5'));var fs=require('fs');var path=require(_0xa8e8('0x6'));var rimraf=require('rimraf');var config=require(_0xa8e8('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xa8e8('0x8')]=function(_0x44ac33,_0x133f1a){return _0x44ac33['define'](_0xa8e8('0x9'),attributes,{'tableName':_0xa8e8('0xa'),'paranoid':![],'indexes':[{'name':_0xa8e8('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 c7d59a4..561c964 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 _0x5a77=['debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s'];(function(_0x33bb07,_0x5b1849){var _0x481c81=function(_0x1709f0){while(--_0x1709f0){_0x33bb07['push'](_0x33bb07['shift']());}};_0x481c81(++_0x5b1849);}(_0x5a77,0xf8));var _0x75a7=function(_0xf038f8,_0x420f3b){_0xf038f8=_0xf038f8-0x0;var _0x417800=_0x5a77[_0xf038f8];return _0x417800;};'use strict';var _=require(_0x75a7('0x0'));var util=require(_0x75a7('0x1'));var moment=require(_0x75a7('0x2'));var BPromise=require(_0x75a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x75a7('0x5'));var logger=require(_0x75a7('0x6'))(_0x75a7('0x7'));var config=require(_0x75a7('0x8'));var jayson=require(_0x75a7('0x9'));var client=jayson[_0x75a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531801,_0x35a8ce,_0x4eca6f){return new BPromise(function(_0x374bfa,_0x4854be){return client['request'](_0x531801,_0x4eca6f)['then'](function(_0x755a6b){logger['info'](_0x75a7('0xb'),_0x35a8ce,'request\x20sent');logger[_0x75a7('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x35a8ce,_0x75a7('0xd'),JSON[_0x75a7('0xe')](_0x755a6b));if(_0x755a6b[_0x75a7('0xf')]){if(_0x755a6b['error'][_0x75a7('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x35a8ce,_0x755a6b['error'][_0x75a7('0x11')]);return _0x4854be(_0x755a6b[_0x75a7('0xf')][_0x75a7('0x11')]);}logger['error'](_0x75a7('0xb'),_0x35a8ce,_0x755a6b[_0x75a7('0xf')][_0x75a7('0x11')]);return _0x374bfa(_0x755a6b[_0x75a7('0xf')][_0x75a7('0x11')]);}else{logger[_0x75a7('0x12')](_0x75a7('0xb'),_0x35a8ce,'request\x20sent');_0x374bfa(_0x755a6b[_0x75a7('0x13')]['message']);}})['catch'](function(_0xf3cb4a){logger['error'](_0x75a7('0xb'),_0x35a8ce,_0xf3cb4a);_0x4854be(_0xf3cb4a);});});}
\ No newline at end of file
+var _0xe88d=['message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3e6c64,_0x2793e5){var _0xafe208=function(_0x587888){while(--_0x587888){_0x3e6c64['push'](_0x3e6c64['shift']());}};_0xafe208(++_0x2793e5);}(_0xe88d,0x71));var _0xde88=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0xe88d[_0x22868f];return _0x97bc75;};'use strict';var _=require(_0xde88('0x0'));var util=require('util');var moment=require(_0xde88('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde88('0x2'));var db=require(_0xde88('0x3'))['db'];var utils=require(_0xde88('0x4'));var logger=require(_0xde88('0x5'))(_0xde88('0x6'));var config=require(_0xde88('0x7'));var jayson=require(_0xde88('0x8'));var client=jayson['client'][_0xde88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e89b9,_0x97418b,_0xd56793){return new BPromise(function(_0xc5d765,_0x4bc720){return client[_0xde88('0xa')](_0x1e89b9,_0xd56793)[_0xde88('0xb')](function(_0x5daa7a){logger[_0xde88('0xc')](_0xde88('0xd'),_0x97418b,'request\x20sent');logger[_0xde88('0xe')](_0xde88('0xf'),_0x97418b,_0xde88('0x10'),JSON[_0xde88('0x11')](_0x5daa7a));if(_0x5daa7a['error']){if(_0x5daa7a[_0xde88('0x12')]['code']===0x1f4){logger[_0xde88('0x12')](_0xde88('0xd'),_0x97418b,_0x5daa7a['error'][_0xde88('0x13')]);return _0x4bc720(_0x5daa7a[_0xde88('0x12')][_0xde88('0x13')]);}logger[_0xde88('0x12')](_0xde88('0xd'),_0x97418b,_0x5daa7a['error'][_0xde88('0x13')]);return _0xc5d765(_0x5daa7a[_0xde88('0x12')]['message']);}else{logger['info'](_0xde88('0xd'),_0x97418b,_0xde88('0x10'));_0xc5d765(_0x5daa7a[_0xde88('0x14')][_0xde88('0x13')]);}})[_0xde88('0x15')](function(_0x519af8){logger[_0xde88('0x12')](_0xde88('0xd'),_0x97418b,_0x519af8);_0x4bc720(_0x519af8);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 3a8a815..6e5b477 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 _0x11a1=['../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c98bd,_0x176245){var _0x4b3190=function(_0x5c49e7){while(--_0x5c49e7){_0x2c98bd['push'](_0x2c98bd['shift']());}};_0x4b3190(++_0x176245);}(_0x11a1,0xf7));var _0x111a=function(_0x3c390d,_0x1cdc1b){_0x3c390d=_0x3c390d-0x0;var _0x101612=_0x11a1[_0x3c390d];return _0x101612;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x111a('0x0'));var timeout=require('connect-timeout');var express=require(_0x111a('0x1'));var router=express[_0x111a('0x2')]();var fs_extra=require(_0x111a('0x3'));var auth=require(_0x111a('0x4'));var interaction=require(_0x111a('0x5'));var config=require(_0x111a('0x6'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x111a('0x7')](),controller[_0x111a('0x8')]);router['get'](_0x111a('0x9'),auth[_0x111a('0x7')](),controller[_0x111a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x111a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x111a('0xc')]);router[_0x111a('0xd')](_0x111a('0xe'),auth[_0x111a('0x7')](),controller[_0x111a('0xf')]);router['delete'](_0x111a('0xe'),auth[_0x111a('0x7')](),controller[_0x111a('0x10')]);module[_0x111a('0x11')]=router;
\ No newline at end of file
+var _0x9b48=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9b48,0x138));var _0x89b4=function(_0x47e260,_0x301d9e){_0x47e260=_0x47e260-0x0;var _0x4e28b9=_0x9b48[_0x47e260];return _0x4e28b9;};'use strict';var multer=require(_0x89b4('0x0'));var util=require(_0x89b4('0x1'));var path=require(_0x89b4('0x2'));var timeout=require(_0x89b4('0x3'));var express=require(_0x89b4('0x4'));var router=express[_0x89b4('0x5')]();var fs_extra=require(_0x89b4('0x6'));var auth=require(_0x89b4('0x7'));var interaction=require(_0x89b4('0x8'));var config=require(_0x89b4('0x9'));var controller=require(_0x89b4('0xa'));router[_0x89b4('0xb')]('/',auth[_0x89b4('0xc')](),controller[_0x89b4('0xd')]);router['get'](_0x89b4('0xe'),auth[_0x89b4('0xc')](),controller[_0x89b4('0xf')]);router[_0x89b4('0xb')](_0x89b4('0x10'),auth['isAuthenticated'](),controller[_0x89b4('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x89b4('0x12')]);router[_0x89b4('0x13')](_0x89b4('0x10'),auth[_0x89b4('0xc')](),controller[_0x89b4('0x14')]);router[_0x89b4('0x15')](_0x89b4('0x10'),auth[_0x89b4('0xc')](),controller['destroy']);module[_0x89b4('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 31698e8..f81049e 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 _0xb8b6=['thumb','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback'];(function(_0x123985,_0x489296){var _0x176258=function(_0x192b10){while(--_0x192b10){_0x123985['push'](_0x123985['shift']());}};_0x176258(++_0x489296);}(_0xb8b6,0xa9));var _0x6b8b=function(_0x4bc217,_0x42f069){_0x4bc217=_0x4bc217-0x0;var _0x3e54d8=_0xb8b6[_0x4bc217];return _0x3e54d8;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x6b8b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![],'unique':_0x6b8b('0x2')},'description':{'type':Sequelize[_0x6b8b('0x1')]},'mapKey':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x3')},'mapKeyOffline':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x3')},'key':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x4')},'customerAlias':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b8b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![],'defaultValue':_0x6b8b('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b8b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b8b('0x9')](_0x6b8b('0xa'),_0x6b8b('0xb')),'defaultValue':_0x6b8b('0xa')},'header_online':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0xc')},'offline_chat_button':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0xd')},'header_offline':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6b8b('0xf')]},'closingQuestion':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x13')},'placeholderMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x14')},'closingMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x15')},'conditionAgreement':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0x16')},'ratingType':{'type':Sequelize['ENUM']('star',_0x6b8b('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6b8b('0xf')],'defaultValue':function(){return JSON[_0x6b8b('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6b8b('0x19'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6b8b('0x1a'),'props':{'title':_0x6b8b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6b8b('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b8b('0x1b')]('onlineForm')?JSON[_0x6b8b('0x1c')](this[_0x6b8b('0x1b')](_0x6b8b('0x1d'))):{};},'set':function(_0x4a399f){return this[_0x6b8b('0x1e')](_0x6b8b('0x1d'),JSON[_0x6b8b('0x18')](_0x4a399f));}},'offlineForm':{'type':Sequelize[_0x6b8b('0xf')],'defaultValue':function(){return JSON[_0x6b8b('0x18')]({'items':[{'type':'input','props':{'title':_0x6b8b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x6b8b('0x3'),'type':'email'},'variable':null},{'type':_0x6b8b('0x1f'),'config':{'placeholder':_0x6b8b('0x20')},'props':{'title':_0x6b8b('0x20'),'helpText':_0x6b8b('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6b8b('0x22'))?JSON[_0x6b8b('0x1c')](this['getDataValue']('offlineForm')):{};},'set':function(_0xb15d8b){return this['setDataValue'](_0x6b8b('0x22'),JSON[_0x6b8b('0x18')](_0xb15d8b));}},'token':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6b8b('0x1')]},'forwardOffline':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6b8b('0x1')]},'waitingTitle':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x23')},'waitingMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x24')},'offlineMessageBody':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6b8b('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6b8b('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6b8b('0x26');}},'notificationSound':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b8b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x28')},'verticalAlignment':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x29')},'defaultTitle':{'type':Sequelize[_0x6b8b('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6b8b('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b8b('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b8b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b8b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':_0x6b8b('0x2b')},'systemAvatar':{'type':Sequelize[_0x6b8b('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6b8b('0x8')],'defaultValue':![],'comment':_0x6b8b('0x2c'),'set':function(_0xd3395e){if(!_0xd3395e)this[_0x6b8b('0x1e')](_0x6b8b('0x2d'),null);this[_0x6b8b('0x1e')](_0x6b8b('0x2e'),_0xd3395e);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6b8b('0x1')]},'vidaooTopic':{'type':Sequelize[_0x6b8b('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x6b8b('0x1')],'defaultValue':function(){return _0x6b8b('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x6b8b('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6b8b('0xf')]}};
\ No newline at end of file
+var _0x2385=['offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','alternate','System','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','stringify','name','input','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse'];(function(_0x38bda3,_0x572484){var _0x79b88c=function(_0x27d42d){while(--_0x27d42d){_0x38bda3['push'](_0x38bda3['shift']());}};_0x79b88c(++_0x572484);}(_0x2385,0x146));var _0x5238=function(_0x807ab6,_0x36977d){_0x807ab6=_0x807ab6-0x0;var _0x44abc1=_0x2385[_0x807ab6];return _0x44abc1;};'use strict';var Sequelize=require(_0x5238('0x0'));var rs=require('randomstring');module[_0x5238('0x1')]={'name':{'type':Sequelize[_0x5238('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'unique':_0x5238('0x3')},'description':{'type':Sequelize[_0x5238('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x5')},'customerAlias':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':_0x5238('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':_0x5238('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5238('0x2')]},'animation':{'type':Sequelize[_0x5238('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x5238('0xa'),'squared'),'defaultValue':_0x5238('0xa')},'header_online':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xb')},'offline_chat_button':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xc')},'header_offline':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x5238('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5238('0xf')]},'closingQuestion':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x11')},'placeholderMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x12')},'closingMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0xc')},'skipMessageButton':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x15')},'ratingType':{'type':Sequelize[_0x5238('0x16')](_0x5238('0x17'),'thumb'),'defaultValue':_0x5238('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5238('0xf')],'defaultValue':function(){return JSON[_0x5238('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x5238('0x19'),'helpText':''}},{'type':_0x5238('0x1a'),'props':{'title':_0x5238('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x5238('0x4'),'type':_0x5238('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5238('0x1b')](_0x5238('0x1c'))?JSON['parse'](this[_0x5238('0x1b')](_0x5238('0x1c'))):{};},'set':function(_0x25a6cd){return this[_0x5238('0x1d')](_0x5238('0x1c'),JSON['stringify'](_0x25a6cd));}},'offlineForm':{'type':Sequelize[_0x5238('0xf')],'defaultValue':function(){return JSON[_0x5238('0x18')]({'items':[{'type':_0x5238('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5238('0x4'),'type':_0x5238('0x4')},'variable':null},{'type':_0x5238('0x1e'),'config':{'placeholder':_0x5238('0x1f')},'props':{'title':'Comments','helpText':_0x5238('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x5238('0x1b')]('offlineForm')?JSON[_0x5238('0x21')](this[_0x5238('0x1b')](_0x5238('0x22'))):{};},'set':function(_0x3e27d4){return this[_0x5238('0x1d')](_0x5238('0x22'),JSON[_0x5238('0x18')](_0x3e27d4));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5238('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5238('0x2')]},'forwardOffline':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x24')},'waitingMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x5238('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5238('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5238('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5238('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5238('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5238('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5238('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5238('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5238('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5238('0x2')],'defaultValue':_0x5238('0x29')},'systemAvatar':{'type':Sequelize[_0x5238('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5238('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b246d){if(!_0x1b246d)this[_0x5238('0x1d')](_0x5238('0x2a'),null);this['setDataValue'](_0x5238('0x2b'),_0x1b246d);}},'vidaooEscalation':{'type':Sequelize[_0x5238('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5238('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5238('0x2c')},'vidaooNote':{'type':Sequelize[_0x5238('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x5238('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 79e730c..475f014 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 _0x21f1=['first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','unmanaged','*,*,*,*','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','email','NotifyMailAccount','notifyMail','addInteraction','omit','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','remote','connection','referer','virtual','replace','render','alignment','verticalAlignment','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','querystring','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','UserProfileResource','name','send','index','map','ChatWebsite','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','join','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','account','applications','list','asc','CmContact','contact','headers','cf-connecting-ip','x-forwarded-for'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21f1,0x1af));var _0x121f=function(_0x237825,_0x42c680){_0x237825=_0x237825-0x0;var _0x4d5e43=_0x21f1[_0x237825];return _0x4d5e43;};'use strict';var BPromise=require(_0x121f('0x0'));var Mustache=require(_0x121f('0x1'));var util=require(_0x121f('0x2'));var path=require(_0x121f('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x121f('0x4'));var _=require('lodash');var querystring=require(_0x121f('0x5'));var Redis=require('ioredis');var qs=require(_0x121f('0x6'));var logger=require(_0x121f('0x7'))('api');var config=require(_0x121f('0x8'));var db=require('../../mysqldb')['db'];config[_0x121f('0x9')]=_[_0x121f('0xa')](config[_0x121f('0x9')],{'host':_0x121f('0xb'),'port':0x18eb});var socket=require(_0x121f('0xc'))(new Redis(config[_0x121f('0x9')]));require(_0x121f('0xd'))[_0x121f('0xe')](socket);var jayson=require(_0x121f('0xf'));var client=jayson[_0x121f('0x10')][_0x121f('0x11')]({'port':0x232c});var client9002=jayson[_0x121f('0x10')][_0x121f('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x121f('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x55fecc,_0x5c4bc5,_0x5a3151,_0x2a486f){return new BPromise(function(_0x357253,_0x59f825){var _0x529dcc=_0x2a486f||client;return _0x529dcc[_0x121f('0x12')](_0x55fecc,_0x5a3151)[_0x121f('0x13')](function(_0x4aacc2){logger[_0x121f('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x5c4bc5,'request\x20sent');logger[_0x121f('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5c4bc5,_0x121f('0x16'),JSON[_0x121f('0x17')](_0x4aacc2));if(_0x4aacc2['error']){if(_0x4aacc2[_0x121f('0x18')][_0x121f('0x19')]===0x1f4){logger[_0x121f('0x18')](_0x121f('0x1a'),_0x5c4bc5,_0x4aacc2[_0x121f('0x18')]['message']);return _0x59f825(_0x4aacc2[_0x121f('0x18')]['message']);}logger[_0x121f('0x18')](_0x121f('0x1a'),_0x5c4bc5,_0x4aacc2[_0x121f('0x18')][_0x121f('0x1b')]);return _0x357253(_0x4aacc2[_0x121f('0x18')][_0x121f('0x1b')]);}else{logger[_0x121f('0x14')](_0x121f('0x1a'),_0x5c4bc5,_0x121f('0x16'));_0x357253(_0x4aacc2[_0x121f('0x1c')]['message']);}})[_0x121f('0x1d')](function(_0x1f9b95){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5c4bc5,_0x1f9b95);_0x59f825(_0x1f9b95);});});}function respondWithStatusCode(_0x290a55,_0x49825f){_0x49825f=_0x49825f||0xcc;return function(_0x53d87c){if(_0x53d87c){return _0x290a55[_0x121f('0x1e')](_0x49825f);}return _0x290a55[_0x121f('0x1f')](_0x49825f)[_0x121f('0x20')]();};}function respondWithResult(_0x26f192,_0x1213e2){_0x1213e2=_0x1213e2||0xc8;return function(_0x24ba00){if(_0x24ba00){return _0x26f192[_0x121f('0x1f')](_0x1213e2)[_0x121f('0x21')](_0x24ba00);}};}function respondWithFilteredResult(_0x1b79c5,_0x18c8dc){return function(_0x53ad93){if(_0x53ad93){var _0x4dc1f2=typeof _0x18c8dc['offset']===_0x121f('0x22')&&typeof _0x18c8dc[_0x121f('0x23')]===_0x121f('0x22');var _0x29850d=_0x53ad93[_0x121f('0x24')];var _0x3ab4b3=_0x4dc1f2?0x0:_0x18c8dc[_0x121f('0x25')];var _0x2847dd=_0x4dc1f2?_0x53ad93[_0x121f('0x24')]:_0x18c8dc[_0x121f('0x25')]+_0x18c8dc[_0x121f('0x23')];var _0xe126ab;if(_0x2847dd>=_0x29850d){_0x2847dd=_0x29850d;_0xe126ab=0xc8;}else{_0xe126ab=0xce;}_0x1b79c5[_0x121f('0x1f')](_0xe126ab);return _0x1b79c5[_0x121f('0x26')]('Content-Range',_0x3ab4b3+'-'+_0x2847dd+'/'+_0x29850d)[_0x121f('0x21')](_0x53ad93);}return null;};}function saveUpdates(_0x3ad613){return function(_0x4d99b7){if(_0x4d99b7){return _0x4d99b7[_0x121f('0x27')](_0x3ad613)['then'](function(_0x28a792){return _0x28a792;});}return null;};}function removeEntity(_0x275964){return function(_0x321b86){if(_0x321b86){return _0x321b86[_0x121f('0x28')]()['then'](function(){var _0x3d7c54=_0x321b86['get']({'plain':!![]});var _0x250fe5='ChatWebsites';return db[_0x121f('0x29')][_0x121f('0x28')]({'where':{'type':_0x250fe5,'resourceId':_0x3d7c54['id']}})['then'](function(){return _0x321b86;});})[_0x121f('0x13')](function(){_0x275964[_0x121f('0x1f')](0xcc)[_0x121f('0x20')]();});}};}function handleEntityNotFound(_0x4d61a6){return function(_0x2cc3ff){if(!_0x2cc3ff){_0x4d61a6[_0x121f('0x1e')](0x194);}return _0x2cc3ff;};}function handleError(_0x45541c,_0x11cdd0){_0x11cdd0=_0x11cdd0||0x1f4;return function(_0x588aed){logger[_0x121f('0x18')](_0x588aed['stack']);if(_0x588aed[_0x121f('0x2a')]){delete _0x588aed[_0x121f('0x2a')];}_0x45541c['status'](_0x11cdd0)[_0x121f('0x2b')](_0x588aed);};}exports[_0x121f('0x2c')]=function(_0x5b7b15,_0x2b4604){var _0x2b6ee6={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4fd5b7={},_0x28582d={'count':0x0,'rows':[]};var _0x2f1b30=_[_0x121f('0x2d')](db[_0x121f('0x2e')][_0x121f('0x2f')],function(_0x2aed99){return{'name':_0x2aed99['fieldName'],'type':_0x2aed99['type']['key']};});_0x4fd5b7['model']=_[_0x121f('0x2d')](_0x2f1b30,_0x121f('0x2a'));_0x4fd5b7[_0x121f('0x30')]=_[_0x121f('0x31')](_0x5b7b15['query']);_0x4fd5b7[_0x121f('0x32')]=_[_0x121f('0x33')](_0x4fd5b7[_0x121f('0x34')],_0x4fd5b7[_0x121f('0x30')]);_0x2b6ee6[_0x121f('0x35')]=_['intersection'](_0x4fd5b7['model'],qs[_0x121f('0x36')](_0x5b7b15[_0x121f('0x30')][_0x121f('0x36')]));_0x2b6ee6[_0x121f('0x35')]=_0x2b6ee6['attributes'][_0x121f('0x37')]?_0x2b6ee6[_0x121f('0x35')]:_0x4fd5b7[_0x121f('0x34')];if(!_0x5b7b15['query'][_0x121f('0x38')](_0x121f('0x39'))){_0x2b6ee6[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x5b7b15[_0x121f('0x30')][_0x121f('0x23')]);_0x2b6ee6[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x5b7b15[_0x121f('0x30')][_0x121f('0x25')]);}_0x2b6ee6[_0x121f('0x3a')]=qs['sort'](_0x5b7b15[_0x121f('0x30')][_0x121f('0x3b')]);_0x2b6ee6['where']=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x5b7b15[_0x121f('0x30')],_0x4fd5b7['filters']),_0x2f1b30);if(_0x5b7b15[_0x121f('0x30')][_0x121f('0x3d')]){_0x2b6ee6['where']=_[_0x121f('0x3e')](_0x2b6ee6[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x2f1b30,function(_0x3f385e){if(_0x3f385e[_0x121f('0x40')]!==_0x121f('0x41')){var _0x278153={};_0x278153[_0x3f385e['name']]={'$like':'%'+_0x5b7b15['query'][_0x121f('0x3d')]+'%'};return _0x278153;}})});}_0x2b6ee6=_[_0x121f('0x3e')]({},_0x2b6ee6,_0x5b7b15[_0x121f('0x42')]);var _0x5dc8ce={'where':_0x2b6ee6['where']};return db[_0x121f('0x2e')][_0x121f('0x24')](_0x5dc8ce)[_0x121f('0x13')](function(_0x5aad3a){_0x28582d[_0x121f('0x24')]=_0x5aad3a;if(_0x5b7b15['query'][_0x121f('0x43')]){_0x2b6ee6[_0x121f('0x44')]=[{'all':!![]}];}return db[_0x121f('0x2e')]['findAll'](_0x2b6ee6);})[_0x121f('0x13')](function(_0x284b94){_0x28582d[_0x121f('0x45')]=_0x284b94;return _0x28582d;})[_0x121f('0x13')](respondWithFilteredResult(_0x2b4604,_0x2b6ee6))['catch'](handleError(_0x2b4604,null));};exports[_0x121f('0x46')]=function(_0x505906,_0x2bf8f3){var _0x12c2de={'raw':![],'where':{'id':_0x505906[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0x48')],'as':_0x121f('0x49')}]},_0x253f71={};_0x253f71['model']=_[_0x121f('0x31')](db[_0x121f('0x2e')][_0x121f('0x2f')]);_0x253f71[_0x121f('0x30')]=_[_0x121f('0x31')](_0x505906[_0x121f('0x30')]);_0x253f71['filters']=_[_0x121f('0x33')](_0x253f71[_0x121f('0x34')],_0x253f71[_0x121f('0x30')]);_0x12c2de[_0x121f('0x35')]=_[_0x121f('0x33')](_0x253f71['model'],qs[_0x121f('0x36')](_0x505906[_0x121f('0x30')]['fields']));_0x12c2de[_0x121f('0x35')]=_0x12c2de[_0x121f('0x35')][_0x121f('0x37')]?_0x12c2de[_0x121f('0x35')]:_0x253f71['model'];if(_0x505906[_0x121f('0x30')][_0x121f('0x43')]){_0x12c2de[_0x121f('0x44')]=[{'all':!![]}];}_0x12c2de=_[_0x121f('0x3e')]({},_0x12c2de,_0x505906['options']);return db[_0x121f('0x2e')][_0x121f('0x4a')](_0x12c2de)[_0x121f('0x13')](handleEntityNotFound(_0x2bf8f3,null))[_0x121f('0x13')](respondWithResult(_0x2bf8f3,null))[_0x121f('0x1d')](handleError(_0x2bf8f3,null));};exports[_0x121f('0x4b')]=function(_0x3fda3c,_0x354376){return db['ChatWebsite'][_0x121f('0x4b')](_0x3fda3c[_0x121f('0x4c')],{})['then'](function(_0x3555fa){var _0x268c96=_0x3fda3c[_0x121f('0x4d')][_0x121f('0x4e')]({'plain':!![]});if(!_0x268c96)throw new Error(_0x121f('0x4f'));if(_0x268c96[_0x121f('0x50')]==='user'){var _0x53bda5=_0x3555fa[_0x121f('0x4e')]({'plain':!![]});var _0x2b4c65='ChatWebsites';return db[_0x121f('0x51')][_0x121f('0x4a')]({'where':{'name':_0x2b4c65,'userProfileId':_0x268c96[_0x121f('0x52')]},'raw':!![]})[_0x121f('0x13')](function(_0x457838){if(_0x457838&&_0x457838['autoAssociation']===0x0){return db[_0x121f('0x29')][_0x121f('0x4b')]({'name':_0x53bda5[_0x121f('0x2a')],'resourceId':_0x53bda5['id'],'type':_0x457838[_0x121f('0x2a')],'sectionId':_0x457838['id']},{})[_0x121f('0x13')](function(){return _0x3555fa;});}else{return _0x3555fa;}})['catch'](function(_0x178e20){logger[_0x121f('0x18')](_0x121f('0x53'),_0x178e20);throw _0x178e20;});}return _0x3555fa;})[_0x121f('0x13')](respondWithResult(_0x354376,0xc9))[_0x121f('0x1d')](handleError(_0x354376,null));};exports['update']=function(_0x3e6b3d,_0xcb5779){if(_0x3e6b3d[_0x121f('0x4c')]['id']){delete _0x3e6b3d['body']['id'];}return db[_0x121f('0x2e')]['find']({'where':{'id':_0x3e6b3d[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0x48')],'as':_0x121f('0x49')}]})['then'](handleEntityNotFound(_0xcb5779,null))[_0x121f('0x13')](saveUpdates(_0x3e6b3d[_0x121f('0x4c')],null))[_0x121f('0x13')](respondWithResult(_0xcb5779,null))['catch'](handleError(_0xcb5779,null));};exports[_0x121f('0x28')]=function(_0x1d7eb1,_0x510913){return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1d7eb1[_0x121f('0x47')]['id']}})['then'](handleEntityNotFound(_0x510913,null))[_0x121f('0x13')](removeEntity(_0x510913,null))[_0x121f('0x1d')](handleError(_0x510913,null));};exports['describe']=function(_0x5ceeff,_0x2903b6){return db[_0x121f('0x2e')][_0x121f('0x54')]()[_0x121f('0x13')](respondWithResult(_0x2903b6,null))[_0x121f('0x1d')](handleError(_0x2903b6,null));};exports['addDisposition']=function(_0x24242e,_0x35a9f4){if(_0x24242e[_0x121f('0x4c')]['id']){delete _0x24242e[_0x121f('0x4c')]['id'];}return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x24242e[_0x121f('0x47')]['id']}})['then'](handleEntityNotFound(_0x35a9f4,null))[_0x121f('0x13')](function(_0x3550bd){if(_0x3550bd){_0x24242e[_0x121f('0x4c')]['ChatWebsiteId']=_0x3550bd['id'];return db['Disposition'][_0x121f('0x4b')](_0x24242e[_0x121f('0x4c')]);}})[_0x121f('0x13')](respondWithResult(_0x35a9f4,null))[_0x121f('0x1d')](handleError(_0x35a9f4,null));};exports[_0x121f('0x55')]=function(_0x558a54,_0x5d6450){var _0xcd0986={'raw':![],'where':{}};var _0x109b53={};var _0x59aa03={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x558a54[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5d6450,null))[_0x121f('0x13')](function(_0x595a9e){if(_0x595a9e){_0x109b53[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x57')]['rawAttributes']);_0x109b53['query']=_['keys'](_0x558a54[_0x121f('0x30')]);_0x109b53[_0x121f('0x32')]=_[_0x121f('0x33')](_0x109b53[_0x121f('0x34')],_0x109b53[_0x121f('0x30')]);_0xcd0986['attributes']=_[_0x121f('0x33')](_0x109b53[_0x121f('0x34')],qs[_0x121f('0x36')](_0x558a54[_0x121f('0x30')][_0x121f('0x36')]));_0xcd0986[_0x121f('0x35')]=_0xcd0986['attributes']['length']?_0xcd0986[_0x121f('0x35')]:_0x109b53['model'];if(!_0x558a54[_0x121f('0x30')][_0x121f('0x38')]('nolimit')){_0xcd0986[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x558a54[_0x121f('0x30')][_0x121f('0x23')]);_0xcd0986[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x558a54['query'][_0x121f('0x25')]);}_0xcd0986[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x558a54['query']['sort']);_0xcd0986[_0x121f('0x3f')]=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x558a54[_0x121f('0x30')],_0x109b53[_0x121f('0x32')]));_0xcd0986[_0x121f('0x3f')]['ChatWebsiteId']=_0x595a9e['id'];if(_0x558a54[_0x121f('0x30')][_0x121f('0x3d')]){_0xcd0986[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0xcd0986['where'],{'$or':_[_0x121f('0x2d')](_0xcd0986[_0x121f('0x35')],function(_0x246903){var _0x30e17b={};_0x30e17b[_0x246903]={'$like':'%'+_0x558a54[_0x121f('0x30')][_0x121f('0x3d')]+'%'};return _0x30e17b;})});}_0xcd0986=_['merge']({},_0xcd0986,_0x558a54[_0x121f('0x42')]);return db[_0x121f('0x57')][_0x121f('0x24')]({'where':_0xcd0986[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x38c49d){_0x59aa03[_0x121f('0x24')]=_0x38c49d;if(_0x558a54[_0x121f('0x30')][_0x121f('0x43')]){_0xcd0986['include']=[{'all':!![]}];}return db[_0x121f('0x57')][_0x121f('0x58')](_0xcd0986);})[_0x121f('0x13')](function(_0x761fd9){_0x59aa03[_0x121f('0x45')]=_0x761fd9;return _0x59aa03;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x5d6450,_0xcd0986))[_0x121f('0x1d')](handleError(_0x5d6450,null));};exports[_0x121f('0x59')]=function(_0x1af2df,_0x3d5795){return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x1af2df['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x3d5795,null))['then'](function(_0x3cb44c){if(_0x3cb44c){return _0x3cb44c['removeDispositions'](_0x1af2df[_0x121f('0x30')][_0x121f('0x5a')]);}})[_0x121f('0x13')](respondWithStatusCode(_0x3d5795,null))[_0x121f('0x1d')](handleError(_0x3d5795,null));};exports[_0x121f('0x5b')]=function(_0x1df841,_0x160b8b){if(_0x1df841[_0x121f('0x4c')]['id']){delete _0x1df841['body']['id'];}return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1df841[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x160b8b,null))['then'](function(_0xf4266){if(_0xf4266){_0x1df841[_0x121f('0x4c')][_0x121f('0x5c')]=_0xf4266['id'];return db[_0x121f('0x5d')][_0x121f('0x4b')](_0x1df841[_0x121f('0x4c')]);}})[_0x121f('0x13')](respondWithResult(_0x160b8b,null))[_0x121f('0x1d')](handleError(_0x160b8b,null));};exports[_0x121f('0x5e')]=function(_0x51a6c0,_0x5939c7){var _0x1a3b57={'raw':![],'where':{}};var _0x12c12e={};var _0x58ca5a={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x51a6c0[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5939c7,null))['then'](function(_0x41e9f3){if(_0x41e9f3){_0x12c12e[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x5d')][_0x121f('0x2f')]);_0x12c12e[_0x121f('0x30')]=_[_0x121f('0x31')](_0x51a6c0[_0x121f('0x30')]);_0x12c12e[_0x121f('0x32')]=_[_0x121f('0x33')](_0x12c12e[_0x121f('0x34')],_0x12c12e[_0x121f('0x30')]);_0x1a3b57[_0x121f('0x35')]=_[_0x121f('0x33')](_0x12c12e[_0x121f('0x34')],qs[_0x121f('0x36')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x36')]));_0x1a3b57[_0x121f('0x35')]=_0x1a3b57[_0x121f('0x35')]['length']?_0x1a3b57[_0x121f('0x35')]:_0x12c12e[_0x121f('0x34')];if(!_0x51a6c0[_0x121f('0x30')][_0x121f('0x38')](_0x121f('0x39'))){_0x1a3b57[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x23')]);_0x1a3b57['offset']=qs[_0x121f('0x25')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x25')]);}_0x1a3b57[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x51a6c0[_0x121f('0x30')][_0x121f('0x3b')]);_0x1a3b57[_0x121f('0x3f')]=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x51a6c0[_0x121f('0x30')],_0x12c12e[_0x121f('0x32')]));_0x1a3b57[_0x121f('0x3f')][_0x121f('0x5c')]=_0x41e9f3['id'];if(_0x51a6c0[_0x121f('0x30')][_0x121f('0x3d')]){_0x1a3b57[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x1a3b57[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x1a3b57[_0x121f('0x35')],function(_0x59678b){var _0x1eface={};_0x1eface[_0x59678b]={'$like':'%'+_0x51a6c0['query'][_0x121f('0x3d')]+'%'};return _0x1eface;})});}_0x1a3b57=_[_0x121f('0x3e')]({},_0x1a3b57,_0x51a6c0[_0x121f('0x42')]);return db[_0x121f('0x5d')][_0x121f('0x24')]({'where':_0x1a3b57[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x168773){_0x58ca5a['count']=_0x168773;if(_0x51a6c0[_0x121f('0x30')][_0x121f('0x43')]){_0x1a3b57[_0x121f('0x44')]=[{'all':!![]}];}return db[_0x121f('0x5d')][_0x121f('0x58')](_0x1a3b57);})[_0x121f('0x13')](function(_0x526d4a){_0x58ca5a[_0x121f('0x45')]=_0x526d4a;return _0x58ca5a;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x5939c7,_0x1a3b57))[_0x121f('0x1d')](handleError(_0x5939c7,null));};exports[_0x121f('0x5f')]=function(_0x407457,_0x59b4d8){return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x407457[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x59b4d8,null))[_0x121f('0x13')](function(_0x24468b){if(_0x24468b){return _0x24468b[_0x121f('0x5f')](_0x407457[_0x121f('0x30')][_0x121f('0x5a')]);}})[_0x121f('0x13')](respondWithStatusCode(_0x59b4d8,null))['catch'](handleError(_0x59b4d8,null));};exports['addLogo']=function(_0x5a8dcf,_0x2224f6){_0x5a8dcf[_0x121f('0x4c')][_0x121f('0x60')]=_0x5a8dcf[_0x121f('0x61')][_0x121f('0x62')];return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x5a8dcf[_0x121f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2224f6,null))[_0x121f('0x13')](saveUpdates(_0x5a8dcf['body'],null))[_0x121f('0x13')](respondWithResult(_0x2224f6,null))[_0x121f('0x1d')](handleError(_0x2224f6,null));};exports[_0x121f('0x63')]=function(_0x599b99,_0x4fd96d){_0x599b99[_0x121f('0x4c')][_0x121f('0x64')]=_0x599b99[_0x121f('0x61')][_0x121f('0x62')];return db['ChatWebsite']['find']({'where':{'id':_0x599b99['params']['id']}})['then'](handleEntityNotFound(_0x4fd96d,null))['then'](saveUpdates(_0x599b99[_0x121f('0x4c')],null))[_0x121f('0x13')](respondWithResult(_0x4fd96d,null))['catch'](handleError(_0x4fd96d,null));};exports[_0x121f('0x65')]=function(_0x1d629b,_0x4ed245){_0x1d629b[_0x121f('0x4c')][_0x121f('0x66')]=_0x1d629b[_0x121f('0x61')][_0x121f('0x62')];return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1d629b[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x4ed245,null))[_0x121f('0x13')](saveUpdates(_0x1d629b[_0x121f('0x4c')],null))['then'](respondWithResult(_0x4ed245,null))[_0x121f('0x1d')](handleError(_0x4ed245,null));};exports['addSystemAvatar']=function(_0x2a0e5e,_0x12b4f7){_0x2a0e5e[_0x121f('0x4c')][_0x121f('0x67')]=_0x2a0e5e['file'][_0x121f('0x62')];return db['ChatWebsite'][_0x121f('0x4a')]({'where':{'id':_0x2a0e5e['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x12b4f7,null))[_0x121f('0x13')](saveUpdates(_0x2a0e5e[_0x121f('0x4c')],null))[_0x121f('0x13')](respondWithResult(_0x12b4f7,null))['catch'](handleError(_0x12b4f7,null));};exports[_0x121f('0x68')]=function(_0x101baa,_0x2e5735){var _0x267384=path['join'](config[_0x121f('0x69')],_0x121f('0x6a'));var _0x1da8c6={'where':{'id':_0x101baa[_0x121f('0x47')]['id']},'attributes':['id',_0x121f('0x60')],'raw':!![]};var _0x4c1c6b=![];return require(_0x121f('0x6b'))[_0x121f('0x6c')]()[_0x121f('0x13')](function(_0x4fd44f){if(_0x4fd44f){_0x4c1c6b=_0x4fd44f[_0x121f('0x6d')];}})[_0x121f('0x13')](function(){return db[_0x121f('0x2e')]['find'](_0x1da8c6);})['then'](handleEntityNotFound(_0x2e5735,null))[_0x121f('0x13')](function(_0x1f9530){if(_0x1f9530){if(!_['isNil'](_0x1f9530[_0x121f('0x60')])){if(fs[_0x121f('0x6e')](path['join'](config[_0x121f('0x69')],'server/files/images/logos/',_0x1f9530[_0x121f('0x60')]))&&_0x4c1c6b){_0x267384=path['join'](config[_0x121f('0x69')],_0x121f('0x6f'),_0x1f9530['sitepic']);}}return _0x2e5735[_0x121f('0x70')](_0x267384);}})[_0x121f('0x1d')](handleError(_0x2e5735,null));};exports[_0x121f('0x71')]=function(_0x1e2c8a,_0x3c433d){var _0x3d4499=path['join'](config[_0x121f('0x69')],_0x121f('0x72'));var _0x57f2e0={'where':{'id':_0x1e2c8a[_0x121f('0x47')]['id']},'attributes':['id',_0x121f('0x64')],'raw':!![]};return db[_0x121f('0x2e')][_0x121f('0x4a')](_0x57f2e0)[_0x121f('0x13')](handleEntityNotFound(_0x3c433d,null))[_0x121f('0x13')](function(_0x21f7a7){if(_0x21f7a7){if(!_['isNil'](_0x21f7a7['agentAvatar'])){if(fs[_0x121f('0x6e')](path['join'](config[_0x121f('0x69')],_0x121f('0x73'),_0x21f7a7[_0x121f('0x64')]))){_0x3d4499=path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x21f7a7[_0x121f('0x64')]);}}return _0x3c433d[_0x121f('0x70')](_0x3d4499);}})[_0x121f('0x1d')](handleError(_0x3c433d,null));};exports[_0x121f('0x75')]=function(_0x36a6ea,_0x4bce04){var _0x497a5f=path['join'](config['root'],_0x121f('0x76'));var _0xec72d={'where':{'id':_0x36a6ea[_0x121f('0x47')]['id']},'attributes':['id',_0x121f('0x66'),_0x121f('0x77')],'raw':!![]};return db[_0x121f('0x2e')][_0x121f('0x4a')](_0xec72d)[_0x121f('0x13')](handleEntityNotFound(_0x4bce04,null))[_0x121f('0x13')](function(_0x26b4f7){if(_0x26b4f7){if(!_[_0x121f('0x78')](_0x26b4f7[_0x121f('0x66')])){if(fs['existsSync'](path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x26b4f7[_0x121f('0x66')]))&&_0x26b4f7['showCustomerAvatar']){_0x497a5f=path[_0x121f('0x74')](config['root'],_0x121f('0x73'),_0x26b4f7['customerAvatar']);}}return _0x4bce04[_0x121f('0x70')](_0x497a5f);}})[_0x121f('0x1d')](handleError(_0x4bce04,null));};exports['getSystemAvatar']=function(_0x266fda,_0x40f474){var _0x297405=path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x79'));var _0x164338={'where':{'id':_0x266fda['params']['id']},'attributes':['id',_0x121f('0x67')],'raw':!![]};return db[_0x121f('0x2e')][_0x121f('0x4a')](_0x164338)['then'](handleEntityNotFound(_0x40f474,null))[_0x121f('0x13')](function(_0x2ea273){if(_0x2ea273){if(!_[_0x121f('0x78')](_0x2ea273[_0x121f('0x67')])){if(fs[_0x121f('0x6e')](path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x2ea273[_0x121f('0x67')]))){_0x297405=path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0x73'),_0x2ea273[_0x121f('0x67')]);}}return _0x40f474['download'](_0x297405);}})['catch'](handleError(_0x40f474,null));};exports['notify']=function(_0x1c7329,_0x117dd8){var _0x34bbf9=require(_0x121f('0x7a'));var _0x4ed956=new _0x34bbf9();var _0x5a92cc=_0x4ed956[_0x121f('0x7b')](_0x1c7329['headers'][_0x121f('0x7c')])[_0x121f('0x7d')]();var _0x313cf2={'body':_0x1c7329[_0x121f('0x4c')],'channel':_0x121f('0x7e')};var _0x528587=[];var _0x15d63d=[];var _0x12a95a={};var _0x3f2ed2=![];return db['CmContact']['describe']()[_0x121f('0x13')](function(_0x44fef4){if(!_0x44fef4){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x80'));}_0x528587=_[_0x121f('0x81')](_[_0x121f('0x31')](_0x44fef4),[_0x121f('0x82'),_0x121f('0x83')]);_0x15d63d=_[_0x121f('0x81')](_[_0x121f('0x31')](_0x44fef4),[_0x121f('0x82'),_0x121f('0x83'),_0x121f('0x84'),_0x121f('0x85')]);if(_0x1c7329['body']['id']){delete _0x1c7329[_0x121f('0x4c')]['id'];}if(_[_0x121f('0x78')](_0x1c7329[_0x121f('0x4c')][_0x121f('0x86')])){throw new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0x88'));}if(_[_0x121f('0x78')](_0x1c7329[_0x121f('0x4c')][_0x121f('0x4c')])||_0x1c7329[_0x121f('0x4c')][_0x121f('0x4c')]===''){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x89'));}if(_[_0x121f('0x78')](_0x1c7329[_0x121f('0x4c')][_0x121f('0x8a')])){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x8b')+_0x15d63d);}if(!_[_0x121f('0x8c')](_0x15d63d,_0x1c7329[_0x121f('0x4c')][_0x121f('0x8a')])){throw new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0x8d')+_0x15d63d);}_0x12a95a[_0x1c7329[_0x121f('0x4c')][_0x121f('0x8a')]]=_0x1c7329[_0x121f('0x4c')]['from'];})[_0x121f('0x13')](function(){return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x1c7329[_0x121f('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x121f('0x8e'),'include':[{'model':db['CmContact'],'as':_0x121f('0x8f'),'where':_0x12a95a,'limit':0x1,'order':[[_0x121f('0x83'),'DESC']]}]},{'model':db[_0x121f('0x90')],'as':_0x121f('0x91')}]});})[_0x121f('0x13')](handleEntityNotFound(_0x117dd8,null))[_0x121f('0x13')](function(_0x304343){if(_0x304343&&_0x304343['List']){_0x313cf2[_0x121f('0x92')]=_0x304343;_0x313cf2[_0x121f('0x93')]=_0x304343[_0x121f('0x91')];_0x313cf2[_0x121f('0x94')]=_0x304343[_0x121f('0x8e')];_0x313cf2[_0x121f('0x93')]=_['orderBy'](_0x313cf2[_0x121f('0x93')],['priority'],[_0x121f('0x95')]);if(_0x313cf2[_0x121f('0x92')][_0x121f('0x91')]){delete _0x313cf2[_0x121f('0x92')][_0x121f('0x91')];}if(_0x313cf2[_0x121f('0x92')]['List']&&_0x313cf2[_0x121f('0x92')][_0x121f('0x8e')][_0x121f('0x8f')][_0x121f('0x37')]){return _0x313cf2[_0x121f('0x92')][_0x121f('0x8e')][_0x121f('0x8f')][0x0];}var _0x27f550=_['defaults'](_0x1c7329[_0x121f('0x4c')],{'firstName':_0x1c7329[_0x121f('0x4c')][_0x121f('0x86')],'ListId':_0x304343[_0x121f('0x85')]});_0x27f550[_0x1c7329['body'][_0x121f('0x8a')]]=_0x1c7329[_0x121f('0x4c')]['from'];return db[_0x121f('0x96')]['create'](_0x27f550,{'fields':_0x528587,'raw':!![]});}})[_0x121f('0x13')](handleEntityNotFound(_0x117dd8,null))['then'](function(_0x47d2ee){_0x313cf2[_0x121f('0x97')]=_0x47d2ee;var _0x1428ce=_0x1c7329[_0x121f('0x4c')]['customerIp'];if(_0x1c7329[_0x121f('0x98')][_0x121f('0x99')]){_0x1428ce=_0x1c7329['headers'][_0x121f('0x99')];}else if(_0x1c7329['headers'][_0x121f('0x9a')]){_0x1428ce=_[_0x121f('0x9b')](_0x1c7329[_0x121f('0x98')][_0x121f('0x9a')][_0x121f('0x9c')](','));}if(_0x47d2ee){var _0x4862d8={'ContactId':_0x47d2ee['id'],'ChatWebsiteId':_0x1c7329[_0x121f('0x47')]['id'],'from':(_0x47d2ee[_0x121f('0x9d')]||'')+'\x20'+(_0x47d2ee[_0x121f('0x9e')]||''),'customerIp':_0x1428ce,'customerPort':_0x1c7329[_0x121f('0x98')]['x-real-port']?_0x1c7329['headers'][_0x121f('0x9f')]:null,'referer':_0x1c7329[_0x121f('0x4c')]['referer'],'browserName':_0x5a92cc[_0x121f('0xa0')][_0x121f('0x2a')]&&_0x5a92cc[_0x121f('0xa0')][_0x121f('0xa1')]?util[_0x121f('0xa2')](_0x121f('0xa3'),_0x5a92cc['browser'][_0x121f('0x2a')],_0x5a92cc[_0x121f('0xa0')][_0x121f('0xa1')]):_0x121f('0xa4'),'browserVersion':_0x5a92cc[_0x121f('0xa0')][_0x121f('0xa1')]||'unknown','osName':util[_0x121f('0xa2')](_0x121f('0xa3'),_0x5a92cc['os'][_0x121f('0x2a')],_0x5a92cc['os']['version']),'osVersion':_0x5a92cc['os'][_0x121f('0xa1')],'deviceModel':_0x5a92cc[_0x121f('0xa5')][_0x121f('0x34')]&&_0x5a92cc[_0x121f('0xa5')]['vendor']?util[_0x121f('0xa2')](_0x121f('0xa6'),_0x5a92cc['device']['model'],_0x5a92cc[_0x121f('0xa5')]['vendor'],_0x5a92cc[_0x121f('0xa5')][_0x121f('0x40')]):null,'deviceVendor':_0x5a92cc[_0x121f('0xa5')][_0x121f('0xa7')],'deviceType':_0x5a92cc[_0x121f('0xa5')]['type'],'formData':JSON[_0x121f('0x17')](_0x1c7329['body'])};var _0x446b9d={'ChatWebsiteId':_0x1c7329[_0x121f('0x47')]['id'],'closed':![]};if(_0x1c7329[_0x121f('0x4c')][_0x121f('0xa8')]){_0x446b9d[_0x121f('0xa8')]=_0x1c7329[_0x121f('0x4c')]['threadId'];return db[_0x121f('0xa9')]['find']({'where':_0x446b9d})[_0x121f('0x13')](function(_0x388022){if(_0x388022){return[_0x388022,![]];}_0x4862d8[_0x121f('0xa8')]=_0x1c7329[_0x121f('0x4c')]['threadId'];_0x4862d8['externalUrl']=_0x1c7329[_0x121f('0x4c')][_0x121f('0xaa')];return db['ChatInteraction']['create'](_0x4862d8)[_0x121f('0x13')](function(_0x3dde49){return[_0x3dde49,!![]];});});}_0x446b9d[_0x121f('0xab')]=_0x47d2ee['id'];if(_0x1c7329[_0x121f('0x4c')]['interaction']&&_0x1c7329[_0x121f('0x4c')][_0x121f('0xac')]['id']){_0x446b9d['id']=_0x1c7329[_0x121f('0x4c')][_0x121f('0xac')]['id'];return db[_0x121f('0xa9')][_0x121f('0x4a')]({'where':_0x446b9d})[_0x121f('0x13')](function(_0x13126e){if(_0x13126e){return[_0x13126e,![]];}return db[_0x121f('0xa9')][_0x121f('0x4b')](_0x4862d8)['then'](function(_0x320bd9){return[_0x320bd9,!![]];});});}return db[_0x121f('0xa9')][_0x121f('0x4b')](_0x4862d8)[_0x121f('0x13')](function(_0x27f779){return[_0x27f779,!![]];});}})[_0x121f('0xad')](function(_0x4a45c,_0x20a1b6){if(_0x4a45c){_0x3f2ed2=_0x20a1b6;if(!_0x20a1b6){var _0x2dfc6b={'from':(_0x313cf2[_0x121f('0x97')][_0x121f('0x9d')]||'')+'\x20'+(_0x313cf2[_0x121f('0x97')][_0x121f('0x9e')]||'')};if(_0x1c7329[_0x121f('0x4c')]['threadId']&&_0x1c7329['body'][_0x121f('0xae')]&&_0x1c7329[_0x121f('0x4c')][_0x121f('0xa8')]!=_0x1c7329[_0x121f('0x4c')][_0x121f('0xae')]){_0x2dfc6b[_0x121f('0xa8')]=_0x1c7329['body']['messageId'];}return _0x4a45c['update'](_0x2dfc6b);}else{return _0x4a45c;}}})[_0x121f('0x13')](function(_0x1c0224){_0x313cf2[_0x121f('0xac')]=_0x1c0224[_0x121f('0x4e')]({'plain':!![]});_0x313cf2[_0x121f('0xac')][_0x121f('0xaf')]=_0x3f2ed2;if(_0x313cf2[_0x121f('0xac')]['created']){if(_0x313cf2[_0x121f('0x92')]['autoclose']){_0x313cf2[_0x121f('0x93')][_0x121f('0xb0')]({'id':0x0,'priority':_0x313cf2[_0x121f('0x93')]['length']+0x1,'app':'close','appdata':_0x121f('0xb1'),'interval':_0x121f('0xb2')});}}return db['ChatMessage']['create']({'body':_0x1c7329[_0x121f('0x4c')][_0x121f('0x4c')],'ChatWebsiteId':_0x1c7329[_0x121f('0x47')]['id'],'ChatInteractionId':_0x1c0224['id'],'direction':'in','ContactId':_0x313cf2[_0x121f('0x97')]['id'],'AttachmentId':_0x1c7329[_0x121f('0x4c')]['AttachmentId']});})[_0x121f('0x13')](function(_0x1c5a1d){_0x313cf2['message']=_0x1c5a1d;if(_0x313cf2[_0x121f('0xac')][_0x121f('0xb3')]){return db[_0x121f('0xb4')][_0x121f('0x4a')]({'attributes':['id',_0x121f('0x2a')],'where':{'id':_0x313cf2[_0x121f('0xac')][_0x121f('0xb3')]}})[_0x121f('0x13')](function(_0x5d9241){if(_0x5d9241){_0x313cf2[_0x121f('0x93')][_0x121f('0xb5')]({'id':0x0,'priority':0x0,'app':_0x121f('0xb6'),'appdata':_0x5d9241[_0x121f('0x2a')]+','+(_0x313cf2['account']['waitForTheAssignedAgent']||0xa),'interval':_0x121f('0xb2')});_0x313cf2[_0x121f('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x313cf2);});}return respondWithRpcPromise(_0x121f('0xb8'),_0x121f('0xb9'),_0x313cf2);})[_0x121f('0x13')](function(_0x7b4ef4){respondWithRpcPromise('EventManager',_0x121f('0xba'),{'event':_0x121f('0xbb'),'message':_0x7b4ef4},client9002);return _0x7b4ef4;})[_0x121f('0x13')](respondWithResult(_0x117dd8,null))[_0x121f('0x1d')](handleError(_0x117dd8,null));};exports[_0x121f('0xbc')]=function(_0x2040c6,_0x2eabb2){var _0x48c964,_0x13750b,_0x1ae0b6;var _0xccb226=[];var _0x595cf4={};var _0x24a1c7=_0x2040c6[_0x121f('0xbd')]||[];var _0x4698be=[];var _0x326e4b;return db['CmContact'][_0x121f('0x54')]()[_0x121f('0x13')](function(_0x2d5e38){if(!_0x2d5e38){throw new db['Sequelize'][(_0x121f('0x7f'))](_0x121f('0x80'));}_0xccb226=_[_0x121f('0x81')](_[_0x121f('0x31')](_0x2d5e38),['createdAt','updatedAt',_0x121f('0x84'),_0x121f('0x85')]);if(_0x2040c6['body']['id']){delete _0x2040c6['body']['id'];}if(_[_0x121f('0x78')](_0x2040c6[_0x121f('0x4c')]['from'])){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0x88')));}if(_[_0x121f('0x78')](_0x2040c6[_0x121f('0x4c')][_0x121f('0x4c')])||_0x2040c6[_0x121f('0x4c')][_0x121f('0x4c')]===''){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db['Sequelize']['ValidationError'](_0x121f('0x89')));}if(_['isNil'](_0x2040c6[_0x121f('0x4c')]['mapKeyOffline'])){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db[(_0x121f('0x87'))]['ValidationError'](_0x121f('0xbe')+_0xccb226));}if(!_[_0x121f('0x8c')](_0xccb226,_0x2040c6[_0x121f('0x4c')][_0x121f('0xbf')])){throw _0x2eabb2[_0x121f('0x1f')](0x1f4)[_0x121f('0x2b')](new db[(_0x121f('0x87'))][(_0x121f('0x7f'))](_0x121f('0xc0')+_0xccb226));}_0x595cf4[_0x2040c6[_0x121f('0x4c')][_0x121f('0xbf')]]=_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')];})[_0x121f('0x13')](function(){return db[_0x121f('0x2e')]['find']({'where':{'id':_0x2040c6[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0xc1')],'as':_0x121f('0x8e')},{'model':db['MailAccount'],'as':_0x121f('0xc2')}]});})[_0x121f('0x13')](handleEntityNotFound(_0x2eabb2,null))[_0x121f('0x13')](function(_0xe2325c){if(_0xe2325c&&_0xe2325c[_0x121f('0x8e')]){_0x13750b=_0xe2325c;var _0x38d5f4=_[_0x121f('0xa')](_0x2040c6[_0x121f('0x4c')],{'firstName':_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')],'phone':_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')],'ListId':_0xe2325c[_0x121f('0x85')]});_0x38d5f4[_0x2040c6['body'][_0x121f('0xbf')]]=_0x2040c6[_0x121f('0x4c')][_0x121f('0x86')];return db[_0x121f('0x96')]['findOrCreate']({'where':_0x595cf4,'defaults':_0x38d5f4});}})['spread'](function(_0x580af6){if(_0x580af6){_0x1ae0b6=_0x580af6;var _0x4584ef=fs[_0x121f('0xc3')](path[_0x121f('0x74')](config[_0x121f('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0x121f('0xc4'));var _0xadeabd=ejs['render'](_0x4584ef,{'body':_[_0x121f('0xc5')](_0x2040c6[_0x121f('0x4c')]['body']),'bodyTitle':_0x13750b['offlineMessageBody']});return db[_0x121f('0xc6')][_0x121f('0x4b')]({'body':_0xadeabd,'ContactId':_0x580af6['id'],'ChatWebsiteId':_0x13750b['id']});}})[_0x121f('0x13')](function(_0x3046c0){_0x326e4b=_0x3046c0;if(_0x24a1c7[_0x121f('0x37')]){var _0x2b555f=_0x24a1c7[_0x121f('0x2d')](function(_0x395716){return{'name':_0x395716[_0x121f('0xc7')],'basename':_0x395716[_0x121f('0x62')],'type':_0x395716[_0x121f('0xc8')],'ChatOfflineMessageId':_0x3046c0['id']};});_0x4698be=_0x2b555f['map'](_0x2eb5cc=>{var _0x1f3c8d={'filename':_0x2eb5cc[_0x121f('0x2a')],'path':path[_0x121f('0x74')](config[_0x121f('0x69')],_0x121f('0xc9'),_0x121f('0xbd'),_0x121f('0xca'),_0x121f('0xcb'),_0x2eb5cc[_0x121f('0xcc')])};return _0x1f3c8d;});if(!_0x13750b[_0x121f('0xcd')]){return db[_0x121f('0xce')][_0x121f('0xcf')](function(_0x5c5cd7){return db['Attachment']['bulkCreate'](_0x2b555f,{'transaction':_0x5c5cd7});});}}})[_0x121f('0x13')](function(){if(_0x326e4b){_0x48c964=_0x326e4b;return db['MailAccount'][_0x121f('0x56')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x121f('0x13')](function(_0x540063){if(_0x540063&&_0x540063[_0x121f('0xd0')]&&_0x13750b['forwardOffline']&&_0x13750b[_0x121f('0xd1')]){var _0x2b7036={'tls':{'rejectUnauthorized':![]}};if(_0x540063[_0x121f('0xd0')][_0x121f('0xd2')]){_0x2b7036[_0x121f('0xd2')]=_0x540063[_0x121f('0xd0')][_0x121f('0xd2')];}else{_0x2b7036[_0x121f('0xd3')]=_0x540063[_0x121f('0xd0')][_0x121f('0xd3')];_0x2b7036[_0x121f('0xd4')]=_0x540063['Smtp'][_0x121f('0xd4')];_0x2b7036[_0x121f('0xd5')]=_0x540063[_0x121f('0xd0')]['secure'];}if(_0x540063[_0x121f('0xd0')][_0x121f('0xd6')]){_0x2b7036['auth']={'user':_0x540063[_0x121f('0xd0')][_0x121f('0x4d')],'pass':_0x540063[_0x121f('0xd0')][_0x121f('0xd7')]};}return respondWithRpcPromise(_0x121f('0xd8'),_0x121f('0xd9'),{'account':_0x2b7036,'message':{'from':util['format'](_0x121f('0xda'),_0x540063[_0x121f('0x2a')],_0x540063['email']||_0x540063['Smtp'][_0x121f('0x4d')]),'to':_0x13750b[_0x121f('0xd1')],'subject':_0x13750b[_0x121f('0xdb')],'html':_0x48c964['body'],'attachments':_0x4698be}},client9003)[_0x121f('0x13')](function(){return _0x48c964;})['catch'](function(_0x483679){console[_0x121f('0x18')](_0x483679);});}})[_0x121f('0x13')](function(){if(_0x13750b&&_0x13750b[_0x121f('0xcd')]&&_0x13750b[_0x121f('0xdc')]){var _0x1b11f4=[];if(_0x24a1c7['length']){_0x1b11f4=_0x24a1c7[_0x121f('0x2d')](function(_0x398d06){return{'name':_0x398d06[_0x121f('0xc7')],'basename':_0x398d06['filename'],'type':_0x398d06[_0x121f('0xc8')],'ChatOfflineMessageId':_0x326e4b['id']};});}var _0x37fb78;if(!_['isNil'](_0x13750b[_0x121f('0xdd')])){var _0x2b8bf8=_[_0x121f('0x2d')](_0x2040c6[_0x121f('0x4c')],function(_0x5f5083){return _0x5f5083;});var _0x4c1954=_[_0x121f('0xde')](_0x2b8bf8)[0x0];var _0x3e8b38=_['mapValues'](_0x4c1954,function(_0x24aa8b){return _0x24aa8b;});_0x37fb78=_0x3e8b38[0x1][_0x13750b[_0x121f('0xdd')]];}var _0x88a05a={'from':_0x1ae0b6[_0x121f('0xdf')],'firstName':_0x1ae0b6[_0x121f('0x9d')],'lastName':_0x1ae0b6['lastName'],'mapKey':'email','message':{'from':_0x1ae0b6[_0x121f('0xdf')],'to':_0x13750b[_0x121f('0xc2')][_0x121f('0xdf')],'cc':'','subject':_['isNil'](_0x37fb78)?_0x13750b[_0x121f('0xdb')]:_0x37fb78,'messageId':'','sentAt':new Date(),'attach':_0x1b11f4[_0x121f('0x37')],'attachments':_0x1b11f4,'originChannel':'Chat','ChatWebsiteId':_0x13750b['id'],'ChatOfflineMessageId':_0x48c964['id'],'originTo':_0x13750b[_0x121f('0xc2')][_0x121f('0xdf')]},'body':_0x48c964[_0x121f('0x4c')]};var _0x23fd64={'account':{'id':_0x13750b[_0x121f('0xdc')]},'body':_0x88a05a,'log':_0x121f('0xe0')};return respondWithRpcPromise(_0x121f('0xe0'),_0x121f('0xe1'),_0x23fd64,client9001)[_0x121f('0x13')](function(){return _0x48c964;})['catch'](function(_0x5b91ba){console[_0x121f('0x18')](_0x5b91ba);});}return;})[_0x121f('0x13')](function(){if(_0x48c964){return _0x48c964;}})[_0x121f('0x13')](respondWithResult(_0x2eabb2,null))['catch'](function(_0x36fa49){console['error']('catch',_0x36fa49);for(var _0x595c09 of _0x24a1c7){var _0xca9eee=path['join'](config[_0x121f('0x69')],_0x121f('0xc9'),'files','attachments',_0x121f('0xcb'),_0x595c09['filename']);fs_extra['remove'](_0xca9eee)['catch'](function(_0x42a33e){console[_0x121f('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0xca9eee,_0x42a33e);});}});};exports[_0x121f('0xe2')]=function(_0x6ac209,_0x39f201){return db[_0x121f('0xa9')][_0x121f('0x4a')]({'where':{'id':_0x6ac209[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x39f201,null))[_0x121f('0x13')](function(_0xfa6885){if(_0xfa6885){return _0xfa6885[_0x121f('0xe2')](_0x6ac209[_0x121f('0x4c')][_0x121f('0x5a')],_[_0x121f('0xe3')](_0x6ac209[_0x121f('0x4c')],[_0x121f('0x5a'),'id'])||{});}})[_0x121f('0x13')](respondWithResult(_0x39f201,null))[_0x121f('0x1d')](handleError(_0x39f201,null));};exports['getInteractions']=function(_0x54e08a,_0x37d114){var _0x2cfceb={'raw':![],'where':{}};var _0x8d5dfb={};var _0x52ab64={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x54e08a['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x37d114,null))[_0x121f('0x13')](function(_0xba3112){if(_0xba3112){_0x8d5dfb[_0x121f('0x34')]=_[_0x121f('0x31')](db['ChatInteraction'][_0x121f('0x2f')]);_0x8d5dfb[_0x121f('0x30')]=_[_0x121f('0x31')](_0x54e08a[_0x121f('0x30')]);_0x8d5dfb[_0x121f('0x32')]=_[_0x121f('0x33')](_0x8d5dfb[_0x121f('0x34')],_0x8d5dfb[_0x121f('0x30')]);_0x2cfceb[_0x121f('0x35')]=_[_0x121f('0x33')](_0x8d5dfb[_0x121f('0x34')],qs[_0x121f('0x36')](_0x54e08a[_0x121f('0x30')][_0x121f('0x36')]));_0x2cfceb[_0x121f('0x35')]=_0x2cfceb[_0x121f('0x35')][_0x121f('0x37')]?_0x2cfceb['attributes']:_0x8d5dfb[_0x121f('0x34')];if(!_0x54e08a[_0x121f('0x30')][_0x121f('0x38')](_0x121f('0x39'))){_0x2cfceb[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x54e08a['query'][_0x121f('0x23')]);_0x2cfceb[_0x121f('0x25')]=qs['offset'](_0x54e08a['query']['offset']);}_0x2cfceb[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x54e08a['query']['sort']);_0x2cfceb[_0x121f('0x3f')]=qs[_0x121f('0x32')](_['pick'](_0x54e08a['query'],_0x8d5dfb[_0x121f('0x32')]));_0x2cfceb[_0x121f('0x3f')][_0x121f('0x5c')]=_0xba3112['id'];if(_0x54e08a['query'][_0x121f('0x3d')]){_0x2cfceb[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x2cfceb[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x2cfceb[_0x121f('0x35')],function(_0x30053c){var _0x57e869={};_0x57e869[_0x30053c]={'$like':'%'+_0x54e08a['query']['filter']+'%'};return _0x57e869;})});}_0x2cfceb=_[_0x121f('0x3e')]({},_0x2cfceb,_0x54e08a[_0x121f('0x42')]);return db[_0x121f('0xa9')]['count']({'where':_0x2cfceb[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x3511a4){_0x52ab64[_0x121f('0x24')]=_0x3511a4;if(_0x54e08a[_0x121f('0x30')][_0x121f('0x43')]){_0x2cfceb[_0x121f('0x44')]=[{'model':db[_0x121f('0x96')],'as':'Contact','required':![]},{'model':db[_0x121f('0xb4')],'as':_0x121f('0xe4'),'attributes':[_0x121f('0x2a'),_0x121f('0xe5'),_0x121f('0xe6')],'required':![]},{'model':db[_0x121f('0xe7')],'as':_0x121f('0xe8'),'attributes':['id',_0x121f('0x2a'),_0x121f('0xe9')],'where':_0x54e08a[_0x121f('0x30')][_0x121f('0xea')]?{'id':_0x54e08a[_0x121f('0x30')]['tag']}:undefined,'required':_0x54e08a['query'][_0x121f('0xea')]?!![]:![]}];}return db[_0x121f('0xa9')]['findAll'](_0x2cfceb);})[_0x121f('0x13')](function(_0x25938f){_0x52ab64[_0x121f('0x45')]=_0x25938f;return _0x52ab64;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x37d114,_0x2cfceb))[_0x121f('0x1d')](handleError(_0x37d114,null));};function iftimePromise(_0x3d9cdb,_0x590475){return respondWithRpcPromise(_0x121f('0xeb'),_0x121f('0xec'),{'command':_0x590475[_0x121f('0xed')]?util[_0x121f('0xa2')](_0x121f('0xee'),_0x3d9cdb[_0x121f('0xef')],_0x590475[_0x121f('0xed')]):util[_0x121f('0xa2')](_0x121f('0xf0'),_0x3d9cdb[_0x121f('0xef')])},client9002)['then'](function(_0x74a1d9){var _0x55c899=_0x74a1d9&&_0x74a1d9[_0x121f('0xf1')](_0x121f('0xf2'))>=0x0?!![]:![];logger['info'](_0x121f('0xf3'),_0x590475['id'],_0x3d9cdb['id'],_0x3d9cdb[_0x121f('0xef')],_0x55c899?_0x121f('0xf4'):_0x121f('0xf5'),_0x590475[_0x121f('0xed')]?_0x590475[_0x121f('0xed')]:_0x121f('0xf6'));return _0x55c899;})[_0x121f('0x1d')](function(_0x5ab6a6){logger['error'](_0x121f('0xf3'),_0x590475['id'],_0x3d9cdb['id'],_0x3d9cdb['interval'],util[_0x121f('0xf7')](_0x5ab6a6,{'showHidden':![],'depth':null}),_0x590475['timezone']?_0x590475[_0x121f('0xed')]:_0x121f('0xf6'));return![];});}exports['getSnippet']=function(_0x29b434,_0x2e231e){var _0x576cd8=0x0;var _0x13b10=0x0;var _0x1c3208=![];var _0x31b8f1;var _0x3e6e20;return db[_0x121f('0x2e')][_0x121f('0x4a')]({'where':{'id':_0x29b434[_0x121f('0x47')]['id']},'include':[{'model':db[_0x121f('0xf8')],'as':_0x121f('0xf8'),'include':[{'model':db[_0x121f('0xf8')],'as':_0x121f('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x121f('0x13')](handleEntityNotFound(_0x2e231e,null))[_0x121f('0x13')](function(_0x409dc0){if(_0x409dc0){_0x31b8f1=_0x409dc0;return _0x409dc0[_0x121f('0xfa')]({'raw':!![]});}})['then'](function(_0x450725){if(_0x31b8f1){if(_0x450725){_0x3e6e20=_0x450725;}}return require(_0x121f('0x6b'))[_0x121f('0x6c')]();})[_0x121f('0x13')](function(_0x5ad255){if(_0x5ad255){_0x13b10=_0x5ad255['virtual'];_0x1c3208=_0x5ad255[_0x121f('0x6d')];}})[_0x121f('0x13')](function(){return db[_0x121f('0xa9')][_0x121f('0x24')]({'where':{'closed':![]}});})['then'](function(_0x42534f){_0x576cd8=_0x42534f;if(_0x13b10&&_0x42534f>_0x13b10){return db[_0x121f('0xfb')][_0x121f('0x56')]({'where':{'id':0x1}})[_0x121f('0x13')](function(_0x547ea3){if(_0x547ea3){_0x547ea3[_0x121f('0xfc')](_0x121f('0xfd'));}});}})[_0x121f('0x13')](function(){if(_0x31b8f1['Interval']&&_0x31b8f1[_0x121f('0xf8')][_0x121f('0xf9')]){var _0x1c84fb=[];for(var _0x2d2b48=0x0;_0x2d2b48<_0x31b8f1[_0x121f('0xf8')][_0x121f('0xf9')]['length'];_0x2d2b48++){var _0x5f3c09=_0x31b8f1['Interval'][_0x121f('0xf9')][_0x2d2b48][_0x121f('0x4e')]({'plain':!![]});_0x1c84fb[_0x121f('0xb0')](iftimePromise(_0x5f3c09,_0x31b8f1));}return BPromise['all'](_0x1c84fb)[_0x121f('0x13')](function(_0x56f79c){return _[_0x121f('0xfe')](_0x56f79c);});}else{return!![];}})[_0x121f('0x13')](function(_0x3ecb94){var _0x54da81=fs['readFileSync'](path['join'](config[_0x121f('0x69')],'server/files/chat/iframe.ejs'),_0x121f('0xc4'));var _0x56d9b7={'remote':_0x31b8f1[_0x121f('0xff')],'query':querystring['stringify'](_[_0x121f('0x3e')](_0x31b8f1[_0x121f('0x4e')]({'plain':!![]}),{'customerIp':_0x29b434[_0x121f('0x98')][_0x121f('0x9a')]||_0x29b434[_0x121f('0x98')]['x-real-ip']||_0x29b434[_0x121f('0x100')]['remoteAddress']||_0x29b434['ip'],'referer':_0x29b434['headers'][_0x121f('0x101')],'openedInteractions':_0x576cd8,'maxInteractions':_0x13b10,'virtual':_0x1c3208[_0x121f('0x102')],'online':_0x3ecb94,'custom':_0x1c3208}))[_0x121f('0x103')](/'/g,'\x5c\x27')};_0x2e231e[_0x121f('0x2b')](ejs[_0x121f('0x104')](Mustache[_0x121f('0x104')](_0x54da81,_0x56d9b7),{'proactiveActions':_0x3e6e20,'alignment':_0x31b8f1[_0x121f('0x105')],'verticalAlignment':_0x31b8f1[_0x121f('0x106')],'div_color':_0x31b8f1[_0x121f('0xe9')],'text_color':_0x31b8f1[_0x121f('0x107')],'button_color':_0x31b8f1['color_button'],'background_color':_0x31b8f1[_0x121f('0x108')]}));})['catch'](handleError(_0x2e231e,null));};exports[_0x121f('0x109')]=function(_0x47b7de,_0xd163aa){var _0x423dd3=_0x47b7de[_0x121f('0x47')]['id'];var _0x3b1c8d=_0x47b7de['body'];var _0x4450af=0xc8;var _0x183edb=null;return db[_0x121f('0xce')]['transaction']({'isolationLevel':db[_0x121f('0xce')][_0x121f('0x10a')][_0x121f('0x10b')][_0x121f('0x10c')]},function(_0x139d54){return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x423dd3},'transaction':_0x139d54})[_0x121f('0x13')](function(_0x2087d4){if(_0x2087d4){return db[_0x121f('0x90')][_0x121f('0x28')]({'where':{'ChatWebsiteId':_0x423dd3},'transaction':_0x139d54})['then'](function(){var _0x3e5dbf=_[_0x121f('0x2d')](_0x3b1c8d,function(_0x475869){_0x475869[_0x121f('0x5c')]=_0x423dd3;return _0x475869;});return db['ChatApplication'][_0x121f('0x10d')](_0x3e5dbf,{'transaction':_0x139d54});});}else{_0x4450af=0x194;_0x183edb=[];}});})[_0x121f('0x13')](function(){if(_0x4450af!==0x194){return db[_0x121f('0x90')][_0x121f('0x10e')]({'where':{'ChatWebsiteId':_0x423dd3},'order':'priority'})[_0x121f('0x13')](function(_0x2408ea){_0x183edb=_0x2408ea;});}})[_0x121f('0x1d')](function(_0x1ce598){_0x4450af=0x1f4;logger['error'](_0x1ce598[_0x121f('0x10f')]);if(_0x1ce598[_0x121f('0x2a')]){delete _0x1ce598['name'];}_0x183edb=_0x1ce598;})[_0x121f('0x110')](function(){if(_0x183edb===null){_0xd163aa[_0x121f('0x1e')](_0x4450af);}else{if(_0x4450af===0x1f4){_0xd163aa['status'](_0x4450af)[_0x121f('0x2b')](_0x183edb);}else{_0xd163aa[_0x121f('0x1f')](_0x4450af)[_0x121f('0x21')](_0x183edb);}}});};exports[_0x121f('0x111')]=function(_0x4380ac,_0x364c58){var _0x3188e0={};var _0xe92762={};var _0x251b63;var _0x4e6736;return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x4380ac[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x364c58,null))['then'](function(_0x421c4c){if(_0x421c4c){_0x251b63=_0x421c4c;_0xe92762[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x90')][_0x121f('0x2f')]);_0xe92762[_0x121f('0x30')]=_[_0x121f('0x31')](_0x4380ac['query']);_0xe92762['filters']=_['intersection'](_0xe92762[_0x121f('0x34')],_0xe92762[_0x121f('0x30')]);_0x3188e0['attributes']=_[_0x121f('0x33')](_0xe92762[_0x121f('0x34')],qs[_0x121f('0x36')](_0x4380ac[_0x121f('0x30')][_0x121f('0x36')]));_0x3188e0[_0x121f('0x35')]=_0x3188e0[_0x121f('0x35')][_0x121f('0x37')]?_0x3188e0['attributes']:_0xe92762[_0x121f('0x34')];_0x3188e0[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x4380ac[_0x121f('0x30')][_0x121f('0x3b')]);_0x3188e0['where']=qs['filters'](_[_0x121f('0x3c')](_0x4380ac[_0x121f('0x30')],_0xe92762[_0x121f('0x32')]));if(_0x4380ac['query'][_0x121f('0x3d')]){_0x3188e0[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x3188e0['where'],{'$or':_[_0x121f('0x2d')](_0x3188e0[_0x121f('0x35')],function(_0x398763){var _0x445673={};_0x445673[_0x398763]={'$like':'%'+_0x4380ac[_0x121f('0x30')][_0x121f('0x3d')]+'%'};return _0x445673;})});}_0x3188e0=_[_0x121f('0x3e')]({},_0x3188e0,_0x4380ac['options']);return _0x251b63[_0x121f('0x111')](_0x3188e0);}})[_0x121f('0x13')](function(_0x5d5f7f){if(_0x5d5f7f){_0x4e6736=_0x5d5f7f[_0x121f('0x37')];if(!_0x4380ac[_0x121f('0x30')][_0x121f('0x38')](_0x121f('0x39'))){_0x3188e0['limit']=qs['limit'](_0x4380ac[_0x121f('0x30')][_0x121f('0x23')]);_0x3188e0[_0x121f('0x25')]=qs['offset'](_0x4380ac[_0x121f('0x30')][_0x121f('0x25')]);}return _0x251b63[_0x121f('0x111')](_0x3188e0);}})[_0x121f('0x13')](function(_0x4df533){if(_0x4df533){return _0x4df533?{'count':_0x4e6736,'rows':_0x4df533}:null;}})[_0x121f('0x13')](respondWithResult(_0x364c58,null))[_0x121f('0x1d')](handleError(_0x364c58,null));};exports['addProactiveActions']=function(_0x140247,_0x5c05c8){return db[_0x121f('0x112')]['find']({'where':{'id':_0x140247[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5c05c8,null))['then'](function(_0x5b90ea){if(_0x5b90ea){return _0x5b90ea[_0x121f('0x113')](_0x140247[_0x121f('0x4c')][_0x121f('0x5a')],_['omit'](_0x140247[_0x121f('0x4c')],[_0x121f('0x5a'),'id'])||{});}})[_0x121f('0x13')](respondWithResult(_0x5c05c8,null))[_0x121f('0x1d')](handleError(_0x5c05c8,null));};exports[_0x121f('0xfa')]=function(_0x1b5ab8,_0x141abc){var _0x550736={};var _0x2e916f={};var _0x5e9806;var _0x1ec903;return db['ChatWebsite'][_0x121f('0x56')]({'where':{'id':_0x1b5ab8[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x141abc,null))[_0x121f('0x13')](function(_0x9408b4){if(_0x9408b4){_0x5e9806=_0x9408b4;_0x2e916f[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0x114')][_0x121f('0x2f')]);_0x2e916f['query']=_[_0x121f('0x31')](_0x1b5ab8[_0x121f('0x30')]);_0x2e916f[_0x121f('0x32')]=_['intersection'](_0x2e916f['model'],_0x2e916f[_0x121f('0x30')]);_0x550736[_0x121f('0x35')]=_[_0x121f('0x33')](_0x2e916f[_0x121f('0x34')],qs[_0x121f('0x36')](_0x1b5ab8[_0x121f('0x30')]['fields']));_0x550736[_0x121f('0x35')]=_0x550736[_0x121f('0x35')][_0x121f('0x37')]?_0x550736[_0x121f('0x35')]:_0x2e916f['model'];_0x550736[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x1b5ab8['query'][_0x121f('0x3b')]);_0x550736[_0x121f('0x3f')]=qs['filters'](_['pick'](_0x1b5ab8[_0x121f('0x30')],_0x2e916f['filters']));if(_0x1b5ab8[_0x121f('0x30')][_0x121f('0x3d')]){_0x550736[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x550736['where'],{'$or':_['map'](_0x550736[_0x121f('0x35')],function(_0xf075cb){var _0x20ba70={};_0x20ba70[_0xf075cb]={'$like':'%'+_0x1b5ab8[_0x121f('0x30')]['filter']+'%'};return _0x20ba70;})});}_0x550736=_[_0x121f('0x3e')]({},_0x550736,_0x1b5ab8['options']);return _0x5e9806[_0x121f('0xfa')](_0x550736);}})[_0x121f('0x13')](function(_0x40b3b3){if(_0x40b3b3){_0x1ec903=_0x40b3b3[_0x121f('0x37')];if(!_0x1b5ab8[_0x121f('0x30')][_0x121f('0x38')]('nolimit')){_0x550736[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x1b5ab8[_0x121f('0x30')][_0x121f('0x23')]);_0x550736['offset']=qs[_0x121f('0x25')](_0x1b5ab8[_0x121f('0x30')]['offset']);}return _0x5e9806[_0x121f('0xfa')](_0x550736);}})[_0x121f('0x13')](function(_0x143fe1){if(_0x143fe1){return _0x143fe1?{'count':_0x1ec903,'rows':_0x143fe1}:null;}})['then'](respondWithResult(_0x141abc,null))[_0x121f('0x1d')](handleError(_0x141abc,null));};exports[_0x121f('0x115')]=function(_0x43885e,_0x5bb44a){var _0x1b022b=_0x43885e['query'][_0x121f('0x116')]===_0x121f('0x117')?'offlineForm':_0x121f('0x118');return db[_0x121f('0x2e')][_0x121f('0x4a')]({'attributes':['id',_0x1b022b],'where':{'id':_0x43885e[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x5bb44a,null))[_0x121f('0x13')](function(_0x1ea0c7){if(_0x1ea0c7){var _0x1cba67=_0x1ea0c7[_0x1b022b];var _0x326193=_0x1cba67&&_0x1cba67[_0x121f('0x119')]?_0x1cba67[_0x121f('0x119')]:[];_0x5bb44a[_0x121f('0x2b')]({'fromKey':_[_0x121f('0x78')](_0x1cba67['fromKey'])?undefined:_0x1cba67[_0x121f('0x11a')],'count':_0x326193[_0x121f('0x37')],'rows':_0x326193});}})[_0x121f('0x1d')](handleError(_0x5bb44a,null));};exports[_0x121f('0x11b')]=function(_0x132651,_0x349385){var _0x5aee2e={'raw':![],'where':{}};var _0x124972={};var _0x385d42={'count':0x0,'rows':[]};return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x132651[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x349385,null))['then'](function(_0x4191ba){if(_0x4191ba){_0x124972['model']=_[_0x121f('0x31')](db[_0x121f('0xc6')]['rawAttributes']);_0x124972[_0x121f('0x30')]=_[_0x121f('0x31')](_0x132651[_0x121f('0x30')]);_0x124972[_0x121f('0x32')]=_[_0x121f('0x33')](_0x124972['model'],_0x124972[_0x121f('0x30')]);_0x5aee2e[_0x121f('0x35')]=_[_0x121f('0x33')](_0x124972['model'],qs[_0x121f('0x36')](_0x132651[_0x121f('0x30')][_0x121f('0x36')]));_0x5aee2e[_0x121f('0x35')]=_0x5aee2e[_0x121f('0x35')]['length']?_0x5aee2e['attributes']:_0x124972['model'];if(!_0x132651[_0x121f('0x30')][_0x121f('0x38')]('nolimit')){_0x5aee2e[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x132651['query']['limit']);_0x5aee2e['offset']=qs[_0x121f('0x25')](_0x132651[_0x121f('0x30')][_0x121f('0x25')]);}_0x5aee2e['order']=qs['sort'](_0x132651[_0x121f('0x30')][_0x121f('0x3b')]);_0x5aee2e['where']=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x132651['query'],_0x124972[_0x121f('0x32')]));_0x5aee2e[_0x121f('0x3f')][_0x121f('0x5c')]=_0x4191ba['id'];if(_0x132651[_0x121f('0x30')][_0x121f('0x3d')]){_0x5aee2e[_0x121f('0x3f')]=_['merge'](_0x5aee2e[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x5aee2e[_0x121f('0x35')],function(_0x205aae){var _0x478e03={};_0x478e03[_0x205aae]={'$like':'%'+_0x132651[_0x121f('0x30')]['filter']+'%'};return _0x478e03;})});}_0x5aee2e=_[_0x121f('0x3e')]({},_0x5aee2e,_0x132651['options']);return db[_0x121f('0xc6')][_0x121f('0x24')]({'where':_0x5aee2e[_0x121f('0x3f')]})[_0x121f('0x13')](function(_0x10e88a){_0x385d42[_0x121f('0x24')]=_0x10e88a;if(_0x132651[_0x121f('0x30')][_0x121f('0x43')]){_0x5aee2e[_0x121f('0x44')]=[{'all':!![]}];}else{_0x5aee2e[_0x121f('0x44')]=[{'model':db[_0x121f('0x96')],'as':'Contact','required':![]},{'model':db[_0x121f('0x11c')],'as':_0x121f('0x11d'),'required':![]}];}return db[_0x121f('0xc6')][_0x121f('0x58')](_0x5aee2e);})[_0x121f('0x13')](function(_0x42e9af){_0x385d42[_0x121f('0x45')]=_0x42e9af;return _0x385d42;});}})[_0x121f('0x13')](respondWithFilteredResult(_0x349385,_0x5aee2e))[_0x121f('0x1d')](handleError(_0x349385,null));};exports[_0x121f('0x11e')]=function(_0x495131,_0x315382){return db[_0x121f('0x2e')]['find']({'where':{'id':_0x495131[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x315382,null))[_0x121f('0x13')](function(_0x3d3b5d){if(_0x3d3b5d){return _0x3d3b5d[_0x121f('0x11e')](_0x495131[_0x121f('0x4c')][_0x121f('0x5a')],_[_0x121f('0xe3')](_0x495131[_0x121f('0x4c')],['ids','id'])||{})[_0x121f('0xad')](function(_0x4b0b5f){for(var _0x324caa=0x0;_0x324caa<_0x495131['body'][_0x121f('0x5a')][_0x121f('0x37')];_0x324caa+=0x1){socket[_0x121f('0x11f')](_0x121f('0x120'),{'UserId':Number(_0x495131['body'][_0x121f('0x5a')][_0x324caa]),'ChatWebsiteId':Number(_0x495131[_0x121f('0x47')]['id'])});}return _0x4b0b5f;});}})[_0x121f('0x13')](respondWithResult(_0x315382,null))[_0x121f('0x1d')](handleError(_0x315382,null));};exports[_0x121f('0x121')]=function(_0x46946e,_0x59cb46){return db[_0x121f('0x2e')]['find']({'where':{'id':_0x46946e['params']['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x59cb46,null))[_0x121f('0x13')](function(_0x296bb6){if(_0x296bb6){return _0x296bb6['removeAgents'](_0x46946e['query'][_0x121f('0x5a')])['then'](function(){if(_[_0x121f('0x122')](_0x46946e[_0x121f('0x30')]['ids'])){for(var _0x50ae75=0x0;_0x50ae75<_0x46946e['query'][_0x121f('0x5a')][_0x121f('0x37')];_0x50ae75+=0x1){socket[_0x121f('0x11f')](_0x121f('0x123'),{'UserId':Number(_0x46946e[_0x121f('0x30')][_0x121f('0x5a')][_0x50ae75]),'ChatWebsiteId':Number(_0x46946e[_0x121f('0x47')]['id'])});}}else{socket[_0x121f('0x11f')](_0x121f('0x123'),{'UserId':Number(_0x46946e[_0x121f('0x30')]['ids']),'ChatWebsiteId':Number(_0x46946e[_0x121f('0x47')]['id'])});}});}})[_0x121f('0x13')](respondWithStatusCode(_0x59cb46,null))[_0x121f('0x1d')](handleError(_0x59cb46,null));};exports[_0x121f('0x124')]=function(_0x2e73de,_0x28c904){var _0x461d32={};var _0x47c3de={};var _0x1cb96e;var _0x3af06b;return db[_0x121f('0x2e')][_0x121f('0x56')]({'where':{'id':_0x2e73de[_0x121f('0x47')]['id']}})[_0x121f('0x13')](handleEntityNotFound(_0x28c904,null))[_0x121f('0x13')](function(_0xcc1df6){if(_0xcc1df6){_0x1cb96e=_0xcc1df6;_0x47c3de[_0x121f('0x34')]=_[_0x121f('0x31')](db[_0x121f('0xb4')][_0x121f('0x2f')]);_0x47c3de['query']=_[_0x121f('0x31')](_0x2e73de[_0x121f('0x30')]);_0x47c3de[_0x121f('0x32')]=_['intersection'](_0x47c3de[_0x121f('0x34')],_0x47c3de[_0x121f('0x30')]);_0x461d32[_0x121f('0x35')]=_['intersection'](_0x47c3de[_0x121f('0x34')],qs[_0x121f('0x36')](_0x2e73de[_0x121f('0x30')][_0x121f('0x36')]));_0x461d32[_0x121f('0x35')]=_0x461d32['attributes'][_0x121f('0x37')]?_0x461d32[_0x121f('0x35')]:_0x47c3de[_0x121f('0x34')];_0x461d32[_0x121f('0x3a')]=qs[_0x121f('0x3b')](_0x2e73de[_0x121f('0x30')][_0x121f('0x3b')]);_0x461d32['where']=qs[_0x121f('0x32')](_[_0x121f('0x3c')](_0x2e73de[_0x121f('0x30')],_0x47c3de[_0x121f('0x32')]));if(_0x2e73de[_0x121f('0x30')][_0x121f('0x3d')]){_0x461d32[_0x121f('0x3f')]=_[_0x121f('0x3e')](_0x461d32[_0x121f('0x3f')],{'$or':_[_0x121f('0x2d')](_0x461d32['attributes'],function(_0x37320d){var _0x4a6dff={};_0x4a6dff[_0x37320d]={'$like':'%'+_0x2e73de['query'][_0x121f('0x3d')]+'%'};return _0x4a6dff;})});}_0x461d32=_[_0x121f('0x3e')]({},_0x461d32,_0x2e73de[_0x121f('0x42')]);return _0x1cb96e[_0x121f('0x124')](_0x461d32);}})[_0x121f('0x13')](function(_0x25bcd9){if(_0x25bcd9){_0x3af06b=_0x25bcd9[_0x121f('0x37')];if(!_0x2e73de['query'][_0x121f('0x38')](_0x121f('0x39'))){_0x461d32[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x2e73de[_0x121f('0x30')][_0x121f('0x23')]);_0x461d32[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x2e73de[_0x121f('0x30')][_0x121f('0x25')]);}return _0x1cb96e[_0x121f('0x124')](_0x461d32);}})['then'](function(_0x3fd9f7){if(_0x3fd9f7){return _0x3fd9f7?{'count':_0x3af06b,'rows':_0x3fd9f7}:null;}})['then'](respondWithResult(_0x28c904,null))[_0x121f('0x1d')](handleError(_0x28c904,null));};
\ No newline at end of file
+var _0xf76f=['online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','ChatWebsites','stack','name','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','nolimit','removeAnswers','file','addAvatar','agentAvatar','addCustomerAvatar','filename','addSystemAvatar','systemAvatar','join','root','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','list','orderBy','applications','priority','account','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','mimetype','subjectOffline','toPairsIn','lastName','email','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','some','remote','connection','virtual','replace','alignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields'];(function(_0x437d62,_0xe7d06d){var _0x1b1151=function(_0xde71ff){while(--_0xde71ff){_0x437d62['push'](_0x437d62['shift']());}};_0x1b1151(++_0xe7d06d);}(_0xf76f,0x13b));var _0xff76=function(_0x4dcfbb,_0x170c85){_0x4dcfbb=_0x4dcfbb-0x0;var _0x1d02cd=_0xf76f[_0x4dcfbb];return _0x1d02cd;};'use strict';var BPromise=require(_0xff76('0x0'));var Mustache=require(_0xff76('0x1'));var util=require('util');var path=require(_0xff76('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff76('0x3'));var _=require(_0xff76('0x4'));var querystring=require('querystring');var Redis=require(_0xff76('0x5'));var qs=require(_0xff76('0x6'));var logger=require(_0xff76('0x7'))('api');var config=require(_0xff76('0x8'));var db=require(_0xff76('0x9'))['db'];config[_0xff76('0xa')]=_[_0xff76('0xb')](config[_0xff76('0xa')],{'host':_0xff76('0xc'),'port':0x18eb});var socket=require(_0xff76('0xd'))(new Redis(config[_0xff76('0xa')]));require('./chatWebsite.socket')[_0xff76('0xe')](socket);var jayson=require(_0xff76('0xf'));var client=jayson[_0xff76('0x10')][_0xff76('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xff76('0x11')]({'port':0x232a});var client9003=jayson[_0xff76('0x10')]['http']({'port':0x232b});var client9001=jayson[_0xff76('0x10')][_0xff76('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x376946,_0x57a70f,_0x49c12d,_0x2b09da){return new BPromise(function(_0x5c2812,_0xd07949){var _0x4ac048=_0x2b09da||client;return _0x4ac048['request'](_0x376946,_0x49c12d)[_0xff76('0x12')](function(_0x8f8304){logger[_0xff76('0x13')](_0xff76('0x14'),_0x57a70f,'request\x20sent');logger[_0xff76('0x15')](_0xff76('0x16'),_0x57a70f,_0xff76('0x17'),JSON[_0xff76('0x18')](_0x8f8304));if(_0x8f8304[_0xff76('0x19')]){if(_0x8f8304[_0xff76('0x19')][_0xff76('0x1a')]===0x1f4){logger[_0xff76('0x19')](_0xff76('0x14'),_0x57a70f,_0x8f8304[_0xff76('0x19')][_0xff76('0x1b')]);return _0xd07949(_0x8f8304[_0xff76('0x19')]['message']);}logger[_0xff76('0x19')](_0xff76('0x14'),_0x57a70f,_0x8f8304['error'][_0xff76('0x1b')]);return _0x5c2812(_0x8f8304['error']['message']);}else{logger[_0xff76('0x13')](_0xff76('0x14'),_0x57a70f,_0xff76('0x17'));_0x5c2812(_0x8f8304[_0xff76('0x1c')][_0xff76('0x1b')]);}})[_0xff76('0x1d')](function(_0x3585e2){logger[_0xff76('0x19')](_0xff76('0x14'),_0x57a70f,_0x3585e2);_0xd07949(_0x3585e2);});});}function respondWithStatusCode(_0x16bf92,_0x21abab){_0x21abab=_0x21abab||0xcc;return function(_0x48df3f){if(_0x48df3f){return _0x16bf92[_0xff76('0x1e')](_0x21abab);}return _0x16bf92[_0xff76('0x1f')](_0x21abab)[_0xff76('0x20')]();};}function respondWithResult(_0x582cf7,_0x41e0a7){_0x41e0a7=_0x41e0a7||0xc8;return function(_0xb09462){if(_0xb09462){return _0x582cf7['status'](_0x41e0a7)[_0xff76('0x21')](_0xb09462);}};}function respondWithFilteredResult(_0x37ef75,_0x187bc3){return function(_0x42c08b){if(_0x42c08b){var _0x1026d0=typeof _0x187bc3[_0xff76('0x22')]===_0xff76('0x23')&&typeof _0x187bc3[_0xff76('0x24')]===_0xff76('0x23');var _0x5d3ae9=_0x42c08b['count'];var _0x328bcf=_0x1026d0?0x0:_0x187bc3[_0xff76('0x22')];var _0x24e79d=_0x1026d0?_0x42c08b[_0xff76('0x25')]:_0x187bc3['offset']+_0x187bc3[_0xff76('0x24')];var _0x5c7db2;if(_0x24e79d>=_0x5d3ae9){_0x24e79d=_0x5d3ae9;_0x5c7db2=0xc8;}else{_0x5c7db2=0xce;}_0x37ef75[_0xff76('0x1f')](_0x5c7db2);return _0x37ef75['set'](_0xff76('0x26'),_0x328bcf+'-'+_0x24e79d+'/'+_0x5d3ae9)[_0xff76('0x21')](_0x42c08b);}return null;};}function saveUpdates(_0x460f45){return function(_0x4ffc90){if(_0x4ffc90){return _0x4ffc90[_0xff76('0x27')](_0x460f45)[_0xff76('0x12')](function(_0x4e4cc3){return _0x4e4cc3;});}return null;};}function removeEntity(_0x618350){return function(_0x17ee30){if(_0x17ee30){return _0x17ee30[_0xff76('0x28')]()[_0xff76('0x12')](function(){var _0x1b1842=_0x17ee30['get']({'plain':!![]});var _0x12e64f=_0xff76('0x29');return db['UserProfileResource'][_0xff76('0x28')]({'where':{'type':_0x12e64f,'resourceId':_0x1b1842['id']}})[_0xff76('0x12')](function(){return _0x17ee30;});})['then'](function(){_0x618350['status'](0xcc)[_0xff76('0x20')]();});}};}function handleEntityNotFound(_0x536a0c){return function(_0x8298d4){if(!_0x8298d4){_0x536a0c[_0xff76('0x1e')](0x194);}return _0x8298d4;};}function handleError(_0x54909a,_0xfe6c41){_0xfe6c41=_0xfe6c41||0x1f4;return function(_0xc26810){logger['error'](_0xc26810[_0xff76('0x2a')]);if(_0xc26810[_0xff76('0x2b')]){delete _0xc26810[_0xff76('0x2b')];}_0x54909a['status'](_0xfe6c41)['send'](_0xc26810);};}exports[_0xff76('0x2c')]=function(_0x2420f5,_0x407cd7){var _0xf494a6={'include':[{'model':db['Pause'],'as':_0xff76('0x2d')}]},_0x4d09f1={},_0x10e557={'count':0x0,'rows':[]};var _0x37b008=_[_0xff76('0x2e')](db[_0xff76('0x2f')][_0xff76('0x30')],function(_0x34888d){return{'name':_0x34888d['fieldName'],'type':_0x34888d[_0xff76('0x31')]['key']};});_0x4d09f1[_0xff76('0x32')]=_[_0xff76('0x2e')](_0x37b008,'name');_0x4d09f1['query']=_[_0xff76('0x33')](_0x2420f5[_0xff76('0x34')]);_0x4d09f1[_0xff76('0x35')]=_['intersection'](_0x4d09f1[_0xff76('0x32')],_0x4d09f1['query']);_0xf494a6[_0xff76('0x36')]=_[_0xff76('0x37')](_0x4d09f1[_0xff76('0x32')],qs[_0xff76('0x38')](_0x2420f5[_0xff76('0x34')][_0xff76('0x38')]));_0xf494a6[_0xff76('0x36')]=_0xf494a6[_0xff76('0x36')]['length']?_0xf494a6['attributes']:_0x4d09f1['model'];if(!_0x2420f5['query'][_0xff76('0x39')]('nolimit')){_0xf494a6[_0xff76('0x24')]=qs[_0xff76('0x24')](_0x2420f5[_0xff76('0x34')][_0xff76('0x24')]);_0xf494a6['offset']=qs[_0xff76('0x22')](_0x2420f5[_0xff76('0x34')][_0xff76('0x22')]);}_0xf494a6[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x2420f5['query']['sort']);_0xf494a6[_0xff76('0x3c')]=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0x2420f5[_0xff76('0x34')],_0x4d09f1[_0xff76('0x35')]),_0x37b008);if(_0x2420f5[_0xff76('0x34')][_0xff76('0x3e')]){_0xf494a6[_0xff76('0x3c')]=_[_0xff76('0x3f')](_0xf494a6[_0xff76('0x3c')],{'$or':_[_0xff76('0x2e')](_0x37b008,function(_0x106dce){if(_0x106dce[_0xff76('0x31')]!==_0xff76('0x40')){var _0x36b262={};_0x36b262[_0x106dce['name']]={'$like':'%'+_0x2420f5[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x36b262;}})});}_0xf494a6=_['merge']({},_0xf494a6,_0x2420f5['options']);var _0x20a5fd={'where':_0xf494a6[_0xff76('0x3c')]};return db[_0xff76('0x2f')][_0xff76('0x25')](_0x20a5fd)[_0xff76('0x12')](function(_0x2bfa76){_0x10e557['count']=_0x2bfa76;if(_0x2420f5[_0xff76('0x34')][_0xff76('0x41')]){_0xf494a6[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x2f')]['findAll'](_0xf494a6);})[_0xff76('0x12')](function(_0x2e9e4c){_0x10e557[_0xff76('0x43')]=_0x2e9e4c;return _0x10e557;})[_0xff76('0x12')](respondWithFilteredResult(_0x407cd7,_0xf494a6))['catch'](handleError(_0x407cd7,null));};exports[_0xff76('0x44')]=function(_0xe64d70,_0x2f2bf0){var _0x702b36={'raw':![],'where':{'id':_0xe64d70[_0xff76('0x45')]['id']},'include':[{'model':db['Pause'],'as':_0xff76('0x2d')}]},_0xd2b59a={};_0xd2b59a[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0x2f')][_0xff76('0x30')]);_0xd2b59a['query']=_['keys'](_0xe64d70['query']);_0xd2b59a[_0xff76('0x35')]=_['intersection'](_0xd2b59a[_0xff76('0x32')],_0xd2b59a[_0xff76('0x34')]);_0x702b36[_0xff76('0x36')]=_[_0xff76('0x37')](_0xd2b59a[_0xff76('0x32')],qs['fields'](_0xe64d70[_0xff76('0x34')][_0xff76('0x38')]));_0x702b36[_0xff76('0x36')]=_0x702b36[_0xff76('0x36')][_0xff76('0x46')]?_0x702b36[_0xff76('0x36')]:_0xd2b59a['model'];if(_0xe64d70[_0xff76('0x34')][_0xff76('0x41')]){_0x702b36[_0xff76('0x42')]=[{'all':!![]}];}_0x702b36=_[_0xff76('0x3f')]({},_0x702b36,_0xe64d70[_0xff76('0x47')]);return db[_0xff76('0x2f')][_0xff76('0x48')](_0x702b36)[_0xff76('0x12')](handleEntityNotFound(_0x2f2bf0,null))[_0xff76('0x12')](respondWithResult(_0x2f2bf0,null))['catch'](handleError(_0x2f2bf0,null));};exports[_0xff76('0x49')]=function(_0x36dd0c,_0x36b7e5){return db[_0xff76('0x2f')]['create'](_0x36dd0c['body'],{})[_0xff76('0x12')](function(_0x2c8c9f){var _0x17e150=_0x36dd0c[_0xff76('0x4a')][_0xff76('0x4b')]({'plain':!![]});if(!_0x17e150)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17e150[_0xff76('0x4c')]==='user'){var _0x1c1cdd=_0x2c8c9f['get']({'plain':!![]});var _0x1a9f5b=_0xff76('0x29');return db[_0xff76('0x4d')][_0xff76('0x48')]({'where':{'name':_0x1a9f5b,'userProfileId':_0x17e150[_0xff76('0x4e')]},'raw':!![]})['then'](function(_0x2e508a){if(_0x2e508a&&_0x2e508a[_0xff76('0x4f')]===0x0){return db[_0xff76('0x50')]['create']({'name':_0x1c1cdd[_0xff76('0x2b')],'resourceId':_0x1c1cdd['id'],'type':_0x2e508a[_0xff76('0x2b')],'sectionId':_0x2e508a['id']},{})[_0xff76('0x12')](function(){return _0x2c8c9f;});}else{return _0x2c8c9f;}})[_0xff76('0x1d')](function(_0xde95bd){logger[_0xff76('0x19')](_0xff76('0x51'),_0xde95bd);throw _0xde95bd;});}return _0x2c8c9f;})[_0xff76('0x12')](respondWithResult(_0x36b7e5,0xc9))[_0xff76('0x1d')](handleError(_0x36b7e5,null));};exports[_0xff76('0x27')]=function(_0x5ef2a6,_0x194fa8){if(_0x5ef2a6[_0xff76('0x52')]['id']){delete _0x5ef2a6[_0xff76('0x52')]['id'];}return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x5ef2a6['params']['id']},'include':[{'model':db[_0xff76('0x53')],'as':_0xff76('0x2d')}]})['then'](handleEntityNotFound(_0x194fa8,null))['then'](saveUpdates(_0x5ef2a6[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x194fa8,null))[_0xff76('0x1d')](handleError(_0x194fa8,null));};exports[_0xff76('0x28')]=function(_0x3b1314,_0x1ff75f){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x3b1314[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x1ff75f,null))[_0xff76('0x12')](removeEntity(_0x1ff75f,null))['catch'](handleError(_0x1ff75f,null));};exports[_0xff76('0x54')]=function(_0x5e0cf3,_0x5a1ce8){return db[_0xff76('0x2f')][_0xff76('0x54')]()['then'](respondWithResult(_0x5a1ce8,null))[_0xff76('0x1d')](handleError(_0x5a1ce8,null));};exports['addDisposition']=function(_0x563895,_0x224c84){if(_0x563895[_0xff76('0x52')]['id']){delete _0x563895['body']['id'];}return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x563895[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x224c84,null))[_0xff76('0x12')](function(_0x128350){if(_0x128350){_0x563895[_0xff76('0x52')][_0xff76('0x55')]=_0x128350['id'];return db[_0xff76('0x56')]['create'](_0x563895[_0xff76('0x52')]);}})[_0xff76('0x12')](respondWithResult(_0x224c84,null))['catch'](handleError(_0x224c84,null));};exports[_0xff76('0x57')]=function(_0xa9d0b5,_0x214120){var _0x3da646={'raw':![],'where':{}};var _0x2ac5d2={};var _0x3a02c3={'count':0x0,'rows':[]};return db[_0xff76('0x2f')]['findOne']({'where':{'id':_0xa9d0b5[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x214120,null))[_0xff76('0x12')](function(_0x483693){if(_0x483693){_0x2ac5d2[_0xff76('0x32')]=_[_0xff76('0x33')](db['Disposition'][_0xff76('0x30')]);_0x2ac5d2[_0xff76('0x34')]=_[_0xff76('0x33')](_0xa9d0b5[_0xff76('0x34')]);_0x2ac5d2[_0xff76('0x35')]=_['intersection'](_0x2ac5d2['model'],_0x2ac5d2[_0xff76('0x34')]);_0x3da646[_0xff76('0x36')]=_[_0xff76('0x37')](_0x2ac5d2[_0xff76('0x32')],qs[_0xff76('0x38')](_0xa9d0b5[_0xff76('0x34')][_0xff76('0x38')]));_0x3da646[_0xff76('0x36')]=_0x3da646[_0xff76('0x36')][_0xff76('0x46')]?_0x3da646[_0xff76('0x36')]:_0x2ac5d2[_0xff76('0x32')];if(!_0xa9d0b5[_0xff76('0x34')][_0xff76('0x39')]('nolimit')){_0x3da646[_0xff76('0x24')]=qs[_0xff76('0x24')](_0xa9d0b5[_0xff76('0x34')][_0xff76('0x24')]);_0x3da646[_0xff76('0x22')]=qs[_0xff76('0x22')](_0xa9d0b5[_0xff76('0x34')][_0xff76('0x22')]);}_0x3da646[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0xa9d0b5['query'][_0xff76('0x3b')]);_0x3da646[_0xff76('0x3c')]=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0xa9d0b5[_0xff76('0x34')],_0x2ac5d2['filters']));_0x3da646[_0xff76('0x3c')][_0xff76('0x55')]=_0x483693['id'];if(_0xa9d0b5['query'][_0xff76('0x3e')]){_0x3da646['where']=_['merge'](_0x3da646['where'],{'$or':_[_0xff76('0x2e')](_0x3da646['attributes'],function(_0x973aea){var _0x4907d2={};_0x4907d2[_0x973aea]={'$like':'%'+_0xa9d0b5[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x4907d2;})});}_0x3da646=_[_0xff76('0x3f')]({},_0x3da646,_0xa9d0b5[_0xff76('0x47')]);return db[_0xff76('0x56')][_0xff76('0x25')]({'where':_0x3da646[_0xff76('0x3c')]})[_0xff76('0x12')](function(_0x1660a6){_0x3a02c3[_0xff76('0x25')]=_0x1660a6;if(_0xa9d0b5['query'][_0xff76('0x41')]){_0x3da646[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x56')][_0xff76('0x58')](_0x3da646);})[_0xff76('0x12')](function(_0x1288ac){_0x3a02c3[_0xff76('0x43')]=_0x1288ac;return _0x3a02c3;});}})[_0xff76('0x12')](respondWithFilteredResult(_0x214120,_0x3da646))['catch'](handleError(_0x214120,null));};exports['removeDispositions']=function(_0xa02b65,_0xce6686){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0xa02b65['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0xce6686,null))[_0xff76('0x12')](function(_0x7c965f){if(_0x7c965f){return _0x7c965f[_0xff76('0x59')](_0xa02b65['query'][_0xff76('0x5a')]);}})[_0xff76('0x12')](respondWithStatusCode(_0xce6686,null))[_0xff76('0x1d')](handleError(_0xce6686,null));};exports[_0xff76('0x5b')]=function(_0x5c4fdc,_0x273caf){if(_0x5c4fdc[_0xff76('0x52')]['id']){delete _0x5c4fdc[_0xff76('0x52')]['id'];}return db[_0xff76('0x2f')]['find']({'where':{'id':_0x5c4fdc[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x273caf,null))['then'](function(_0x493232){if(_0x493232){_0x5c4fdc[_0xff76('0x52')][_0xff76('0x55')]=_0x493232['id'];return db[_0xff76('0x5c')][_0xff76('0x49')](_0x5c4fdc[_0xff76('0x52')]);}})['then'](respondWithResult(_0x273caf,null))[_0xff76('0x1d')](handleError(_0x273caf,null));};exports['getAnswers']=function(_0x5c3976,_0x3dbe76){var _0x565a72={'raw':![],'where':{}};var _0x2c269c={};var _0x140719={'count':0x0,'rows':[]};return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x5c3976[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x3dbe76,null))[_0xff76('0x12')](function(_0x5936ad){if(_0x5936ad){_0x2c269c['model']=_[_0xff76('0x33')](db[_0xff76('0x5c')]['rawAttributes']);_0x2c269c[_0xff76('0x34')]=_[_0xff76('0x33')](_0x5c3976[_0xff76('0x34')]);_0x2c269c['filters']=_[_0xff76('0x37')](_0x2c269c[_0xff76('0x32')],_0x2c269c[_0xff76('0x34')]);_0x565a72[_0xff76('0x36')]=_[_0xff76('0x37')](_0x2c269c[_0xff76('0x32')],qs[_0xff76('0x38')](_0x5c3976[_0xff76('0x34')]['fields']));_0x565a72[_0xff76('0x36')]=_0x565a72[_0xff76('0x36')]['length']?_0x565a72[_0xff76('0x36')]:_0x2c269c[_0xff76('0x32')];if(!_0x5c3976[_0xff76('0x34')]['hasOwnProperty'](_0xff76('0x5e'))){_0x565a72['limit']=qs[_0xff76('0x24')](_0x5c3976[_0xff76('0x34')][_0xff76('0x24')]);_0x565a72['offset']=qs[_0xff76('0x22')](_0x5c3976[_0xff76('0x34')][_0xff76('0x22')]);}_0x565a72['order']=qs[_0xff76('0x3b')](_0x5c3976['query'][_0xff76('0x3b')]);_0x565a72[_0xff76('0x3c')]=qs['filters'](_[_0xff76('0x3d')](_0x5c3976[_0xff76('0x34')],_0x2c269c[_0xff76('0x35')]));_0x565a72[_0xff76('0x3c')][_0xff76('0x55')]=_0x5936ad['id'];if(_0x5c3976[_0xff76('0x34')][_0xff76('0x3e')]){_0x565a72[_0xff76('0x3c')]=_['merge'](_0x565a72[_0xff76('0x3c')],{'$or':_[_0xff76('0x2e')](_0x565a72[_0xff76('0x36')],function(_0x24b219){var _0x5f21cb={};_0x5f21cb[_0x24b219]={'$like':'%'+_0x5c3976[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x5f21cb;})});}_0x565a72=_[_0xff76('0x3f')]({},_0x565a72,_0x5c3976[_0xff76('0x47')]);return db[_0xff76('0x5c')][_0xff76('0x25')]({'where':_0x565a72['where']})[_0xff76('0x12')](function(_0xf3a78a){_0x140719[_0xff76('0x25')]=_0xf3a78a;if(_0x5c3976[_0xff76('0x34')][_0xff76('0x41')]){_0x565a72[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x5c')][_0xff76('0x58')](_0x565a72);})['then'](function(_0x5f2e2e){_0x140719[_0xff76('0x43')]=_0x5f2e2e;return _0x140719;});}})[_0xff76('0x12')](respondWithFilteredResult(_0x3dbe76,_0x565a72))[_0xff76('0x1d')](handleError(_0x3dbe76,null));};exports[_0xff76('0x5f')]=function(_0x12bf1e,_0x548b10){return db['ChatWebsite']['find']({'where':{'id':_0x12bf1e[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x548b10,null))[_0xff76('0x12')](function(_0x3308e0){if(_0x3308e0){return _0x3308e0[_0xff76('0x5f')](_0x12bf1e[_0xff76('0x34')][_0xff76('0x5a')]);}})[_0xff76('0x12')](respondWithStatusCode(_0x548b10,null))[_0xff76('0x1d')](handleError(_0x548b10,null));};exports['addLogo']=function(_0x455048,_0x4d6907){_0x455048[_0xff76('0x52')]['sitepic']=_0x455048[_0xff76('0x60')]['filename'];return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x455048[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x4d6907,null))[_0xff76('0x12')](saveUpdates(_0x455048['body'],null))[_0xff76('0x12')](respondWithResult(_0x4d6907,null))[_0xff76('0x1d')](handleError(_0x4d6907,null));};exports[_0xff76('0x61')]=function(_0xaeb944,_0x182161){_0xaeb944[_0xff76('0x52')][_0xff76('0x62')]=_0xaeb944[_0xff76('0x60')]['filename'];return db[_0xff76('0x2f')]['find']({'where':{'id':_0xaeb944['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x182161,null))[_0xff76('0x12')](saveUpdates(_0xaeb944[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x182161,null))['catch'](handleError(_0x182161,null));};exports[_0xff76('0x63')]=function(_0x36002c,_0x5c0d44){_0x36002c[_0xff76('0x52')]['customerAvatar']=_0x36002c['file'][_0xff76('0x64')];return db['ChatWebsite'][_0xff76('0x48')]({'where':{'id':_0x36002c['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x5c0d44,null))[_0xff76('0x12')](saveUpdates(_0x36002c[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x5c0d44,null))[_0xff76('0x1d')](handleError(_0x5c0d44,null));};exports[_0xff76('0x65')]=function(_0x545011,_0x4dfc36){_0x545011[_0xff76('0x52')][_0xff76('0x66')]=_0x545011[_0xff76('0x60')]['filename'];return db['ChatWebsite'][_0xff76('0x48')]({'where':{'id':_0x545011[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x4dfc36,null))[_0xff76('0x12')](saveUpdates(_0x545011[_0xff76('0x52')],null))[_0xff76('0x12')](respondWithResult(_0x4dfc36,null))[_0xff76('0x1d')](handleError(_0x4dfc36,null));};exports['getLogo']=function(_0x501bd9,_0x262939){var _0x3dfb83=path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/images/logos/default_logo.svg');var _0x5d56fc={'where':{'id':_0x501bd9[_0xff76('0x45')]['id']},'attributes':['id',_0xff76('0x69')],'raw':!![]};var _0x23f579=![];return require(_0xff76('0x6a'))[_0xff76('0x6b')]()[_0xff76('0x12')](function(_0x4f061b){if(_0x4f061b){_0x23f579=_0x4f061b[_0xff76('0x6c')];}})['then'](function(){return db['ChatWebsite'][_0xff76('0x48')](_0x5d56fc);})[_0xff76('0x12')](handleEntityNotFound(_0x262939,null))[_0xff76('0x12')](function(_0x60ac86){if(_0x60ac86){if(!_[_0xff76('0x6d')](_0x60ac86['sitepic'])){if(fs[_0xff76('0x6e')](path['join'](config[_0xff76('0x68')],_0xff76('0x6f'),_0x60ac86[_0xff76('0x69')]))&&_0x23f579){_0x3dfb83=path[_0xff76('0x67')](config[_0xff76('0x68')],_0xff76('0x6f'),_0x60ac86[_0xff76('0x69')]);}}return _0x262939[_0xff76('0x70')](_0x3dfb83);}})[_0xff76('0x1d')](handleError(_0x262939,null));};exports[_0xff76('0x71')]=function(_0x150432,_0x2e117f){var _0x1d05a1=path[_0xff76('0x67')](config['root'],_0xff76('0x72'));var _0x5ee470={'where':{'id':_0x150432['params']['id']},'attributes':['id',_0xff76('0x62')],'raw':!![]};return db[_0xff76('0x2f')]['find'](_0x5ee470)['then'](handleEntityNotFound(_0x2e117f,null))['then'](function(_0x54c2bf){if(_0x54c2bf){if(!_[_0xff76('0x6d')](_0x54c2bf[_0xff76('0x62')])){if(fs['existsSync'](path['join'](config[_0xff76('0x68')],'server/files/images/avatars/',_0x54c2bf[_0xff76('0x62')]))){_0x1d05a1=path['join'](config[_0xff76('0x68')],_0xff76('0x73'),_0x54c2bf[_0xff76('0x62')]);}}return _0x2e117f[_0xff76('0x70')](_0x1d05a1);}})[_0xff76('0x1d')](handleError(_0x2e117f,null));};exports[_0xff76('0x74')]=function(_0x4db541,_0x1a5a04){var _0x498f8a=path[_0xff76('0x67')](config['root'],_0xff76('0x75'));var _0x29c33f={'where':{'id':_0x4db541['params']['id']},'attributes':['id','customerAvatar',_0xff76('0x76')],'raw':!![]};return db[_0xff76('0x2f')][_0xff76('0x48')](_0x29c33f)[_0xff76('0x12')](handleEntityNotFound(_0x1a5a04,null))['then'](function(_0x94152d){if(_0x94152d){if(!_['isNil'](_0x94152d[_0xff76('0x77')])){if(fs[_0xff76('0x6e')](path[_0xff76('0x67')](config[_0xff76('0x68')],_0xff76('0x73'),_0x94152d['customerAvatar']))&&_0x94152d[_0xff76('0x76')]){_0x498f8a=path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/images/avatars/',_0x94152d['customerAvatar']);}}return _0x1a5a04[_0xff76('0x70')](_0x498f8a);}})[_0xff76('0x1d')](handleError(_0x1a5a04,null));};exports[_0xff76('0x78')]=function(_0x5ee5dc,_0x1c5051){var _0xc8293c=path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/images/avatars/system_avatar.png');var _0xcc3315={'where':{'id':_0x5ee5dc[_0xff76('0x45')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xff76('0x2f')]['find'](_0xcc3315)[_0xff76('0x12')](handleEntityNotFound(_0x1c5051,null))[_0xff76('0x12')](function(_0x38de8d){if(_0x38de8d){if(!_['isNil'](_0x38de8d[_0xff76('0x66')])){if(fs[_0xff76('0x6e')](path['join'](config[_0xff76('0x68')],_0xff76('0x73'),_0x38de8d['systemAvatar']))){_0xc8293c=path[_0xff76('0x67')](config['root'],_0xff76('0x73'),_0x38de8d[_0xff76('0x66')]);}}return _0x1c5051['download'](_0xc8293c);}})[_0xff76('0x1d')](handleError(_0x1c5051,null));};exports['notify']=function(_0x3084ba,_0x3eab89){var _0x652683=require(_0xff76('0x79'));var _0x3b3e6d=new _0x652683();var _0x224e72=_0x3b3e6d[_0xff76('0x7a')](_0x3084ba[_0xff76('0x7b')][_0xff76('0x7c')])[_0xff76('0x7d')]();var _0x251964={'body':_0x3084ba[_0xff76('0x52')],'channel':_0xff76('0x7e')};var _0x4090fb=[];var _0xff0a50=[];var _0x1418aa={};var _0x29b229=![];return db[_0xff76('0x7f')][_0xff76('0x54')]()[_0xff76('0x12')](function(_0x188aa5){if(!_0x188aa5){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))]('no\x20available\x20attributes');}_0x4090fb=_[_0xff76('0x82')](_[_0xff76('0x33')](_0x188aa5),[_0xff76('0x83'),_0xff76('0x84')]);_0xff0a50=_[_0xff76('0x82')](_[_0xff76('0x33')](_0x188aa5),[_0xff76('0x83'),_0xff76('0x84'),_0xff76('0x85'),_0xff76('0x86')]);if(_0x3084ba[_0xff76('0x52')]['id']){delete _0x3084ba[_0xff76('0x52')]['id'];}if(_[_0xff76('0x6d')](_0x3084ba[_0xff76('0x52')][_0xff76('0x87')])){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x88'));}if(_[_0xff76('0x6d')](_0x3084ba[_0xff76('0x52')][_0xff76('0x52')])||_0x3084ba['body'][_0xff76('0x52')]===''){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x89'));}if(_['isNil'](_0x3084ba[_0xff76('0x52')][_0xff76('0x8a')])){throw new db[(_0xff76('0x80'))]['ValidationError'](_0xff76('0x8b')+_0xff0a50);}if(!_[_0xff76('0x8c')](_0xff0a50,_0x3084ba['body'][_0xff76('0x8a')])){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x8d')+_0xff0a50);}_0x1418aa[_0x3084ba[_0xff76('0x52')][_0xff76('0x8a')]]=_0x3084ba[_0xff76('0x52')]['from'];})['then'](function(){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x3084ba[_0xff76('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0xff76('0x8e'),'include':[{'model':db[_0xff76('0x7f')],'as':_0xff76('0x8f'),'where':_0x1418aa,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xff76('0x90')],'as':_0xff76('0x91')}]});})['then'](handleEntityNotFound(_0x3eab89,null))[_0xff76('0x12')](function(_0x18aaf2){if(_0x18aaf2&&_0x18aaf2[_0xff76('0x8e')]){_0x251964['account']=_0x18aaf2;_0x251964['applications']=_0x18aaf2[_0xff76('0x91')];_0x251964[_0xff76('0x92')]=_0x18aaf2['List'];_0x251964['applications']=_[_0xff76('0x93')](_0x251964[_0xff76('0x94')],[_0xff76('0x95')],['asc']);if(_0x251964[_0xff76('0x96')]['Applications']){delete _0x251964['account'][_0xff76('0x91')];}if(_0x251964[_0xff76('0x96')][_0xff76('0x8e')]&&_0x251964['account'][_0xff76('0x8e')][_0xff76('0x8f')][_0xff76('0x46')]){return _0x251964[_0xff76('0x96')][_0xff76('0x8e')][_0xff76('0x8f')][0x0];}var _0x257837=_[_0xff76('0xb')](_0x3084ba[_0xff76('0x52')],{'firstName':_0x3084ba[_0xff76('0x52')][_0xff76('0x87')],'ListId':_0x18aaf2[_0xff76('0x86')]});_0x257837[_0x3084ba[_0xff76('0x52')][_0xff76('0x8a')]]=_0x3084ba[_0xff76('0x52')][_0xff76('0x87')];return db[_0xff76('0x7f')]['create'](_0x257837,{'fields':_0x4090fb,'raw':!![]});}})[_0xff76('0x12')](handleEntityNotFound(_0x3eab89,null))[_0xff76('0x12')](function(_0x485058){_0x251964[_0xff76('0x97')]=_0x485058;var _0x1e1993=_0x3084ba['body'][_0xff76('0x98')];if(_0x3084ba[_0xff76('0x7b')][_0xff76('0x99')]){_0x1e1993=_0x3084ba[_0xff76('0x7b')]['cf-connecting-ip'];}else if(_0x3084ba[_0xff76('0x7b')]['x-forwarded-for']){_0x1e1993=_[_0xff76('0x9a')](_0x3084ba[_0xff76('0x7b')][_0xff76('0x9b')][_0xff76('0x9c')](','));}if(_0x485058){var _0x4bc602={'ContactId':_0x485058['id'],'ChatWebsiteId':_0x3084ba['params']['id'],'from':(_0x485058['firstName']||'')+'\x20'+(_0x485058['lastName']||''),'customerIp':_0x1e1993,'customerPort':_0x3084ba['headers']['x-real-port']?_0x3084ba[_0xff76('0x7b')]['x-real-port']:null,'referer':_0x3084ba['body'][_0xff76('0x9d')],'browserName':_0x224e72[_0xff76('0x9e')][_0xff76('0x2b')]&&_0x224e72[_0xff76('0x9e')][_0xff76('0x9f')]?util[_0xff76('0xa0')](_0xff76('0xa1'),_0x224e72[_0xff76('0x9e')][_0xff76('0x2b')],_0x224e72[_0xff76('0x9e')]['version']):_0xff76('0xa2'),'browserVersion':_0x224e72[_0xff76('0x9e')][_0xff76('0x9f')]||_0xff76('0xa2'),'osName':util[_0xff76('0xa0')](_0xff76('0xa1'),_0x224e72['os'][_0xff76('0x2b')],_0x224e72['os'][_0xff76('0x9f')]),'osVersion':_0x224e72['os'][_0xff76('0x9f')],'deviceModel':_0x224e72['device'][_0xff76('0x32')]&&_0x224e72['device'][_0xff76('0xa3')]?util[_0xff76('0xa0')](_0xff76('0xa4'),_0x224e72[_0xff76('0xa5')][_0xff76('0x32')],_0x224e72[_0xff76('0xa5')][_0xff76('0xa3')],_0x224e72['device'][_0xff76('0x31')]):null,'deviceVendor':_0x224e72[_0xff76('0xa5')][_0xff76('0xa3')],'deviceType':_0x224e72[_0xff76('0xa5')]['type'],'formData':JSON[_0xff76('0x18')](_0x3084ba[_0xff76('0x52')])};var _0x27b125={'ChatWebsiteId':_0x3084ba[_0xff76('0x45')]['id'],'closed':![]};if(_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')]){_0x27b125['threadId']=_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')];return db[_0xff76('0xa7')]['find']({'where':_0x27b125})[_0xff76('0x12')](function(_0x482a61){if(_0x482a61){return[_0x482a61,![]];}_0x4bc602['threadId']=_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')];_0x4bc602[_0xff76('0xa8')]=_0x3084ba['body']['externalUrl'];return db['ChatInteraction'][_0xff76('0x49')](_0x4bc602)[_0xff76('0x12')](function(_0x5c6aaf){return[_0x5c6aaf,!![]];});});}_0x27b125[_0xff76('0xa9')]=_0x485058['id'];if(_0x3084ba['body'][_0xff76('0xaa')]&&_0x3084ba[_0xff76('0x52')][_0xff76('0xaa')]['id']){_0x27b125['id']=_0x3084ba['body'][_0xff76('0xaa')]['id'];return db[_0xff76('0xa7')][_0xff76('0x48')]({'where':_0x27b125})[_0xff76('0x12')](function(_0x326b74){if(_0x326b74){return[_0x326b74,![]];}return db[_0xff76('0xa7')]['create'](_0x4bc602)['then'](function(_0x3c7764){return[_0x3c7764,!![]];});});}return db[_0xff76('0xa7')]['create'](_0x4bc602)[_0xff76('0x12')](function(_0x1737f0){return[_0x1737f0,!![]];});}})[_0xff76('0xab')](function(_0x289c26,_0x2fa575){if(_0x289c26){_0x29b229=_0x2fa575;if(!_0x2fa575){var _0x16b43a={'from':(_0x251964[_0xff76('0x97')][_0xff76('0xac')]||'')+'\x20'+(_0x251964['contact']['lastName']||'')};if(_0x3084ba[_0xff76('0x52')][_0xff76('0xa6')]&&_0x3084ba[_0xff76('0x52')][_0xff76('0xad')]&&_0x3084ba[_0xff76('0x52')]['threadId']!=_0x3084ba[_0xff76('0x52')]['messageId']){_0x16b43a[_0xff76('0xa6')]=_0x3084ba[_0xff76('0x52')][_0xff76('0xad')];}return _0x289c26['update'](_0x16b43a);}else{return _0x289c26;}}})[_0xff76('0x12')](function(_0x5ce9d4){_0x251964['interaction']=_0x5ce9d4[_0xff76('0x4b')]({'plain':!![]});_0x251964[_0xff76('0xaa')][_0xff76('0xae')]=_0x29b229;if(_0x251964[_0xff76('0xaa')][_0xff76('0xae')]){if(_0x251964['account'][_0xff76('0xaf')]){_0x251964[_0xff76('0x94')][_0xff76('0xb0')]({'id':0x0,'priority':_0x251964[_0xff76('0x94')][_0xff76('0x46')]+0x1,'app':'close','appdata':_0xff76('0xb1'),'interval':_0xff76('0xb2')});}}return db[_0xff76('0xb3')]['create']({'body':_0x3084ba[_0xff76('0x52')][_0xff76('0x52')],'ChatWebsiteId':_0x3084ba[_0xff76('0x45')]['id'],'ChatInteractionId':_0x5ce9d4['id'],'direction':'in','ContactId':_0x251964[_0xff76('0x97')]['id'],'AttachmentId':_0x3084ba[_0xff76('0x52')][_0xff76('0xb4')]});})[_0xff76('0x12')](function(_0x40fc83){_0x251964[_0xff76('0x1b')]=_0x40fc83;if(_0x251964['interaction'][_0xff76('0xb5')]){return db[_0xff76('0xb6')][_0xff76('0x48')]({'attributes':['id',_0xff76('0x2b')],'where':{'id':_0x251964[_0xff76('0xaa')][_0xff76('0xb5')]}})[_0xff76('0x12')](function(_0x1baddf){if(_0x1baddf){_0x251964[_0xff76('0x94')][_0xff76('0xb7')]({'id':0x0,'priority':0x0,'app':_0xff76('0xb8'),'appdata':_0x1baddf['name']+','+(_0x251964['account'][_0xff76('0xb9')]||0xa),'interval':_0xff76('0xb2')});_0x251964[_0xff76('0xba')]=!![];}return respondWithRpcPromise('Start',_0xff76('0xbb'),_0x251964);});}return respondWithRpcPromise(_0xff76('0xbc'),'startRouting',_0x251964);})['then'](function(_0x61c7f4){respondWithRpcPromise('EventManager',_0xff76('0xbd'),{'event':'notify','message':_0x61c7f4},client9002);return _0x61c7f4;})[_0xff76('0x12')](respondWithResult(_0x3eab89,null))[_0xff76('0x1d')](handleError(_0x3eab89,null));};exports[_0xff76('0xbe')]=function(_0x34eefb,_0x5460b8){var _0x35ebf1,_0x172a74,_0x6bddac;var _0x3b777c=[];var _0x2bad7f={};var _0x54b533=_0x34eefb[_0xff76('0xbf')]||[];var _0x5289ac=[];var _0x751f41;return db['CmContact']['describe']()[_0xff76('0x12')](function(_0x4e32e8){if(!_0x4e32e8){throw new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0xc0'));}_0x3b777c=_[_0xff76('0x82')](_[_0xff76('0x33')](_0x4e32e8),[_0xff76('0x83'),_0xff76('0x84'),_0xff76('0x85'),_0xff76('0x86')]);if(_0x34eefb['body']['id']){delete _0x34eefb[_0xff76('0x52')]['id'];}if(_[_0xff76('0x6d')](_0x34eefb['body'][_0xff76('0x87')])){throw _0x5460b8[_0xff76('0x1f')](0x1f4)[_0xff76('0xc1')](new db['Sequelize'][(_0xff76('0x81'))]('from\x20is\x20mandatory'));}if(_[_0xff76('0x6d')](_0x34eefb[_0xff76('0x52')][_0xff76('0x52')])||_0x34eefb[_0xff76('0x52')]['body']===''){throw _0x5460b8[_0xff76('0x1f')](0x1f4)[_0xff76('0xc1')](new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0x89')));}if(_[_0xff76('0x6d')](_0x34eefb[_0xff76('0x52')][_0xff76('0xc2')])){throw _0x5460b8[_0xff76('0x1f')](0x1f4)['send'](new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0xc3')+_0x3b777c));}if(!_['includes'](_0x3b777c,_0x34eefb[_0xff76('0x52')][_0xff76('0xc2')])){throw _0x5460b8[_0xff76('0x1f')](0x1f4)['send'](new db[(_0xff76('0x80'))][(_0xff76('0x81'))](_0xff76('0xc4')+_0x3b777c));}_0x2bad7f[_0x34eefb[_0xff76('0x52')]['mapKeyOffline']]=_0x34eefb['body']['from'];})[_0xff76('0x12')](function(){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x34eefb[_0xff76('0x45')]['id']},'include':[{'model':db[_0xff76('0xc5')],'as':_0xff76('0x8e')},{'model':db[_0xff76('0xc6')],'as':_0xff76('0xc6')}]});})[_0xff76('0x12')](handleEntityNotFound(_0x5460b8,null))['then'](function(_0x260952){if(_0x260952&&_0x260952[_0xff76('0x8e')]){_0x172a74=_0x260952;var _0x1deac5=_['defaults'](_0x34eefb[_0xff76('0x52')],{'firstName':_0x34eefb[_0xff76('0x52')][_0xff76('0x87')],'phone':_0x34eefb[_0xff76('0x52')][_0xff76('0x87')],'ListId':_0x260952[_0xff76('0x86')]});_0x1deac5[_0x34eefb[_0xff76('0x52')][_0xff76('0xc2')]]=_0x34eefb[_0xff76('0x52')]['from'];return db['CmContact'][_0xff76('0xc7')]({'where':_0x2bad7f,'defaults':_0x1deac5});}})[_0xff76('0xab')](function(_0x320b68){if(_0x320b68){_0x6bddac=_0x320b68;var _0x4044c8=fs[_0xff76('0xc8')](path['join'](config[_0xff76('0x68')],_0xff76('0xc9')),_0xff76('0xca'));var _0x5b191a=ejs[_0xff76('0xcb')](_0x4044c8,{'body':_[_0xff76('0xcc')](_0x34eefb[_0xff76('0x52')][_0xff76('0x52')]),'bodyTitle':_0x172a74['offlineMessageBody']});return db[_0xff76('0xcd')][_0xff76('0x49')]({'body':_0x5b191a,'ContactId':_0x320b68['id'],'ChatWebsiteId':_0x172a74['id']});}})[_0xff76('0x12')](function(_0x4890ed){_0x751f41=_0x4890ed;if(_0x54b533['length']){var _0x1b54f5=_0x54b533['map'](function(_0x4493e4){return{'name':_0x4493e4['originalname'],'basename':_0x4493e4['filename'],'type':_0x4493e4['mimetype'],'ChatOfflineMessageId':_0x4890ed['id']};});_0x5289ac=_0x1b54f5['map'](_0x29c31f=>{var _0x752362={'filename':_0x29c31f[_0xff76('0x2b')],'path':path[_0xff76('0x67')](config[_0xff76('0x68')],_0xff76('0xce'),'files','attachments',_0xff76('0xcf'),_0x29c31f[_0xff76('0xd0')])};return _0x752362;});if(!_0x172a74[_0xff76('0xd1')]){return db[_0xff76('0xd2')][_0xff76('0xd3')](function(_0xa74f3f){return db[_0xff76('0xd4')]['bulkCreate'](_0x1b54f5,{'transaction':_0xa74f3f});});}}})[_0xff76('0x12')](function(){if(_0x751f41){_0x35ebf1=_0x751f41;return db[_0xff76('0xc6')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xff76('0xd5'),'raw':!![]}]});}})[_0xff76('0x12')](function(_0x4c64ab){if(_0x4c64ab&&_0x4c64ab[_0xff76('0xd5')]&&_0x172a74[_0xff76('0xd6')]&&_0x172a74[_0xff76('0xd7')]){var _0x468ca2={'tls':{'rejectUnauthorized':![]}};if(_0x4c64ab[_0xff76('0xd5')][_0xff76('0xd8')]){_0x468ca2[_0xff76('0xd8')]=_0x4c64ab['Smtp']['service'];}else{_0x468ca2[_0xff76('0xd9')]=_0x4c64ab[_0xff76('0xd5')][_0xff76('0xd9')];_0x468ca2['port']=_0x4c64ab[_0xff76('0xd5')][_0xff76('0xda')];_0x468ca2[_0xff76('0xdb')]=_0x4c64ab['Smtp'][_0xff76('0xdb')];}if(_0x4c64ab[_0xff76('0xd5')][_0xff76('0xdc')]){_0x468ca2['auth']={'user':_0x4c64ab[_0xff76('0xd5')]['user'],'pass':_0x4c64ab[_0xff76('0xd5')][_0xff76('0xdd')]};}return respondWithRpcPromise(_0xff76('0xde'),_0xff76('0xdf'),{'account':_0x468ca2,'message':{'from':util[_0xff76('0xa0')](_0xff76('0xe0'),_0x4c64ab['name'],_0x4c64ab['email']||_0x4c64ab[_0xff76('0xd5')][_0xff76('0x4a')]),'to':_0x172a74[_0xff76('0xd7')],'subject':_0x172a74[_0xff76('0xe1')],'html':_0x35ebf1[_0xff76('0x52')],'attachments':_0x5289ac}},client9003)[_0xff76('0x12')](function(){return _0x35ebf1;})[_0xff76('0x1d')](function(_0xe9fa2){console[_0xff76('0x19')](_0xe9fa2);});}})[_0xff76('0x12')](function(){if(_0x172a74&&_0x172a74[_0xff76('0xd1')]&&_0x172a74[_0xff76('0xe2')]){var _0x48c45b=[];if(_0x54b533['length']){_0x48c45b=_0x54b533['map'](function(_0x31e079){return{'name':_0x31e079[_0xff76('0xe3')],'basename':_0x31e079[_0xff76('0x64')],'type':_0x31e079[_0xff76('0xe4')],'ChatOfflineMessageId':_0x751f41['id']};});}var _0x3c4dcd;if(!_['isNil'](_0x172a74[_0xff76('0xe5')])){var _0x16db62=_[_0xff76('0x2e')](_0x34eefb['body'],function(_0x3615b3){return _0x3615b3;});var _0x2bdd1f=_[_0xff76('0xe6')](_0x16db62)[0x0];var _0x1854fc=_['mapValues'](_0x2bdd1f,function(_0x121c96){return _0x121c96;});_0x3c4dcd=_0x1854fc[0x1][_0x172a74['subjectOffline']];}var _0x5c2043={'from':_0x6bddac['email'],'firstName':_0x6bddac[_0xff76('0xac')],'lastName':_0x6bddac[_0xff76('0xe7')],'mapKey':_0xff76('0xe8'),'message':{'from':_0x6bddac['email'],'to':_0x172a74['MailAccount']['email'],'cc':'','subject':_[_0xff76('0x6d')](_0x3c4dcd)?_0x172a74['offlineMessageSubject']:_0x3c4dcd,'messageId':'','sentAt':new Date(),'attach':_0x48c45b[_0xff76('0x46')],'attachments':_0x48c45b,'originChannel':'Chat','ChatWebsiteId':_0x172a74['id'],'ChatOfflineMessageId':_0x35ebf1['id'],'originTo':_0x172a74[_0xff76('0xc6')]['email']},'body':_0x35ebf1[_0xff76('0x52')]};var _0x3d337b={'account':{'id':_0x172a74['MailAccountId']},'body':_0x5c2043,'log':_0xff76('0xe9')};return respondWithRpcPromise('NotifyMailAccount',_0xff76('0xea'),_0x3d337b,client9001)[_0xff76('0x12')](function(){return _0x35ebf1;})[_0xff76('0x1d')](function(_0x2bbc11){console[_0xff76('0x19')](_0x2bbc11);});}return;})[_0xff76('0x12')](function(){if(_0x35ebf1){return _0x35ebf1;}})['then'](respondWithResult(_0x5460b8,null))['catch'](function(_0x21ceb8){console['error'](_0xff76('0x1d'),_0x21ceb8);for(var _0x2787c7 of _0x54b533){var _0x1eabfa=path['join'](config[_0xff76('0x68')],'server',_0xff76('0xbf'),_0xff76('0xeb'),'offline-chat',_0x2787c7[_0xff76('0x64')]);fs_extra[_0xff76('0xec')](_0x1eabfa)[_0xff76('0x1d')](function(_0x492f71){console[_0xff76('0x19')](_0xff76('0xed'),_0x1eabfa,_0x492f71);});}});};exports[_0xff76('0xee')]=function(_0x32690b,_0x29dc83){return db[_0xff76('0xa7')]['find']({'where':{'id':_0x32690b['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x29dc83,null))['then'](function(_0x2f98d4){if(_0x2f98d4){return _0x2f98d4['addInteraction'](_0x32690b[_0xff76('0x52')]['ids'],_['omit'](_0x32690b[_0xff76('0x52')],[_0xff76('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x29dc83,null))[_0xff76('0x1d')](handleError(_0x29dc83,null));};exports[_0xff76('0xef')]=function(_0x293b8f,_0xc7e8dd){var _0x506dce={'raw':![],'where':{}};var _0x4fa9ae={};var _0x3d9a8a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xff76('0x5d')]({'where':{'id':_0x293b8f[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0xc7e8dd,null))[_0xff76('0x12')](function(_0x1f3250){if(_0x1f3250){_0x4fa9ae['model']=_['keys'](db['ChatInteraction'][_0xff76('0x30')]);_0x4fa9ae[_0xff76('0x34')]=_['keys'](_0x293b8f[_0xff76('0x34')]);_0x4fa9ae['filters']=_[_0xff76('0x37')](_0x4fa9ae[_0xff76('0x32')],_0x4fa9ae[_0xff76('0x34')]);_0x506dce[_0xff76('0x36')]=_[_0xff76('0x37')](_0x4fa9ae['model'],qs[_0xff76('0x38')](_0x293b8f[_0xff76('0x34')]['fields']));_0x506dce[_0xff76('0x36')]=_0x506dce['attributes'][_0xff76('0x46')]?_0x506dce[_0xff76('0x36')]:_0x4fa9ae[_0xff76('0x32')];if(!_0x293b8f['query']['hasOwnProperty'](_0xff76('0x5e'))){_0x506dce[_0xff76('0x24')]=qs[_0xff76('0x24')](_0x293b8f[_0xff76('0x34')][_0xff76('0x24')]);_0x506dce['offset']=qs[_0xff76('0x22')](_0x293b8f[_0xff76('0x34')][_0xff76('0x22')]);}_0x506dce[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x293b8f[_0xff76('0x34')]['sort']);_0x506dce[_0xff76('0x3c')]=qs['filters'](_[_0xff76('0x3d')](_0x293b8f[_0xff76('0x34')],_0x4fa9ae['filters']));_0x506dce['where']['ChatWebsiteId']=_0x1f3250['id'];if(_0x293b8f[_0xff76('0x34')][_0xff76('0x3e')]){_0x506dce[_0xff76('0x3c')]=_['merge'](_0x506dce[_0xff76('0x3c')],{'$or':_['map'](_0x506dce['attributes'],function(_0xa14458){var _0x516416={};_0x516416[_0xa14458]={'$like':'%'+_0x293b8f[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x516416;})});}_0x506dce=_['merge']({},_0x506dce,_0x293b8f[_0xff76('0x47')]);return db[_0xff76('0xa7')]['count']({'where':_0x506dce[_0xff76('0x3c')]})[_0xff76('0x12')](function(_0x3f1ac6){_0x3d9a8a[_0xff76('0x25')]=_0x3f1ac6;if(_0x293b8f[_0xff76('0x34')][_0xff76('0x41')]){_0x506dce[_0xff76('0x42')]=[{'model':db['CmContact'],'as':_0xff76('0xf0'),'required':![]},{'model':db['User'],'as':_0xff76('0xf1'),'attributes':['name',_0xff76('0xf2'),_0xff76('0xf3')],'required':![]},{'model':db['Tag'],'as':_0xff76('0xf4'),'attributes':['id','name',_0xff76('0xf5')],'where':_0x293b8f['query'][_0xff76('0xf6')]?{'id':_0x293b8f[_0xff76('0x34')][_0xff76('0xf6')]}:undefined,'required':_0x293b8f['query'][_0xff76('0xf6')]?!![]:![]}];}return db['ChatInteraction'][_0xff76('0x58')](_0x506dce);})[_0xff76('0x12')](function(_0x5b1531){_0x3d9a8a[_0xff76('0x43')]=_0x5b1531;return _0x3d9a8a;});}})[_0xff76('0x12')](respondWithFilteredResult(_0xc7e8dd,_0x506dce))[_0xff76('0x1d')](handleError(_0xc7e8dd,null));};function iftimePromise(_0x2f7f1f,_0x2f847f){return respondWithRpcPromise(_0xff76('0xf7'),'getSnippet',{'command':_0x2f847f['timezone']?util[_0xff76('0xa0')]('iftime\x20%s,%s',_0x2f7f1f[_0xff76('0xf8')],_0x2f847f[_0xff76('0xf9')]):util[_0xff76('0xa0')](_0xff76('0xfa'),_0x2f7f1f[_0xff76('0xf8')])},client9002)[_0xff76('0x12')](function(_0x2a5c5f){var _0x3f19f8=_0x2a5c5f&&_0x2a5c5f[_0xff76('0xfb')](_0xff76('0xfc'))>=0x0?!![]:![];logger[_0xff76('0x13')](_0xff76('0xfd'),_0x2f847f['id'],_0x2f7f1f['id'],_0x2f7f1f[_0xff76('0xf8')],_0x3f19f8?_0xff76('0xfe'):_0xff76('0xff'),_0x2f847f['timezone']?_0x2f847f[_0xff76('0xf9')]:_0xff76('0x100'));return _0x3f19f8;})[_0xff76('0x1d')](function(_0x4f1bef){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2f847f['id'],_0x2f7f1f['id'],_0x2f7f1f[_0xff76('0xf8')],util[_0xff76('0x101')](_0x4f1bef,{'showHidden':![],'depth':null}),_0x2f847f[_0xff76('0xf9')]?_0x2f847f[_0xff76('0xf9')]:'No\x20timezone');return![];});}exports[_0xff76('0x102')]=function(_0x1b3545,_0x10eb47){var _0x5582b0=0x0;var _0xacaa9b=0x0;var _0x48bc72=![];var _0x4101da;var _0x3d7bd6;return db[_0xff76('0x2f')]['find']({'where':{'id':_0x1b3545[_0xff76('0x45')]['id']},'include':[{'model':db[_0xff76('0x103')],'as':'Interval','include':[{'model':db[_0xff76('0x103')],'as':'Intervals','attributes':['id',_0xff76('0xf8')],'raw':!![]}]}]})[_0xff76('0x12')](handleEntityNotFound(_0x10eb47,null))[_0xff76('0x12')](function(_0x38ad6e){if(_0x38ad6e){_0x4101da=_0x38ad6e;return _0x38ad6e[_0xff76('0x104')]({'raw':!![]});}})[_0xff76('0x12')](function(_0x31a5bf){if(_0x4101da){if(_0x31a5bf){_0x3d7bd6=_0x31a5bf;}}return require(_0xff76('0x6a'))[_0xff76('0x6b')]();})[_0xff76('0x12')](function(_0x637e31){if(_0x637e31){_0xacaa9b=_0x637e31['virtual'];_0x48bc72=_0x637e31[_0xff76('0x6c')];}})[_0xff76('0x12')](function(){return db['ChatInteraction'][_0xff76('0x25')]({'where':{'closed':![]}});})[_0xff76('0x12')](function(_0x2f1986){_0x5582b0=_0x2f1986;if(_0xacaa9b&&_0x2f1986>_0xacaa9b){return db[_0xff76('0x105')][_0xff76('0x5d')]({'where':{'id':0x1}})['then'](function(_0x6dccf0){if(_0x6dccf0){_0x6dccf0[_0xff76('0x106')](_0xff76('0x107'));}});}})[_0xff76('0x12')](function(){if(_0x4101da[_0xff76('0x103')]&&_0x4101da[_0xff76('0x103')][_0xff76('0x108')]){var _0x5d6806=[];for(var _0x2943ee=0x0;_0x2943ee<_0x4101da[_0xff76('0x103')][_0xff76('0x108')][_0xff76('0x46')];_0x2943ee++){var _0x425a7f=_0x4101da[_0xff76('0x103')][_0xff76('0x108')][_0x2943ee][_0xff76('0x4b')]({'plain':!![]});_0x5d6806[_0xff76('0xb0')](iftimePromise(_0x425a7f,_0x4101da));}return BPromise['all'](_0x5d6806)[_0xff76('0x12')](function(_0x2ed84a){return _[_0xff76('0x109')](_0x2ed84a);});}else{return!![];}})['then'](function(_0x16068b){var _0x4c8fc3=fs[_0xff76('0xc8')](path[_0xff76('0x67')](config[_0xff76('0x68')],'server/files/chat/iframe.ejs'),_0xff76('0xca'));var _0x459727={'remote':_0x4101da[_0xff76('0x10a')],'query':querystring['stringify'](_[_0xff76('0x3f')](_0x4101da[_0xff76('0x4b')]({'plain':!![]}),{'customerIp':_0x1b3545[_0xff76('0x7b')]['x-forwarded-for']||_0x1b3545[_0xff76('0x7b')]['x-real-ip']||_0x1b3545[_0xff76('0x10b')]['remoteAddress']||_0x1b3545['ip'],'referer':_0x1b3545[_0xff76('0x7b')][_0xff76('0x9d')],'openedInteractions':_0x5582b0,'maxInteractions':_0xacaa9b,'virtual':_0x48bc72[_0xff76('0x10c')],'online':_0x16068b,'custom':_0x48bc72}))[_0xff76('0x10d')](/'/g,'\x5c\x27')};_0x10eb47[_0xff76('0xc1')](ejs['render'](Mustache[_0xff76('0xcb')](_0x4c8fc3,_0x459727),{'proactiveActions':_0x3d7bd6,'alignment':_0x4101da[_0xff76('0x10e')],'verticalAlignment':_0x4101da['verticalAlignment'],'div_color':_0x4101da[_0xff76('0xf5')],'text_color':_0x4101da[_0xff76('0x10f')],'button_color':_0x4101da[_0xff76('0x110')],'background_color':_0x4101da[_0xff76('0x111')]}));})['catch'](handleError(_0x10eb47,null));};exports[_0xff76('0x112')]=function(_0x33055b,_0x3d4a51){var _0x3eaad9=_0x33055b[_0xff76('0x45')]['id'];var _0x1c54bd=_0x33055b[_0xff76('0x52')];var _0x2756eb=0xc8;var _0x451384=null;return db['sequelize'][_0xff76('0xd3')]({'isolationLevel':db[_0xff76('0xd2')][_0xff76('0x113')][_0xff76('0x114')][_0xff76('0x115')]},function(_0x4a3d33){return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x3eaad9},'transaction':_0x4a3d33})[_0xff76('0x12')](function(_0x9a8476){if(_0x9a8476){return db['ChatApplication'][_0xff76('0x28')]({'where':{'ChatWebsiteId':_0x3eaad9},'transaction':_0x4a3d33})['then'](function(){var _0x5f2f6b=_[_0xff76('0x2e')](_0x1c54bd,function(_0x48608a){_0x48608a['ChatWebsiteId']=_0x3eaad9;return _0x48608a;});return db[_0xff76('0x90')][_0xff76('0x116')](_0x5f2f6b,{'transaction':_0x4a3d33});});}else{_0x2756eb=0x194;_0x451384=[];}});})['then'](function(){if(_0x2756eb!==0x194){return db[_0xff76('0x90')][_0xff76('0x117')]({'where':{'ChatWebsiteId':_0x3eaad9},'order':'priority'})[_0xff76('0x12')](function(_0x27f1c7){_0x451384=_0x27f1c7;});}})[_0xff76('0x1d')](function(_0x28ea2e){_0x2756eb=0x1f4;logger[_0xff76('0x19')](_0x28ea2e[_0xff76('0x2a')]);if(_0x28ea2e[_0xff76('0x2b')]){delete _0x28ea2e[_0xff76('0x2b')];}_0x451384=_0x28ea2e;})[_0xff76('0x118')](function(){if(_0x451384===null){_0x3d4a51[_0xff76('0x1e')](_0x2756eb);}else{if(_0x2756eb===0x1f4){_0x3d4a51['status'](_0x2756eb)[_0xff76('0xc1')](_0x451384);}else{_0x3d4a51[_0xff76('0x1f')](_0x2756eb)[_0xff76('0x21')](_0x451384);}}});};exports['getApplications']=function(_0x56687d,_0x5687be){var _0x544a74={};var _0x33cfc1={};var _0x2ba0ad;var _0x41a469;return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x56687d[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x5687be,null))['then'](function(_0x471cbf){if(_0x471cbf){_0x2ba0ad=_0x471cbf;_0x33cfc1[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0x90')][_0xff76('0x30')]);_0x33cfc1[_0xff76('0x34')]=_[_0xff76('0x33')](_0x56687d['query']);_0x33cfc1[_0xff76('0x35')]=_[_0xff76('0x37')](_0x33cfc1[_0xff76('0x32')],_0x33cfc1[_0xff76('0x34')]);_0x544a74[_0xff76('0x36')]=_['intersection'](_0x33cfc1[_0xff76('0x32')],qs[_0xff76('0x38')](_0x56687d['query']['fields']));_0x544a74[_0xff76('0x36')]=_0x544a74['attributes'][_0xff76('0x46')]?_0x544a74[_0xff76('0x36')]:_0x33cfc1[_0xff76('0x32')];_0x544a74[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x56687d[_0xff76('0x34')][_0xff76('0x3b')]);_0x544a74['where']=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0x56687d[_0xff76('0x34')],_0x33cfc1[_0xff76('0x35')]));if(_0x56687d[_0xff76('0x34')][_0xff76('0x3e')]){_0x544a74[_0xff76('0x3c')]=_[_0xff76('0x3f')](_0x544a74['where'],{'$or':_['map'](_0x544a74[_0xff76('0x36')],function(_0x3c7590){var _0x35d540={};_0x35d540[_0x3c7590]={'$like':'%'+_0x56687d[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x35d540;})});}_0x544a74=_[_0xff76('0x3f')]({},_0x544a74,_0x56687d[_0xff76('0x47')]);return _0x2ba0ad['getApplications'](_0x544a74);}})['then'](function(_0xb9ba5c){if(_0xb9ba5c){_0x41a469=_0xb9ba5c[_0xff76('0x46')];if(!_0x56687d[_0xff76('0x34')][_0xff76('0x39')]('nolimit')){_0x544a74['limit']=qs[_0xff76('0x24')](_0x56687d[_0xff76('0x34')][_0xff76('0x24')]);_0x544a74[_0xff76('0x22')]=qs['offset'](_0x56687d[_0xff76('0x34')]['offset']);}return _0x2ba0ad[_0xff76('0x119')](_0x544a74);}})[_0xff76('0x12')](function(_0x7e7698){if(_0x7e7698){return _0x7e7698?{'count':_0x41a469,'rows':_0x7e7698}:null;}})['then'](respondWithResult(_0x5687be,null))[_0xff76('0x1d')](handleError(_0x5687be,null));};exports['addProactiveActions']=function(_0x4c60b5,_0x347618){return db[_0xff76('0x11a')][_0xff76('0x48')]({'where':{'id':_0x4c60b5['params']['id']}})['then'](handleEntityNotFound(_0x347618,null))[_0xff76('0x12')](function(_0x3f755c){if(_0x3f755c){return _0x3f755c[_0xff76('0x11b')](_0x4c60b5['body'][_0xff76('0x5a')],_[_0xff76('0x11c')](_0x4c60b5[_0xff76('0x52')],[_0xff76('0x5a'),'id'])||{});}})[_0xff76('0x12')](respondWithResult(_0x347618,null))['catch'](handleError(_0x347618,null));};exports[_0xff76('0x104')]=function(_0x41f593,_0x46f55c){var _0x556db4={};var _0x22b9c1={};var _0x2e5691;var _0x5f472a;return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x41f593['params']['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x46f55c,null))[_0xff76('0x12')](function(_0x7e5465){if(_0x7e5465){_0x2e5691=_0x7e5465;_0x22b9c1[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0x11d')][_0xff76('0x30')]);_0x22b9c1[_0xff76('0x34')]=_[_0xff76('0x33')](_0x41f593[_0xff76('0x34')]);_0x22b9c1['filters']=_[_0xff76('0x37')](_0x22b9c1['model'],_0x22b9c1['query']);_0x556db4[_0xff76('0x36')]=_[_0xff76('0x37')](_0x22b9c1[_0xff76('0x32')],qs[_0xff76('0x38')](_0x41f593[_0xff76('0x34')][_0xff76('0x38')]));_0x556db4[_0xff76('0x36')]=_0x556db4[_0xff76('0x36')][_0xff76('0x46')]?_0x556db4[_0xff76('0x36')]:_0x22b9c1[_0xff76('0x32')];_0x556db4['order']=qs[_0xff76('0x3b')](_0x41f593[_0xff76('0x34')][_0xff76('0x3b')]);_0x556db4[_0xff76('0x3c')]=qs[_0xff76('0x35')](_['pick'](_0x41f593[_0xff76('0x34')],_0x22b9c1[_0xff76('0x35')]));if(_0x41f593[_0xff76('0x34')][_0xff76('0x3e')]){_0x556db4[_0xff76('0x3c')]=_['merge'](_0x556db4['where'],{'$or':_[_0xff76('0x2e')](_0x556db4[_0xff76('0x36')],function(_0x31929b){var _0x491fa8={};_0x491fa8[_0x31929b]={'$like':'%'+_0x41f593[_0xff76('0x34')][_0xff76('0x3e')]+'%'};return _0x491fa8;})});}_0x556db4=_['merge']({},_0x556db4,_0x41f593[_0xff76('0x47')]);return _0x2e5691[_0xff76('0x104')](_0x556db4);}})['then'](function(_0x1acfb3){if(_0x1acfb3){_0x5f472a=_0x1acfb3[_0xff76('0x46')];if(!_0x41f593['query']['hasOwnProperty'](_0xff76('0x5e'))){_0x556db4['limit']=qs[_0xff76('0x24')](_0x41f593[_0xff76('0x34')]['limit']);_0x556db4[_0xff76('0x22')]=qs[_0xff76('0x22')](_0x41f593[_0xff76('0x34')]['offset']);}return _0x2e5691['getProactiveActions'](_0x556db4);}})[_0xff76('0x12')](function(_0x4e2973){if(_0x4e2973){return _0x4e2973?{'count':_0x5f472a,'rows':_0x4e2973}:null;}})[_0xff76('0x12')](respondWithResult(_0x46f55c,null))[_0xff76('0x1d')](handleError(_0x46f55c,null));};exports[_0xff76('0x11e')]=function(_0x4cef74,_0x2b09c3){var _0x4df0cb=_0x4cef74['query'][_0xff76('0x11f')]===_0xff76('0x120')?_0xff76('0x121'):_0xff76('0x122');return db['ChatWebsite'][_0xff76('0x48')]({'attributes':['id',_0x4df0cb],'where':{'id':_0x4cef74['params']['id']}})['then'](handleEntityNotFound(_0x2b09c3,null))[_0xff76('0x12')](function(_0x4b688c){if(_0x4b688c){var _0x4ebf12=_0x4b688c[_0x4df0cb];var _0x1567f3=_0x4ebf12&&_0x4ebf12[_0xff76('0x123')]?_0x4ebf12[_0xff76('0x123')]:[];_0x2b09c3[_0xff76('0xc1')]({'fromKey':_[_0xff76('0x6d')](_0x4ebf12[_0xff76('0x124')])?undefined:_0x4ebf12['fromKey'],'count':_0x1567f3[_0xff76('0x46')],'rows':_0x1567f3});}})[_0xff76('0x1d')](handleError(_0x2b09c3,null));};exports[_0xff76('0x125')]=function(_0x4cfda9,_0x435cc0){var _0x44a789={'raw':![],'where':{}};var _0xef93d3={};var _0x3a801d={'count':0x0,'rows':[]};return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x4cfda9[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x435cc0,null))[_0xff76('0x12')](function(_0x278ea0){if(_0x278ea0){_0xef93d3[_0xff76('0x32')]=_[_0xff76('0x33')](db[_0xff76('0xcd')][_0xff76('0x30')]);_0xef93d3[_0xff76('0x34')]=_[_0xff76('0x33')](_0x4cfda9[_0xff76('0x34')]);_0xef93d3[_0xff76('0x35')]=_['intersection'](_0xef93d3[_0xff76('0x32')],_0xef93d3[_0xff76('0x34')]);_0x44a789['attributes']=_[_0xff76('0x37')](_0xef93d3[_0xff76('0x32')],qs['fields'](_0x4cfda9[_0xff76('0x34')][_0xff76('0x38')]));_0x44a789[_0xff76('0x36')]=_0x44a789[_0xff76('0x36')]['length']?_0x44a789[_0xff76('0x36')]:_0xef93d3[_0xff76('0x32')];if(!_0x4cfda9[_0xff76('0x34')]['hasOwnProperty'](_0xff76('0x5e'))){_0x44a789[_0xff76('0x24')]=qs['limit'](_0x4cfda9['query'][_0xff76('0x24')]);_0x44a789[_0xff76('0x22')]=qs[_0xff76('0x22')](_0x4cfda9[_0xff76('0x34')][_0xff76('0x22')]);}_0x44a789[_0xff76('0x3a')]=qs['sort'](_0x4cfda9[_0xff76('0x34')][_0xff76('0x3b')]);_0x44a789[_0xff76('0x3c')]=qs[_0xff76('0x35')](_['pick'](_0x4cfda9['query'],_0xef93d3[_0xff76('0x35')]));_0x44a789['where'][_0xff76('0x55')]=_0x278ea0['id'];if(_0x4cfda9[_0xff76('0x34')][_0xff76('0x3e')]){_0x44a789[_0xff76('0x3c')]=_[_0xff76('0x3f')](_0x44a789['where'],{'$or':_[_0xff76('0x2e')](_0x44a789['attributes'],function(_0x3a47dd){var _0x5de2a1={};_0x5de2a1[_0x3a47dd]={'$like':'%'+_0x4cfda9[_0xff76('0x34')]['filter']+'%'};return _0x5de2a1;})});}_0x44a789=_[_0xff76('0x3f')]({},_0x44a789,_0x4cfda9['options']);return db[_0xff76('0xcd')][_0xff76('0x25')]({'where':_0x44a789[_0xff76('0x3c')]})[_0xff76('0x12')](function(_0x5dad02){_0x3a801d[_0xff76('0x25')]=_0x5dad02;if(_0x4cfda9[_0xff76('0x34')][_0xff76('0x41')]){_0x44a789[_0xff76('0x42')]=[{'all':!![]}];}else{_0x44a789['include']=[{'model':db['CmContact'],'as':_0xff76('0xf0'),'required':![]},{'model':db[_0xff76('0xd4')],'as':_0xff76('0x126'),'required':![]}];}return db[_0xff76('0xcd')][_0xff76('0x58')](_0x44a789);})[_0xff76('0x12')](function(_0xaaaf4d){_0x3a801d[_0xff76('0x43')]=_0xaaaf4d;return _0x3a801d;});}})['then'](respondWithFilteredResult(_0x435cc0,_0x44a789))[_0xff76('0x1d')](handleError(_0x435cc0,null));};exports[_0xff76('0x127')]=function(_0x1eb9ac,_0x509236){return db[_0xff76('0x2f')][_0xff76('0x48')]({'where':{'id':_0x1eb9ac[_0xff76('0x45')]['id']}})[_0xff76('0x12')](handleEntityNotFound(_0x509236,null))['then'](function(_0x4c6185){if(_0x4c6185){return _0x4c6185[_0xff76('0x127')](_0x1eb9ac[_0xff76('0x52')][_0xff76('0x5a')],_['omit'](_0x1eb9ac['body'],[_0xff76('0x5a'),'id'])||{})['spread'](function(_0x5eee2a){for(var _0x5a5be3=0x0;_0x5a5be3<_0x1eb9ac[_0xff76('0x52')][_0xff76('0x5a')][_0xff76('0x46')];_0x5a5be3+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x1eb9ac[_0xff76('0x52')][_0xff76('0x5a')][_0x5a5be3]),'ChatWebsiteId':Number(_0x1eb9ac[_0xff76('0x45')]['id'])});}return _0x5eee2a;});}})['then'](respondWithResult(_0x509236,null))[_0xff76('0x1d')](handleError(_0x509236,null));};exports[_0xff76('0x128')]=function(_0x2f49cd,_0x4af308){return db['ChatWebsite'][_0xff76('0x48')]({'where':{'id':_0x2f49cd[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x4af308,null))[_0xff76('0x12')](function(_0x499315){if(_0x499315){return _0x499315[_0xff76('0x128')](_0x2f49cd['query'][_0xff76('0x5a')])[_0xff76('0x12')](function(){if(_[_0xff76('0x129')](_0x2f49cd[_0xff76('0x34')]['ids'])){for(var _0x1e7ef6=0x0;_0x1e7ef6<_0x2f49cd['query'][_0xff76('0x5a')][_0xff76('0x46')];_0x1e7ef6+=0x1){socket[_0xff76('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x2f49cd[_0xff76('0x34')][_0xff76('0x5a')][_0x1e7ef6]),'ChatWebsiteId':Number(_0x2f49cd['params']['id'])});}}else{socket['emit'](_0xff76('0x12b'),{'UserId':Number(_0x2f49cd[_0xff76('0x34')]['ids']),'ChatWebsiteId':Number(_0x2f49cd[_0xff76('0x45')]['id'])});}});}})[_0xff76('0x12')](respondWithStatusCode(_0x4af308,null))['catch'](handleError(_0x4af308,null));};exports[_0xff76('0x12c')]=function(_0x371fe0,_0x560ee8){var _0x5978b0={};var _0x374ac0={};var _0x2875c8;var _0x79aa3d;return db[_0xff76('0x2f')][_0xff76('0x5d')]({'where':{'id':_0x371fe0[_0xff76('0x45')]['id']}})['then'](handleEntityNotFound(_0x560ee8,null))[_0xff76('0x12')](function(_0x445a46){if(_0x445a46){_0x2875c8=_0x445a46;_0x374ac0['model']=_[_0xff76('0x33')](db[_0xff76('0xb6')]['rawAttributes']);_0x374ac0['query']=_[_0xff76('0x33')](_0x371fe0[_0xff76('0x34')]);_0x374ac0[_0xff76('0x35')]=_[_0xff76('0x37')](_0x374ac0['model'],_0x374ac0[_0xff76('0x34')]);_0x5978b0[_0xff76('0x36')]=_[_0xff76('0x37')](_0x374ac0[_0xff76('0x32')],qs[_0xff76('0x38')](_0x371fe0[_0xff76('0x34')]['fields']));_0x5978b0['attributes']=_0x5978b0['attributes'][_0xff76('0x46')]?_0x5978b0[_0xff76('0x36')]:_0x374ac0['model'];_0x5978b0[_0xff76('0x3a')]=qs[_0xff76('0x3b')](_0x371fe0[_0xff76('0x34')]['sort']);_0x5978b0[_0xff76('0x3c')]=qs[_0xff76('0x35')](_[_0xff76('0x3d')](_0x371fe0[_0xff76('0x34')],_0x374ac0[_0xff76('0x35')]));if(_0x371fe0[_0xff76('0x34')]['filter']){_0x5978b0['where']=_[_0xff76('0x3f')](_0x5978b0[_0xff76('0x3c')],{'$or':_[_0xff76('0x2e')](_0x5978b0[_0xff76('0x36')],function(_0x4f936a){var _0xe91c6a={};_0xe91c6a[_0x4f936a]={'$like':'%'+_0x371fe0['query'][_0xff76('0x3e')]+'%'};return _0xe91c6a;})});}_0x5978b0=_[_0xff76('0x3f')]({},_0x5978b0,_0x371fe0['options']);return _0x2875c8[_0xff76('0x12c')](_0x5978b0);}})[_0xff76('0x12')](function(_0x1c1756){if(_0x1c1756){_0x79aa3d=_0x1c1756[_0xff76('0x46')];if(!_0x371fe0['query'][_0xff76('0x39')](_0xff76('0x5e'))){_0x5978b0[_0xff76('0x24')]=qs['limit'](_0x371fe0[_0xff76('0x34')][_0xff76('0x24')]);_0x5978b0[_0xff76('0x22')]=qs[_0xff76('0x22')](_0x371fe0[_0xff76('0x34')][_0xff76('0x22')]);}return _0x2875c8[_0xff76('0x12c')](_0x5978b0);}})[_0xff76('0x12')](function(_0x12ee8a){if(_0x12ee8a){return _0x12ee8a?{'count':_0x79aa3d,'rows':_0x12ee8a}:null;}})[_0xff76('0x12')](respondWithResult(_0x560ee8,null))[_0xff76('0x1d')](handleError(_0x560ee8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1b8e334..1d282a7 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 _0x3c70=['ChatWebsite','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2cd4cf,_0x1ed34e){var _0x4c9605=function(_0x4f0b08){while(--_0x4f0b08){_0x2cd4cf['push'](_0x2cd4cf['shift']());}};_0x4c9605(++_0x1ed34e);}(_0x3c70,0x10c));var _0x03c7=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x3c70[_0x3c4737];return _0x2bb926;};'use strict';var EventEmitter=require(_0x03c7('0x0'));var ChatWebsite=require(_0x03c7('0x1'))['db'][_0x03c7('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03c7('0x3'),'afterUpdate':_0x03c7('0x4'),'afterDestroy':_0x03c7('0x5')};function emitEvent(_0x37a9ea){return function(_0x38a36b,_0x2464f2,_0x55a9d5){ChatWebsiteEvents[_0x03c7('0x6')](_0x37a9ea+':'+_0x38a36b['id'],_0x38a36b);ChatWebsiteEvents['emit'](_0x37a9ea,_0x38a36b);_0x55a9d5(null);};}for(var e in events){if(events[_0x03c7('0x7')](e)){var event=events[e];ChatWebsite[_0x03c7('0x8')](e,emitEvent(event));}}module[_0x03c7('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc23a=['../../mysqldb','ChatWebsite','setMaxListeners','update','emit','exports'];(function(_0x14b5a5,_0x231b3a){var _0x2a7706=function(_0x2d451d){while(--_0x2d451d){_0x14b5a5['push'](_0x14b5a5['shift']());}};_0x2a7706(++_0x231b3a);}(_0xc23a,0xd2));var _0xac23=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0xc23a[_0x3e5bc8];return _0xfd84bc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xac23('0x0'))['db'][_0xac23('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xac23('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xac23('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49c690){return function(_0x35c541,_0x4f104c,_0x3f2613){ChatWebsiteEvents[_0xac23('0x4')](_0x49c690+':'+_0x35c541['id'],_0x35c541);ChatWebsiteEvents[_0xac23('0x4')](_0x49c690,_0x35c541);_0x3f2613(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xac23('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 12a5c41..d62de06 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 _0xafc0=['ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x4311f5,_0x3550da){var _0x54107a=function(_0x147284){while(--_0x147284){_0x4311f5['push'](_0x4311f5['shift']());}};_0x54107a(++_0x3550da);}(_0xafc0,0x109));var _0x0afc=function(_0x15981e,_0x5d31ad){_0x15981e=_0x15981e-0x0;var _0x19e95e=_0xafc0[_0x15981e];return _0x19e95e;};'use strict';var _=require(_0x0afc('0x0'));var util=require(_0x0afc('0x1'));var logger=require(_0x0afc('0x2'))('api');var moment=require(_0x0afc('0x3'));var BPromise=require(_0x0afc('0x4'));var rp=require(_0x0afc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0afc('0x6'));var config=require(_0x0afc('0x7'));var attributes=require(_0x0afc('0x8'));module[_0x0afc('0x9')]=function(_0x4521e8,_0x4b0f71){return _0x4521e8[_0x0afc('0xa')](_0x0afc('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c50=['request-promise','path','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird'];(function(_0x22f309,_0x4001fb){var _0x524f16=function(_0x2156cd){while(--_0x2156cd){_0x22f309['push'](_0x22f309['shift']());}};_0x524f16(++_0x4001fb);}(_0x5c50,0x1c3));var _0x05c5=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0x5c50[_0x3cca7a];return _0x34e717;};'use strict';var _=require(_0x05c5('0x0'));var util=require(_0x05c5('0x1'));var logger=require('../../config/logger')(_0x05c5('0x2'));var moment=require(_0x05c5('0x3'));var BPromise=require(_0x05c5('0x4'));var rp=require(_0x05c5('0x5'));var fs=require('fs');var path=require(_0x05c5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x05c5('0x7'));module[_0x05c5('0x8')]=function(_0x53817b,_0x2b23ec){return _0x53817b[_0x05c5('0x9')](_0x05c5('0xa'),attributes,{'tableName':_0x05c5('0xb'),'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 2bde40b..3e29602 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 _0x94e8=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x150d2a,_0x570662){var _0x1064e5=function(_0xd9f42f){while(--_0xd9f42f){_0x150d2a['push'](_0x150d2a['shift']());}};_0x1064e5(++_0x570662);}(_0x94e8,0x142));var _0x894e=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0x94e8[_0x1ebe2f];return _0xdeb06f;};'use strict';var _=require(_0x894e('0x0'));var util=require(_0x894e('0x1'));var moment=require(_0x894e('0x2'));var BPromise=require(_0x894e('0x3'));var rs=require(_0x894e('0x4'));var fs=require('fs');var Redis=require(_0x894e('0x5'));var db=require(_0x894e('0x6'))['db'];var utils=require(_0x894e('0x7'));var logger=require(_0x894e('0x8'))(_0x894e('0x9'));var config=require(_0x894e('0xa'));var jayson=require(_0x894e('0xb'));var client=jayson[_0x894e('0xc')][_0x894e('0xd')]({'port':0x232a});config[_0x894e('0xe')]=_['defaults'](config['redis'],{'host':_0x894e('0xf'),'port':0x18eb});var socket=require(_0x894e('0x10'))(new Redis(config[_0x894e('0xe')]));require('./chatWebsite.socket')[_0x894e('0x11')](socket);function respondWithRpcPromise(_0x389304,_0x4c2ec0,_0x519edc){return new BPromise(function(_0x2f8bce,_0x1d7631){return client[_0x894e('0x12')](_0x389304,_0x519edc)[_0x894e('0x13')](function(_0x29fbb6){logger['info'](_0x894e('0x14'),_0x4c2ec0,_0x894e('0x15'));logger[_0x894e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4c2ec0,_0x894e('0x15'),JSON[_0x894e('0x17')](_0x29fbb6));if(_0x29fbb6[_0x894e('0x18')]){if(_0x29fbb6[_0x894e('0x18')][_0x894e('0x19')]===0x1f4){logger[_0x894e('0x18')](_0x894e('0x14'),_0x4c2ec0,_0x29fbb6[_0x894e('0x18')][_0x894e('0x1a')]);return _0x1d7631(_0x29fbb6[_0x894e('0x18')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4c2ec0,_0x29fbb6[_0x894e('0x18')][_0x894e('0x1a')]);return _0x2f8bce(_0x29fbb6[_0x894e('0x18')][_0x894e('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4c2ec0,_0x894e('0x15'));_0x2f8bce(_0x29fbb6[_0x894e('0x1b')][_0x894e('0x1a')]);}})[_0x894e('0x1c')](function(_0x4064c8){logger[_0x894e('0x18')](_0x894e('0x14'),_0x4c2ec0,_0x4064c8);_0x1d7631(_0x4064c8);});});}
\ No newline at end of file
+var _0x8ce4=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x422ed7,_0x435058){var _0x36aee6=function(_0x2f2cd5){while(--_0x2f2cd5){_0x422ed7['push'](_0x422ed7['shift']());}};_0x36aee6(++_0x435058);}(_0x8ce4,0x198));var _0x48ce=function(_0x10eb11,_0x1c2aaa){_0x10eb11=_0x10eb11-0x0;var _0x1aad42=_0x8ce4[_0x10eb11];return _0x1aad42;};'use strict';var _=require(_0x48ce('0x0'));var util=require('util');var moment=require(_0x48ce('0x1'));var BPromise=require('bluebird');var rs=require(_0x48ce('0x2'));var fs=require('fs');var Redis=require(_0x48ce('0x3'));var db=require(_0x48ce('0x4'))['db'];var utils=require(_0x48ce('0x5'));var logger=require(_0x48ce('0x6'))(_0x48ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x48ce('0x8'));var client=jayson[_0x48ce('0x9')][_0x48ce('0xa')]({'port':0x232a});config[_0x48ce('0xb')]=_[_0x48ce('0xc')](config['redis'],{'host':_0x48ce('0xd'),'port':0x18eb});var socket=require(_0x48ce('0xe'))(new Redis(config[_0x48ce('0xb')]));require(_0x48ce('0xf'))['register'](socket);function respondWithRpcPromise(_0x3f5ab6,_0x1aa0d6,_0x1589e3){return new BPromise(function(_0xb6dae4,_0x1551cb){return client[_0x48ce('0x10')](_0x3f5ab6,_0x1589e3)[_0x48ce('0x11')](function(_0x2b84d7){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1aa0d6,'request\x20sent');logger[_0x48ce('0x12')](_0x48ce('0x13'),_0x1aa0d6,_0x48ce('0x14'),JSON[_0x48ce('0x15')](_0x2b84d7));if(_0x2b84d7[_0x48ce('0x16')]){if(_0x2b84d7[_0x48ce('0x16')][_0x48ce('0x17')]===0x1f4){logger[_0x48ce('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1aa0d6,_0x2b84d7[_0x48ce('0x16')][_0x48ce('0x18')]);return _0x1551cb(_0x2b84d7[_0x48ce('0x16')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1aa0d6,_0x2b84d7[_0x48ce('0x16')]['message']);return _0xb6dae4(_0x2b84d7['error'][_0x48ce('0x18')]);}else{logger[_0x48ce('0x19')](_0x48ce('0x1a'),_0x1aa0d6,_0x48ce('0x14'));_0xb6dae4(_0x2b84d7[_0x48ce('0x1b')][_0x48ce('0x18')]);}})[_0x48ce('0x1c')](function(_0x5d8d19){logger[_0x48ce('0x16')](_0x48ce('0x1a'),_0x1aa0d6,_0x5d8d19);_0x1551cb(_0x5d8d19);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 5bf7e88..d6b3b65 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 _0xd77f=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0xb3e40d,_0x43a176){var _0x291be1=function(_0x87961){while(--_0x87961){_0xb3e40d['push'](_0xb3e40d['shift']());}};_0x291be1(++_0x43a176);}(_0xd77f,0x152));var _0xfd77=function(_0x28d657,_0x16e0f9){_0x28d657=_0x28d657-0x0;var _0x5733d6=_0xd77f[_0x28d657];return _0x5733d6;};'use strict';var ChatWebsiteEvents=require(_0xfd77('0x0'));var events=[_0xfd77('0x1'),_0xfd77('0x2'),_0xfd77('0x3')];function createListener(_0x9b3647,_0x178213){return function(_0x27435c){_0x178213[_0xfd77('0x4')](_0x9b3647,_0x27435c);};}function removeListener(_0x178c8a,_0x481413){return function(){ChatWebsiteEvents[_0xfd77('0x5')](_0x178c8a,_0x481413);};}exports[_0xfd77('0x6')]=function(_0x29e3af){for(var _0x546b25=0x0,_0x465d3b=events[_0xfd77('0x7')];_0x546b25<_0x465d3b;_0x546b25++){var _0x45b905=events[_0x546b25];var _0x1212f2=createListener(_0xfd77('0x8')+_0x45b905,_0x29e3af);ChatWebsiteEvents['on'](_0x45b905,_0x1212f2);}};
\ No newline at end of file
+var _0x6621=['removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x3e5595,_0xbe4275){var _0x3fd3a6=function(_0x43874c){while(--_0x43874c){_0x3e5595['push'](_0x3e5595['shift']());}};_0x3fd3a6(++_0xbe4275);}(_0x6621,0xb7));var _0x1662=function(_0xb81c7f,_0x3c91fe){_0xb81c7f=_0xb81c7f-0x0;var _0x1bbcd6=_0x6621[_0xb81c7f];return _0x1bbcd6;};'use strict';var ChatWebsiteEvents=require(_0x1662('0x0'));var events=[_0x1662('0x1'),_0x1662('0x2'),'update'];function createListener(_0x46063c,_0x36a4d5){return function(_0x2b3b39){_0x36a4d5['emit'](_0x46063c,_0x2b3b39);};}function removeListener(_0x51214c,_0x5dbd05){return function(){ChatWebsiteEvents[_0x1662('0x3')](_0x51214c,_0x5dbd05);};}exports[_0x1662('0x4')]=function(_0x570d51){for(var _0x1f43d5=0x0,_0x3af120=events['length'];_0x1f43d5<_0x3af120;_0x1f43d5++){var _0x4eded6=events[_0x1f43d5];var _0x1b7610=createListener(_0x1662('0x5')+_0x4eded6,_0x570d51);ChatWebsiteEvents['on'](_0x4eded6,_0x1b7610);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 750b90d..905f8c7 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 _0xde7a=['getAgents','post','addAnswer','diskStorage','root','format','%s-%s','now','originalname','single','file','addLogo','join','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages'];(function(_0x243515,_0x4241f3){var _0x44a8d6=function(_0x4e0922){while(--_0x4e0922){_0x243515['push'](_0x243515['shift']());}};_0x44a8d6(++_0x4241f3);}(_0xde7a,0x172));var _0xade7=function(_0x58e389,_0x169078){_0x58e389=_0x58e389-0x0;var _0x29f59c=_0xde7a[_0x58e389];return _0x29f59c;};'use strict';var multer=require('multer');var util=require(_0xade7('0x0'));var path=require('path');var timeout=require(_0xade7('0x1'));var express=require(_0xade7('0x2'));var router=express[_0xade7('0x3')]();var fs_extra=require(_0xade7('0x4'));var auth=require(_0xade7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xade7('0x6'));router[_0xade7('0x7')]('/',auth[_0xade7('0x8')](),controller['index']);router[_0xade7('0x7')]('/describe',auth[_0xade7('0x8')](),controller[_0xade7('0x9')]);router['get'](_0xade7('0xa'),auth[_0xade7('0x8')](),controller[_0xade7('0xb')]);router[_0xade7('0x7')](_0xade7('0xc'),auth[_0xade7('0x8')](),controller[_0xade7('0xd')]);router[_0xade7('0x7')](_0xade7('0xe'),auth[_0xade7('0x8')](),controller[_0xade7('0xf')]);router[_0xade7('0x7')](_0xade7('0x10'),controller[_0xade7('0x11')]);router['get'](_0xade7('0x12'),controller[_0xade7('0x13')]);router[_0xade7('0x7')](_0xade7('0x14'),controller[_0xade7('0x15')]);router[_0xade7('0x7')]('/:id/system_avatar',controller[_0xade7('0x16')]);router['get'](_0xade7('0x17'),auth[_0xade7('0x8')](),controller[_0xade7('0x18')]);router[_0xade7('0x7')](_0xade7('0x19'),controller['getSnippet']);router[_0xade7('0x7')](_0xade7('0x1a'),auth[_0xade7('0x8')](),controller[_0xade7('0x1b')]);router[_0xade7('0x7')](_0xade7('0x1c'),auth['isAuthenticated'](),controller[_0xade7('0x1d')]);router[_0xade7('0x7')]('/:id/fields',controller[_0xade7('0x1e')]);router[_0xade7('0x7')]('/:id/offline_messages',auth[_0xade7('0x8')](),controller[_0xade7('0x1f')]);router[_0xade7('0x7')]('/:id/users',auth[_0xade7('0x8')](),controller[_0xade7('0x20')]);router['post']('/',auth[_0xade7('0x8')](),controller['create']);router['post'](_0xade7('0xc'),auth[_0xade7('0x8')](),controller['addDisposition']);router[_0xade7('0x21')]('/:id/canned_answers',auth[_0xade7('0x8')](),controller[_0xade7('0x22')]);var upload=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x3efddc,_0x20bb25,_0x1dffd6){_0x1dffd6(null,path['join'](config[_0xade7('0x24')],'server/files/images/logos/'));},'filename':function(_0x2a493f,_0x2d6e61,_0x2649cb){_0x2649cb(null,util[_0xade7('0x25')](_0xade7('0x26'),Date[_0xade7('0x27')](),_0x2d6e61[_0xade7('0x28')]));}})});router[_0xade7('0x21')]('/:id/logo',upload[_0xade7('0x29')](_0xade7('0x2a')),controller[_0xade7('0x2b')]);var upload=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x82fd19,_0x4d0c40,_0xcee3f7){_0xcee3f7(null,path[_0xade7('0x2c')](config[_0xade7('0x24')],'server/files/images/avatars/'));},'filename':function(_0x1842d3,_0x599926,_0x59d684){_0x59d684(null,util[_0xade7('0x25')](_0xade7('0x26'),Date[_0xade7('0x27')](),_0x599926[_0xade7('0x28')]));}})});router[_0xade7('0x21')]('/:id/avatar',upload[_0xade7('0x29')](_0xade7('0x2a')),controller[_0xade7('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe938e7,_0x2f8514,_0x537e1e){_0x537e1e(null,path[_0xade7('0x2c')](config[_0xade7('0x24')],_0xade7('0x2e')));},'filename':function(_0x2f52af,_0x401a7c,_0x233cc4){_0x233cc4(null,util[_0xade7('0x25')]('%s-%s',Date[_0xade7('0x27')](),_0x401a7c[_0xade7('0x28')]));}})});router[_0xade7('0x21')](_0xade7('0x14'),upload['single'](_0xade7('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x379b95,_0x2fd121,_0x19fb74){_0x19fb74(null,path[_0xade7('0x2c')](config[_0xade7('0x24')],_0xade7('0x2e')));},'filename':function(_0x3e8a28,_0x28feb5,_0x57722c){_0x57722c(null,util['format']('%s-%s',Date[_0xade7('0x27')](),_0x28feb5[_0xade7('0x28')]));}})});router[_0xade7('0x21')]('/:id/system_avatar',upload['single']('file'),controller[_0xade7('0x2f')]);router[_0xade7('0x21')](_0xade7('0x30'),controller[_0xade7('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xade7('0x23')]({'destination':function(_0x4a0cd7,_0x1d300b,_0x3cb0b9){const _0x48cb6c=path[_0xade7('0x2c')](config[_0xade7('0x24')],_0xade7('0x32'),'attachments',_0xade7('0x33'));fs_extra[_0xade7('0x34')](_0x48cb6c,function(){_0x3cb0b9(null,_0x48cb6c);});},'filename':function(_0x555761,_0x166194,_0x2abeec){const _0x209939=_0x166194['originalname'][_0xade7('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4724e8=path[_0xade7('0x36')](_0x209939);const _0x1e31c3=Date[_0xade7('0x27')]()+'-'+_0x209939[_0xade7('0x35')](_0x4724e8,'')+_0x4724e8;_0x2abeec(null,_0x1e31c3);}})});router[_0xade7('0x21')]('/:id/offline',offlineUploadMulter[_0xade7('0x37')](),controller[_0xade7('0x38')]);router[_0xade7('0x21')](_0xade7('0x17'),auth[_0xade7('0x8')](),controller[_0xade7('0x39')]);router[_0xade7('0x21')](_0xade7('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xade7('0x1c'),auth['isAuthenticated'](),controller[_0xade7('0x3a')]);router[_0xade7('0x21')](_0xade7('0x3b'),auth['isAuthenticated'](),controller[_0xade7('0x3c')]);router[_0xade7('0x3d')](_0xade7('0xa'),auth['isAuthenticated'](),controller[_0xade7('0x3e')]);router[_0xade7('0x3f')]('/:id',auth[_0xade7('0x8')](),controller['destroy']);router[_0xade7('0x3f')](_0xade7('0xc'),auth[_0xade7('0x8')](),controller[_0xade7('0x40')]);router[_0xade7('0x3f')]('/:id/canned_answers',auth[_0xade7('0x8')](),controller[_0xade7('0x41')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xade7('0x42')]);module['exports']=router;
\ No newline at end of file
+var _0xc0b9=['getInteractions','getSnippet','/:id/applications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','file','join','server/files/images/avatars/','addAvatar','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','express','Router','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x428609,_0x1b6787){var _0x3d22a4=function(_0x481703){while(--_0x481703){_0x428609['push'](_0x428609['shift']());}};_0x3d22a4(++_0x1b6787);}(_0xc0b9,0x149));var _0x9c0b=function(_0x36e299,_0x5f3e95){_0x36e299=_0x36e299-0x0;var _0xa47999=_0xc0b9[_0x36e299];return _0xa47999;};'use strict';var multer=require(_0x9c0b('0x0'));var util=require('util');var path=require(_0x9c0b('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c0b('0x2'));var router=express[_0x9c0b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c0b('0x4'));router[_0x9c0b('0x5')]('/',auth[_0x9c0b('0x6')](),controller['index']);router[_0x9c0b('0x5')](_0x9c0b('0x7'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x8')]);router[_0x9c0b('0x5')](_0x9c0b('0x9'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0xa')]);router[_0x9c0b('0x5')](_0x9c0b('0xb'),auth[_0x9c0b('0x6')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9c0b('0xc')]);router[_0x9c0b('0x5')]('/:id/logo',controller[_0x9c0b('0xd')]);router[_0x9c0b('0x5')](_0x9c0b('0xe'),controller[_0x9c0b('0xf')]);router[_0x9c0b('0x5')](_0x9c0b('0x10'),controller[_0x9c0b('0x11')]);router[_0x9c0b('0x5')](_0x9c0b('0x12'),controller[_0x9c0b('0x13')]);router['get'](_0x9c0b('0x14'),auth['isAuthenticated'](),controller[_0x9c0b('0x15')]);router['get']('/:id/snippet',controller[_0x9c0b('0x16')]);router[_0x9c0b('0x5')](_0x9c0b('0x17'),auth[_0x9c0b('0x6')](),controller['getApplications']);router[_0x9c0b('0x5')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x9c0b('0x5')](_0x9c0b('0x18'),controller[_0x9c0b('0x19')]);router[_0x9c0b('0x5')](_0x9c0b('0x1a'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x1b')]);router[_0x9c0b('0x5')](_0x9c0b('0x1c'),auth['isAuthenticated'](),controller[_0x9c0b('0x1d')]);router[_0x9c0b('0x1e')]('/',auth['isAuthenticated'](),controller[_0x9c0b('0x1f')]);router['post']('/:id/dispositions',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x20')]);router[_0x9c0b('0x1e')](_0x9c0b('0x21'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x22')]);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0xd3b892,_0x598290,_0x35f5fc){_0x35f5fc(null,path['join'](config[_0x9c0b('0x24')],_0x9c0b('0x25')));},'filename':function(_0x5be2f,_0x1064a6,_0xe650e){_0xe650e(null,util[_0x9c0b('0x26')](_0x9c0b('0x27'),Date[_0x9c0b('0x28')](),_0x1064a6['originalname']));}})});router['post'](_0x9c0b('0x29'),upload[_0x9c0b('0x2a')](_0x9c0b('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x32ac29,_0x4e8ab8,_0x711ea7){_0x711ea7(null,path[_0x9c0b('0x2c')](config[_0x9c0b('0x24')],_0x9c0b('0x2d')));},'filename':function(_0x571f99,_0x6babd9,_0x16bb9b){_0x16bb9b(null,util[_0x9c0b('0x26')]('%s-%s',Date[_0x9c0b('0x28')](),_0x6babd9['originalname']));}})});router[_0x9c0b('0x1e')](_0x9c0b('0xe'),upload['single'](_0x9c0b('0x2b')),controller[_0x9c0b('0x2e')]);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x4b6d80,_0x4d79a2,_0xaabea9){_0xaabea9(null,path[_0x9c0b('0x2c')](config[_0x9c0b('0x24')],_0x9c0b('0x2d')));},'filename':function(_0x14dffe,_0x57975c,_0x439c06){_0x439c06(null,util[_0x9c0b('0x26')](_0x9c0b('0x27'),Date['now'](),_0x57975c[_0x9c0b('0x2f')]));}})});router[_0x9c0b('0x1e')](_0x9c0b('0x10'),upload[_0x9c0b('0x2a')](_0x9c0b('0x2b')),controller[_0x9c0b('0x30')]);var upload=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x31b7bf,_0x25d3a0,_0x3d7e9a){_0x3d7e9a(null,path[_0x9c0b('0x2c')](config['root'],_0x9c0b('0x2d')));},'filename':function(_0x4fdab6,_0x22ebf3,_0x3e26b0){_0x3e26b0(null,util[_0x9c0b('0x26')](_0x9c0b('0x27'),Date[_0x9c0b('0x28')](),_0x22ebf3[_0x9c0b('0x2f')]));}})});router[_0x9c0b('0x1e')]('/:id/system_avatar',upload[_0x9c0b('0x2a')](_0x9c0b('0x2b')),controller[_0x9c0b('0x31')]);router[_0x9c0b('0x1e')](_0x9c0b('0x32'),controller[_0x9c0b('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x9c0b('0x23')]({'destination':function(_0x4ea145,_0x5eb605,_0x43e433){const _0x4b1047=path[_0x9c0b('0x2c')](config[_0x9c0b('0x24')],_0x9c0b('0x34'),_0x9c0b('0x35'),'offline-chat');fs_extra['ensureDir'](_0x4b1047,function(){_0x43e433(null,_0x4b1047);});},'filename':function(_0x1871ed,_0x57866b,_0x3b3269){const _0x338d0e=_0x57866b[_0x9c0b('0x2f')][_0x9c0b('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x7583f5=path[_0x9c0b('0x37')](_0x338d0e);const _0x4ccb02=Date['now']()+'-'+_0x338d0e[_0x9c0b('0x36')](_0x7583f5,'')+_0x7583f5;_0x3b3269(null,_0x4ccb02);}})});router['post'](_0x9c0b('0x38'),offlineUploadMulter[_0x9c0b('0x39')](),controller[_0x9c0b('0x3a')]);router[_0x9c0b('0x1e')](_0x9c0b('0x14'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x3b')]);router[_0x9c0b('0x1e')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x9c0b('0x1e')](_0x9c0b('0x3c'),auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x3d')]);router['post']('/:id/users',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x3e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9c0b('0x3f')]);router[_0x9c0b('0x40')]('/:id',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x41')]);router[_0x9c0b('0x40')](_0x9c0b('0xb'),auth['isAuthenticated'](),controller[_0x9c0b('0x42')]);router[_0x9c0b('0x40')](_0x9c0b('0x21'),auth['isAuthenticated'](),controller[_0x9c0b('0x43')]);router[_0x9c0b('0x40')]('/:id/users',auth[_0x9c0b('0x6')](),controller[_0x9c0b('0x44')]);module[_0x9c0b('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 714e050..aa5d7f1 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 _0xab3f=['STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x2c3dc6,_0x187b82){var _0x2b48d8=function(_0x49b7bd){while(--_0x49b7bd){_0x2c3dc6['push'](_0x2c3dc6['shift']());}};_0x2b48d8(++_0x187b82);}(_0xab3f,0x72));var _0xfab3=function(_0x1268fc,_0x1e2f79){_0x1268fc=_0x1268fc-0x0;var _0x15158d=_0xab3f[_0x1268fc];return _0x15158d;};'use strict';var Sequelize=require(_0xfab3('0x0'));module['exports']={'name':{'type':Sequelize[_0xfab3('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfab3('0x2')](_0xfab3('0x3'),_0xfab3('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xfab3('0x1')]},'data2':{'type':Sequelize[_0xfab3('0x1')]}};
\ No newline at end of file
+var _0x0af5=['STRING','ENUM','AmazonAWS','Google','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0af5,0x158));var _0x50af=function(_0x344066,_0x16d1dd){_0x344066=_0x344066-0x0;var _0x526692=_0x0af5[_0x344066];return _0x526692;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x50af('0x2')](_0x50af('0x3'),_0x50af('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x50af('0x1')]},'data2':{'type':Sequelize[_0x50af('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 807de43..0307d8d 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x1d3a0b,_0x272ff6){var _0x1968b0=function(_0x27bce7){while(--_0x27bce7){_0x1d3a0b['push'](_0x1d3a0b['shift']());}};_0x1968b0(++_0x272ff6);}(_0x2032,0xd9));var _0x2203=function(_0x2c59f9,_0x242547){_0x2c59f9=_0x2c59f9-0x0;var _0xf7c8bd=_0x2032[_0x2c59f9];return _0xf7c8bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x4b07cf,_0x274300){var _0x2732c8=function(_0x19b1a4){while(--_0x19b1a4){_0x4b07cf['push'](_0x4b07cf['shift']());}};_0x2732c8(++_0x274300);}(_0x2032,0xd9));var _0x2203=function(_0x442705,_0xaa3b7d){_0x442705=_0x442705-0x0;var _0x3515fd=_0x2032[_0x442705];return _0x3515fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index e3461af..1450ed4 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 _0xec16=['./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c78af,_0x13a87a){var _0x14b0cb=function(_0x2a6f28){while(--_0x2a6f28){_0x3c78af['push'](_0x3c78af['shift']());}};_0x14b0cb(++_0x13a87a);}(_0xec16,0xb8));var _0x6ec1=function(_0x54f10e,_0x328584){_0x54f10e=_0x54f10e-0x0;var _0x1cc01d=_0xec16[_0x54f10e];return _0x1cc01d;};'use strict';var _=require('lodash');var util=require(_0x6ec1('0x0'));var logger=require(_0x6ec1('0x1'))(_0x6ec1('0x2'));var moment=require(_0x6ec1('0x3'));var BPromise=require(_0x6ec1('0x4'));var rp=require(_0x6ec1('0x5'));var fs=require('fs');var path=require(_0x6ec1('0x6'));var rimraf=require(_0x6ec1('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ec1('0x8'));module[_0x6ec1('0x9')]=function(_0x2dbcc0,_0x2ba8b2){return _0x2dbcc0[_0x6ec1('0xa')](_0x6ec1('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b0b=['cloud_providers','lodash','../../config/logger','moment','bluebird','request-promise','path','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x497f4f,_0x251ed6){var _0x547310=function(_0x3fe420){while(--_0x3fe420){_0x497f4f['push'](_0x497f4f['shift']());}};_0x547310(++_0x251ed6);}(_0x3b0b,0x9b));var _0xb3b0=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x3b0b[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xb3b0('0x0'));var util=require('util');var logger=require(_0xb3b0('0x1'))('api');var moment=require(_0xb3b0('0x2'));var BPromise=require(_0xb3b0('0x3'));var rp=require(_0xb3b0('0x4'));var fs=require('fs');var path=require(_0xb3b0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb3b0('0x6'));module[_0xb3b0('0x7')]=function(_0x2f29e5,_0x443368){return _0x2f29e5[_0xb3b0('0x8')](_0xb3b0('0x9'),attributes,{'tableName':_0xb3b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index aa79ffd..71b6777 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 _0xd232=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x555555,_0xc2c92){var _0x530811=function(_0x8d8dde){while(--_0x8d8dde){_0x555555['push'](_0x555555['shift']());}};_0x530811(++_0xc2c92);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var moment=require(_0x2d23('0x1'));var BPromise=require(_0x2d23('0x2'));var rs=require(_0x2d23('0x3'));var fs=require('fs');var Redis=require(_0x2d23('0x4'));var db=require(_0x2d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d23('0x7')][_0x2d23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15c735,_0x53ac18,_0x18cac8){return new BPromise(function(_0x4cf7f4,_0x2c4667){return client[_0x2d23('0x9')](_0x15c735,_0x18cac8)[_0x2d23('0xa')](function(_0x7847cb){logger[_0x2d23('0xb')](_0x2d23('0xc'),_0x53ac18,_0x2d23('0xd'));logger['debug'](_0x2d23('0xe'),_0x53ac18,_0x2d23('0xd'),JSON[_0x2d23('0xf')](_0x7847cb));if(_0x7847cb[_0x2d23('0x10')]){if(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x11')]===0x1f4){logger[_0x2d23('0x10')](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x2c4667(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}logger['error'](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x4cf7f4(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}else{logger['info'](_0x2d23('0xc'),_0x53ac18,'request\x20sent');_0x4cf7f4(_0x7847cb[_0x2d23('0x13')]['message']);}})[_0x2d23('0x14')](function(_0x30b578){logger['error']('CloudProvider,\x20%s,\x20%s',_0x53ac18,_0x30b578);_0x2c4667(_0x30b578);});});}
\ No newline at end of file
+var _0x2deb=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8f7d547..b0f68c5 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 _0xa908=['../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x3b6266,_0x1a2b8b){var _0x37a372=function(_0x3ea98a){while(--_0x3ea98a){_0x3b6266['push'](_0x3b6266['shift']());}};_0x37a372(++_0x1a2b8b);}(_0xa908,0x1c3));var _0x8a90=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0xa908[_0x256422];return _0x55dddc;};'use strict';var multer=require(_0x8a90('0x0'));var util=require('util');var path=require(_0x8a90('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a90('0x2'));var router=express[_0x8a90('0x3')]();var fs_extra=require(_0x8a90('0x4'));var auth=require(_0x8a90('0x5'));var interaction=require(_0x8a90('0x6'));var config=require('../../config/environment');var controller=require(_0x8a90('0x7'));router[_0x8a90('0x8')]('/',auth['isAuthenticated'](),controller[_0x8a90('0x9')]);router[_0x8a90('0x8')](_0x8a90('0xa'),auth[_0x8a90('0xb')](),controller[_0x8a90('0xc')]);router[_0x8a90('0xd')]('/',auth['isAuthenticated'](),controller[_0x8a90('0xe')]);router['put'](_0x8a90('0xa'),auth['isAuthenticated'](),controller[_0x8a90('0xf')]);router[_0x8a90('0x10')](_0x8a90('0xa'),auth[_0x8a90('0xb')](),controller[_0x8a90('0x11')]);module[_0x8a90('0x12')]=router;
\ No newline at end of file
+var _0x4e6e=['put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','create'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x4e6e,0x143));var _0xe4e6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4e6e[_0x24f31b];return _0x488401;};'use strict';var multer=require(_0xe4e6('0x0'));var util=require(_0xe4e6('0x1'));var path=require(_0xe4e6('0x2'));var timeout=require(_0xe4e6('0x3'));var express=require(_0xe4e6('0x4'));var router=express[_0xe4e6('0x5')]();var fs_extra=require(_0xe4e6('0x6'));var auth=require(_0xe4e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe4e6('0x8'));var controller=require(_0xe4e6('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe4e6('0xa')]('/:id',auth[_0xe4e6('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe4e6('0xc')]);router[_0xe4e6('0xd')]('/:id',auth[_0xe4e6('0xb')](),controller['update']);router[_0xe4e6('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe4e6('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ae08b59..392eba2 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 _0x72d7=['name','STRING'];(function(_0x227d0d,_0x1a1363){var _0x2d23c4=function(_0x10e935){while(--_0x10e935){_0x227d0d['push'](_0x227d0d['shift']());}};_0x2d23c4(++_0x1a1363);}(_0x72d7,0x129));var _0x772d=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x72d7[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x772d('0x0')],'unique':_0x772d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x772d('0x0')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x772d('0x0')]},'phone':{'type':Sequelize[_0x772d('0x0')]},'fax':{'type':Sequelize[_0x772d('0x0')]},'type':{'type':Sequelize[_0x772d('0x0')]},'street':{'type':Sequelize[_0x772d('0x0')]},'postalCode':{'type':Sequelize[_0x772d('0x0')]},'city':{'type':Sequelize[_0x772d('0x0')]},'country':{'type':Sequelize[_0x772d('0x0')]},'email':{'type':Sequelize[_0x772d('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x772d('0x0')]},'sStreet':{'type':Sequelize[_0x772d('0x0')]},'sPostalCode':{'type':Sequelize[_0x772d('0x0')]},'sCity':{'type':Sequelize[_0x772d('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x772d('0x0')]}};
\ No newline at end of file
+var _0x11a1=['name','sequelize','exports','STRING'];(function(_0x530455,_0x41da2d){var _0x128a27=function(_0x3152af){while(--_0x3152af){_0x530455['push'](_0x530455['shift']());}};_0x128a27(++_0x41da2d);}(_0x11a1,0xbd));var _0x111a=function(_0x16d51f,_0x2868af){_0x16d51f=_0x16d51f-0x0;var _0x2d08a0=_0x11a1[_0x16d51f];return _0x2d08a0;};'use strict';var Sequelize=require(_0x111a('0x0'));module[_0x111a('0x1')]={'name':{'type':Sequelize[_0x111a('0x2')],'unique':_0x111a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x111a('0x2')]},'companyId':{'type':Sequelize[_0x111a('0x2')]},'website':{'type':Sequelize[_0x111a('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x111a('0x2')]},'street':{'type':Sequelize[_0x111a('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x111a('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x111a('0x2')]},'sCountry':{'type':Sequelize[_0x111a('0x2')]},'description':{'type':Sequelize[_0x111a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index fb4d7a7..f9e59b2 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 _0x29e2=['find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','CmContact','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','params'];(function(_0x566407,_0x35c8ed){var _0x5dbbbe=function(_0x5c0d7f){while(--_0x5c0d7f){_0x566407['push'](_0x566407['shift']());}};_0x5dbbbe(++_0x35c8ed);}(_0x29e2,0xb8));var _0x229e=function(_0x589d37,_0x1399c4){_0x589d37=_0x589d37-0x0;var _0x5e8d4e=_0x29e2[_0x589d37];return _0x5e8d4e;};'use strict';var emlformat=require(_0x229e('0x0'));var rimraf=require(_0x229e('0x1'));var zipdir=require(_0x229e('0x2'));var jsonpatch=require(_0x229e('0x3'));var rp=require(_0x229e('0x4'));var moment=require(_0x229e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x229e('0x6'));var util=require(_0x229e('0x7'));var path=require(_0x229e('0x8'));var sox=require(_0x229e('0x9'));var csv=require(_0x229e('0xa'));var ejs=require(_0x229e('0xb'));var fs=require('fs');var fs_extra=require(_0x229e('0xc'));var _=require(_0x229e('0xd'));var squel=require('squel');var crypto=require(_0x229e('0xe'));var jsforce=require(_0x229e('0xf'));var deskjs=require(_0x229e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x229e('0x11'));var Papa=require(_0x229e('0x12'));var Redis=require(_0x229e('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x229e('0x14'));var hardwareService=require(_0x229e('0x15'));var logger=require(_0x229e('0x16'))(_0x229e('0x17'));var utils=require(_0x229e('0x18'));var config=require(_0x229e('0x19'));var licenseUtil=require(_0x229e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x156ecc,_0x56bdfd){_0x56bdfd=_0x56bdfd||0xcc;return function(_0x115195){if(_0x115195){return _0x156ecc[_0x229e('0x1b')](_0x56bdfd);}return _0x156ecc[_0x229e('0x1c')](_0x56bdfd)[_0x229e('0x1d')]();};}function respondWithResult(_0x284792,_0x5dbe3a){_0x5dbe3a=_0x5dbe3a||0xc8;return function(_0x251dfb){if(_0x251dfb){return _0x284792[_0x229e('0x1c')](_0x5dbe3a)[_0x229e('0x1e')](_0x251dfb);}};}function respondWithFilteredResult(_0x4b671e,_0x124ff7){return function(_0x2ca292){if(_0x2ca292){var _0x5e416e=typeof _0x124ff7[_0x229e('0x1f')]===_0x229e('0x20')&&typeof _0x124ff7[_0x229e('0x21')]==='undefined';var _0x4407dc=_0x2ca292[_0x229e('0x22')];var _0x128285=_0x5e416e?0x0:_0x124ff7[_0x229e('0x1f')];var _0x40fde9=_0x5e416e?_0x2ca292['count']:_0x124ff7[_0x229e('0x1f')]+_0x124ff7['limit'];var _0x24e4ee;if(_0x40fde9>=_0x4407dc){_0x40fde9=_0x4407dc;_0x24e4ee=0xc8;}else{_0x24e4ee=0xce;}_0x4b671e[_0x229e('0x1c')](_0x24e4ee);return _0x4b671e[_0x229e('0x23')](_0x229e('0x24'),_0x128285+'-'+_0x40fde9+'/'+_0x4407dc)['json'](_0x2ca292);}return null;};}function patchUpdates(_0x1138e9){return function(_0x26d37d){try{jsonpatch['apply'](_0x26d37d,_0x1138e9,!![]);}catch(_0x399cca){return BPromise[_0x229e('0x25')](_0x399cca);}return _0x26d37d[_0x229e('0x26')]();};}function saveUpdates(_0x39c0d6,_0x55c73d){return function(_0x42d464){if(_0x42d464){return _0x42d464[_0x229e('0x27')](_0x39c0d6)[_0x229e('0x28')](function(_0x418866){return _0x418866;});}return null;};}function removeEntity(_0x905280,_0x307817){return function(_0x1f63f0){if(_0x1f63f0){return _0x1f63f0[_0x229e('0x29')]()[_0x229e('0x28')](function(){var _0x527945=_0x1f63f0[_0x229e('0x2a')]({'plain':!![]});var _0x550ba9=_0x229e('0x2b');return db[_0x229e('0x2c')][_0x229e('0x29')]({'where':{'type':_0x550ba9,'resourceId':_0x527945['id']}})[_0x229e('0x28')](function(){return _0x1f63f0;});})[_0x229e('0x28')](function(){_0x905280[_0x229e('0x1c')](0xcc)[_0x229e('0x1d')]();});}};}function handleEntityNotFound(_0x9c1782,_0x5c3803){return function(_0x3269df){if(!_0x3269df){_0x9c1782[_0x229e('0x1b')](0x194);}return _0x3269df;};}function handleError(_0x302df4,_0x3d60bc){_0x3d60bc=_0x3d60bc||0x1f4;return function(_0x26c926){logger[_0x229e('0x2d')](_0x26c926[_0x229e('0x2e')]);if(_0x26c926[_0x229e('0x2f')]){delete _0x26c926[_0x229e('0x2f')];}_0x302df4['status'](_0x3d60bc)[_0x229e('0x30')](_0x26c926);};}exports['index']=function(_0x4aeee6,_0x1a64a6){var _0x3f6cc5={},_0x1d583a={},_0x384630={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x229e('0x28')](function(_0x4d79c3){_0x1d583a[_0x229e('0x31')]=_[_0x229e('0x32')](_0x4d79c3);_0x1d583a[_0x229e('0x33')]=_['keys'](_0x4aeee6['query']);_0x1d583a[_0x229e('0x34')]=_['intersection'](_0x1d583a[_0x229e('0x31')],_0x1d583a[_0x229e('0x33')]);_0x3f6cc5[_0x229e('0x35')]=_[_0x229e('0x36')](_0x1d583a['model'],qs['fields'](_0x4aeee6[_0x229e('0x33')][_0x229e('0x37')]));_0x3f6cc5[_0x229e('0x35')]=_0x3f6cc5[_0x229e('0x35')][_0x229e('0x38')]?_0x3f6cc5[_0x229e('0x35')]:_0x1d583a['model'];if(!_0x4aeee6[_0x229e('0x33')][_0x229e('0x39')](_0x229e('0x3a'))){_0x3f6cc5[_0x229e('0x21')]=qs[_0x229e('0x21')](_0x4aeee6[_0x229e('0x33')][_0x229e('0x21')]);_0x3f6cc5[_0x229e('0x1f')]=qs[_0x229e('0x1f')](_0x4aeee6[_0x229e('0x33')][_0x229e('0x1f')]);}_0x3f6cc5[_0x229e('0x3b')]=qs[_0x229e('0x3c')](_0x4aeee6[_0x229e('0x33')][_0x229e('0x3c')]);_0x3f6cc5[_0x229e('0x3d')]=qs[_0x229e('0x34')](_[_0x229e('0x3e')](_0x4aeee6[_0x229e('0x33')],_0x1d583a[_0x229e('0x34')]),_0x4d79c3);if(_0x4aeee6[_0x229e('0x33')][_0x229e('0x3f')]){_0x3f6cc5['where']=_[_0x229e('0x40')](_0x3f6cc5[_0x229e('0x3d')],{'$or':_[_0x229e('0x41')](_0x3f6cc5[_0x229e('0x35')],function(_0xea229d){var _0xcc6a2f={};_0xcc6a2f[_0xea229d]={'$like':'%'+_0x4aeee6[_0x229e('0x33')][_0x229e('0x3f')]+'%'};return _0xcc6a2f;})});}_0x3f6cc5=_[_0x229e('0x40')]({},_0x3f6cc5,_0x4aeee6[_0x229e('0x42')]);var _0xe3f071={'where':_0x3f6cc5[_0x229e('0x3d')]};return db[_0x229e('0x43')]['count'](_0xe3f071)['then'](function(_0x5049f7){_0x384630['count']=_0x5049f7;if(_0x4aeee6[_0x229e('0x33')][_0x229e('0x44')]){_0x3f6cc5[_0x229e('0x45')]=[{'all':!![]}];}return db[_0x229e('0x43')][_0x229e('0x46')](_0x3f6cc5);})[_0x229e('0x28')](function(_0x2cc859){_0x384630['rows']=_0x2cc859;return _0x384630;})[_0x229e('0x28')](respondWithFilteredResult(_0x1a64a6,_0x3f6cc5))[_0x229e('0x47')](handleError(_0x1a64a6,null));})[_0x229e('0x47')](handleError(_0x1a64a6,null));};exports[_0x229e('0x48')]=function(_0x528ab5,_0x36aff1){var _0x3271e6={'raw':![],'where':{'id':_0x528ab5[_0x229e('0x49')]['id']}},_0x541568={};_0x541568[_0x229e('0x31')]=_[_0x229e('0x32')](db[_0x229e('0x43')]['rawAttributes']);_0x541568['query']=_[_0x229e('0x32')](_0x528ab5[_0x229e('0x33')]);_0x541568[_0x229e('0x34')]=_[_0x229e('0x36')](_0x541568[_0x229e('0x31')],_0x541568[_0x229e('0x33')]);_0x3271e6[_0x229e('0x35')]=_[_0x229e('0x36')](_0x541568[_0x229e('0x31')],qs[_0x229e('0x37')](_0x528ab5[_0x229e('0x33')][_0x229e('0x37')]));_0x3271e6[_0x229e('0x35')]=_0x3271e6[_0x229e('0x35')][_0x229e('0x38')]?_0x3271e6[_0x229e('0x35')]:_0x541568[_0x229e('0x31')];if(_0x528ab5['query'][_0x229e('0x44')]){_0x3271e6[_0x229e('0x45')]=[{'all':!![]}];}_0x3271e6=_[_0x229e('0x40')]({},_0x3271e6,_0x528ab5[_0x229e('0x42')]);return db[_0x229e('0x43')][_0x229e('0x4a')](_0x3271e6)[_0x229e('0x28')](handleEntityNotFound(_0x36aff1,null))['then'](respondWithResult(_0x36aff1,null))[_0x229e('0x47')](handleError(_0x36aff1,null));};exports[_0x229e('0x4b')]=function(_0x2a2660,_0x2d466c){return db[_0x229e('0x43')][_0x229e('0x4b')](_0x2a2660['body'],{})[_0x229e('0x28')](function(_0x47fc14){var _0x38a914=_0x2a2660['user'][_0x229e('0x2a')]({'plain':!![]});if(!_0x38a914)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38a914['role']===_0x229e('0x4c')){var _0x6eda77=_0x47fc14['get']({'plain':!![]});var _0x3262dd=_0x229e('0x2b');return db[_0x229e('0x4d')][_0x229e('0x4a')]({'where':{'name':_0x3262dd,'userProfileId':_0x38a914[_0x229e('0x4e')]},'raw':!![]})['then'](function(_0x1d49e0){if(_0x1d49e0&&_0x1d49e0['autoAssociation']===0x0){return db[_0x229e('0x2c')]['create']({'name':_0x6eda77[_0x229e('0x2f')],'resourceId':_0x6eda77['id'],'type':_0x1d49e0[_0x229e('0x2f')],'sectionId':_0x1d49e0['id']},{})['then'](function(){return _0x47fc14;});}else{return _0x47fc14;}})['catch'](function(_0x27a8bb){logger[_0x229e('0x2d')](_0x229e('0x4f'),_0x27a8bb);throw _0x27a8bb;});}return _0x47fc14;})[_0x229e('0x28')](respondWithResult(_0x2d466c,0xc9))[_0x229e('0x47')](handleError(_0x2d466c,null));};exports[_0x229e('0x27')]=function(_0x3391f3,_0x18930e){if(_0x3391f3['body']['id']){delete _0x3391f3['body']['id'];}return db[_0x229e('0x43')][_0x229e('0x4a')]({'where':{'id':_0x3391f3[_0x229e('0x49')]['id']}})[_0x229e('0x28')](handleEntityNotFound(_0x18930e,null))[_0x229e('0x28')](saveUpdates(_0x3391f3[_0x229e('0x50')],null))[_0x229e('0x28')](respondWithResult(_0x18930e,null))['catch'](handleError(_0x18930e,null));};exports[_0x229e('0x29')]=function(_0x22fe34,_0x4d6491){return db[_0x229e('0x43')][_0x229e('0x4a')]({'where':{'id':_0x22fe34[_0x229e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d6491,null))[_0x229e('0x28')](removeEntity(_0x4d6491,null))['catch'](handleError(_0x4d6491,null));};exports[_0x229e('0x51')]=function(_0x36f256,_0x3ee86a){return db['CmCompany'][_0x229e('0x51')]()[_0x229e('0x28')](respondWithResult(_0x3ee86a,null))['catch'](handleError(_0x3ee86a,null));};exports[_0x229e('0x52')]=function(_0x26a9f3,_0x34f847,_0x5dc645){return db['CmContact'][_0x229e('0x4a')]({'where':{'id':_0x26a9f3[_0x229e('0x49')]['id']}})[_0x229e('0x28')](handleEntityNotFound(_0x34f847,null))[_0x229e('0x28')](function(_0x23f628){if(_0x23f628){return _0x23f628[_0x229e('0x52')](_0x26a9f3[_0x229e('0x50')]['ids'],_['omit'](_0x26a9f3[_0x229e('0x50')],[_0x229e('0x53'),'id'])||{});}})[_0x229e('0x28')](respondWithResult(_0x34f847,null))[_0x229e('0x47')](handleError(_0x34f847,null));};exports['getContacts']=function(_0x4f751a,_0x1dd504,_0x34a0ff){var _0x2369a2={};var _0x2ad6f8={};var _0x1b8d65;var _0xec39ef;return db[_0x229e('0x43')]['findOne']({'where':{'id':_0x4f751a['params']['id']}})[_0x229e('0x28')](handleEntityNotFound(_0x1dd504,null))['then'](function(_0x4a3278){if(_0x4a3278){_0x1b8d65=_0x4a3278;_0x2ad6f8[_0x229e('0x31')]=_[_0x229e('0x32')](db[_0x229e('0x54')]['rawAttributes']);_0x2ad6f8[_0x229e('0x33')]=_[_0x229e('0x32')](_0x4f751a[_0x229e('0x33')]);_0x2ad6f8['filters']=_[_0x229e('0x36')](_0x2ad6f8[_0x229e('0x31')],_0x2ad6f8[_0x229e('0x33')]);_0x2369a2[_0x229e('0x35')]=_['intersection'](_0x2ad6f8[_0x229e('0x31')],qs[_0x229e('0x37')](_0x4f751a['query'][_0x229e('0x37')]));_0x2369a2['attributes']=_0x2369a2[_0x229e('0x35')][_0x229e('0x38')]?_0x2369a2['attributes']:_0x2ad6f8[_0x229e('0x31')];_0x2369a2[_0x229e('0x3b')]=qs[_0x229e('0x3c')](_0x4f751a[_0x229e('0x33')][_0x229e('0x3c')]);_0x2369a2['where']=qs[_0x229e('0x34')](_[_0x229e('0x3e')](_0x4f751a[_0x229e('0x33')],_0x2ad6f8[_0x229e('0x34')]));if(_0x4f751a['query'][_0x229e('0x3f')]){_0x2369a2[_0x229e('0x3d')]=_[_0x229e('0x40')](_0x2369a2[_0x229e('0x3d')],{'$or':_[_0x229e('0x41')](_0x2369a2[_0x229e('0x35')],function(_0x5e083e){var _0x490539={};_0x490539[_0x5e083e]={'$like':'%'+_0x4f751a['query'][_0x229e('0x3f')]+'%'};return _0x490539;})});}_0x2369a2=_[_0x229e('0x40')]({},_0x2369a2,_0x4f751a[_0x229e('0x42')]);return _0x1b8d65['getContacts'](_0x2369a2);}})[_0x229e('0x28')](function(_0x3082ed){if(_0x3082ed){_0xec39ef=_0x3082ed[_0x229e('0x38')];if(!_0x4f751a['query'][_0x229e('0x39')](_0x229e('0x3a'))){_0x2369a2[_0x229e('0x21')]=qs['limit'](_0x4f751a[_0x229e('0x33')][_0x229e('0x21')]);_0x2369a2[_0x229e('0x1f')]=qs[_0x229e('0x1f')](_0x4f751a[_0x229e('0x33')][_0x229e('0x1f')]);}return _0x1b8d65[_0x229e('0x55')](_0x2369a2);}})[_0x229e('0x28')](function(_0x3543a7){if(_0x3543a7){return _0x3543a7?{'count':_0xec39ef,'rows':_0x3543a7}:null;}})[_0x229e('0x28')](respondWithResult(_0x1dd504,null))[_0x229e('0x47')](handleError(_0x1dd504,null));};
\ No newline at end of file
+var _0x0e97=['ids','omit','findOne','rawAttributes','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','Companies','UserProfileResource','sendStatus','error','name','index','CmCompany','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','filter','options','include','findAll','rows','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact'];(function(_0x35e7b3,_0x770749){var _0x1cb325=function(_0x157d26){while(--_0x157d26){_0x35e7b3['push'](_0x35e7b3['shift']());}};_0x1cb325(++_0x770749);}(_0x0e97,0x161));var _0x70e9=function(_0x87b0b9,_0x526c12){_0x87b0b9=_0x87b0b9-0x0;var _0x8ee1e5=_0x0e97[_0x87b0b9];return _0x8ee1e5;};'use strict';var emlformat=require(_0x70e9('0x0'));var rimraf=require(_0x70e9('0x1'));var zipdir=require(_0x70e9('0x2'));var jsonpatch=require(_0x70e9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70e9('0x4'));var Mustache=require(_0x70e9('0x5'));var util=require(_0x70e9('0x6'));var path=require('path');var sox=require(_0x70e9('0x7'));var csv=require('to-csv');var ejs=require(_0x70e9('0x8'));var fs=require('fs');var fs_extra=require(_0x70e9('0x9'));var _=require(_0x70e9('0xa'));var squel=require(_0x70e9('0xb'));var crypto=require(_0x70e9('0xc'));var jsforce=require(_0x70e9('0xd'));var deskjs=require(_0x70e9('0xe'));var toCsv=require(_0x70e9('0xf'));var querystring=require(_0x70e9('0x10'));var Papa=require(_0x70e9('0x11'));var Redis=require(_0x70e9('0x12'));var authService=require(_0x70e9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x70e9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x70e9('0x15'));var utils=require(_0x70e9('0x16'));var config=require(_0x70e9('0x17'));var licenseUtil=require(_0x70e9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cc88b,_0x3f828e){_0x3f828e=_0x3f828e||0xcc;return function(_0x3a7d06){if(_0x3a7d06){return _0x4cc88b['sendStatus'](_0x3f828e);}return _0x4cc88b['status'](_0x3f828e)[_0x70e9('0x19')]();};}function respondWithResult(_0x384fdd,_0x388a5c){_0x388a5c=_0x388a5c||0xc8;return function(_0xed65a8){if(_0xed65a8){return _0x384fdd[_0x70e9('0x1a')](_0x388a5c)[_0x70e9('0x1b')](_0xed65a8);}};}function respondWithFilteredResult(_0x15aca1,_0x1532fd){return function(_0x3a5274){if(_0x3a5274){var _0x5b34c7=typeof _0x1532fd[_0x70e9('0x1c')]===_0x70e9('0x1d')&&typeof _0x1532fd['limit']===_0x70e9('0x1d');var _0x3b5042=_0x3a5274[_0x70e9('0x1e')];var _0x583bbe=_0x5b34c7?0x0:_0x1532fd[_0x70e9('0x1c')];var _0xa1c7dd=_0x5b34c7?_0x3a5274[_0x70e9('0x1e')]:_0x1532fd[_0x70e9('0x1c')]+_0x1532fd[_0x70e9('0x1f')];var _0xc131d3;if(_0xa1c7dd>=_0x3b5042){_0xa1c7dd=_0x3b5042;_0xc131d3=0xc8;}else{_0xc131d3=0xce;}_0x15aca1[_0x70e9('0x1a')](_0xc131d3);return _0x15aca1['set'](_0x70e9('0x20'),_0x583bbe+'-'+_0xa1c7dd+'/'+_0x3b5042)[_0x70e9('0x1b')](_0x3a5274);}return null;};}function patchUpdates(_0x26e78f){return function(_0xbd3b9b){try{jsonpatch[_0x70e9('0x21')](_0xbd3b9b,_0x26e78f,!![]);}catch(_0x4e7cee){return BPromise[_0x70e9('0x22')](_0x4e7cee);}return _0xbd3b9b['save']();};}function saveUpdates(_0x503a78,_0x4dbceb){return function(_0x3f44e1){if(_0x3f44e1){return _0x3f44e1['update'](_0x503a78)[_0x70e9('0x23')](function(_0x845dcf){return _0x845dcf;});}return null;};}function removeEntity(_0x4775dc,_0x4b2db4){return function(_0x1ee118){if(_0x1ee118){return _0x1ee118[_0x70e9('0x24')]()[_0x70e9('0x23')](function(){var _0x353595=_0x1ee118['get']({'plain':!![]});var _0x589e76=_0x70e9('0x25');return db[_0x70e9('0x26')][_0x70e9('0x24')]({'where':{'type':_0x589e76,'resourceId':_0x353595['id']}})[_0x70e9('0x23')](function(){return _0x1ee118;});})[_0x70e9('0x23')](function(){_0x4775dc[_0x70e9('0x1a')](0xcc)[_0x70e9('0x19')]();});}};}function handleEntityNotFound(_0xf1ee05,_0x3873df){return function(_0x133b75){if(!_0x133b75){_0xf1ee05[_0x70e9('0x27')](0x194);}return _0x133b75;};}function handleError(_0x55b25b,_0x990e41){_0x990e41=_0x990e41||0x1f4;return function(_0x1095f0){logger[_0x70e9('0x28')](_0x1095f0['stack']);if(_0x1095f0[_0x70e9('0x29')]){delete _0x1095f0['name'];}_0x55b25b['status'](_0x990e41)['send'](_0x1095f0);};}exports[_0x70e9('0x2a')]=function(_0x570251,_0x2ab076){var _0x415630={},_0x594bbe={},_0x9ed922={'count':0x0,'rows':[]};return db[_0x70e9('0x2b')]['describe']()[_0x70e9('0x23')](function(_0x375862){_0x594bbe[_0x70e9('0x2c')]=_[_0x70e9('0x2d')](_0x375862);_0x594bbe[_0x70e9('0x2e')]=_[_0x70e9('0x2d')](_0x570251['query']);_0x594bbe['filters']=_[_0x70e9('0x2f')](_0x594bbe[_0x70e9('0x2c')],_0x594bbe[_0x70e9('0x2e')]);_0x415630['attributes']=_[_0x70e9('0x2f')](_0x594bbe[_0x70e9('0x2c')],qs[_0x70e9('0x30')](_0x570251[_0x70e9('0x2e')][_0x70e9('0x30')]));_0x415630[_0x70e9('0x31')]=_0x415630[_0x70e9('0x31')][_0x70e9('0x32')]?_0x415630[_0x70e9('0x31')]:_0x594bbe['model'];if(!_0x570251[_0x70e9('0x2e')][_0x70e9('0x33')](_0x70e9('0x34'))){_0x415630[_0x70e9('0x1f')]=qs['limit'](_0x570251[_0x70e9('0x2e')][_0x70e9('0x1f')]);_0x415630[_0x70e9('0x1c')]=qs[_0x70e9('0x1c')](_0x570251[_0x70e9('0x2e')][_0x70e9('0x1c')]);}_0x415630[_0x70e9('0x35')]=qs[_0x70e9('0x36')](_0x570251[_0x70e9('0x2e')][_0x70e9('0x36')]);_0x415630['where']=qs['filters'](_['pick'](_0x570251[_0x70e9('0x2e')],_0x594bbe[_0x70e9('0x37')]),_0x375862);if(_0x570251[_0x70e9('0x2e')]['filter']){_0x415630[_0x70e9('0x38')]=_[_0x70e9('0x39')](_0x415630[_0x70e9('0x38')],{'$or':_[_0x70e9('0x3a')](_0x415630[_0x70e9('0x31')],function(_0x18cb40){var _0x116919={};_0x116919[_0x18cb40]={'$like':'%'+_0x570251[_0x70e9('0x2e')][_0x70e9('0x3b')]+'%'};return _0x116919;})});}_0x415630=_[_0x70e9('0x39')]({},_0x415630,_0x570251[_0x70e9('0x3c')]);var _0x2f6696={'where':_0x415630[_0x70e9('0x38')]};return db['CmCompany'][_0x70e9('0x1e')](_0x2f6696)[_0x70e9('0x23')](function(_0x13434a){_0x9ed922[_0x70e9('0x1e')]=_0x13434a;if(_0x570251[_0x70e9('0x2e')]['includeAll']){_0x415630[_0x70e9('0x3d')]=[{'all':!![]}];}return db[_0x70e9('0x2b')][_0x70e9('0x3e')](_0x415630);})[_0x70e9('0x23')](function(_0x27668e){_0x9ed922[_0x70e9('0x3f')]=_0x27668e;return _0x9ed922;})[_0x70e9('0x23')](respondWithFilteredResult(_0x2ab076,_0x415630))['catch'](handleError(_0x2ab076,null));})[_0x70e9('0x40')](handleError(_0x2ab076,null));};exports[_0x70e9('0x41')]=function(_0x208664,_0x3d0546){var _0x2f4071={'raw':![],'where':{'id':_0x208664['params']['id']}},_0x45d5c1={};_0x45d5c1[_0x70e9('0x2c')]=_[_0x70e9('0x2d')](db[_0x70e9('0x2b')]['rawAttributes']);_0x45d5c1[_0x70e9('0x2e')]=_[_0x70e9('0x2d')](_0x208664[_0x70e9('0x2e')]);_0x45d5c1[_0x70e9('0x37')]=_['intersection'](_0x45d5c1[_0x70e9('0x2c')],_0x45d5c1[_0x70e9('0x2e')]);_0x2f4071[_0x70e9('0x31')]=_[_0x70e9('0x2f')](_0x45d5c1[_0x70e9('0x2c')],qs[_0x70e9('0x30')](_0x208664[_0x70e9('0x2e')][_0x70e9('0x30')]));_0x2f4071[_0x70e9('0x31')]=_0x2f4071[_0x70e9('0x31')][_0x70e9('0x32')]?_0x2f4071[_0x70e9('0x31')]:_0x45d5c1[_0x70e9('0x2c')];if(_0x208664[_0x70e9('0x2e')][_0x70e9('0x42')]){_0x2f4071['include']=[{'all':!![]}];}_0x2f4071=_['merge']({},_0x2f4071,_0x208664[_0x70e9('0x3c')]);return db[_0x70e9('0x2b')][_0x70e9('0x43')](_0x2f4071)[_0x70e9('0x23')](handleEntityNotFound(_0x3d0546,null))['then'](respondWithResult(_0x3d0546,null))[_0x70e9('0x40')](handleError(_0x3d0546,null));};exports[_0x70e9('0x44')]=function(_0x355c0a,_0xd7fcba){return db[_0x70e9('0x2b')][_0x70e9('0x44')](_0x355c0a['body'],{})[_0x70e9('0x23')](function(_0x1def4e){var _0x4a4380=_0x355c0a[_0x70e9('0x45')][_0x70e9('0x46')]({'plain':!![]});if(!_0x4a4380)throw new Error(_0x70e9('0x47'));if(_0x4a4380['role']===_0x70e9('0x45')){var _0x58d05a=_0x1def4e[_0x70e9('0x46')]({'plain':!![]});var _0x3b4b16=_0x70e9('0x25');return db[_0x70e9('0x48')][_0x70e9('0x43')]({'where':{'name':_0x3b4b16,'userProfileId':_0x4a4380[_0x70e9('0x49')]},'raw':!![]})[_0x70e9('0x23')](function(_0x5ade45){if(_0x5ade45&&_0x5ade45[_0x70e9('0x4a')]===0x0){return db[_0x70e9('0x26')][_0x70e9('0x44')]({'name':_0x58d05a[_0x70e9('0x29')],'resourceId':_0x58d05a['id'],'type':_0x5ade45[_0x70e9('0x29')],'sectionId':_0x5ade45['id']},{})[_0x70e9('0x23')](function(){return _0x1def4e;});}else{return _0x1def4e;}})[_0x70e9('0x40')](function(_0x35b3d4){logger[_0x70e9('0x28')](_0x70e9('0x4b'),_0x35b3d4);throw _0x35b3d4;});}return _0x1def4e;})['then'](respondWithResult(_0xd7fcba,0xc9))[_0x70e9('0x40')](handleError(_0xd7fcba,null));};exports[_0x70e9('0x4c')]=function(_0x3b0f67,_0x44b55f){if(_0x3b0f67[_0x70e9('0x4d')]['id']){delete _0x3b0f67['body']['id'];}return db[_0x70e9('0x2b')]['find']({'where':{'id':_0x3b0f67[_0x70e9('0x4e')]['id']}})[_0x70e9('0x23')](handleEntityNotFound(_0x44b55f,null))[_0x70e9('0x23')](saveUpdates(_0x3b0f67['body'],null))[_0x70e9('0x23')](respondWithResult(_0x44b55f,null))[_0x70e9('0x40')](handleError(_0x44b55f,null));};exports[_0x70e9('0x24')]=function(_0x280e20,_0x14b0da){return db[_0x70e9('0x2b')][_0x70e9('0x43')]({'where':{'id':_0x280e20[_0x70e9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x14b0da,null))[_0x70e9('0x23')](removeEntity(_0x14b0da,null))[_0x70e9('0x40')](handleError(_0x14b0da,null));};exports[_0x70e9('0x4f')]=function(_0x299677,_0x12bc23){return db[_0x70e9('0x2b')][_0x70e9('0x4f')]()[_0x70e9('0x23')](respondWithResult(_0x12bc23,null))[_0x70e9('0x40')](handleError(_0x12bc23,null));};exports[_0x70e9('0x50')]=function(_0x4b35f0,_0x559944,_0x92aec3){return db[_0x70e9('0x51')][_0x70e9('0x43')]({'where':{'id':_0x4b35f0[_0x70e9('0x4e')]['id']}})[_0x70e9('0x23')](handleEntityNotFound(_0x559944,null))['then'](function(_0x3a3bfe){if(_0x3a3bfe){return _0x3a3bfe[_0x70e9('0x50')](_0x4b35f0[_0x70e9('0x4d')][_0x70e9('0x52')],_[_0x70e9('0x53')](_0x4b35f0[_0x70e9('0x4d')],['ids','id'])||{});}})[_0x70e9('0x23')](respondWithResult(_0x559944,null))['catch'](handleError(_0x559944,null));};exports['getContacts']=function(_0x48ee05,_0x3cb6e9,_0x3364b7){var _0x67a51f={};var _0x51deb7={};var _0x179e5b;var _0x31ace4;return db[_0x70e9('0x2b')][_0x70e9('0x54')]({'where':{'id':_0x48ee05[_0x70e9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cb6e9,null))['then'](function(_0x5d7a8a){if(_0x5d7a8a){_0x179e5b=_0x5d7a8a;_0x51deb7[_0x70e9('0x2c')]=_[_0x70e9('0x2d')](db[_0x70e9('0x51')][_0x70e9('0x55')]);_0x51deb7['query']=_[_0x70e9('0x2d')](_0x48ee05['query']);_0x51deb7[_0x70e9('0x37')]=_[_0x70e9('0x2f')](_0x51deb7['model'],_0x51deb7[_0x70e9('0x2e')]);_0x67a51f['attributes']=_[_0x70e9('0x2f')](_0x51deb7['model'],qs[_0x70e9('0x30')](_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x30')]));_0x67a51f[_0x70e9('0x31')]=_0x67a51f['attributes']['length']?_0x67a51f[_0x70e9('0x31')]:_0x51deb7[_0x70e9('0x2c')];_0x67a51f[_0x70e9('0x35')]=qs[_0x70e9('0x36')](_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x36')]);_0x67a51f['where']=qs[_0x70e9('0x37')](_['pick'](_0x48ee05[_0x70e9('0x2e')],_0x51deb7['filters']));if(_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x3b')]){_0x67a51f[_0x70e9('0x38')]=_[_0x70e9('0x39')](_0x67a51f['where'],{'$or':_['map'](_0x67a51f['attributes'],function(_0x33d09c){var _0x552585={};_0x552585[_0x33d09c]={'$like':'%'+_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x3b')]+'%'};return _0x552585;})});}_0x67a51f=_[_0x70e9('0x39')]({},_0x67a51f,_0x48ee05[_0x70e9('0x3c')]);return _0x179e5b[_0x70e9('0x56')](_0x67a51f);}})['then'](function(_0x46dc5e){if(_0x46dc5e){_0x31ace4=_0x46dc5e['length'];if(!_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x33')](_0x70e9('0x34'))){_0x67a51f['limit']=qs['limit'](_0x48ee05[_0x70e9('0x2e')][_0x70e9('0x1f')]);_0x67a51f[_0x70e9('0x1c')]=qs[_0x70e9('0x1c')](_0x48ee05['query'][_0x70e9('0x1c')]);}return _0x179e5b[_0x70e9('0x56')](_0x67a51f);}})['then'](function(_0xb6d0cf){if(_0xb6d0cf){return _0xb6d0cf?{'count':_0x31ace4,'rows':_0xb6d0cf}:null;}})['then'](respondWithResult(_0x3cb6e9,null))[_0x70e9('0x40')](handleError(_0x3cb6e9,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 3b211d5..f7eb654 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 _0xc3ab=['api','moment','bluebird','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util'];(function(_0x17e94c,_0x86bf53){var _0x257169=function(_0x24f0e0){while(--_0x24f0e0){_0x17e94c['push'](_0x17e94c['shift']());}};_0x257169(++_0x86bf53);}(_0xc3ab,0xae));var _0xbc3a=function(_0x28acc4,_0x23586){_0x28acc4=_0x28acc4-0x0;var _0x207585=_0xc3ab[_0x28acc4];return _0x207585;};'use strict';var _=require(_0xbc3a('0x0'));var util=require(_0xbc3a('0x1'));var logger=require('../../config/logger')(_0xbc3a('0x2'));var moment=require(_0xbc3a('0x3'));var BPromise=require(_0xbc3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc3a('0x5'));var rimraf=require(_0xbc3a('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc3a('0x7'));module[_0xbc3a('0x8')]=function(_0x175be7,_0x2d0d92){return _0x175be7[_0xbc3a('0x9')](_0xbc3a('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6096=['path','rimraf','../../config/environment','define','cm_companies','lodash','util','../../config/logger','api','request-promise'];(function(_0x36accc,_0xc4b9b3){var _0x5e8daf=function(_0x2950de){while(--_0x2950de){_0x36accc['push'](_0x36accc['shift']());}};_0x5e8daf(++_0xc4b9b3);}(_0x6096,0x7d));var _0x6609=function(_0x4cd6b9,_0x2da770){_0x4cd6b9=_0x4cd6b9-0x0;var _0x4437ea=_0x6096[_0x4cd6b9];return _0x4437ea;};'use strict';var _=require(_0x6609('0x0'));var util=require(_0x6609('0x1'));var logger=require(_0x6609('0x2'))(_0x6609('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6609('0x4'));var fs=require('fs');var path=require(_0x6609('0x5'));var rimraf=require(_0x6609('0x6'));var config=require(_0x6609('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x27f082,_0x4c56c7){return _0x27f082[_0x6609('0x8')]('CmCompany',attributes,{'tableName':_0x6609('0x9'),'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 ed0eee5..7fe0a13 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 _0x6b29=['request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x113a8f,_0x52894b){var _0x1c5708=function(_0x2dc65b){while(--_0x2dc65b){_0x113a8f['push'](_0x113a8f['shift']());}};_0x1c5708(++_0x52894b);}(_0x6b29,0x141));var _0x96b2=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6b29[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x96b2('0x0'));var util=require(_0x96b2('0x1'));var moment=require(_0x96b2('0x2'));var BPromise=require(_0x96b2('0x3'));var rs=require(_0x96b2('0x4'));var fs=require('fs');var Redis=require(_0x96b2('0x5'));var db=require(_0x96b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96b2('0x7'))(_0x96b2('0x8'));var config=require(_0x96b2('0x9'));var jayson=require(_0x96b2('0xa'));var client=jayson['client'][_0x96b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5313e3,_0x5e7d20,_0x42fcce){return new BPromise(function(_0x471fe9,_0x173b00){return client['request'](_0x5313e3,_0x42fcce)[_0x96b2('0xc')](function(_0x31e5dc){logger[_0x96b2('0xd')](_0x96b2('0xe'),_0x5e7d20,_0x96b2('0xf'));logger[_0x96b2('0x10')](_0x96b2('0x11'),_0x5e7d20,_0x96b2('0xf'),JSON['stringify'](_0x31e5dc));if(_0x31e5dc[_0x96b2('0x12')]){if(_0x31e5dc[_0x96b2('0x12')]['code']===0x1f4){logger[_0x96b2('0x12')](_0x96b2('0xe'),_0x5e7d20,_0x31e5dc['error'][_0x96b2('0x13')]);return _0x173b00(_0x31e5dc[_0x96b2('0x12')][_0x96b2('0x13')]);}logger[_0x96b2('0x12')](_0x96b2('0xe'),_0x5e7d20,_0x31e5dc[_0x96b2('0x12')][_0x96b2('0x13')]);return _0x471fe9(_0x31e5dc[_0x96b2('0x12')][_0x96b2('0x13')]);}else{logger[_0x96b2('0xd')](_0x96b2('0xe'),_0x5e7d20,_0x96b2('0xf'));_0x471fe9(_0x31e5dc[_0x96b2('0x14')][_0x96b2('0x13')]);}})['catch'](function(_0x23b818){logger['error'](_0x96b2('0xe'),_0x5e7d20,_0x23b818);_0x173b00(_0x23b818);});});}
\ No newline at end of file
+var _0x3c99=['rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x3c99,0x189));var _0x93c9=function(_0x1761f7,_0x3367c7){_0x1761f7=_0x1761f7-0x0;var _0xfb470b=_0x3c99[_0x1761f7];return _0xfb470b;};'use strict';var _=require('lodash');var util=require(_0x93c9('0x0'));var moment=require(_0x93c9('0x1'));var BPromise=require(_0x93c9('0x2'));var rs=require(_0x93c9('0x3'));var fs=require('fs');var Redis=require(_0x93c9('0x4'));var db=require(_0x93c9('0x5'))['db'];var utils=require(_0x93c9('0x6'));var logger=require('../../config/logger')(_0x93c9('0x7'));var config=require(_0x93c9('0x8'));var jayson=require(_0x93c9('0x9'));var client=jayson['client'][_0x93c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c8f1e,_0x476d99,_0x5a4a7e){return new BPromise(function(_0x3f4865,_0x30b1dd){return client['request'](_0x4c8f1e,_0x5a4a7e)[_0x93c9('0xb')](function(_0x518d62){logger['info']('CmCompany,\x20%s,\x20%s',_0x476d99,_0x93c9('0xc'));logger[_0x93c9('0xd')](_0x93c9('0xe'),_0x476d99,_0x93c9('0xc'),JSON[_0x93c9('0xf')](_0x518d62));if(_0x518d62['error']){if(_0x518d62[_0x93c9('0x10')]['code']===0x1f4){logger['error'](_0x93c9('0x11'),_0x476d99,_0x518d62['error'][_0x93c9('0x12')]);return _0x30b1dd(_0x518d62[_0x93c9('0x10')][_0x93c9('0x12')]);}logger[_0x93c9('0x10')](_0x93c9('0x11'),_0x476d99,_0x518d62['error'][_0x93c9('0x12')]);return _0x3f4865(_0x518d62['error'][_0x93c9('0x12')]);}else{logger[_0x93c9('0x13')](_0x93c9('0x11'),_0x476d99,_0x93c9('0xc'));_0x3f4865(_0x518d62['result']['message']);}})['catch'](function(_0x26184a){logger[_0x93c9('0x10')](_0x93c9('0x11'),_0x476d99,_0x26184a);_0x30b1dd(_0x26184a);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 371439d..e375bf9 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 _0x3ee7=['../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x38cac1,_0x1c852){var _0x386a7c=function(_0x205246){while(--_0x205246){_0x38cac1['push'](_0x38cac1['shift']());}};_0x386a7c(++_0x1c852);}(_0x3ee7,0xe1));var _0x73ee=function(_0x36375a,_0x43ede3){_0x36375a=_0x36375a-0x0;var _0xe646d0=_0x3ee7[_0x36375a];return _0xe646d0;};'use strict';var multer=require(_0x73ee('0x0'));var util=require(_0x73ee('0x1'));var path=require(_0x73ee('0x2'));var timeout=require('connect-timeout');var express=require(_0x73ee('0x3'));var router=express[_0x73ee('0x4')]();var fs_extra=require(_0x73ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x73ee('0x6'));var config=require('../../config/environment');var controller=require(_0x73ee('0x7'));router[_0x73ee('0x8')]('/',auth[_0x73ee('0x9')](),controller[_0x73ee('0xa')]);router[_0x73ee('0x8')](_0x73ee('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x73ee('0xc'),auth['isAuthenticated'](),controller[_0x73ee('0xd')]);router[_0x73ee('0x8')](_0x73ee('0xe'),auth[_0x73ee('0x9')](),controller[_0x73ee('0xf')]);router[_0x73ee('0x10')]('/',auth[_0x73ee('0x9')](),controller['create']);router[_0x73ee('0x10')]('/:id/contacts',auth[_0x73ee('0x9')](),controller[_0x73ee('0x11')]);router[_0x73ee('0x12')](_0x73ee('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x73ee('0x13')](_0x73ee('0xc'),auth[_0x73ee('0x9')](),controller[_0x73ee('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x18e9=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','create','addContacts','put','update','delete'];(function(_0x468f91,_0x2cb8e1){var _0x36e3a8=function(_0xe418d2){while(--_0xe418d2){_0x468f91['push'](_0x468f91['shift']());}};_0x36e3a8(++_0x2cb8e1);}(_0x18e9,0x1e5));var _0x918e=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x18e9[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require(_0x918e('0x0'));var util=require(_0x918e('0x1'));var path=require(_0x918e('0x2'));var timeout=require(_0x918e('0x3'));var express=require(_0x918e('0x4'));var router=express['Router']();var fs_extra=require(_0x918e('0x5'));var auth=require(_0x918e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x918e('0x7'));var controller=require('./cmCompany.controller');router[_0x918e('0x8')]('/',auth[_0x918e('0x9')](),controller[_0x918e('0xa')]);router['get'](_0x918e('0xb'),auth[_0x918e('0x9')](),controller['describe']);router[_0x918e('0x8')](_0x918e('0xc'),auth[_0x918e('0x9')](),controller[_0x918e('0xd')]);router[_0x918e('0x8')](_0x918e('0xe'),auth[_0x918e('0x9')](),controller[_0x918e('0xf')]);router['post']('/',auth[_0x918e('0x9')](),controller[_0x918e('0x10')]);router['post'](_0x918e('0xe'),auth['isAuthenticated'](),controller[_0x918e('0x11')]);router[_0x918e('0x12')]('/:id',auth[_0x918e('0x9')](),controller[_0x918e('0x13')]);router[_0x918e('0x14')](_0x918e('0xc'),auth[_0x918e('0x9')](),controller[_0x918e('0x15')]);module[_0x918e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 4dc6048..f20d619 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 _0xf67a=['DATE','NOW','lodash','exports','STRING','INTEGER'];(function(_0x314331,_0x31e602){var _0xe15a39=function(_0x47d522){while(--_0x47d522){_0x314331['push'](_0x314331['shift']());}};_0xe15a39(++_0x31e602);}(_0xf67a,0x1b8));var _0xaf67=function(_0x1dadda,_0x158116){_0x1dadda=_0x1dadda-0x0;var _0x37e931=_0xf67a[_0x1dadda];return _0x37e931;};'use strict';var _=require(_0xaf67('0x0'));var Sequelize=require('sequelize');module[_0xaf67('0x1')]={'firstName':{'type':Sequelize[_0xaf67('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xaf67('0x2')]},'street':{'type':Sequelize[_0xaf67('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xaf67('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xaf67('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xaf67('0x2')]},'mobile':{'type':Sequelize[_0xaf67('0x2')]},'fax':{'type':Sequelize[_0xaf67('0x2')]},'email':{'type':Sequelize[_0xaf67('0x2')]},'url':{'type':Sequelize[_0xaf67('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xaf67('0x2')]},'skype':{'type':Sequelize[_0xaf67('0x2')]},'teams':{'type':Sequelize[_0xaf67('0x2')]},'viber':{'type':Sequelize[_0xaf67('0x2')]},'line':{'type':Sequelize[_0xaf67('0x2')]},'wechat':{'type':Sequelize[_0xaf67('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xaf67('0x3')]},'priority':{'type':Sequelize[_0xaf67('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xaf67('0x4')],'defaultValue':Sequelize[_0xaf67('0x5')]}};
\ No newline at end of file
+var _0xb88a=['TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x42f393,_0x3e0df0){var _0x2b035d=function(_0x36af6e){while(--_0x36af6e){_0x42f393['push'](_0x42f393['shift']());}};_0x2b035d(++_0x3e0df0);}(_0xb88a,0x1c4));var _0xab88=function(_0x364438,_0x156cd5){_0x364438=_0x364438-0x0;var _0x1abb30=_0xb88a[_0x364438];return _0x1abb30;};'use strict';var _=require(_0xab88('0x0'));var Sequelize=require(_0xab88('0x1'));module[_0xab88('0x2')]={'firstName':{'type':Sequelize[_0xab88('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xab88('0x3')]},'street':{'type':Sequelize[_0xab88('0x3')]},'postalCode':{'type':Sequelize[_0xab88('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xab88('0x3')]},'dateOfBirth':{'type':Sequelize[_0xab88('0x3')]},'description':{'type':Sequelize[_0xab88('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xab88('0x3')]},'fax':{'type':Sequelize[_0xab88('0x3')]},'email':{'type':Sequelize[_0xab88('0x3')]},'url':{'type':Sequelize[_0xab88('0x3')]},'facebook':{'type':Sequelize[_0xab88('0x3')]},'fb_data':{'type':Sequelize[_0xab88('0x3')]},'twitter':{'type':Sequelize[_0xab88('0x3')]},'skype':{'type':Sequelize[_0xab88('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xab88('0x3')]},'line':{'type':Sequelize[_0xab88('0x3')]},'wechat':{'type':Sequelize[_0xab88('0x3')]},'telegram':{'type':Sequelize[_0xab88('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xab88('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xab88('0x6')],'defaultValue':Sequelize[_0xab88('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5e22022..bf2d0b6 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 _0xbbd2=['status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','error','stack','name','send','CmContact','describe','length','keys','startsWith','cf_','push','CmCustomField','findOne','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','text','filter','isNil','Contact','c.ListId\x20IN\x20?','\x20=\x20?','isArray','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','having','resolve','role','agent','User','c.ListId\x20IS\x20NULL','user','toString','sequelize','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','custom','type','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','bulkCreate','duplicates','$or','ListId','findOrCreate','spread','$and','format','cf_%d','omit','pickBy','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','import','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','starttime','endtime','note','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','channel','startCase','Account','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','subject','substatus','threadId','Interaction','findAndCountAll','sortBy','reverse','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register'];(function(_0x1ef97c,_0x3a65f0){var _0x199029=function(_0x586208){while(--_0x586208){_0x1ef97c['push'](_0x1ef97c['shift']());}};_0x199029(++_0x3a65f0);}(_0xbbd2,0x100));var _0x2bbd=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xbbd2[_0x15ea09];return _0x3e9c78;};'use strict';var moment=require(_0x2bbd('0x0'));var BPromise=require('bluebird');var util=require(_0x2bbd('0x1'));var path=require(_0x2bbd('0x2'));var fs=require('fs');var _=require(_0x2bbd('0x3'));var squel=require(_0x2bbd('0x4'));var Papa=require(_0x2bbd('0x5'));var Redis=require(_0x2bbd('0x6'));var qs=require(_0x2bbd('0x7'));var as=require(_0x2bbd('0x8'));var logger=require(_0x2bbd('0x9'))(_0x2bbd('0xa'));var config=require(_0x2bbd('0xb'));var db=require(_0x2bbd('0xc'))['db'];config[_0x2bbd('0xd')]=_['defaults'](config[_0x2bbd('0xd')],{'host':_0x2bbd('0xe'),'port':0x18eb});var socket=require(_0x2bbd('0xf'))(new Redis(config['redis']));require(_0x2bbd('0x10'))[_0x2bbd('0x11')](socket);function respondWithResult(_0x3c4634,_0x3d582e){_0x3d582e=_0x3d582e||0xc8;return function(_0x3ec7cb){if(_0x3ec7cb){return _0x3c4634[_0x2bbd('0x12')](_0x3d582e)[_0x2bbd('0x13')](_0x3ec7cb);}};}function respondWithFilteredResult(_0x5ed59c,_0x1e7a09){return function(_0x3de9b0){if(_0x3de9b0){var _0xe20eed=typeof _0x1e7a09[_0x2bbd('0x14')]===_0x2bbd('0x15')&&typeof _0x1e7a09[_0x2bbd('0x16')]==='undefined';var _0x3d8ff6=_0x3de9b0['count'];var _0x1be2c3=_0xe20eed?0x0:_0x1e7a09[_0x2bbd('0x14')];var _0x2248ac=_0xe20eed?_0x3de9b0[_0x2bbd('0x17')]:_0x1e7a09[_0x2bbd('0x14')]+_0x1e7a09[_0x2bbd('0x16')];var _0x3a39ae;if(_0x2248ac>=_0x3d8ff6){_0x2248ac=_0x3d8ff6;_0x3a39ae=0xc8;}else{_0x3a39ae=0xce;}_0x5ed59c[_0x2bbd('0x12')](_0x3a39ae);return _0x5ed59c[_0x2bbd('0x18')]('Content-Range',_0x1be2c3+'-'+_0x2248ac+'/'+_0x3d8ff6)[_0x2bbd('0x13')](_0x3de9b0);}return null;};}function saveUpdates(_0x404101){return function(_0x232503){if(_0x232503){return _0x232503[_0x2bbd('0x19')](_0x404101)[_0x2bbd('0x1a')](function(_0x15b975){return _0x15b975;});}return null;};}function removeEntity(_0x490695){return function(_0xc20f3c){if(_0xc20f3c){return _0xc20f3c[_0x2bbd('0x1b')]()[_0x2bbd('0x1a')](function(){_0x490695[_0x2bbd('0x12')](0xcc)[_0x2bbd('0x1c')]();});}};}function handleEntityNotFound(_0xfd799e){return function(_0x16174a){if(!_0x16174a){_0xfd799e[_0x2bbd('0x1d')](0x194);}return _0x16174a;};}function handleError(_0x2df9bf,_0x498299){_0x498299=_0x498299||0x1f4;return function(_0x1e50d1){logger[_0x2bbd('0x1e')](_0x1e50d1[_0x2bbd('0x1f')]);if(_0x1e50d1[_0x2bbd('0x20')]){delete _0x1e50d1[_0x2bbd('0x20')];}_0x2df9bf[_0x2bbd('0x12')](_0x498299)[_0x2bbd('0x21')](_0x1e50d1);};}exports['index']=function(_0x151969,_0x1aba5a){var _0xf08d87={},_0x5e1cf5={},_0x32e715={'count':0x0,'rows':[]};return db[_0x2bbd('0x22')][_0x2bbd('0x23')]()['then'](function(_0x5dd706){var _0x1c4928=[];for(var _0x522e71=0x0;_0x522e71
','Attachments','Title','Data','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','length','join','Anonymous','split','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]'];(function(_0x122936,_0x4c53f1){var _0x178004=function(_0x1ed29f){while(--_0x1ed29f){_0x122936['push'](_0x122936['shift']());}};_0x178004(++_0x4c53f1);}(_0xdced,0xcb));var _0xddce=function(_0x42df6a,_0x373ee1){_0x42df6a=_0x42df6a-0x0;var _0xc9c7f4=_0xdced[_0x42df6a];return _0xc9c7f4;};'use strict';var _=require('lodash');var moment=require(_0xddce('0x0'));var random=require(_0xddce('0x1'));var fs=require('fs');var path=require(_0xddce('0x2'));var util=require(_0xddce('0x3'));var tnef=require(_0xddce('0x4'));var logger=require(_0xddce('0x5'))('email');var config=require(_0xddce('0x6'));function getAddress(_0x509b66){var _0x3bfdd2=_[_0xddce('0x7')](_0x509b66['value']);return _0x3bfdd2&&_0x3bfdd2[_0xddce('0x8')]?_0x3bfdd2['address']:_0xddce('0x9')+random[_0xddce('0xa')](0x6)+_0xddce('0xb');}function getFirstName(_0x105bf9){var _0x4b150b=_[_0xddce('0x7')](_0x105bf9[_0xddce('0xc')]);if(_0x4b150b&&_0x4b150b[_0xddce('0xd')]){if(_0x4b150b['name']==_0x4b150b['address']){return _0x4b150b[_0xddce('0xd')][_0xddce('0xe')](0x0,_0x4b150b['name'][_0xddce('0xf')]('@'));}var _0x362144=_0x4b150b[_0xddce('0xd')]['split'](/\s+/);return _0x362144[_0xddce('0x10')]>0x1?_0x362144['slice'](0x0,-0x1)[_0xddce('0x11')]('\x20'):_0x4b150b[_0xddce('0xd')];}return _0xddce('0x12');}function getLastName(_0x10a409){var _0x1e5ca2=_[_0xddce('0x7')](_0x10a409[_0xddce('0xc')]);if(_0x1e5ca2&&_0x1e5ca2['name']){var _0x5311be=_0x1e5ca2[_0xddce('0xd')][_0xddce('0x13')](/\s+/);return _0x5311be['length']>0x1?_0x5311be[_0xddce('0x14')]():'';}return'';}function getMails(_0x4d2e2a,_0x245345){var _0x53203f='';for(var _0x30205e=0x0;_0x30205e<_0x245345[_0xddce('0xc')]['length'];_0x30205e+=0x1){if(_0x245345[_0xddce('0xc')][_0x30205e][_0xddce('0x8')]!==_0x4d2e2a){if(!_[_0xddce('0x15')](_0x53203f)){_0x53203f+=',';}_0x53203f+=_0x245345[_0xddce('0xc')][_0x30205e]['name']||_0x245345[_0xddce('0xc')][_0x30205e][_0xddce('0x8')]||'';_0x53203f+='\x20<';_0x53203f+=_0x245345[_0xddce('0xc')][_0x30205e]['address']?_0x245345[_0xddce('0xc')][_0x30205e]['address']:_0xddce('0x9')+random['generate'](0x6)+_0xddce('0xb');_0x53203f+='>';}}return _0x53203f;}function parseEmail(_0x2399e7,_0x16467c,_0x489ca9){if(_0x16467c[_0xddce('0x16')]){var _0x7fc3a1=/