From: Andrea Bianco
Date: Sun, 29 Aug 2021 17:39:16 +0000 (+0200)
Subject: Built motion from commit fa1ea1af.|2.5.34
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20110license.mail?a=commitdiff_plain;h=7fee4332d01abeb7bc90a152b78f2f652e240d86;p=motion2.git
Built motion from commit fa1ea1af.|2.5.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 62429e9..1980c68 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-08-29T17:00:00.135Z",
+ "time": "2021-08-29T17:31:57.563Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 103b237..e65ac47 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-29T17:00:00.135Z",
+ "time": "2021-08-29T17:31:57.563Z",
"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 dab3e2b..29f723c 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 _0xa71c=['contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x3a0186,_0x55535d){var _0x22d4ba=function(_0x165f33){while(--_0x165f33){_0x3a0186['push'](_0x3a0186['shift']());}};_0x22d4ba(++_0x55535d);}(_0xa71c,0x93));var _0xca71=function(_0x4db7e6,_0x3a65bf){_0x4db7e6=_0x4db7e6-0x0;var _0x3e4891=_0xa71c[_0x4db7e6];return _0x3e4891;};'use strict';var Sequelize=require(_0xca71('0x0'));module[_0xca71('0x1')]={'name':{'type':Sequelize[_0xca71('0x2')],'get':function(_0x25f3d3){return this[_0xca71('0x3')](_0xca71('0x4'));}},'action':{'type':Sequelize[_0xca71('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xca71('0x6'),_0xca71('0x7'),_0xca71('0x8'),_0xca71('0x9'),_0xca71('0xa'),_0xca71('0xb'),_0xca71('0xc'),_0xca71('0xd')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xca71('0xe')},'data1':{'type':Sequelize[_0xca71('0x5')](0x1000),'comment':_0xca71('0xf')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xca71('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xca71('0x11')},'data4':{'type':Sequelize[_0xca71('0x5')](0x1000)},'data5':{'type':Sequelize[_0xca71('0x5')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe678=['motionbar','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','contactManager','integration'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xe678,0xcc));var _0x8e67=function(_0x33bd4b,_0x403f89){_0x33bd4b=_0x33bd4b-0x0;var _0x37b2d4=_0xe678[_0x33bd4b];return _0x37b2d4;};'use strict';var Sequelize=require(_0x8e67('0x0'));module[_0x8e67('0x1')]={'name':{'type':Sequelize[_0x8e67('0x2')],'get':function(_0x1b1801){return this[_0x8e67('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8e67('0x4'),_0x8e67('0x5'),_0x8e67('0x6'),'jscripty',_0x8e67('0x7'),_0x8e67('0x8'),'bot','script']],'msg':_0x8e67('0x9')}},'comment':_0x8e67('0x9')},'data1':{'type':Sequelize[_0x8e67('0xa')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x8e67('0xa')](0x1000),'comment':_0x8e67('0xb')},'data3':{'type':Sequelize[_0x8e67('0xa')](0x1000),'comment':_0x8e67('0xc')},'data4':{'type':Sequelize[_0x8e67('0xa')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x8e67('0xa')]},'data7':{'type':Sequelize[_0x8e67('0xd')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 75cb2e2..cc344ad 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 _0xef32=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','stack','name','send','body','find','params','Action','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x58cc40,_0x183602){var _0x19f72b=function(_0x26cc96){while(--_0x26cc96){_0x58cc40['push'](_0x58cc40['shift']());}};_0x19f72b(++_0x183602);}(_0xef32,0x1f0));var _0x2ef3=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xef32[_0x26da89];return _0xc95b7b;};'use strict';var emlformat=require(_0x2ef3('0x0'));var rimraf=require(_0x2ef3('0x1'));var zipdir=require(_0x2ef3('0x2'));var jsonpatch=require(_0x2ef3('0x3'));var rp=require(_0x2ef3('0x4'));var moment=require(_0x2ef3('0x5'));var BPromise=require(_0x2ef3('0x6'));var Mustache=require('mustache');var util=require(_0x2ef3('0x7'));var path=require('path');var sox=require(_0x2ef3('0x8'));var csv=require(_0x2ef3('0x9'));var ejs=require(_0x2ef3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ef3('0xb'));var squel=require(_0x2ef3('0xc'));var crypto=require(_0x2ef3('0xd'));var jsforce=require(_0x2ef3('0xe'));var deskjs=require(_0x2ef3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ef3('0x10'));var Papa=require('papaparse');var Redis=require(_0x2ef3('0x11'));var authService=require(_0x2ef3('0x12'));var qs=require(_0x2ef3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ef3('0x14'));var logger=require(_0x2ef3('0x15'))('api');var utils=require(_0x2ef3('0x16'));var config=require(_0x2ef3('0x17'));var licenseUtil=require(_0x2ef3('0x18'));var db=require(_0x2ef3('0x19'))['db'];function respondWithStatusCode(_0x35f409,_0x16299a){_0x16299a=_0x16299a||0xcc;return function(_0x365ee6){if(_0x365ee6){return _0x35f409[_0x2ef3('0x1a')](_0x16299a);}return _0x35f409[_0x2ef3('0x1b')](_0x16299a)['end']();};}function respondWithResult(_0x2efe53,_0x581c2e){_0x581c2e=_0x581c2e||0xc8;return function(_0x2dea5b){if(_0x2dea5b){return _0x2efe53[_0x2ef3('0x1b')](_0x581c2e)[_0x2ef3('0x1c')](_0x2dea5b);}};}function respondWithFilteredResult(_0xa1b7a5,_0x2c5ff3){return function(_0x26e26c){if(_0x26e26c){var _0x1b6521=typeof _0x2c5ff3[_0x2ef3('0x1d')]===_0x2ef3('0x1e')&&typeof _0x2c5ff3[_0x2ef3('0x1f')]==='undefined';var _0x46d4c6=_0x26e26c['count'];var _0x239998=_0x1b6521?0x0:_0x2c5ff3['offset'];var _0x2b18ae=_0x1b6521?_0x26e26c[_0x2ef3('0x20')]:_0x2c5ff3[_0x2ef3('0x1d')]+_0x2c5ff3[_0x2ef3('0x1f')];var _0x3aa5f3;if(_0x2b18ae>=_0x46d4c6){_0x2b18ae=_0x46d4c6;_0x3aa5f3=0xc8;}else{_0x3aa5f3=0xce;}_0xa1b7a5[_0x2ef3('0x1b')](_0x3aa5f3);return _0xa1b7a5['set']('Content-Range',_0x239998+'-'+_0x2b18ae+'/'+_0x46d4c6)[_0x2ef3('0x1c')](_0x26e26c);}return null;};}function patchUpdates(_0x130d47){return function(_0x44dd11){try{jsonpatch[_0x2ef3('0x21')](_0x44dd11,_0x130d47,!![]);}catch(_0x5aee16){return BPromise[_0x2ef3('0x22')](_0x5aee16);}return _0x44dd11['save']();};}function saveUpdates(_0x4faf72,_0x3c0375){return function(_0x522c20){if(_0x522c20){return _0x522c20[_0x2ef3('0x23')](_0x4faf72)[_0x2ef3('0x24')](function(_0x54770c){return _0x54770c;});}return null;};}function removeEntity(_0x362b9c,_0xaf9b3f){return function(_0x576cc0){if(_0x576cc0){return _0x576cc0[_0x2ef3('0x25')]()[_0x2ef3('0x24')](function(){_0x362b9c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8e99,_0x32c9c0){return function(_0x1e9373){if(!_0x1e9373){_0x2c8e99[_0x2ef3('0x1a')](0x194);}return _0x1e9373;};}function handleError(_0x560ac6,_0x145e02){_0x145e02=_0x145e02||0x1f4;return function(_0x141388){logger['error'](_0x141388[_0x2ef3('0x26')]);if(_0x141388[_0x2ef3('0x27')]){delete _0x141388[_0x2ef3('0x27')];}_0x560ac6[_0x2ef3('0x1b')](_0x145e02)[_0x2ef3('0x28')](_0x141388);};}exports[_0x2ef3('0x23')]=function(_0x42c5a1,_0x271973){if(_0x42c5a1[_0x2ef3('0x29')]['id']){delete _0x42c5a1[_0x2ef3('0x29')]['id'];}return db['Action'][_0x2ef3('0x2a')]({'where':{'id':_0x42c5a1[_0x2ef3('0x2b')]['id']}})['then'](handleEntityNotFound(_0x271973,null))['then'](saveUpdates(_0x42c5a1[_0x2ef3('0x29')],null))[_0x2ef3('0x24')](respondWithResult(_0x271973,null))['catch'](handleError(_0x271973,null));};exports['destroy']=function(_0x29a0a8,_0x1403c2){return db[_0x2ef3('0x2c')][_0x2ef3('0x2a')]({'where':{'id':_0x29a0a8[_0x2ef3('0x2b')]['id']}})[_0x2ef3('0x24')](handleEntityNotFound(_0x1403c2,null))[_0x2ef3('0x24')](removeEntity(_0x1403c2,null))[_0x2ef3('0x2d')](handleError(_0x1403c2,null));};
\ No newline at end of file
+var _0xa0b5=['name','send','body','Action','find','catch','destroy','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','apply','save','update','then','error'];(function(_0xaa4927,_0x1a0cbe){var _0x4cd355=function(_0x4f1901){while(--_0x4f1901){_0xaa4927['push'](_0xaa4927['shift']());}};_0x4cd355(++_0x1a0cbe);}(_0xa0b5,0x8c));var _0x5a0b=function(_0x2a3df1,_0x456866){_0x2a3df1=_0x2a3df1-0x0;var _0xdb3fc3=_0xa0b5[_0x2a3df1];return _0xdb3fc3;};'use strict';var emlformat=require(_0x5a0b('0x0'));var rimraf=require(_0x5a0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a0b('0x2'));var rp=require('request-promise');var moment=require(_0x5a0b('0x3'));var BPromise=require(_0x5a0b('0x4'));var Mustache=require(_0x5a0b('0x5'));var util=require(_0x5a0b('0x6'));var path=require(_0x5a0b('0x7'));var sox=require(_0x5a0b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a0b('0x9'));var _=require('lodash');var squel=require(_0x5a0b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a0b('0xb'));var querystring=require('querystring');var Papa=require(_0x5a0b('0xc'));var Redis=require(_0x5a0b('0xd'));var authService=require(_0x5a0b('0xe'));var qs=require(_0x5a0b('0xf'));var as=require(_0x5a0b('0x10'));var hardwareService=require(_0x5a0b('0x11'));var logger=require(_0x5a0b('0x12'))(_0x5a0b('0x13'));var utils=require(_0x5a0b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5a0b('0x15'));var db=require(_0x5a0b('0x16'))['db'];function respondWithStatusCode(_0x542224,_0x16428b){_0x16428b=_0x16428b||0xcc;return function(_0x80a2f6){if(_0x80a2f6){return _0x542224[_0x5a0b('0x17')](_0x16428b);}return _0x542224[_0x5a0b('0x18')](_0x16428b)[_0x5a0b('0x19')]();};}function respondWithResult(_0x33d59c,_0x4ea694){_0x4ea694=_0x4ea694||0xc8;return function(_0x1cc56b){if(_0x1cc56b){return _0x33d59c['status'](_0x4ea694)['json'](_0x1cc56b);}};}function respondWithFilteredResult(_0x193a1a,_0x463436){return function(_0x16f1ae){if(_0x16f1ae){var _0x3540ca=typeof _0x463436['offset']===_0x5a0b('0x1a')&&typeof _0x463436['limit']===_0x5a0b('0x1a');var _0x5715d1=_0x16f1ae[_0x5a0b('0x1b')];var _0x8c7fe1=_0x3540ca?0x0:_0x463436['offset'];var _0x41c629=_0x3540ca?_0x16f1ae['count']:_0x463436[_0x5a0b('0x1c')]+_0x463436[_0x5a0b('0x1d')];var _0x4a226a;if(_0x41c629>=_0x5715d1){_0x41c629=_0x5715d1;_0x4a226a=0xc8;}else{_0x4a226a=0xce;}_0x193a1a['status'](_0x4a226a);return _0x193a1a[_0x5a0b('0x1e')]('Content-Range',_0x8c7fe1+'-'+_0x41c629+'/'+_0x5715d1)['json'](_0x16f1ae);}return null;};}function patchUpdates(_0x40adc5){return function(_0x12b2f9){try{jsonpatch[_0x5a0b('0x1f')](_0x12b2f9,_0x40adc5,!![]);}catch(_0x465b1e){return BPromise['reject'](_0x465b1e);}return _0x12b2f9[_0x5a0b('0x20')]();};}function saveUpdates(_0x55ce45,_0x45ceb3){return function(_0xe953b1){if(_0xe953b1){return _0xe953b1[_0x5a0b('0x21')](_0x55ce45)[_0x5a0b('0x22')](function(_0x5448a4){return _0x5448a4;});}return null;};}function removeEntity(_0x5a9163,_0x4803d0){return function(_0x386bfd){if(_0x386bfd){return _0x386bfd['destroy']()['then'](function(){_0x5a9163[_0x5a0b('0x18')](0xcc)[_0x5a0b('0x19')]();});}};}function handleEntityNotFound(_0x105ee1,_0x27abd9){return function(_0x29ee17){if(!_0x29ee17){_0x105ee1[_0x5a0b('0x17')](0x194);}return _0x29ee17;};}function handleError(_0x3c19c0,_0x598b7c){_0x598b7c=_0x598b7c||0x1f4;return function(_0x342a4b){logger[_0x5a0b('0x23')](_0x342a4b['stack']);if(_0x342a4b[_0x5a0b('0x24')]){delete _0x342a4b[_0x5a0b('0x24')];}_0x3c19c0[_0x5a0b('0x18')](_0x598b7c)[_0x5a0b('0x25')](_0x342a4b);};}exports[_0x5a0b('0x21')]=function(_0x339f40,_0x514f39){if(_0x339f40[_0x5a0b('0x26')]['id']){delete _0x339f40[_0x5a0b('0x26')]['id'];}return db[_0x5a0b('0x27')][_0x5a0b('0x28')]({'where':{'id':_0x339f40['params']['id']}})[_0x5a0b('0x22')](handleEntityNotFound(_0x514f39,null))[_0x5a0b('0x22')](saveUpdates(_0x339f40['body'],null))['then'](respondWithResult(_0x514f39,null))[_0x5a0b('0x29')](handleError(_0x514f39,null));};exports[_0x5a0b('0x2a')]=function(_0x586852,_0x163e7c){return db[_0x5a0b('0x27')][_0x5a0b('0x28')]({'where':{'id':_0x586852[_0x5a0b('0x2b')]['id']}})[_0x5a0b('0x22')](handleEntityNotFound(_0x163e7c,null))['then'](removeEntity(_0x163e7c,null))['catch'](handleError(_0x163e7c,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 086770f..ce5798a 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 _0xf570=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4f85c5,_0x517e60){var _0x46fc5b=function(_0x23381a){while(--_0x23381a){_0x4f85c5['push'](_0x4f85c5['shift']());}};_0x46fc5b(++_0x517e60);}(_0xf570,0x7a));var _0x0f57=function(_0x258f78,_0x211d1c){_0x258f78=_0x258f78-0x0;var _0x1ffbd2=_0xf570[_0x258f78];return _0x1ffbd2;};'use strict';var _=require(_0x0f57('0x0'));var util=require(_0x0f57('0x1'));var logger=require(_0x0f57('0x2'))(_0x0f57('0x3'));var moment=require(_0x0f57('0x4'));var BPromise=require(_0x0f57('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f57('0x6'));var rimraf=require('rimraf');var config=require(_0x0f57('0x7'));var attributes=require('./action.attributes');module[_0x0f57('0x8')]=function(_0x3c10e4,_0x7ef4f6){return _0x3c10e4[_0x0f57('0x9')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac10=['request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9f0ec7,_0x73d12e){var _0x4b4ddd=function(_0x486295){while(--_0x486295){_0x9f0ec7['push'](_0x9f0ec7['shift']());}};_0x4b4ddd(++_0x73d12e);}(_0xac10,0x81));var _0x0ac1=function(_0x749c48,_0x336468){_0x749c48=_0x749c48-0x0;var _0x2f419c=_0xac10[_0x749c48];return _0x2f419c;};'use strict';var _=require(_0x0ac1('0x0'));var util=require(_0x0ac1('0x1'));var logger=require(_0x0ac1('0x2'))(_0x0ac1('0x3'));var moment=require(_0x0ac1('0x4'));var BPromise=require(_0x0ac1('0x5'));var rp=require(_0x0ac1('0x6'));var fs=require('fs');var path=require(_0x0ac1('0x7'));var rimraf=require(_0x0ac1('0x8'));var config=require(_0x0ac1('0x9'));var attributes=require(_0x0ac1('0xa'));module[_0x0ac1('0xb')]=function(_0x4e8a66,_0x290a39){return _0x4e8a66[_0x0ac1('0xc')](_0x0ac1('0xd'),attributes,{'tableName':_0x0ac1('0xe'),'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 b04eb33..92ca089 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x53ec,0x192));var _0xc53e=function(_0x5585ca,_0x4c6c65){_0x5585ca=_0x5585ca-0x0;var _0x415be9=_0x53ec[_0x5585ca];return _0x415be9;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x52a495,_0x3a405b){_0x52a495=_0x52a495-0x0;var _0x8affe1=_0x7a54[_0x52a495];return _0x8affe1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 125269b..a17371a 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 _0x9501=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','delete','/:id','isAuthenticated','destroy','exports','util'];(function(_0x3546e2,_0x1c8f96){var _0x59813e=function(_0x48c907){while(--_0x48c907){_0x3546e2['push'](_0x3546e2['shift']());}};_0x59813e(++_0x1c8f96);}(_0x9501,0x11f));var _0x1950=function(_0x57343e,_0x520bd2){_0x57343e=_0x57343e-0x0;var _0x265cbc=_0x9501[_0x57343e];return _0x265cbc;};'use strict';var multer=require('multer');var util=require(_0x1950('0x0'));var path=require(_0x1950('0x1'));var timeout=require(_0x1950('0x2'));var express=require(_0x1950('0x3'));var router=express[_0x1950('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1950('0x5'));var interaction=require(_0x1950('0x6'));var config=require(_0x1950('0x7'));var controller=require(_0x1950('0x8'));router[_0x1950('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1950('0xa')]);router[_0x1950('0xb')](_0x1950('0xc'),auth[_0x1950('0xd')](),controller[_0x1950('0xe')]);module[_0x1950('0xf')]=router;
\ No newline at end of file
+var _0xc481=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc481,0x10a));var _0x1c48=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0xc481[_0x35f83e];return _0x249b05;};'use strict';var multer=require('multer');var util=require(_0x1c48('0x0'));var path=require(_0x1c48('0x1'));var timeout=require(_0x1c48('0x2'));var express=require(_0x1c48('0x3'));var router=express[_0x1c48('0x4')]();var fs_extra=require(_0x1c48('0x5'));var auth=require(_0x1c48('0x6'));var interaction=require(_0x1c48('0x7'));var config=require(_0x1c48('0x8'));var controller=require(_0x1c48('0x9'));router['put'](_0x1c48('0xa'),auth[_0x1c48('0xb')](),controller['update']);router[_0x1c48('0xc')](_0x1c48('0xa'),auth[_0x1c48('0xb')](),controller[_0x1c48('0xd')]);module[_0x1c48('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 40b619d..23b238c 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0xafc4,0x69));var _0x4afc=function(_0x4e12fa,_0x3b3bc9){_0x4e12fa=_0x4e12fa-0x0;var _0x812359=_0xafc4[_0x4e12fa];return _0x812359;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x2a678c,_0x2a05e3){var _0x19590c=function(_0x154fb9){while(--_0x154fb9){_0x2a678c['push'](_0x2a678c['shift']());}};_0x19590c(++_0x2a05e3);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x30c0f1,_0x566eba){_0x30c0f1=_0x30c0f1-0x0;var _0x127df4=_0x3eea[_0x30c0f1];return _0x127df4;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f78f180..3723f08 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 _0x3b1b=['../../mysqldb','dbH','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','name','map','AnalyticCustomReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','AnalyticMetric','DESC','%s.%s\x20=\x20%s.%s','output','fullPath','randomstring','generate','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','sequelize','run','left_join','COUNT(%s)','keyBy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5be347,_0x47e999){var _0x129a2b=function(_0x457cbd){while(--_0x457cbd){_0x5be347['push'](_0x5be347['shift']());}};_0x129a2b(++_0x47e999);}(_0x3b1b,0x8a));var _0xb3b1=function(_0x35cdc6,_0x4608f9){_0x35cdc6=_0x35cdc6-0x0;var _0x8f454b=_0x3b1b[_0x35cdc6];return _0x8f454b;};'use strict';var emlformat=require(_0xb3b1('0x0'));var rimraf=require(_0xb3b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3b1('0x2'));var rp=require(_0xb3b1('0x3'));var moment=require('moment');var BPromise=require(_0xb3b1('0x4'));var Mustache=require(_0xb3b1('0x5'));var util=require('util');var path=require(_0xb3b1('0x6'));var sox=require(_0xb3b1('0x7'));var csv=require('to-csv');var ejs=require(_0xb3b1('0x8'));var fs=require('fs');var fs_extra=require(_0xb3b1('0x9'));var _=require('lodash');var squel=require(_0xb3b1('0xa'));var crypto=require(_0xb3b1('0xb'));var jsforce=require(_0xb3b1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb3b1('0xd'));var querystring=require(_0xb3b1('0xe'));var Papa=require(_0xb3b1('0xf'));var Redis=require(_0xb3b1('0x10'));var authService=require(_0xb3b1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb3b1('0x12'));var hardwareService=require(_0xb3b1('0x13'));var logger=require(_0xb3b1('0x14'))(_0xb3b1('0x15'));var utils=require(_0xb3b1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb3b1('0x17'))['db'];var dbH=require('../../mysqldb')[_0xb3b1('0x18')];function respondWithStatusCode(_0x3aa81a,_0x2dc0ff){_0x2dc0ff=_0x2dc0ff||0xcc;return function(_0x41ffef){if(_0x41ffef){return _0x3aa81a['sendStatus'](_0x2dc0ff);}return _0x3aa81a['status'](_0x2dc0ff)[_0xb3b1('0x19')]();};}function respondWithResult(_0x3a1b44,_0x56c8d6){_0x56c8d6=_0x56c8d6||0xc8;return function(_0x57759b){if(_0x57759b){return _0x3a1b44[_0xb3b1('0x1a')](_0x56c8d6)['json'](_0x57759b);}};}function respondWithFilteredResult(_0x37bd34,_0x5b321a){return function(_0x375d47){if(_0x375d47){var _0xfba4c9=typeof _0x5b321a[_0xb3b1('0x1b')]===_0xb3b1('0x1c')&&typeof _0x5b321a[_0xb3b1('0x1d')]===_0xb3b1('0x1c');var _0x1204c5=_0x375d47[_0xb3b1('0x1e')];var _0x52132f=_0xfba4c9?0x0:_0x5b321a[_0xb3b1('0x1b')];var _0x10f174=_0xfba4c9?_0x375d47[_0xb3b1('0x1e')]:_0x5b321a[_0xb3b1('0x1b')]+_0x5b321a[_0xb3b1('0x1d')];var _0x32b8b0;if(_0x10f174>=_0x1204c5){_0x10f174=_0x1204c5;_0x32b8b0=0xc8;}else{_0x32b8b0=0xce;}_0x37bd34[_0xb3b1('0x1a')](_0x32b8b0);return _0x37bd34[_0xb3b1('0x1f')](_0xb3b1('0x20'),_0x52132f+'-'+_0x10f174+'/'+_0x1204c5)['json'](_0x375d47);}return null;};}function patchUpdates(_0x4f27cf){return function(_0x4637ef){try{jsonpatch[_0xb3b1('0x21')](_0x4637ef,_0x4f27cf,!![]);}catch(_0x2696e6){return BPromise[_0xb3b1('0x22')](_0x2696e6);}return _0x4637ef[_0xb3b1('0x23')]();};}function saveUpdates(_0x4b50ed,_0x172c7c){return function(_0xc4b91a){if(_0xc4b91a){return _0xc4b91a['update'](_0x4b50ed)[_0xb3b1('0x24')](function(_0x10dd1f){return _0x10dd1f;});}return null;};}function removeEntity(_0xcdc054,_0x2a7b3a){return function(_0x51c228){if(_0x51c228){return _0x51c228[_0xb3b1('0x25')]()[_0xb3b1('0x24')](function(){var _0x3d3a0c=_0x51c228[_0xb3b1('0x26')]({'plain':!![]});var _0x56b936=_0xb3b1('0x27');return db[_0xb3b1('0x28')][_0xb3b1('0x25')]({'where':{'type':_0x56b936,'resourceId':_0x3d3a0c['id']}})[_0xb3b1('0x24')](function(){return _0x51c228;});})['then'](function(){_0xcdc054['status'](0xcc)[_0xb3b1('0x19')]();});}};}function handleEntityNotFound(_0xa42709,_0xa041ad){return function(_0x2a0220){if(!_0x2a0220){_0xa42709[_0xb3b1('0x29')](0x194);}return _0x2a0220;};}function handleError(_0x3e4268,_0x4470ee){_0x4470ee=_0x4470ee||0x1f4;return function(_0xc1a229){logger[_0xb3b1('0x2a')](_0xc1a229['stack']);if(_0xc1a229[_0xb3b1('0x2b')]){delete _0xc1a229['name'];}_0x3e4268[_0xb3b1('0x1a')](_0x4470ee)['send'](_0xc1a229);};}exports['index']=function(_0x5a2b66,_0x1d9977){var _0x331c1e={},_0x550040={},_0x49e558={'count':0x0,'rows':[]};var _0x9a97f7=_[_0xb3b1('0x2c')](db[_0xb3b1('0x2d')]['rawAttributes'],function(_0x3f4149){return{'name':_0x3f4149[_0xb3b1('0x2e')],'type':_0x3f4149['type'][_0xb3b1('0x2f')]};});_0x550040['model']=_[_0xb3b1('0x2c')](_0x9a97f7,_0xb3b1('0x2b'));_0x550040[_0xb3b1('0x30')]=_['keys'](_0x5a2b66[_0xb3b1('0x30')]);_0x550040[_0xb3b1('0x31')]=_[_0xb3b1('0x32')](_0x550040[_0xb3b1('0x33')],_0x550040[_0xb3b1('0x30')]);_0x331c1e[_0xb3b1('0x34')]=_[_0xb3b1('0x32')](_0x550040['model'],qs[_0xb3b1('0x35')](_0x5a2b66['query'][_0xb3b1('0x35')]));_0x331c1e[_0xb3b1('0x34')]=_0x331c1e[_0xb3b1('0x34')][_0xb3b1('0x36')]?_0x331c1e[_0xb3b1('0x34')]:_0x550040[_0xb3b1('0x33')];if(!_0x5a2b66['query'][_0xb3b1('0x37')](_0xb3b1('0x38'))){_0x331c1e[_0xb3b1('0x1d')]=qs[_0xb3b1('0x1d')](_0x5a2b66[_0xb3b1('0x30')]['limit']);_0x331c1e[_0xb3b1('0x1b')]=qs[_0xb3b1('0x1b')](_0x5a2b66['query'][_0xb3b1('0x1b')]);}_0x331c1e[_0xb3b1('0x39')]=qs['sort'](_0x5a2b66[_0xb3b1('0x30')]['sort']);_0x331c1e[_0xb3b1('0x3a')]=qs[_0xb3b1('0x31')](_['pick'](_0x5a2b66[_0xb3b1('0x30')],_0x550040[_0xb3b1('0x31')]),_0x9a97f7);if(_0x5a2b66['query'][_0xb3b1('0x3b')]){_0x331c1e[_0xb3b1('0x3a')]=_['merge'](_0x331c1e[_0xb3b1('0x3a')],{'$or':_[_0xb3b1('0x2c')](_0x9a97f7,function(_0x185634){if(_0x185634[_0xb3b1('0x3c')]!==_0xb3b1('0x3d')){var _0x141436={};_0x141436[_0x185634[_0xb3b1('0x2b')]]={'$like':'%'+_0x5a2b66[_0xb3b1('0x30')]['filter']+'%'};return _0x141436;}})});}_0x331c1e=_[_0xb3b1('0x3e')]({},_0x331c1e,_0x5a2b66[_0xb3b1('0x3f')]);var _0xe7948f={'where':_0x331c1e[_0xb3b1('0x3a')]};return db[_0xb3b1('0x2d')][_0xb3b1('0x1e')](_0xe7948f)[_0xb3b1('0x24')](function(_0x1f32a2){_0x49e558[_0xb3b1('0x1e')]=_0x1f32a2;if(_0x5a2b66[_0xb3b1('0x30')][_0xb3b1('0x40')]){_0x331c1e[_0xb3b1('0x41')]=[{'all':!![]}];}return db[_0xb3b1('0x2d')]['findAll'](_0x331c1e);})[_0xb3b1('0x24')](function(_0x54d198){_0x49e558['rows']=_0x54d198;return _0x49e558;})[_0xb3b1('0x24')](respondWithFilteredResult(_0x1d9977,_0x331c1e))[_0xb3b1('0x42')](handleError(_0x1d9977,null));};exports[_0xb3b1('0x43')]=function(_0x38726e,_0x165f63){var _0x29c3fb={'raw':![],'where':{'id':_0x38726e[_0xb3b1('0x44')]['id']}},_0x5d68ca={};_0x5d68ca['model']=_[_0xb3b1('0x45')](db[_0xb3b1('0x2d')][_0xb3b1('0x46')]);_0x5d68ca[_0xb3b1('0x30')]=_[_0xb3b1('0x45')](_0x38726e[_0xb3b1('0x30')]);_0x5d68ca[_0xb3b1('0x31')]=_[_0xb3b1('0x32')](_0x5d68ca['model'],_0x5d68ca['query']);_0x29c3fb[_0xb3b1('0x34')]=_[_0xb3b1('0x32')](_0x5d68ca['model'],qs[_0xb3b1('0x35')](_0x38726e[_0xb3b1('0x30')][_0xb3b1('0x35')]));_0x29c3fb[_0xb3b1('0x34')]=_0x29c3fb['attributes'][_0xb3b1('0x36')]?_0x29c3fb['attributes']:_0x5d68ca[_0xb3b1('0x33')];if(_0x38726e[_0xb3b1('0x30')]['includeAll']){_0x29c3fb[_0xb3b1('0x41')]=[{'all':!![]}];}_0x29c3fb=_['merge']({},_0x29c3fb,_0x38726e[_0xb3b1('0x3f')]);return db['AnalyticCustomReport'][_0xb3b1('0x47')](_0x29c3fb)[_0xb3b1('0x24')](handleEntityNotFound(_0x165f63,null))['then'](respondWithResult(_0x165f63,null))[_0xb3b1('0x42')](handleError(_0x165f63,null));};exports[_0xb3b1('0x48')]=function(_0x4bc6d6,_0x3e71c0){return db['AnalyticCustomReport'][_0xb3b1('0x48')](_0x4bc6d6['body'],{})[_0xb3b1('0x24')](function(_0x26aba6){var _0x5ebb83=_0x4bc6d6['user'][_0xb3b1('0x26')]({'plain':!![]});if(!_0x5ebb83)throw new Error(_0xb3b1('0x49'));if(_0x5ebb83['role']===_0xb3b1('0x4a')){var _0xc65c0c=_0x26aba6['get']({'plain':!![]});var _0x16141c='Reports';return db[_0xb3b1('0x4b')][_0xb3b1('0x47')]({'where':{'name':_0x16141c,'userProfileId':_0x5ebb83[_0xb3b1('0x4c')]},'raw':!![]})[_0xb3b1('0x24')](function(_0x3e430c){if(_0x3e430c&&_0x3e430c[_0xb3b1('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0xc65c0c[_0xb3b1('0x2b')],'resourceId':_0xc65c0c['id'],'type':_0xb3b1('0x27'),'sectionId':_0x3e430c['id']},{})[_0xb3b1('0x24')](function(){return _0x26aba6;});}else{return _0x26aba6;}})[_0xb3b1('0x42')](function(_0x60025e){logger[_0xb3b1('0x2a')](_0xb3b1('0x4e'),_0x60025e);throw _0x60025e;});}return _0x26aba6;})[_0xb3b1('0x24')](respondWithResult(_0x3e71c0,0xc9))[_0xb3b1('0x42')](handleError(_0x3e71c0,null));};exports[_0xb3b1('0x4f')]=function(_0x3a137c,_0xf01766){if(_0x3a137c[_0xb3b1('0x50')]['id']){delete _0x3a137c[_0xb3b1('0x50')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3a137c[_0xb3b1('0x44')]['id']}})[_0xb3b1('0x24')](handleEntityNotFound(_0xf01766,null))['then'](saveUpdates(_0x3a137c[_0xb3b1('0x50')],null))[_0xb3b1('0x24')](respondWithResult(_0xf01766,null))[_0xb3b1('0x42')](handleError(_0xf01766,null));};exports[_0xb3b1('0x25')]=function(_0x3e0b13,_0xe8aaf8){return db[_0xb3b1('0x2d')]['find']({'where':{'id':_0x3e0b13['params']['id']}})['then'](handleEntityNotFound(_0xe8aaf8,null))['then'](removeEntity(_0xe8aaf8,null))['catch'](handleError(_0xe8aaf8,null));};exports[_0xb3b1('0x51')]=function(_0x47dd33,_0x590566){var _0xe9c51c=0xa;var _0x1a8f11=[_0xb3b1('0x52'),'left_join',_0xb3b1('0x53'),_0xb3b1('0x54')];var _0x25914d={'SUM':_0xb3b1('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb3b1('0x56'),'MAX':_0xb3b1('0x57'),'MIN':_0xb3b1('0x58'),'AVG':_0xb3b1('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb3b1('0x5a'),'GROUP_CONCAT DESC':_0xb3b1('0x5b')};var _0xbd4747={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb3b1('0x5c'),'HOUR':_0xb3b1('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x20266c=function(_0x4e4ddf){return!_[_0xb3b1('0x5e')]([_0xb3b1('0x5f'),_0xb3b1('0x60'),_0xb3b1('0x61'),_0xb3b1('0x62')],_0x4e4ddf);};var _0x3be934=function(_0x5e3df5){if(!_0x5e3df5||!_0x5e3df5[_0xb3b1('0x63')][_0xb3b1('0x36')]){return'';}for(var _0x33cf0a='(',_0x8a4e0b=0x0;_0x8a4e0b<_0x5e3df5[_0xb3b1('0x63')][_0xb3b1('0x36')];_0x8a4e0b+=0x1){_0x8a4e0b>0x0&&(_0x33cf0a+='\x20'+_0x5e3df5[_0xb3b1('0x64')]+'\x20');_0x33cf0a+=_0x5e3df5['rules'][_0x8a4e0b][_0xb3b1('0x65')]?_0x3be934(_0x5e3df5[_0xb3b1('0x63')][_0x8a4e0b][_0xb3b1('0x65')]):_0x5e3df5[_0xb3b1('0x63')][_0x8a4e0b][_0xb3b1('0x66')]+'\x20'+_0x5e3df5[_0xb3b1('0x63')][_0x8a4e0b][_0xb3b1('0x67')]+(_0x20266c(_0x5e3df5[_0xb3b1('0x63')][_0x8a4e0b][_0xb3b1('0x67')])?'\x20'+_0x5e3df5[_0xb3b1('0x63')][_0x8a4e0b][_0xb3b1('0x68')]:'');}return _0x33cf0a+')';};var _0x3e012e={'where':{'id':_0x47dd33[_0xb3b1('0x44')]['id']}},_0x28a05f,_0x4088ad,_0x151a6f,_0x1b1e0d,_0x2115f4;_0x3e012e=_[_0xb3b1('0x3e')]({},_0x3e012e,_0x47dd33[_0xb3b1('0x3f')]);return db[_0xb3b1('0x2d')][_0xb3b1('0x47')](_0x3e012e)[_0xb3b1('0x24')](function(_0x26df05){if(_0x26df05){_0x28a05f=_0x26df05;return _0x26df05[_0xb3b1('0x69')]();}return null;})[_0xb3b1('0x24')](function(_0x4ead39){if(_0x4ead39){if(!_0x4ead39[_0xb3b1('0x36')]){throw new db[(_0xb3b1('0x6a'))][(_0xb3b1('0x6b'))](_0xb3b1('0x6c'),0x193);}_0x4088ad=_0x4ead39;return db['AnalyticMetric'][_0xb3b1('0x6d')]({'raw':!![]});}return null;})[_0xb3b1('0x24')](function(_0x13a935){if(_0x13a935){_0x151a6f=_['keyBy'](_0x13a935,'id');var _0x26c296;var _0x40fb5e=squel[_0xb3b1('0x6e')]();_0x40fb5e[_0xb3b1('0x6f')](_0x28a05f[_0xb3b1('0x70')]);for(var _0xd9acd8=0x0;_0xd9acd8<_0x4088ad[_0xb3b1('0x36')];_0xd9acd8+=0x1){_0x26c296=_0x4088ad[_0xd9acd8][_0xb3b1('0x71')]?_0x151a6f[_0x4088ad[_0xd9acd8][_0xb3b1('0x71')]][_0xb3b1('0x72')]:_0x4088ad[_0xd9acd8][_0xb3b1('0x66')];_0x26c296=_0x4088ad[_0xd9acd8][_0xb3b1('0x73')]?_[_0xb3b1('0x74')](_0x25914d[_0x4088ad[_0xd9acd8][_0xb3b1('0x73')]],'%s',_0x26c296):_0x26c296;_0x26c296=_0x4088ad[_0xd9acd8][_0xb3b1('0x75')]?_[_0xb3b1('0x74')](_0xbd4747[_0x4088ad[_0xd9acd8]['format']],'%s',_0x26c296):_0x26c296;if(_0x4088ad[_0xd9acd8][_0xb3b1('0x76')]){_0x40fb5e[_0xb3b1('0x65')](_0x26c296);}_0x4088ad[_0xd9acd8][_0xb3b1('0x77')]&&_0x40fb5e[_0xb3b1('0x39')](_0x26c296,_0x4088ad[_0xd9acd8][_0xb3b1('0x77')]==='DESC'?![]:!![]);_0x40fb5e[_0xb3b1('0x66')](_0x26c296,_0x4088ad[_0xd9acd8][_0xb3b1('0x78')]||_0x26c296);}if(_0x28a05f[_0xb3b1('0x79')]){_0x28a05f[_0xb3b1('0x79')]=JSON[_0xb3b1('0x7a')](_0x28a05f['joins']);for(var _0x4f7dc8=0x0;_0x4f7dc8<_0x28a05f[_0xb3b1('0x79')][_0xb3b1('0x36')];_0x4f7dc8+=0x1){if(_0x28a05f['joins'][_0x4f7dc8][_0xb3b1('0x3c')]&&_['includes'](_0x1a8f11,_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8][_0xb3b1('0x3c')])&&_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8][_0xb3b1('0x7b')]&&_0x28a05f['joins'][_0x4f7dc8][_0xb3b1('0x7c')]&&_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8][_0xb3b1('0x7d')]){_0x40fb5e[_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8]['type']](_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8]['foreignTable'],null,util[_0xb3b1('0x75')]('%s.%s\x20=\x20%s.%s',_0x28a05f[_0xb3b1('0x70')],_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8][_0xb3b1('0x7b')],_0x28a05f[_0xb3b1('0x79')][_0x4f7dc8][_0xb3b1('0x7c')],_0x28a05f['joins'][_0x4f7dc8][_0xb3b1('0x7d')]));}}}if(_0x28a05f[_0xb3b1('0x7e')]){_0x28a05f[_0xb3b1('0x7e')]=JSON['parse'](_0x28a05f[_0xb3b1('0x7e')]);_0x40fb5e[_0xb3b1('0x3a')](_0x3be934(_0x28a05f[_0xb3b1('0x7e')]['group']));}_0x2115f4=_0x40fb5e[_0xb3b1('0x7f')]();_0x40fb5e[_0xb3b1('0x1d')](_0xe9c51c);_0x40fb5e[_0xb3b1('0x1b')](0x0);logger[_0xb3b1('0x80')](_0xb3b1('0x81'),_0x40fb5e[_0xb3b1('0x82')]());return dbH['sequelize'][_0xb3b1('0x30')](_0x40fb5e[_0xb3b1('0x82')](),{'type':dbH['sequelize'][_0xb3b1('0x83')][_0xb3b1('0x84')]});}})['then'](respondWithResult(_0x590566,null))[_0xb3b1('0x42')](handleError(_0x590566,null));};function runReport(_0x13b02f,_0x54bb72,_0x307538){var _0xf11259=_0x54bb72[_0xb3b1('0x2b')];var _0x13bfbb=0xa;var _0x17b092=[_0xb3b1('0x52'),'left_join',_0xb3b1('0x53'),_0xb3b1('0x54')];var _0x41de35={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb3b1('0x57'),'MIN':_0xb3b1('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb3b1('0x85'),'GROUP_CONCAT ASC':_0xb3b1('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2605d4={'SEC_TO_TIME':_0xb3b1('0x86'),'DATE':_0xb3b1('0x5c'),'HOUR':_0xb3b1('0x5d'),'ROUND':_0xb3b1('0x87'),'UNIX_TIMESTAMP':_0xb3b1('0x88')};var _0x588a39=function(_0x33ec34){return!_[_0xb3b1('0x5e')]([_0xb3b1('0x5f'),'IS\x20NOT\x20NULL',_0xb3b1('0x61'),_0xb3b1('0x62')],_0x33ec34);};var _0x468216=function(_0x267b8b){if(!_0x267b8b||!_0x267b8b['rules'][_0xb3b1('0x36')]){return'';}for(var _0x25f5f3='(',_0x561e7e=0x0;_0x561e7e<_0x267b8b['rules'][_0xb3b1('0x36')];_0x561e7e+=0x1){_0x561e7e>0x0&&(_0x25f5f3+='\x20'+_0x267b8b[_0xb3b1('0x64')]+'\x20');_0x25f5f3+=_0x267b8b['rules'][_0x561e7e][_0xb3b1('0x65')]?_0x468216(_0x267b8b['rules'][_0x561e7e][_0xb3b1('0x65')]):_0x267b8b[_0xb3b1('0x63')][_0x561e7e]['field']+'\x20'+_0x267b8b[_0xb3b1('0x63')][_0x561e7e][_0xb3b1('0x67')]+(_0x588a39(_0x267b8b[_0xb3b1('0x63')][_0x561e7e][_0xb3b1('0x67')])?'\x20'+_0x267b8b[_0xb3b1('0x63')][_0x561e7e][_0xb3b1('0x68')]:'');}return _0x25f5f3+')';};var _0x44ca5e={'where':{'id':_0x13b02f['id']}},_0x9c0ac6,_0x4e6951,_0x2895fb,_0xe4e846,_0xf34f11;_0x44ca5e=_['merge']({},_0x44ca5e,_0x307538);return db[_0xb3b1('0x2d')][_0xb3b1('0x47')](_0x44ca5e)['then'](function(_0x1f4dc4){if(_0x1f4dc4){_0x9c0ac6=_0x1f4dc4;return _0x1f4dc4[_0xb3b1('0x69')]();}return null;})[_0xb3b1('0x24')](function(_0x16975b){if(_0x16975b){if(!_0x16975b[_0xb3b1('0x36')]){throw new db[(_0xb3b1('0x6a'))]['ValidationErrorItem'](_0xb3b1('0x6c'),0x193);}_0x4e6951=_0x16975b;return db[_0xb3b1('0x89')]['findAll']({'raw':!![]});}return null;})[_0xb3b1('0x24')](function(_0xf9f6f9){if(_0xf9f6f9){_0x2895fb=_['keyBy'](_0xf9f6f9,'id');var _0x275b3c;var _0x5cdaef=squel['select']();_0x5cdaef['from'](_0x9c0ac6[_0xb3b1('0x70')]);for(var _0x436498=0x0;_0x436498<_0x4e6951[_0xb3b1('0x36')];_0x436498+=0x1){_0x275b3c=_0x4e6951[_0x436498][_0xb3b1('0x71')]?_0x2895fb[_0x4e6951[_0x436498][_0xb3b1('0x71')]][_0xb3b1('0x72')]:_0x4e6951[_0x436498][_0xb3b1('0x66')];_0x275b3c=_0x4e6951[_0x436498]['function']?_[_0xb3b1('0x74')](_0x41de35[_0x4e6951[_0x436498][_0xb3b1('0x73')]],'%s',_0x275b3c):_0x275b3c;_0x275b3c=_0x4e6951[_0x436498][_0xb3b1('0x75')]?_[_0xb3b1('0x74')](_0x2605d4[_0x4e6951[_0x436498][_0xb3b1('0x75')]],'%s',_0x275b3c):_0x275b3c;if(_0x4e6951[_0x436498]['groupBy']){_0x5cdaef[_0xb3b1('0x65')](_0x275b3c);}_0x4e6951[_0x436498]['orderBy']&&_0x5cdaef['order'](_0x275b3c,_0x4e6951[_0x436498][_0xb3b1('0x77')]===_0xb3b1('0x8a')?![]:!![]);_0x5cdaef[_0xb3b1('0x66')](_0x275b3c,_0x4e6951[_0x436498][_0xb3b1('0x78')]||_0x275b3c);}if(_0x9c0ac6[_0xb3b1('0x79')]){_0x9c0ac6['joins']=JSON[_0xb3b1('0x7a')](_0x9c0ac6[_0xb3b1('0x79')]);for(var _0x4b037d=0x0;_0x4b037d<_0x9c0ac6['joins'][_0xb3b1('0x36')];_0x4b037d+=0x1){if(_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d]['type']&&_[_0xb3b1('0x5e')](_0x17b092,_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d][_0xb3b1('0x3c')])&&_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d][_0xb3b1('0x7b')]&&_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d]['foreignTable']&&_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d][_0xb3b1('0x7d')]){_0x5cdaef[_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d][_0xb3b1('0x3c')]](_0x9c0ac6[_0xb3b1('0x79')][_0x4b037d][_0xb3b1('0x7c')],null,util['format'](_0xb3b1('0x8b'),_0x9c0ac6[_0xb3b1('0x70')],_0x9c0ac6['joins'][_0x4b037d][_0xb3b1('0x7b')],_0x9c0ac6['joins'][_0x4b037d]['foreignTable'],_0x9c0ac6['joins'][_0x4b037d][_0xb3b1('0x7d')]));}}}if(_0x9c0ac6[_0xb3b1('0x7e')]){_0x9c0ac6[_0xb3b1('0x7e')]=JSON['parse'](_0x9c0ac6[_0xb3b1('0x7e')]);_0x5cdaef[_0xb3b1('0x3a')](_0x468216(_0x9c0ac6['conditions'][_0xb3b1('0x65')]));}_0xf34f11=_0x5cdaef['clone']();_0x5cdaef[_0xb3b1('0x1d')](_0x13bfbb);_0x5cdaef[_0xb3b1('0x1b')](0x0);return;}})['then'](function(){if(_0x54bb72[_0xb3b1('0x8c')]==='web'){return null;}var _0x4f033b=_[_0xb3b1('0x3e')](_0x54bb72,{'name':_0x54bb72[_0xb3b1('0x8d')]||_0x54bb72[_0xb3b1('0x2b')]||_0x9c0ac6[_0xb3b1('0x2b')],'basename':_0xf11259,'savename':util[_0xb3b1('0x75')]('%s-%s.%s',_0x54bb72[_0xb3b1('0x2b')]||_0x9c0ac6['name'],require(_0xb3b1('0x8e'))[_0xb3b1('0x8f')](0x4),_0x54bb72['output']||'csv'),'reportId':_0x9c0ac6['id'],'reportType':'custom'});return db[_0xb3b1('0x90')][_0xb3b1('0x48')](_0x4f033b,{'raw':!![]});})[_0xb3b1('0x24')](function(_0x9cb6c7){if(_0x9c0ac6[_0xb3b1('0x70')]===_0xb3b1('0x91')){_0xf34f11[_0xb3b1('0x3a')](_0x9c0ac6['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x54bb72[_0xb3b1('0x92')],_0x54bb72[_0xb3b1('0x93')]);}else{_0xf34f11[_0xb3b1('0x3a')](_0x9c0ac6[_0xb3b1('0x70')]+_0xb3b1('0x94'),_0x54bb72[_0xb3b1('0x92')],_0x54bb72[_0xb3b1('0x93')]);}if(_0x9cb6c7){logger[_0xb3b1('0x95')](_0xb3b1('0x96'),_0xf34f11[_0xb3b1('0x82')]());require(_0xb3b1('0x97'))[_0xb3b1('0x98')](path[_0xb3b1('0x52')](__dirname,'../../components/export/',_0x9cb6c7[_0xb3b1('0x8c')]),[_0x9cb6c7['id'],_0xf34f11[_0xb3b1('0x82')](),path['join'](__dirname,_0xb3b1('0x99'),_0x9cb6c7['savename']),_0xf11259]);return _0x9cb6c7;}else{var _0x498571=squel[_0xb3b1('0x6e')]();_0x498571[_0xb3b1('0x6f')]('('+_0xf34f11[_0xb3b1('0x82')]()+')',_0xb3b1('0x9a'));_0x498571[_0xb3b1('0x66')](_0xb3b1('0x9b'),_0xb3b1('0x1e'));_0xf34f11['limit'](_0x54bb72[_0xb3b1('0x1d')]||_0x13bfbb);_0xf34f11[_0xb3b1('0x1b')](_0x54bb72[_0xb3b1('0x1b')]||0x0);return dbH[_0xb3b1('0x9c')][_0xb3b1('0x30')](_0x498571[_0xb3b1('0x82')](),{'type':dbH[_0xb3b1('0x9c')][_0xb3b1('0x83')]['SELECT']})['then'](function(_0x335b55){if(!_0x335b55[_0xb3b1('0x36')]){_0xe4e846=0x0;}else{_0xe4e846=_0x335b55[0x0]['count']||0x0;}return dbH[_0xb3b1('0x9c')][_0xb3b1('0x30')](_0xf34f11['toString'](),{'type':dbH['sequelize'][_0xb3b1('0x83')][_0xb3b1('0x84')]});})[_0xb3b1('0x24')](function(_0x22b9aa){return{'rows':_0x22b9aa||[],'count':_0xe4e846};});}});}exports[_0xb3b1('0x9d')]=function(_0x43f7cb,_0x4144c5){return runReport(_0x43f7cb[_0xb3b1('0x44')],_0x43f7cb['query'],_0x43f7cb[_0xb3b1('0x3f')])[_0xb3b1('0x24')](respondWithResult(_0x4144c5,null))['catch'](handleError(_0x4144c5,null));};exports['runReport']=runReport;exports[_0xb3b1('0x30')]=function(_0x2ea4cc,_0x7ada44){var _0xd69be2=0xa;var _0x42201a=[_0xb3b1('0x52'),_0xb3b1('0x9e'),_0xb3b1('0x53'),_0xb3b1('0x54')];var _0x5c21da={'SUM':'SUM(%s)','COUNT':_0xb3b1('0x9f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb3b1('0x57'),'MIN':_0xb3b1('0x58'),'AVG':_0xb3b1('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb3b1('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x268bce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb3b1('0x5c'),'HOUR':_0xb3b1('0x5d'),'ROUND':_0xb3b1('0x87'),'UNIX_TIMESTAMP':_0xb3b1('0x88')};var _0x1c73ad=function(_0x542001){return!_[_0xb3b1('0x5e')](['IS\x20NULL',_0xb3b1('0x60'),_0xb3b1('0x61'),_0xb3b1('0x62')],_0x542001);};var _0xbad284=function(_0x2bd4bb){if(!_0x2bd4bb||!_0x2bd4bb[_0xb3b1('0x63')][_0xb3b1('0x36')]){return'';}for(var _0x5b13cd='(',_0x89bc6d=0x0;_0x89bc6d<_0x2bd4bb['rules'][_0xb3b1('0x36')];_0x89bc6d+=0x1){_0x89bc6d>0x0&&(_0x5b13cd+='\x20'+_0x2bd4bb[_0xb3b1('0x64')]+'\x20');_0x5b13cd+=_0x2bd4bb[_0xb3b1('0x63')][_0x89bc6d][_0xb3b1('0x65')]?_0xbad284(_0x2bd4bb[_0xb3b1('0x63')][_0x89bc6d]['group']):_0x2bd4bb[_0xb3b1('0x63')][_0x89bc6d][_0xb3b1('0x66')]+'\x20'+_0x2bd4bb[_0xb3b1('0x63')][_0x89bc6d]['condition']+(_0x1c73ad(_0x2bd4bb[_0xb3b1('0x63')][_0x89bc6d]['condition'])?'\x20'+_0x2bd4bb['rules'][_0x89bc6d]['value']:'');}return _0x5b13cd+')';};var _0x4ce9f0={'where':{'id':_0x2ea4cc[_0xb3b1('0x44')]['id']}},_0x1a9042,_0x4d5b17,_0x46f7f9,_0x3985ab,_0x244898;_0x4ce9f0=_[_0xb3b1('0x3e')]({},_0x4ce9f0,_0x2ea4cc[_0xb3b1('0x3f')]);return db[_0xb3b1('0x2d')][_0xb3b1('0x47')](_0x4ce9f0)['then'](function(_0x20eb98){if(_0x20eb98){_0x1a9042=_0x20eb98;return _0x20eb98['getFields']();}return null;})[_0xb3b1('0x24')](function(_0x281274){if(_0x281274){if(!_0x281274[_0xb3b1('0x36')]){throw new db[(_0xb3b1('0x6a'))][(_0xb3b1('0x6b'))](_0xb3b1('0x6c'),0x193);}_0x4d5b17=_0x281274;return db[_0xb3b1('0x89')][_0xb3b1('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x4a86ad){if(_0x4a86ad){_0x46f7f9=_[_0xb3b1('0xa0')](_0x4a86ad,'id');var _0x22fd37;var _0x5d99b6=squel[_0xb3b1('0x6e')]();_0x5d99b6[_0xb3b1('0x6f')](_0x1a9042['table']);for(var _0x4a92fc=0x0;_0x4a92fc<_0x4d5b17[_0xb3b1('0x36')];_0x4a92fc+=0x1){_0x22fd37=_0x4d5b17[_0x4a92fc][_0xb3b1('0x71')]?_0x46f7f9[_0x4d5b17[_0x4a92fc][_0xb3b1('0x71')]]['metric']:_0x4d5b17[_0x4a92fc][_0xb3b1('0x66')];_0x22fd37=_0x4d5b17[_0x4a92fc][_0xb3b1('0x73')]?_[_0xb3b1('0x74')](_0x5c21da[_0x4d5b17[_0x4a92fc][_0xb3b1('0x73')]],'%s',_0x22fd37):_0x22fd37;_0x22fd37=_0x4d5b17[_0x4a92fc][_0xb3b1('0x75')]?_[_0xb3b1('0x74')](_0x268bce[_0x4d5b17[_0x4a92fc][_0xb3b1('0x75')]],'%s',_0x22fd37):_0x22fd37;if(_0x4d5b17[_0x4a92fc][_0xb3b1('0x76')]){_0x5d99b6[_0xb3b1('0x65')](_0x22fd37);}_0x4d5b17[_0x4a92fc]['orderBy']&&_0x5d99b6[_0xb3b1('0x39')](_0x22fd37,_0x4d5b17[_0x4a92fc][_0xb3b1('0x77')]===_0xb3b1('0x8a')?![]:!![]);_0x5d99b6['field'](_0x22fd37,_0x4d5b17[_0x4a92fc][_0xb3b1('0x78')]||_0x22fd37);}if(_0x1a9042[_0xb3b1('0x79')]){_0x1a9042[_0xb3b1('0x79')]=JSON[_0xb3b1('0x7a')](_0x1a9042[_0xb3b1('0x79')]);for(var _0x499ff8=0x0;_0x499ff8<_0x1a9042['joins'][_0xb3b1('0x36')];_0x499ff8+=0x1){if(_0x1a9042['joins'][_0x499ff8][_0xb3b1('0x3c')]&&_[_0xb3b1('0x5e')](_0x42201a,_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x3c')])&&_0x1a9042['joins'][_0x499ff8]['parentKey']&&_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x7c')]&&_0x1a9042['joins'][_0x499ff8]['foreignKey']){_0x5d99b6[_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x3c')]](_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x7c')],null,util[_0xb3b1('0x75')](_0xb3b1('0x8b'),_0x1a9042['table'],_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x7b')],_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x7c')],_0x1a9042[_0xb3b1('0x79')][_0x499ff8][_0xb3b1('0x7d')]));}}}if(_0x1a9042['conditions']){_0x1a9042['conditions']=JSON['parse'](_0x1a9042[_0xb3b1('0x7e')]);_0x5d99b6['where'](_0xbad284(_0x1a9042[_0xb3b1('0x7e')]['group']));}_0x244898=_0x5d99b6[_0xb3b1('0x7f')]();_0x5d99b6['limit'](_0xd69be2);_0x5d99b6[_0xb3b1('0x1b')](0x0);logger[_0xb3b1('0x80')]('Limited\x20Query:',_0x5d99b6[_0xb3b1('0x82')]());return dbH[_0xb3b1('0x9c')]['query'](_0x5d99b6[_0xb3b1('0x82')](),{'type':dbH[_0xb3b1('0x9c')][_0xb3b1('0x83')][_0xb3b1('0x84')]});}})['then'](function(){return{'sql':_0x244898[_0xb3b1('0x82')]()};})[_0xb3b1('0x24')](respondWithResult(_0x7ada44,null))[_0xb3b1('0x42')](handleError(_0x7ada44,null));};
\ No newline at end of file
+var _0xa1cd=['type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','format','groupBy','orderBy','order','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DESC','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','run','runReport','replace','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','destroy','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa1cd,0x11a));var _0xda1c=function(_0xecb1b4,_0x343c87){_0xecb1b4=_0xecb1b4-0x0;var _0x5b3e03=_0xa1cd[_0xecb1b4];return _0x5b3e03;};'use strict';var emlformat=require(_0xda1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda1c('0x1'));var jsonpatch=require(_0xda1c('0x2'));var rp=require(_0xda1c('0x3'));var moment=require(_0xda1c('0x4'));var BPromise=require(_0xda1c('0x5'));var Mustache=require(_0xda1c('0x6'));var util=require('util');var path=require(_0xda1c('0x7'));var sox=require('sox');var csv=require(_0xda1c('0x8'));var ejs=require(_0xda1c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xda1c('0xa'));var crypto=require(_0xda1c('0xb'));var jsforce=require(_0xda1c('0xc'));var deskjs=require(_0xda1c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xda1c('0xe'));var Papa=require('papaparse');var Redis=require(_0xda1c('0xf'));var authService=require(_0xda1c('0x10'));var qs=require(_0xda1c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xda1c('0x12'))(_0xda1c('0x13'));var utils=require('../../config/utils');var config=require(_0xda1c('0x14'));var licenseUtil=require(_0xda1c('0x15'));var db=require(_0xda1c('0x16'))['db'];var dbH=require(_0xda1c('0x16'))[_0xda1c('0x17')];function respondWithStatusCode(_0x40ab15,_0xd9abac){_0xd9abac=_0xd9abac||0xcc;return function(_0x156ca9){if(_0x156ca9){return _0x40ab15['sendStatus'](_0xd9abac);}return _0x40ab15[_0xda1c('0x18')](_0xd9abac)[_0xda1c('0x19')]();};}function respondWithResult(_0x3bb158,_0x1b16c4){_0x1b16c4=_0x1b16c4||0xc8;return function(_0x753829){if(_0x753829){return _0x3bb158[_0xda1c('0x18')](_0x1b16c4)['json'](_0x753829);}};}function respondWithFilteredResult(_0x152ebd,_0x32374c){return function(_0x1a3450){if(_0x1a3450){var _0x1e46c0=typeof _0x32374c[_0xda1c('0x1a')]===_0xda1c('0x1b')&&typeof _0x32374c[_0xda1c('0x1c')]===_0xda1c('0x1b');var _0x5571e7=_0x1a3450[_0xda1c('0x1d')];var _0x50f672=_0x1e46c0?0x0:_0x32374c[_0xda1c('0x1a')];var _0x23283c=_0x1e46c0?_0x1a3450[_0xda1c('0x1d')]:_0x32374c['offset']+_0x32374c[_0xda1c('0x1c')];var _0x42e1dc;if(_0x23283c>=_0x5571e7){_0x23283c=_0x5571e7;_0x42e1dc=0xc8;}else{_0x42e1dc=0xce;}_0x152ebd[_0xda1c('0x18')](_0x42e1dc);return _0x152ebd[_0xda1c('0x1e')](_0xda1c('0x1f'),_0x50f672+'-'+_0x23283c+'/'+_0x5571e7)[_0xda1c('0x20')](_0x1a3450);}return null;};}function patchUpdates(_0x2ad420){return function(_0x5bfe5b){try{jsonpatch[_0xda1c('0x21')](_0x5bfe5b,_0x2ad420,!![]);}catch(_0x4de3ea){return BPromise[_0xda1c('0x22')](_0x4de3ea);}return _0x5bfe5b[_0xda1c('0x23')]();};}function saveUpdates(_0xe774c2,_0x241d35){return function(_0x103d9e){if(_0x103d9e){return _0x103d9e[_0xda1c('0x24')](_0xe774c2)[_0xda1c('0x25')](function(_0x1a6612){return _0x1a6612;});}return null;};}function removeEntity(_0x10be24,_0x3f0f58){return function(_0x23f6b7){if(_0x23f6b7){return _0x23f6b7['destroy']()['then'](function(){var _0x130ed1=_0x23f6b7[_0xda1c('0x26')]({'plain':!![]});var _0x328e0e='CustomReports';return db['UserProfileResource'][_0xda1c('0x27')]({'where':{'type':_0x328e0e,'resourceId':_0x130ed1['id']}})[_0xda1c('0x25')](function(){return _0x23f6b7;});})[_0xda1c('0x25')](function(){_0x10be24[_0xda1c('0x18')](0xcc)[_0xda1c('0x19')]();});}};}function handleEntityNotFound(_0x157bb7,_0x4ad8e4){return function(_0x193ab4){if(!_0x193ab4){_0x157bb7['sendStatus'](0x194);}return _0x193ab4;};}function handleError(_0x35e237,_0x18b4fa){_0x18b4fa=_0x18b4fa||0x1f4;return function(_0x3b9e12){logger[_0xda1c('0x28')](_0x3b9e12[_0xda1c('0x29')]);if(_0x3b9e12[_0xda1c('0x2a')]){delete _0x3b9e12[_0xda1c('0x2a')];}_0x35e237[_0xda1c('0x18')](_0x18b4fa)[_0xda1c('0x2b')](_0x3b9e12);};}exports['index']=function(_0x3f2595,_0x876e60){var _0x51d500={},_0x136222={},_0x37b859={'count':0x0,'rows':[]};var _0x1310ea=_[_0xda1c('0x2c')](db[_0xda1c('0x2d')][_0xda1c('0x2e')],function(_0x5e67aa){return{'name':_0x5e67aa[_0xda1c('0x2f')],'type':_0x5e67aa[_0xda1c('0x30')][_0xda1c('0x31')]};});_0x136222[_0xda1c('0x32')]=_[_0xda1c('0x2c')](_0x1310ea,_0xda1c('0x2a'));_0x136222[_0xda1c('0x33')]=_['keys'](_0x3f2595[_0xda1c('0x33')]);_0x136222['filters']=_[_0xda1c('0x34')](_0x136222[_0xda1c('0x32')],_0x136222[_0xda1c('0x33')]);_0x51d500[_0xda1c('0x35')]=_['intersection'](_0x136222['model'],qs[_0xda1c('0x36')](_0x3f2595[_0xda1c('0x33')][_0xda1c('0x36')]));_0x51d500[_0xda1c('0x35')]=_0x51d500[_0xda1c('0x35')][_0xda1c('0x37')]?_0x51d500[_0xda1c('0x35')]:_0x136222[_0xda1c('0x32')];if(!_0x3f2595[_0xda1c('0x33')][_0xda1c('0x38')](_0xda1c('0x39'))){_0x51d500[_0xda1c('0x1c')]=qs[_0xda1c('0x1c')](_0x3f2595[_0xda1c('0x33')][_0xda1c('0x1c')]);_0x51d500[_0xda1c('0x1a')]=qs['offset'](_0x3f2595[_0xda1c('0x33')]['offset']);}_0x51d500['order']=qs[_0xda1c('0x3a')](_0x3f2595[_0xda1c('0x33')]['sort']);_0x51d500[_0xda1c('0x3b')]=qs[_0xda1c('0x3c')](_['pick'](_0x3f2595[_0xda1c('0x33')],_0x136222[_0xda1c('0x3c')]),_0x1310ea);if(_0x3f2595['query'][_0xda1c('0x3d')]){_0x51d500['where']=_[_0xda1c('0x3e')](_0x51d500['where'],{'$or':_[_0xda1c('0x2c')](_0x1310ea,function(_0x5a8ce9){if(_0x5a8ce9[_0xda1c('0x30')]!==_0xda1c('0x3f')){var _0x3aefd2={};_0x3aefd2[_0x5a8ce9[_0xda1c('0x2a')]]={'$like':'%'+_0x3f2595[_0xda1c('0x33')][_0xda1c('0x3d')]+'%'};return _0x3aefd2;}})});}_0x51d500=_['merge']({},_0x51d500,_0x3f2595[_0xda1c('0x40')]);var _0x1f89c5={'where':_0x51d500['where']};return db[_0xda1c('0x2d')]['count'](_0x1f89c5)[_0xda1c('0x25')](function(_0x4ffeb0){_0x37b859[_0xda1c('0x1d')]=_0x4ffeb0;if(_0x3f2595[_0xda1c('0x33')]['includeAll']){_0x51d500[_0xda1c('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xda1c('0x42')](_0x51d500);})[_0xda1c('0x25')](function(_0xc4a652){_0x37b859[_0xda1c('0x43')]=_0xc4a652;return _0x37b859;})['then'](respondWithFilteredResult(_0x876e60,_0x51d500))['catch'](handleError(_0x876e60,null));};exports[_0xda1c('0x44')]=function(_0x37a799,_0x3a44fa){var _0x3744f2={'raw':![],'where':{'id':_0x37a799[_0xda1c('0x45')]['id']}},_0x52c8f5={};_0x52c8f5[_0xda1c('0x32')]=_[_0xda1c('0x46')](db[_0xda1c('0x2d')][_0xda1c('0x2e')]);_0x52c8f5['query']=_[_0xda1c('0x46')](_0x37a799[_0xda1c('0x33')]);_0x52c8f5['filters']=_[_0xda1c('0x34')](_0x52c8f5[_0xda1c('0x32')],_0x52c8f5[_0xda1c('0x33')]);_0x3744f2['attributes']=_[_0xda1c('0x34')](_0x52c8f5['model'],qs[_0xda1c('0x36')](_0x37a799[_0xda1c('0x33')]['fields']));_0x3744f2[_0xda1c('0x35')]=_0x3744f2[_0xda1c('0x35')]['length']?_0x3744f2[_0xda1c('0x35')]:_0x52c8f5[_0xda1c('0x32')];if(_0x37a799['query'][_0xda1c('0x47')]){_0x3744f2[_0xda1c('0x41')]=[{'all':!![]}];}_0x3744f2=_[_0xda1c('0x3e')]({},_0x3744f2,_0x37a799[_0xda1c('0x40')]);return db['AnalyticCustomReport'][_0xda1c('0x48')](_0x3744f2)['then'](handleEntityNotFound(_0x3a44fa,null))['then'](respondWithResult(_0x3a44fa,null))[_0xda1c('0x49')](handleError(_0x3a44fa,null));};exports[_0xda1c('0x4a')]=function(_0x8bcb00,_0x3ca87b){return db[_0xda1c('0x2d')][_0xda1c('0x4a')](_0x8bcb00[_0xda1c('0x4b')],{})[_0xda1c('0x25')](function(_0x5d3ca7){var _0x17472b=_0x8bcb00['user'][_0xda1c('0x26')]({'plain':!![]});if(!_0x17472b)throw new Error(_0xda1c('0x4c'));if(_0x17472b[_0xda1c('0x4d')]===_0xda1c('0x4e')){var _0x3cbbb6=_0x5d3ca7['get']({'plain':!![]});var _0x2f3a32=_0xda1c('0x4f');return db['UserProfileSection'][_0xda1c('0x48')]({'where':{'name':_0x2f3a32,'userProfileId':_0x17472b[_0xda1c('0x50')]},'raw':!![]})['then'](function(_0x8a8ab){if(_0x8a8ab&&_0x8a8ab[_0xda1c('0x51')]===0x0){return db[_0xda1c('0x52')][_0xda1c('0x4a')]({'name':_0x3cbbb6['name'],'resourceId':_0x3cbbb6['id'],'type':'CustomReports','sectionId':_0x8a8ab['id']},{})['then'](function(){return _0x5d3ca7;});}else{return _0x5d3ca7;}})[_0xda1c('0x49')](function(_0x231055){logger[_0xda1c('0x28')](_0xda1c('0x53'),_0x231055);throw _0x231055;});}return _0x5d3ca7;})[_0xda1c('0x25')](respondWithResult(_0x3ca87b,0xc9))[_0xda1c('0x49')](handleError(_0x3ca87b,null));};exports[_0xda1c('0x24')]=function(_0x565748,_0x24e6cc){if(_0x565748[_0xda1c('0x4b')]['id']){delete _0x565748[_0xda1c('0x4b')]['id'];}return db[_0xda1c('0x2d')][_0xda1c('0x48')]({'where':{'id':_0x565748['params']['id']}})[_0xda1c('0x25')](handleEntityNotFound(_0x24e6cc,null))[_0xda1c('0x25')](saveUpdates(_0x565748[_0xda1c('0x4b')],null))[_0xda1c('0x25')](respondWithResult(_0x24e6cc,null))[_0xda1c('0x49')](handleError(_0x24e6cc,null));};exports[_0xda1c('0x27')]=function(_0x3cb6b1,_0xc12cf2){return db[_0xda1c('0x2d')][_0xda1c('0x48')]({'where':{'id':_0x3cb6b1['params']['id']}})['then'](handleEntityNotFound(_0xc12cf2,null))[_0xda1c('0x25')](removeEntity(_0xc12cf2,null))[_0xda1c('0x49')](handleError(_0xc12cf2,null));};exports[_0xda1c('0x54')]=function(_0xd3da10,_0x48a49e){var _0xd3b7ee=0xa;var _0x10343e=[_0xda1c('0x55'),'left_join',_0xda1c('0x56'),_0xda1c('0x57')];var _0x1f00ff={'SUM':_0xda1c('0x58'),'COUNT':_0xda1c('0x59'),'COUNT DISTINCT':_0xda1c('0x5a'),'MAX':_0xda1c('0x5b'),'MIN':_0xda1c('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xda1c('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4c6ebb={'SEC_TO_TIME':_0xda1c('0x5e'),'DATE':_0xda1c('0x5f'),'HOUR':_0xda1c('0x60'),'ROUND':_0xda1c('0x61'),'UNIX_TIMESTAMP':_0xda1c('0x62')};var _0x5c3aa7=function(_0x1f741b){return!_[_0xda1c('0x63')]([_0xda1c('0x64'),_0xda1c('0x65'),_0xda1c('0x66'),'IS\x20NOT\x20EMPTY'],_0x1f741b);};var _0x326d43=function(_0x4134d8){if(!_0x4134d8||!_0x4134d8[_0xda1c('0x67')]['length']){return'';}for(var _0x317b32='(',_0x4b0df0=0x0;_0x4b0df0<_0x4134d8[_0xda1c('0x67')][_0xda1c('0x37')];_0x4b0df0+=0x1){_0x4b0df0>0x0&&(_0x317b32+='\x20'+_0x4134d8[_0xda1c('0x68')]+'\x20');_0x317b32+=_0x4134d8[_0xda1c('0x67')][_0x4b0df0][_0xda1c('0x69')]?_0x326d43(_0x4134d8[_0xda1c('0x67')][_0x4b0df0][_0xda1c('0x69')]):_0x4134d8['rules'][_0x4b0df0][_0xda1c('0x6a')]+'\x20'+_0x4134d8[_0xda1c('0x67')][_0x4b0df0][_0xda1c('0x6b')]+(_0x5c3aa7(_0x4134d8[_0xda1c('0x67')][_0x4b0df0][_0xda1c('0x6b')])?'\x20'+_0x4134d8[_0xda1c('0x67')][_0x4b0df0][_0xda1c('0x6c')]:'');}return _0x317b32+')';};var _0x479af4={'where':{'id':_0xd3da10[_0xda1c('0x45')]['id']}},_0x22df6b,_0x1f4439,_0x5b661c,_0x1b69c5,_0x44c7c4;_0x479af4=_['merge']({},_0x479af4,_0xd3da10['options']);return db[_0xda1c('0x2d')]['find'](_0x479af4)[_0xda1c('0x25')](function(_0x54368d){if(_0x54368d){_0x22df6b=_0x54368d;return _0x54368d[_0xda1c('0x6d')]();}return null;})[_0xda1c('0x25')](function(_0x5abd46){if(_0x5abd46){if(!_0x5abd46[_0xda1c('0x37')]){throw new db[(_0xda1c('0x6e'))][(_0xda1c('0x6f'))](_0xda1c('0x70'),0x193);}_0x1f4439=_0x5abd46;return db[_0xda1c('0x71')][_0xda1c('0x42')]({'raw':!![]});}return null;})[_0xda1c('0x25')](function(_0x186206){if(_0x186206){_0x5b661c=_[_0xda1c('0x72')](_0x186206,'id');var _0x1e53a6;var _0x870252=squel[_0xda1c('0x73')]();_0x870252['from'](_0x22df6b['table']);for(var _0x563cff=0x0;_0x563cff<_0x1f4439[_0xda1c('0x37')];_0x563cff+=0x1){_0x1e53a6=_0x1f4439[_0x563cff][_0xda1c('0x74')]?_0x5b661c[_0x1f4439[_0x563cff][_0xda1c('0x74')]][_0xda1c('0x75')]:_0x1f4439[_0x563cff][_0xda1c('0x6a')];_0x1e53a6=_0x1f4439[_0x563cff][_0xda1c('0x76')]?_['replace'](_0x1f00ff[_0x1f4439[_0x563cff]['function']],'%s',_0x1e53a6):_0x1e53a6;_0x1e53a6=_0x1f4439[_0x563cff][_0xda1c('0x77')]?_['replace'](_0x4c6ebb[_0x1f4439[_0x563cff]['format']],'%s',_0x1e53a6):_0x1e53a6;if(_0x1f4439[_0x563cff][_0xda1c('0x78')]){_0x870252[_0xda1c('0x69')](_0x1e53a6);}_0x1f4439[_0x563cff][_0xda1c('0x79')]&&_0x870252[_0xda1c('0x7a')](_0x1e53a6,_0x1f4439[_0x563cff][_0xda1c('0x79')]==='DESC'?![]:!![]);_0x870252[_0xda1c('0x6a')](_0x1e53a6,_0x1f4439[_0x563cff][_0xda1c('0x7b')]||_0x1e53a6);}if(_0x22df6b[_0xda1c('0x7c')]){_0x22df6b[_0xda1c('0x7c')]=JSON[_0xda1c('0x7d')](_0x22df6b[_0xda1c('0x7c')]);for(var _0x1d615b=0x0;_0x1d615b<_0x22df6b[_0xda1c('0x7c')]['length'];_0x1d615b+=0x1){if(_0x22df6b[_0xda1c('0x7c')][_0x1d615b][_0xda1c('0x30')]&&_[_0xda1c('0x63')](_0x10343e,_0x22df6b[_0xda1c('0x7c')][_0x1d615b][_0xda1c('0x30')])&&_0x22df6b[_0xda1c('0x7c')][_0x1d615b]['parentKey']&&_0x22df6b['joins'][_0x1d615b][_0xda1c('0x7e')]&&_0x22df6b[_0xda1c('0x7c')][_0x1d615b][_0xda1c('0x7f')]){_0x870252[_0x22df6b[_0xda1c('0x7c')][_0x1d615b][_0xda1c('0x30')]](_0x22df6b['joins'][_0x1d615b]['foreignTable'],null,util[_0xda1c('0x77')](_0xda1c('0x80'),_0x22df6b[_0xda1c('0x81')],_0x22df6b['joins'][_0x1d615b][_0xda1c('0x82')],_0x22df6b[_0xda1c('0x7c')][_0x1d615b]['foreignTable'],_0x22df6b[_0xda1c('0x7c')][_0x1d615b][_0xda1c('0x7f')]));}}}if(_0x22df6b[_0xda1c('0x83')]){_0x22df6b[_0xda1c('0x83')]=JSON[_0xda1c('0x7d')](_0x22df6b['conditions']);_0x870252['where'](_0x326d43(_0x22df6b['conditions']['group']));}_0x44c7c4=_0x870252[_0xda1c('0x84')]();_0x870252[_0xda1c('0x1c')](_0xd3b7ee);_0x870252[_0xda1c('0x1a')](0x0);logger[_0xda1c('0x85')]('Limited\x20Query:',_0x870252[_0xda1c('0x86')]());return dbH[_0xda1c('0x87')][_0xda1c('0x33')](_0x870252[_0xda1c('0x86')](),{'type':dbH[_0xda1c('0x87')][_0xda1c('0x88')][_0xda1c('0x89')]});}})[_0xda1c('0x25')](respondWithResult(_0x48a49e,null))['catch'](handleError(_0x48a49e,null));};function runReport(_0x16e856,_0x252774,_0x5c62fc){var _0x3d7f89=_0x252774[_0xda1c('0x2a')];var _0x415230=0xa;var _0x1addb3=[_0xda1c('0x55'),_0xda1c('0x8a'),_0xda1c('0x56'),_0xda1c('0x57')];var _0x42ba03={'SUM':_0xda1c('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xda1c('0x5a'),'MAX':_0xda1c('0x5b'),'MIN':_0xda1c('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xda1c('0x8b'),'GROUP_CONCAT ASC':_0xda1c('0x5d'),'GROUP_CONCAT DESC':_0xda1c('0x8c')};var _0x542eda={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xda1c('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19950c=function(_0x2d4367){return!_[_0xda1c('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xda1c('0x66'),'IS\x20NOT\x20EMPTY'],_0x2d4367);};var _0x15afa6=function(_0x561048){if(!_0x561048||!_0x561048[_0xda1c('0x67')][_0xda1c('0x37')]){return'';}for(var _0x485e7c='(',_0x5d8a5d=0x0;_0x5d8a5d<_0x561048[_0xda1c('0x67')]['length'];_0x5d8a5d+=0x1){_0x5d8a5d>0x0&&(_0x485e7c+='\x20'+_0x561048['operator']+'\x20');_0x485e7c+=_0x561048['rules'][_0x5d8a5d][_0xda1c('0x69')]?_0x15afa6(_0x561048[_0xda1c('0x67')][_0x5d8a5d][_0xda1c('0x69')]):_0x561048[_0xda1c('0x67')][_0x5d8a5d]['field']+'\x20'+_0x561048[_0xda1c('0x67')][_0x5d8a5d]['condition']+(_0x19950c(_0x561048['rules'][_0x5d8a5d][_0xda1c('0x6b')])?'\x20'+_0x561048[_0xda1c('0x67')][_0x5d8a5d][_0xda1c('0x6c')]:'');}return _0x485e7c+')';};var _0x19dfc8={'where':{'id':_0x16e856['id']}},_0x3fee40,_0x10aea3,_0x5c79f9,_0x31af6f,_0x14b683;_0x19dfc8=_[_0xda1c('0x3e')]({},_0x19dfc8,_0x5c62fc);return db[_0xda1c('0x2d')][_0xda1c('0x48')](_0x19dfc8)['then'](function(_0x25dccf){if(_0x25dccf){_0x3fee40=_0x25dccf;return _0x25dccf['getFields']();}return null;})['then'](function(_0x1c0236){if(_0x1c0236){if(!_0x1c0236[_0xda1c('0x37')]){throw new db[(_0xda1c('0x6e'))][(_0xda1c('0x6f'))](_0xda1c('0x70'),0x193);}_0x10aea3=_0x1c0236;return db[_0xda1c('0x71')][_0xda1c('0x42')]({'raw':!![]});}return null;})[_0xda1c('0x25')](function(_0xd454ff){if(_0xd454ff){_0x5c79f9=_[_0xda1c('0x72')](_0xd454ff,'id');var _0x248fee;var _0x39bceb=squel[_0xda1c('0x73')]();_0x39bceb['from'](_0x3fee40[_0xda1c('0x81')]);for(var _0x55a7a2=0x0;_0x55a7a2<_0x10aea3[_0xda1c('0x37')];_0x55a7a2+=0x1){_0x248fee=_0x10aea3[_0x55a7a2][_0xda1c('0x74')]?_0x5c79f9[_0x10aea3[_0x55a7a2][_0xda1c('0x74')]]['metric']:_0x10aea3[_0x55a7a2][_0xda1c('0x6a')];_0x248fee=_0x10aea3[_0x55a7a2][_0xda1c('0x76')]?_['replace'](_0x42ba03[_0x10aea3[_0x55a7a2][_0xda1c('0x76')]],'%s',_0x248fee):_0x248fee;_0x248fee=_0x10aea3[_0x55a7a2]['format']?_['replace'](_0x542eda[_0x10aea3[_0x55a7a2][_0xda1c('0x77')]],'%s',_0x248fee):_0x248fee;if(_0x10aea3[_0x55a7a2][_0xda1c('0x78')]){_0x39bceb[_0xda1c('0x69')](_0x248fee);}_0x10aea3[_0x55a7a2][_0xda1c('0x79')]&&_0x39bceb[_0xda1c('0x7a')](_0x248fee,_0x10aea3[_0x55a7a2][_0xda1c('0x79')]===_0xda1c('0x8d')?![]:!![]);_0x39bceb[_0xda1c('0x6a')](_0x248fee,_0x10aea3[_0x55a7a2][_0xda1c('0x7b')]||_0x248fee);}if(_0x3fee40[_0xda1c('0x7c')]){_0x3fee40['joins']=JSON[_0xda1c('0x7d')](_0x3fee40[_0xda1c('0x7c')]);for(var _0x2349ba=0x0;_0x2349ba<_0x3fee40[_0xda1c('0x7c')][_0xda1c('0x37')];_0x2349ba+=0x1){if(_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x30')]&&_[_0xda1c('0x63')](_0x1addb3,_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x30')])&&_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x82')]&&_0x3fee40[_0xda1c('0x7c')][_0x2349ba]['foreignTable']&&_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x7f')]){_0x39bceb[_0x3fee40['joins'][_0x2349ba][_0xda1c('0x30')]](_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x7e')],null,util[_0xda1c('0x77')]('%s.%s\x20=\x20%s.%s',_0x3fee40[_0xda1c('0x81')],_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x82')],_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x7e')],_0x3fee40[_0xda1c('0x7c')][_0x2349ba][_0xda1c('0x7f')]));}}}if(_0x3fee40[_0xda1c('0x83')]){_0x3fee40['conditions']=JSON[_0xda1c('0x7d')](_0x3fee40['conditions']);_0x39bceb[_0xda1c('0x3b')](_0x15afa6(_0x3fee40['conditions'][_0xda1c('0x69')]));}_0x14b683=_0x39bceb[_0xda1c('0x84')]();_0x39bceb[_0xda1c('0x1c')](_0x415230);_0x39bceb['offset'](0x0);return;}})[_0xda1c('0x25')](function(){if(_0x252774[_0xda1c('0x8e')]==='web'){return null;}var _0x236f2e=_[_0xda1c('0x3e')](_0x252774,{'name':_0x252774[_0xda1c('0x8f')]||_0x252774[_0xda1c('0x2a')]||_0x3fee40[_0xda1c('0x2a')],'basename':_0x3d7f89,'savename':util[_0xda1c('0x77')](_0xda1c('0x90'),_0x252774['name']||_0x3fee40[_0xda1c('0x2a')],require('randomstring')[_0xda1c('0x91')](0x4),_0x252774[_0xda1c('0x8e')]||_0xda1c('0x92')),'reportId':_0x3fee40['id'],'reportType':_0xda1c('0x93')});return db[_0xda1c('0x94')][_0xda1c('0x4a')](_0x236f2e,{'raw':!![]});})[_0xda1c('0x25')](function(_0x68f9ed){if(_0x3fee40['table']===_0xda1c('0x95')){_0x14b683['where'](_0x3fee40[_0xda1c('0x81')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x252774[_0xda1c('0x96')],_0x252774[_0xda1c('0x97')]);}else{_0x14b683[_0xda1c('0x3b')](_0x3fee40['table']+_0xda1c('0x98'),_0x252774[_0xda1c('0x96')],_0x252774[_0xda1c('0x97')]);}if(_0x68f9ed){logger['info'](_0xda1c('0x99'),_0x14b683['toString']());require(_0xda1c('0x9a'))[_0xda1c('0x9b')](path[_0xda1c('0x55')](__dirname,_0xda1c('0x9c'),_0x68f9ed[_0xda1c('0x8e')]),[_0x68f9ed['id'],_0x14b683[_0xda1c('0x86')](),path[_0xda1c('0x55')](__dirname,_0xda1c('0x9d'),_0x68f9ed[_0xda1c('0x9e')]),_0x3d7f89]);return _0x68f9ed;}else{var _0x43d6e5=squel['select']();_0x43d6e5[_0xda1c('0x9f')]('('+_0x14b683[_0xda1c('0x86')]()+')',_0xda1c('0xa0'));_0x43d6e5[_0xda1c('0x6a')](_0xda1c('0xa1'),_0xda1c('0x1d'));_0x14b683['limit'](_0x252774['limit']||_0x415230);_0x14b683[_0xda1c('0x1a')](_0x252774[_0xda1c('0x1a')]||0x0);return dbH[_0xda1c('0x87')][_0xda1c('0x33')](_0x43d6e5[_0xda1c('0x86')](),{'type':dbH['sequelize'][_0xda1c('0x88')][_0xda1c('0x89')]})[_0xda1c('0x25')](function(_0x261d02){if(!_0x261d02[_0xda1c('0x37')]){_0x31af6f=0x0;}else{_0x31af6f=_0x261d02[0x0][_0xda1c('0x1d')]||0x0;}return dbH['sequelize']['query'](_0x14b683[_0xda1c('0x86')](),{'type':dbH[_0xda1c('0x87')][_0xda1c('0x88')][_0xda1c('0x89')]});})[_0xda1c('0x25')](function(_0x5672c8){return{'rows':_0x5672c8||[],'count':_0x31af6f};});}});}exports[_0xda1c('0xa2')]=function(_0x106cb3,_0x5a144a){return runReport(_0x106cb3['params'],_0x106cb3[_0xda1c('0x33')],_0x106cb3[_0xda1c('0x40')])[_0xda1c('0x25')](respondWithResult(_0x5a144a,null))[_0xda1c('0x49')](handleError(_0x5a144a,null));};exports[_0xda1c('0xa3')]=runReport;exports[_0xda1c('0x33')]=function(_0x348ba4,_0x4bba1f){var _0x5b31a7=0xa;var _0x2b6150=['join',_0xda1c('0x8a'),_0xda1c('0x56'),_0xda1c('0x57')];var _0x21995e={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xda1c('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xda1c('0x8b'),'GROUP_CONCAT ASC':_0xda1c('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xde5483={'SEC_TO_TIME':_0xda1c('0x5e'),'DATE':'DATE(%s)','HOUR':_0xda1c('0x60'),'ROUND':_0xda1c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9388=function(_0x2c9b3a){return!_[_0xda1c('0x63')](['IS\x20NULL',_0xda1c('0x65'),_0xda1c('0x66'),'IS\x20NOT\x20EMPTY'],_0x2c9b3a);};var _0x4acb9c=function(_0x5dd842){if(!_0x5dd842||!_0x5dd842[_0xda1c('0x67')][_0xda1c('0x37')]){return'';}for(var _0x4567af='(',_0x262d4f=0x0;_0x262d4f<_0x5dd842['rules'][_0xda1c('0x37')];_0x262d4f+=0x1){_0x262d4f>0x0&&(_0x4567af+='\x20'+_0x5dd842[_0xda1c('0x68')]+'\x20');_0x4567af+=_0x5dd842[_0xda1c('0x67')][_0x262d4f][_0xda1c('0x69')]?_0x4acb9c(_0x5dd842[_0xda1c('0x67')][_0x262d4f]['group']):_0x5dd842[_0xda1c('0x67')][_0x262d4f]['field']+'\x20'+_0x5dd842['rules'][_0x262d4f][_0xda1c('0x6b')]+(_0x1c9388(_0x5dd842[_0xda1c('0x67')][_0x262d4f]['condition'])?'\x20'+_0x5dd842[_0xda1c('0x67')][_0x262d4f][_0xda1c('0x6c')]:'');}return _0x4567af+')';};var _0x488eec={'where':{'id':_0x348ba4['params']['id']}},_0x2d2e75,_0x33d94,_0x479cb2,_0x598c28,_0x562aab;_0x488eec=_[_0xda1c('0x3e')]({},_0x488eec,_0x348ba4['options']);return db[_0xda1c('0x2d')][_0xda1c('0x48')](_0x488eec)[_0xda1c('0x25')](function(_0x2f2cd7){if(_0x2f2cd7){_0x2d2e75=_0x2f2cd7;return _0x2f2cd7[_0xda1c('0x6d')]();}return null;})['then'](function(_0x433849){if(_0x433849){if(!_0x433849[_0xda1c('0x37')]){throw new db[(_0xda1c('0x6e'))][(_0xda1c('0x6f'))](_0xda1c('0x70'),0x193);}_0x33d94=_0x433849;return db['AnalyticMetric'][_0xda1c('0x42')]({'raw':!![]});}return null;})[_0xda1c('0x25')](function(_0x15395d){if(_0x15395d){_0x479cb2=_['keyBy'](_0x15395d,'id');var _0x1a5d6b;var _0xa2e22d=squel[_0xda1c('0x73')]();_0xa2e22d[_0xda1c('0x9f')](_0x2d2e75[_0xda1c('0x81')]);for(var _0x396af4=0x0;_0x396af4<_0x33d94[_0xda1c('0x37')];_0x396af4+=0x1){_0x1a5d6b=_0x33d94[_0x396af4][_0xda1c('0x74')]?_0x479cb2[_0x33d94[_0x396af4][_0xda1c('0x74')]][_0xda1c('0x75')]:_0x33d94[_0x396af4][_0xda1c('0x6a')];_0x1a5d6b=_0x33d94[_0x396af4]['function']?_[_0xda1c('0xa4')](_0x21995e[_0x33d94[_0x396af4][_0xda1c('0x76')]],'%s',_0x1a5d6b):_0x1a5d6b;_0x1a5d6b=_0x33d94[_0x396af4]['format']?_['replace'](_0xde5483[_0x33d94[_0x396af4][_0xda1c('0x77')]],'%s',_0x1a5d6b):_0x1a5d6b;if(_0x33d94[_0x396af4][_0xda1c('0x78')]){_0xa2e22d[_0xda1c('0x69')](_0x1a5d6b);}_0x33d94[_0x396af4][_0xda1c('0x79')]&&_0xa2e22d[_0xda1c('0x7a')](_0x1a5d6b,_0x33d94[_0x396af4][_0xda1c('0x79')]==='DESC'?![]:!![]);_0xa2e22d['field'](_0x1a5d6b,_0x33d94[_0x396af4][_0xda1c('0x7b')]||_0x1a5d6b);}if(_0x2d2e75[_0xda1c('0x7c')]){_0x2d2e75['joins']=JSON[_0xda1c('0x7d')](_0x2d2e75['joins']);for(var _0xe143e7=0x0;_0xe143e7<_0x2d2e75[_0xda1c('0x7c')][_0xda1c('0x37')];_0xe143e7+=0x1){if(_0x2d2e75[_0xda1c('0x7c')][_0xe143e7]['type']&&_[_0xda1c('0x63')](_0x2b6150,_0x2d2e75[_0xda1c('0x7c')][_0xe143e7][_0xda1c('0x30')])&&_0x2d2e75[_0xda1c('0x7c')][_0xe143e7][_0xda1c('0x82')]&&_0x2d2e75['joins'][_0xe143e7][_0xda1c('0x7e')]&&_0x2d2e75[_0xda1c('0x7c')][_0xe143e7][_0xda1c('0x7f')]){_0xa2e22d[_0x2d2e75[_0xda1c('0x7c')][_0xe143e7][_0xda1c('0x30')]](_0x2d2e75[_0xda1c('0x7c')][_0xe143e7][_0xda1c('0x7e')],null,util['format'](_0xda1c('0x80'),_0x2d2e75[_0xda1c('0x81')],_0x2d2e75['joins'][_0xe143e7]['parentKey'],_0x2d2e75[_0xda1c('0x7c')][_0xe143e7]['foreignTable'],_0x2d2e75[_0xda1c('0x7c')][_0xe143e7][_0xda1c('0x7f')]));}}}if(_0x2d2e75['conditions']){_0x2d2e75[_0xda1c('0x83')]=JSON[_0xda1c('0x7d')](_0x2d2e75[_0xda1c('0x83')]);_0xa2e22d['where'](_0x4acb9c(_0x2d2e75[_0xda1c('0x83')][_0xda1c('0x69')]));}_0x562aab=_0xa2e22d['clone']();_0xa2e22d[_0xda1c('0x1c')](_0x5b31a7);_0xa2e22d['offset'](0x0);logger['debug']('Limited\x20Query:',_0xa2e22d[_0xda1c('0x86')]());return dbH[_0xda1c('0x87')]['query'](_0xa2e22d[_0xda1c('0x86')](),{'type':dbH[_0xda1c('0x87')]['QueryTypes'][_0xda1c('0x89')]});}})['then'](function(){return{'sql':_0x562aab[_0xda1c('0x86')]()};})['then'](respondWithResult(_0x4bba1f,null))['catch'](handleError(_0x4bba1f,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index a3c6c32..a6ff356 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 _0xb098=['define','lodash','util','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xb098,0x173));var _0x8b09=function(_0x2d040e,_0x32b09b){_0x2d040e=_0x2d040e-0x0;var _0x4b5a90=_0xb098[_0x2d040e];return _0x4b5a90;};'use strict';var _=require(_0x8b09('0x0'));var util=require(_0x8b09('0x1'));var logger=require('../../config/logger')(_0x8b09('0x2'));var moment=require(_0x8b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b09('0x4'));var fs=require('fs');var path=require(_0x8b09('0x5'));var rimraf=require('rimraf');var config=require(_0x8b09('0x6'));var attributes=require(_0x8b09('0x7'));module[_0x8b09('0x8')]=function(_0x16f78a,_0x1dd508){return _0x16f78a[_0x8b09('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48dc=['bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','api','moment'];(function(_0x59edd0,_0x13ad1b){var _0x30ff26=function(_0x1423b4){while(--_0x1423b4){_0x59edd0['push'](_0x59edd0['shift']());}};_0x30ff26(++_0x13ad1b);}(_0x48dc,0x8b));var _0xc48d=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0x48dc[_0x2d6197];return _0x4d0e75;};'use strict';var _=require(_0xc48d('0x0'));var util=require(_0xc48d('0x1'));var logger=require('../../config/logger')(_0xc48d('0x2'));var moment=require(_0xc48d('0x3'));var BPromise=require(_0xc48d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc48d('0x5'));var config=require(_0xc48d('0x6'));var attributes=require(_0xc48d('0x7'));module[_0xc48d('0x8')]=function(_0x24d8d3,_0x178ee5){return _0x24d8d3[_0xc48d('0x9')](_0xc48d('0xa'),attributes,{'tableName':'analytics_custom_reports','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 caed895..06768f6 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 _0x0382=['info','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','error','AnalyticCustomReport,\x20%s,\x20%s','message'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0382,0x133));var _0x2038=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0382[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x2038('0x0'));var moment=require(_0x2038('0x1'));var BPromise=require(_0x2038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2038('0x4'));var logger=require(_0x2038('0x5'))(_0x2038('0x6'));var config=require(_0x2038('0x7'));var jayson=require(_0x2038('0x8'));var client=jayson[_0x2038('0x9')][_0x2038('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ef38,_0x426a33,_0x46d984){return new BPromise(function(_0x282a75,_0x18bb09){return client[_0x2038('0xb')](_0x56ef38,_0x46d984)['then'](function(_0x3ad107){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x426a33,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x426a33,_0x2038('0xc'),JSON['stringify'](_0x3ad107));if(_0x3ad107[_0x2038('0xd')]){if(_0x3ad107[_0x2038('0xd')]['code']===0x1f4){logger['error'](_0x2038('0xe'),_0x426a33,_0x3ad107[_0x2038('0xd')][_0x2038('0xf')]);return _0x18bb09(_0x3ad107['error']['message']);}logger['error'](_0x2038('0xe'),_0x426a33,_0x3ad107[_0x2038('0xd')]['message']);return _0x282a75(_0x3ad107['error']['message']);}else{logger[_0x2038('0x10')](_0x2038('0xe'),_0x426a33,'request\x20sent');_0x282a75(_0x3ad107['result'][_0x2038('0xf')]);}})['catch'](function(_0x5563dd){logger[_0x2038('0xd')](_0x2038('0xe'),_0x426a33,_0x5563dd);_0x18bb09(_0x5563dd);});});}
\ No newline at end of file
+var _0x29fb=['info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message'];(function(_0x36aaad,_0x4123c5){var _0x383ce2=function(_0x49f08b){while(--_0x49f08b){_0x36aaad['push'](_0x36aaad['shift']());}};_0x383ce2(++_0x4123c5);}(_0x29fb,0x16b));var _0xb29f=function(_0x46d1b5,_0x167007){_0x46d1b5=_0x46d1b5-0x0;var _0x5002cc=_0x29fb[_0x46d1b5];return _0x5002cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb29f('0x0'));var BPromise=require(_0xb29f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb29f('0x2'));var db=require(_0xb29f('0x3'))['db'];var utils=require(_0xb29f('0x4'));var logger=require(_0xb29f('0x5'))(_0xb29f('0x6'));var config=require(_0xb29f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb29f('0x8')][_0xb29f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b385d,_0x5cb8dc,_0x4e4bab){return new BPromise(function(_0x4008d7,_0x5a05d6){return client['request'](_0x3b385d,_0x4e4bab)[_0xb29f('0xa')](function(_0x16ccb0){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5cb8dc,_0xb29f('0xb'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5cb8dc,_0xb29f('0xb'),JSON[_0xb29f('0xc')](_0x16ccb0));if(_0x16ccb0[_0xb29f('0xd')]){if(_0x16ccb0[_0xb29f('0xd')][_0xb29f('0xe')]===0x1f4){logger[_0xb29f('0xd')](_0xb29f('0xf'),_0x5cb8dc,_0x16ccb0[_0xb29f('0xd')][_0xb29f('0x10')]);return _0x5a05d6(_0x16ccb0[_0xb29f('0xd')][_0xb29f('0x10')]);}logger[_0xb29f('0xd')](_0xb29f('0xf'),_0x5cb8dc,_0x16ccb0[_0xb29f('0xd')]['message']);return _0x4008d7(_0x16ccb0[_0xb29f('0xd')][_0xb29f('0x10')]);}else{logger[_0xb29f('0x11')](_0xb29f('0xf'),_0x5cb8dc,_0xb29f('0xb'));_0x4008d7(_0x16ccb0[_0xb29f('0x12')][_0xb29f('0x10')]);}})[_0xb29f('0x13')](function(_0x1c6559){logger[_0xb29f('0xd')](_0xb29f('0xf'),_0x5cb8dc,_0x1c6559);_0x5a05d6(_0x1c6559);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 5bf5df5..ad5248d 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 _0xaa75=['util','connect-timeout','express','Router','fs-extra','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','run','/:id/query','query','post','delete','destroy','exports','multer'];(function(_0x53af5c,_0x4d4879){var _0x12c96f=function(_0x16ece5){while(--_0x16ece5){_0x53af5c['push'](_0x53af5c['shift']());}};_0x12c96f(++_0x4d4879);}(_0xaa75,0xb3));var _0x5aa7=function(_0x326ce2,_0x57b888){_0x326ce2=_0x326ce2-0x0;var _0x53c217=_0xaa75[_0x326ce2];return _0x53c217;};'use strict';var multer=require(_0x5aa7('0x0'));var util=require(_0x5aa7('0x1'));var path=require('path');var timeout=require(_0x5aa7('0x2'));var express=require(_0x5aa7('0x3'));var router=express[_0x5aa7('0x4')]();var fs_extra=require(_0x5aa7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5aa7('0x6'));router['get']('/',auth[_0x5aa7('0x7')](),controller[_0x5aa7('0x8')]);router[_0x5aa7('0x9')](_0x5aa7('0xa'),auth[_0x5aa7('0x7')](),controller[_0x5aa7('0xb')]);router[_0x5aa7('0x9')](_0x5aa7('0xc'),auth[_0x5aa7('0x7')](),controller['preview']);router['get']('/:id/run',auth[_0x5aa7('0x7')](),controller[_0x5aa7('0xd')]);router['get'](_0x5aa7('0xe'),auth[_0x5aa7('0x7')](),controller[_0x5aa7('0xf')]);router[_0x5aa7('0x10')]('/',auth[_0x5aa7('0x7')](),controller['create']);router['put']('/:id',auth[_0x5aa7('0x7')](),controller['update']);router[_0x5aa7('0x11')](_0x5aa7('0xa'),auth['isAuthenticated'](),controller[_0x5aa7('0x12')]);module[_0x5aa7('0x13')]=router;
\ No newline at end of file
+var _0xf421=['../../config/environment','isAuthenticated','index','get','show','/:id/preview','/:id/run','run','/:id/query','query','put','/:id','update','delete','multer','path','connect-timeout','express','Router'];(function(_0x3c9fbc,_0x47cae5){var _0x355ce9=function(_0x2af3f9){while(--_0x2af3f9){_0x3c9fbc['push'](_0x3c9fbc['shift']());}};_0x355ce9(++_0x47cae5);}(_0xf421,0x1b0));var _0x1f42=function(_0x50499c,_0x188984){_0x50499c=_0x50499c-0x0;var _0xd422b3=_0xf421[_0x50499c];return _0xd422b3;};'use strict';var multer=require(_0x1f42('0x0'));var util=require('util');var path=require(_0x1f42('0x1'));var timeout=require(_0x1f42('0x2'));var express=require(_0x1f42('0x3'));var router=express[_0x1f42('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1f42('0x5'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x1f42('0x6')](),controller[_0x1f42('0x7')]);router[_0x1f42('0x8')]('/:id',auth[_0x1f42('0x6')](),controller[_0x1f42('0x9')]);router['get'](_0x1f42('0xa'),auth[_0x1f42('0x6')](),controller['preview']);router['get'](_0x1f42('0xb'),auth[_0x1f42('0x6')](),controller[_0x1f42('0xc')]);router[_0x1f42('0x8')](_0x1f42('0xd'),auth[_0x1f42('0x6')](),controller[_0x1f42('0xe')]);router['post']('/',auth[_0x1f42('0x6')](),controller['create']);router[_0x1f42('0xf')](_0x1f42('0x10'),auth[_0x1f42('0x6')](),controller[_0x1f42('0x11')]);router[_0x1f42('0x12')](_0x1f42('0x10'),auth[_0x1f42('0x6')](),controller['destroy']);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 1782c5d..9b9588b 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x43b07c,_0x52f771){var _0x53b142=function(_0x5d3e5e){while(--_0x5d3e5e){_0x43b07c['push'](_0x43b07c['shift']());}};_0x53b142(++_0x52f771);}(_0x326f,0xd1));var _0xf326=function(_0x1aab34,_0x324732){_0x1aab34=_0x1aab34-0x0;var _0x12b2d8=_0x326f[_0x1aab34];return _0x12b2d8;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x358610,_0x36bc12){var _0x45594d=function(_0x19b149){while(--_0x19b149){_0x358610['push'](_0x358610['shift']());}};_0x45594d(++_0x36bc12);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5256474..1d67985 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x41f5ba,_0xd0ffa8){var _0x535e03=function(_0x7b8c37){while(--_0x7b8c37){_0x41f5ba['push'](_0x41f5ba['shift']());}};_0x535e03(++_0xd0ffa8);}(_0x4819,0xcd));var _0x9481=function(_0x117ab9,_0x45c7b6){_0x117ab9=_0x117ab9-0x0;var _0x258a48=_0x4819[_0x117ab9];return _0x258a48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x126af7,_0x25fa06){var _0x25b500=function(_0x10ffe7){while(--_0x10ffe7){_0x126af7['push'](_0x126af7['shift']());}};_0x25b500(++_0x25fa06);}(_0x7a54,0x106));var _0x47a5=function(_0x559536,_0x39afd8){_0x559536=_0x559536-0x0;var _0x1632ee=_0x7a54[_0x559536];return _0x1632ee;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5097078..817cc6e 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 _0xeebc=['analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x44bb10,_0x19d1ad){var _0x18f26a=function(_0x12b3be){while(--_0x12b3be){_0x44bb10['push'](_0x44bb10['shift']());}};_0x18f26a(++_0x19d1ad);}(_0xeebc,0x6d));var _0xceeb=function(_0xab9e34,_0x41c35f){_0xab9e34=_0xab9e34-0x0;var _0x2ed9e0=_0xeebc[_0xab9e34];return _0x2ed9e0;};'use strict';var _=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var logger=require('../../config/logger')(_0xceeb('0x2'));var moment=require(_0xceeb('0x3'));var BPromise=require(_0xceeb('0x4'));var rp=require(_0xceeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xceeb('0x6'));var config=require(_0xceeb('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xceeb('0x8')]=function(_0x16bbe0,_0xe94df7){return _0x16bbe0[_0xceeb('0x9')](_0xceeb('0xa'),attributes,{'tableName':_0xceeb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeac7=['analytics_default_reports','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x582737,_0x56cd7a){var _0x514b49=function(_0x404d40){while(--_0x404d40){_0x582737['push'](_0x582737['shift']());}};_0x514b49(++_0x56cd7a);}(_0xeac7,0x6d));var _0x7eac=function(_0x391634,_0x2ab03a){_0x391634=_0x391634-0x0;var _0x58a6f1=_0xeac7[_0x391634];return _0x58a6f1;};'use strict';var _=require(_0x7eac('0x0'));var util=require(_0x7eac('0x1'));var logger=require(_0x7eac('0x2'))('api');var moment=require(_0x7eac('0x3'));var BPromise=require('bluebird');var rp=require(_0x7eac('0x4'));var fs=require('fs');var path=require(_0x7eac('0x5'));var rimraf=require(_0x7eac('0x6'));var config=require(_0x7eac('0x7'));var attributes=require(_0x7eac('0x8'));module['exports']=function(_0x128b80,_0x1b3213){return _0x128b80[_0x7eac('0x9')](_0x7eac('0xa'),attributes,{'tableName':_0x7eac('0xb'),'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 473586a..f4dcded 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 _0xfe12=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfe12,0x1d8));var _0x2fe1=function(_0x18df6a,_0x3938b6){_0x18df6a=_0x18df6a-0x0;var _0x3b154d=_0xfe12[_0x18df6a];return _0x3b154d;};'use strict';var _=require('lodash');var util=require(_0x2fe1('0x0'));var moment=require(_0x2fe1('0x1'));var BPromise=require(_0x2fe1('0x2'));var rs=require(_0x2fe1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fe1('0x4'))['db'];var utils=require(_0x2fe1('0x5'));var logger=require(_0x2fe1('0x6'))(_0x2fe1('0x7'));var config=require('../../config/environment');var jayson=require(_0x2fe1('0x8'));var client=jayson[_0x2fe1('0x9')][_0x2fe1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x435082,_0x2ba712,_0x2cb8f7){return new BPromise(function(_0xcc445d,_0x56df09){return client[_0x2fe1('0xb')](_0x435082,_0x2cb8f7)[_0x2fe1('0xc')](function(_0x5e78b6){logger[_0x2fe1('0xd')](_0x2fe1('0xe'),_0x2ba712,_0x2fe1('0xf'));logger[_0x2fe1('0x10')](_0x2fe1('0x11'),_0x2ba712,_0x2fe1('0xf'),JSON[_0x2fe1('0x12')](_0x5e78b6));if(_0x5e78b6[_0x2fe1('0x13')]){if(_0x5e78b6[_0x2fe1('0x13')][_0x2fe1('0x14')]===0x1f4){logger[_0x2fe1('0x13')](_0x2fe1('0xe'),_0x2ba712,_0x5e78b6['error'][_0x2fe1('0x15')]);return _0x56df09(_0x5e78b6[_0x2fe1('0x13')][_0x2fe1('0x15')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2ba712,_0x5e78b6[_0x2fe1('0x13')][_0x2fe1('0x15')]);return _0xcc445d(_0x5e78b6['error']['message']);}else{logger[_0x2fe1('0xd')](_0x2fe1('0xe'),_0x2ba712,'request\x20sent');_0xcc445d(_0x5e78b6[_0x2fe1('0x16')][_0x2fe1('0x15')]);}})[_0x2fe1('0x17')](function(_0x3672fb){logger[_0x2fe1('0x13')](_0x2fe1('0xe'),_0x2ba712,_0x3672fb);_0x56df09(_0x3672fb);});});}
\ No newline at end of file
+var _0x5e6d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash'];(function(_0x26b0c8,_0x43b8bc){var _0x15135b=function(_0x64c08){while(--_0x64c08){_0x26b0c8['push'](_0x26b0c8['shift']());}};_0x15135b(++_0x43b8bc);}(_0x5e6d,0x1a3));var _0xd5e6=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x5e6d[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0xd5e6('0x0'));var util=require(_0xd5e6('0x1'));var moment=require(_0xd5e6('0x2'));var BPromise=require(_0xd5e6('0x3'));var rs=require(_0xd5e6('0x4'));var fs=require('fs');var Redis=require(_0xd5e6('0x5'));var db=require(_0xd5e6('0x6'))['db'];var utils=require(_0xd5e6('0x7'));var logger=require(_0xd5e6('0x8'))(_0xd5e6('0x9'));var config=require(_0xd5e6('0xa'));var jayson=require(_0xd5e6('0xb'));var client=jayson[_0xd5e6('0xc')][_0xd5e6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2095c1,_0x42860b,_0x4ca4b9){return new BPromise(function(_0x3d1160,_0x32024f){return client['request'](_0x2095c1,_0x4ca4b9)['then'](function(_0x33b998){logger[_0xd5e6('0xe')](_0xd5e6('0xf'),_0x42860b,_0xd5e6('0x10'));logger[_0xd5e6('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x42860b,_0xd5e6('0x10'),JSON['stringify'](_0x33b998));if(_0x33b998[_0xd5e6('0x12')]){if(_0x33b998[_0xd5e6('0x12')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x42860b,_0x33b998[_0xd5e6('0x12')]['message']);return _0x32024f(_0x33b998['error'][_0xd5e6('0x13')]);}logger[_0xd5e6('0x12')](_0xd5e6('0xf'),_0x42860b,_0x33b998[_0xd5e6('0x12')][_0xd5e6('0x13')]);return _0x3d1160(_0x33b998[_0xd5e6('0x12')][_0xd5e6('0x13')]);}else{logger['info'](_0xd5e6('0xf'),_0x42860b,'request\x20sent');_0x3d1160(_0x33b998['result'][_0xd5e6('0x13')]);}})[_0xd5e6('0x14')](function(_0x4a4699){logger[_0xd5e6('0x12')](_0xd5e6('0xf'),_0x42860b,_0x4a4699);_0x32024f(_0x4a4699);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a1470f6..ab81644 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 _0x78e7=['run','/:id/query','query','create','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x306368,_0x2fc5e4){var _0x294718=function(_0x4445ba){while(--_0x4445ba){_0x306368['push'](_0x306368['shift']());}};_0x294718(++_0x2fc5e4);}(_0x78e7,0x17d));var _0x778e=function(_0x5f20ae,_0x2463cf){_0x5f20ae=_0x5f20ae-0x0;var _0x314ecd=_0x78e7[_0x5f20ae];return _0x314ecd;};'use strict';var multer=require('multer');var util=require(_0x778e('0x0'));var path=require(_0x778e('0x1'));var timeout=require('connect-timeout');var express=require(_0x778e('0x2'));var router=express['Router']();var fs_extra=require(_0x778e('0x3'));var auth=require(_0x778e('0x4'));var interaction=require(_0x778e('0x5'));var config=require(_0x778e('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x778e('0x7')]('/',auth[_0x778e('0x8')](),controller[_0x778e('0x9')]);router[_0x778e('0x7')](_0x778e('0xa'),auth[_0x778e('0x8')](),controller[_0x778e('0xb')]);router['get'](_0x778e('0xc'),auth[_0x778e('0x8')](),controller[_0x778e('0xd')]);router[_0x778e('0x7')](_0x778e('0xe'),auth[_0x778e('0x8')](),controller[_0x778e('0xf')]);router[_0x778e('0x7')](_0x778e('0x10'),auth[_0x778e('0x8')](),controller[_0x778e('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x778e('0x12')]);router['put'](_0x778e('0xa'),auth['isAuthenticated'](),controller[_0x778e('0x13')]);router[_0x778e('0x14')](_0x778e('0xa'),auth['isAuthenticated'](),controller[_0x778e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xbc71=['express','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/run','run','/:id/query','post','put','update','delete','multer','path'];(function(_0x398527,_0x4867a5){var _0x310998=function(_0x5e9394){while(--_0x5e9394){_0x398527['push'](_0x398527['shift']());}};_0x310998(++_0x4867a5);}(_0xbc71,0x86));var _0x1bc7=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xbc71[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x1bc7('0x0'));var util=require('util');var path=require(_0x1bc7('0x1'));var timeout=require('connect-timeout');var express=require(_0x1bc7('0x2'));var router=express['Router']();var fs_extra=require(_0x1bc7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1bc7('0x4'));var controller=require(_0x1bc7('0x5'));router[_0x1bc7('0x6')]('/',auth['isAuthenticated'](),controller[_0x1bc7('0x7')]);router[_0x1bc7('0x6')](_0x1bc7('0x8'),auth[_0x1bc7('0x9')](),controller['show']);router[_0x1bc7('0x6')]('/:id/preview',auth[_0x1bc7('0x9')](),controller['preview']);router[_0x1bc7('0x6')](_0x1bc7('0xa'),auth['isAuthenticated'](),controller[_0x1bc7('0xb')]);router[_0x1bc7('0x6')](_0x1bc7('0xc'),auth[_0x1bc7('0x9')](),controller['query']);router[_0x1bc7('0xd')]('/',auth[_0x1bc7('0x9')](),controller['create']);router[_0x1bc7('0xe')](_0x1bc7('0x8'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0xf')]);router[_0x1bc7('0x10')]('/:id',auth[_0x1bc7('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ecddd9f..37d5fe5 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 _0xf99e=['Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','ENUM','pdf','STRING','DATE'];(function(_0x5e67be,_0x271ac8){var _0x45c259=function(_0x5eb9d7){while(--_0x5eb9d7){_0x5e67be['push'](_0x5e67be['shift']());}};_0x45c259(++_0x271ac8);}(_0xf99e,0x67));var _0xef99=function(_0x307d2b,_0x3796e0){_0x307d2b=_0x307d2b-0x0;var _0xe82587=_0xf99e[_0x307d2b];return _0xe82587;};'use strict';var Sequelize=require(_0xef99('0x0'));var moment=require(_0xef99('0x1'));module[_0xef99('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xef99('0x3')]('csv',_0xef99('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xef99('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0xef99('0x6')]},'endDate':{'type':Sequelize[_0xef99('0x6')]},'status':{'type':Sequelize[_0xef99('0x5')],'defaultValue':_0xef99('0x7')},'type':{'type':Sequelize[_0xef99('0x3')](_0xef99('0x8'),_0xef99('0x9')),'allowNull':![],'defaultValue':_0xef99('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xef99('0xa')]},'reportType':{'type':Sequelize[_0xef99('0x5')]}};
\ No newline at end of file
+var _0x017c=['xlsx','DATE','Loading','ENUM','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','csv','pdf'];(function(_0x585d0b,_0x3a692a){var _0x25d2ec=function(_0x5412a0){while(--_0x5412a0){_0x585d0b['push'](_0x585d0b['shift']());}};_0x25d2ec(++_0x3a692a);}(_0x017c,0x127));var _0xc017=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x017c[_0x113e32];return _0x4ff939;};'use strict';var Sequelize=require(_0xc017('0x0'));var moment=require(_0xc017('0x1'));module['exports']={'name':{'type':Sequelize[_0xc017('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xc017('0x3'),_0xc017('0x4'),_0xc017('0x5')),'allowNull':![],'defaultValue':_0xc017('0x3')},'savename':{'type':Sequelize[_0xc017('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc017('0x6')]},'endDate':{'type':Sequelize[_0xc017('0x6')]},'status':{'type':Sequelize[_0xc017('0x2')],'defaultValue':_0xc017('0x7')},'type':{'type':Sequelize[_0xc017('0x8')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xc017('0x9')},'reportId':{'type':Sequelize[_0xc017('0xa')](0xb)[_0xc017('0xb')]},'reportType':{'type':Sequelize[_0xc017('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 4a9eacb..313ae97 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 _0x4bd0=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','include','findAll','catch','show','params','keys','filters','includeAll','options','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','existsSync','join','root','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x498791,_0x55101b){var _0x1a79ce=function(_0x4d2571){while(--_0x4d2571){_0x498791['push'](_0x498791['shift']());}};_0x1a79ce(++_0x55101b);}(_0x4bd0,0x172));var _0x04bd=function(_0x169a8a,_0x3526b1){_0x169a8a=_0x169a8a-0x0;var _0x2e8502=_0x4bd0[_0x169a8a];return _0x2e8502;};'use strict';var emlformat=require(_0x04bd('0x0'));var rimraf=require(_0x04bd('0x1'));var zipdir=require(_0x04bd('0x2'));var jsonpatch=require(_0x04bd('0x3'));var rp=require(_0x04bd('0x4'));var moment=require(_0x04bd('0x5'));var BPromise=require(_0x04bd('0x6'));var Mustache=require(_0x04bd('0x7'));var util=require(_0x04bd('0x8'));var path=require(_0x04bd('0x9'));var sox=require(_0x04bd('0xa'));var csv=require(_0x04bd('0xb'));var ejs=require(_0x04bd('0xc'));var fs=require('fs');var fs_extra=require(_0x04bd('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x04bd('0xe'));var jsforce=require(_0x04bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x04bd('0xb'));var querystring=require(_0x04bd('0x10'));var Papa=require(_0x04bd('0x11'));var Redis=require(_0x04bd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x04bd('0x13'));var as=require(_0x04bd('0x14'));var hardwareService=require(_0x04bd('0x15'));var logger=require(_0x04bd('0x16'))(_0x04bd('0x17'));var utils=require('../../config/utils');var config=require(_0x04bd('0x18'));var licenseUtil=require(_0x04bd('0x19'));var db=require(_0x04bd('0x1a'))['db'];function respondWithStatusCode(_0x1e9140,_0x44e947){_0x44e947=_0x44e947||0xcc;return function(_0x425e70){if(_0x425e70){return _0x1e9140[_0x04bd('0x1b')](_0x44e947);}return _0x1e9140[_0x04bd('0x1c')](_0x44e947)[_0x04bd('0x1d')]();};}function respondWithResult(_0x4c05da,_0x189d1f){_0x189d1f=_0x189d1f||0xc8;return function(_0x2bfe5f){if(_0x2bfe5f){return _0x4c05da[_0x04bd('0x1c')](_0x189d1f)[_0x04bd('0x1e')](_0x2bfe5f);}};}function respondWithFilteredResult(_0x364687,_0x2fd626){return function(_0x5df0da){if(_0x5df0da){var _0x466a54=typeof _0x2fd626[_0x04bd('0x1f')]===_0x04bd('0x20')&&typeof _0x2fd626[_0x04bd('0x21')]==='undefined';var _0x394125=_0x5df0da[_0x04bd('0x22')];var _0x3e0bd3=_0x466a54?0x0:_0x2fd626[_0x04bd('0x1f')];var _0x4bc328=_0x466a54?_0x5df0da[_0x04bd('0x22')]:_0x2fd626['offset']+_0x2fd626[_0x04bd('0x21')];var _0x4b987e;if(_0x4bc328>=_0x394125){_0x4bc328=_0x394125;_0x4b987e=0xc8;}else{_0x4b987e=0xce;}_0x364687['status'](_0x4b987e);return _0x364687[_0x04bd('0x23')]('Content-Range',_0x3e0bd3+'-'+_0x4bc328+'/'+_0x394125)[_0x04bd('0x1e')](_0x5df0da);}return null;};}function patchUpdates(_0x63f762){return function(_0x16d191){try{jsonpatch['apply'](_0x16d191,_0x63f762,!![]);}catch(_0xac435e){return BPromise['reject'](_0xac435e);}return _0x16d191[_0x04bd('0x24')]();};}function saveUpdates(_0x19f8c0,_0x41749b){return function(_0x5a82a7){if(_0x5a82a7){return _0x5a82a7[_0x04bd('0x25')](_0x19f8c0)[_0x04bd('0x26')](function(_0x53938d){return _0x53938d;});}return null;};}function removeEntity(_0x1b13ea,_0x160f66){return function(_0x30fdc9){if(_0x30fdc9){return _0x30fdc9['destroy']()[_0x04bd('0x26')](function(){var _0xaca9e6=_0x30fdc9[_0x04bd('0x27')]({'plain':!![]});var _0x4f77ce=_0x04bd('0x28');return db[_0x04bd('0x29')][_0x04bd('0x2a')]({'where':{'type':_0x4f77ce,'resourceId':_0xaca9e6['id']}})[_0x04bd('0x26')](function(){return _0x30fdc9;});})[_0x04bd('0x26')](function(){_0x1b13ea[_0x04bd('0x1c')](0xcc)[_0x04bd('0x1d')]();});}};}function handleEntityNotFound(_0x5491b5,_0x40e3df){return function(_0x4dea72){if(!_0x4dea72){_0x5491b5[_0x04bd('0x1b')](0x194);}return _0x4dea72;};}function handleError(_0xbb5381,_0x53e7c0){_0x53e7c0=_0x53e7c0||0x1f4;return function(_0x2a8c75){logger[_0x04bd('0x2b')](_0x2a8c75[_0x04bd('0x2c')]);if(_0x2a8c75[_0x04bd('0x2d')]){delete _0x2a8c75[_0x04bd('0x2d')];}_0xbb5381['status'](_0x53e7c0)[_0x04bd('0x2e')](_0x2a8c75);};}exports[_0x04bd('0x2f')]=function(_0x20a4ff,_0x546029){var _0x43de2f={},_0x1888e8={},_0xe2c9c={'count':0x0,'rows':[]};var _0xa741dd=_[_0x04bd('0x30')](db[_0x04bd('0x31')][_0x04bd('0x32')],function(_0x5fcc6d){return{'name':_0x5fcc6d[_0x04bd('0x33')],'type':_0x5fcc6d[_0x04bd('0x34')][_0x04bd('0x35')]};});_0x1888e8[_0x04bd('0x36')]=_[_0x04bd('0x30')](_0xa741dd,_0x04bd('0x2d'));_0x1888e8[_0x04bd('0x37')]=_['keys'](_0x20a4ff[_0x04bd('0x37')]);_0x1888e8['filters']=_[_0x04bd('0x38')](_0x1888e8[_0x04bd('0x36')],_0x1888e8[_0x04bd('0x37')]);_0x43de2f['attributes']=_[_0x04bd('0x38')](_0x1888e8[_0x04bd('0x36')],qs['fields'](_0x20a4ff[_0x04bd('0x37')][_0x04bd('0x39')]));_0x43de2f[_0x04bd('0x3a')]=_0x43de2f[_0x04bd('0x3a')][_0x04bd('0x3b')]?_0x43de2f[_0x04bd('0x3a')]:_0x1888e8['model'];if(!_0x20a4ff[_0x04bd('0x37')]['hasOwnProperty'](_0x04bd('0x3c'))){_0x43de2f[_0x04bd('0x21')]=qs[_0x04bd('0x21')](_0x20a4ff[_0x04bd('0x37')]['limit']);_0x43de2f['offset']=qs['offset'](_0x20a4ff['query'][_0x04bd('0x1f')]);}_0x43de2f['order']=qs[_0x04bd('0x3d')](_0x20a4ff[_0x04bd('0x37')][_0x04bd('0x3d')]);_0x43de2f['where']=qs['filters'](_[_0x04bd('0x3e')](_0x20a4ff[_0x04bd('0x37')],_0x1888e8['filters']),_0xa741dd);if(_0x20a4ff['query'][_0x04bd('0x3f')]){_0x43de2f['where']=_[_0x04bd('0x40')](_0x43de2f[_0x04bd('0x41')],{'$or':_[_0x04bd('0x30')](_0xa741dd,function(_0x2e352a){if(_0x2e352a[_0x04bd('0x34')]!==_0x04bd('0x42')){var _0x141bca={};_0x141bca[_0x2e352a[_0x04bd('0x2d')]]={'$like':'%'+_0x20a4ff[_0x04bd('0x37')][_0x04bd('0x3f')]+'%'};return _0x141bca;}})});}_0x43de2f=_[_0x04bd('0x40')]({},_0x43de2f,_0x20a4ff['options']);var _0x38b2eb={'where':_0x43de2f[_0x04bd('0x41')]};return db[_0x04bd('0x31')][_0x04bd('0x22')](_0x38b2eb)['then'](function(_0x180e19){_0xe2c9c[_0x04bd('0x22')]=_0x180e19;if(_0x20a4ff[_0x04bd('0x37')]['includeAll']){_0x43de2f[_0x04bd('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x04bd('0x44')](_0x43de2f);})['then'](function(_0x47ac59){_0xe2c9c['rows']=_0x47ac59;return _0xe2c9c;})[_0x04bd('0x26')](respondWithFilteredResult(_0x546029,_0x43de2f))[_0x04bd('0x45')](handleError(_0x546029,null));};exports[_0x04bd('0x46')]=function(_0x40a2b9,_0x133b7b){var _0x4b4104={'raw':!![],'where':{'id':_0x40a2b9[_0x04bd('0x47')]['id']}},_0x154875={};_0x154875['model']=_[_0x04bd('0x48')](db['AnalyticExtractedReport']['rawAttributes']);_0x154875[_0x04bd('0x37')]=_[_0x04bd('0x48')](_0x40a2b9[_0x04bd('0x37')]);_0x154875[_0x04bd('0x49')]=_[_0x04bd('0x38')](_0x154875[_0x04bd('0x36')],_0x154875['query']);_0x4b4104['attributes']=_[_0x04bd('0x38')](_0x154875[_0x04bd('0x36')],qs[_0x04bd('0x39')](_0x40a2b9[_0x04bd('0x37')]['fields']));_0x4b4104[_0x04bd('0x3a')]=_0x4b4104[_0x04bd('0x3a')][_0x04bd('0x3b')]?_0x4b4104[_0x04bd('0x3a')]:_0x154875[_0x04bd('0x36')];if(_0x40a2b9['query'][_0x04bd('0x4a')]){_0x4b4104['include']=[{'all':!![]}];}_0x4b4104=_[_0x04bd('0x40')]({},_0x4b4104,_0x40a2b9[_0x04bd('0x4b')]);return db[_0x04bd('0x31')][_0x04bd('0x4c')](_0x4b4104)[_0x04bd('0x26')](handleEntityNotFound(_0x133b7b,null))['then'](respondWithResult(_0x133b7b,null))[_0x04bd('0x45')](handleError(_0x133b7b,null));};exports['create']=function(_0x32f673,_0x11e3f7){return db['AnalyticExtractedReport']['create'](_0x32f673[_0x04bd('0x4d')],{})[_0x04bd('0x26')](function(_0x177ee9){var _0x2a93b7=_0x32f673[_0x04bd('0x4e')][_0x04bd('0x27')]({'plain':!![]});if(!_0x2a93b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a93b7[_0x04bd('0x4f')]===_0x04bd('0x4e')){var _0x171a51=_0x177ee9[_0x04bd('0x27')]({'plain':!![]});var _0x4def66='ExtractedReports';return db[_0x04bd('0x50')][_0x04bd('0x4c')]({'where':{'name':_0x4def66,'userProfileId':_0x2a93b7[_0x04bd('0x51')]},'raw':!![]})[_0x04bd('0x26')](function(_0x126cfd){if(_0x126cfd&&_0x126cfd[_0x04bd('0x52')]===0x0){return db[_0x04bd('0x29')][_0x04bd('0x53')]({'name':_0x171a51[_0x04bd('0x2d')],'resourceId':_0x171a51['id'],'type':_0x126cfd[_0x04bd('0x2d')],'sectionId':_0x126cfd['id']},{})[_0x04bd('0x26')](function(){return _0x177ee9;});}else{return _0x177ee9;}})[_0x04bd('0x45')](function(_0x409d53){logger[_0x04bd('0x2b')](_0x04bd('0x54'),_0x409d53);throw _0x409d53;});}return _0x177ee9;})['then'](respondWithResult(_0x11e3f7,0xc9))['catch'](handleError(_0x11e3f7,null));};exports[_0x04bd('0x25')]=function(_0x43390a,_0x20a134){if(_0x43390a[_0x04bd('0x4d')]['id']){delete _0x43390a[_0x04bd('0x4d')]['id'];}return db[_0x04bd('0x31')][_0x04bd('0x4c')]({'where':{'id':_0x43390a['params']['id']}})[_0x04bd('0x26')](handleEntityNotFound(_0x20a134,null))[_0x04bd('0x26')](saveUpdates(_0x43390a[_0x04bd('0x4d')],null))['then'](respondWithResult(_0x20a134,null))[_0x04bd('0x45')](handleError(_0x20a134,null));};exports[_0x04bd('0x2a')]=function(_0x5b8a19,_0x57edb6){return db[_0x04bd('0x31')][_0x04bd('0x4c')]({'where':{'id':_0x5b8a19[_0x04bd('0x47')]['id']}})[_0x04bd('0x26')](handleEntityNotFound(_0x57edb6,null))[_0x04bd('0x26')](removeEntity(_0x57edb6,null))[_0x04bd('0x45')](handleError(_0x57edb6,null));};exports[_0x04bd('0x55')]=function(_0x3ee8b5,_0x2b061e,_0x1d3ad4){return db[_0x04bd('0x31')][_0x04bd('0x4c')]({'where':{'id':_0x3ee8b5[_0x04bd('0x47')]['id']},'attributes':[_0x04bd('0x2d'),_0x04bd('0x56'),'savename','output'],'raw':!![]})[_0x04bd('0x26')](handleEntityNotFound(_0x2b061e,null))[_0x04bd('0x26')](function(_0x17e54d){if(_0x17e54d){if(!fs[_0x04bd('0x57')](path[_0x04bd('0x58')](config[_0x04bd('0x59')],'server/files/reports',_0x17e54d[_0x04bd('0x5a')]))){throw new db['Sequelize'][(_0x04bd('0x5b'))](_0x04bd('0x5c'));}if(_0x3ee8b5[_0x04bd('0x37')][_0x04bd('0x5d')]){return _0x2b061e[_0x04bd('0x1b')](0xc8);}return _0x2b061e['download'](path[_0x04bd('0x58')](config[_0x04bd('0x59')],_0x04bd('0x5e'),_0x17e54d[_0x04bd('0x5a')]),util[_0x04bd('0x5f')](_0x04bd('0x60'),_0x17e54d[_0x04bd('0x56')]||_0x17e54d[_0x04bd('0x2d')],_0x17e54d['output'][_0x04bd('0x61')]()));}})['catch'](handleError(_0x2b061e,null));};
\ No newline at end of file
+var _0x632e=['include','rows','catch','params','keys','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ExtractedReports','UserProfileSection','userProfileId','error','update','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll'];(function(_0x576fad,_0x42b670){var _0xf6604e=function(_0x479463){while(--_0x479463){_0x576fad['push'](_0x576fad['shift']());}};_0xf6604e(++_0x42b670);}(_0x632e,0x142));var _0xe632=function(_0x369534,_0x5557c4){_0x369534=_0x369534-0x0;var _0x524bf9=_0x632e[_0x369534];return _0x524bf9;};'use strict';var emlformat=require(_0xe632('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe632('0x1'));var jsonpatch=require(_0xe632('0x2'));var rp=require('request-promise');var moment=require(_0xe632('0x3'));var BPromise=require(_0xe632('0x4'));var Mustache=require(_0xe632('0x5'));var util=require(_0xe632('0x6'));var path=require(_0xe632('0x7'));var sox=require(_0xe632('0x8'));var csv=require(_0xe632('0x9'));var ejs=require(_0xe632('0xa'));var fs=require('fs');var fs_extra=require(_0xe632('0xb'));var _=require('lodash');var squel=require(_0xe632('0xc'));var crypto=require(_0xe632('0xd'));var jsforce=require(_0xe632('0xe'));var deskjs=require(_0xe632('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe632('0x10'));var Papa=require(_0xe632('0x11'));var Redis=require(_0xe632('0x12'));var authService=require(_0xe632('0x13'));var qs=require(_0xe632('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe632('0x15'));var logger=require(_0xe632('0x16'))(_0xe632('0x17'));var utils=require(_0xe632('0x18'));var config=require(_0xe632('0x19'));var licenseUtil=require(_0xe632('0x1a'));var db=require(_0xe632('0x1b'))['db'];function respondWithStatusCode(_0x4a643d,_0x462a8d){_0x462a8d=_0x462a8d||0xcc;return function(_0x1f4ed4){if(_0x1f4ed4){return _0x4a643d['sendStatus'](_0x462a8d);}return _0x4a643d[_0xe632('0x1c')](_0x462a8d)['end']();};}function respondWithResult(_0x510ad4,_0x33fe9a){_0x33fe9a=_0x33fe9a||0xc8;return function(_0x50307b){if(_0x50307b){return _0x510ad4[_0xe632('0x1c')](_0x33fe9a)[_0xe632('0x1d')](_0x50307b);}};}function respondWithFilteredResult(_0x14736f,_0x928715){return function(_0x301320){if(_0x301320){var _0x435071=typeof _0x928715[_0xe632('0x1e')]===_0xe632('0x1f')&&typeof _0x928715[_0xe632('0x20')]===_0xe632('0x1f');var _0x5888fe=_0x301320[_0xe632('0x21')];var _0x15a281=_0x435071?0x0:_0x928715[_0xe632('0x1e')];var _0x2cceb2=_0x435071?_0x301320[_0xe632('0x21')]:_0x928715[_0xe632('0x1e')]+_0x928715[_0xe632('0x20')];var _0x57eebc;if(_0x2cceb2>=_0x5888fe){_0x2cceb2=_0x5888fe;_0x57eebc=0xc8;}else{_0x57eebc=0xce;}_0x14736f['status'](_0x57eebc);return _0x14736f[_0xe632('0x22')](_0xe632('0x23'),_0x15a281+'-'+_0x2cceb2+'/'+_0x5888fe)['json'](_0x301320);}return null;};}function patchUpdates(_0x4426f0){return function(_0x350f72){try{jsonpatch[_0xe632('0x24')](_0x350f72,_0x4426f0,!![]);}catch(_0xd44823){return BPromise['reject'](_0xd44823);}return _0x350f72[_0xe632('0x25')]();};}function saveUpdates(_0x1b70af,_0xfbdcc6){return function(_0x1df51c){if(_0x1df51c){return _0x1df51c['update'](_0x1b70af)[_0xe632('0x26')](function(_0x4956bf){return _0x4956bf;});}return null;};}function removeEntity(_0x9da700,_0x545251){return function(_0x2122e7){if(_0x2122e7){return _0x2122e7[_0xe632('0x27')]()[_0xe632('0x26')](function(){var _0x524219=_0x2122e7['get']({'plain':!![]});var _0x277b60='ExtractedReports';return db['UserProfileResource'][_0xe632('0x27')]({'where':{'type':_0x277b60,'resourceId':_0x524219['id']}})['then'](function(){return _0x2122e7;});})['then'](function(){_0x9da700['status'](0xcc)[_0xe632('0x28')]();});}};}function handleEntityNotFound(_0xb971af,_0x289cac){return function(_0x2e75fa){if(!_0x2e75fa){_0xb971af[_0xe632('0x29')](0x194);}return _0x2e75fa;};}function handleError(_0x4059cd,_0x5a2996){_0x5a2996=_0x5a2996||0x1f4;return function(_0x1555e7){logger['error'](_0x1555e7[_0xe632('0x2a')]);if(_0x1555e7['name']){delete _0x1555e7[_0xe632('0x2b')];}_0x4059cd[_0xe632('0x1c')](_0x5a2996)[_0xe632('0x2c')](_0x1555e7);};}exports[_0xe632('0x2d')]=function(_0x2d2d53,_0x4e4380){var _0x423c49={},_0x545763={},_0x2d5e71={'count':0x0,'rows':[]};var _0x59ab2d=_[_0xe632('0x2e')](db[_0xe632('0x2f')][_0xe632('0x30')],function(_0x41d206){return{'name':_0x41d206['fieldName'],'type':_0x41d206[_0xe632('0x31')][_0xe632('0x32')]};});_0x545763[_0xe632('0x33')]=_[_0xe632('0x2e')](_0x59ab2d,_0xe632('0x2b'));_0x545763[_0xe632('0x34')]=_['keys'](_0x2d2d53[_0xe632('0x34')]);_0x545763[_0xe632('0x35')]=_[_0xe632('0x36')](_0x545763[_0xe632('0x33')],_0x545763[_0xe632('0x34')]);_0x423c49[_0xe632('0x37')]=_[_0xe632('0x36')](_0x545763[_0xe632('0x33')],qs[_0xe632('0x38')](_0x2d2d53[_0xe632('0x34')][_0xe632('0x38')]));_0x423c49[_0xe632('0x37')]=_0x423c49[_0xe632('0x37')][_0xe632('0x39')]?_0x423c49['attributes']:_0x545763[_0xe632('0x33')];if(!_0x2d2d53[_0xe632('0x34')]['hasOwnProperty'](_0xe632('0x3a'))){_0x423c49[_0xe632('0x20')]=qs['limit'](_0x2d2d53[_0xe632('0x34')]['limit']);_0x423c49[_0xe632('0x1e')]=qs['offset'](_0x2d2d53[_0xe632('0x34')][_0xe632('0x1e')]);}_0x423c49['order']=qs[_0xe632('0x3b')](_0x2d2d53[_0xe632('0x34')][_0xe632('0x3b')]);_0x423c49['where']=qs[_0xe632('0x35')](_[_0xe632('0x3c')](_0x2d2d53[_0xe632('0x34')],_0x545763[_0xe632('0x35')]),_0x59ab2d);if(_0x2d2d53[_0xe632('0x34')]['filter']){_0x423c49[_0xe632('0x3d')]=_[_0xe632('0x3e')](_0x423c49[_0xe632('0x3d')],{'$or':_['map'](_0x59ab2d,function(_0x570a47){if(_0x570a47[_0xe632('0x31')]!==_0xe632('0x3f')){var _0x57b687={};_0x57b687[_0x570a47['name']]={'$like':'%'+_0x2d2d53[_0xe632('0x34')][_0xe632('0x40')]+'%'};return _0x57b687;}})});}_0x423c49=_['merge']({},_0x423c49,_0x2d2d53['options']);var _0x50e9f1={'where':_0x423c49['where']};return db[_0xe632('0x2f')][_0xe632('0x21')](_0x50e9f1)[_0xe632('0x26')](function(_0x87e0bb){_0x2d5e71['count']=_0x87e0bb;if(_0x2d2d53[_0xe632('0x34')][_0xe632('0x41')]){_0x423c49[_0xe632('0x42')]=[{'all':!![]}];}return db[_0xe632('0x2f')]['findAll'](_0x423c49);})[_0xe632('0x26')](function(_0x5bc67f){_0x2d5e71[_0xe632('0x43')]=_0x5bc67f;return _0x2d5e71;})[_0xe632('0x26')](respondWithFilteredResult(_0x4e4380,_0x423c49))[_0xe632('0x44')](handleError(_0x4e4380,null));};exports['show']=function(_0x1bf386,_0x3a43a8){var _0x364be4={'raw':!![],'where':{'id':_0x1bf386[_0xe632('0x45')]['id']}},_0x390bf0={};_0x390bf0[_0xe632('0x33')]=_[_0xe632('0x46')](db[_0xe632('0x2f')]['rawAttributes']);_0x390bf0['query']=_[_0xe632('0x46')](_0x1bf386[_0xe632('0x34')]);_0x390bf0[_0xe632('0x35')]=_[_0xe632('0x36')](_0x390bf0['model'],_0x390bf0[_0xe632('0x34')]);_0x364be4[_0xe632('0x37')]=_['intersection'](_0x390bf0[_0xe632('0x33')],qs[_0xe632('0x38')](_0x1bf386['query'][_0xe632('0x38')]));_0x364be4[_0xe632('0x37')]=_0x364be4[_0xe632('0x37')][_0xe632('0x39')]?_0x364be4[_0xe632('0x37')]:_0x390bf0[_0xe632('0x33')];if(_0x1bf386[_0xe632('0x34')][_0xe632('0x41')]){_0x364be4['include']=[{'all':!![]}];}_0x364be4=_[_0xe632('0x3e')]({},_0x364be4,_0x1bf386[_0xe632('0x47')]);return db['AnalyticExtractedReport'][_0xe632('0x48')](_0x364be4)[_0xe632('0x26')](handleEntityNotFound(_0x3a43a8,null))[_0xe632('0x26')](respondWithResult(_0x3a43a8,null))[_0xe632('0x44')](handleError(_0x3a43a8,null));};exports[_0xe632('0x49')]=function(_0x5134ca,_0x19e725){return db[_0xe632('0x2f')]['create'](_0x5134ca[_0xe632('0x4a')],{})['then'](function(_0x37b652){var _0x27041a=_0x5134ca['user']['get']({'plain':!![]});if(!_0x27041a)throw new Error(_0xe632('0x4b'));if(_0x27041a[_0xe632('0x4c')]==='user'){var _0x14d734=_0x37b652[_0xe632('0x4d')]({'plain':!![]});var _0x43be2f=_0xe632('0x4e');return db[_0xe632('0x4f')][_0xe632('0x48')]({'where':{'name':_0x43be2f,'userProfileId':_0x27041a[_0xe632('0x50')]},'raw':!![]})[_0xe632('0x26')](function(_0x1bd78d){if(_0x1bd78d&&_0x1bd78d['autoAssociation']===0x0){return db['UserProfileResource'][_0xe632('0x49')]({'name':_0x14d734[_0xe632('0x2b')],'resourceId':_0x14d734['id'],'type':_0x1bd78d[_0xe632('0x2b')],'sectionId':_0x1bd78d['id']},{})[_0xe632('0x26')](function(){return _0x37b652;});}else{return _0x37b652;}})['catch'](function(_0x122901){logger[_0xe632('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x122901);throw _0x122901;});}return _0x37b652;})[_0xe632('0x26')](respondWithResult(_0x19e725,0xc9))[_0xe632('0x44')](handleError(_0x19e725,null));};exports[_0xe632('0x52')]=function(_0x58a4cd,_0x16a160){if(_0x58a4cd[_0xe632('0x4a')]['id']){delete _0x58a4cd[_0xe632('0x4a')]['id'];}return db[_0xe632('0x2f')]['find']({'where':{'id':_0x58a4cd['params']['id']}})['then'](handleEntityNotFound(_0x16a160,null))[_0xe632('0x26')](saveUpdates(_0x58a4cd['body'],null))[_0xe632('0x26')](respondWithResult(_0x16a160,null))[_0xe632('0x44')](handleError(_0x16a160,null));};exports[_0xe632('0x27')]=function(_0x2ccfa0,_0x13bb6c){return db['AnalyticExtractedReport'][_0xe632('0x48')]({'where':{'id':_0x2ccfa0[_0xe632('0x45')]['id']}})[_0xe632('0x26')](handleEntityNotFound(_0x13bb6c,null))[_0xe632('0x26')](removeEntity(_0x13bb6c,null))[_0xe632('0x44')](handleError(_0x13bb6c,null));};exports[_0xe632('0x53')]=function(_0xe4496f,_0x3549d4,_0x7eb6fd){return db[_0xe632('0x2f')][_0xe632('0x48')]({'where':{'id':_0xe4496f['params']['id']},'attributes':[_0xe632('0x2b'),'basename',_0xe632('0x54'),_0xe632('0x55')],'raw':!![]})[_0xe632('0x26')](handleEntityNotFound(_0x3549d4,null))[_0xe632('0x26')](function(_0x4c9110){if(_0x4c9110){if(!fs[_0xe632('0x56')](path[_0xe632('0x57')](config[_0xe632('0x58')],_0xe632('0x59'),_0x4c9110['savename']))){throw new db[(_0xe632('0x5a'))]['ValidationError'](_0xe632('0x5b'));}if(_0xe4496f[_0xe632('0x34')][_0xe632('0x5c')]){return _0x3549d4[_0xe632('0x29')](0xc8);}return _0x3549d4[_0xe632('0x53')](path[_0xe632('0x57')](config[_0xe632('0x58')],_0xe632('0x59'),_0x4c9110[_0xe632('0x54')]),util[_0xe632('0x5d')](_0xe632('0x5e'),_0x4c9110[_0xe632('0x5f')]||_0x4c9110['name'],_0x4c9110[_0xe632('0x55')][_0xe632('0x60')]()));}})['catch'](handleError(_0x3549d4,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 5a396bd..3c74c3e 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 _0x7840=['exports','analytics_extracted_reports','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x7840,0xb6));var _0x0784=function(_0x598596,_0x3cec09){_0x598596=_0x598596-0x0;var _0x509ff1=_0x7840[_0x598596];return _0x509ff1;};'use strict';var _=require(_0x0784('0x0'));var util=require(_0x0784('0x1'));var logger=require(_0x0784('0x2'))('api');var moment=require(_0x0784('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0784('0x4'));var rimraf=require(_0x0784('0x5'));var config=require(_0x0784('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x0784('0x7')]=function(_0x2ab8c5,_0x5e947b){return _0x2ab8c5['define']('AnalyticExtractedReport',attributes,{'tableName':_0x0784('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d2f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0x5d2f,0x168));var _0xf5d2=function(_0x5e9d1f,_0x37c578){_0x5e9d1f=_0x5e9d1f-0x0;var _0x895bea=_0x5d2f[_0x5e9d1f];return _0x895bea;};'use strict';var _=require(_0xf5d2('0x0'));var util=require(_0xf5d2('0x1'));var logger=require(_0xf5d2('0x2'))(_0xf5d2('0x3'));var moment=require(_0xf5d2('0x4'));var BPromise=require(_0xf5d2('0x5'));var rp=require(_0xf5d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5d2('0x7'));var config=require(_0xf5d2('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf5d2('0x9')]=function(_0x5ab8b5,_0x22c1f9){return _0x5ab8b5['define'](_0xf5d2('0xa'),attributes,{'tableName':_0xf5d2('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 9c7b45b..769f3e8 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 _0x463e=['client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x463e,0x87));var _0xe463=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x463e[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xe463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe463('0x1'));var rs=require(_0xe463('0x2'));var fs=require('fs');var Redis=require(_0xe463('0x3'));var db=require(_0xe463('0x4'))['db'];var utils=require(_0xe463('0x5'));var logger=require(_0xe463('0x6'))(_0xe463('0x7'));var config=require(_0xe463('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe463('0x9')][_0xe463('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37cc01,_0x455477,_0x1f2e5b){return new BPromise(function(_0x34e71e,_0x38a66d){return client[_0xe463('0xb')](_0x37cc01,_0x1f2e5b)[_0xe463('0xc')](function(_0x5d7f3d){logger[_0xe463('0xd')](_0xe463('0xe'),_0x455477,_0xe463('0xf'));logger[_0xe463('0x10')](_0xe463('0x11'),_0x455477,_0xe463('0xf'),JSON[_0xe463('0x12')](_0x5d7f3d));if(_0x5d7f3d['error']){if(_0x5d7f3d[_0xe463('0x13')][_0xe463('0x14')]===0x1f4){logger[_0xe463('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x455477,_0x5d7f3d[_0xe463('0x13')]['message']);return _0x38a66d(_0x5d7f3d[_0xe463('0x13')]['message']);}logger[_0xe463('0x13')](_0xe463('0xe'),_0x455477,_0x5d7f3d[_0xe463('0x13')][_0xe463('0x15')]);return _0x34e71e(_0x5d7f3d[_0xe463('0x13')][_0xe463('0x15')]);}else{logger[_0xe463('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x455477,_0xe463('0xf'));_0x34e71e(_0x5d7f3d[_0xe463('0x16')]['message']);}})[_0xe463('0x17')](function(_0x1eaa50){logger[_0xe463('0x13')](_0xe463('0xe'),_0x455477,_0x1eaa50);_0x38a66d(_0x1eaa50);});});}
\ No newline at end of file
+var _0x55af=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then'];(function(_0x5a3a81,_0x5e862f){var _0x59f7fa=function(_0x445a70){while(--_0x445a70){_0x5a3a81['push'](_0x5a3a81['shift']());}};_0x59f7fa(++_0x5e862f);}(_0x55af,0x1ab));var _0xf55a=function(_0x592239,_0x582549){_0x592239=_0x592239-0x0;var _0x434b8c=_0x55af[_0x592239];return _0x434b8c;};'use strict';var _=require(_0xf55a('0x0'));var util=require(_0xf55a('0x1'));var moment=require(_0xf55a('0x2'));var BPromise=require(_0xf55a('0x3'));var rs=require(_0xf55a('0x4'));var fs=require('fs');var Redis=require(_0xf55a('0x5'));var db=require(_0xf55a('0x6'))['db'];var utils=require(_0xf55a('0x7'));var logger=require(_0xf55a('0x8'))(_0xf55a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf55a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe7e23d,_0x997482,_0x2f9d8e){return new BPromise(function(_0x295293,_0x306f2e){return client[_0xf55a('0xb')](_0xe7e23d,_0x2f9d8e)[_0xf55a('0xc')](function(_0x41a041){logger[_0xf55a('0xd')](_0xf55a('0xe'),_0x997482,_0xf55a('0xf'));logger[_0xf55a('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x997482,_0xf55a('0xf'),JSON['stringify'](_0x41a041));if(_0x41a041[_0xf55a('0x11')]){if(_0x41a041[_0xf55a('0x11')][_0xf55a('0x12')]===0x1f4){logger[_0xf55a('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x997482,_0x41a041[_0xf55a('0x11')][_0xf55a('0x13')]);return _0x306f2e(_0x41a041[_0xf55a('0x11')][_0xf55a('0x13')]);}logger['error'](_0xf55a('0xe'),_0x997482,_0x41a041[_0xf55a('0x11')][_0xf55a('0x13')]);return _0x295293(_0x41a041[_0xf55a('0x11')][_0xf55a('0x13')]);}else{logger['info'](_0xf55a('0xe'),_0x997482,_0xf55a('0xf'));_0x295293(_0x41a041[_0xf55a('0x14')][_0xf55a('0x13')]);}})[_0xf55a('0x15')](function(_0x18aa9b){logger[_0xf55a('0x11')](_0xf55a('0xe'),_0x997482,_0x18aa9b);_0x306f2e(_0x18aa9b);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 065b3e7..0629347 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 _0x4283=['isAuthenticated','index','/:id','show','/:id/download','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4283,0x131));var _0x3428=function(_0x533c6f,_0x338d51){_0x533c6f=_0x533c6f-0x0;var _0x4f3926=_0x4283[_0x533c6f];return _0x4f3926;};'use strict';var multer=require('multer');var util=require(_0x3428('0x0'));var path=require(_0x3428('0x1'));var timeout=require(_0x3428('0x2'));var express=require(_0x3428('0x3'));var router=express['Router']();var fs_extra=require(_0x3428('0x4'));var auth=require(_0x3428('0x5'));var interaction=require(_0x3428('0x6'));var config=require(_0x3428('0x7'));var controller=require(_0x3428('0x8'));router[_0x3428('0x9')]('/',auth[_0x3428('0xa')](),controller[_0x3428('0xb')]);router[_0x3428('0x9')](_0x3428('0xc'),auth[_0x3428('0xa')](),controller[_0x3428('0xd')]);router['get'](_0x3428('0xe'),auth[_0x3428('0xa')](),controller['download']);router[_0x3428('0xf')]('/',auth[_0x3428('0xa')](),controller[_0x3428('0x10')]);router['put'](_0x3428('0xc'),auth[_0x3428('0xa')](),controller[_0x3428('0x11')]);router[_0x3428('0x12')](_0x3428('0xc'),auth['isAuthenticated'](),controller[_0x3428('0x13')]);module[_0x3428('0x14')]=router;
\ No newline at end of file
+var _0x93a0=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','post','/:id','update'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x93a0,0x1aa));var _0x093a=function(_0x268cc1,_0x42368b){_0x268cc1=_0x268cc1-0x0;var _0x121299=_0x93a0[_0x268cc1];return _0x121299;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x093a('0x0'));var timeout=require(_0x093a('0x1'));var express=require(_0x093a('0x2'));var router=express['Router']();var fs_extra=require(_0x093a('0x3'));var auth=require(_0x093a('0x4'));var interaction=require(_0x093a('0x5'));var config=require(_0x093a('0x6'));var controller=require(_0x093a('0x7'));router[_0x093a('0x8')]('/',auth[_0x093a('0x9')](),controller[_0x093a('0xa')]);router[_0x093a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x093a('0xb')]);router[_0x093a('0x8')](_0x093a('0xc'),auth[_0x093a('0x9')](),controller['download']);router[_0x093a('0xd')]('/',auth[_0x093a('0x9')](),controller['create']);router['put'](_0x093a('0xe'),auth['isAuthenticated'](),controller[_0x093a('0xf')]);router['delete'](_0x093a('0xe'),auth[_0x093a('0x9')](),controller['destroy']);module[_0x093a('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1bbb443..1bf56ab 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 _0x7574=['exports','STRING','BOOLEAN'];(function(_0x17714e,_0x41c46f){var _0x65d270=function(_0x1e4b43){while(--_0x1e4b43){_0x17714e['push'](_0x17714e['shift']());}};_0x65d270(++_0x41c46f);}(_0x7574,0xab));var _0x4757=function(_0x30ae49,_0x1a0dd0){_0x30ae49=_0x30ae49-0x0;var _0x1bf02c=_0x7574[_0x30ae49];return _0x1bf02c;};'use strict';var Sequelize=require('sequelize');module[_0x4757('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x4757('0x1')]},'function':{'type':Sequelize[_0x4757('0x1')]},'format':{'type':Sequelize[_0x4757('0x1')]},'groupBy':{'type':Sequelize[_0x4757('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4757('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4ff4=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x566e25,_0x3a602d){var _0x494556=function(_0x2a5183){while(--_0x2a5183){_0x566e25['push'](_0x566e25['shift']());}};_0x494556(++_0x3a602d);}(_0x4ff4,0x17d));var _0x44ff=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x4ff4[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0x44ff('0x0'));module['exports']={'field':{'type':Sequelize[_0x44ff('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x44ff('0x2')]},'format':{'type':Sequelize[_0x44ff('0x2')]},'groupBy':{'type':Sequelize[_0x44ff('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x44ff('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 b3141b7..6068114 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 _0x9d98=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','bulkCreate','body','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x20b9f0,_0xeb34e1){var _0x405e13=function(_0x5dbad8){while(--_0x5dbad8){_0x20b9f0['push'](_0x20b9f0['shift']());}};_0x405e13(++_0xeb34e1);}(_0x9d98,0xf0));var _0x89d9=function(_0x21c683,_0x187b2b){_0x21c683=_0x21c683-0x0;var _0x59f136=_0x9d98[_0x21c683];return _0x59f136;};'use strict';var emlformat=require(_0x89d9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x89d9('0x1'));var rp=require(_0x89d9('0x2'));var moment=require('moment');var BPromise=require(_0x89d9('0x3'));var Mustache=require(_0x89d9('0x4'));var util=require('util');var path=require(_0x89d9('0x5'));var sox=require(_0x89d9('0x6'));var csv=require(_0x89d9('0x7'));var ejs=require(_0x89d9('0x8'));var fs=require('fs');var fs_extra=require(_0x89d9('0x9'));var _=require(_0x89d9('0xa'));var squel=require(_0x89d9('0xb'));var crypto=require(_0x89d9('0xc'));var jsforce=require(_0x89d9('0xd'));var deskjs=require(_0x89d9('0xe'));var toCsv=require(_0x89d9('0x7'));var querystring=require(_0x89d9('0xf'));var Papa=require('papaparse');var Redis=require(_0x89d9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x89d9('0x11'));var as=require(_0x89d9('0x12'));var hardwareService=require(_0x89d9('0x13'));var logger=require(_0x89d9('0x14'))(_0x89d9('0x15'));var utils=require(_0x89d9('0x16'));var config=require(_0x89d9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x89d9('0x18'))['db'];function respondWithStatusCode(_0x4bd6d9,_0x1e1f27){_0x1e1f27=_0x1e1f27||0xcc;return function(_0x9359ef){if(_0x9359ef){return _0x4bd6d9[_0x89d9('0x19')](_0x1e1f27);}return _0x4bd6d9[_0x89d9('0x1a')](_0x1e1f27)[_0x89d9('0x1b')]();};}function respondWithResult(_0x4f06fa,_0x52fc0a){_0x52fc0a=_0x52fc0a||0xc8;return function(_0x3a4d42){if(_0x3a4d42){return _0x4f06fa[_0x89d9('0x1a')](_0x52fc0a)['json'](_0x3a4d42);}};}function respondWithFilteredResult(_0x2aaa3c,_0x584852){return function(_0x5b4a8e){if(_0x5b4a8e){var _0x33cd2b=typeof _0x584852[_0x89d9('0x1c')]===_0x89d9('0x1d')&&typeof _0x584852['limit']==='undefined';var _0x12c84c=_0x5b4a8e[_0x89d9('0x1e')];var _0x2d7170=_0x33cd2b?0x0:_0x584852[_0x89d9('0x1c')];var _0x4f181f=_0x33cd2b?_0x5b4a8e[_0x89d9('0x1e')]:_0x584852[_0x89d9('0x1c')]+_0x584852[_0x89d9('0x1f')];var _0x40ce02;if(_0x4f181f>=_0x12c84c){_0x4f181f=_0x12c84c;_0x40ce02=0xc8;}else{_0x40ce02=0xce;}_0x2aaa3c[_0x89d9('0x1a')](_0x40ce02);return _0x2aaa3c['set']('Content-Range',_0x2d7170+'-'+_0x4f181f+'/'+_0x12c84c)[_0x89d9('0x20')](_0x5b4a8e);}return null;};}function patchUpdates(_0x1a2ffe){return function(_0x1c6715){try{jsonpatch['apply'](_0x1c6715,_0x1a2ffe,!![]);}catch(_0x57211f){return BPromise[_0x89d9('0x21')](_0x57211f);}return _0x1c6715[_0x89d9('0x22')]();};}function saveUpdates(_0x169525,_0x59239b){return function(_0x358c55){if(_0x358c55){return _0x358c55['update'](_0x169525)[_0x89d9('0x23')](function(_0x1b9aec){return _0x1b9aec;});}return null;};}function removeEntity(_0x3f37cd,_0x3ab186){return function(_0x3e1cbf){if(_0x3e1cbf){return _0x3e1cbf[_0x89d9('0x24')]()['then'](function(){_0x3f37cd[_0x89d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c8bd,_0x78dd4d){return function(_0x18c95d){if(!_0x18c95d){_0x29c8bd[_0x89d9('0x19')](0x194);}return _0x18c95d;};}function handleError(_0x24427f,_0x13e06d){_0x13e06d=_0x13e06d||0x1f4;return function(_0x35798e){logger[_0x89d9('0x25')](_0x35798e[_0x89d9('0x26')]);if(_0x35798e['name']){delete _0x35798e[_0x89d9('0x27')];}_0x24427f['status'](_0x13e06d)[_0x89d9('0x28')](_0x35798e);};}exports[_0x89d9('0x29')]=function(_0x3c0a29,_0x37b01c){var _0x39590e={},_0x384154={},_0x4afdeb={'count':0x0,'rows':[]};var _0x2675a3=_[_0x89d9('0x2a')](db[_0x89d9('0x2b')]['rawAttributes'],function(_0x46f81c){return{'name':_0x46f81c[_0x89d9('0x2c')],'type':_0x46f81c['type'][_0x89d9('0x2d')]};});_0x384154[_0x89d9('0x2e')]=_[_0x89d9('0x2a')](_0x2675a3,_0x89d9('0x27'));_0x384154[_0x89d9('0x2f')]=_['keys'](_0x3c0a29[_0x89d9('0x2f')]);_0x384154[_0x89d9('0x30')]=_[_0x89d9('0x31')](_0x384154[_0x89d9('0x2e')],_0x384154[_0x89d9('0x2f')]);_0x39590e['attributes']=_[_0x89d9('0x31')](_0x384154['model'],qs['fields'](_0x3c0a29['query']['fields']));_0x39590e[_0x89d9('0x32')]=_0x39590e[_0x89d9('0x32')][_0x89d9('0x33')]?_0x39590e['attributes']:_0x384154[_0x89d9('0x2e')];if(!_0x3c0a29[_0x89d9('0x2f')][_0x89d9('0x34')](_0x89d9('0x35'))){_0x39590e['limit']=qs[_0x89d9('0x1f')](_0x3c0a29['query']['limit']);_0x39590e['offset']=qs[_0x89d9('0x1c')](_0x3c0a29[_0x89d9('0x2f')][_0x89d9('0x1c')]);}_0x39590e['order']=qs[_0x89d9('0x36')](_0x3c0a29['query']['sort']);_0x39590e['where']=qs[_0x89d9('0x30')](_[_0x89d9('0x37')](_0x3c0a29[_0x89d9('0x2f')],_0x384154['filters']),_0x2675a3);if(_0x3c0a29[_0x89d9('0x2f')][_0x89d9('0x38')]){_0x39590e[_0x89d9('0x39')]=_[_0x89d9('0x3a')](_0x39590e[_0x89d9('0x39')],{'$or':_[_0x89d9('0x2a')](_0x2675a3,function(_0xcbd87a){if(_0xcbd87a[_0x89d9('0x3b')]!==_0x89d9('0x3c')){var _0x1ee86b={};_0x1ee86b[_0xcbd87a[_0x89d9('0x27')]]={'$like':'%'+_0x3c0a29['query']['filter']+'%'};return _0x1ee86b;}})});}_0x39590e=_[_0x89d9('0x3a')]({},_0x39590e,_0x3c0a29[_0x89d9('0x3d')]);var _0x2ab55c={'where':_0x39590e[_0x89d9('0x39')]};return db[_0x89d9('0x2b')]['count'](_0x2ab55c)['then'](function(_0x29886d){_0x4afdeb[_0x89d9('0x1e')]=_0x29886d;if(_0x3c0a29[_0x89d9('0x2f')][_0x89d9('0x3e')]){_0x39590e[_0x89d9('0x3f')]=[{'all':!![]}];}return db[_0x89d9('0x2b')][_0x89d9('0x40')](_0x39590e);})[_0x89d9('0x23')](function(_0x5e2330){_0x4afdeb[_0x89d9('0x41')]=_0x5e2330;return _0x4afdeb;})[_0x89d9('0x23')](respondWithFilteredResult(_0x37b01c,_0x39590e))[_0x89d9('0x42')](handleError(_0x37b01c,null));};exports[_0x89d9('0x43')]=function(_0x555698,_0x58c5d7){var _0x35cb42={'raw':![],'where':{'id':_0x555698[_0x89d9('0x44')]['id']}},_0x1f7ca5={};_0x1f7ca5[_0x89d9('0x2e')]=_[_0x89d9('0x45')](db[_0x89d9('0x2b')]['rawAttributes']);_0x1f7ca5[_0x89d9('0x2f')]=_[_0x89d9('0x45')](_0x555698['query']);_0x1f7ca5[_0x89d9('0x30')]=_['intersection'](_0x1f7ca5[_0x89d9('0x2e')],_0x1f7ca5[_0x89d9('0x2f')]);_0x35cb42[_0x89d9('0x32')]=_[_0x89d9('0x31')](_0x1f7ca5[_0x89d9('0x2e')],qs['fields'](_0x555698['query']['fields']));_0x35cb42[_0x89d9('0x32')]=_0x35cb42[_0x89d9('0x32')]['length']?_0x35cb42['attributes']:_0x1f7ca5[_0x89d9('0x2e')];if(_0x555698[_0x89d9('0x2f')][_0x89d9('0x3e')]){_0x35cb42[_0x89d9('0x3f')]=[{'all':!![]}];}_0x35cb42=_[_0x89d9('0x3a')]({},_0x35cb42,_0x555698[_0x89d9('0x3d')]);return db[_0x89d9('0x2b')][_0x89d9('0x46')](_0x35cb42)['then'](handleEntityNotFound(_0x58c5d7,null))['then'](respondWithResult(_0x58c5d7,null))[_0x89d9('0x42')](handleError(_0x58c5d7,null));};exports[_0x89d9('0x47')]=function(_0x44613f,_0x2c1a61){return db[_0x89d9('0x2b')][_0x89d9('0x47')](_0x44613f['body'],{})['then'](respondWithResult(_0x2c1a61,0xc9))[_0x89d9('0x42')](handleError(_0x2c1a61,null));};exports[_0x89d9('0x48')]=function(_0x127145,_0x46dfce){return db[_0x89d9('0x2b')][_0x89d9('0x48')](_0x127145[_0x89d9('0x49')],{'raw':![],'individualHooks':!![]})[_0x89d9('0x23')](respondWithResult(_0x46dfce,0xc9))[_0x89d9('0x42')](handleError(_0x46dfce,null));};exports[_0x89d9('0x4a')]=function(_0x586f9d,_0x3bfaf0){if(_0x586f9d[_0x89d9('0x49')]['id']){delete _0x586f9d['body']['id'];}return db[_0x89d9('0x2b')][_0x89d9('0x46')]({'where':{'id':_0x586f9d[_0x89d9('0x44')]['id']}})[_0x89d9('0x23')](handleEntityNotFound(_0x3bfaf0,null))['then'](saveUpdates(_0x586f9d[_0x89d9('0x49')],null))['then'](respondWithResult(_0x3bfaf0,null))[_0x89d9('0x42')](handleError(_0x3bfaf0,null));};exports[_0x89d9('0x24')]=function(_0x4581b9,_0x206fdd){return db['AnalyticFieldReport'][_0x89d9('0x46')]({'where':{'id':_0x4581b9[_0x89d9('0x44')]['id']}})[_0x89d9('0x23')](handleEntityNotFound(_0x206fdd,null))[_0x89d9('0x23')](removeEntity(_0x206fdd,null))[_0x89d9('0x42')](handleError(_0x206fdd,null));};exports[_0x89d9('0x4b')]=function(_0x54e8b4,_0x4f34fd){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x54e8b4['query'][_0x89d9('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x89d9('0x23')](respondWithResult(_0x4f34fd,0xcc))[_0x89d9('0x42')](handleError(_0x4f34fd,null));};exports[_0x89d9('0x4d')]=function(_0x3da3af,_0x513ae3,_0x5db0ad){return db[_0x89d9('0x4e')][_0x89d9('0x4f')]({'where':{'id':_0x3da3af[_0x89d9('0x44')]['id']}})[_0x89d9('0x23')](handleEntityNotFound(_0x513ae3,null))[_0x89d9('0x23')](function(_0xe64aa8){if(_0xe64aa8){return db[_0x89d9('0x50')][_0x89d9('0x51')](function(_0x376904){return db[_0x89d9('0x2b')]['destroy']({'where':{'CustomReportId':_0x3da3af[_0x89d9('0x44')]['id']},'transaction':_0x376904})['then'](function(_0x22c217){var _0x2fdb85=_[_0x89d9('0x2a')](_0x3da3af['body'],function(_0x5835a9){delete _0x5835a9['id'];_0x5835a9[_0x89d9('0x52')]=_0x3da3af['params']['id'];return _0x5835a9;});return db[_0x89d9('0x2b')][_0x89d9('0x48')](_0x2fdb85,{'transaction':_0x376904});});})[_0x89d9('0x23')](function(){return db[_0x89d9('0x2b')][_0x89d9('0x40')]({'where':{'CustomReportId':_0x3da3af['params']['id']}});});}})['then'](respondWithResult(_0x513ae3,null))[_0x89d9('0x42')](handleError(_0x513ae3,null));};
\ No newline at end of file
+var _0x5042=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','then','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','include','findAll','catch','show','params','length','find','create','bulkCreate','body','update','destroy','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x271a65,_0xadc011){var _0x88d8e=function(_0x2ff125){while(--_0x2ff125){_0x271a65['push'](_0x271a65['shift']());}};_0x88d8e(++_0xadc011);}(_0x5042,0x146));var _0x2504=function(_0x247549,_0x24cbbf){_0x247549=_0x247549-0x0;var _0x3982aa=_0x5042[_0x247549];return _0x3982aa;};'use strict';var emlformat=require(_0x2504('0x0'));var rimraf=require(_0x2504('0x1'));var zipdir=require(_0x2504('0x2'));var jsonpatch=require(_0x2504('0x3'));var rp=require(_0x2504('0x4'));var moment=require(_0x2504('0x5'));var BPromise=require(_0x2504('0x6'));var Mustache=require(_0x2504('0x7'));var util=require(_0x2504('0x8'));var path=require(_0x2504('0x9'));var sox=require(_0x2504('0xa'));var csv=require(_0x2504('0xb'));var ejs=require(_0x2504('0xc'));var fs=require('fs');var fs_extra=require(_0x2504('0xd'));var _=require('lodash');var squel=require(_0x2504('0xe'));var crypto=require(_0x2504('0xf'));var jsforce=require(_0x2504('0x10'));var deskjs=require(_0x2504('0x11'));var toCsv=require(_0x2504('0xb'));var querystring=require(_0x2504('0x12'));var Papa=require('papaparse');var Redis=require(_0x2504('0x13'));var authService=require(_0x2504('0x14'));var qs=require(_0x2504('0x15'));var as=require(_0x2504('0x16'));var hardwareService=require(_0x2504('0x17'));var logger=require(_0x2504('0x18'))(_0x2504('0x19'));var utils=require(_0x2504('0x1a'));var config=require(_0x2504('0x1b'));var licenseUtil=require(_0x2504('0x1c'));var db=require(_0x2504('0x1d'))['db'];function respondWithStatusCode(_0x307e56,_0x19b9f6){_0x19b9f6=_0x19b9f6||0xcc;return function(_0x6a60b9){if(_0x6a60b9){return _0x307e56[_0x2504('0x1e')](_0x19b9f6);}return _0x307e56[_0x2504('0x1f')](_0x19b9f6)[_0x2504('0x20')]();};}function respondWithResult(_0x275e39,_0x777f77){_0x777f77=_0x777f77||0xc8;return function(_0x417279){if(_0x417279){return _0x275e39[_0x2504('0x1f')](_0x777f77)['json'](_0x417279);}};}function respondWithFilteredResult(_0x4e0390,_0x5069f0){return function(_0x499a92){if(_0x499a92){var _0x30ceba=typeof _0x5069f0['offset']===_0x2504('0x21')&&typeof _0x5069f0[_0x2504('0x22')]==='undefined';var _0x18ca31=_0x499a92[_0x2504('0x23')];var _0x559b8e=_0x30ceba?0x0:_0x5069f0[_0x2504('0x24')];var _0x1fa6f4=_0x30ceba?_0x499a92[_0x2504('0x23')]:_0x5069f0[_0x2504('0x24')]+_0x5069f0[_0x2504('0x22')];var _0x1c60e6;if(_0x1fa6f4>=_0x18ca31){_0x1fa6f4=_0x18ca31;_0x1c60e6=0xc8;}else{_0x1c60e6=0xce;}_0x4e0390['status'](_0x1c60e6);return _0x4e0390[_0x2504('0x25')](_0x2504('0x26'),_0x559b8e+'-'+_0x1fa6f4+'/'+_0x18ca31)[_0x2504('0x27')](_0x499a92);}return null;};}function patchUpdates(_0x3e61cc){return function(_0x38d002){try{jsonpatch['apply'](_0x38d002,_0x3e61cc,!![]);}catch(_0x68751e){return BPromise[_0x2504('0x28')](_0x68751e);}return _0x38d002['save']();};}function saveUpdates(_0x289d64,_0x418aa2){return function(_0x324f39){if(_0x324f39){return _0x324f39['update'](_0x289d64)[_0x2504('0x29')](function(_0x213b98){return _0x213b98;});}return null;};}function removeEntity(_0x3c984d,_0x25167c){return function(_0x315317){if(_0x315317){return _0x315317['destroy']()[_0x2504('0x29')](function(){_0x3c984d[_0x2504('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d34b3,_0x417f4f){return function(_0xf42412){if(!_0xf42412){_0x4d34b3[_0x2504('0x1e')](0x194);}return _0xf42412;};}function handleError(_0x1bda95,_0x14c028){_0x14c028=_0x14c028||0x1f4;return function(_0x3264ea){logger[_0x2504('0x2a')](_0x3264ea[_0x2504('0x2b')]);if(_0x3264ea['name']){delete _0x3264ea[_0x2504('0x2c')];}_0x1bda95['status'](_0x14c028)[_0x2504('0x2d')](_0x3264ea);};}exports[_0x2504('0x2e')]=function(_0x46308a,_0x3619c1){var _0x5cfb30={},_0x543571={},_0x5caba6={'count':0x0,'rows':[]};var _0x5f0358=_[_0x2504('0x2f')](db['AnalyticFieldReport'][_0x2504('0x30')],function(_0x2295df){return{'name':_0x2295df['fieldName'],'type':_0x2295df[_0x2504('0x31')][_0x2504('0x32')]};});_0x543571[_0x2504('0x33')]=_[_0x2504('0x2f')](_0x5f0358,_0x2504('0x2c'));_0x543571['query']=_[_0x2504('0x34')](_0x46308a[_0x2504('0x35')]);_0x543571[_0x2504('0x36')]=_[_0x2504('0x37')](_0x543571[_0x2504('0x33')],_0x543571['query']);_0x5cfb30[_0x2504('0x38')]=_[_0x2504('0x37')](_0x543571[_0x2504('0x33')],qs[_0x2504('0x39')](_0x46308a[_0x2504('0x35')][_0x2504('0x39')]));_0x5cfb30[_0x2504('0x38')]=_0x5cfb30[_0x2504('0x38')]['length']?_0x5cfb30[_0x2504('0x38')]:_0x543571[_0x2504('0x33')];if(!_0x46308a[_0x2504('0x35')][_0x2504('0x3a')](_0x2504('0x3b'))){_0x5cfb30[_0x2504('0x22')]=qs[_0x2504('0x22')](_0x46308a['query'][_0x2504('0x22')]);_0x5cfb30['offset']=qs[_0x2504('0x24')](_0x46308a[_0x2504('0x35')][_0x2504('0x24')]);}_0x5cfb30['order']=qs[_0x2504('0x3c')](_0x46308a['query']['sort']);_0x5cfb30['where']=qs[_0x2504('0x36')](_[_0x2504('0x3d')](_0x46308a[_0x2504('0x35')],_0x543571[_0x2504('0x36')]),_0x5f0358);if(_0x46308a[_0x2504('0x35')][_0x2504('0x3e')]){_0x5cfb30[_0x2504('0x3f')]=_['merge'](_0x5cfb30[_0x2504('0x3f')],{'$or':_[_0x2504('0x2f')](_0x5f0358,function(_0x13c28c){if(_0x13c28c[_0x2504('0x31')]!==_0x2504('0x40')){var _0x4d423f={};_0x4d423f[_0x13c28c['name']]={'$like':'%'+_0x46308a[_0x2504('0x35')][_0x2504('0x3e')]+'%'};return _0x4d423f;}})});}_0x5cfb30=_[_0x2504('0x41')]({},_0x5cfb30,_0x46308a[_0x2504('0x42')]);var _0x48c0bd={'where':_0x5cfb30['where']};return db[_0x2504('0x43')][_0x2504('0x23')](_0x48c0bd)[_0x2504('0x29')](function(_0x3768a7){_0x5caba6[_0x2504('0x23')]=_0x3768a7;if(_0x46308a[_0x2504('0x35')][_0x2504('0x44')]){_0x5cfb30[_0x2504('0x45')]=[{'all':!![]}];}return db[_0x2504('0x43')][_0x2504('0x46')](_0x5cfb30);})['then'](function(_0xd367a1){_0x5caba6['rows']=_0xd367a1;return _0x5caba6;})[_0x2504('0x29')](respondWithFilteredResult(_0x3619c1,_0x5cfb30))[_0x2504('0x47')](handleError(_0x3619c1,null));};exports[_0x2504('0x48')]=function(_0x2c8ad7,_0x2eb377){var _0x240af8={'raw':![],'where':{'id':_0x2c8ad7[_0x2504('0x49')]['id']}},_0x2ffb9e={};_0x2ffb9e['model']=_[_0x2504('0x34')](db['AnalyticFieldReport'][_0x2504('0x30')]);_0x2ffb9e[_0x2504('0x35')]=_['keys'](_0x2c8ad7[_0x2504('0x35')]);_0x2ffb9e[_0x2504('0x36')]=_[_0x2504('0x37')](_0x2ffb9e[_0x2504('0x33')],_0x2ffb9e[_0x2504('0x35')]);_0x240af8[_0x2504('0x38')]=_[_0x2504('0x37')](_0x2ffb9e['model'],qs[_0x2504('0x39')](_0x2c8ad7[_0x2504('0x35')][_0x2504('0x39')]));_0x240af8[_0x2504('0x38')]=_0x240af8[_0x2504('0x38')][_0x2504('0x4a')]?_0x240af8['attributes']:_0x2ffb9e['model'];if(_0x2c8ad7[_0x2504('0x35')][_0x2504('0x44')]){_0x240af8['include']=[{'all':!![]}];}_0x240af8=_['merge']({},_0x240af8,_0x2c8ad7[_0x2504('0x42')]);return db[_0x2504('0x43')][_0x2504('0x4b')](_0x240af8)['then'](handleEntityNotFound(_0x2eb377,null))[_0x2504('0x29')](respondWithResult(_0x2eb377,null))[_0x2504('0x47')](handleError(_0x2eb377,null));};exports[_0x2504('0x4c')]=function(_0x2a7931,_0x5ef280){return db[_0x2504('0x43')][_0x2504('0x4c')](_0x2a7931['body'],{})[_0x2504('0x29')](respondWithResult(_0x5ef280,0xc9))[_0x2504('0x47')](handleError(_0x5ef280,null));};exports[_0x2504('0x4d')]=function(_0x129c58,_0x3f8fd2){return db[_0x2504('0x43')][_0x2504('0x4d')](_0x129c58[_0x2504('0x4e')],{'raw':![],'individualHooks':!![]})[_0x2504('0x29')](respondWithResult(_0x3f8fd2,0xc9))[_0x2504('0x47')](handleError(_0x3f8fd2,null));};exports[_0x2504('0x4f')]=function(_0x358aec,_0x9d31ba){if(_0x358aec[_0x2504('0x4e')]['id']){delete _0x358aec['body']['id'];}return db[_0x2504('0x43')]['find']({'where':{'id':_0x358aec['params']['id']}})[_0x2504('0x29')](handleEntityNotFound(_0x9d31ba,null))[_0x2504('0x29')](saveUpdates(_0x358aec[_0x2504('0x4e')],null))[_0x2504('0x29')](respondWithResult(_0x9d31ba,null))[_0x2504('0x47')](handleError(_0x9d31ba,null));};exports[_0x2504('0x50')]=function(_0x3224d4,_0x5e4470){return db[_0x2504('0x43')][_0x2504('0x4b')]({'where':{'id':_0x3224d4[_0x2504('0x49')]['id']}})[_0x2504('0x29')](handleEntityNotFound(_0x5e4470,null))[_0x2504('0x29')](removeEntity(_0x5e4470,null))[_0x2504('0x47')](handleError(_0x5e4470,null));};exports[_0x2504('0x51')]=function(_0x148ce4,_0x5b81b3){return db['AnalyticFieldReport'][_0x2504('0x50')]({'where':{'id':_0x148ce4[_0x2504('0x35')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5b81b3,0xcc))['catch'](handleError(_0x5b81b3,null));};exports[_0x2504('0x52')]=function(_0x248d99,_0x426af8,_0x2dcd5c){return db[_0x2504('0x53')]['findOne']({'where':{'id':_0x248d99['params']['id']}})[_0x2504('0x29')](handleEntityNotFound(_0x426af8,null))[_0x2504('0x29')](function(_0x5b4470){if(_0x5b4470){return db[_0x2504('0x54')][_0x2504('0x55')](function(_0x49ca7a){return db[_0x2504('0x43')][_0x2504('0x50')]({'where':{'CustomReportId':_0x248d99[_0x2504('0x49')]['id']},'transaction':_0x49ca7a})['then'](function(_0xcd9624){var _0x599ae5=_['map'](_0x248d99[_0x2504('0x4e')],function(_0x41d0c5){delete _0x41d0c5['id'];_0x41d0c5[_0x2504('0x56')]=_0x248d99[_0x2504('0x49')]['id'];return _0x41d0c5;});return db[_0x2504('0x43')][_0x2504('0x4d')](_0x599ae5,{'transaction':_0x49ca7a});});})[_0x2504('0x29')](function(){return db[_0x2504('0x43')]['findAll']({'where':{'CustomReportId':_0x248d99[_0x2504('0x49')]['id']}});});}})[_0x2504('0x29')](respondWithResult(_0x426af8,null))[_0x2504('0x47')](handleError(_0x426af8,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 119f1de..02b2536 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 _0x23b9=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x59f066,_0x3d8a42){var _0x21187c=function(_0x17a6ee){while(--_0x17a6ee){_0x59f066['push'](_0x59f066['shift']());}};_0x21187c(++_0x3d8a42);}(_0x23b9,0x9c));var _0x923b=function(_0x315cc9,_0x40ca3b){_0x315cc9=_0x315cc9-0x0;var _0x3b3e42=_0x23b9[_0x315cc9];return _0x3b3e42;};'use strict';var _=require(_0x923b('0x0'));var util=require(_0x923b('0x1'));var logger=require(_0x923b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x923b('0x3'));var rp=require(_0x923b('0x4'));var fs=require('fs');var path=require(_0x923b('0x5'));var rimraf=require(_0x923b('0x6'));var config=require(_0x923b('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x923b('0x8')]=function(_0x367767,_0x55e560){return _0x367767[_0x923b('0x9')](_0x923b('0xa'),attributes,{'tableName':_0x923b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc7fa=['path','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2b3b07,_0xa237cb){var _0x553ac5=function(_0x3d9297){while(--_0x3d9297){_0x2b3b07['push'](_0x2b3b07['shift']());}};_0x553ac5(++_0xa237cb);}(_0xc7fa,0x7e));var _0xac7f=function(_0x66a74f,_0x192e2d){_0x66a74f=_0x66a74f-0x0;var _0x314c38=_0xc7fa[_0x66a74f];return _0x314c38;};'use strict';var _=require(_0xac7f('0x0'));var util=require(_0xac7f('0x1'));var logger=require(_0xac7f('0x2'))(_0xac7f('0x3'));var moment=require(_0xac7f('0x4'));var BPromise=require('bluebird');var rp=require(_0xac7f('0x5'));var fs=require('fs');var path=require(_0xac7f('0x6'));var rimraf=require(_0xac7f('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0xac7f('0x8')]=function(_0x1fdcb4,_0xfc8794){return _0x1fdcb4[_0xac7f('0x9')](_0xac7f('0xa'),attributes,{'tableName':_0xac7f('0xb'),'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 1d2a48d..a84948c 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 _0x18cc=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x18cc,0xe5));var _0xc18c=function(_0x8e02e3,_0xc1ff5){_0x8e02e3=_0x8e02e3-0x0;var _0x27512f=_0x18cc[_0x8e02e3];return _0x27512f;};'use strict';var _=require(_0xc18c('0x0'));var util=require(_0xc18c('0x1'));var moment=require('moment');var BPromise=require(_0xc18c('0x2'));var rs=require(_0xc18c('0x3'));var fs=require('fs');var Redis=require(_0xc18c('0x4'));var db=require(_0xc18c('0x5'))['db'];var utils=require(_0xc18c('0x6'));var logger=require(_0xc18c('0x7'))(_0xc18c('0x8'));var config=require(_0xc18c('0x9'));var jayson=require(_0xc18c('0xa'));var client=jayson[_0xc18c('0xb')][_0xc18c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13f576,_0x521879,_0x2a655a){return new BPromise(function(_0x2249bc,_0x473450){return client['request'](_0x13f576,_0x2a655a)['then'](function(_0x57d07c){logger[_0xc18c('0xd')](_0xc18c('0xe'),_0x521879,_0xc18c('0xf'));logger[_0xc18c('0x10')](_0xc18c('0x11'),_0x521879,'request\x20sent',JSON[_0xc18c('0x12')](_0x57d07c));if(_0x57d07c[_0xc18c('0x13')]){if(_0x57d07c[_0xc18c('0x13')]['code']===0x1f4){logger[_0xc18c('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x521879,_0x57d07c[_0xc18c('0x13')][_0xc18c('0x14')]);return _0x473450(_0x57d07c[_0xc18c('0x13')][_0xc18c('0x14')]);}logger[_0xc18c('0x13')](_0xc18c('0xe'),_0x521879,_0x57d07c['error'][_0xc18c('0x14')]);return _0x2249bc(_0x57d07c[_0xc18c('0x13')][_0xc18c('0x14')]);}else{logger[_0xc18c('0xd')](_0xc18c('0xe'),_0x521879,_0xc18c('0xf'));_0x2249bc(_0x57d07c[_0xc18c('0x15')][_0xc18c('0x14')]);}})[_0xc18c('0x16')](function(_0xa46086){logger[_0xc18c('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x521879,_0xa46086);_0x473450(_0xa46086);});});}
\ No newline at end of file
+var _0x632e=['client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x632e,0x97));var _0xe632=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x632e[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0xe632('0x0'));var util=require(_0xe632('0x1'));var moment=require(_0xe632('0x2'));var BPromise=require(_0xe632('0x3'));var rs=require(_0xe632('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe632('0x5'))['db'];var utils=require(_0xe632('0x6'));var logger=require('../../config/logger')(_0xe632('0x7'));var config=require(_0xe632('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe632('0x9')][_0xe632('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28bedb,_0x505a63,_0x5be77e){return new BPromise(function(_0x2f0097,_0x3e9d96){return client[_0xe632('0xb')](_0x28bedb,_0x5be77e)['then'](function(_0xe078db){logger[_0xe632('0xc')](_0xe632('0xd'),_0x505a63,_0xe632('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x505a63,_0xe632('0xe'),JSON[_0xe632('0xf')](_0xe078db));if(_0xe078db[_0xe632('0x10')]){if(_0xe078db[_0xe632('0x10')]['code']===0x1f4){logger[_0xe632('0x10')](_0xe632('0xd'),_0x505a63,_0xe078db[_0xe632('0x10')][_0xe632('0x11')]);return _0x3e9d96(_0xe078db[_0xe632('0x10')][_0xe632('0x11')]);}logger[_0xe632('0x10')](_0xe632('0xd'),_0x505a63,_0xe078db[_0xe632('0x10')][_0xe632('0x11')]);return _0x2f0097(_0xe078db[_0xe632('0x10')][_0xe632('0x11')]);}else{logger[_0xe632('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x505a63,_0xe632('0xe'));_0x2f0097(_0xe078db[_0xe632('0x12')][_0xe632('0x11')]);}})[_0xe632('0x13')](function(_0x5c6a62){logger[_0xe632('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x505a63,_0x5c6a62);_0x3e9d96(_0x5c6a62);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4559c78..e1fd706 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(_0x3828df,_0x453607){var _0x132d03=function(_0x188a61){while(--_0x188a61){_0x3828df['push'](_0x3828df['shift']());}};_0x132d03(++_0x453607);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x1e87fe,_0x3707d6){var _0x558d64=function(_0x566f1e){while(--_0x566f1e){_0x1e87fe['push'](_0x1e87fe['shift']());}};_0x558d64(++_0x3707d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 397f3a7..26da861 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 _0x2917=['name','TEXT','sequelize','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2917,0x142));var _0x7291=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x2917[_0x473738];return _0x1df4ae;};'use strict';var Sequelize=require(_0x7291('0x0'));module[_0x7291('0x1')]={'name':{'type':Sequelize[_0x7291('0x2')],'allowNull':![],'unique':_0x7291('0x3')},'table':{'type':Sequelize[_0x7291('0x2')]},'metric':{'type':Sequelize[_0x7291('0x4')]},'description':{'type':Sequelize[_0x7291('0x2')]}};
\ No newline at end of file
+var _0xfbac=['STRING','name','TEXT','exports'];(function(_0x5403d5,_0xf406eb){var _0xd87ca2=function(_0x498015){while(--_0x498015){_0x5403d5['push'](_0x5403d5['shift']());}};_0xd87ca2(++_0xf406eb);}(_0xfbac,0x167));var _0xcfba=function(_0x1bc29b,_0x5e1235){_0x1bc29b=_0x1bc29b-0x0;var _0x19f05a=_0xfbac[_0x1bc29b];return _0x19f05a;};'use strict';var Sequelize=require('sequelize');module[_0xcfba('0x0')]={'name':{'type':Sequelize[_0xcfba('0x1')],'allowNull':![],'unique':_0xcfba('0x2')},'table':{'type':Sequelize[_0xcfba('0x1')]},'metric':{'type':Sequelize[_0xcfba('0x3')]},'description':{'type':Sequelize[_0xcfba('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9c6f367..37d5539 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 _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
+var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3df208,_0x3681f2){var _0x529cbe=function(_0x3120c0){while(--_0x3120c0){_0x3df208['push'](_0x3df208['shift']());}};_0x529cbe(++_0x3681f2);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 947cd12..a505da0 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 _0x80c3=['define','AnalyticMetric','analytics_metrics','lodash','api','bluebird','request-promise','path','exports'];(function(_0x4765dd,_0x266998){var _0x2f98dc=function(_0x24ef13){while(--_0x24ef13){_0x4765dd['push'](_0x4765dd['shift']());}};_0x2f98dc(++_0x266998);}(_0x80c3,0x18f));var _0x380c=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x80c3[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x380c('0x1'));var moment=require('moment');var BPromise=require(_0x380c('0x2'));var rp=require(_0x380c('0x3'));var fs=require('fs');var path=require(_0x380c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x380c('0x5')]=function(_0x595b66,_0x581c96){return _0x595b66[_0x380c('0x6')](_0x380c('0x7'),attributes,{'tableName':_0x380c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15b2=['rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','request-promise','path'];(function(_0x443847,_0x1e25fa){var _0x4e8088=function(_0x3fac0d){while(--_0x3fac0d){_0x443847['push'](_0x443847['shift']());}};_0x4e8088(++_0x1e25fa);}(_0x15b2,0x145));var _0x215b=function(_0xdb810a,_0x3007f8){_0xdb810a=_0xdb810a-0x0;var _0x3954ba=_0x15b2[_0xdb810a];return _0x3954ba;};'use strict';var _=require('lodash');var util=require(_0x215b('0x0'));var logger=require('../../config/logger')(_0x215b('0x1'));var moment=require(_0x215b('0x2'));var BPromise=require('bluebird');var rp=require(_0x215b('0x3'));var fs=require('fs');var path=require(_0x215b('0x4'));var rimraf=require(_0x215b('0x5'));var config=require(_0x215b('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x215b('0x7')]=function(_0x4ffb8e,_0x2d8ea5){return _0x4ffb8e[_0x215b('0x8')](_0x215b('0x9'),attributes,{'tableName':_0x215b('0xa'),'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 9bdf003..b701548 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 _0xe2c4=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info'];(function(_0xf9a37a,_0x49a7f1){var _0x2eed8e=function(_0x3035ad){while(--_0x3035ad){_0xf9a37a['push'](_0xf9a37a['shift']());}};_0x2eed8e(++_0x49a7f1);}(_0xe2c4,0x80));var _0x4e2c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe2c4[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x4e2c('0x0'));var util=require(_0x4e2c('0x1'));var moment=require('moment');var BPromise=require(_0x4e2c('0x2'));var rs=require(_0x4e2c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e2c('0x4'))['db'];var utils=require(_0x4e2c('0x5'));var logger=require(_0x4e2c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e2c('0x7'));var client=jayson[_0x4e2c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48b7de,_0x464a9f,_0x189b30){return new BPromise(function(_0x1392c3,_0x4a3567){return client[_0x4e2c('0x9')](_0x48b7de,_0x189b30)[_0x4e2c('0xa')](function(_0x109442){logger[_0x4e2c('0xb')](_0x4e2c('0xc'),_0x464a9f,_0x4e2c('0xd'));logger[_0x4e2c('0xe')](_0x4e2c('0xf'),_0x464a9f,_0x4e2c('0xd'),JSON['stringify'](_0x109442));if(_0x109442[_0x4e2c('0x10')]){if(_0x109442[_0x4e2c('0x10')][_0x4e2c('0x11')]===0x1f4){logger[_0x4e2c('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x464a9f,_0x109442[_0x4e2c('0x10')][_0x4e2c('0x12')]);return _0x4a3567(_0x109442['error'][_0x4e2c('0x12')]);}logger[_0x4e2c('0x10')](_0x4e2c('0xc'),_0x464a9f,_0x109442[_0x4e2c('0x10')][_0x4e2c('0x12')]);return _0x1392c3(_0x109442[_0x4e2c('0x10')]['message']);}else{logger[_0x4e2c('0xb')](_0x4e2c('0xc'),_0x464a9f,_0x4e2c('0xd'));_0x1392c3(_0x109442[_0x4e2c('0x13')]['message']);}})['catch'](function(_0x2b7109){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x464a9f,_0x2b7109);_0x4a3567(_0x2b7109);});});}
\ No newline at end of file
+var _0x2110=['../../config/environment','jayson/promise','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x2e9703,_0x299227){var _0x5056a3=function(_0x36990e){while(--_0x36990e){_0x2e9703['push'](_0x2e9703['shift']());}};_0x5056a3(++_0x299227);}(_0x2110,0x1d6));var _0x0211=function(_0x29f250,_0x258820){_0x29f250=_0x29f250-0x0;var _0x27a149=_0x2110[_0x29f250];return _0x27a149;};'use strict';var _=require(_0x0211('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0211('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0211('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0211('0x3'))(_0x0211('0x4'));var config=require(_0x0211('0x5'));var jayson=require(_0x0211('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20f075,_0x12c1c2,_0x912747){return new BPromise(function(_0xb3d19c,_0x39f9cf){return client['request'](_0x20f075,_0x912747)[_0x0211('0x7')](function(_0x5effc5){logger[_0x0211('0x8')](_0x0211('0x9'),_0x12c1c2,'request\x20sent');logger[_0x0211('0xa')](_0x0211('0xb'),_0x12c1c2,_0x0211('0xc'),JSON[_0x0211('0xd')](_0x5effc5));if(_0x5effc5[_0x0211('0xe')]){if(_0x5effc5[_0x0211('0xe')][_0x0211('0xf')]===0x1f4){logger[_0x0211('0xe')](_0x0211('0x9'),_0x12c1c2,_0x5effc5['error'][_0x0211('0x10')]);return _0x39f9cf(_0x5effc5['error'][_0x0211('0x10')]);}logger['error'](_0x0211('0x9'),_0x12c1c2,_0x5effc5[_0x0211('0xe')][_0x0211('0x10')]);return _0xb3d19c(_0x5effc5[_0x0211('0xe')][_0x0211('0x10')]);}else{logger['info'](_0x0211('0x9'),_0x12c1c2,_0x0211('0xc'));_0xb3d19c(_0x5effc5[_0x0211('0x11')]['message']);}})[_0x0211('0x12')](function(_0x50ba0f){logger[_0x0211('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x12c1c2,_0x50ba0f);_0x39f9cf(_0x50ba0f);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b72c293..7276f81 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 _0xb091=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','show','post','create','put'];(function(_0x4257b6,_0x2348c7){var _0x4ad68c=function(_0x33a6e8){while(--_0x33a6e8){_0x4257b6['push'](_0x4257b6['shift']());}};_0x4ad68c(++_0x2348c7);}(_0xb091,0x16e));var _0x1b09=function(_0x832044,_0x3bbbb8){_0x832044=_0x832044-0x0;var _0x50759a=_0xb091[_0x832044];return _0x50759a;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var fs_extra=require(_0x1b09('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b09('0x5'));var controller=require(_0x1b09('0x6'));router['get']('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x8')]);router[_0x1b09('0x9')]('/:id',auth[_0x1b09('0x7')](),controller[_0x1b09('0xa')]);router[_0x1b09('0xb')]('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0xc')]);router[_0x1b09('0xd')](_0x1b09('0xe'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xf')]);router[_0x1b09('0x10')](_0x1b09('0xe'),auth['isAuthenticated'](),controller[_0x1b09('0x11')]);module[_0x1b09('0x12')]=router;
\ No newline at end of file
+var _0xeedf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xeedf,0x12c));var _0xfeed=function(_0xe04363,_0x16fb55){_0xe04363=_0xe04363-0x0;var _0x3aaa62=_0xeedf[_0xe04363];return _0x3aaa62;};'use strict';var multer=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var path=require(_0xfeed('0x2'));var timeout=require('connect-timeout');var express=require(_0xfeed('0x3'));var router=express['Router']();var fs_extra=require(_0xfeed('0x4'));var auth=require(_0xfeed('0x5'));var interaction=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var controller=require('./analyticMetric.controller');router[_0xfeed('0x8')]('/',auth[_0xfeed('0x9')](),controller['index']);router[_0xfeed('0x8')]('/:id',auth[_0xfeed('0x9')](),controller['show']);router[_0xfeed('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfeed('0xb'),auth[_0xfeed('0x9')](),controller[_0xfeed('0xc')]);router[_0xfeed('0xd')]('/:id',auth[_0xfeed('0x9')](),controller[_0xfeed('0xe')]);module[_0xfeed('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 98d7f35..7044ac3 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 _0xdaff=['TEXT','sequelize','exports'];(function(_0x541103,_0x357bfe){var _0x5776ea=function(_0x501632){while(--_0x501632){_0x541103['push'](_0x541103['shift']());}};_0x5776ea(++_0x357bfe);}(_0xdaff,0x151));var _0xfdaf=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdaff[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xfdaf('0x0'));module[_0xfdaf('0x1')]={'tree':{'type':Sequelize[_0xfdaf('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xcac8=['exports','sequelize'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xcac8,0x163));var _0x8cac=function(_0x191bba,_0x4f9a31){_0x191bba=_0x191bba-0x0;var _0x20e095=_0xcac8[_0x191bba];return _0x20e095;};'use strict';var Sequelize=require(_0x8cac('0x0'));module[_0x8cac('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 100b9ec..21e1786 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 _0x02bb=['send','index','map','AnalyticTreeReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','destroy','then','stack','name'];(function(_0x294190,_0xeedc7a){var _0x5c1ac9=function(_0x5393e6){while(--_0x5393e6){_0x294190['push'](_0x294190['shift']());}};_0x5c1ac9(++_0xeedc7a);}(_0x02bb,0x121));var _0xb02b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x02bb[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb02b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb02b('0x1'));var moment=require('moment');var BPromise=require(_0xb02b('0x2'));var Mustache=require(_0xb02b('0x3'));var util=require(_0xb02b('0x4'));var path=require(_0xb02b('0x5'));var sox=require(_0xb02b('0x6'));var csv=require('to-csv');var ejs=require(_0xb02b('0x7'));var fs=require('fs');var fs_extra=require(_0xb02b('0x8'));var _=require(_0xb02b('0x9'));var squel=require(_0xb02b('0xa'));var crypto=require(_0xb02b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb02b('0xc'));var toCsv=require(_0xb02b('0xd'));var querystring=require(_0xb02b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb02b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb02b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb02b('0x11'));var config=require(_0xb02b('0x12'));var licenseUtil=require(_0xb02b('0x13'));var db=require(_0xb02b('0x14'))['db'];function respondWithStatusCode(_0x221a3a,_0x29cf14){_0x29cf14=_0x29cf14||0xcc;return function(_0x1c2b77){if(_0x1c2b77){return _0x221a3a[_0xb02b('0x15')](_0x29cf14);}return _0x221a3a[_0xb02b('0x16')](_0x29cf14)[_0xb02b('0x17')]();};}function respondWithResult(_0x4e3943,_0x8dc1d6){_0x8dc1d6=_0x8dc1d6||0xc8;return function(_0x5ef0ff){if(_0x5ef0ff){return _0x4e3943['status'](_0x8dc1d6)[_0xb02b('0x18')](_0x5ef0ff);}};}function respondWithFilteredResult(_0x459087,_0xd47316){return function(_0xb06d64){if(_0xb06d64){var _0x2b78a1=typeof _0xd47316['offset']===_0xb02b('0x19')&&typeof _0xd47316[_0xb02b('0x1a')]===_0xb02b('0x19');var _0x16b966=_0xb06d64[_0xb02b('0x1b')];var _0x42f9e6=_0x2b78a1?0x0:_0xd47316[_0xb02b('0x1c')];var _0x312b26=_0x2b78a1?_0xb06d64['count']:_0xd47316[_0xb02b('0x1c')]+_0xd47316['limit'];var _0x1aab52;if(_0x312b26>=_0x16b966){_0x312b26=_0x16b966;_0x1aab52=0xc8;}else{_0x1aab52=0xce;}_0x459087[_0xb02b('0x16')](_0x1aab52);return _0x459087[_0xb02b('0x1d')]('Content-Range',_0x42f9e6+'-'+_0x312b26+'/'+_0x16b966)[_0xb02b('0x18')](_0xb06d64);}return null;};}function patchUpdates(_0x59245b){return function(_0x241960){try{jsonpatch['apply'](_0x241960,_0x59245b,!![]);}catch(_0x3bec73){return BPromise[_0xb02b('0x1e')](_0x3bec73);}return _0x241960['save']();};}function saveUpdates(_0x5298d7,_0x455fbe){return function(_0x30fe13){if(_0x30fe13){return _0x30fe13[_0xb02b('0x1f')](_0x5298d7)['then'](function(_0x17465c){return _0x17465c;});}return null;};}function removeEntity(_0x128a93,_0x2f600e){return function(_0x1520d1){if(_0x1520d1){return _0x1520d1[_0xb02b('0x20')]()[_0xb02b('0x21')](function(){_0x128a93[_0xb02b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x406934,_0xe2b979){return function(_0x3aff98){if(!_0x3aff98){_0x406934['sendStatus'](0x194);}return _0x3aff98;};}function handleError(_0x4d4692,_0x5e9fb8){_0x5e9fb8=_0x5e9fb8||0x1f4;return function(_0x2e0300){logger['error'](_0x2e0300[_0xb02b('0x22')]);if(_0x2e0300[_0xb02b('0x23')]){delete _0x2e0300['name'];}_0x4d4692[_0xb02b('0x16')](_0x5e9fb8)[_0xb02b('0x24')](_0x2e0300);};}exports[_0xb02b('0x25')]=function(_0x102b40,_0x28f3bd){var _0xf60185={},_0x57248e={},_0x2d7247={'count':0x0,'rows':[]};var _0x6ab09b=_[_0xb02b('0x26')](db[_0xb02b('0x27')][_0xb02b('0x28')],function(_0x20c970){return{'name':_0x20c970['fieldName'],'type':_0x20c970[_0xb02b('0x29')]['key']};});_0x57248e[_0xb02b('0x2a')]=_['map'](_0x6ab09b,_0xb02b('0x23'));_0x57248e['query']=_[_0xb02b('0x2b')](_0x102b40[_0xb02b('0x2c')]);_0x57248e[_0xb02b('0x2d')]=_[_0xb02b('0x2e')](_0x57248e[_0xb02b('0x2a')],_0x57248e[_0xb02b('0x2c')]);_0xf60185[_0xb02b('0x2f')]=_[_0xb02b('0x2e')](_0x57248e[_0xb02b('0x2a')],qs[_0xb02b('0x30')](_0x102b40[_0xb02b('0x2c')][_0xb02b('0x30')]));_0xf60185['attributes']=_0xf60185['attributes'][_0xb02b('0x31')]?_0xf60185[_0xb02b('0x2f')]:_0x57248e[_0xb02b('0x2a')];if(!_0x102b40[_0xb02b('0x2c')][_0xb02b('0x32')]('nolimit')){_0xf60185[_0xb02b('0x1a')]=qs[_0xb02b('0x1a')](_0x102b40[_0xb02b('0x2c')]['limit']);_0xf60185['offset']=qs[_0xb02b('0x1c')](_0x102b40[_0xb02b('0x2c')][_0xb02b('0x1c')]);}_0xf60185[_0xb02b('0x33')]=qs[_0xb02b('0x34')](_0x102b40[_0xb02b('0x2c')]['sort']);_0xf60185[_0xb02b('0x35')]=qs[_0xb02b('0x2d')](_['pick'](_0x102b40[_0xb02b('0x2c')],_0x57248e['filters']),_0x6ab09b);if(_0x102b40[_0xb02b('0x2c')]['filter']){_0xf60185['where']=_[_0xb02b('0x36')](_0xf60185[_0xb02b('0x35')],{'$or':_[_0xb02b('0x26')](_0x6ab09b,function(_0x2ff7cc){if(_0x2ff7cc[_0xb02b('0x29')]!=='VIRTUAL'){var _0x5f1b08={};_0x5f1b08[_0x2ff7cc[_0xb02b('0x23')]]={'$like':'%'+_0x102b40[_0xb02b('0x2c')]['filter']+'%'};return _0x5f1b08;}})});}_0xf60185=_[_0xb02b('0x36')]({},_0xf60185,_0x102b40[_0xb02b('0x37')]);var _0x286b78={'where':_0xf60185[_0xb02b('0x35')]};return db[_0xb02b('0x27')][_0xb02b('0x1b')](_0x286b78)[_0xb02b('0x21')](function(_0x358fb7){_0x2d7247[_0xb02b('0x1b')]=_0x358fb7;if(_0x102b40[_0xb02b('0x2c')]['includeAll']){_0xf60185[_0xb02b('0x38')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xb02b('0x39')](_0xf60185);})[_0xb02b('0x21')](function(_0xe29262){_0x2d7247['rows']=_0xe29262;return _0x2d7247;})[_0xb02b('0x21')](respondWithFilteredResult(_0x28f3bd,_0xf60185))[_0xb02b('0x3a')](handleError(_0x28f3bd,null));};exports[_0xb02b('0x3b')]=function(_0x158a0d,_0x42bdb7){var _0xa00bdc={'raw':!![],'where':{'id':_0x158a0d[_0xb02b('0x3c')]['id']}},_0x5068c4={};_0x5068c4[_0xb02b('0x2a')]=_[_0xb02b('0x2b')](db[_0xb02b('0x27')][_0xb02b('0x28')]);_0x5068c4[_0xb02b('0x2c')]=_[_0xb02b('0x2b')](_0x158a0d[_0xb02b('0x2c')]);_0x5068c4[_0xb02b('0x2d')]=_[_0xb02b('0x2e')](_0x5068c4[_0xb02b('0x2a')],_0x5068c4[_0xb02b('0x2c')]);_0xa00bdc['attributes']=_['intersection'](_0x5068c4[_0xb02b('0x2a')],qs[_0xb02b('0x30')](_0x158a0d[_0xb02b('0x2c')][_0xb02b('0x30')]));_0xa00bdc[_0xb02b('0x2f')]=_0xa00bdc['attributes'][_0xb02b('0x31')]?_0xa00bdc[_0xb02b('0x2f')]:_0x5068c4[_0xb02b('0x2a')];if(_0x158a0d[_0xb02b('0x2c')][_0xb02b('0x3d')]){_0xa00bdc[_0xb02b('0x38')]=[{'all':!![]}];}_0xa00bdc=_[_0xb02b('0x36')]({},_0xa00bdc,_0x158a0d['options']);return db['AnalyticTreeReport'][_0xb02b('0x3e')](_0xa00bdc)['then'](handleEntityNotFound(_0x42bdb7,null))[_0xb02b('0x21')](respondWithResult(_0x42bdb7,null))[_0xb02b('0x3a')](handleError(_0x42bdb7,null));};exports['create']=function(_0x13bd46,_0x39ff43){return db[_0xb02b('0x27')][_0xb02b('0x3f')](_0x13bd46[_0xb02b('0x40')],{})[_0xb02b('0x21')](respondWithResult(_0x39ff43,0xc9))[_0xb02b('0x3a')](handleError(_0x39ff43,null));};exports['update']=function(_0x483447,_0x4ad69e){if(_0x483447[_0xb02b('0x40')]['id']){delete _0x483447['body']['id'];}return db[_0xb02b('0x27')][_0xb02b('0x3e')]({'where':{'id':_0x483447[_0xb02b('0x3c')]['id']}})[_0xb02b('0x21')](handleEntityNotFound(_0x4ad69e,null))['then'](saveUpdates(_0x483447[_0xb02b('0x40')],null))[_0xb02b('0x21')](respondWithResult(_0x4ad69e,null))[_0xb02b('0x3a')](handleError(_0x4ad69e,null));};exports['destroy']=function(_0xc5b171,_0x4a3069){return db[_0xb02b('0x27')]['find']({'where':{'id':_0xc5b171['params']['id']}})[_0xb02b('0x21')](handleEntityNotFound(_0x4a3069,null))['then'](removeEntity(_0x4a3069,null))[_0xb02b('0x3a')](handleError(_0x4a3069,null));};
\ No newline at end of file
+var _0xc143=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','save','then','error','stack','name','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xc143,0x7f));var _0x3c14=function(_0x4022dd,_0x3c66b3){_0x4022dd=_0x4022dd-0x0;var _0x3ce86e=_0xc143[_0x4022dd];return _0x3ce86e;};'use strict';var emlformat=require(_0x3c14('0x0'));var rimraf=require(_0x3c14('0x1'));var zipdir=require(_0x3c14('0x2'));var jsonpatch=require(_0x3c14('0x3'));var rp=require(_0x3c14('0x4'));var moment=require(_0x3c14('0x5'));var BPromise=require(_0x3c14('0x6'));var Mustache=require(_0x3c14('0x7'));var util=require('util');var path=require(_0x3c14('0x8'));var sox=require(_0x3c14('0x9'));var csv=require(_0x3c14('0xa'));var ejs=require(_0x3c14('0xb'));var fs=require('fs');var fs_extra=require(_0x3c14('0xc'));var _=require(_0x3c14('0xd'));var squel=require(_0x3c14('0xe'));var crypto=require(_0x3c14('0xf'));var jsforce=require(_0x3c14('0x10'));var deskjs=require(_0x3c14('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3c14('0x12'));var Papa=require('papaparse');var Redis=require(_0x3c14('0x13'));var authService=require(_0x3c14('0x14'));var qs=require(_0x3c14('0x15'));var as=require(_0x3c14('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c14('0x17'))(_0x3c14('0x18'));var utils=require(_0x3c14('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x241e52,_0x2483ab){_0x2483ab=_0x2483ab||0xcc;return function(_0x13411e){if(_0x13411e){return _0x241e52[_0x3c14('0x1a')](_0x2483ab);}return _0x241e52['status'](_0x2483ab)[_0x3c14('0x1b')]();};}function respondWithResult(_0xbe8b83,_0x4cb2ec){_0x4cb2ec=_0x4cb2ec||0xc8;return function(_0x17886f){if(_0x17886f){return _0xbe8b83[_0x3c14('0x1c')](_0x4cb2ec)[_0x3c14('0x1d')](_0x17886f);}};}function respondWithFilteredResult(_0x5dc65b,_0x16e081){return function(_0x48e38b){if(_0x48e38b){var _0x273220=typeof _0x16e081[_0x3c14('0x1e')]===_0x3c14('0x1f')&&typeof _0x16e081[_0x3c14('0x20')]===_0x3c14('0x1f');var _0x49d1c0=_0x48e38b[_0x3c14('0x21')];var _0x4f5d00=_0x273220?0x0:_0x16e081[_0x3c14('0x1e')];var _0x587fbe=_0x273220?_0x48e38b[_0x3c14('0x21')]:_0x16e081['offset']+_0x16e081[_0x3c14('0x20')];var _0x4f053e;if(_0x587fbe>=_0x49d1c0){_0x587fbe=_0x49d1c0;_0x4f053e=0xc8;}else{_0x4f053e=0xce;}_0x5dc65b[_0x3c14('0x1c')](_0x4f053e);return _0x5dc65b[_0x3c14('0x22')]('Content-Range',_0x4f5d00+'-'+_0x587fbe+'/'+_0x49d1c0)[_0x3c14('0x1d')](_0x48e38b);}return null;};}function patchUpdates(_0x5ae146){return function(_0x270e9e){try{jsonpatch['apply'](_0x270e9e,_0x5ae146,!![]);}catch(_0xbfc428){return BPromise['reject'](_0xbfc428);}return _0x270e9e[_0x3c14('0x23')]();};}function saveUpdates(_0x3ccf6b,_0x34804e){return function(_0x246140){if(_0x246140){return _0x246140['update'](_0x3ccf6b)[_0x3c14('0x24')](function(_0x39f6b4){return _0x39f6b4;});}return null;};}function removeEntity(_0x5ec1eb,_0x5b32ed){return function(_0xd54ee){if(_0xd54ee){return _0xd54ee['destroy']()['then'](function(){_0x5ec1eb[_0x3c14('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d8c59,_0x3ec186){return function(_0x125381){if(!_0x125381){_0x2d8c59[_0x3c14('0x1a')](0x194);}return _0x125381;};}function handleError(_0x1d1964,_0x88db49){_0x88db49=_0x88db49||0x1f4;return function(_0x4d32e5){logger[_0x3c14('0x25')](_0x4d32e5[_0x3c14('0x26')]);if(_0x4d32e5[_0x3c14('0x27')]){delete _0x4d32e5[_0x3c14('0x27')];}_0x1d1964['status'](_0x88db49)['send'](_0x4d32e5);};}exports['index']=function(_0xffe014,_0x5c0ea8){var _0x516fe2={},_0x492f04={},_0x3a348a={'count':0x0,'rows':[]};var _0x5711cd=_['map'](db[_0x3c14('0x28')][_0x3c14('0x29')],function(_0x2c791f){return{'name':_0x2c791f[_0x3c14('0x2a')],'type':_0x2c791f[_0x3c14('0x2b')][_0x3c14('0x2c')]};});_0x492f04[_0x3c14('0x2d')]=_[_0x3c14('0x2e')](_0x5711cd,_0x3c14('0x27'));_0x492f04[_0x3c14('0x2f')]=_['keys'](_0xffe014[_0x3c14('0x2f')]);_0x492f04['filters']=_[_0x3c14('0x30')](_0x492f04['model'],_0x492f04[_0x3c14('0x2f')]);_0x516fe2[_0x3c14('0x31')]=_['intersection'](_0x492f04[_0x3c14('0x2d')],qs[_0x3c14('0x32')](_0xffe014[_0x3c14('0x2f')][_0x3c14('0x32')]));_0x516fe2[_0x3c14('0x31')]=_0x516fe2[_0x3c14('0x31')]['length']?_0x516fe2[_0x3c14('0x31')]:_0x492f04[_0x3c14('0x2d')];if(!_0xffe014[_0x3c14('0x2f')][_0x3c14('0x33')](_0x3c14('0x34'))){_0x516fe2[_0x3c14('0x20')]=qs[_0x3c14('0x20')](_0xffe014[_0x3c14('0x2f')][_0x3c14('0x20')]);_0x516fe2['offset']=qs[_0x3c14('0x1e')](_0xffe014[_0x3c14('0x2f')][_0x3c14('0x1e')]);}_0x516fe2[_0x3c14('0x35')]=qs[_0x3c14('0x36')](_0xffe014[_0x3c14('0x2f')][_0x3c14('0x36')]);_0x516fe2[_0x3c14('0x37')]=qs[_0x3c14('0x38')](_[_0x3c14('0x39')](_0xffe014['query'],_0x492f04['filters']),_0x5711cd);if(_0xffe014[_0x3c14('0x2f')][_0x3c14('0x3a')]){_0x516fe2[_0x3c14('0x37')]=_[_0x3c14('0x3b')](_0x516fe2['where'],{'$or':_[_0x3c14('0x2e')](_0x5711cd,function(_0x10799e){if(_0x10799e['type']!==_0x3c14('0x3c')){var _0x46a4be={};_0x46a4be[_0x10799e['name']]={'$like':'%'+_0xffe014[_0x3c14('0x2f')]['filter']+'%'};return _0x46a4be;}})});}_0x516fe2=_[_0x3c14('0x3b')]({},_0x516fe2,_0xffe014[_0x3c14('0x3d')]);var _0x13acfb={'where':_0x516fe2[_0x3c14('0x37')]};return db['AnalyticTreeReport']['count'](_0x13acfb)[_0x3c14('0x24')](function(_0x3ac865){_0x3a348a[_0x3c14('0x21')]=_0x3ac865;if(_0xffe014[_0x3c14('0x2f')][_0x3c14('0x3e')]){_0x516fe2[_0x3c14('0x3f')]=[{'all':!![]}];}return db[_0x3c14('0x28')][_0x3c14('0x40')](_0x516fe2);})[_0x3c14('0x24')](function(_0x2d05d5){_0x3a348a['rows']=_0x2d05d5;return _0x3a348a;})['then'](respondWithFilteredResult(_0x5c0ea8,_0x516fe2))[_0x3c14('0x41')](handleError(_0x5c0ea8,null));};exports[_0x3c14('0x42')]=function(_0x375ae2,_0x504168){var _0x26c5cd={'raw':!![],'where':{'id':_0x375ae2[_0x3c14('0x43')]['id']}},_0x557273={};_0x557273[_0x3c14('0x2d')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x557273[_0x3c14('0x2f')]=_[_0x3c14('0x44')](_0x375ae2[_0x3c14('0x2f')]);_0x557273[_0x3c14('0x38')]=_['intersection'](_0x557273['model'],_0x557273['query']);_0x26c5cd[_0x3c14('0x31')]=_[_0x3c14('0x30')](_0x557273[_0x3c14('0x2d')],qs[_0x3c14('0x32')](_0x375ae2[_0x3c14('0x2f')][_0x3c14('0x32')]));_0x26c5cd['attributes']=_0x26c5cd[_0x3c14('0x31')]['length']?_0x26c5cd['attributes']:_0x557273[_0x3c14('0x2d')];if(_0x375ae2[_0x3c14('0x2f')][_0x3c14('0x3e')]){_0x26c5cd[_0x3c14('0x3f')]=[{'all':!![]}];}_0x26c5cd=_[_0x3c14('0x3b')]({},_0x26c5cd,_0x375ae2[_0x3c14('0x3d')]);return db[_0x3c14('0x28')]['find'](_0x26c5cd)[_0x3c14('0x24')](handleEntityNotFound(_0x504168,null))['then'](respondWithResult(_0x504168,null))[_0x3c14('0x41')](handleError(_0x504168,null));};exports[_0x3c14('0x45')]=function(_0x207621,_0x5a6ccc){return db['AnalyticTreeReport'][_0x3c14('0x45')](_0x207621[_0x3c14('0x46')],{})[_0x3c14('0x24')](respondWithResult(_0x5a6ccc,0xc9))[_0x3c14('0x41')](handleError(_0x5a6ccc,null));};exports[_0x3c14('0x47')]=function(_0x238243,_0x1c7e96){if(_0x238243[_0x3c14('0x46')]['id']){delete _0x238243['body']['id'];}return db[_0x3c14('0x28')][_0x3c14('0x48')]({'where':{'id':_0x238243[_0x3c14('0x43')]['id']}})[_0x3c14('0x24')](handleEntityNotFound(_0x1c7e96,null))[_0x3c14('0x24')](saveUpdates(_0x238243[_0x3c14('0x46')],null))[_0x3c14('0x24')](respondWithResult(_0x1c7e96,null))[_0x3c14('0x41')](handleError(_0x1c7e96,null));};exports[_0x3c14('0x49')]=function(_0x52c6cf,_0x543ab9){return db[_0x3c14('0x28')][_0x3c14('0x48')]({'where':{'id':_0x52c6cf[_0x3c14('0x43')]['id']}})[_0x3c14('0x24')](handleEntityNotFound(_0x543ab9,null))[_0x3c14('0x24')](removeEntity(_0x543ab9,null))[_0x3c14('0x41')](handleError(_0x543ab9,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index b7c57e8..7a5bf49 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 _0x5ad9=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x26462e,_0x416ff7){var _0x31c3f0=function(_0xd387ea){while(--_0xd387ea){_0x26462e['push'](_0x26462e['shift']());}};_0x31c3f0(++_0x416ff7);}(_0x5ad9,0xc7));var _0x95ad=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5ad9[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x95ad('0x0'));var util=require('util');var logger=require(_0x95ad('0x1'))(_0x95ad('0x2'));var moment=require(_0x95ad('0x3'));var BPromise=require(_0x95ad('0x4'));var rp=require(_0x95ad('0x5'));var fs=require('fs');var path=require(_0x95ad('0x6'));var rimraf=require(_0x95ad('0x7'));var config=require(_0x95ad('0x8'));var attributes=require(_0x95ad('0x9'));module[_0x95ad('0xa')]=function(_0x31cdb4,_0xe49a61){return _0x31cdb4[_0x95ad('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdae9=['analytics_report_trees','util','api','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xdae9,0x155));var _0x9dae=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xdae9[_0x4de586];return _0x46baf5;};'use strict';var _=require('lodash');var util=require(_0x9dae('0x0'));var logger=require('../../config/logger')(_0x9dae('0x1'));var moment=require('moment');var BPromise=require(_0x9dae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9dae('0x3'));var rimraf=require(_0x9dae('0x4'));var config=require(_0x9dae('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x9dae('0x6')]=function(_0x19b8ad,_0x4edb2e){return _0x19b8ad[_0x9dae('0x7')](_0x9dae('0x8'),attributes,{'tableName':_0x9dae('0x9'),'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 081cbaf..1576c04 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x22e162,_0x525978){var _0x34ea12=function(_0xfc0866){while(--_0xfc0866){_0x22e162['push'](_0x22e162['shift']());}};_0x34ea12(++_0x525978);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x34aa7b,_0x2f63a4){var _0x414d26=function(_0x4ba495){while(--_0x4ba495){_0x34aa7b['push'](_0x34aa7b['shift']());}};_0x414d26(++_0x2f63a4);}(_0x1261,0x144));var _0x1126=function(_0x1cd585,_0x54276b){_0x1cd585=_0x1cd585-0x0;var _0x3ca87f=_0x1261[_0x1cd585];return _0x3ca87f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index bc3d99a..ac91afa 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 _0x75da=['isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x59e26c,_0x225c23){var _0x5881af=function(_0x33050c){while(--_0x33050c){_0x59e26c['push'](_0x59e26c['shift']());}};_0x5881af(++_0x225c23);}(_0x75da,0x15d));var _0xa75d=function(_0x5aedbc,_0x41eab8){_0x5aedbc=_0x5aedbc-0x0;var _0xc9a701=_0x75da[_0x5aedbc];return _0xc9a701;};'use strict';var multer=require(_0xa75d('0x0'));var util=require(_0xa75d('0x1'));var path=require(_0xa75d('0x2'));var timeout=require('connect-timeout');var express=require(_0xa75d('0x3'));var router=express[_0xa75d('0x4')]();var fs_extra=require(_0xa75d('0x5'));var auth=require(_0xa75d('0x6'));var interaction=require(_0xa75d('0x7'));var config=require(_0xa75d('0x8'));var controller=require(_0xa75d('0x9'));router[_0xa75d('0xa')]('/',auth[_0xa75d('0xb')](),controller['index']);router[_0xa75d('0xa')](_0xa75d('0xc'),auth[_0xa75d('0xb')](),controller[_0xa75d('0xd')]);router[_0xa75d('0xe')]('/',auth[_0xa75d('0xb')](),controller[_0xa75d('0xf')]);router['put'](_0xa75d('0xc'),auth[_0xa75d('0xb')](),controller[_0xa75d('0x10')]);router[_0xa75d('0x11')](_0xa75d('0xc'),auth[_0xa75d('0xb')](),controller[_0xa75d('0x12')]);module[_0xa75d('0x13')]=router;
\ No newline at end of file
+var _0x0be5=['../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x13639d,_0x3c996b){var _0x52ef14=function(_0x3faf51){while(--_0x3faf51){_0x13639d['push'](_0x13639d['shift']());}};_0x52ef14(++_0x3c996b);}(_0x0be5,0x177));var _0x50be=function(_0x23ca2f,_0x271c2b){_0x23ca2f=_0x23ca2f-0x0;var _0x4f4b51=_0x0be5[_0x23ca2f];return _0x4f4b51;};'use strict';var multer=require(_0x50be('0x0'));var util=require(_0x50be('0x1'));var path=require(_0x50be('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x50be('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x50be('0x4'));var interaction=require(_0x50be('0x5'));var config=require('../../config/environment');var controller=require(_0x50be('0x6'));router[_0x50be('0x7')]('/',auth[_0x50be('0x8')](),controller[_0x50be('0x9')]);router[_0x50be('0x7')](_0x50be('0xa'),auth[_0x50be('0x8')](),controller[_0x50be('0xb')]);router[_0x50be('0xc')]('/',auth['isAuthenticated'](),controller[_0x50be('0xd')]);router[_0x50be('0xe')](_0x50be('0xa'),auth[_0x50be('0x8')](),controller[_0x50be('0xf')]);router[_0x50be('0x10')](_0x50be('0xa'),auth[_0x50be('0x8')](),controller[_0x50be('0x11')]);module[_0x50be('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index abf1a38..8df5ebd 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 _0x402f=['STRING','sequelize'];(function(_0x413280,_0x4e63cf){var _0xd03c26=function(_0x1ee1d2){while(--_0x1ee1d2){_0x413280['push'](_0x413280['shift']());}};_0xd03c26(++_0x4e63cf);}(_0x402f,0x6f));var _0xf402=function(_0x371233,_0x406e5e){_0x371233=_0x371233-0x0;var _0x4bd097=_0x402f[_0x371233];return _0x4bd097;};'use strict';var Sequelize=require(_0xf402('0x0'));module['exports']={'name':{'type':Sequelize[_0xf402('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6658=['sequelize','exports','STRING'];(function(_0x404fff,_0x6ddf8){var _0x31700b=function(_0x1b7fd9){while(--_0x1b7fd9){_0x404fff['push'](_0x404fff['shift']());}};_0x31700b(++_0x6ddf8);}(_0x6658,0x198));var _0x8665=function(_0x4b8793,_0x24d145){_0x4b8793=_0x4b8793-0x0;var _0x3a8b37=_0x6658[_0x4b8793];return _0x3a8b37;};'use strict';var Sequelize=require(_0x8665('0x0'));module[_0x8665('0x1')]={'name':{'type':Sequelize[_0x8665('0x2')]},'basename':{'type':Sequelize[_0x8665('0x2')]},'type':{'type':Sequelize[_0x8665('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index fc95cc5..96d346a 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 _0x5c48=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','Attachment','count','includeAll','include','findAll','rows','show','params','find','catch','clone','get','omit','createdAt','updatedAt','body','create','originalname','filename','file','mimetype','download','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','basename','rimraf','moment','mustache','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','type'];(function(_0x435938,_0x2142c7){var _0x2e660a=function(_0x43378e){while(--_0x43378e){_0x435938['push'](_0x435938['shift']());}};_0x2e660a(++_0x2142c7);}(_0x5c48,0x125));var _0x85c4=function(_0x4c6ee3,_0x296be9){_0x4c6ee3=_0x4c6ee3-0x0;var _0x750506=_0x5c48[_0x4c6ee3];return _0x750506;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85c4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85c4('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x85c4('0x2'));var util=require('util');var path=require('path');var sox=require(_0x85c4('0x3'));var csv=require(_0x85c4('0x4'));var ejs=require(_0x85c4('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85c4('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x85c4('0x7'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x85c4('0x8'));var Redis=require('ioredis');var authService=require(_0x85c4('0x9'));var qs=require(_0x85c4('0xa'));var as=require(_0x85c4('0xb'));var hardwareService=require(_0x85c4('0xc'));var logger=require('../../config/logger')(_0x85c4('0xd'));var utils=require(_0x85c4('0xe'));var config=require(_0x85c4('0xf'));var licenseUtil=require(_0x85c4('0x10'));var db=require(_0x85c4('0x11'))['db'];function respondWithStatusCode(_0x6ac06e,_0x38dfa7){_0x38dfa7=_0x38dfa7||0xcc;return function(_0x4d1638){if(_0x4d1638){return _0x6ac06e[_0x85c4('0x12')](_0x38dfa7);}return _0x6ac06e['status'](_0x38dfa7)['end']();};}function respondWithResult(_0x587549,_0x4758d2){_0x4758d2=_0x4758d2||0xc8;return function(_0x43294d){if(_0x43294d){return _0x587549[_0x85c4('0x13')](_0x4758d2)['json'](_0x43294d);}};}function respondWithFilteredResult(_0x5aeae9,_0x41bc0b){return function(_0x1a670e){if(_0x1a670e){var _0x4f4888=typeof _0x41bc0b[_0x85c4('0x14')]===_0x85c4('0x15')&&typeof _0x41bc0b[_0x85c4('0x16')]==='undefined';var _0xdfd361=_0x1a670e['count'];var _0x3652c9=_0x4f4888?0x0:_0x41bc0b[_0x85c4('0x14')];var _0x3abd05=_0x4f4888?_0x1a670e['count']:_0x41bc0b[_0x85c4('0x14')]+_0x41bc0b[_0x85c4('0x16')];var _0x463634;if(_0x3abd05>=_0xdfd361){_0x3abd05=_0xdfd361;_0x463634=0xc8;}else{_0x463634=0xce;}_0x5aeae9['status'](_0x463634);return _0x5aeae9['set'](_0x85c4('0x17'),_0x3652c9+'-'+_0x3abd05+'/'+_0xdfd361)[_0x85c4('0x18')](_0x1a670e);}return null;};}function patchUpdates(_0x4982ac){return function(_0x31c778){try{jsonpatch[_0x85c4('0x19')](_0x31c778,_0x4982ac,!![]);}catch(_0x244373){return BPromise[_0x85c4('0x1a')](_0x244373);}return _0x31c778[_0x85c4('0x1b')]();};}function saveUpdates(_0x333f14,_0x36fef4){return function(_0x33a00e){if(_0x33a00e){return _0x33a00e[_0x85c4('0x1c')](_0x333f14)[_0x85c4('0x1d')](function(_0x1bb24c){return _0x1bb24c;});}return null;};}function removeEntity(_0x670dc0,_0x1fabf5){return function(_0x3787f0){if(_0x3787f0){return _0x3787f0[_0x85c4('0x1e')]()[_0x85c4('0x1d')](function(){_0x670dc0[_0x85c4('0x13')](0xcc)[_0x85c4('0x1f')]();});}};}function handleEntityNotFound(_0x414dc6,_0x135f60){return function(_0x41ac56){if(!_0x41ac56){_0x414dc6[_0x85c4('0x12')](0x194);}return _0x41ac56;};}function handleError(_0x2624db,_0x484c6b){_0x484c6b=_0x484c6b||0x1f4;return function(_0x23a963){logger['error'](_0x23a963[_0x85c4('0x20')]);if(_0x23a963[_0x85c4('0x21')]){delete _0x23a963[_0x85c4('0x21')];}_0x2624db[_0x85c4('0x13')](_0x484c6b)[_0x85c4('0x22')](_0x23a963);};}exports[_0x85c4('0x23')]=function(_0x11faf3,_0x41f774){var _0xd102e2={},_0x1acc9c={},_0x30958e={'count':0x0,'rows':[]};var _0x106515=_[_0x85c4('0x24')](db['Attachment'][_0x85c4('0x25')],function(_0x37fb57){return{'name':_0x37fb57['fieldName'],'type':_0x37fb57[_0x85c4('0x26')][_0x85c4('0x27')]};});_0x1acc9c[_0x85c4('0x28')]=_[_0x85c4('0x24')](_0x106515,_0x85c4('0x21'));_0x1acc9c[_0x85c4('0x29')]=_[_0x85c4('0x2a')](_0x11faf3['query']);_0x1acc9c[_0x85c4('0x2b')]=_[_0x85c4('0x2c')](_0x1acc9c[_0x85c4('0x28')],_0x1acc9c[_0x85c4('0x29')]);_0xd102e2[_0x85c4('0x2d')]=_[_0x85c4('0x2c')](_0x1acc9c['model'],qs[_0x85c4('0x2e')](_0x11faf3[_0x85c4('0x29')][_0x85c4('0x2e')]));_0xd102e2[_0x85c4('0x2d')]=_0xd102e2['attributes'][_0x85c4('0x2f')]?_0xd102e2['attributes']:_0x1acc9c[_0x85c4('0x28')];if(!_0x11faf3[_0x85c4('0x29')][_0x85c4('0x30')](_0x85c4('0x31'))){_0xd102e2[_0x85c4('0x16')]=qs[_0x85c4('0x16')](_0x11faf3['query'][_0x85c4('0x16')]);_0xd102e2[_0x85c4('0x14')]=qs[_0x85c4('0x14')](_0x11faf3['query']['offset']);}_0xd102e2[_0x85c4('0x32')]=qs['sort'](_0x11faf3[_0x85c4('0x29')][_0x85c4('0x33')]);_0xd102e2[_0x85c4('0x34')]=qs[_0x85c4('0x2b')](_['pick'](_0x11faf3[_0x85c4('0x29')],_0x1acc9c[_0x85c4('0x2b')]),_0x106515);if(_0x11faf3[_0x85c4('0x29')][_0x85c4('0x35')]){_0xd102e2[_0x85c4('0x34')]=_['merge'](_0xd102e2[_0x85c4('0x34')],{'$or':_['map'](_0x106515,function(_0x5eaac2){if(_0x5eaac2[_0x85c4('0x26')]!==_0x85c4('0x36')){var _0x54ffb7={};_0x54ffb7[_0x5eaac2['name']]={'$like':'%'+_0x11faf3[_0x85c4('0x29')][_0x85c4('0x35')]+'%'};return _0x54ffb7;}})});}_0xd102e2=_[_0x85c4('0x37')]({},_0xd102e2,_0x11faf3['options']);var _0x212d56={'where':_0xd102e2[_0x85c4('0x34')]};return db[_0x85c4('0x38')][_0x85c4('0x39')](_0x212d56)[_0x85c4('0x1d')](function(_0x31035f){_0x30958e[_0x85c4('0x39')]=_0x31035f;if(_0x11faf3[_0x85c4('0x29')][_0x85c4('0x3a')]){_0xd102e2[_0x85c4('0x3b')]=[{'all':!![]}];}return db[_0x85c4('0x38')][_0x85c4('0x3c')](_0xd102e2);})[_0x85c4('0x1d')](function(_0x52e552){_0x30958e[_0x85c4('0x3d')]=_0x52e552;return _0x30958e;})[_0x85c4('0x1d')](respondWithFilteredResult(_0x41f774,_0xd102e2))['catch'](handleError(_0x41f774,null));};exports[_0x85c4('0x3e')]=function(_0x22863c,_0x18732a){var _0x2e7a59={'raw':!![],'where':{'id':_0x22863c[_0x85c4('0x3f')]['id']}},_0x586903={};_0x586903[_0x85c4('0x28')]=_[_0x85c4('0x2a')](db['Attachment'][_0x85c4('0x25')]);_0x586903[_0x85c4('0x29')]=_[_0x85c4('0x2a')](_0x22863c[_0x85c4('0x29')]);_0x586903[_0x85c4('0x2b')]=_[_0x85c4('0x2c')](_0x586903[_0x85c4('0x28')],_0x586903[_0x85c4('0x29')]);_0x2e7a59[_0x85c4('0x2d')]=_[_0x85c4('0x2c')](_0x586903['model'],qs['fields'](_0x22863c[_0x85c4('0x29')][_0x85c4('0x2e')]));_0x2e7a59[_0x85c4('0x2d')]=_0x2e7a59['attributes'][_0x85c4('0x2f')]?_0x2e7a59['attributes']:_0x586903['model'];if(_0x22863c['query'][_0x85c4('0x3a')]){_0x2e7a59[_0x85c4('0x3b')]=[{'all':!![]}];}_0x2e7a59=_[_0x85c4('0x37')]({},_0x2e7a59,_0x22863c['options']);return db[_0x85c4('0x38')][_0x85c4('0x40')](_0x2e7a59)[_0x85c4('0x1d')](handleEntityNotFound(_0x18732a,null))[_0x85c4('0x1d')](respondWithResult(_0x18732a,null))[_0x85c4('0x41')](handleError(_0x18732a,null));};exports[_0x85c4('0x42')]=function(_0x176e1e,_0x34cb79){var _0x214683={'where':{'id':_0x176e1e['params']['id']}},_0x5c9d41={};_0x5c9d41[_0x85c4('0x28')]=_[_0x85c4('0x2a')](db[_0x85c4('0x38')][_0x85c4('0x25')]);_0x214683['attributes']=_['intersection'](_0x5c9d41[_0x85c4('0x28')],qs['fields'](_0x176e1e[_0x85c4('0x29')][_0x85c4('0x2e')]));_0x214683[_0x85c4('0x2d')]=_0x214683[_0x85c4('0x2d')][_0x85c4('0x2f')]?_0x214683['attributes']:_0x5c9d41['model'];if(_0x176e1e[_0x85c4('0x29')][_0x85c4('0x3a')]){_0x214683[_0x85c4('0x3b')]=[{'all':!![]}];}_0x214683=_[_0x85c4('0x37')]({},_0x214683,_0x176e1e['options']);return db['Attachment'][_0x85c4('0x40')](_0x214683)[_0x85c4('0x1d')](handleEntityNotFound(_0x34cb79,null))[_0x85c4('0x1d')](function(_0x59d6bd){if(_0x59d6bd){var _0x1759eb=_0x59d6bd[_0x85c4('0x43')]({'plain':!![]});_0x1759eb=qs[_0x85c4('0x44')](_0x1759eb,['id',_0x85c4('0x45'),_0x85c4('0x46')]);_0x176e1e[_0x85c4('0x47')]=_[_0x85c4('0x44')](_0x176e1e[_0x85c4('0x47')],['id',_0x85c4('0x45'),_0x85c4('0x46')]);return db[_0x85c4('0x38')][_0x85c4('0x48')](_[_0x85c4('0x37')](_0x1759eb,_0x176e1e['body']),{'include':_0x176e1e[_0x85c4('0x29')][_0x85c4('0x3a')]?[{'all':!![]}]:undefined});}})[_0x85c4('0x1d')](respondWithResult(_0x34cb79,0xc9))[_0x85c4('0x41')](handleError(_0x34cb79,null));};exports[_0x85c4('0x1c')]=function(_0x5e7bd9,_0x513744){if(_0x5e7bd9[_0x85c4('0x47')]['id']){delete _0x5e7bd9[_0x85c4('0x47')]['id'];}return db['Attachment'][_0x85c4('0x40')]({'where':{'id':_0x5e7bd9[_0x85c4('0x3f')]['id']}})[_0x85c4('0x1d')](handleEntityNotFound(_0x513744,null))[_0x85c4('0x1d')](saveUpdates(_0x5e7bd9[_0x85c4('0x47')],null))[_0x85c4('0x1d')](respondWithResult(_0x513744,null))[_0x85c4('0x41')](handleError(_0x513744,null));};exports[_0x85c4('0x1e')]=function(_0x3fb2f3,_0x21a704){return db[_0x85c4('0x38')]['find']({'where':{'id':_0x3fb2f3[_0x85c4('0x3f')]['id']}})[_0x85c4('0x1d')](handleEntityNotFound(_0x21a704,null))[_0x85c4('0x1d')](removeEntity(_0x21a704,null))['catch'](handleError(_0x21a704,null));};exports['create']=function(_0x2f4fa2,_0x578e7b,_0x42fecb){_0x2f4fa2[_0x85c4('0x47')]['name']=_0x2f4fa2['file'][_0x85c4('0x49')];_0x2f4fa2[_0x85c4('0x47')]['basename']=_0x2f4fa2['file'][_0x85c4('0x4a')];_0x2f4fa2[_0x85c4('0x47')][_0x85c4('0x26')]=_0x2f4fa2[_0x85c4('0x4b')][_0x85c4('0x4c')];return db['Attachment']['create'](_0x2f4fa2['body'])[_0x85c4('0x1d')](respondWithResult(_0x578e7b,0xc9))[_0x85c4('0x41')](handleError(_0x578e7b,null));};exports[_0x85c4('0x4d')]=function(_0x3a7a6b,_0x2c2f5f,_0x21f585){return db[_0x85c4('0x38')]['findOne']({'where':{'id':_0x3a7a6b[_0x85c4('0x3f')]['id']},'raw':!![]})[_0x85c4('0x1d')](handleEntityNotFound(_0x2c2f5f,null))[_0x85c4('0x1d')](function(_0x586912){if(_0x586912){var _0x203147=_0x586912[_0x85c4('0x4e')]!==null;var _0xb53e03=path['join'](config['root'],_0x85c4('0x4f'));if(_0x203147){_0xb53e03=path[_0x85c4('0x50')](_0xb53e03,_0x85c4('0x51'));}var _0x34501d=path['join'](_0xb53e03,_0x586912[_0x85c4('0x52')]);return _0x2c2f5f[_0x85c4('0x4d')](_0x34501d);}})[_0x85c4('0x41')](handleError(_0x2c2f5f,null));};
\ No newline at end of file
+var _0x2c2a=['includeAll','find','get','omit','updatedAt','body','createdAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params'];(function(_0x2efa92,_0x2557f6){var _0x32704b=function(_0x190985){while(--_0x190985){_0x2efa92['push'](_0x2efa92['shift']());}};_0x32704b(++_0x2557f6);}(_0x2c2a,0xc2));var _0xa2c2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2c2a[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xa2c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2c2('0x1'));var jsonpatch=require(_0xa2c2('0x2'));var rp=require('request-promise');var moment=require(_0xa2c2('0x3'));var BPromise=require(_0xa2c2('0x4'));var Mustache=require('mustache');var util=require(_0xa2c2('0x5'));var path=require('path');var sox=require(_0xa2c2('0x6'));var csv=require(_0xa2c2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2c2('0x8'));var _=require('lodash');var squel=require(_0xa2c2('0x9'));var crypto=require(_0xa2c2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa2c2('0xb'));var toCsv=require(_0xa2c2('0x7'));var querystring=require(_0xa2c2('0xc'));var Papa=require('papaparse');var Redis=require(_0xa2c2('0xd'));var authService=require(_0xa2c2('0xe'));var qs=require(_0xa2c2('0xf'));var as=require(_0xa2c2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa2c2('0x11'));var utils=require(_0xa2c2('0x12'));var config=require(_0xa2c2('0x13'));var licenseUtil=require(_0xa2c2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f86f1,_0x8f0b99){_0x8f0b99=_0x8f0b99||0xcc;return function(_0x2eee31){if(_0x2eee31){return _0x3f86f1[_0xa2c2('0x15')](_0x8f0b99);}return _0x3f86f1[_0xa2c2('0x16')](_0x8f0b99)[_0xa2c2('0x17')]();};}function respondWithResult(_0x25161b,_0x2dc2ee){_0x2dc2ee=_0x2dc2ee||0xc8;return function(_0x39e7e4){if(_0x39e7e4){return _0x25161b[_0xa2c2('0x16')](_0x2dc2ee)[_0xa2c2('0x18')](_0x39e7e4);}};}function respondWithFilteredResult(_0xe35aec,_0x2f35ce){return function(_0x1ac1a3){if(_0x1ac1a3){var _0x24c044=typeof _0x2f35ce[_0xa2c2('0x19')]===_0xa2c2('0x1a')&&typeof _0x2f35ce[_0xa2c2('0x1b')]==='undefined';var _0x363c48=_0x1ac1a3['count'];var _0xc40f8d=_0x24c044?0x0:_0x2f35ce['offset'];var _0x331cac=_0x24c044?_0x1ac1a3[_0xa2c2('0x1c')]:_0x2f35ce[_0xa2c2('0x19')]+_0x2f35ce[_0xa2c2('0x1b')];var _0x44ae96;if(_0x331cac>=_0x363c48){_0x331cac=_0x363c48;_0x44ae96=0xc8;}else{_0x44ae96=0xce;}_0xe35aec[_0xa2c2('0x16')](_0x44ae96);return _0xe35aec[_0xa2c2('0x1d')](_0xa2c2('0x1e'),_0xc40f8d+'-'+_0x331cac+'/'+_0x363c48)[_0xa2c2('0x18')](_0x1ac1a3);}return null;};}function patchUpdates(_0x46e0b2){return function(_0x310c48){try{jsonpatch[_0xa2c2('0x1f')](_0x310c48,_0x46e0b2,!![]);}catch(_0x5e41bd){return BPromise[_0xa2c2('0x20')](_0x5e41bd);}return _0x310c48[_0xa2c2('0x21')]();};}function saveUpdates(_0x475b38,_0x1c624c){return function(_0x38c0fd){if(_0x38c0fd){return _0x38c0fd[_0xa2c2('0x22')](_0x475b38)['then'](function(_0x4a6db1){return _0x4a6db1;});}return null;};}function removeEntity(_0x301b78,_0x1ca6f0){return function(_0x155b2b){if(_0x155b2b){return _0x155b2b[_0xa2c2('0x23')]()['then'](function(){_0x301b78[_0xa2c2('0x16')](0xcc)[_0xa2c2('0x17')]();});}};}function handleEntityNotFound(_0x5a97dd,_0x41e197){return function(_0x1eff4a){if(!_0x1eff4a){_0x5a97dd[_0xa2c2('0x15')](0x194);}return _0x1eff4a;};}function handleError(_0x1f09d3,_0x5bb17a){_0x5bb17a=_0x5bb17a||0x1f4;return function(_0x2d92c6){logger['error'](_0x2d92c6['stack']);if(_0x2d92c6[_0xa2c2('0x24')]){delete _0x2d92c6[_0xa2c2('0x24')];}_0x1f09d3[_0xa2c2('0x16')](_0x5bb17a)[_0xa2c2('0x25')](_0x2d92c6);};}exports[_0xa2c2('0x26')]=function(_0x1dc0c2,_0x3f74f5){var _0x8db358={},_0x11be31={},_0x39dec6={'count':0x0,'rows':[]};var _0x303714=_[_0xa2c2('0x27')](db[_0xa2c2('0x28')][_0xa2c2('0x29')],function(_0x497012){return{'name':_0x497012['fieldName'],'type':_0x497012[_0xa2c2('0x2a')][_0xa2c2('0x2b')]};});_0x11be31[_0xa2c2('0x2c')]=_['map'](_0x303714,_0xa2c2('0x24'));_0x11be31[_0xa2c2('0x2d')]=_[_0xa2c2('0x2e')](_0x1dc0c2[_0xa2c2('0x2d')]);_0x11be31['filters']=_[_0xa2c2('0x2f')](_0x11be31['model'],_0x11be31[_0xa2c2('0x2d')]);_0x8db358[_0xa2c2('0x30')]=_[_0xa2c2('0x2f')](_0x11be31[_0xa2c2('0x2c')],qs[_0xa2c2('0x31')](_0x1dc0c2[_0xa2c2('0x2d')][_0xa2c2('0x31')]));_0x8db358['attributes']=_0x8db358[_0xa2c2('0x30')][_0xa2c2('0x32')]?_0x8db358[_0xa2c2('0x30')]:_0x11be31[_0xa2c2('0x2c')];if(!_0x1dc0c2[_0xa2c2('0x2d')]['hasOwnProperty']('nolimit')){_0x8db358[_0xa2c2('0x1b')]=qs[_0xa2c2('0x1b')](_0x1dc0c2['query'][_0xa2c2('0x1b')]);_0x8db358[_0xa2c2('0x19')]=qs['offset'](_0x1dc0c2['query'][_0xa2c2('0x19')]);}_0x8db358[_0xa2c2('0x33')]=qs[_0xa2c2('0x34')](_0x1dc0c2['query'][_0xa2c2('0x34')]);_0x8db358['where']=qs[_0xa2c2('0x35')](_[_0xa2c2('0x36')](_0x1dc0c2[_0xa2c2('0x2d')],_0x11be31[_0xa2c2('0x35')]),_0x303714);if(_0x1dc0c2[_0xa2c2('0x2d')][_0xa2c2('0x37')]){_0x8db358[_0xa2c2('0x38')]=_['merge'](_0x8db358['where'],{'$or':_['map'](_0x303714,function(_0x32a581){if(_0x32a581['type']!==_0xa2c2('0x39')){var _0x25bf74={};_0x25bf74[_0x32a581[_0xa2c2('0x24')]]={'$like':'%'+_0x1dc0c2['query'][_0xa2c2('0x37')]+'%'};return _0x25bf74;}})});}_0x8db358=_[_0xa2c2('0x3a')]({},_0x8db358,_0x1dc0c2[_0xa2c2('0x3b')]);var _0x51b5d5={'where':_0x8db358[_0xa2c2('0x38')]};return db[_0xa2c2('0x28')][_0xa2c2('0x1c')](_0x51b5d5)[_0xa2c2('0x3c')](function(_0x2e031e){_0x39dec6[_0xa2c2('0x1c')]=_0x2e031e;if(_0x1dc0c2[_0xa2c2('0x2d')]['includeAll']){_0x8db358[_0xa2c2('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0xa2c2('0x3e')](_0x8db358);})[_0xa2c2('0x3c')](function(_0x3f36d4){_0x39dec6[_0xa2c2('0x3f')]=_0x3f36d4;return _0x39dec6;})[_0xa2c2('0x3c')](respondWithFilteredResult(_0x3f74f5,_0x8db358))[_0xa2c2('0x40')](handleError(_0x3f74f5,null));};exports[_0xa2c2('0x41')]=function(_0x29ff1b,_0x12a3ab){var _0x20ca88={'raw':!![],'where':{'id':_0x29ff1b[_0xa2c2('0x42')]['id']}},_0x452e1b={};_0x452e1b[_0xa2c2('0x2c')]=_['keys'](db[_0xa2c2('0x28')][_0xa2c2('0x29')]);_0x452e1b[_0xa2c2('0x2d')]=_['keys'](_0x29ff1b['query']);_0x452e1b[_0xa2c2('0x35')]=_[_0xa2c2('0x2f')](_0x452e1b[_0xa2c2('0x2c')],_0x452e1b[_0xa2c2('0x2d')]);_0x20ca88[_0xa2c2('0x30')]=_['intersection'](_0x452e1b[_0xa2c2('0x2c')],qs[_0xa2c2('0x31')](_0x29ff1b['query']['fields']));_0x20ca88[_0xa2c2('0x30')]=_0x20ca88['attributes'][_0xa2c2('0x32')]?_0x20ca88[_0xa2c2('0x30')]:_0x452e1b[_0xa2c2('0x2c')];if(_0x29ff1b[_0xa2c2('0x2d')][_0xa2c2('0x43')]){_0x20ca88[_0xa2c2('0x3d')]=[{'all':!![]}];}_0x20ca88=_[_0xa2c2('0x3a')]({},_0x20ca88,_0x29ff1b[_0xa2c2('0x3b')]);return db[_0xa2c2('0x28')][_0xa2c2('0x44')](_0x20ca88)['then'](handleEntityNotFound(_0x12a3ab,null))[_0xa2c2('0x3c')](respondWithResult(_0x12a3ab,null))[_0xa2c2('0x40')](handleError(_0x12a3ab,null));};exports['clone']=function(_0xced6ac,_0x37e601){var _0x147bb6={'where':{'id':_0xced6ac[_0xa2c2('0x42')]['id']}},_0x2eb8ce={};_0x2eb8ce['model']=_[_0xa2c2('0x2e')](db['Attachment'][_0xa2c2('0x29')]);_0x147bb6[_0xa2c2('0x30')]=_['intersection'](_0x2eb8ce[_0xa2c2('0x2c')],qs['fields'](_0xced6ac[_0xa2c2('0x2d')][_0xa2c2('0x31')]));_0x147bb6[_0xa2c2('0x30')]=_0x147bb6[_0xa2c2('0x30')][_0xa2c2('0x32')]?_0x147bb6['attributes']:_0x2eb8ce[_0xa2c2('0x2c')];if(_0xced6ac[_0xa2c2('0x2d')][_0xa2c2('0x43')]){_0x147bb6[_0xa2c2('0x3d')]=[{'all':!![]}];}_0x147bb6=_[_0xa2c2('0x3a')]({},_0x147bb6,_0xced6ac[_0xa2c2('0x3b')]);return db[_0xa2c2('0x28')][_0xa2c2('0x44')](_0x147bb6)[_0xa2c2('0x3c')](handleEntityNotFound(_0x37e601,null))[_0xa2c2('0x3c')](function(_0x5ef981){if(_0x5ef981){var _0x3ae5c7=_0x5ef981[_0xa2c2('0x45')]({'plain':!![]});_0x3ae5c7=qs[_0xa2c2('0x46')](_0x3ae5c7,['id','createdAt',_0xa2c2('0x47')]);_0xced6ac['body']=_[_0xa2c2('0x46')](_0xced6ac[_0xa2c2('0x48')],['id',_0xa2c2('0x49'),_0xa2c2('0x47')]);return db[_0xa2c2('0x28')]['create'](_['merge'](_0x3ae5c7,_0xced6ac[_0xa2c2('0x48')]),{'include':_0xced6ac[_0xa2c2('0x2d')][_0xa2c2('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x37e601,0xc9))[_0xa2c2('0x40')](handleError(_0x37e601,null));};exports[_0xa2c2('0x22')]=function(_0x249049,_0x1ebbbd){if(_0x249049[_0xa2c2('0x48')]['id']){delete _0x249049[_0xa2c2('0x48')]['id'];}return db['Attachment'][_0xa2c2('0x44')]({'where':{'id':_0x249049[_0xa2c2('0x42')]['id']}})[_0xa2c2('0x3c')](handleEntityNotFound(_0x1ebbbd,null))[_0xa2c2('0x3c')](saveUpdates(_0x249049['body'],null))['then'](respondWithResult(_0x1ebbbd,null))[_0xa2c2('0x40')](handleError(_0x1ebbbd,null));};exports['destroy']=function(_0x40f54a,_0x4ccab6){return db[_0xa2c2('0x28')][_0xa2c2('0x44')]({'where':{'id':_0x40f54a[_0xa2c2('0x42')]['id']}})[_0xa2c2('0x3c')](handleEntityNotFound(_0x4ccab6,null))['then'](removeEntity(_0x4ccab6,null))['catch'](handleError(_0x4ccab6,null));};exports[_0xa2c2('0x4a')]=function(_0x5251bf,_0x31e4ac,_0x487847){_0x5251bf[_0xa2c2('0x48')]['name']=_0x5251bf[_0xa2c2('0x4b')][_0xa2c2('0x4c')];_0x5251bf[_0xa2c2('0x48')][_0xa2c2('0x4d')]=_0x5251bf[_0xa2c2('0x4b')][_0xa2c2('0x4e')];_0x5251bf['body'][_0xa2c2('0x2a')]=_0x5251bf['file'][_0xa2c2('0x4f')];return db[_0xa2c2('0x28')]['create'](_0x5251bf[_0xa2c2('0x48')])[_0xa2c2('0x3c')](respondWithResult(_0x31e4ac,0xc9))[_0xa2c2('0x40')](handleError(_0x31e4ac,null));};exports[_0xa2c2('0x50')]=function(_0x2348e6,_0x11818c,_0x5155c0){return db['Attachment'][_0xa2c2('0x51')]({'where':{'id':_0x2348e6['params']['id']},'raw':!![]})[_0xa2c2('0x3c')](handleEntityNotFound(_0x11818c,null))[_0xa2c2('0x3c')](function(_0x44e6a3){if(_0x44e6a3){var _0x43c441=_0x44e6a3[_0xa2c2('0x52')]!==null;var _0x88a983=path[_0xa2c2('0x53')](config[_0xa2c2('0x54')],_0xa2c2('0x55'));if(_0x43c441){_0x88a983=path[_0xa2c2('0x53')](_0x88a983,_0xa2c2('0x56'));}var _0x20930c=path[_0xa2c2('0x53')](_0x88a983,_0x44e6a3[_0xa2c2('0x4d')]);return _0x11818c[_0xa2c2('0x50')](_0x20930c);}})[_0xa2c2('0x40')](handleError(_0x11818c,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index fa21f72..395ab17 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 _0x02a5=['define','attachments','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x53d081,_0x3e7da8){var _0x2044c9=function(_0x530e45){while(--_0x530e45){_0x53d081['push'](_0x53d081['shift']());}};_0x2044c9(++_0x3e7da8);}(_0x02a5,0x9b));var _0x502a=function(_0x286a2c,_0x587871){_0x286a2c=_0x286a2c-0x0;var _0x356e75=_0x02a5[_0x286a2c];return _0x356e75;};'use strict';var _=require('lodash');var util=require(_0x502a('0x0'));var logger=require(_0x502a('0x1'))(_0x502a('0x2'));var moment=require(_0x502a('0x3'));var BPromise=require(_0x502a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x502a('0x5'));var rimraf=require('rimraf');var config=require(_0x502a('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x341744,_0x308533){return _0x341744[_0x502a('0x7')]('Attachment',attributes,{'tableName':_0x502a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4f6=['attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xb4f6,0x197));var _0x6b4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6b4f('0x0'));var util=require(_0x6b4f('0x1'));var logger=require(_0x6b4f('0x2'))(_0x6b4f('0x3'));var moment=require(_0x6b4f('0x4'));var BPromise=require(_0x6b4f('0x5'));var rp=require(_0x6b4f('0x6'));var fs=require('fs');var path=require(_0x6b4f('0x7'));var rimraf=require('rimraf');var config=require(_0x6b4f('0x8'));var attributes=require(_0x6b4f('0x9'));module[_0x6b4f('0xa')]=function(_0x10c2ea,_0x387d33){return _0x10c2ea[_0x6b4f('0xb')](_0x6b4f('0xc'),attributes,{'tableName':_0x6b4f('0xd'),'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 cc5e109..c3ddea0 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 _0x1ba2=['http','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x34cc39,_0x43ae41){var _0x37f874=function(_0x3aa675){while(--_0x3aa675){_0x34cc39['push'](_0x34cc39['shift']());}};_0x37f874(++_0x43ae41);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x21ba('0x0'));var util=require('util');var moment=require(_0x21ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x21ba('0x2'));var fs=require('fs');var Redis=require(_0x21ba('0x3'));var db=require(_0x21ba('0x4'))['db'];var utils=require(_0x21ba('0x5'));var logger=require(_0x21ba('0x6'))('rpc');var config=require(_0x21ba('0x7'));var jayson=require(_0x21ba('0x8'));var client=jayson['client'][_0x21ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53b3e0,_0x44eb71,_0x23c3b7){return new BPromise(function(_0x5c50aa,_0x17755a){return client['request'](_0x53b3e0,_0x23c3b7)[_0x21ba('0xa')](function(_0x261a15){logger['info'](_0x21ba('0xb'),_0x44eb71,_0x21ba('0xc'));logger[_0x21ba('0xd')](_0x21ba('0xe'),_0x44eb71,_0x21ba('0xc'),JSON[_0x21ba('0xf')](_0x261a15));if(_0x261a15[_0x21ba('0x10')]){if(_0x261a15[_0x21ba('0x10')][_0x21ba('0x11')]===0x1f4){logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15[_0x21ba('0x10')]['message']);return _0x17755a(_0x261a15['error'][_0x21ba('0x12')]);}logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15['error']['message']);return _0x5c50aa(_0x261a15[_0x21ba('0x10')]['message']);}else{logger[_0x21ba('0x13')]('Attachment,\x20%s,\x20%s',_0x44eb71,_0x21ba('0xc'));_0x5c50aa(_0x261a15[_0x21ba('0x14')][_0x21ba('0x12')]);}})[_0x21ba('0x15')](function(_0x10b9e6){logger['error'](_0x21ba('0xb'),_0x44eb71,_0x10b9e6);_0x17755a(_0x10b9e6);});});}exports['CreateAttachment']=function(_0xc995ee){var _0xa1022=this;return new Promise(function(_0x1f2f48,_0x154ef4){return db[_0x21ba('0x16')][_0x21ba('0x17')](_0xc995ee[_0x21ba('0x18')],{'raw':_0xc995ee[_0x21ba('0x19')]?_0xc995ee['options'][_0x21ba('0x1a')]===undefined?!![]:![]:!![]})[_0x21ba('0xa')](function(_0x58ba99){logger[_0x21ba('0x13')]('CreateAttachment',_0xc995ee);logger[_0x21ba('0xd')]('CreateAttachment',_0xc995ee,JSON[_0x21ba('0xf')](_0x58ba99));_0x1f2f48(_0x58ba99);})[_0x21ba('0x15')](function(_0x30ac7a){logger[_0x21ba('0x10')]('CreateAttachment',_0x30ac7a['message'],_0xc995ee);_0x154ef4(_0xa1022['error'](0x1f4,_0x30ac7a['message']));});});};
\ No newline at end of file
+var _0x0e35=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','create','options','lodash','util'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x0e35,0xc2));var _0x50e3=function(_0xb72cda,_0x2f7a3f){_0xb72cda=_0xb72cda-0x0;var _0x58a7a5=_0x0e35[_0xb72cda];return _0x58a7a5;};'use strict';var _=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var moment=require(_0x50e3('0x2'));var BPromise=require(_0x50e3('0x3'));var rs=require(_0x50e3('0x4'));var fs=require('fs');var Redis=require(_0x50e3('0x5'));var db=require(_0x50e3('0x6'))['db'];var utils=require(_0x50e3('0x7'));var logger=require(_0x50e3('0x8'))(_0x50e3('0x9'));var config=require('../../config/environment');var jayson=require(_0x50e3('0xa'));var client=jayson[_0x50e3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5defe6,_0x2ac084,_0x1ed6ec){return new BPromise(function(_0x57bb5f,_0x48382f){return client[_0x50e3('0xc')](_0x5defe6,_0x1ed6ec)[_0x50e3('0xd')](function(_0x3e0a06){logger[_0x50e3('0xe')](_0x50e3('0xf'),_0x2ac084,_0x50e3('0x10'));logger[_0x50e3('0x11')](_0x50e3('0x12'),_0x2ac084,_0x50e3('0x10'),JSON[_0x50e3('0x13')](_0x3e0a06));if(_0x3e0a06[_0x50e3('0x14')]){if(_0x3e0a06[_0x50e3('0x14')][_0x50e3('0x15')]===0x1f4){logger['error'](_0x50e3('0xf'),_0x2ac084,_0x3e0a06[_0x50e3('0x14')][_0x50e3('0x16')]);return _0x48382f(_0x3e0a06[_0x50e3('0x14')]['message']);}logger[_0x50e3('0x14')](_0x50e3('0xf'),_0x2ac084,_0x3e0a06['error'][_0x50e3('0x16')]);return _0x57bb5f(_0x3e0a06[_0x50e3('0x14')][_0x50e3('0x16')]);}else{logger[_0x50e3('0xe')](_0x50e3('0xf'),_0x2ac084,'request\x20sent');_0x57bb5f(_0x3e0a06[_0x50e3('0x17')]['message']);}})[_0x50e3('0x18')](function(_0x1bf9df){logger[_0x50e3('0x14')]('Attachment,\x20%s,\x20%s',_0x2ac084,_0x1bf9df);_0x48382f(_0x1bf9df);});});}exports[_0x50e3('0x19')]=function(_0x2d25e6){var _0x1b4279=this;return new Promise(function(_0x3e56b6,_0x47ea2c){return db['Attachment'][_0x50e3('0x1a')](_0x2d25e6['body'],{'raw':_0x2d25e6[_0x50e3('0x1b')]?_0x2d25e6[_0x50e3('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x635288){logger[_0x50e3('0xe')]('CreateAttachment',_0x2d25e6);logger[_0x50e3('0x11')](_0x50e3('0x19'),_0x2d25e6,JSON[_0x50e3('0x13')](_0x635288));_0x3e56b6(_0x635288);})[_0x50e3('0x18')](function(_0x3fdd65){logger[_0x50e3('0x14')]('CreateAttachment',_0x3fdd65[_0x50e3('0x16')],_0x2d25e6);_0x47ea2c(_0x1b4279[_0x50e3('0x14')](0x1f4,_0x3fdd65[_0x50e3('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 20586a5..1a72ef6 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4af998,_0x12986e){var _0xd87a26=function(_0x2892a7){while(--_0x2892a7){_0x4af998['push'](_0x4af998['shift']());}};_0xd87a26(++_0x12986e);}(_0x2032,0xd9));var _0x2203=function(_0x279d9c,_0x25dd8e){_0x279d9c=_0x279d9c-0x0;var _0x295780=_0x2032[_0x279d9c];return _0x295780;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x1a820e,_0x269a18){var _0x476c5b=function(_0x43c889){while(--_0x43c889){_0x1a820e['push'](_0x1a820e['shift']());}};_0x476c5b(++_0x269a18);}(_0xadb5,0xad));var _0x5adb=function(_0x3c64a0,_0x34e5b7){_0x3c64a0=_0x3c64a0-0x0;var _0xf597cc=_0xadb5[_0x3c64a0];return _0xf597cc;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 607b331..4193d31 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 _0x537f=['clientID','secret','Setting','findOne','allowedLoginAttempts','then','User','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','/login','profile','email','callback','authenticate','google','use'];(function(_0x2d0bfd,_0x2ba336){var _0x4d806c=function(_0x47938d){while(--_0x47938d){_0x2d0bfd['push'](_0x2d0bfd['shift']());}};_0x4d806c(++_0x2ba336);}(_0x537f,0x108));var _0xf537=function(_0x4a9c9d,_0x1d4c19){_0x4a9c9d=_0x4a9c9d-0x0;var _0x3f387a=_0x537f[_0x4a9c9d];return _0x3f387a;};'use strict';var _=require(_0xf537('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xf537('0x1'))[_0xf537('0x2')];var moment=require(_0xf537('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0xf537('0x4'));var signToken=require(_0xf537('0x5'))[_0xf537('0x6')];var utils=require(_0xf537('0x7'));exports[_0xf537('0x8')]=passport['authenticate']('google',{'failureRedirect':_0xf537('0x9'),'scope':[_0xf537('0xa'),_0xf537('0xb')],'session':![]});exports[_0xf537('0xc')]=passport[_0xf537('0xd')](_0xf537('0xe'),{'failureRedirect':_0xf537('0x9'),'session':![]});passport[_0xf537('0xf')](new GoogleStrategy({'clientID':config[_0xf537('0xe')]?config[_0xf537('0xe')][_0xf537('0x10')]:'id','clientSecret':config['google']?config[_0xf537('0xe')]['clientSecret']:_0xf537('0x11'),'callbackURL':config['google']?config[_0xf537('0xe')]['callbackURL']:''},function(_0x40347e,_0x7ba037,_0xf1e951,_0xfe0c9e){var _0x1e1ded,_0x52f841;return db[_0xf537('0x12')][_0xf537('0x13')]({'where':{'id':0x1},'attributes':[_0xf537('0x14'),'blockDuration'],'raw':!![]})[_0xf537('0x15')](function(_0x104fd5){_0x1e1ded=_0x104fd5;return db[_0xf537('0x16')]['find']({'where':{'email':_['map'](_0xf1e951[_0xf537('0x17')],'value'),'role':{'$or':[_0xf537('0x18'),_0xf537('0x19'),_0xf537('0x1a')]}}});})[_0xf537('0x15')](function(_0x3933db){_0x52f841=_0x3933db;if(_0x52f841){if(_0x52f841['disabled']){return _0xfe0c9e(_0xf537('0x1b'));}else if(_0x1e1ded[_0xf537('0x1c')]>0x0){if(_0x52f841[_0xf537('0x1d')]){if(moment(_0x52f841[_0xf537('0x1e')])[_0xf537('0x1f')](_0x1e1ded[_0xf537('0x1c')],_0xf537('0x20'))>moment()){return _0xfe0c9e(_0xf537('0x1b'));}else{return utils[_0xf537('0x21')](_0x52f841,0x0,![],null)['then'](function(){return utils[_0xf537('0x22')](_0x52f841);})[_0xf537('0x15')](function(){return _0xfe0c9e(null,_0x52f841);});}}else{return utils[_0xf537('0x22')](_0x52f841)[_0xf537('0x15')](function(){return _0xfe0c9e(null,_0x52f841);});}}else{return utils[_0xf537('0x22')](_0x52f841)[_0xf537('0x15')](function(){return _0xfe0c9e(null,_0x52f841);});}}return _0xfe0c9e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x4a4b83){_0xfe0c9e(_0x4a4b83);});}));
\ No newline at end of file
+var _0x3ecc=['google','/login','email','callback','use','clientSecret','secret','Setting','allowedLoginAttempts','blockDuration','then','User','find','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x3ecc,0x1df));var _0xc3ec=function(_0x28bafe,_0x216293){_0x28bafe=_0x28bafe-0x0;var _0x1ac283=_0x3ecc[_0x28bafe];return _0x1ac283;};'use strict';var _=require(_0xc3ec('0x0'));var passport=require(_0xc3ec('0x1'));var GoogleStrategy=require(_0xc3ec('0x2'))[_0xc3ec('0x3')];var moment=require(_0xc3ec('0x4'));var db=require(_0xc3ec('0x5'))['db'];var config=require(_0xc3ec('0x6'));var signToken=require(_0xc3ec('0x7'))['signToken'];var utils=require(_0xc3ec('0x8'));exports[_0xc3ec('0x9')]=passport[_0xc3ec('0xa')](_0xc3ec('0xb'),{'failureRedirect':_0xc3ec('0xc'),'scope':['profile',_0xc3ec('0xd')],'session':![]});exports[_0xc3ec('0xe')]=passport[_0xc3ec('0xa')](_0xc3ec('0xb'),{'failureRedirect':_0xc3ec('0xc'),'session':![]});passport[_0xc3ec('0xf')](new GoogleStrategy({'clientID':config[_0xc3ec('0xb')]?config[_0xc3ec('0xb')]['clientID']:'id','clientSecret':config[_0xc3ec('0xb')]?config[_0xc3ec('0xb')][_0xc3ec('0x10')]:_0xc3ec('0x11'),'callbackURL':config['google']?config['google']['callbackURL']:''},function(_0x28a88b,_0x13f06a,_0x462cd0,_0xaf1356){var _0x558cae,_0x72bc3;return db[_0xc3ec('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xc3ec('0x13'),_0xc3ec('0x14')],'raw':!![]})[_0xc3ec('0x15')](function(_0x199a9a){_0x558cae=_0x199a9a;return db[_0xc3ec('0x16')][_0xc3ec('0x17')]({'where':{'email':_['map'](_0x462cd0[_0xc3ec('0x18')],_0xc3ec('0x19')),'role':{'$or':[_0xc3ec('0x1a'),'user',_0xc3ec('0x1b')]}}});})[_0xc3ec('0x15')](function(_0x596989){_0x72bc3=_0x596989;if(_0x72bc3){if(_0x72bc3[_0xc3ec('0x1c')]){return _0xaf1356(_0xc3ec('0x1d'));}else if(_0x558cae[_0xc3ec('0x14')]>0x0){if(_0x72bc3[_0xc3ec('0x1e')]){if(moment(_0x72bc3[_0xc3ec('0x1f')])['add'](_0x558cae[_0xc3ec('0x14')],'minutes')>moment()){return _0xaf1356('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xc3ec('0x20')](_0x72bc3,0x0,![],null)['then'](function(){return utils[_0xc3ec('0x21')](_0x72bc3);})['then'](function(){return _0xaf1356(null,_0x72bc3);});}}else{return utils['getLicense'](_0x72bc3)['then'](function(){return _0xaf1356(null,_0x72bc3);});}}else{return utils[_0xc3ec('0x21')](_0x72bc3)[_0xc3ec('0x15')](function(){return _0xaf1356(null,_0x72bc3);});}}return _0xaf1356('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xc3ec('0x22')](function(_0x531beb){_0xaf1356(_0x531beb);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 4e98fd5..35c117a 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 _0x15ae=['setTokenCookie','passport','./authGoogle.controller','get','login','isMiddleware'];(function(_0x18b58c,_0x3fd0e9){var _0x4cccbf=function(_0x5f87c3){while(--_0x5f87c3){_0x18b58c['push'](_0x18b58c['shift']());}};_0x4cccbf(++_0x3fd0e9);}(_0x15ae,0x10f));var _0xe15a=function(_0x165817,_0x491b00){_0x165817=_0x165817-0x0;var _0x5e4c3b=_0x15ae[_0x165817];return _0x5e4c3b;};'use strict';var express=require('express');var passport=require(_0xe15a('0x0'));var router=express['Router']();var controller=require(_0xe15a('0x1'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xe15a('0x2')]('/',controller[_0xe15a('0x3')]);router[_0xe15a('0x2')]('/callback',controller['callback'],authService[_0xe15a('0x4')],userController[_0xe15a('0x3')],authService[_0xe15a('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0xbb7f=['../../components/auth/service','login','get','/callback','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbb7f,0xe3));var _0xfbb7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbb7f[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require(_0xfbb7('0x0'));var passport=require(_0xfbb7('0x1'));var router=express['Router']();var controller=require(_0xfbb7('0x2'));var userController=require(_0xfbb7('0x3'));var authService=require(_0xfbb7('0x4'));router['get']('/',controller[_0xfbb7('0x5')]);router[_0xfbb7('0x6')](_0xfbb7('0x7'),controller[_0xfbb7('0x8')],authService['isMiddleware'],userController[_0xfbb7('0x5')],authService[_0xfbb7('0x9')]);module[_0xfbb7('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 7ef50ff..890e3ef 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 _0xf151=['User','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','Setting','findOne','then','name','salt','role','disabled','blocked','admin','user','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','blockDuration','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','use'];(function(_0x3faf51,_0x4535f3){var _0x4685b7=function(_0x4c1839){while(--_0x4c1839){_0x3faf51['push'](_0x3faf51['shift']());}};_0x4685b7(++_0x4535f3);}(_0xf151,0xab));var _0x1f15=function(_0x4e5040,_0x2c288a){_0x4e5040=_0x4e5040-0x0;var _0x396234=_0xf151[_0x4e5040];return _0x396234;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x1f15('0x0'))[_0x1f15('0x1')];var jayson=require(_0x1f15('0x2'));var _=require(_0x1f15('0x3'));var rs=require(_0x1f15('0x4'));var moment=require(_0x1f15('0x5'));var db=require(_0x1f15('0x6'))['db'];var authService=require(_0x1f15('0x7'));var utils=require('../../config/utils');var client=jayson[_0x1f15('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4cfc7b,_0x5ecda5,_0x1a1c65,_0x166156){var _0xc7ae4b,_0x5d0bc8;return db[_0x1f15('0x9')][_0x1f15('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x1f15('0xb')](function(_0x2baa12){_0xc7ae4b=_0x2baa12;return _0x4cfc7b[_0x1f15('0xa')]({'attributes':['id',_0x1f15('0xc'),'password',_0x1f15('0xd'),_0x1f15('0xe'),_0x1f15('0xf'),_0x1f15('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x5ecda5,'role':{'$or':[_0x1f15('0x11'),_0x1f15('0x12'),_0x1f15('0x13')]}}});})[_0x1f15('0xb')](function(_0x2b2711){if(!_0x2b2711||_0x2b2711&&_0x2b2711[_0x1f15('0xc')]!==_0x5ecda5){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5d0bc8=_0x2b2711;return _0x5d0bc8;}})[_0x1f15('0xb')](function(){_0x5d0bc8[_0x1f15('0x14')](_0x1a1c65,function(_0x276ee0,_0x387c36){var _0x48ef33=_0x5d0bc8[_0x1f15('0x15')]+0x1;if(_0x276ee0){return _0x166156(_0x276ee0);}else if(!_0x387c36){if(_0x5d0bc8['disabled']){return _0x166156(null,![],{'message':_0x1f15('0x16')});}else if(_0xc7ae4b[_0x1f15('0x17')]>0x0){if(_0x5d0bc8[_0x1f15('0x10')]){if(_0xc7ae4b['blockDuration']>0x0){if(moment(_0x5d0bc8['blockedAt'])[_0x1f15('0x18')](_0xc7ae4b[_0x1f15('0x19')],_0x1f15('0x1a'))>moment()){return _0x166156(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1f15('0x1b')](_0x5d0bc8,_0x48ef33,![],null)['then'](function(){return _0x166156(null,![],{'message':_0x1f15('0x16')});});}}else{return _0x166156(null,![],{'message':_0x1f15('0x16')});}}else{if(_0x48ef33>=_0xc7ae4b['allowedLoginAttempts']){return utils['clearBlockUser'](_0x5d0bc8,0x0,!![],moment())[_0x1f15('0xb')](function(){return _0x166156(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x1f15('0x1b')](_0x5d0bc8,_0x48ef33,![],null)[_0x1f15('0xb')](function(){return _0x166156(null,![],{'message':_0x1f15('0x16')});});}}}else{return _0x166156(null,![],{'message':_0x1f15('0x16')});}}else{if(_0x5d0bc8[_0x1f15('0xf')]){return _0x166156(null,![],{'message':_0x1f15('0x16')});}else if(_0xc7ae4b[_0x1f15('0x17')]>0x0){if(_0x5d0bc8['blocked']){if(_0xc7ae4b['blockDuration']>0x0){if(moment(_0x5d0bc8[_0x1f15('0x1c')])[_0x1f15('0x18')](_0xc7ae4b['blockDuration'],'minutes')>moment()){return _0x166156(null,![],{'message':_0x1f15('0x16')});}else{return utils[_0x1f15('0x1b')](_0x5d0bc8,0x0,![],null)[_0x1f15('0xb')](function(){return utils['getLicense'](_0x5d0bc8);})[_0x1f15('0xb')](function(){return _0x166156(null,_0x5d0bc8);});}}else{return _0x166156(null,![],{'message':_0x1f15('0x16')});}}else{return utils[_0x1f15('0x1b')](_0x5d0bc8,0x0,![],null)[_0x1f15('0xb')](function(){return utils[_0x1f15('0x1d')](_0x5d0bc8);})[_0x1f15('0xb')](function(){return _0x166156(null,_0x5d0bc8);})[_0x1f15('0x1e')](function(_0x317bfc){return _0x166156(null,![],_0x317bfc);});}}else{if(_0x5d0bc8[_0x1f15('0x10')]){return _0x166156(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1f15('0x1d')](_0x5d0bc8)['then'](function(){return _0x166156(null,_0x5d0bc8);});}}}});})[_0x1f15('0x1e')](function(_0xe42369){return _0x166156(null,![],_0xe42369);});}function sendServiceMail(_0x5660e6){return db[_0x1f15('0x1f')][_0x1f15('0x20')]({'where':{'service':!![]},'attributes':['id',_0x1f15('0xc'),'email'],'include':[{'model':db[_0x1f15('0x21')],'as':_0x1f15('0x22')}]})[_0x1f15('0xb')](function(_0x51b054){if(!_0x51b054){throw new Error(_0x1f15('0x23'));}var _0x4a4eff={'tls':{'rejectUnauthorized':![]}};if(_0x51b054[_0x1f15('0x22')]['service']){_0x4a4eff[_0x1f15('0x24')]=_0x51b054[_0x1f15('0x22')][_0x1f15('0x24')];}else{_0x4a4eff[_0x1f15('0x25')]=_0x51b054[_0x1f15('0x22')][_0x1f15('0x25')];_0x4a4eff[_0x1f15('0x26')]=_0x51b054[_0x1f15('0x22')]['port'];_0x4a4eff['secure']=_0x51b054[_0x1f15('0x22')][_0x1f15('0x27')];}if(_0x51b054[_0x1f15('0x22')][_0x1f15('0x28')]){_0x4a4eff[_0x1f15('0x29')]={'user':_0x51b054[_0x1f15('0x22')]['user'],'pass':_0x51b054[_0x1f15('0x22')][_0x1f15('0x2a')]};}var _0x246554={'account':_0x4a4eff,'message':_[_0x1f15('0x2b')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x51b054['name'],_0x51b054['email']||_0x51b054[_0x1f15('0x22')][_0x1f15('0x12')])},_0x5660e6)};return client[_0x1f15('0x2c')](_0x1f15('0x2d'),_0x246554);})['then'](function(_0x1915f4){if(_0x1915f4['error']){throw new Error(util[_0x1f15('0x2e')](_0x1f15('0x2f'),_0x1915f4[_0x1f15('0x30')][_0x1f15('0x31')]||JSON[_0x1f15('0x32')](_0x1915f4[_0x1f15('0x30')])));}return!![];});}function handleError(_0x56fc97,_0x1d2256,_0x24ea8f){return _0x56fc97['status'](_0x1d2256||0x1f4)[_0x1f15('0x33')]({'message':_0x24ea8f?_0x24ea8f[_0x1f15('0x31')]||_0x24ea8f:''});}exports[_0x1f15('0x34')]=function(_0x5dee16,_0x371478,_0x24cc03){passport['authenticate']('local',function(_0x327db9,_0x42d9ca,_0x57d2cf){var _0x21785a=_0x327db9||_0x57d2cf;if(_0x21785a){return handleError(_0x371478,0x191,_0x21785a);}if(!_0x42d9ca){return handleError(_0x371478,0x194,{'message':_0x1f15('0x35')});}else{var _0x54d39d={'payload':{'id':_0x42d9ca['id'],'role':_0x42d9ca[_0x1f15('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x1f15('0x36')](_0x54d39d)['then'](function(_0x112b38){_0x371478['json']({'id':_0x42d9ca['id'],'token':_0x112b38,'statusCall':'','isAlreadyLogged':_0x42d9ca['online']});});}})(_0x5dee16,_0x371478,_0x24cc03);};exports['forgot']=function(_0x49f78b,_0x3f19b9,_0x1a0c9e){if(!_0x49f78b[_0x1f15('0x37')][_0x1f15('0x38')]){return handleError(_0x3f19b9,0x1f4,{'message':_0x1f15('0x39')});}var _0x4fbfae=rs['generate']();_0x49f78b[_0x1f15('0x37')]['email']=_0x49f78b[_0x1f15('0x37')]['email'][_0x1f15('0x3a')]()[_0x1f15('0x3b')]();var _0xadb025;return db[_0x1f15('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x1f15('0x17'),_0x1f15('0x19')],'raw':!![]})[_0x1f15('0xb')](function(_0x110495){_0xadb025=_0x110495;return db['User'][_0x1f15('0x20')]({'where':{'email':_0x49f78b[_0x1f15('0x37')]['email']}});})[_0x1f15('0xb')](function(_0x4d4df4){if(!_0x4d4df4){throw new Error(_0x1f15('0x3c'));}if(_0x4d4df4[_0x1f15('0xf')]){throw new Error(_0x1f15('0x3d'));}if(_0x4d4df4[_0x1f15('0x10')]){if(moment(_0x4d4df4[_0x1f15('0x1c')])[_0x1f15('0x18')](_0xadb025[_0x1f15('0x19')],_0x1f15('0x1a'))>moment()){throw new Error(_0x1f15('0x3e'));}else{_0x4d4df4['blocked']=![];_0x4d4df4[_0x1f15('0x1c')]=null;}}_0x4d4df4[_0x1f15('0x3f')]=_0x4fbfae;_0x4d4df4['resetPasswordExpires']=Date[_0x1f15('0x40')]()+0x36ee80;return _0x4d4df4[_0x1f15('0x41')]();})[_0x1f15('0xb')](function(){return sendServiceMail({'to':_0x49f78b['body'][_0x1f15('0x38')],'subject':_0x1f15('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x1f15('0x43')+'https://'+_0x49f78b[_0x1f15('0x44')][_0x1f15('0x25')]+_0x1f15('0x45')+_0x4fbfae+'\x0a\x0a'+_0x1f15('0x46')});})['then'](function(){_0x3f19b9[_0x1f15('0x47')](0xc8)[_0x1f15('0x33')]({'message':_0x1f15('0x48')});})[_0x1f15('0x1e')](function(_0x37dfdd){return handleError(_0x3f19b9,0x1f4,_0x37dfdd);});};exports[_0x1f15('0x49')]=function(_0x391332,_0x2cbcb7,_0x421eb7){return db['User'][_0x1f15('0x20')]({'where':{'resetPasswordToken':_0x391332[_0x1f15('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date[_0x1f15('0x40')]()}}})[_0x1f15('0xb')](function(_0x265d74){if(!_0x265d74){throw new Error(_0x1f15('0x4b'));}return db[_0x1f15('0x9')]['findOne']({'attributes':['id',_0x1f15('0x4c'),_0x1f15('0x4d'),_0x1f15('0x4e')]})[_0x1f15('0xb')](function(_0x246d33){if(_0x246d33[_0x1f15('0x4c')])authService['validatePasswordPattern'](_0x391332[_0x1f15('0x37')][_0x1f15('0x4f')]);if(!_0x246d33[_0x1f15('0x4d')]||!_0x265d74[_0x1f15('0x50')])return _0x265d74;authService[_0x1f15('0x51')](_0x391332[_0x1f15('0x37')][_0x1f15('0x4f')],_0x265d74['previousPasswords'],_0x246d33['passwordHistoryLimit']);return _0x265d74;})[_0x1f15('0xb')](function(){_0x265d74[_0x1f15('0x4f')]=_0x391332[_0x1f15('0x37')][_0x1f15('0x4f')];_0x265d74[_0x1f15('0x3f')]=null;_0x265d74[_0x1f15('0x52')]=null;return _0x265d74['save']();});})[_0x1f15('0xb')](function(){_0x2cbcb7[_0x1f15('0x47')](0xc8)[_0x1f15('0x33')]({'message':'Password\x20reset!'});})['catch'](function(_0x282756){return handleError(_0x2cbcb7,0x1f4,_0x282756);});};passport[_0x1f15('0x53')](new LocalStrategy({'usernameField':'name','passwordField':_0x1f15('0x4f')},function(_0x4f6118,_0x5ed4c4,_0x29f8cb){return localAuthenticate(db[_0x1f15('0x54')],_0x4f6118,_0x5ed4c4,_0x29f8cb);}));
\ No newline at end of file
+var _0x8a56=['findOne','allowedLoginAttempts','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','minutes','clearBlockUser','catch','getLicense','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting'];(function(_0x41a0b6,_0x626e80){var _0x10ca8a=function(_0x4edd24){while(--_0x4edd24){_0x41a0b6['push'](_0x41a0b6['shift']());}};_0x10ca8a(++_0x626e80);}(_0x8a56,0xf0));var _0x68a5=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x8a56[_0x29aefc];return _0x11be36;};'use strict';var util=require(_0x68a5('0x0'));var passport=require(_0x68a5('0x1'));var LocalStrategy=require(_0x68a5('0x2'))[_0x68a5('0x3')];var jayson=require(_0x68a5('0x4'));var _=require(_0x68a5('0x5'));var rs=require(_0x68a5('0x6'));var moment=require('moment');var db=require(_0x68a5('0x7'))['db'];var authService=require(_0x68a5('0x8'));var utils=require(_0x68a5('0x9'));var client=jayson[_0x68a5('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x3ac385,_0x329c96,_0x185cb1,_0x43d7d2){var _0x123b79,_0x181846;return db[_0x68a5('0xb')][_0x68a5('0xc')]({'where':{'id':0x1},'attributes':[_0x68a5('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x56104e){_0x123b79=_0x56104e;return _0x3ac385[_0x68a5('0xc')]({'attributes':['id',_0x68a5('0xe'),_0x68a5('0xf'),_0x68a5('0x10'),_0x68a5('0x11'),_0x68a5('0x12'),_0x68a5('0x13'),'blockedAt',_0x68a5('0x14')],'where':{'name':_0x329c96,'role':{'$or':[_0x68a5('0x15'),_0x68a5('0x16'),_0x68a5('0x17')]}}});})[_0x68a5('0x18')](function(_0x8521fd){if(!_0x8521fd||_0x8521fd&&_0x8521fd[_0x68a5('0xe')]!==_0x329c96){throw new Error(_0x68a5('0x19'));}else{_0x181846=_0x8521fd;return _0x181846;}})['then'](function(){_0x181846[_0x68a5('0x1a')](_0x185cb1,function(_0x3f2f5b,_0xc8a8bd){var _0x3a83c7=_0x181846[_0x68a5('0x14')]+0x1;if(_0x3f2f5b){return _0x43d7d2(_0x3f2f5b);}else if(!_0xc8a8bd){if(_0x181846['disabled']){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}else if(_0x123b79[_0x68a5('0xd')]>0x0){if(_0x181846[_0x68a5('0x13')]){if(_0x123b79[_0x68a5('0x1b')]>0x0){if(moment(_0x181846[_0x68a5('0x1c')])[_0x68a5('0x1d')](_0x123b79[_0x68a5('0x1b')],_0x68a5('0x1e'))>moment()){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}else{return utils[_0x68a5('0x1f')](_0x181846,_0x3a83c7,![],null)[_0x68a5('0x18')](function(){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});});}}else{return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}}else{if(_0x3a83c7>=_0x123b79[_0x68a5('0xd')]){return utils[_0x68a5('0x1f')](_0x181846,0x0,!![],moment())[_0x68a5('0x18')](function(){return _0x43d7d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x68a5('0x1f')](_0x181846,_0x3a83c7,![],null)[_0x68a5('0x18')](function(){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});});}}}else{return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}}else{if(_0x181846['disabled']){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}else if(_0x123b79[_0x68a5('0xd')]>0x0){if(_0x181846[_0x68a5('0x13')]){if(_0x123b79['blockDuration']>0x0){if(moment(_0x181846[_0x68a5('0x1c')])[_0x68a5('0x1d')](_0x123b79[_0x68a5('0x1b')],_0x68a5('0x1e'))>moment()){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}else{return utils['clearBlockUser'](_0x181846,0x0,![],null)[_0x68a5('0x18')](function(){return utils['getLicense'](_0x181846);})[_0x68a5('0x18')](function(){return _0x43d7d2(null,_0x181846);});}}else{return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}}else{return utils['clearBlockUser'](_0x181846,0x0,![],null)['then'](function(){return utils['getLicense'](_0x181846);})[_0x68a5('0x18')](function(){return _0x43d7d2(null,_0x181846);})[_0x68a5('0x20')](function(_0x333439){return _0x43d7d2(null,![],_0x333439);});}}else{if(_0x181846[_0x68a5('0x13')]){return _0x43d7d2(null,![],{'message':_0x68a5('0x19')});}else{return utils[_0x68a5('0x21')](_0x181846)['then'](function(){return _0x43d7d2(null,_0x181846);});}}}});})['catch'](function(_0x4764fa){return _0x43d7d2(null,![],_0x4764fa);});}function sendServiceMail(_0x4d38e0){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x68a5('0xe'),_0x68a5('0x22')],'include':[{'model':db[_0x68a5('0x23')],'as':_0x68a5('0x24')}]})['then'](function(_0x14a82b){if(!_0x14a82b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x10377a={'tls':{'rejectUnauthorized':![]}};if(_0x14a82b[_0x68a5('0x24')][_0x68a5('0x25')]){_0x10377a[_0x68a5('0x25')]=_0x14a82b[_0x68a5('0x24')][_0x68a5('0x25')];}else{_0x10377a['host']=_0x14a82b[_0x68a5('0x24')][_0x68a5('0x26')];_0x10377a[_0x68a5('0x27')]=_0x14a82b[_0x68a5('0x24')][_0x68a5('0x27')];_0x10377a[_0x68a5('0x28')]=_0x14a82b[_0x68a5('0x24')][_0x68a5('0x28')];}if(_0x14a82b[_0x68a5('0x24')][_0x68a5('0x29')]){_0x10377a[_0x68a5('0x2a')]={'user':_0x14a82b['Smtp']['user'],'pass':_0x14a82b['Smtp']['pass']};}var _0x162267={'account':_0x10377a,'message':_[_0x68a5('0x2b')]({'from':util[_0x68a5('0x2c')](_0x68a5('0x2d'),_0x14a82b[_0x68a5('0xe')],_0x14a82b[_0x68a5('0x22')]||_0x14a82b[_0x68a5('0x24')]['user'])},_0x4d38e0)};return client[_0x68a5('0x2e')](_0x68a5('0x2f'),_0x162267);})['then'](function(_0x4a3257){if(_0x4a3257[_0x68a5('0x30')]){throw new Error(util[_0x68a5('0x2c')](_0x68a5('0x31'),_0x4a3257[_0x68a5('0x30')]['message']||JSON[_0x68a5('0x32')](_0x4a3257[_0x68a5('0x30')])));}return!![];});}function handleError(_0x3c6367,_0x301411,_0x348f04){return _0x3c6367[_0x68a5('0x33')](_0x301411||0x1f4)[_0x68a5('0x34')]({'message':_0x348f04?_0x348f04[_0x68a5('0x35')]||_0x348f04:''});}exports[_0x68a5('0x36')]=function(_0x536d21,_0x2f15c1,_0x483247){passport[_0x68a5('0x1a')](_0x68a5('0x37'),function(_0x50206d,_0x206ed0,_0x28c2ee){var _0x49b0b5=_0x50206d||_0x28c2ee;if(_0x49b0b5){return handleError(_0x2f15c1,0x191,_0x49b0b5);}if(!_0x206ed0){return handleError(_0x2f15c1,0x194,{'message':_0x68a5('0x38')});}else{var _0x1ab720={'payload':{'id':_0x206ed0['id'],'role':_0x206ed0['role']},'options':{'expiresIn':0x15180}};return authService[_0x68a5('0x39')](_0x1ab720)['then'](function(_0x3f4fc4){_0x2f15c1[_0x68a5('0x3a')]({'id':_0x206ed0['id'],'token':_0x3f4fc4,'statusCall':'','isAlreadyLogged':_0x206ed0[_0x68a5('0x3b')]});});}})(_0x536d21,_0x2f15c1,_0x483247);};exports['forgot']=function(_0x319334,_0x369c7f,_0x1d87d5){if(!_0x319334[_0x68a5('0x3c')][_0x68a5('0x22')]){return handleError(_0x369c7f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x538187=rs['generate']();_0x319334[_0x68a5('0x3c')][_0x68a5('0x22')]=_0x319334[_0x68a5('0x3c')]['email']['trim']()[_0x68a5('0x3d')]();var _0x8c80c0;return db['Setting'][_0x68a5('0xc')]({'where':{'id':0x1},'attributes':[_0x68a5('0xd'),_0x68a5('0x1b')],'raw':!![]})['then'](function(_0x158cc3){_0x8c80c0=_0x158cc3;return db[_0x68a5('0x3e')][_0x68a5('0x3f')]({'where':{'email':_0x319334[_0x68a5('0x3c')][_0x68a5('0x22')]}});})[_0x68a5('0x18')](function(_0x35f18a){if(!_0x35f18a){throw new Error(_0x68a5('0x40'));}if(_0x35f18a[_0x68a5('0x12')]){throw new Error(_0x68a5('0x41'));}if(_0x35f18a[_0x68a5('0x13')]){if(moment(_0x35f18a['blockedAt'])[_0x68a5('0x1d')](_0x8c80c0[_0x68a5('0x1b')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x35f18a[_0x68a5('0x13')]=![];_0x35f18a[_0x68a5('0x1c')]=null;}}_0x35f18a[_0x68a5('0x42')]=_0x538187;_0x35f18a[_0x68a5('0x43')]=Date[_0x68a5('0x44')]()+0x36ee80;return _0x35f18a[_0x68a5('0x45')]();})['then'](function(){return sendServiceMail({'to':_0x319334[_0x68a5('0x3c')][_0x68a5('0x22')],'subject':_0x68a5('0x46'),'text':_0x68a5('0x47')+_0x68a5('0x48')+_0x68a5('0x49')+_0x319334[_0x68a5('0x4a')][_0x68a5('0x26')]+'/reset/'+_0x538187+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x369c7f[_0x68a5('0x33')](0xc8)[_0x68a5('0x34')]({'message':_0x68a5('0x4b')});})[_0x68a5('0x20')](function(_0x594703){return handleError(_0x369c7f,0x1f4,_0x594703);});};exports[_0x68a5('0x4c')]=function(_0x1e39e5,_0x247145,_0x168f30){return db[_0x68a5('0x3e')]['find']({'where':{'resetPasswordToken':_0x1e39e5[_0x68a5('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0x68a5('0x44')]()}}})[_0x68a5('0x18')](function(_0x32cecd){if(!_0x32cecd){throw new Error(_0x68a5('0x4e'));}return db[_0x68a5('0xb')][_0x68a5('0xc')]({'attributes':['id',_0x68a5('0x4f'),_0x68a5('0x50'),_0x68a5('0x51')]})[_0x68a5('0x18')](function(_0x53e212){if(_0x53e212[_0x68a5('0x4f')])authService['validatePasswordPattern'](_0x1e39e5['body']['password']);if(!_0x53e212[_0x68a5('0x50')]||!_0x32cecd[_0x68a5('0x52')])return _0x32cecd;authService['validatePasswordHistory'](_0x1e39e5['body'][_0x68a5('0xf')],_0x32cecd[_0x68a5('0x52')],_0x53e212[_0x68a5('0x51')]);return _0x32cecd;})[_0x68a5('0x18')](function(){_0x32cecd[_0x68a5('0xf')]=_0x1e39e5[_0x68a5('0x3c')]['password'];_0x32cecd['resetPasswordToken']=null;_0x32cecd[_0x68a5('0x43')]=null;return _0x32cecd['save']();});})['then'](function(){_0x247145[_0x68a5('0x33')](0xc8)[_0x68a5('0x34')]({'message':_0x68a5('0x53')});})[_0x68a5('0x20')](function(_0xcc3352){return handleError(_0x247145,0x1f4,_0xcc3352);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x68a5('0xf')},function(_0x1e99f7,_0x284665,_0x37cb14){return localAuthenticate(db[_0x68a5('0x3e')],_0x1e99f7,_0x284665,_0x37cb14);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 361b28e..0c5cda0 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 _0x14a5=['forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x48c5b8,_0x48b283){var _0xcc6ccf=function(_0x213faa){while(--_0x213faa){_0x48c5b8['push'](_0x48c5b8['shift']());}};_0xcc6ccf(++_0x48b283);}(_0x14a5,0xd3));var _0x514a=function(_0x58a336,_0x1fb755){_0x58a336=_0x58a336-0x0;var _0x145add=_0x14a5[_0x58a336];return _0x145add;};'use strict';var express=require(_0x514a('0x0'));var router=express[_0x514a('0x1')]();var controller=require(_0x514a('0x2'));router[_0x514a('0x3')]('/',controller['login']);router['post'](_0x514a('0x4'),controller[_0x514a('0x5')]);router[_0x514a('0x3')](_0x514a('0x6'),controller['reset']);module[_0x514a('0x7')]=router;
\ No newline at end of file
+var _0xb363=['login','/forgot','reset','exports','Router','post'];(function(_0x396bd5,_0x474e60){var _0x426082=function(_0x2d5971){while(--_0x2d5971){_0x396bd5['push'](_0x396bd5['shift']());}};_0x426082(++_0x474e60);}(_0xb363,0x8e));var _0x3b36=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb363[_0xefd519];return _0x4bb882;};'use strict';var express=require('express');var router=express[_0x3b36('0x0')]();var controller=require('./authLocal.controller');router[_0x3b36('0x1')]('/',controller[_0x3b36('0x2')]);router[_0x3b36('0x1')](_0x3b36('0x3'),controller['forgot']);router[_0x3b36('0x1')]('/reset/:token',controller[_0x3b36('0x4')]);module[_0x3b36('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 4339d73..c7ebf87 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 _0x762a=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x762a,0x194));var _0xa762=function(_0x4837bf,_0x1115ad){_0x4837bf=_0x4837bf-0x0;var _0x4ae19e=_0x762a[_0x4837bf];return _0x4ae19e;};'use strict';var Sequelize=require(_0xa762('0x0'));module['exports']={'name':{'type':Sequelize[_0xa762('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xa762('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa762('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa762('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x947f=['STRING','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x947f,0x12d));var _0xf947=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x947f[_0x11deef];return _0xe9ba85;};'use strict';var Sequelize=require('sequelize');module[_0xf947('0x0')]={'name':{'type':Sequelize[_0xf947('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xf947('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'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 0294fee..b6c39b7 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 _0x70ee=['includeAll','include','findAll','rows','catch','show','params','model','length','create','body','update','find','addConditions','Condition','ids','omit','getConditions','order','options','Action','addActions','findOne','getActions','zip-dir','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/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x34dd46,_0x589427){var _0x531e94=function(_0x45086f){while(--_0x45086f){_0x34dd46['push'](_0x34dd46['shift']());}};_0x531e94(++_0x589427);}(_0x70ee,0x1c6));var _0xe70e=function(_0x366171,_0x160e18){_0x366171=_0x366171-0x0;var _0x2fb0af=_0x70ee[_0x366171];return _0x2fb0af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe70e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe70e('0x1'));var BPromise=require(_0xe70e('0x2'));var Mustache=require(_0xe70e('0x3'));var util=require(_0xe70e('0x4'));var path=require('path');var sox=require(_0xe70e('0x5'));var csv=require(_0xe70e('0x6'));var ejs=require(_0xe70e('0x7'));var fs=require('fs');var fs_extra=require(_0xe70e('0x8'));var _=require(_0xe70e('0x9'));var squel=require(_0xe70e('0xa'));var crypto=require('crypto');var jsforce=require(_0xe70e('0xb'));var deskjs=require(_0xe70e('0xc'));var toCsv=require(_0xe70e('0x6'));var querystring=require(_0xe70e('0xd'));var Papa=require(_0xe70e('0xe'));var Redis=require(_0xe70e('0xf'));var authService=require(_0xe70e('0x10'));var qs=require(_0xe70e('0x11'));var as=require(_0xe70e('0x12'));var hardwareService=require(_0xe70e('0x13'));var logger=require('../../config/logger')(_0xe70e('0x14'));var utils=require(_0xe70e('0x15'));var config=require(_0xe70e('0x16'));var licenseUtil=require(_0xe70e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e8203,_0x451956){_0x451956=_0x451956||0xcc;return function(_0x322a32){if(_0x322a32){return _0x5e8203['sendStatus'](_0x451956);}return _0x5e8203[_0xe70e('0x18')](_0x451956)[_0xe70e('0x19')]();};}function respondWithResult(_0x547144,_0x26f994){_0x26f994=_0x26f994||0xc8;return function(_0x458572){if(_0x458572){return _0x547144[_0xe70e('0x18')](_0x26f994)[_0xe70e('0x1a')](_0x458572);}};}function respondWithFilteredResult(_0x57a4b0,_0x308156){return function(_0x66baeb){if(_0x66baeb){var _0x352eda=typeof _0x308156[_0xe70e('0x1b')]===_0xe70e('0x1c')&&typeof _0x308156[_0xe70e('0x1d')]===_0xe70e('0x1c');var _0x5a11b5=_0x66baeb[_0xe70e('0x1e')];var _0xf645f8=_0x352eda?0x0:_0x308156[_0xe70e('0x1b')];var _0x1b6d86=_0x352eda?_0x66baeb[_0xe70e('0x1e')]:_0x308156[_0xe70e('0x1b')]+_0x308156[_0xe70e('0x1d')];var _0x3072d5;if(_0x1b6d86>=_0x5a11b5){_0x1b6d86=_0x5a11b5;_0x3072d5=0xc8;}else{_0x3072d5=0xce;}_0x57a4b0[_0xe70e('0x18')](_0x3072d5);return _0x57a4b0[_0xe70e('0x1f')](_0xe70e('0x20'),_0xf645f8+'-'+_0x1b6d86+'/'+_0x5a11b5)['json'](_0x66baeb);}return null;};}function patchUpdates(_0x44967b){return function(_0x5406a3){try{jsonpatch[_0xe70e('0x21')](_0x5406a3,_0x44967b,!![]);}catch(_0x463861){return BPromise[_0xe70e('0x22')](_0x463861);}return _0x5406a3['save']();};}function saveUpdates(_0x3be8a7,_0x3873f8){return function(_0x225533){if(_0x225533){return _0x225533['update'](_0x3be8a7)[_0xe70e('0x23')](function(_0x678372){return _0x678372;});}return null;};}function removeEntity(_0x5c609c,_0x55c9c7){return function(_0x325700){if(_0x325700){return _0x325700[_0xe70e('0x24')]()[_0xe70e('0x23')](function(){_0x5c609c[_0xe70e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6b822,_0xfd934f){return function(_0x1f863f){if(!_0x1f863f){_0x6b822[_0xe70e('0x25')](0x194);}return _0x1f863f;};}function handleError(_0x200631,_0x586d72){_0x586d72=_0x586d72||0x1f4;return function(_0x528567){logger['error'](_0x528567[_0xe70e('0x26')]);if(_0x528567['name']){delete _0x528567[_0xe70e('0x27')];}_0x200631[_0xe70e('0x18')](_0x586d72)[_0xe70e('0x28')](_0x528567);};}exports[_0xe70e('0x29')]=function(_0x14c9b5,_0x1d80a2){var _0x5221de={},_0x4bd08a={},_0x3e967d={'count':0x0,'rows':[]};var _0x10a277=_[_0xe70e('0x2a')](db[_0xe70e('0x2b')][_0xe70e('0x2c')],function(_0x2dacf5){return{'name':_0x2dacf5[_0xe70e('0x2d')],'type':_0x2dacf5[_0xe70e('0x2e')][_0xe70e('0x2f')]};});_0x4bd08a['model']=_[_0xe70e('0x2a')](_0x10a277,_0xe70e('0x27'));_0x4bd08a['query']=_[_0xe70e('0x30')](_0x14c9b5[_0xe70e('0x31')]);_0x4bd08a['filters']=_['intersection'](_0x4bd08a['model'],_0x4bd08a[_0xe70e('0x31')]);_0x5221de[_0xe70e('0x32')]=_[_0xe70e('0x33')](_0x4bd08a['model'],qs[_0xe70e('0x34')](_0x14c9b5[_0xe70e('0x31')][_0xe70e('0x34')]));_0x5221de['attributes']=_0x5221de[_0xe70e('0x32')]['length']?_0x5221de[_0xe70e('0x32')]:_0x4bd08a['model'];if(!_0x14c9b5['query'][_0xe70e('0x35')](_0xe70e('0x36'))){_0x5221de[_0xe70e('0x1d')]=qs[_0xe70e('0x1d')](_0x14c9b5[_0xe70e('0x31')][_0xe70e('0x1d')]);_0x5221de[_0xe70e('0x1b')]=qs[_0xe70e('0x1b')](_0x14c9b5[_0xe70e('0x31')][_0xe70e('0x1b')]);}_0x5221de['order']=qs[_0xe70e('0x37')](_0x14c9b5['query'][_0xe70e('0x37')]);_0x5221de[_0xe70e('0x38')]=qs[_0xe70e('0x39')](_[_0xe70e('0x3a')](_0x14c9b5[_0xe70e('0x31')],_0x4bd08a[_0xe70e('0x39')]),_0x10a277);if(_0x14c9b5[_0xe70e('0x31')][_0xe70e('0x3b')]){_0x5221de[_0xe70e('0x38')]=_[_0xe70e('0x3c')](_0x5221de[_0xe70e('0x38')],{'$or':_['map'](_0x10a277,function(_0x39242a){if(_0x39242a[_0xe70e('0x2e')]!==_0xe70e('0x3d')){var _0x169f37={};_0x169f37[_0x39242a[_0xe70e('0x27')]]={'$like':'%'+_0x14c9b5[_0xe70e('0x31')][_0xe70e('0x3b')]+'%'};return _0x169f37;}})});}_0x5221de=_[_0xe70e('0x3c')]({},_0x5221de,_0x14c9b5['options']);var _0x31477e={'where':_0x5221de['where']};return db[_0xe70e('0x2b')]['count'](_0x31477e)['then'](function(_0xbf5c1d){_0x3e967d[_0xe70e('0x1e')]=_0xbf5c1d;if(_0x14c9b5[_0xe70e('0x31')][_0xe70e('0x3e')]){_0x5221de[_0xe70e('0x3f')]=[{'all':!![]}];}return db[_0xe70e('0x2b')][_0xe70e('0x40')](_0x5221de);})[_0xe70e('0x23')](function(_0x12517b){_0x3e967d[_0xe70e('0x41')]=_0x12517b;return _0x3e967d;})[_0xe70e('0x23')](respondWithFilteredResult(_0x1d80a2,_0x5221de))[_0xe70e('0x42')](handleError(_0x1d80a2,null));};exports[_0xe70e('0x43')]=function(_0x384b8f,_0x279529){var _0x370676={'raw':![],'where':{'id':_0x384b8f[_0xe70e('0x44')]['id']}},_0xd0eaad={};_0xd0eaad['model']=_[_0xe70e('0x30')](db[_0xe70e('0x2b')]['rawAttributes']);_0xd0eaad[_0xe70e('0x31')]=_[_0xe70e('0x30')](_0x384b8f[_0xe70e('0x31')]);_0xd0eaad[_0xe70e('0x39')]=_[_0xe70e('0x33')](_0xd0eaad[_0xe70e('0x45')],_0xd0eaad[_0xe70e('0x31')]);_0x370676[_0xe70e('0x32')]=_[_0xe70e('0x33')](_0xd0eaad[_0xe70e('0x45')],qs[_0xe70e('0x34')](_0x384b8f[_0xe70e('0x31')][_0xe70e('0x34')]));_0x370676[_0xe70e('0x32')]=_0x370676[_0xe70e('0x32')][_0xe70e('0x46')]?_0x370676[_0xe70e('0x32')]:_0xd0eaad['model'];if(_0x384b8f[_0xe70e('0x31')][_0xe70e('0x3e')]){_0x370676[_0xe70e('0x3f')]=[{'all':!![]}];}_0x370676=_[_0xe70e('0x3c')]({},_0x370676,_0x384b8f['options']);return db['Automation']['find'](_0x370676)[_0xe70e('0x23')](handleEntityNotFound(_0x279529,null))['then'](respondWithResult(_0x279529,null))[_0xe70e('0x42')](handleError(_0x279529,null));};exports[_0xe70e('0x47')]=function(_0x5c97d5,_0x547336){return db['Automation'][_0xe70e('0x47')](_0x5c97d5[_0xe70e('0x48')],{})[_0xe70e('0x23')](respondWithResult(_0x547336,0xc9))['catch'](handleError(_0x547336,null));};exports[_0xe70e('0x49')]=function(_0x3070ad,_0x5cbd77){if(_0x3070ad[_0xe70e('0x48')]['id']){delete _0x3070ad['body']['id'];}return db[_0xe70e('0x2b')]['find']({'where':{'id':_0x3070ad[_0xe70e('0x44')]['id']}})[_0xe70e('0x23')](handleEntityNotFound(_0x5cbd77,null))['then'](saveUpdates(_0x3070ad['body'],null))[_0xe70e('0x23')](respondWithResult(_0x5cbd77,null))[_0xe70e('0x42')](handleError(_0x5cbd77,null));};exports[_0xe70e('0x24')]=function(_0x3799eb,_0x19222b){return db[_0xe70e('0x2b')][_0xe70e('0x4a')]({'where':{'id':_0x3799eb[_0xe70e('0x44')]['id']}})[_0xe70e('0x23')](handleEntityNotFound(_0x19222b,null))[_0xe70e('0x23')](removeEntity(_0x19222b,null))[_0xe70e('0x42')](handleError(_0x19222b,null));};exports[_0xe70e('0x4b')]=function(_0x2b4164,_0x145294,_0x398de5){return db[_0xe70e('0x4c')]['find']({'where':{'id':_0x2b4164[_0xe70e('0x44')]['id']}})[_0xe70e('0x23')](handleEntityNotFound(_0x145294,null))[_0xe70e('0x23')](function(_0x38b8d2){if(_0x38b8d2){return _0x38b8d2[_0xe70e('0x4b')](_0x2b4164['body'][_0xe70e('0x4d')],_[_0xe70e('0x4e')](_0x2b4164[_0xe70e('0x48')],[_0xe70e('0x4d'),'id'])||{});}})[_0xe70e('0x23')](respondWithResult(_0x145294,null))['catch'](handleError(_0x145294,null));};exports[_0xe70e('0x4f')]=function(_0x10961b,_0x38a986,_0xb5a8db){var _0x8380b0={};var _0x475c90={};var _0x5d2896;var _0x2e7e9b;return db[_0xe70e('0x2b')]['findOne']({'where':{'id':_0x10961b[_0xe70e('0x44')]['id']}})[_0xe70e('0x23')](handleEntityNotFound(_0x38a986,null))[_0xe70e('0x23')](function(_0x15c4b9){if(_0x15c4b9){_0x5d2896=_0x15c4b9;_0x475c90[_0xe70e('0x45')]=_[_0xe70e('0x30')](db[_0xe70e('0x4c')][_0xe70e('0x2c')]);_0x475c90[_0xe70e('0x31')]=_[_0xe70e('0x30')](_0x10961b[_0xe70e('0x31')]);_0x475c90[_0xe70e('0x39')]=_[_0xe70e('0x33')](_0x475c90[_0xe70e('0x45')],_0x475c90['query']);_0x8380b0[_0xe70e('0x32')]=_[_0xe70e('0x33')](_0x475c90[_0xe70e('0x45')],qs[_0xe70e('0x34')](_0x10961b[_0xe70e('0x31')][_0xe70e('0x34')]));_0x8380b0[_0xe70e('0x32')]=_0x8380b0[_0xe70e('0x32')][_0xe70e('0x46')]?_0x8380b0['attributes']:_0x475c90[_0xe70e('0x45')];_0x8380b0[_0xe70e('0x50')]=qs[_0xe70e('0x37')](_0x10961b['query'][_0xe70e('0x37')]);_0x8380b0[_0xe70e('0x38')]=qs[_0xe70e('0x39')](_[_0xe70e('0x3a')](_0x10961b['query'],_0x475c90['filters']));if(_0x10961b[_0xe70e('0x31')][_0xe70e('0x3b')]){_0x8380b0[_0xe70e('0x38')]=_['merge'](_0x8380b0[_0xe70e('0x38')],{'$or':_['map'](_0x8380b0[_0xe70e('0x32')],function(_0x9cb7cf){var _0x31eb90={};_0x31eb90[_0x9cb7cf]={'$like':'%'+_0x10961b[_0xe70e('0x31')][_0xe70e('0x3b')]+'%'};return _0x31eb90;})});}_0x8380b0=_[_0xe70e('0x3c')]({},_0x8380b0,_0x10961b[_0xe70e('0x51')]);return _0x5d2896['getConditions'](_0x8380b0);}})['then'](function(_0x3ea581){if(_0x3ea581){_0x2e7e9b=_0x3ea581['length'];if(!_0x10961b[_0xe70e('0x31')][_0xe70e('0x35')](_0xe70e('0x36'))){_0x8380b0[_0xe70e('0x1d')]=qs['limit'](_0x10961b[_0xe70e('0x31')][_0xe70e('0x1d')]);_0x8380b0[_0xe70e('0x1b')]=qs[_0xe70e('0x1b')](_0x10961b[_0xe70e('0x31')][_0xe70e('0x1b')]);}return _0x5d2896[_0xe70e('0x4f')](_0x8380b0);}})[_0xe70e('0x23')](function(_0x584567){if(_0x584567){return _0x584567?{'count':_0x2e7e9b,'rows':_0x584567}:null;}})['then'](respondWithResult(_0x38a986,null))[_0xe70e('0x42')](handleError(_0x38a986,null));};exports['addActions']=function(_0x345797,_0x48af3c,_0x389a3f){return db[_0xe70e('0x52')]['find']({'where':{'id':_0x345797['params']['id']}})[_0xe70e('0x23')](handleEntityNotFound(_0x48af3c,null))['then'](function(_0x3a4986){if(_0x3a4986){return _0x3a4986[_0xe70e('0x53')](_0x345797[_0xe70e('0x48')][_0xe70e('0x4d')],_['omit'](_0x345797[_0xe70e('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x48af3c,null))[_0xe70e('0x42')](handleError(_0x48af3c,null));};exports['getActions']=function(_0x348ac5,_0x2b17b5,_0x4841af){var _0x4ae2f2={};var _0x13f050={};var _0x44d894;var _0x56ff2b;return db[_0xe70e('0x2b')][_0xe70e('0x54')]({'where':{'id':_0x348ac5[_0xe70e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b17b5,null))['then'](function(_0x233c11){if(_0x233c11){_0x44d894=_0x233c11;_0x13f050[_0xe70e('0x45')]=_['keys'](db[_0xe70e('0x52')][_0xe70e('0x2c')]);_0x13f050['query']=_[_0xe70e('0x30')](_0x348ac5['query']);_0x13f050[_0xe70e('0x39')]=_[_0xe70e('0x33')](_0x13f050['model'],_0x13f050[_0xe70e('0x31')]);_0x4ae2f2[_0xe70e('0x32')]=_[_0xe70e('0x33')](_0x13f050['model'],qs[_0xe70e('0x34')](_0x348ac5[_0xe70e('0x31')][_0xe70e('0x34')]));_0x4ae2f2['attributes']=_0x4ae2f2[_0xe70e('0x32')][_0xe70e('0x46')]?_0x4ae2f2[_0xe70e('0x32')]:_0x13f050['model'];_0x4ae2f2[_0xe70e('0x50')]=qs[_0xe70e('0x37')](_0x348ac5['query'][_0xe70e('0x37')]);_0x4ae2f2[_0xe70e('0x38')]=qs[_0xe70e('0x39')](_[_0xe70e('0x3a')](_0x348ac5[_0xe70e('0x31')],_0x13f050[_0xe70e('0x39')]));if(_0x348ac5[_0xe70e('0x31')]['filter']){_0x4ae2f2[_0xe70e('0x38')]=_['merge'](_0x4ae2f2['where'],{'$or':_[_0xe70e('0x2a')](_0x4ae2f2[_0xe70e('0x32')],function(_0x2d7dc8){var _0x510067={};_0x510067[_0x2d7dc8]={'$like':'%'+_0x348ac5[_0xe70e('0x31')][_0xe70e('0x3b')]+'%'};return _0x510067;})});}_0x4ae2f2=_[_0xe70e('0x3c')]({},_0x4ae2f2,_0x348ac5[_0xe70e('0x51')]);return _0x44d894[_0xe70e('0x55')](_0x4ae2f2);}})[_0xe70e('0x23')](function(_0x4d747f){if(_0x4d747f){_0x56ff2b=_0x4d747f['length'];if(!_0x348ac5[_0xe70e('0x31')][_0xe70e('0x35')]('nolimit')){_0x4ae2f2[_0xe70e('0x1d')]=qs[_0xe70e('0x1d')](_0x348ac5[_0xe70e('0x31')][_0xe70e('0x1d')]);_0x4ae2f2[_0xe70e('0x1b')]=qs[_0xe70e('0x1b')](_0x348ac5[_0xe70e('0x31')][_0xe70e('0x1b')]);}return _0x44d894[_0xe70e('0x55')](_0x4ae2f2);}})[_0xe70e('0x23')](function(_0x3b40e4){if(_0x3b40e4){return _0x3b40e4?{'count':_0x56ff2b,'rows':_0x3b40e4}:null;}})[_0xe70e('0x23')](respondWithResult(_0x2b17b5,null))[_0xe70e('0x42')](handleError(_0x2b17b5,null));};
\ No newline at end of file
+var _0x181d=['intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','addConditions','Condition','ids','omit','getConditions','addActions','Action','findOne','getActions','nolimit','rimraf','zip-dir','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','query','keys'];(function(_0x45ff8d,_0x5adde4){var _0x4c63cc=function(_0x4535a0){while(--_0x4535a0){_0x45ff8d['push'](_0x45ff8d['shift']());}};_0x4c63cc(++_0x5adde4);}(_0x181d,0xbf));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd181('0x0'));var zipdir=require(_0xd181('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd181('0x2'));var path=require(_0xd181('0x3'));var sox=require(_0xd181('0x4'));var csv=require(_0xd181('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd181('0x6'));var squel=require(_0xd181('0x7'));var crypto=require(_0xd181('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd181('0x5'));var querystring=require('querystring');var Papa=require(_0xd181('0x9'));var Redis=require(_0xd181('0xa'));var authService=require(_0xd181('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd181('0xc'));var logger=require(_0xd181('0xd'))('api');var utils=require(_0xd181('0xe'));var config=require(_0xd181('0xf'));var licenseUtil=require(_0xd181('0x10'));var db=require(_0xd181('0x11'))['db'];function respondWithStatusCode(_0x47fd23,_0x5eaa01){_0x5eaa01=_0x5eaa01||0xcc;return function(_0x2a193e){if(_0x2a193e){return _0x47fd23[_0xd181('0x12')](_0x5eaa01);}return _0x47fd23['status'](_0x5eaa01)[_0xd181('0x13')]();};}function respondWithResult(_0xee752b,_0x1daf7c){_0x1daf7c=_0x1daf7c||0xc8;return function(_0x51522c){if(_0x51522c){return _0xee752b['status'](_0x1daf7c)[_0xd181('0x14')](_0x51522c);}};}function respondWithFilteredResult(_0x409dcc,_0x244058){return function(_0x4cd054){if(_0x4cd054){var _0x115016=typeof _0x244058[_0xd181('0x15')]===_0xd181('0x16')&&typeof _0x244058['limit']===_0xd181('0x16');var _0x1c6c0b=_0x4cd054[_0xd181('0x17')];var _0x534188=_0x115016?0x0:_0x244058[_0xd181('0x15')];var _0x193f8d=_0x115016?_0x4cd054[_0xd181('0x17')]:_0x244058[_0xd181('0x15')]+_0x244058['limit'];var _0x59b973;if(_0x193f8d>=_0x1c6c0b){_0x193f8d=_0x1c6c0b;_0x59b973=0xc8;}else{_0x59b973=0xce;}_0x409dcc[_0xd181('0x18')](_0x59b973);return _0x409dcc[_0xd181('0x19')]('Content-Range',_0x534188+'-'+_0x193f8d+'/'+_0x1c6c0b)[_0xd181('0x14')](_0x4cd054);}return null;};}function patchUpdates(_0x33a715){return function(_0x1a0fce){try{jsonpatch[_0xd181('0x1a')](_0x1a0fce,_0x33a715,!![]);}catch(_0x57b195){return BPromise[_0xd181('0x1b')](_0x57b195);}return _0x1a0fce[_0xd181('0x1c')]();};}function saveUpdates(_0x1f6860,_0x281abb){return function(_0x3061c3){if(_0x3061c3){return _0x3061c3[_0xd181('0x1d')](_0x1f6860)[_0xd181('0x1e')](function(_0x371a00){return _0x371a00;});}return null;};}function removeEntity(_0x194cc8,_0x5938ed){return function(_0x4e7feb){if(_0x4e7feb){return _0x4e7feb[_0xd181('0x1f')]()[_0xd181('0x1e')](function(){_0x194cc8[_0xd181('0x18')](0xcc)[_0xd181('0x13')]();});}};}function handleEntityNotFound(_0xc34d42,_0x2fc6c7){return function(_0x54126d){if(!_0x54126d){_0xc34d42[_0xd181('0x12')](0x194);}return _0x54126d;};}function handleError(_0x16ea54,_0x2f2aac){_0x2f2aac=_0x2f2aac||0x1f4;return function(_0x376460){logger['error'](_0x376460[_0xd181('0x20')]);if(_0x376460[_0xd181('0x21')]){delete _0x376460[_0xd181('0x21')];}_0x16ea54['status'](_0x2f2aac)[_0xd181('0x22')](_0x376460);};}exports['index']=function(_0x36c63d,_0x3a3b01){var _0xdeebd3={},_0x383166={},_0x3512b1={'count':0x0,'rows':[]};var _0x41708f=_[_0xd181('0x23')](db[_0xd181('0x24')][_0xd181('0x25')],function(_0x8143ba){return{'name':_0x8143ba[_0xd181('0x26')],'type':_0x8143ba[_0xd181('0x27')][_0xd181('0x28')]};});_0x383166['model']=_[_0xd181('0x23')](_0x41708f,_0xd181('0x21'));_0x383166[_0xd181('0x29')]=_[_0xd181('0x2a')](_0x36c63d[_0xd181('0x29')]);_0x383166['filters']=_[_0xd181('0x2b')](_0x383166[_0xd181('0x2c')],_0x383166[_0xd181('0x29')]);_0xdeebd3['attributes']=_[_0xd181('0x2b')](_0x383166['model'],qs[_0xd181('0x2d')](_0x36c63d[_0xd181('0x29')][_0xd181('0x2d')]));_0xdeebd3[_0xd181('0x2e')]=_0xdeebd3[_0xd181('0x2e')]['length']?_0xdeebd3[_0xd181('0x2e')]:_0x383166[_0xd181('0x2c')];if(!_0x36c63d[_0xd181('0x29')][_0xd181('0x2f')]('nolimit')){_0xdeebd3[_0xd181('0x30')]=qs[_0xd181('0x30')](_0x36c63d[_0xd181('0x29')][_0xd181('0x30')]);_0xdeebd3[_0xd181('0x15')]=qs['offset'](_0x36c63d[_0xd181('0x29')][_0xd181('0x15')]);}_0xdeebd3[_0xd181('0x31')]=qs['sort'](_0x36c63d[_0xd181('0x29')][_0xd181('0x32')]);_0xdeebd3[_0xd181('0x33')]=qs[_0xd181('0x34')](_[_0xd181('0x35')](_0x36c63d[_0xd181('0x29')],_0x383166[_0xd181('0x34')]),_0x41708f);if(_0x36c63d[_0xd181('0x29')][_0xd181('0x36')]){_0xdeebd3[_0xd181('0x33')]=_['merge'](_0xdeebd3[_0xd181('0x33')],{'$or':_[_0xd181('0x23')](_0x41708f,function(_0xee1967){if(_0xee1967[_0xd181('0x27')]!=='VIRTUAL'){var _0x1c3370={};_0x1c3370[_0xee1967[_0xd181('0x21')]]={'$like':'%'+_0x36c63d['query'][_0xd181('0x36')]+'%'};return _0x1c3370;}})});}_0xdeebd3=_[_0xd181('0x37')]({},_0xdeebd3,_0x36c63d[_0xd181('0x38')]);var _0x479596={'where':_0xdeebd3[_0xd181('0x33')]};return db['Automation'][_0xd181('0x17')](_0x479596)[_0xd181('0x1e')](function(_0x147365){_0x3512b1[_0xd181('0x17')]=_0x147365;if(_0x36c63d[_0xd181('0x29')]['includeAll']){_0xdeebd3[_0xd181('0x39')]=[{'all':!![]}];}return db[_0xd181('0x24')][_0xd181('0x3a')](_0xdeebd3);})[_0xd181('0x1e')](function(_0x13feed){_0x3512b1[_0xd181('0x3b')]=_0x13feed;return _0x3512b1;})[_0xd181('0x1e')](respondWithFilteredResult(_0x3a3b01,_0xdeebd3))[_0xd181('0x3c')](handleError(_0x3a3b01,null));};exports[_0xd181('0x3d')]=function(_0x19b46c,_0x365fbb){var _0x378938={'raw':![],'where':{'id':_0x19b46c['params']['id']}},_0x238564={};_0x238564[_0xd181('0x2c')]=_[_0xd181('0x2a')](db['Automation'][_0xd181('0x25')]);_0x238564[_0xd181('0x29')]=_[_0xd181('0x2a')](_0x19b46c[_0xd181('0x29')]);_0x238564[_0xd181('0x34')]=_['intersection'](_0x238564[_0xd181('0x2c')],_0x238564[_0xd181('0x29')]);_0x378938[_0xd181('0x2e')]=_['intersection'](_0x238564['model'],qs['fields'](_0x19b46c[_0xd181('0x29')]['fields']));_0x378938[_0xd181('0x2e')]=_0x378938[_0xd181('0x2e')][_0xd181('0x3e')]?_0x378938[_0xd181('0x2e')]:_0x238564[_0xd181('0x2c')];if(_0x19b46c[_0xd181('0x29')][_0xd181('0x3f')]){_0x378938[_0xd181('0x39')]=[{'all':!![]}];}_0x378938=_[_0xd181('0x37')]({},_0x378938,_0x19b46c[_0xd181('0x38')]);return db[_0xd181('0x24')][_0xd181('0x40')](_0x378938)[_0xd181('0x1e')](handleEntityNotFound(_0x365fbb,null))[_0xd181('0x1e')](respondWithResult(_0x365fbb,null))[_0xd181('0x3c')](handleError(_0x365fbb,null));};exports[_0xd181('0x41')]=function(_0x10055b,_0x1ffb8c){return db[_0xd181('0x24')]['create'](_0x10055b[_0xd181('0x42')],{})[_0xd181('0x1e')](respondWithResult(_0x1ffb8c,0xc9))[_0xd181('0x3c')](handleError(_0x1ffb8c,null));};exports[_0xd181('0x1d')]=function(_0x5d2a6a,_0x28c715){if(_0x5d2a6a['body']['id']){delete _0x5d2a6a[_0xd181('0x42')]['id'];}return db[_0xd181('0x24')][_0xd181('0x40')]({'where':{'id':_0x5d2a6a[_0xd181('0x43')]['id']}})['then'](handleEntityNotFound(_0x28c715,null))['then'](saveUpdates(_0x5d2a6a['body'],null))[_0xd181('0x1e')](respondWithResult(_0x28c715,null))[_0xd181('0x3c')](handleError(_0x28c715,null));};exports[_0xd181('0x1f')]=function(_0x1b1f41,_0x376c88){return db[_0xd181('0x24')][_0xd181('0x40')]({'where':{'id':_0x1b1f41[_0xd181('0x43')]['id']}})[_0xd181('0x1e')](handleEntityNotFound(_0x376c88,null))[_0xd181('0x1e')](removeEntity(_0x376c88,null))[_0xd181('0x3c')](handleError(_0x376c88,null));};exports[_0xd181('0x44')]=function(_0xe3711d,_0x50b7a3,_0x574785){return db[_0xd181('0x45')][_0xd181('0x40')]({'where':{'id':_0xe3711d['params']['id']}})[_0xd181('0x1e')](handleEntityNotFound(_0x50b7a3,null))[_0xd181('0x1e')](function(_0x46a4db){if(_0x46a4db){return _0x46a4db[_0xd181('0x44')](_0xe3711d['body'][_0xd181('0x46')],_[_0xd181('0x47')](_0xe3711d[_0xd181('0x42')],['ids','id'])||{});}})['then'](respondWithResult(_0x50b7a3,null))[_0xd181('0x3c')](handleError(_0x50b7a3,null));};exports[_0xd181('0x48')]=function(_0x42d31d,_0x3dce33,_0x1b7103){var _0x39b478={};var _0x31d2ed={};var _0x20bfa8;var _0x58fb97;return db[_0xd181('0x24')]['findOne']({'where':{'id':_0x42d31d[_0xd181('0x43')]['id']}})['then'](handleEntityNotFound(_0x3dce33,null))[_0xd181('0x1e')](function(_0x220bce){if(_0x220bce){_0x20bfa8=_0x220bce;_0x31d2ed[_0xd181('0x2c')]=_[_0xd181('0x2a')](db['Condition']['rawAttributes']);_0x31d2ed['query']=_['keys'](_0x42d31d['query']);_0x31d2ed['filters']=_[_0xd181('0x2b')](_0x31d2ed[_0xd181('0x2c')],_0x31d2ed['query']);_0x39b478[_0xd181('0x2e')]=_['intersection'](_0x31d2ed[_0xd181('0x2c')],qs[_0xd181('0x2d')](_0x42d31d[_0xd181('0x29')][_0xd181('0x2d')]));_0x39b478[_0xd181('0x2e')]=_0x39b478[_0xd181('0x2e')][_0xd181('0x3e')]?_0x39b478[_0xd181('0x2e')]:_0x31d2ed[_0xd181('0x2c')];_0x39b478[_0xd181('0x31')]=qs[_0xd181('0x32')](_0x42d31d[_0xd181('0x29')]['sort']);_0x39b478['where']=qs['filters'](_['pick'](_0x42d31d[_0xd181('0x29')],_0x31d2ed[_0xd181('0x34')]));if(_0x42d31d[_0xd181('0x29')][_0xd181('0x36')]){_0x39b478[_0xd181('0x33')]=_[_0xd181('0x37')](_0x39b478[_0xd181('0x33')],{'$or':_[_0xd181('0x23')](_0x39b478[_0xd181('0x2e')],function(_0xddfb59){var _0x28e8e2={};_0x28e8e2[_0xddfb59]={'$like':'%'+_0x42d31d[_0xd181('0x29')][_0xd181('0x36')]+'%'};return _0x28e8e2;})});}_0x39b478=_[_0xd181('0x37')]({},_0x39b478,_0x42d31d[_0xd181('0x38')]);return _0x20bfa8[_0xd181('0x48')](_0x39b478);}})[_0xd181('0x1e')](function(_0x17f510){if(_0x17f510){_0x58fb97=_0x17f510['length'];if(!_0x42d31d[_0xd181('0x29')][_0xd181('0x2f')]('nolimit')){_0x39b478[_0xd181('0x30')]=qs['limit'](_0x42d31d[_0xd181('0x29')][_0xd181('0x30')]);_0x39b478[_0xd181('0x15')]=qs[_0xd181('0x15')](_0x42d31d[_0xd181('0x29')][_0xd181('0x15')]);}return _0x20bfa8[_0xd181('0x48')](_0x39b478);}})[_0xd181('0x1e')](function(_0x1c48d8){if(_0x1c48d8){return _0x1c48d8?{'count':_0x58fb97,'rows':_0x1c48d8}:null;}})[_0xd181('0x1e')](respondWithResult(_0x3dce33,null))['catch'](handleError(_0x3dce33,null));};exports[_0xd181('0x49')]=function(_0x2b868d,_0x35a5a0,_0x4cb3ce){return db[_0xd181('0x4a')][_0xd181('0x40')]({'where':{'id':_0x2b868d[_0xd181('0x43')]['id']}})[_0xd181('0x1e')](handleEntityNotFound(_0x35a5a0,null))['then'](function(_0x385c49){if(_0x385c49){return _0x385c49[_0xd181('0x49')](_0x2b868d[_0xd181('0x42')][_0xd181('0x46')],_[_0xd181('0x47')](_0x2b868d[_0xd181('0x42')],[_0xd181('0x46'),'id'])||{});}})[_0xd181('0x1e')](respondWithResult(_0x35a5a0,null))[_0xd181('0x3c')](handleError(_0x35a5a0,null));};exports['getActions']=function(_0x54ecf4,_0x2d1923,_0x4b4644){var _0x44078f={};var _0x4f525d={};var _0x50b41b;var _0x3bd647;return db[_0xd181('0x24')][_0xd181('0x4b')]({'where':{'id':_0x54ecf4['params']['id']}})[_0xd181('0x1e')](handleEntityNotFound(_0x2d1923,null))['then'](function(_0x4d668b){if(_0x4d668b){_0x50b41b=_0x4d668b;_0x4f525d[_0xd181('0x2c')]=_[_0xd181('0x2a')](db[_0xd181('0x4a')][_0xd181('0x25')]);_0x4f525d[_0xd181('0x29')]=_[_0xd181('0x2a')](_0x54ecf4[_0xd181('0x29')]);_0x4f525d[_0xd181('0x34')]=_['intersection'](_0x4f525d[_0xd181('0x2c')],_0x4f525d['query']);_0x44078f[_0xd181('0x2e')]=_['intersection'](_0x4f525d[_0xd181('0x2c')],qs[_0xd181('0x2d')](_0x54ecf4[_0xd181('0x29')][_0xd181('0x2d')]));_0x44078f[_0xd181('0x2e')]=_0x44078f[_0xd181('0x2e')][_0xd181('0x3e')]?_0x44078f[_0xd181('0x2e')]:_0x4f525d[_0xd181('0x2c')];_0x44078f[_0xd181('0x31')]=qs[_0xd181('0x32')](_0x54ecf4[_0xd181('0x29')][_0xd181('0x32')]);_0x44078f['where']=qs[_0xd181('0x34')](_['pick'](_0x54ecf4[_0xd181('0x29')],_0x4f525d[_0xd181('0x34')]));if(_0x54ecf4[_0xd181('0x29')][_0xd181('0x36')]){_0x44078f['where']=_[_0xd181('0x37')](_0x44078f[_0xd181('0x33')],{'$or':_[_0xd181('0x23')](_0x44078f[_0xd181('0x2e')],function(_0x599252){var _0x2c5756={};_0x2c5756[_0x599252]={'$like':'%'+_0x54ecf4[_0xd181('0x29')][_0xd181('0x36')]+'%'};return _0x2c5756;})});}_0x44078f=_[_0xd181('0x37')]({},_0x44078f,_0x54ecf4[_0xd181('0x38')]);return _0x50b41b[_0xd181('0x4c')](_0x44078f);}})[_0xd181('0x1e')](function(_0x4dc2d8){if(_0x4dc2d8){_0x3bd647=_0x4dc2d8[_0xd181('0x3e')];if(!_0x54ecf4[_0xd181('0x29')][_0xd181('0x2f')](_0xd181('0x4d'))){_0x44078f[_0xd181('0x30')]=qs[_0xd181('0x30')](_0x54ecf4['query'][_0xd181('0x30')]);_0x44078f['offset']=qs[_0xd181('0x15')](_0x54ecf4[_0xd181('0x29')][_0xd181('0x15')]);}return _0x50b41b['getActions'](_0x44078f);}})[_0xd181('0x1e')](function(_0x4e8138){if(_0x4e8138){return _0x4e8138?{'count':_0x3bd647,'rows':_0x4e8138}:null;}})['then'](respondWithResult(_0x2d1923,null))[_0xd181('0x3c')](handleError(_0x2d1923,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3769046..e2abf96 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 _0xeb61=['exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x3cd91b,_0x2619fc){var _0x31c1c7=function(_0x391981){while(--_0x391981){_0x3cd91b['push'](_0x3cd91b['shift']());}};_0x31c1c7(++_0x2619fc);}(_0xeb61,0x1a8));var _0x1eb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb61[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1eb6('0x0'));var util=require(_0x1eb6('0x1'));var logger=require(_0x1eb6('0x2'))(_0x1eb6('0x3'));var moment=require(_0x1eb6('0x4'));var BPromise=require(_0x1eb6('0x5'));var rp=require(_0x1eb6('0x6'));var fs=require('fs');var path=require(_0x1eb6('0x7'));var rimraf=require(_0x1eb6('0x8'));var config=require(_0x1eb6('0x9'));var attributes=require(_0x1eb6('0xa'));module[_0x1eb6('0xb')]=function(_0x3f9500,_0x4a0122){return _0x3f9500[_0x1eb6('0xc')](_0x1eb6('0xd'),attributes,{'tableName':_0x1eb6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf446=['define','lodash','util','request-promise','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x4b2c99,_0x4d101f){var _0xb4e918=function(_0x1a0375){while(--_0x1a0375){_0x4b2c99['push'](_0x4b2c99['shift']());}};_0xb4e918(++_0x4d101f);}(_0xf446,0x189));var _0x6f44=function(_0x5f5327,_0x52b78c){_0x5f5327=_0x5f5327-0x0;var _0x21301b=_0xf446[_0x5f5327];return _0x21301b;};'use strict';var _=require(_0x6f44('0x0'));var util=require(_0x6f44('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f44('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f44('0x3'));var config=require(_0x6f44('0x4'));var attributes=require(_0x6f44('0x5'));module[_0x6f44('0x6')]=function(_0x34526d,_0x3bb0a9){return _0x34526d[_0x6f44('0x7')]('Automation',attributes,{'tableName':'tools_automations','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 4773208..b10074a 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 _0x5942=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2135df,_0x16cd72){var _0x24397e=function(_0x3d3ac7){while(--_0x3d3ac7){_0x2135df['push'](_0x2135df['shift']());}};_0x24397e(++_0x16cd72);}(_0x5942,0x16a));var _0x2594=function(_0x4fa40f,_0x14d5c5){_0x4fa40f=_0x4fa40f-0x0;var _0x2b0e0c=_0x5942[_0x4fa40f];return _0x2b0e0c;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x381472,_0xd0ada5,_0x3d20aa){return new BPromise(function(_0x5707a0,_0x2b42d3){return client[_0x2594('0xc')](_0x381472,_0x3d20aa)['then'](function(_0x29517f){logger['info'](_0x2594('0xd'),_0xd0ada5,_0x2594('0xe'));logger[_0x2594('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0xd0ada5,_0x2594('0xe'),JSON[_0x2594('0x10')](_0x29517f));if(_0x29517f[_0x2594('0x11')]){if(_0x29517f[_0x2594('0x11')]['code']===0x1f4){logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);return _0x2b42d3(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')]['message']);return _0x5707a0(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}else{logger['info'](_0x2594('0xd'),_0xd0ada5,'request\x20sent');_0x5707a0(_0x29517f[_0x2594('0x13')][_0x2594('0x12')]);}})[_0x2594('0x14')](function(_0x33b4bc){logger[_0x2594('0x11')]('Automation,\x20%s,\x20%s',_0xd0ada5,_0x33b4bc);_0x2b42d3(_0x33b4bc);});});}
\ No newline at end of file
+var _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x5e8584,_0xab5d1f){var _0x500b5a=function(_0x5b4223){while(--_0x5b4223){_0x5e8584['push'](_0x5e8584['shift']());}};_0x500b5a(++_0xab5d1f);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x7e9e04,_0xb3b10){_0x7e9e04=_0x7e9e04-0x0;var _0x1e501b=_0xcf2f[_0x7e9e04];return _0x1e501b;};'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});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1148158..aeae7c4 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 _0xeec3=['destroy','multer','util','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','post','create','addActions','put','update'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xeec3,0x1c3));var _0x3eec=function(_0x3178be,_0x45cb3e){_0x3178be=_0x3178be-0x0;var _0x118180=_0xeec3[_0x3178be];return _0x118180;};'use strict';var multer=require(_0x3eec('0x0'));var util=require(_0x3eec('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(_0x3eec('0x2'));var interaction=require(_0x3eec('0x3'));var config=require('../../config/environment');var controller=require(_0x3eec('0x4'));router['get']('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0x6')]);router['get'](_0x3eec('0x7'),auth[_0x3eec('0x5')](),controller[_0x3eec('0x8')]);router[_0x3eec('0x9')](_0x3eec('0xa'),auth[_0x3eec('0x5')](),controller[_0x3eec('0xb')]);router[_0x3eec('0x9')]('/:id/actions',auth[_0x3eec('0x5')](),controller['getActions']);router[_0x3eec('0xc')]('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0xd')]);router[_0x3eec('0xc')]('/:id/conditions',auth[_0x3eec('0x5')](),controller['addConditions']);router['post']('/:id/actions',auth[_0x3eec('0x5')](),controller[_0x3eec('0xe')]);router[_0x3eec('0xf')](_0x3eec('0x7'),auth['isAuthenticated'](),controller[_0x3eec('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3eec('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x5da1=['addConditions','addActions','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','getActions','post','create'];(function(_0x5d31c5,_0x5414c8){var _0x48ff31=function(_0x381a23){while(--_0x381a23){_0x5d31c5['push'](_0x5d31c5['shift']());}};_0x48ff31(++_0x5414c8);}(_0x5da1,0xbf));var _0x15da=function(_0x2e150a,_0x3253d3){_0x2e150a=_0x2e150a-0x0;var _0x16cc6f=_0x5da1[_0x2e150a];return _0x16cc6f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x15da('0x0'));var express=require(_0x15da('0x1'));var router=express[_0x15da('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x15da('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x15da('0x4'));var controller=require(_0x15da('0x5'));router['get']('/',auth[_0x15da('0x6')](),controller[_0x15da('0x7')]);router[_0x15da('0x8')](_0x15da('0x9'),auth[_0x15da('0x6')](),controller[_0x15da('0xa')]);router[_0x15da('0x8')](_0x15da('0xb'),auth['isAuthenticated'](),controller[_0x15da('0xc')]);router[_0x15da('0x8')]('/:id/actions',auth[_0x15da('0x6')](),controller[_0x15da('0xd')]);router[_0x15da('0xe')]('/',auth['isAuthenticated'](),controller[_0x15da('0xf')]);router['post'](_0x15da('0xb'),auth['isAuthenticated'](),controller[_0x15da('0x10')]);router[_0x15da('0xe')]('/:id/actions',auth[_0x15da('0x6')](),controller[_0x15da('0x11')]);router[_0x15da('0x12')](_0x15da('0x9'),auth[_0x15da('0x6')](),controller[_0x15da('0x13')]);router[_0x15da('0x14')]('/:id',auth[_0x15da('0x6')](),controller[_0x15da('0x15')]);module[_0x15da('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index d4252fb..e59449a 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 _0xe695=['#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','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\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)'];(function(_0x18583c,_0x3d1c08){var _0x16f5b2=function(_0x361a4b){while(--_0x361a4b){_0x18583c['push'](_0x18583c['shift']());}};_0x16f5b2(++_0x3d1c08);}(_0xe695,0x1cb));var _0x5e69=function(_0x20fbad,_0x4337bc){_0x20fbad=_0x20fbad-0x0;var _0x11cb63=_0xe695[_0x20fbad];return _0x11cb63;};'use strict';var Sequelize=require(_0x5e69('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5e69('0x1')](_0x5e69('0x2')),'allowNull':![],'defaultValue':_0x5e69('0x2')},'description':{'type':Sequelize[_0x5e69('0x3')]},'active':{'type':Sequelize[_0x5e69('0x4')],'defaultValue':0x0,'comment':_0x5e69('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x5e69('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5e69('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5e69('0x7')](0x5)[_0x5e69('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e69('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5e69('0x7')](0x5)[_0x5e69('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'defaultValue':0x3,'comment':_0x5e69('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5e69('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5e69('0xd')},'dialTimezone':{'type':Sequelize[_0x5e69('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5e69('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x5e69('0x1')](_0x5e69('0xf'),_0x5e69('0x10'),_0x5e69('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5e69('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x5e69('0x7')](0x9)[_0x5e69('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5e69('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x5e69('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5e69('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5e69('0x7')](0x9)[_0x5e69('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5e69('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5e69('0x7')](0x9)[_0x5e69('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e69('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x5e69('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5e69('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5e69('0x7')](0x9)[_0x5e69('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5e69('0x7')](0x9)[_0x5e69('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5e69('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5e69('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5e69('0x7')](0x9)[_0x5e69('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e69('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x5e69('0x19')),'defaultValue':_0x5e69('0x1a')},'dialPrefix':{'type':Sequelize[_0x5e69('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e69('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x5e69('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e69('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5e69('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e69('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e69('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5e69('0x7')](0x5)[_0x5e69('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e69('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5e69('0x7')](0x5)[_0x5e69('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5e69('0x7')](0x3)[_0x5e69('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e69('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e69('0x25')}};
\ No newline at end of file
+var _0xb675=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb675,0xe6));var _0x5b67=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xb675[_0x30faec];return _0x29484f;};'use strict';var Sequelize=require(_0x5b67('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b67('0x1')],'unique':_0x5b67('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5b67('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x5b67('0x4')},'description':{'type':Sequelize[_0x5b67('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x5b67('0x5')](0x4)[_0x5b67('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5b67('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5b67('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5b67('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5b67('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b67('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5b67('0x5')](0x5)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x5b67('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'comment':_0x5b67('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5b67('0xd')},'dialTimezone':{'type':Sequelize[_0x5b67('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5b67('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x5b67('0x3')]('always',_0x5b67('0xf'),_0x5b67('0x10')),'defaultValue':_0x5b67('0x11')},'dialAMDActive':{'type':Sequelize[_0x5b67('0x12')],'defaultValue':0x0,'comment':_0x5b67('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x5b67('0x5')](0x9)[_0x5b67('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5b67('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5b67('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5b67('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5b67('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5b67('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5b67('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5b67('0x5')](0x9)[_0x5b67('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5b67('0x5')](0x9)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5b67('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5b67('0x5')](0x5)[_0x5b67('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5b67('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5b67('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5b67('0x19'),_0x5b67('0x1a')),'defaultValue':_0x5b67('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5b67('0x1b')},'dialCutDigit':{'type':Sequelize[_0x5b67('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5b67('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5b67('0x5')](0x5)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b67('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b67('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b67('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5b67('0x5')](0x5)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5b67('0x5')](0x3)[_0x5b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b67('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b67('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 28e41ee..925fb9c 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 _0xd931=['ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','Campaign','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','nolimit','filter','CmHopper','findOne','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','scheduledAt','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x537501,_0x1509e4){var _0x54bfc2=function(_0x29bd68){while(--_0x29bd68){_0x537501['push'](_0x537501['shift']());}};_0x54bfc2(++_0x1509e4);}(_0xd931,0x191));var _0x1d93=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0xd931[_0x1ca93c];return _0x185169;};'use strict';var emlformat=require(_0x1d93('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d93('0x1'));var jsonpatch=require(_0x1d93('0x2'));var rp=require(_0x1d93('0x3'));var moment=require(_0x1d93('0x4'));var BPromise=require(_0x1d93('0x5'));var Mustache=require(_0x1d93('0x6'));var util=require(_0x1d93('0x7'));var path=require(_0x1d93('0x8'));var sox=require(_0x1d93('0x9'));var csv=require('to-csv');var ejs=require(_0x1d93('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d93('0xb'));var squel=require('squel');var crypto=require(_0x1d93('0xc'));var jsforce=require(_0x1d93('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1d93('0xe'));var querystring=require(_0x1d93('0xf'));var Papa=require(_0x1d93('0x10'));var Redis=require(_0x1d93('0x11'));var authService=require(_0x1d93('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1d93('0x13'));var hardwareService=require(_0x1d93('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1d93('0x15'));var config=require(_0x1d93('0x16'));var licenseUtil=require(_0x1d93('0x17'));var db=require(_0x1d93('0x18'))['db'];function respondWithStatusCode(_0x27ef31,_0x90338d){_0x90338d=_0x90338d||0xcc;return function(_0x50ddd7){if(_0x50ddd7){return _0x27ef31['sendStatus'](_0x90338d);}return _0x27ef31[_0x1d93('0x19')](_0x90338d)[_0x1d93('0x1a')]();};}function respondWithResult(_0x511444,_0x3f2e8f){_0x3f2e8f=_0x3f2e8f||0xc8;return function(_0x2f3211){if(_0x2f3211){return _0x511444['status'](_0x3f2e8f)[_0x1d93('0x1b')](_0x2f3211);}};}function respondWithFilteredResult(_0x500efe,_0x31e24e){return function(_0x14c7f4){if(_0x14c7f4){var _0x595521=typeof _0x31e24e[_0x1d93('0x1c')]==='undefined'&&typeof _0x31e24e[_0x1d93('0x1d')]===_0x1d93('0x1e');var _0x48ea00=_0x14c7f4[_0x1d93('0x1f')];var _0x35679c=_0x595521?0x0:_0x31e24e[_0x1d93('0x1c')];var _0x1848e9=_0x595521?_0x14c7f4[_0x1d93('0x1f')]:_0x31e24e[_0x1d93('0x1c')]+_0x31e24e[_0x1d93('0x1d')];var _0xa265f4;if(_0x1848e9>=_0x48ea00){_0x1848e9=_0x48ea00;_0xa265f4=0xc8;}else{_0xa265f4=0xce;}_0x500efe[_0x1d93('0x19')](_0xa265f4);return _0x500efe[_0x1d93('0x20')](_0x1d93('0x21'),_0x35679c+'-'+_0x1848e9+'/'+_0x48ea00)[_0x1d93('0x1b')](_0x14c7f4);}return null;};}function patchUpdates(_0x5a8715){return function(_0x37e9c9){try{jsonpatch[_0x1d93('0x22')](_0x37e9c9,_0x5a8715,!![]);}catch(_0x2c7259){return BPromise[_0x1d93('0x23')](_0x2c7259);}return _0x37e9c9[_0x1d93('0x24')]();};}function saveUpdates(_0x1b9b31,_0x106048){return function(_0x575082){if(_0x575082){return _0x575082[_0x1d93('0x25')](_0x1b9b31)[_0x1d93('0x26')](function(_0x15845b){return _0x15845b;});}return null;};}function removeEntity(_0x16d539,_0x19a8ff){return function(_0x222f7c){if(_0x222f7c){return _0x222f7c['destroy']()[_0x1d93('0x26')](function(){var _0x4921f0=_0x222f7c[_0x1d93('0x27')]({'plain':!![]});var _0x147ad3='IvrCampaigns';return db['UserProfileResource'][_0x1d93('0x28')]({'where':{'type':_0x147ad3,'resourceId':_0x4921f0['id']}})[_0x1d93('0x26')](function(){return _0x222f7c;});})[_0x1d93('0x26')](function(){_0x16d539[_0x1d93('0x19')](0xcc)[_0x1d93('0x1a')]();});}};}function handleEntityNotFound(_0x3d9d90,_0x4f632f){return function(_0x1b9441){if(!_0x1b9441){_0x3d9d90[_0x1d93('0x29')](0x194);}return _0x1b9441;};}function handleError(_0x2f51b5,_0x2e6527){_0x2e6527=_0x2e6527||0x1f4;return function(_0x8443fc){logger[_0x1d93('0x2a')](_0x8443fc[_0x1d93('0x2b')]);if(_0x8443fc[_0x1d93('0x2c')]){delete _0x8443fc[_0x1d93('0x2c')];}_0x2f51b5[_0x1d93('0x19')](_0x2e6527)[_0x1d93('0x2d')](_0x8443fc);};}exports[_0x1d93('0x2e')]=function(_0xbf8772,_0x12d8c5){var _0x5b6342={},_0x95b469={},_0x5a94c7={'count':0x0,'rows':[]};var _0x49f0cc=_[_0x1d93('0x2f')](db['Campaign'][_0x1d93('0x30')],function(_0x3db7d3){return{'name':_0x3db7d3[_0x1d93('0x31')],'type':_0x3db7d3[_0x1d93('0x32')]['key']};});_0x95b469[_0x1d93('0x33')]=_[_0x1d93('0x2f')](_0x49f0cc,_0x1d93('0x2c'));_0x95b469[_0x1d93('0x34')]=_[_0x1d93('0x35')](_0xbf8772[_0x1d93('0x34')]);_0x95b469[_0x1d93('0x36')]=_[_0x1d93('0x37')](_0x95b469['model'],_0x95b469[_0x1d93('0x34')]);_0x5b6342['attributes']=_[_0x1d93('0x37')](_0x95b469['model'],qs[_0x1d93('0x38')](_0xbf8772[_0x1d93('0x34')]['fields']));_0x5b6342[_0x1d93('0x39')]=_0x5b6342[_0x1d93('0x39')]['length']?_0x5b6342[_0x1d93('0x39')]:_0x95b469['model'];if(!_0xbf8772[_0x1d93('0x34')][_0x1d93('0x3a')]('nolimit')){_0x5b6342[_0x1d93('0x1d')]=qs[_0x1d93('0x1d')](_0xbf8772[_0x1d93('0x34')][_0x1d93('0x1d')]);_0x5b6342[_0x1d93('0x1c')]=qs[_0x1d93('0x1c')](_0xbf8772[_0x1d93('0x34')]['offset']);}_0x5b6342[_0x1d93('0x3b')]=qs[_0x1d93('0x3c')](_0xbf8772['query'][_0x1d93('0x3c')]);_0x5b6342[_0x1d93('0x3d')]=qs[_0x1d93('0x36')](_[_0x1d93('0x3e')](_0xbf8772['query'],_0x95b469[_0x1d93('0x36')]),_0x49f0cc);if(_0xbf8772[_0x1d93('0x34')]['filter']){_0x5b6342[_0x1d93('0x3d')]=_[_0x1d93('0x3f')](_0x5b6342['where'],{'$or':_[_0x1d93('0x2f')](_0x49f0cc,function(_0x475fe3){if(_0x475fe3[_0x1d93('0x32')]!==_0x1d93('0x40')){var _0x44167f={};_0x44167f[_0x475fe3[_0x1d93('0x2c')]]={'$like':'%'+_0xbf8772[_0x1d93('0x34')]['filter']+'%'};return _0x44167f;}})});}_0x5b6342=_[_0x1d93('0x3f')]({},_0x5b6342,_0xbf8772[_0x1d93('0x41')]);var _0xda8311={'where':_0x5b6342[_0x1d93('0x3d')]};return db[_0x1d93('0x42')][_0x1d93('0x1f')](_0xda8311)['then'](function(_0x5ecccc){_0x5a94c7[_0x1d93('0x1f')]=_0x5ecccc;if(_0xbf8772[_0x1d93('0x34')][_0x1d93('0x43')]){_0x5b6342['include']=[{'all':!![]}];}return db[_0x1d93('0x42')][_0x1d93('0x44')](_0x5b6342);})[_0x1d93('0x26')](function(_0x4c3a7a){_0x5a94c7[_0x1d93('0x45')]=_0x4c3a7a;return _0x5a94c7;})['then'](respondWithFilteredResult(_0x12d8c5,_0x5b6342))[_0x1d93('0x46')](handleError(_0x12d8c5,null));};exports[_0x1d93('0x47')]=function(_0x1a646a,_0x2b3252){var _0x4545fd={'raw':![],'where':{'id':_0x1a646a[_0x1d93('0x48')]['id']}},_0x4294d1={};_0x4294d1[_0x1d93('0x33')]=_[_0x1d93('0x35')](db['Campaign']['rawAttributes']);_0x4294d1['query']=_[_0x1d93('0x35')](_0x1a646a['query']);_0x4294d1['filters']=_[_0x1d93('0x37')](_0x4294d1[_0x1d93('0x33')],_0x4294d1[_0x1d93('0x34')]);_0x4545fd[_0x1d93('0x39')]=_[_0x1d93('0x37')](_0x4294d1[_0x1d93('0x33')],qs[_0x1d93('0x38')](_0x1a646a[_0x1d93('0x34')][_0x1d93('0x38')]));_0x4545fd[_0x1d93('0x39')]=_0x4545fd[_0x1d93('0x39')]['length']?_0x4545fd['attributes']:_0x4294d1['model'];if(_0x1a646a[_0x1d93('0x34')]['includeAll']){_0x4545fd[_0x1d93('0x49')]=[{'all':!![]}];}_0x4545fd=_[_0x1d93('0x3f')]({},_0x4545fd,_0x1a646a[_0x1d93('0x41')]);return db['Campaign'][_0x1d93('0x4a')](_0x4545fd)[_0x1d93('0x26')](handleEntityNotFound(_0x2b3252,null))[_0x1d93('0x26')](respondWithResult(_0x2b3252,null))[_0x1d93('0x46')](handleError(_0x2b3252,null));};exports[_0x1d93('0x4b')]=function(_0x4d5e62,_0x4eaa9b){return db['Campaign'][_0x1d93('0x4b')](_0x4d5e62[_0x1d93('0x4c')],{})[_0x1d93('0x26')](function(_0x22e8f3){var _0xbb3807=_0x4d5e62['user'][_0x1d93('0x27')]({'plain':!![]});if(!_0xbb3807)throw new Error(_0x1d93('0x4d'));if(_0xbb3807[_0x1d93('0x4e')]===_0x1d93('0x4f')){var _0x20aa10=_0x22e8f3[_0x1d93('0x27')]({'plain':!![]});var _0x63ee96=_0x1d93('0x50');return db[_0x1d93('0x51')][_0x1d93('0x4a')]({'where':{'name':_0x63ee96,'userProfileId':_0xbb3807[_0x1d93('0x52')]},'raw':!![]})['then'](function(_0x2eae5d){if(_0x2eae5d&&_0x2eae5d[_0x1d93('0x53')]===0x0){return db['UserProfileResource'][_0x1d93('0x4b')]({'name':_0x20aa10[_0x1d93('0x2c')],'resourceId':_0x20aa10['id'],'type':_0x2eae5d['name'],'sectionId':_0x2eae5d['id']},{})[_0x1d93('0x26')](function(){return _0x22e8f3;});}else{return _0x22e8f3;}})['catch'](function(_0x16718c){logger[_0x1d93('0x2a')](_0x1d93('0x54'),_0x16718c);throw _0x16718c;});}return _0x22e8f3;})[_0x1d93('0x26')](respondWithResult(_0x4eaa9b,0xc9))['catch'](handleError(_0x4eaa9b,null));};exports[_0x1d93('0x55')]=function(_0x4bc044,_0x202f1c){var _0x2fc544={'where':{'id':_0x4bc044['params']['id']}},_0x512dc0={};_0x512dc0[_0x1d93('0x33')]=_[_0x1d93('0x35')](db[_0x1d93('0x42')][_0x1d93('0x30')]);_0x2fc544[_0x1d93('0x39')]=_[_0x1d93('0x37')](_0x512dc0[_0x1d93('0x33')],qs[_0x1d93('0x38')](_0x4bc044[_0x1d93('0x34')][_0x1d93('0x38')]));_0x2fc544[_0x1d93('0x39')]=_0x2fc544['attributes'][_0x1d93('0x56')]?_0x2fc544[_0x1d93('0x39')]:_0x512dc0[_0x1d93('0x33')];if(_0x4bc044[_0x1d93('0x34')][_0x1d93('0x43')]){_0x2fc544[_0x1d93('0x49')]=[{'all':!![]}];}_0x2fc544=_[_0x1d93('0x3f')]({},_0x2fc544,_0x4bc044['options']);return db[_0x1d93('0x42')][_0x1d93('0x4a')](_0x2fc544)[_0x1d93('0x26')](handleEntityNotFound(_0x202f1c,null))['then'](function(_0x1f3658){if(_0x1f3658){var _0xef3912=_0x1f3658['get']({'plain':!![]});_0xef3912=qs['omit'](_0xef3912,['id','createdAt','updatedAt']);_0x4bc044['body']=_[_0x1d93('0x57')](_0x4bc044[_0x1d93('0x4c')],['id',_0x1d93('0x58'),_0x1d93('0x59')]);return db[_0x1d93('0x42')]['create'](_['merge'](_0xef3912,_0x4bc044[_0x1d93('0x4c')]),{'include':_0x4bc044[_0x1d93('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x1d93('0x26')](function(_0x2c1298){var _0x1c1185=_0x4bc044['user'][_0x1d93('0x27')]({'plain':!![]});if(!_0x1c1185)throw new Error(_0x1d93('0x4d'));if(_0x1c1185['role']===_0x1d93('0x4f')){var _0x4d67b2=_0x2c1298[_0x1d93('0x27')]({'plain':!![]});var _0x305f63=_0x1d93('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x305f63,'userProfileId':_0x1c1185[_0x1d93('0x52')]},'raw':!![]})[_0x1d93('0x26')](function(_0x2f7be1){if(_0x2f7be1&&_0x2f7be1[_0x1d93('0x53')]===0x0){return db['UserProfileResource'][_0x1d93('0x4b')]({'name':_0x4d67b2[_0x1d93('0x2c')],'resourceId':_0x4d67b2['id'],'type':_0x2f7be1[_0x1d93('0x2c')],'sectionId':_0x2f7be1['id']},{})[_0x1d93('0x26')](function(){return _0x2c1298;});}else{return _0x2c1298;}})[_0x1d93('0x46')](function(_0x53bae7){logger[_0x1d93('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53bae7);throw _0x53bae7;});}return _0x2c1298;});}})['then'](respondWithResult(_0x202f1c,0xc9))[_0x1d93('0x46')](handleError(_0x202f1c,null));};exports['update']=function(_0x3beb37,_0x57af8a){if(_0x3beb37[_0x1d93('0x4c')]['id']){delete _0x3beb37['body']['id'];}return db[_0x1d93('0x42')]['find']({'where':{'id':_0x3beb37[_0x1d93('0x48')]['id']}})['then'](handleEntityNotFound(_0x57af8a,null))[_0x1d93('0x26')](saveUpdates(_0x3beb37['body'],null))[_0x1d93('0x26')](respondWithResult(_0x57af8a,null))[_0x1d93('0x46')](handleError(_0x57af8a,null));};exports['destroy']=function(_0x2fecff,_0x2441dc){return db[_0x1d93('0x42')][_0x1d93('0x4a')]({'where':{'id':_0x2fecff[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x2441dc,null))['then'](removeEntity(_0x2441dc,null))['catch'](handleError(_0x2441dc,null));};exports['getHoppers']=function(_0xe4fe34,_0xa26138,_0x7db463){var _0x26a0f0={'raw':!![],'where':{}};var _0x257058={};var _0x4dbb1b={'count':0x0,'rows':[]};return db[_0x1d93('0x42')]['findOne']({'where':{'id':_0xe4fe34[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0xa26138,null))[_0x1d93('0x26')](function(_0x1a609e){if(_0x1a609e){_0x257058[_0x1d93('0x33')]=_[_0x1d93('0x35')](db['CmHopper']['rawAttributes']);_0x257058[_0x1d93('0x34')]=_[_0x1d93('0x35')](_0xe4fe34[_0x1d93('0x34')]);_0x257058['filters']=_[_0x1d93('0x37')](_0x257058[_0x1d93('0x33')],_0x257058[_0x1d93('0x34')]);_0x26a0f0['attributes']=_[_0x1d93('0x37')](_0x257058['model'],qs[_0x1d93('0x38')](_0xe4fe34['query'][_0x1d93('0x38')]));_0x26a0f0[_0x1d93('0x39')]=_0x26a0f0[_0x1d93('0x39')]['length']?_0x26a0f0['attributes']:_0x257058[_0x1d93('0x33')];if(!_0xe4fe34[_0x1d93('0x34')][_0x1d93('0x3a')](_0x1d93('0x5a'))){_0x26a0f0['limit']=qs[_0x1d93('0x1d')](_0xe4fe34['query']['limit']);_0x26a0f0[_0x1d93('0x1c')]=qs['offset'](_0xe4fe34['query']['offset']);}_0x26a0f0['order']=qs[_0x1d93('0x3c')](_0xe4fe34[_0x1d93('0x34')][_0x1d93('0x3c')]);_0x26a0f0['where']=qs['filters'](_['pick'](_0xe4fe34[_0x1d93('0x34')],_0x257058['filters']));_0x26a0f0[_0x1d93('0x3d')]['CampaignId']=_0x1a609e['id'];if(_0xe4fe34['query'][_0x1d93('0x5b')]){_0x26a0f0['where']=_[_0x1d93('0x3f')](_0x26a0f0[_0x1d93('0x3d')],{'$or':_[_0x1d93('0x2f')](_0x26a0f0[_0x1d93('0x39')],function(_0x37280f){var _0x1814f4={};_0x1814f4[_0x37280f]={'$like':'%'+_0xe4fe34[_0x1d93('0x34')][_0x1d93('0x5b')]+'%'};return _0x1814f4;})});}_0x26a0f0=_[_0x1d93('0x3f')]({},_0x26a0f0,_0xe4fe34[_0x1d93('0x41')]);return db[_0x1d93('0x5c')][_0x1d93('0x1f')]({'where':_0x26a0f0[_0x1d93('0x3d')]})[_0x1d93('0x26')](function(_0x3efd4a){_0x4dbb1b[_0x1d93('0x1f')]=_0x3efd4a;if(_0xe4fe34[_0x1d93('0x34')][_0x1d93('0x43')]){_0x26a0f0['include']=[{'all':!![]}];}return db[_0x1d93('0x5c')]['findAll'](_0x26a0f0);})[_0x1d93('0x26')](function(_0x4e2f5b){_0x4dbb1b[_0x1d93('0x45')]=_0x4e2f5b;return _0x4dbb1b;});}})[_0x1d93('0x26')](respondWithFilteredResult(_0xa26138,_0x26a0f0))[_0x1d93('0x46')](handleError(_0xa26138,null));};exports['getHopperHistories']=function(_0x6e69b2,_0x327133,_0x4cbec3){var _0x48d04a={'raw':!![],'where':{}};var _0x3835da={};var _0x3ee6ed={'count':0x0,'rows':[]};return db[_0x1d93('0x42')][_0x1d93('0x5d')]({'where':{'id':_0x6e69b2['params']['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x327133,null))['then'](function(_0xf15070){if(_0xf15070){_0x3835da[_0x1d93('0x33')]=_[_0x1d93('0x35')](db['CmHopperHistory'][_0x1d93('0x30')]);_0x3835da[_0x1d93('0x34')]=_['keys'](_0x6e69b2[_0x1d93('0x34')]);_0x3835da[_0x1d93('0x36')]=_['intersection'](_0x3835da[_0x1d93('0x33')],_0x3835da[_0x1d93('0x34')]);_0x48d04a[_0x1d93('0x39')]=_[_0x1d93('0x37')](_0x3835da[_0x1d93('0x33')],qs[_0x1d93('0x38')](_0x6e69b2[_0x1d93('0x34')]['fields']));_0x48d04a[_0x1d93('0x39')]=_0x48d04a[_0x1d93('0x39')][_0x1d93('0x56')]?_0x48d04a['attributes']:_0x3835da[_0x1d93('0x33')];if(!_0x6e69b2[_0x1d93('0x34')][_0x1d93('0x3a')](_0x1d93('0x5a'))){_0x48d04a[_0x1d93('0x1d')]=qs['limit'](_0x6e69b2[_0x1d93('0x34')][_0x1d93('0x1d')]);_0x48d04a[_0x1d93('0x1c')]=qs[_0x1d93('0x1c')](_0x6e69b2[_0x1d93('0x34')][_0x1d93('0x1c')]);}_0x48d04a[_0x1d93('0x3b')]=qs['sort'](_0x6e69b2[_0x1d93('0x34')][_0x1d93('0x3c')]);_0x48d04a[_0x1d93('0x3d')]=qs[_0x1d93('0x36')](_['pick'](_0x6e69b2[_0x1d93('0x34')],_0x3835da[_0x1d93('0x36')]));_0x48d04a[_0x1d93('0x3d')][_0x1d93('0x5e')]=_0xf15070['id'];if(_0x6e69b2[_0x1d93('0x34')][_0x1d93('0x5b')]){_0x48d04a[_0x1d93('0x3d')]=_['merge'](_0x48d04a[_0x1d93('0x3d')],{'$or':_['map'](_0x48d04a[_0x1d93('0x39')],function(_0x50d3d1){var _0x4c78d1={};_0x4c78d1[_0x50d3d1]={'$like':'%'+_0x6e69b2[_0x1d93('0x34')][_0x1d93('0x5b')]+'%'};return _0x4c78d1;})});}_0x48d04a=_['merge']({},_0x48d04a,_0x6e69b2[_0x1d93('0x41')]);return db[_0x1d93('0x5f')]['count']({'where':_0x48d04a[_0x1d93('0x3d')]})[_0x1d93('0x26')](function(_0x4182cd){_0x3ee6ed['count']=_0x4182cd;if(_0x6e69b2[_0x1d93('0x34')]['includeAll']){_0x48d04a[_0x1d93('0x49')]=[{'all':!![]}];}return db[_0x1d93('0x5f')]['findAll'](_0x48d04a);})[_0x1d93('0x26')](function(_0x2fc7b2){_0x3ee6ed[_0x1d93('0x45')]=_0x2fc7b2;return _0x3ee6ed;});}})['then'](respondWithFilteredResult(_0x327133,_0x48d04a))[_0x1d93('0x46')](handleError(_0x327133,null));};exports[_0x1d93('0x60')]=function(_0x13b3a0,_0x331ccb,_0x323fb6){var _0x4cdf5d={'raw':!![],'where':{}};var _0x5c1c5a={};var _0x4b6111={'count':0x0,'rows':[]};return db[_0x1d93('0x42')][_0x1d93('0x5d')]({'where':{'id':_0x13b3a0[_0x1d93('0x48')]['id']}})['then'](handleEntityNotFound(_0x331ccb,null))['then'](function(_0x1781d2){if(_0x1781d2){_0x5c1c5a[_0x1d93('0x33')]=_[_0x1d93('0x35')](db[_0x1d93('0x61')][_0x1d93('0x30')]);_0x5c1c5a[_0x1d93('0x34')]=_[_0x1d93('0x35')](_0x13b3a0[_0x1d93('0x34')]);_0x5c1c5a['filters']=_[_0x1d93('0x37')](_0x5c1c5a[_0x1d93('0x33')],_0x5c1c5a[_0x1d93('0x34')]);_0x4cdf5d['attributes']=_['intersection'](_0x5c1c5a[_0x1d93('0x33')],qs[_0x1d93('0x38')](_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x38')]));_0x4cdf5d[_0x1d93('0x39')]=_0x4cdf5d[_0x1d93('0x39')][_0x1d93('0x56')]?_0x4cdf5d[_0x1d93('0x39')]:_0x5c1c5a['model'];if(!_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x3a')]('nolimit')){_0x4cdf5d[_0x1d93('0x1d')]=qs['limit'](_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x1d')]);_0x4cdf5d[_0x1d93('0x1c')]=qs['offset'](_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x1c')]);}_0x4cdf5d['order']=qs['sort'](_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x3c')]);_0x4cdf5d[_0x1d93('0x3d')]=qs[_0x1d93('0x36')](_[_0x1d93('0x3e')](_0x13b3a0['query'],_0x5c1c5a[_0x1d93('0x36')]));_0x4cdf5d[_0x1d93('0x3d')]['CampaignId']=_0x1781d2['id'];if(_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x5b')]){_0x4cdf5d[_0x1d93('0x3d')]=_[_0x1d93('0x3f')](_0x4cdf5d['where'],{'$or':_[_0x1d93('0x2f')](_0x4cdf5d[_0x1d93('0x39')],function(_0x490b14){var _0x54a747={};_0x54a747[_0x490b14]={'$like':'%'+_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x5b')]+'%'};return _0x54a747;})});}_0x4cdf5d=_[_0x1d93('0x3f')]({},_0x4cdf5d,_0x13b3a0['options']);return db[_0x1d93('0x61')][_0x1d93('0x1f')]({'where':_0x4cdf5d[_0x1d93('0x3d')]})[_0x1d93('0x26')](function(_0x420a96){_0x4b6111[_0x1d93('0x1f')]=_0x420a96;if(_0x13b3a0[_0x1d93('0x34')][_0x1d93('0x43')]){_0x4cdf5d[_0x1d93('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x1d93('0x44')](_0x4cdf5d);})[_0x1d93('0x26')](function(_0x131a73){_0x4b6111[_0x1d93('0x45')]=_0x131a73;return _0x4b6111;});}})[_0x1d93('0x26')](respondWithFilteredResult(_0x331ccb,_0x4cdf5d))[_0x1d93('0x46')](handleError(_0x331ccb,null));};exports[_0x1d93('0x62')]=function(_0x272de3,_0x4eefd0,_0x405df9){var _0x3b65f8={'raw':!![],'where':{}};var _0x2f087d={};var _0x2bbae9={'count':0x0,'rows':[]};return db['Campaign'][_0x1d93('0x5d')]({'where':{'id':_0x272de3[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x4eefd0,null))[_0x1d93('0x26')](function(_0x28243f){if(_0x28243f){_0x2f087d['model']=_[_0x1d93('0x35')](db['CmHopperBlack'][_0x1d93('0x30')]);_0x2f087d[_0x1d93('0x34')]=_[_0x1d93('0x35')](_0x272de3[_0x1d93('0x34')]);_0x2f087d[_0x1d93('0x36')]=_[_0x1d93('0x37')](_0x2f087d[_0x1d93('0x33')],_0x2f087d[_0x1d93('0x34')]);_0x3b65f8['attributes']=_[_0x1d93('0x37')](_0x2f087d['model'],qs[_0x1d93('0x38')](_0x272de3['query'][_0x1d93('0x38')]));_0x3b65f8[_0x1d93('0x39')]=_0x3b65f8['attributes'][_0x1d93('0x56')]?_0x3b65f8[_0x1d93('0x39')]:_0x2f087d['model'];if(!_0x272de3[_0x1d93('0x34')][_0x1d93('0x3a')](_0x1d93('0x5a'))){_0x3b65f8[_0x1d93('0x1d')]=qs[_0x1d93('0x1d')](_0x272de3['query'][_0x1d93('0x1d')]);_0x3b65f8[_0x1d93('0x1c')]=qs[_0x1d93('0x1c')](_0x272de3[_0x1d93('0x34')][_0x1d93('0x1c')]);}_0x3b65f8[_0x1d93('0x3b')]=qs[_0x1d93('0x3c')](_0x272de3[_0x1d93('0x34')][_0x1d93('0x3c')]);_0x3b65f8[_0x1d93('0x3d')]=qs[_0x1d93('0x36')](_[_0x1d93('0x3e')](_0x272de3[_0x1d93('0x34')],_0x2f087d[_0x1d93('0x36')]));_0x3b65f8[_0x1d93('0x3d')][_0x1d93('0x5e')]=_0x28243f['id'];if(_0x272de3['query'][_0x1d93('0x5b')]){_0x3b65f8[_0x1d93('0x3d')]=_[_0x1d93('0x3f')](_0x3b65f8[_0x1d93('0x3d')],{'$or':_[_0x1d93('0x2f')](_0x3b65f8[_0x1d93('0x39')],function(_0x31b913){var _0x10ca42={};_0x10ca42[_0x31b913]={'$like':'%'+_0x272de3[_0x1d93('0x34')][_0x1d93('0x5b')]+'%'};return _0x10ca42;})});}_0x3b65f8=_['merge']({},_0x3b65f8,_0x272de3['options']);return db[_0x1d93('0x63')]['count']({'where':_0x3b65f8[_0x1d93('0x3d')]})[_0x1d93('0x26')](function(_0x188bde){_0x2bbae9[_0x1d93('0x1f')]=_0x188bde;if(_0x272de3[_0x1d93('0x34')][_0x1d93('0x43')]){_0x3b65f8[_0x1d93('0x49')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x1d93('0x44')](_0x3b65f8);})[_0x1d93('0x26')](function(_0x1a9f74){_0x2bbae9[_0x1d93('0x45')]=_0x1a9f74;return _0x2bbae9;});}})[_0x1d93('0x26')](respondWithFilteredResult(_0x4eefd0,_0x3b65f8))['catch'](handleError(_0x4eefd0,null));};exports[_0x1d93('0x64')]=function(_0x4c7d3e,_0x45b780,_0x5df264){var _0x19b732={};var _0x1a73e7={};var _0x1ae3c3;var _0x5970e6;return db[_0x1d93('0x42')][_0x1d93('0x5d')]({'where':{'id':_0x4c7d3e[_0x1d93('0x48')]['id']}})['then'](handleEntityNotFound(_0x45b780,null))[_0x1d93('0x26')](function(_0x107487){if(_0x107487){_0x1ae3c3=_0x107487;_0x1a73e7[_0x1d93('0x33')]=_[_0x1d93('0x35')](db['CmList']['rawAttributes']);_0x1a73e7['query']=_[_0x1d93('0x35')](_0x4c7d3e[_0x1d93('0x34')]);_0x1a73e7['filters']=_[_0x1d93('0x37')](_0x1a73e7[_0x1d93('0x33')],_0x1a73e7[_0x1d93('0x34')]);_0x19b732['attributes']=_[_0x1d93('0x37')](_0x1a73e7[_0x1d93('0x33')],qs[_0x1d93('0x38')](_0x4c7d3e[_0x1d93('0x34')][_0x1d93('0x38')]));_0x19b732['attributes']=_0x19b732[_0x1d93('0x39')][_0x1d93('0x56')]?_0x19b732[_0x1d93('0x39')]:_0x1a73e7['model'];_0x19b732[_0x1d93('0x3b')]=qs[_0x1d93('0x3c')](_0x4c7d3e[_0x1d93('0x34')][_0x1d93('0x3c')]);_0x19b732[_0x1d93('0x3d')]=qs[_0x1d93('0x36')](_[_0x1d93('0x3e')](_0x4c7d3e[_0x1d93('0x34')],_0x1a73e7['filters']));if(_0x4c7d3e[_0x1d93('0x34')][_0x1d93('0x5b')]){_0x19b732[_0x1d93('0x3d')]=_[_0x1d93('0x3f')](_0x19b732[_0x1d93('0x3d')],{'$or':_[_0x1d93('0x2f')](_0x19b732['attributes'],function(_0x594fce){var _0x35a367={};_0x35a367[_0x594fce]={'$like':'%'+_0x4c7d3e[_0x1d93('0x34')][_0x1d93('0x5b')]+'%'};return _0x35a367;})});}_0x19b732=_[_0x1d93('0x3f')]({},_0x19b732,_0x4c7d3e[_0x1d93('0x41')]);return _0x1ae3c3['getLists'](_0x19b732);}})[_0x1d93('0x26')](function(_0xfd4e59){if(_0xfd4e59){_0x5970e6=_0xfd4e59[_0x1d93('0x56')];if(!_0x4c7d3e[_0x1d93('0x34')][_0x1d93('0x3a')](_0x1d93('0x5a'))){_0x19b732[_0x1d93('0x1d')]=qs['limit'](_0x4c7d3e['query'][_0x1d93('0x1d')]);_0x19b732['offset']=qs[_0x1d93('0x1c')](_0x4c7d3e[_0x1d93('0x34')]['offset']);}return _0x1ae3c3[_0x1d93('0x64')](_0x19b732);}})[_0x1d93('0x26')](function(_0x40d3f4){if(_0x40d3f4){return _0x40d3f4?{'count':_0x5970e6,'rows':_0x40d3f4}:null;}})[_0x1d93('0x26')](respondWithResult(_0x45b780,null))[_0x1d93('0x46')](handleError(_0x45b780,null));};exports[_0x1d93('0x65')]=function(_0xb60f59,_0x258586,_0x178b3a){var _0x2de1b5,_0x3fd6ac;return db['Campaign'][_0x1d93('0x4a')]({'where':{'id':_0xb60f59[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x258586,null))['then'](function(_0x4bfdb9){if(_0x4bfdb9){_0x3fd6ac=_0x4bfdb9;return _0x4bfdb9[_0x1d93('0x65')](_0xb60f59['body'][_0x1d93('0x66')],_[_0x1d93('0x57')](_0xb60f59['body'],[_0x1d93('0x66'),'id'])||{});}return null;})['spread'](function(_0x42da7d){var _0x3409fc;_0x2de1b5=_0x42da7d||[];var _0x46e40b=[];if(_0x42da7d){for(var _0x329af1=0x0;_0x329af1<_0x42da7d['length'];_0x329af1+=0x1){var _0x224ff2=_0x42da7d[_0x329af1]['get']({'plain':!![]});_0x3fd6ac[_0x1d93('0x67')]=_0xb60f59[_0x1d93('0x4c')][_0x1d93('0x67')]?_0xb60f59['body'][_0x1d93('0x67')]:_0x3fd6ac[_0x1d93('0x67')];switch(_0x3fd6ac[_0x1d93('0x67')]){case'always':_0x3409fc=squel[_0x1d93('0x68')]()[_0x1d93('0x69')](_0x1d93('0x6a'))['fromQuery'](['phone','scheduledAt',_0x1d93('0x6b'),_0x1d93('0x6c'),_0x1d93('0x5e'),_0x1d93('0x58'),'updatedAt'],squel['select']()[_0x1d93('0x6d')](_0x1d93('0x6e'),_0x1d93('0x6e'))['field'](_0x1d93('0x6f'),'scheduledAt')[_0x1d93('0x6d')]('id',_0x1d93('0x6b'))[_0x1d93('0x6d')](_0x224ff2[_0x1d93('0x70')][_0x1d93('0x71')](),_0x1d93('0x6c'))['field'](_0xb60f59[_0x1d93('0x48')]['id'][_0x1d93('0x71')](),_0x1d93('0x5e'))[_0x1d93('0x6d')]('NOW()',_0x1d93('0x58'))[_0x1d93('0x6d')](_0x1d93('0x6f'),_0x1d93('0x59'))[_0x1d93('0x72')](_0x1d93('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0x1d93('0x3d')](_0x1d93('0x74'),_0x224ff2[_0x1d93('0x70')][_0x1d93('0x71')]())[_0x1d93('0x3d')](_0x1d93('0x75'))[_0x1d93('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1d93('0x76')]()[_0x1d93('0x6d')](_0x1d93('0x77'))[_0x1d93('0x72')](_0x1d93('0x78'))['where'](_0x1d93('0x79'),_0xb60f59[_0x1d93('0x48')]['id']['toString']()))[_0x1d93('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1d93('0x76')]()[_0x1d93('0x6d')]('COALESCE(phone,\x27\x27)')[_0x1d93('0x72')](_0x1d93('0x6a'))[_0x1d93('0x3d')](_0x1d93('0x79'),_0xb60f59[_0x1d93('0x48')]['id'][_0x1d93('0x71')]())))[_0x1d93('0x71')]();break;case _0x1d93('0x7a'):_0x3409fc=squel['insert']()[_0x1d93('0x69')]('cm_hopper')[_0x1d93('0x7b')]([_0x1d93('0x6e'),'scheduledAt','ContactId','ListId','CampaignId',_0x1d93('0x58'),_0x1d93('0x59')],squel['select']()[_0x1d93('0x6d')](_0x1d93('0x6e'),'phone')[_0x1d93('0x6d')](_0x1d93('0x6f'),_0x1d93('0x7c'))[_0x1d93('0x6d')]('id',_0x1d93('0x6b'))[_0x1d93('0x6d')](_0x224ff2[_0x1d93('0x70')][_0x1d93('0x71')](),_0x1d93('0x6c'))['field'](_0xb60f59[_0x1d93('0x48')]['id'][_0x1d93('0x71')](),_0x1d93('0x5e'))[_0x1d93('0x6d')](_0x1d93('0x6f'),_0x1d93('0x58'))[_0x1d93('0x6d')](_0x1d93('0x6f'),'updatedAt')[_0x1d93('0x72')](_0x1d93('0x73'))[_0x1d93('0x3d')](_0x1d93('0x7d'))[_0x1d93('0x3d')](_0x1d93('0x74'),_0x224ff2[_0x1d93('0x70')]['toString']())[_0x1d93('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x1d93('0x3d')](_0x1d93('0x7e'),squel[_0x1d93('0x76')]()[_0x1d93('0x6d')](_0x1d93('0x7f'))[_0x1d93('0x72')](_0x1d93('0x6a'))[_0x1d93('0x3d')](_0x1d93('0x79'),_0xb60f59[_0x1d93('0x48')]['id'][_0x1d93('0x71')]())))[_0x1d93('0x71')]();break;default:_0x3409fc=squel['insert']()['into'](_0x1d93('0x6a'))[_0x1d93('0x7b')]([_0x1d93('0x6e'),'scheduledAt',_0x1d93('0x6b'),'ListId','CampaignId',_0x1d93('0x58'),_0x1d93('0x59')],squel[_0x1d93('0x76')]()[_0x1d93('0x6d')](_0x1d93('0x6e'),_0x1d93('0x6e'))['field'](_0x1d93('0x6f'),'scheduledAt')[_0x1d93('0x6d')]('id',_0x1d93('0x6b'))[_0x1d93('0x6d')](_0x224ff2['CmListId'][_0x1d93('0x71')](),_0x1d93('0x6c'))[_0x1d93('0x6d')](_0xb60f59[_0x1d93('0x48')]['id'][_0x1d93('0x71')](),_0x1d93('0x5e'))[_0x1d93('0x6d')](_0x1d93('0x6f'),_0x1d93('0x58'))[_0x1d93('0x6d')](_0x1d93('0x6f'),_0x1d93('0x59'))[_0x1d93('0x72')](_0x1d93('0x73'))[_0x1d93('0x3d')](_0x1d93('0x7d'))[_0x1d93('0x3d')](_0x1d93('0x74'),_0x224ff2[_0x1d93('0x70')][_0x1d93('0x71')]())[_0x1d93('0x3d')](_0x1d93('0x75')))[_0x1d93('0x71')]();}_0x46e40b[_0x1d93('0x80')](db[_0x1d93('0x81')]['query'](_0x3409fc));}return BPromise[_0x1d93('0x82')](_0x46e40b);}})[_0x1d93('0x26')](function(){return _0x2de1b5;})['then'](respondWithResult(_0x258586,null))['catch'](handleError(_0x258586,null));};exports[_0x1d93('0x83')]=function(_0x2d1fc5,_0x6c94ef,_0x400c1d){return db[_0x1d93('0x42')][_0x1d93('0x4a')]({'where':{'id':_0x2d1fc5[_0x1d93('0x48')]['id']}})['then'](handleEntityNotFound(_0x6c94ef,null))[_0x1d93('0x26')](function(_0x585c0d){if(_0x585c0d){return _0x585c0d[_0x1d93('0x83')](_0x2d1fc5[_0x1d93('0x34')][_0x1d93('0x66')]);}})['then'](function(_0x4629b1){if(_0x4629b1){return db[_0x1d93('0x5c')][_0x1d93('0x28')]({'where':{'ListId':_0x2d1fc5['query'][_0x1d93('0x66')],'CampaignId':_0x2d1fc5['params']['id']}})[_0x1d93('0x26')](function(){return _0x4629b1;});}})[_0x1d93('0x26')](respondWithStatusCode(_0x6c94ef,null))[_0x1d93('0x46')](handleError(_0x6c94ef,null));};exports[_0x1d93('0x84')]=function(_0x39bc22,_0x20d90e,_0x2eb8c7){var _0x56a91f={};var _0x437ca7={};var _0x4b280e;var _0xe17ace;return db[_0x1d93('0x42')][_0x1d93('0x5d')]({'where':{'id':_0x39bc22[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x20d90e,null))[_0x1d93('0x26')](function(_0x171c9b){if(_0x171c9b){_0x4b280e=_0x171c9b;_0x437ca7[_0x1d93('0x33')]=_['keys'](db[_0x1d93('0x85')][_0x1d93('0x30')]);_0x437ca7['query']=_[_0x1d93('0x35')](_0x39bc22[_0x1d93('0x34')]);_0x437ca7['filters']=_[_0x1d93('0x37')](_0x437ca7[_0x1d93('0x33')],_0x437ca7['query']);_0x56a91f['attributes']=_[_0x1d93('0x37')](_0x437ca7[_0x1d93('0x33')],qs[_0x1d93('0x38')](_0x39bc22[_0x1d93('0x34')][_0x1d93('0x38')]));_0x56a91f[_0x1d93('0x39')]=_0x56a91f[_0x1d93('0x39')][_0x1d93('0x56')]?_0x56a91f[_0x1d93('0x39')]:_0x437ca7[_0x1d93('0x33')];_0x56a91f[_0x1d93('0x3b')]=qs[_0x1d93('0x3c')](_0x39bc22[_0x1d93('0x34')]['sort']);_0x56a91f['where']=qs[_0x1d93('0x36')](_[_0x1d93('0x3e')](_0x39bc22[_0x1d93('0x34')],_0x437ca7['filters']));if(_0x39bc22[_0x1d93('0x34')][_0x1d93('0x5b')]){_0x56a91f[_0x1d93('0x3d')]=_[_0x1d93('0x3f')](_0x56a91f[_0x1d93('0x3d')],{'$or':_['map'](_0x56a91f[_0x1d93('0x39')],function(_0x537d41){var _0x114d42={};_0x114d42[_0x537d41]={'$like':'%'+_0x39bc22[_0x1d93('0x34')]['filter']+'%'};return _0x114d42;})});}_0x56a91f=_['merge']({},_0x56a91f,_0x39bc22[_0x1d93('0x41')]);return _0x4b280e['getBlackLists'](_0x56a91f);}})[_0x1d93('0x26')](function(_0x46d606){if(_0x46d606){_0xe17ace=_0x46d606[_0x1d93('0x56')];if(!_0x39bc22['query'][_0x1d93('0x3a')]('nolimit')){_0x56a91f['limit']=qs[_0x1d93('0x1d')](_0x39bc22[_0x1d93('0x34')]['limit']);_0x56a91f[_0x1d93('0x1c')]=qs[_0x1d93('0x1c')](_0x39bc22[_0x1d93('0x34')][_0x1d93('0x1c')]);}return _0x4b280e['getBlackLists'](_0x56a91f);}})['then'](function(_0x9123d5){if(_0x9123d5){return _0x9123d5?{'count':_0xe17ace,'rows':_0x9123d5}:null;}})['then'](respondWithResult(_0x20d90e,null))[_0x1d93('0x46')](handleError(_0x20d90e,null));};exports[_0x1d93('0x86')]=function(_0xb7dadf,_0x5d07c9,_0x3e3c58){var _0x2233a5,_0x998788;return db['Campaign'][_0x1d93('0x4a')]({'where':{'id':_0xb7dadf[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x5d07c9,null))[_0x1d93('0x26')](function(_0xcfe545){if(_0xcfe545){_0x998788=_0xcfe545;return _0xcfe545[_0x1d93('0x86')](_0xb7dadf['body'][_0x1d93('0x66')],_[_0x1d93('0x57')](_0xb7dadf[_0x1d93('0x4c')],[_0x1d93('0x66'),'id'])||{});}return null;})['spread'](function(_0x5404bc){var _0x25aa1a;_0x2233a5=_0x5404bc||[];var _0x382eff=[];if(_0x5404bc){for(var _0x5736b4=0x0;_0x5736b4<_0x5404bc[_0x1d93('0x56')];_0x5736b4+=0x1){var _0x4300de=_0x5404bc[_0x5736b4][_0x1d93('0x27')]({'plain':!![]});_0x25aa1a=squel[_0x1d93('0x68')]()[_0x1d93('0x69')](_0x1d93('0x87'))[_0x1d93('0x7b')](['phone',_0x1d93('0x6b'),_0x1d93('0x6c'),_0x1d93('0x5e'),_0x1d93('0x58'),_0x1d93('0x59')],squel[_0x1d93('0x76')]()[_0x1d93('0x6d')](_0x1d93('0x6e'),'phone')['field']('id',_0x1d93('0x6b'))[_0x1d93('0x6d')](_0x4300de['CmListId'][_0x1d93('0x71')](),'ListId')[_0x1d93('0x6d')](_0xb7dadf[_0x1d93('0x48')]['id']['toString'](),_0x1d93('0x5e'))['field']('NOW()','createdAt')[_0x1d93('0x6d')](_0x1d93('0x6f'),_0x1d93('0x59'))['from']('cm_contacts')['where'](_0x1d93('0x7d'))[_0x1d93('0x3d')](_0x1d93('0x74'),_0x4300de[_0x1d93('0x70')]['toString']())[_0x1d93('0x3d')](_0x1d93('0x75')))[_0x1d93('0x71')]();_0x382eff['push'](db[_0x1d93('0x81')][_0x1d93('0x34')](_0x25aa1a));}return BPromise[_0x1d93('0x82')](_0x382eff);}})[_0x1d93('0x26')](function(){return _0x2233a5;})[_0x1d93('0x26')](respondWithResult(_0x5d07c9,null))[_0x1d93('0x46')](handleError(_0x5d07c9,null));};exports[_0x1d93('0x88')]=function(_0x1b8f4d,_0x401277,_0xae1692){return db[_0x1d93('0x42')][_0x1d93('0x4a')]({'where':{'id':_0x1b8f4d[_0x1d93('0x48')]['id']}})[_0x1d93('0x26')](handleEntityNotFound(_0x401277,null))[_0x1d93('0x26')](function(_0x31664e){if(_0x31664e){return _0x31664e['removeBlackLists'](_0x1b8f4d[_0x1d93('0x34')][_0x1d93('0x66')]);}})[_0x1d93('0x26')](function(_0x347b1e){if(_0x347b1e){return db[_0x1d93('0x63')]['destroy']({'where':{'ListId':_0x1b8f4d['query']['ids'],'CampaignId':_0x1b8f4d['params']['id']}})[_0x1d93('0x26')](function(){return _0x347b1e;});}})[_0x1d93('0x26')](respondWithStatusCode(_0x401277,null))[_0x1d93('0x46')](handleError(_0x401277,null));};
\ No newline at end of file
+var _0xcd55=['insert','into','removeLists','getBlackLists','push','all','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Campaign','includeAll','include','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','clone','omit','updatedAt','createdAt','getHoppers','findOne','pick','CmHopper','findAll','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0xcd55,0x19c));var _0x5cd5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcd55[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x5cd5('0x0'));var rimraf=require(_0x5cd5('0x1'));var zipdir=require(_0x5cd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5cd5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5cd5('0x4'));var util=require(_0x5cd5('0x5'));var path=require(_0x5cd5('0x6'));var sox=require(_0x5cd5('0x7'));var csv=require(_0x5cd5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cd5('0x9'));var _=require('lodash');var squel=require(_0x5cd5('0xa'));var crypto=require(_0x5cd5('0xb'));var jsforce=require(_0x5cd5('0xc'));var deskjs=require(_0x5cd5('0xd'));var toCsv=require(_0x5cd5('0x8'));var querystring=require(_0x5cd5('0xe'));var Papa=require(_0x5cd5('0xf'));var Redis=require(_0x5cd5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5cd5('0x11'));var as=require(_0x5cd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cd5('0x13'))('api');var utils=require(_0x5cd5('0x14'));var config=require(_0x5cd5('0x15'));var licenseUtil=require(_0x5cd5('0x16'));var db=require(_0x5cd5('0x17'))['db'];function respondWithStatusCode(_0x540c2f,_0x190386){_0x190386=_0x190386||0xcc;return function(_0x1d2d09){if(_0x1d2d09){return _0x540c2f[_0x5cd5('0x18')](_0x190386);}return _0x540c2f['status'](_0x190386)['end']();};}function respondWithResult(_0xeb8cc2,_0x3a4712){_0x3a4712=_0x3a4712||0xc8;return function(_0x23e383){if(_0x23e383){return _0xeb8cc2[_0x5cd5('0x19')](_0x3a4712)[_0x5cd5('0x1a')](_0x23e383);}};}function respondWithFilteredResult(_0x204239,_0x16fcfb){return function(_0x3d13ba){if(_0x3d13ba){var _0x1fb6d1=typeof _0x16fcfb['offset']==='undefined'&&typeof _0x16fcfb[_0x5cd5('0x1b')]===_0x5cd5('0x1c');var _0x4e811b=_0x3d13ba[_0x5cd5('0x1d')];var _0x581f84=_0x1fb6d1?0x0:_0x16fcfb[_0x5cd5('0x1e')];var _0x525717=_0x1fb6d1?_0x3d13ba[_0x5cd5('0x1d')]:_0x16fcfb['offset']+_0x16fcfb['limit'];var _0x8fd539;if(_0x525717>=_0x4e811b){_0x525717=_0x4e811b;_0x8fd539=0xc8;}else{_0x8fd539=0xce;}_0x204239[_0x5cd5('0x19')](_0x8fd539);return _0x204239[_0x5cd5('0x1f')]('Content-Range',_0x581f84+'-'+_0x525717+'/'+_0x4e811b)[_0x5cd5('0x1a')](_0x3d13ba);}return null;};}function patchUpdates(_0x258587){return function(_0x328a86){try{jsonpatch['apply'](_0x328a86,_0x258587,!![]);}catch(_0x1d8f11){return BPromise[_0x5cd5('0x20')](_0x1d8f11);}return _0x328a86[_0x5cd5('0x21')]();};}function saveUpdates(_0x1aa280,_0x561df3){return function(_0x276486){if(_0x276486){return _0x276486[_0x5cd5('0x22')](_0x1aa280)['then'](function(_0x18446e){return _0x18446e;});}return null;};}function removeEntity(_0x46b375,_0x31eb36){return function(_0x481483){if(_0x481483){return _0x481483[_0x5cd5('0x23')]()[_0x5cd5('0x24')](function(){var _0x4a3741=_0x481483[_0x5cd5('0x25')]({'plain':!![]});var _0x17c7bf=_0x5cd5('0x26');return db[_0x5cd5('0x27')][_0x5cd5('0x23')]({'where':{'type':_0x17c7bf,'resourceId':_0x4a3741['id']}})[_0x5cd5('0x24')](function(){return _0x481483;});})[_0x5cd5('0x24')](function(){_0x46b375[_0x5cd5('0x19')](0xcc)[_0x5cd5('0x28')]();});}};}function handleEntityNotFound(_0x5c3b21,_0x2a1901){return function(_0x1e5405){if(!_0x1e5405){_0x5c3b21['sendStatus'](0x194);}return _0x1e5405;};}function handleError(_0x587cc9,_0x2a38e3){_0x2a38e3=_0x2a38e3||0x1f4;return function(_0x5a80a8){logger[_0x5cd5('0x29')](_0x5a80a8[_0x5cd5('0x2a')]);if(_0x5a80a8['name']){delete _0x5a80a8['name'];}_0x587cc9[_0x5cd5('0x19')](_0x2a38e3)[_0x5cd5('0x2b')](_0x5a80a8);};}exports['index']=function(_0x4f7371,_0xaaab18){var _0x116779={},_0x47f6c0={},_0x845ae7={'count':0x0,'rows':[]};var _0x1bce4f=_[_0x5cd5('0x2c')](db['Campaign'][_0x5cd5('0x2d')],function(_0x1a2a04){return{'name':_0x1a2a04[_0x5cd5('0x2e')],'type':_0x1a2a04[_0x5cd5('0x2f')][_0x5cd5('0x30')]};});_0x47f6c0[_0x5cd5('0x31')]=_[_0x5cd5('0x2c')](_0x1bce4f,_0x5cd5('0x32'));_0x47f6c0[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0x4f7371['query']);_0x47f6c0[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x47f6c0[_0x5cd5('0x31')],_0x47f6c0['query']);_0x116779[_0x5cd5('0x37')]=_[_0x5cd5('0x36')](_0x47f6c0[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0x4f7371[_0x5cd5('0x33')]['fields']));_0x116779[_0x5cd5('0x37')]=_0x116779[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x116779[_0x5cd5('0x37')]:_0x47f6c0[_0x5cd5('0x31')];if(!_0x4f7371[_0x5cd5('0x33')][_0x5cd5('0x3a')](_0x5cd5('0x3b'))){_0x116779[_0x5cd5('0x1b')]=qs['limit'](_0x4f7371[_0x5cd5('0x33')][_0x5cd5('0x1b')]);_0x116779[_0x5cd5('0x1e')]=qs['offset'](_0x4f7371[_0x5cd5('0x33')][_0x5cd5('0x1e')]);}_0x116779[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3d')](_0x4f7371[_0x5cd5('0x33')][_0x5cd5('0x3d')]);_0x116779[_0x5cd5('0x3e')]=qs[_0x5cd5('0x35')](_['pick'](_0x4f7371[_0x5cd5('0x33')],_0x47f6c0[_0x5cd5('0x35')]),_0x1bce4f);if(_0x4f7371[_0x5cd5('0x33')][_0x5cd5('0x3f')]){_0x116779[_0x5cd5('0x3e')]=_[_0x5cd5('0x40')](_0x116779[_0x5cd5('0x3e')],{'$or':_[_0x5cd5('0x2c')](_0x1bce4f,function(_0x3ccb3f){if(_0x3ccb3f[_0x5cd5('0x2f')]!==_0x5cd5('0x41')){var _0x4fd2da={};_0x4fd2da[_0x3ccb3f['name']]={'$like':'%'+_0x4f7371[_0x5cd5('0x33')]['filter']+'%'};return _0x4fd2da;}})});}_0x116779=_[_0x5cd5('0x40')]({},_0x116779,_0x4f7371[_0x5cd5('0x42')]);var _0x56f2d1={'where':_0x116779['where']};return db[_0x5cd5('0x43')][_0x5cd5('0x1d')](_0x56f2d1)['then'](function(_0x2de8f9){_0x845ae7[_0x5cd5('0x1d')]=_0x2de8f9;if(_0x4f7371[_0x5cd5('0x33')][_0x5cd5('0x44')]){_0x116779[_0x5cd5('0x45')]=[{'all':!![]}];}return db[_0x5cd5('0x43')]['findAll'](_0x116779);})[_0x5cd5('0x24')](function(_0x59bb25){_0x845ae7[_0x5cd5('0x46')]=_0x59bb25;return _0x845ae7;})[_0x5cd5('0x24')](respondWithFilteredResult(_0xaaab18,_0x116779))[_0x5cd5('0x47')](handleError(_0xaaab18,null));};exports[_0x5cd5('0x48')]=function(_0x2cbfee,_0xcd7a4){var _0x25b757={'raw':![],'where':{'id':_0x2cbfee[_0x5cd5('0x49')]['id']}},_0x4a4dbf={};_0x4a4dbf[_0x5cd5('0x31')]=_['keys'](db[_0x5cd5('0x43')][_0x5cd5('0x2d')]);_0x4a4dbf[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0x2cbfee[_0x5cd5('0x33')]);_0x4a4dbf[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x4a4dbf[_0x5cd5('0x31')],_0x4a4dbf[_0x5cd5('0x33')]);_0x25b757[_0x5cd5('0x37')]=_[_0x5cd5('0x36')](_0x4a4dbf[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0x2cbfee[_0x5cd5('0x33')][_0x5cd5('0x38')]));_0x25b757[_0x5cd5('0x37')]=_0x25b757['attributes'][_0x5cd5('0x39')]?_0x25b757['attributes']:_0x4a4dbf[_0x5cd5('0x31')];if(_0x2cbfee[_0x5cd5('0x33')][_0x5cd5('0x44')]){_0x25b757[_0x5cd5('0x45')]=[{'all':!![]}];}_0x25b757=_[_0x5cd5('0x40')]({},_0x25b757,_0x2cbfee[_0x5cd5('0x42')]);return db[_0x5cd5('0x43')][_0x5cd5('0x4a')](_0x25b757)['then'](handleEntityNotFound(_0xcd7a4,null))['then'](respondWithResult(_0xcd7a4,null))[_0x5cd5('0x47')](handleError(_0xcd7a4,null));};exports['create']=function(_0x4319d3,_0x52c81c){return db[_0x5cd5('0x43')][_0x5cd5('0x4b')](_0x4319d3[_0x5cd5('0x4c')],{})[_0x5cd5('0x24')](function(_0x15897c){var _0x7c58a2=_0x4319d3[_0x5cd5('0x4d')][_0x5cd5('0x25')]({'plain':!![]});if(!_0x7c58a2)throw new Error(_0x5cd5('0x4e'));if(_0x7c58a2[_0x5cd5('0x4f')]===_0x5cd5('0x4d')){var _0x36f7e5=_0x15897c[_0x5cd5('0x25')]({'plain':!![]});var _0x1f5737=_0x5cd5('0x26');return db[_0x5cd5('0x50')][_0x5cd5('0x4a')]({'where':{'name':_0x1f5737,'userProfileId':_0x7c58a2[_0x5cd5('0x51')]},'raw':!![]})['then'](function(_0x515c9b){if(_0x515c9b&&_0x515c9b[_0x5cd5('0x52')]===0x0){return db[_0x5cd5('0x27')][_0x5cd5('0x4b')]({'name':_0x36f7e5[_0x5cd5('0x32')],'resourceId':_0x36f7e5['id'],'type':_0x515c9b[_0x5cd5('0x32')],'sectionId':_0x515c9b['id']},{})[_0x5cd5('0x24')](function(){return _0x15897c;});}else{return _0x15897c;}})[_0x5cd5('0x47')](function(_0x259d1e){logger[_0x5cd5('0x29')](_0x5cd5('0x53'),_0x259d1e);throw _0x259d1e;});}return _0x15897c;})['then'](respondWithResult(_0x52c81c,0xc9))[_0x5cd5('0x47')](handleError(_0x52c81c,null));};exports[_0x5cd5('0x54')]=function(_0x2dfb43,_0x3ff076){var _0x42870b={'where':{'id':_0x2dfb43[_0x5cd5('0x49')]['id']}},_0x26fac1={};_0x26fac1['model']=_[_0x5cd5('0x34')](db['Campaign'][_0x5cd5('0x2d')]);_0x42870b['attributes']=_['intersection'](_0x26fac1[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0x2dfb43[_0x5cd5('0x33')][_0x5cd5('0x38')]));_0x42870b['attributes']=_0x42870b[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x42870b[_0x5cd5('0x37')]:_0x26fac1[_0x5cd5('0x31')];if(_0x2dfb43[_0x5cd5('0x33')][_0x5cd5('0x44')]){_0x42870b[_0x5cd5('0x45')]=[{'all':!![]}];}_0x42870b=_['merge']({},_0x42870b,_0x2dfb43[_0x5cd5('0x42')]);return db['Campaign'][_0x5cd5('0x4a')](_0x42870b)[_0x5cd5('0x24')](handleEntityNotFound(_0x3ff076,null))[_0x5cd5('0x24')](function(_0x418ab0){if(_0x418ab0){var _0x3d8e90=_0x418ab0['get']({'plain':!![]});_0x3d8e90=qs[_0x5cd5('0x55')](_0x3d8e90,['id','createdAt',_0x5cd5('0x56')]);_0x2dfb43['body']=_[_0x5cd5('0x55')](_0x2dfb43['body'],['id',_0x5cd5('0x57'),_0x5cd5('0x56')]);return db[_0x5cd5('0x43')]['create'](_[_0x5cd5('0x40')](_0x3d8e90,_0x2dfb43[_0x5cd5('0x4c')]),{'include':_0x2dfb43[_0x5cd5('0x33')][_0x5cd5('0x44')]?[{'all':!![]}]:undefined})[_0x5cd5('0x24')](function(_0x1269bc){var _0x38288d=_0x2dfb43['user'][_0x5cd5('0x25')]({'plain':!![]});if(!_0x38288d)throw new Error(_0x5cd5('0x4e'));if(_0x38288d[_0x5cd5('0x4f')]===_0x5cd5('0x4d')){var _0x6c6e87=_0x1269bc['get']({'plain':!![]});var _0x41109f=_0x5cd5('0x26');return db[_0x5cd5('0x50')][_0x5cd5('0x4a')]({'where':{'name':_0x41109f,'userProfileId':_0x38288d[_0x5cd5('0x51')]},'raw':!![]})[_0x5cd5('0x24')](function(_0x287294){if(_0x287294&&_0x287294[_0x5cd5('0x52')]===0x0){return db[_0x5cd5('0x27')][_0x5cd5('0x4b')]({'name':_0x6c6e87[_0x5cd5('0x32')],'resourceId':_0x6c6e87['id'],'type':_0x287294[_0x5cd5('0x32')],'sectionId':_0x287294['id']},{})[_0x5cd5('0x24')](function(){return _0x1269bc;});}else{return _0x1269bc;}})[_0x5cd5('0x47')](function(_0x426cda){logger['error'](_0x5cd5('0x53'),_0x426cda);throw _0x426cda;});}return _0x1269bc;});}})[_0x5cd5('0x24')](respondWithResult(_0x3ff076,0xc9))[_0x5cd5('0x47')](handleError(_0x3ff076,null));};exports[_0x5cd5('0x22')]=function(_0x1896ef,_0x5f5a0d){if(_0x1896ef[_0x5cd5('0x4c')]['id']){delete _0x1896ef[_0x5cd5('0x4c')]['id'];}return db[_0x5cd5('0x43')][_0x5cd5('0x4a')]({'where':{'id':_0x1896ef['params']['id']}})['then'](handleEntityNotFound(_0x5f5a0d,null))[_0x5cd5('0x24')](saveUpdates(_0x1896ef[_0x5cd5('0x4c')],null))[_0x5cd5('0x24')](respondWithResult(_0x5f5a0d,null))[_0x5cd5('0x47')](handleError(_0x5f5a0d,null));};exports[_0x5cd5('0x23')]=function(_0x50ecab,_0x489d47){return db[_0x5cd5('0x43')][_0x5cd5('0x4a')]({'where':{'id':_0x50ecab[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x489d47,null))[_0x5cd5('0x24')](removeEntity(_0x489d47,null))[_0x5cd5('0x47')](handleError(_0x489d47,null));};exports[_0x5cd5('0x58')]=function(_0x262701,_0x2ee2fc,_0xbcd715){var _0x145e67={'raw':!![],'where':{}};var _0x354009={};var _0x2d2e09={'count':0x0,'rows':[]};return db['Campaign'][_0x5cd5('0x59')]({'where':{'id':_0x262701['params']['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x2ee2fc,null))[_0x5cd5('0x24')](function(_0x4062e9){if(_0x4062e9){_0x354009['model']=_['keys'](db['CmHopper'][_0x5cd5('0x2d')]);_0x354009[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0x262701['query']);_0x354009[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x354009[_0x5cd5('0x31')],_0x354009['query']);_0x145e67['attributes']=_[_0x5cd5('0x36')](_0x354009['model'],qs[_0x5cd5('0x38')](_0x262701[_0x5cd5('0x33')][_0x5cd5('0x38')]));_0x145e67[_0x5cd5('0x37')]=_0x145e67[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x145e67[_0x5cd5('0x37')]:_0x354009[_0x5cd5('0x31')];if(!_0x262701['query'][_0x5cd5('0x3a')](_0x5cd5('0x3b'))){_0x145e67[_0x5cd5('0x1b')]=qs[_0x5cd5('0x1b')](_0x262701['query']['limit']);_0x145e67[_0x5cd5('0x1e')]=qs[_0x5cd5('0x1e')](_0x262701[_0x5cd5('0x33')][_0x5cd5('0x1e')]);}_0x145e67[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3d')](_0x262701['query']['sort']);_0x145e67[_0x5cd5('0x3e')]=qs['filters'](_[_0x5cd5('0x5a')](_0x262701[_0x5cd5('0x33')],_0x354009[_0x5cd5('0x35')]));_0x145e67[_0x5cd5('0x3e')]['CampaignId']=_0x4062e9['id'];if(_0x262701[_0x5cd5('0x33')][_0x5cd5('0x3f')]){_0x145e67[_0x5cd5('0x3e')]=_[_0x5cd5('0x40')](_0x145e67[_0x5cd5('0x3e')],{'$or':_[_0x5cd5('0x2c')](_0x145e67[_0x5cd5('0x37')],function(_0x890814){var _0xb831cc={};_0xb831cc[_0x890814]={'$like':'%'+_0x262701[_0x5cd5('0x33')][_0x5cd5('0x3f')]+'%'};return _0xb831cc;})});}_0x145e67=_['merge']({},_0x145e67,_0x262701[_0x5cd5('0x42')]);return db['CmHopper']['count']({'where':_0x145e67[_0x5cd5('0x3e')]})[_0x5cd5('0x24')](function(_0x1478ac){_0x2d2e09[_0x5cd5('0x1d')]=_0x1478ac;if(_0x262701[_0x5cd5('0x33')]['includeAll']){_0x145e67[_0x5cd5('0x45')]=[{'all':!![]}];}return db[_0x5cd5('0x5b')][_0x5cd5('0x5c')](_0x145e67);})[_0x5cd5('0x24')](function(_0x3a4297){_0x2d2e09[_0x5cd5('0x46')]=_0x3a4297;return _0x2d2e09;});}})[_0x5cd5('0x24')](respondWithFilteredResult(_0x2ee2fc,_0x145e67))[_0x5cd5('0x47')](handleError(_0x2ee2fc,null));};exports[_0x5cd5('0x5d')]=function(_0xd3882e,_0x57ee85,_0xb5548d){var _0x2ac085={'raw':!![],'where':{}};var _0x58dabd={};var _0x5ed443={'count':0x0,'rows':[]};return db[_0x5cd5('0x43')][_0x5cd5('0x59')]({'where':{'id':_0xd3882e[_0x5cd5('0x49')]['id']}})['then'](handleEntityNotFound(_0x57ee85,null))[_0x5cd5('0x24')](function(_0x537e2d){if(_0x537e2d){_0x58dabd[_0x5cd5('0x31')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x58dabd[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0xd3882e[_0x5cd5('0x33')]);_0x58dabd[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x58dabd[_0x5cd5('0x31')],_0x58dabd[_0x5cd5('0x33')]);_0x2ac085[_0x5cd5('0x37')]=_['intersection'](_0x58dabd[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0xd3882e[_0x5cd5('0x33')]['fields']));_0x2ac085[_0x5cd5('0x37')]=_0x2ac085[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x2ac085['attributes']:_0x58dabd[_0x5cd5('0x31')];if(!_0xd3882e[_0x5cd5('0x33')]['hasOwnProperty'](_0x5cd5('0x3b'))){_0x2ac085[_0x5cd5('0x1b')]=qs[_0x5cd5('0x1b')](_0xd3882e[_0x5cd5('0x33')][_0x5cd5('0x1b')]);_0x2ac085['offset']=qs[_0x5cd5('0x1e')](_0xd3882e[_0x5cd5('0x33')][_0x5cd5('0x1e')]);}_0x2ac085[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3d')](_0xd3882e[_0x5cd5('0x33')]['sort']);_0x2ac085[_0x5cd5('0x3e')]=qs[_0x5cd5('0x35')](_['pick'](_0xd3882e[_0x5cd5('0x33')],_0x58dabd['filters']));_0x2ac085['where'][_0x5cd5('0x5e')]=_0x537e2d['id'];if(_0xd3882e['query'][_0x5cd5('0x3f')]){_0x2ac085[_0x5cd5('0x3e')]=_['merge'](_0x2ac085[_0x5cd5('0x3e')],{'$or':_[_0x5cd5('0x2c')](_0x2ac085[_0x5cd5('0x37')],function(_0x4b4326){var _0x594826={};_0x594826[_0x4b4326]={'$like':'%'+_0xd3882e[_0x5cd5('0x33')][_0x5cd5('0x3f')]+'%'};return _0x594826;})});}_0x2ac085=_[_0x5cd5('0x40')]({},_0x2ac085,_0xd3882e[_0x5cd5('0x42')]);return db['CmHopperHistory'][_0x5cd5('0x1d')]({'where':_0x2ac085[_0x5cd5('0x3e')]})[_0x5cd5('0x24')](function(_0x2e7f7c){_0x5ed443[_0x5cd5('0x1d')]=_0x2e7f7c;if(_0xd3882e[_0x5cd5('0x33')][_0x5cd5('0x44')]){_0x2ac085[_0x5cd5('0x45')]=[{'all':!![]}];}return db[_0x5cd5('0x5f')][_0x5cd5('0x5c')](_0x2ac085);})[_0x5cd5('0x24')](function(_0x475365){_0x5ed443[_0x5cd5('0x46')]=_0x475365;return _0x5ed443;});}})[_0x5cd5('0x24')](respondWithFilteredResult(_0x57ee85,_0x2ac085))[_0x5cd5('0x47')](handleError(_0x57ee85,null));};exports[_0x5cd5('0x60')]=function(_0x514e88,_0x7ff3c8,_0x5f245a){var _0x300892={'raw':!![],'where':{}};var _0x1e0062={};var _0x4906dc={'count':0x0,'rows':[]};return db['Campaign'][_0x5cd5('0x59')]({'where':{'id':_0x514e88[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x7ff3c8,null))[_0x5cd5('0x24')](function(_0x4b7cbc){if(_0x4b7cbc){_0x1e0062[_0x5cd5('0x31')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x1e0062[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0x514e88[_0x5cd5('0x33')]);_0x1e0062[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x1e0062[_0x5cd5('0x31')],_0x1e0062[_0x5cd5('0x33')]);_0x300892['attributes']=_[_0x5cd5('0x36')](_0x1e0062[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0x514e88[_0x5cd5('0x33')]['fields']));_0x300892[_0x5cd5('0x37')]=_0x300892[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x300892[_0x5cd5('0x37')]:_0x1e0062[_0x5cd5('0x31')];if(!_0x514e88[_0x5cd5('0x33')][_0x5cd5('0x3a')]('nolimit')){_0x300892[_0x5cd5('0x1b')]=qs[_0x5cd5('0x1b')](_0x514e88['query'][_0x5cd5('0x1b')]);_0x300892['offset']=qs['offset'](_0x514e88[_0x5cd5('0x33')][_0x5cd5('0x1e')]);}_0x300892[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3d')](_0x514e88[_0x5cd5('0x33')][_0x5cd5('0x3d')]);_0x300892[_0x5cd5('0x3e')]=qs[_0x5cd5('0x35')](_['pick'](_0x514e88[_0x5cd5('0x33')],_0x1e0062[_0x5cd5('0x35')]));_0x300892['where'][_0x5cd5('0x5e')]=_0x4b7cbc['id'];if(_0x514e88[_0x5cd5('0x33')]['filter']){_0x300892['where']=_[_0x5cd5('0x40')](_0x300892[_0x5cd5('0x3e')],{'$or':_['map'](_0x300892[_0x5cd5('0x37')],function(_0x3c8213){var _0x16dcc6={};_0x16dcc6[_0x3c8213]={'$like':'%'+_0x514e88[_0x5cd5('0x33')][_0x5cd5('0x3f')]+'%'};return _0x16dcc6;})});}_0x300892=_['merge']({},_0x300892,_0x514e88['options']);return db[_0x5cd5('0x61')]['count']({'where':_0x300892[_0x5cd5('0x3e')]})[_0x5cd5('0x24')](function(_0x38d40f){_0x4906dc[_0x5cd5('0x1d')]=_0x38d40f;if(_0x514e88[_0x5cd5('0x33')]['includeAll']){_0x300892['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x5cd5('0x5c')](_0x300892);})['then'](function(_0x449bc2){_0x4906dc['rows']=_0x449bc2;return _0x4906dc;});}})[_0x5cd5('0x24')](respondWithFilteredResult(_0x7ff3c8,_0x300892))['catch'](handleError(_0x7ff3c8,null));};exports[_0x5cd5('0x62')]=function(_0x3f5399,_0x3958a6,_0x88b93){var _0x447ddf={'raw':!![],'where':{}};var _0x1f898d={};var _0x5cf4cf={'count':0x0,'rows':[]};return db[_0x5cd5('0x43')][_0x5cd5('0x59')]({'where':{'id':_0x3f5399[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x3958a6,null))[_0x5cd5('0x24')](function(_0x3f1b56){if(_0x3f1b56){_0x1f898d[_0x5cd5('0x31')]=_['keys'](db[_0x5cd5('0x63')]['rawAttributes']);_0x1f898d[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0x3f5399[_0x5cd5('0x33')]);_0x1f898d[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x1f898d[_0x5cd5('0x31')],_0x1f898d['query']);_0x447ddf['attributes']=_[_0x5cd5('0x36')](_0x1f898d[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0x3f5399[_0x5cd5('0x33')][_0x5cd5('0x38')]));_0x447ddf[_0x5cd5('0x37')]=_0x447ddf[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x447ddf[_0x5cd5('0x37')]:_0x1f898d[_0x5cd5('0x31')];if(!_0x3f5399[_0x5cd5('0x33')][_0x5cd5('0x3a')](_0x5cd5('0x3b'))){_0x447ddf[_0x5cd5('0x1b')]=qs[_0x5cd5('0x1b')](_0x3f5399[_0x5cd5('0x33')][_0x5cd5('0x1b')]);_0x447ddf[_0x5cd5('0x1e')]=qs[_0x5cd5('0x1e')](_0x3f5399[_0x5cd5('0x33')]['offset']);}_0x447ddf['order']=qs[_0x5cd5('0x3d')](_0x3f5399[_0x5cd5('0x33')][_0x5cd5('0x3d')]);_0x447ddf[_0x5cd5('0x3e')]=qs[_0x5cd5('0x35')](_[_0x5cd5('0x5a')](_0x3f5399[_0x5cd5('0x33')],_0x1f898d[_0x5cd5('0x35')]));_0x447ddf[_0x5cd5('0x3e')][_0x5cd5('0x5e')]=_0x3f1b56['id'];if(_0x3f5399['query'][_0x5cd5('0x3f')]){_0x447ddf[_0x5cd5('0x3e')]=_[_0x5cd5('0x40')](_0x447ddf[_0x5cd5('0x3e')],{'$or':_['map'](_0x447ddf[_0x5cd5('0x37')],function(_0x24c009){var _0x49c575={};_0x49c575[_0x24c009]={'$like':'%'+_0x3f5399[_0x5cd5('0x33')][_0x5cd5('0x3f')]+'%'};return _0x49c575;})});}_0x447ddf=_['merge']({},_0x447ddf,_0x3f5399[_0x5cd5('0x42')]);return db[_0x5cd5('0x63')][_0x5cd5('0x1d')]({'where':_0x447ddf[_0x5cd5('0x3e')]})[_0x5cd5('0x24')](function(_0x31a72d){_0x5cf4cf[_0x5cd5('0x1d')]=_0x31a72d;if(_0x3f5399[_0x5cd5('0x33')][_0x5cd5('0x44')]){_0x447ddf['include']=[{'all':!![]}];}return db[_0x5cd5('0x63')][_0x5cd5('0x5c')](_0x447ddf);})[_0x5cd5('0x24')](function(_0x29ae68){_0x5cf4cf[_0x5cd5('0x46')]=_0x29ae68;return _0x5cf4cf;});}})[_0x5cd5('0x24')](respondWithFilteredResult(_0x3958a6,_0x447ddf))['catch'](handleError(_0x3958a6,null));};exports[_0x5cd5('0x64')]=function(_0x3f2d2c,_0x4c065e,_0x42e304){var _0x125dc7={};var _0x2cd53c={};var _0x4c501b;var _0x3b71e8;return db[_0x5cd5('0x43')][_0x5cd5('0x59')]({'where':{'id':_0x3f2d2c[_0x5cd5('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c065e,null))[_0x5cd5('0x24')](function(_0x52080c){if(_0x52080c){_0x4c501b=_0x52080c;_0x2cd53c[_0x5cd5('0x31')]=_['keys'](db[_0x5cd5('0x65')][_0x5cd5('0x2d')]);_0x2cd53c[_0x5cd5('0x33')]=_[_0x5cd5('0x34')](_0x3f2d2c[_0x5cd5('0x33')]);_0x2cd53c[_0x5cd5('0x35')]=_[_0x5cd5('0x36')](_0x2cd53c[_0x5cd5('0x31')],_0x2cd53c[_0x5cd5('0x33')]);_0x125dc7[_0x5cd5('0x37')]=_[_0x5cd5('0x36')](_0x2cd53c[_0x5cd5('0x31')],qs[_0x5cd5('0x38')](_0x3f2d2c[_0x5cd5('0x33')][_0x5cd5('0x38')]));_0x125dc7[_0x5cd5('0x37')]=_0x125dc7[_0x5cd5('0x37')]['length']?_0x125dc7[_0x5cd5('0x37')]:_0x2cd53c['model'];_0x125dc7[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3d')](_0x3f2d2c['query'][_0x5cd5('0x3d')]);_0x125dc7[_0x5cd5('0x3e')]=qs[_0x5cd5('0x35')](_[_0x5cd5('0x5a')](_0x3f2d2c[_0x5cd5('0x33')],_0x2cd53c[_0x5cd5('0x35')]));if(_0x3f2d2c[_0x5cd5('0x33')][_0x5cd5('0x3f')]){_0x125dc7[_0x5cd5('0x3e')]=_[_0x5cd5('0x40')](_0x125dc7[_0x5cd5('0x3e')],{'$or':_[_0x5cd5('0x2c')](_0x125dc7['attributes'],function(_0x165eec){var _0x341bc7={};_0x341bc7[_0x165eec]={'$like':'%'+_0x3f2d2c[_0x5cd5('0x33')]['filter']+'%'};return _0x341bc7;})});}_0x125dc7=_[_0x5cd5('0x40')]({},_0x125dc7,_0x3f2d2c[_0x5cd5('0x42')]);return _0x4c501b[_0x5cd5('0x64')](_0x125dc7);}})['then'](function(_0x5c0da3){if(_0x5c0da3){_0x3b71e8=_0x5c0da3[_0x5cd5('0x39')];if(!_0x3f2d2c['query']['hasOwnProperty'](_0x5cd5('0x3b'))){_0x125dc7[_0x5cd5('0x1b')]=qs[_0x5cd5('0x1b')](_0x3f2d2c[_0x5cd5('0x33')][_0x5cd5('0x1b')]);_0x125dc7[_0x5cd5('0x1e')]=qs[_0x5cd5('0x1e')](_0x3f2d2c[_0x5cd5('0x33')][_0x5cd5('0x1e')]);}return _0x4c501b[_0x5cd5('0x64')](_0x125dc7);}})[_0x5cd5('0x24')](function(_0x1286e8){if(_0x1286e8){return _0x1286e8?{'count':_0x3b71e8,'rows':_0x1286e8}:null;}})[_0x5cd5('0x24')](respondWithResult(_0x4c065e,null))[_0x5cd5('0x47')](handleError(_0x4c065e,null));};exports[_0x5cd5('0x66')]=function(_0x3ff0d5,_0x2296ad,_0x444464){var _0x2fc4be,_0x563bc8;return db[_0x5cd5('0x43')]['find']({'where':{'id':_0x3ff0d5['params']['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x2296ad,null))['then'](function(_0x59d0f6){if(_0x59d0f6){_0x563bc8=_0x59d0f6;return _0x59d0f6[_0x5cd5('0x66')](_0x3ff0d5[_0x5cd5('0x4c')]['ids'],_['omit'](_0x3ff0d5['body'],[_0x5cd5('0x67'),'id'])||{});}return null;})[_0x5cd5('0x68')](function(_0x1756cd){var _0x394742;_0x2fc4be=_0x1756cd||[];var _0x1f4e78=[];if(_0x1756cd){for(var _0x3ea599=0x0;_0x3ea599<_0x1756cd[_0x5cd5('0x39')];_0x3ea599+=0x1){var _0x4c94d8=_0x1756cd[_0x3ea599]['get']({'plain':!![]});_0x563bc8[_0x5cd5('0x69')]=_0x3ff0d5[_0x5cd5('0x4c')][_0x5cd5('0x69')]?_0x3ff0d5['body'][_0x5cd5('0x69')]:_0x563bc8[_0x5cd5('0x69')];switch(_0x563bc8['dialCheckDuplicateType']){case _0x5cd5('0x6a'):_0x394742=squel['insert']()['into'](_0x5cd5('0x6b'))[_0x5cd5('0x6c')]([_0x5cd5('0x6d'),_0x5cd5('0x6e'),_0x5cd5('0x6f'),_0x5cd5('0x70'),_0x5cd5('0x5e'),_0x5cd5('0x57'),_0x5cd5('0x56')],squel[_0x5cd5('0x71')]()['field'](_0x5cd5('0x6d'),_0x5cd5('0x6d'))['field']('NOW()',_0x5cd5('0x6e'))[_0x5cd5('0x72')]('id','ContactId')[_0x5cd5('0x72')](_0x4c94d8['CmListId'][_0x5cd5('0x73')](),'ListId')[_0x5cd5('0x72')](_0x3ff0d5['params']['id'][_0x5cd5('0x73')](),_0x5cd5('0x5e'))[_0x5cd5('0x72')]('NOW()',_0x5cd5('0x57'))[_0x5cd5('0x72')](_0x5cd5('0x74'),_0x5cd5('0x56'))[_0x5cd5('0x75')](_0x5cd5('0x76'))[_0x5cd5('0x3e')](_0x5cd5('0x77'))[_0x5cd5('0x3e')](_0x5cd5('0x78'),_0x4c94d8[_0x5cd5('0x79')]['toString']())[_0x5cd5('0x3e')](_0x5cd5('0x7a'))[_0x5cd5('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5cd5('0x71')]()[_0x5cd5('0x72')](_0x5cd5('0x7b'))[_0x5cd5('0x75')](_0x5cd5('0x7c'))['where'](_0x5cd5('0x7d'),_0x3ff0d5[_0x5cd5('0x49')]['id'][_0x5cd5('0x73')]()))[_0x5cd5('0x3e')](_0x5cd5('0x7e'),squel[_0x5cd5('0x71')]()[_0x5cd5('0x72')](_0x5cd5('0x7f'))[_0x5cd5('0x75')]('cm_hopper')[_0x5cd5('0x3e')]('CampaignId\x20=\x20?',_0x3ff0d5['params']['id']['toString']())))[_0x5cd5('0x73')]();break;case'onlyIfOpen':_0x394742=squel[_0x5cd5('0x80')]()['into'](_0x5cd5('0x6b'))[_0x5cd5('0x6c')]([_0x5cd5('0x6d'),'scheduledAt',_0x5cd5('0x6f'),_0x5cd5('0x70'),_0x5cd5('0x5e'),_0x5cd5('0x57'),'updatedAt'],squel[_0x5cd5('0x71')]()[_0x5cd5('0x72')]('phone',_0x5cd5('0x6d'))['field'](_0x5cd5('0x74'),'scheduledAt')['field']('id','ContactId')[_0x5cd5('0x72')](_0x4c94d8[_0x5cd5('0x79')][_0x5cd5('0x73')](),'ListId')[_0x5cd5('0x72')](_0x3ff0d5['params']['id'][_0x5cd5('0x73')](),_0x5cd5('0x5e'))['field'](_0x5cd5('0x74'),_0x5cd5('0x57'))['field']('NOW()',_0x5cd5('0x56'))[_0x5cd5('0x75')](_0x5cd5('0x76'))[_0x5cd5('0x3e')]('deletedAt\x20IS\x20NULL')[_0x5cd5('0x3e')](_0x5cd5('0x78'),_0x4c94d8[_0x5cd5('0x79')][_0x5cd5('0x73')]())[_0x5cd5('0x3e')](_0x5cd5('0x7a'))[_0x5cd5('0x3e')](_0x5cd5('0x7e'),squel[_0x5cd5('0x71')]()[_0x5cd5('0x72')]('COALESCE(phone,\x27\x27)')[_0x5cd5('0x75')]('cm_hopper')[_0x5cd5('0x3e')](_0x5cd5('0x7d'),_0x3ff0d5['params']['id'][_0x5cd5('0x73')]())))[_0x5cd5('0x73')]();break;default:_0x394742=squel['insert']()[_0x5cd5('0x81')](_0x5cd5('0x6b'))[_0x5cd5('0x6c')]([_0x5cd5('0x6d'),_0x5cd5('0x6e'),'ContactId',_0x5cd5('0x70'),_0x5cd5('0x5e'),'createdAt',_0x5cd5('0x56')],squel[_0x5cd5('0x71')]()[_0x5cd5('0x72')](_0x5cd5('0x6d'),_0x5cd5('0x6d'))[_0x5cd5('0x72')]('NOW()',_0x5cd5('0x6e'))[_0x5cd5('0x72')]('id',_0x5cd5('0x6f'))[_0x5cd5('0x72')](_0x4c94d8[_0x5cd5('0x79')]['toString'](),_0x5cd5('0x70'))[_0x5cd5('0x72')](_0x3ff0d5[_0x5cd5('0x49')]['id'][_0x5cd5('0x73')](),_0x5cd5('0x5e'))[_0x5cd5('0x72')](_0x5cd5('0x74'),'createdAt')[_0x5cd5('0x72')]('NOW()',_0x5cd5('0x56'))['from'](_0x5cd5('0x76'))[_0x5cd5('0x3e')](_0x5cd5('0x77'))['where'](_0x5cd5('0x78'),_0x4c94d8[_0x5cd5('0x79')][_0x5cd5('0x73')]())['where'](_0x5cd5('0x7a')))['toString']();}_0x1f4e78['push'](db['sequelize'][_0x5cd5('0x33')](_0x394742));}return BPromise['all'](_0x1f4e78);}})[_0x5cd5('0x24')](function(){return _0x2fc4be;})['then'](respondWithResult(_0x2296ad,null))[_0x5cd5('0x47')](handleError(_0x2296ad,null));};exports[_0x5cd5('0x82')]=function(_0x92dd0,_0xcb72b9,_0x3af6ec){return db['Campaign'][_0x5cd5('0x4a')]({'where':{'id':_0x92dd0[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0xcb72b9,null))[_0x5cd5('0x24')](function(_0x1bf43c){if(_0x1bf43c){return _0x1bf43c[_0x5cd5('0x82')](_0x92dd0[_0x5cd5('0x33')][_0x5cd5('0x67')]);}})[_0x5cd5('0x24')](function(_0x5a93d8){if(_0x5a93d8){return db[_0x5cd5('0x5b')][_0x5cd5('0x23')]({'where':{'ListId':_0x92dd0[_0x5cd5('0x33')][_0x5cd5('0x67')],'CampaignId':_0x92dd0['params']['id']}})[_0x5cd5('0x24')](function(){return _0x5a93d8;});}})['then'](respondWithStatusCode(_0xcb72b9,null))[_0x5cd5('0x47')](handleError(_0xcb72b9,null));};exports[_0x5cd5('0x83')]=function(_0x52848c,_0x30eabb,_0x183d2f){var _0x322a83={};var _0x1ad275={};var _0xe97948;var _0x557fde;return db[_0x5cd5('0x43')][_0x5cd5('0x59')]({'where':{'id':_0x52848c['params']['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x30eabb,null))[_0x5cd5('0x24')](function(_0x54b521){if(_0x54b521){_0xe97948=_0x54b521;_0x1ad275[_0x5cd5('0x31')]=_[_0x5cd5('0x34')](db['CmList'][_0x5cd5('0x2d')]);_0x1ad275['query']=_['keys'](_0x52848c[_0x5cd5('0x33')]);_0x1ad275['filters']=_[_0x5cd5('0x36')](_0x1ad275[_0x5cd5('0x31')],_0x1ad275[_0x5cd5('0x33')]);_0x322a83[_0x5cd5('0x37')]=_[_0x5cd5('0x36')](_0x1ad275['model'],qs[_0x5cd5('0x38')](_0x52848c['query']['fields']));_0x322a83[_0x5cd5('0x37')]=_0x322a83[_0x5cd5('0x37')][_0x5cd5('0x39')]?_0x322a83[_0x5cd5('0x37')]:_0x1ad275[_0x5cd5('0x31')];_0x322a83[_0x5cd5('0x3c')]=qs[_0x5cd5('0x3d')](_0x52848c[_0x5cd5('0x33')][_0x5cd5('0x3d')]);_0x322a83[_0x5cd5('0x3e')]=qs[_0x5cd5('0x35')](_[_0x5cd5('0x5a')](_0x52848c['query'],_0x1ad275[_0x5cd5('0x35')]));if(_0x52848c['query'][_0x5cd5('0x3f')]){_0x322a83[_0x5cd5('0x3e')]=_[_0x5cd5('0x40')](_0x322a83['where'],{'$or':_[_0x5cd5('0x2c')](_0x322a83[_0x5cd5('0x37')],function(_0x2f06bd){var _0x1043a4={};_0x1043a4[_0x2f06bd]={'$like':'%'+_0x52848c[_0x5cd5('0x33')][_0x5cd5('0x3f')]+'%'};return _0x1043a4;})});}_0x322a83=_[_0x5cd5('0x40')]({},_0x322a83,_0x52848c['options']);return _0xe97948[_0x5cd5('0x83')](_0x322a83);}})[_0x5cd5('0x24')](function(_0x36783a){if(_0x36783a){_0x557fde=_0x36783a[_0x5cd5('0x39')];if(!_0x52848c[_0x5cd5('0x33')][_0x5cd5('0x3a')](_0x5cd5('0x3b'))){_0x322a83[_0x5cd5('0x1b')]=qs[_0x5cd5('0x1b')](_0x52848c['query'][_0x5cd5('0x1b')]);_0x322a83[_0x5cd5('0x1e')]=qs[_0x5cd5('0x1e')](_0x52848c['query']['offset']);}return _0xe97948[_0x5cd5('0x83')](_0x322a83);}})['then'](function(_0x2978c4){if(_0x2978c4){return _0x2978c4?{'count':_0x557fde,'rows':_0x2978c4}:null;}})[_0x5cd5('0x24')](respondWithResult(_0x30eabb,null))[_0x5cd5('0x47')](handleError(_0x30eabb,null));};exports['addBlackLists']=function(_0x380390,_0x4643bf,_0x1e233f){var _0x12972f,_0xa0d733;return db['Campaign'][_0x5cd5('0x4a')]({'where':{'id':_0x380390[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x4643bf,null))['then'](function(_0x356783){if(_0x356783){_0xa0d733=_0x356783;return _0x356783['addBlackLists'](_0x380390[_0x5cd5('0x4c')][_0x5cd5('0x67')],_[_0x5cd5('0x55')](_0x380390[_0x5cd5('0x4c')],['ids','id'])||{});}return null;})[_0x5cd5('0x68')](function(_0x1a3e51){var _0x2b197f;_0x12972f=_0x1a3e51||[];var _0x52c415=[];if(_0x1a3e51){for(var _0x147f4b=0x0;_0x147f4b<_0x1a3e51[_0x5cd5('0x39')];_0x147f4b+=0x1){var _0x28598e=_0x1a3e51[_0x147f4b][_0x5cd5('0x25')]({'plain':!![]});_0x2b197f=squel[_0x5cd5('0x80')]()[_0x5cd5('0x81')]('cm_hopper_black')['fromQuery'](['phone',_0x5cd5('0x6f'),_0x5cd5('0x70'),_0x5cd5('0x5e'),_0x5cd5('0x57'),_0x5cd5('0x56')],squel[_0x5cd5('0x71')]()[_0x5cd5('0x72')](_0x5cd5('0x6d'),_0x5cd5('0x6d'))[_0x5cd5('0x72')]('id',_0x5cd5('0x6f'))[_0x5cd5('0x72')](_0x28598e[_0x5cd5('0x79')][_0x5cd5('0x73')](),_0x5cd5('0x70'))['field'](_0x380390[_0x5cd5('0x49')]['id'][_0x5cd5('0x73')](),_0x5cd5('0x5e'))[_0x5cd5('0x72')](_0x5cd5('0x74'),_0x5cd5('0x57'))[_0x5cd5('0x72')](_0x5cd5('0x74'),_0x5cd5('0x56'))[_0x5cd5('0x75')]('cm_contacts')['where'](_0x5cd5('0x77'))[_0x5cd5('0x3e')](_0x5cd5('0x78'),_0x28598e['CmListId'][_0x5cd5('0x73')]())['where'](_0x5cd5('0x7a')))['toString']();_0x52c415[_0x5cd5('0x84')](db['sequelize'][_0x5cd5('0x33')](_0x2b197f));}return BPromise[_0x5cd5('0x85')](_0x52c415);}})[_0x5cd5('0x24')](function(){return _0x12972f;})['then'](respondWithResult(_0x4643bf,null))['catch'](handleError(_0x4643bf,null));};exports['removeBlackLists']=function(_0x33274d,_0x41dadc,_0x2bf8df){return db['Campaign'][_0x5cd5('0x4a')]({'where':{'id':_0x33274d[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](handleEntityNotFound(_0x41dadc,null))[_0x5cd5('0x24')](function(_0x1123a2){if(_0x1123a2){return _0x1123a2[_0x5cd5('0x86')](_0x33274d['query']['ids']);}})[_0x5cd5('0x24')](function(_0x204a3a){if(_0x204a3a){return db[_0x5cd5('0x63')][_0x5cd5('0x23')]({'where':{'ListId':_0x33274d['query']['ids'],'CampaignId':_0x33274d[_0x5cd5('0x49')]['id']}})[_0x5cd5('0x24')](function(){return _0x204a3a;});}})[_0x5cd5('0x24')](respondWithStatusCode(_0x41dadc,null))[_0x5cd5('0x47')](handleError(_0x41dadc,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 765310f..3cc355e 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5277cc,_0x39d5a9){var _0x1bba2b=function(_0x620d20){while(--_0x620d20){_0x5277cc['push'](_0x5277cc['shift']());}};_0x1bba2b(++_0x39d5a9);}(_0x7a54,0x106));var _0x47a5=function(_0x12bb52,_0x3b6415){_0x12bb52=_0x12bb52-0x0;var _0x4ba1ed=_0x7a54[_0x12bb52];return _0x4ba1ed;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 9fe53de..b4f60c7 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 _0xf4dd=['info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then'];(function(_0x3afa79,_0x2f1a1f){var _0x4b48ef=function(_0xca9a4b){while(--_0xca9a4b){_0x3afa79['push'](_0x3afa79['shift']());}};_0x4b48ef(++_0x2f1a1f);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x215de4,_0x2ba2b4){_0x215de4=_0x215de4-0x0;var _0x3607d2=_0xf4dd[_0x215de4];return _0x3607d2;};'use strict';var _=require(_0xdf4d('0x0'));var util=require(_0xdf4d('0x1'));var moment=require(_0xdf4d('0x2'));var BPromise=require(_0xdf4d('0x3'));var rs=require(_0xdf4d('0x4'));var fs=require('fs');var Redis=require(_0xdf4d('0x5'));var db=require(_0xdf4d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf4d('0x7'))('rpc');var config=require(_0xdf4d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdf4d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4334b0,_0x5ee8f5,_0x64c256){return new BPromise(function(_0x4a3e29,_0x34918e){return client[_0xdf4d('0xa')](_0x4334b0,_0x64c256)[_0xdf4d('0xb')](function(_0x49c7ef){logger[_0xdf4d('0xc')](_0xdf4d('0xd'),_0x5ee8f5,_0xdf4d('0xe'));logger[_0xdf4d('0xf')](_0xdf4d('0x10'),_0x5ee8f5,_0xdf4d('0xe'),JSON[_0xdf4d('0x11')](_0x49c7ef));if(_0x49c7ef[_0xdf4d('0x12')]){if(_0x49c7ef[_0xdf4d('0x12')]['code']===0x1f4){logger[_0xdf4d('0x12')](_0xdf4d('0xd'),_0x5ee8f5,_0x49c7ef[_0xdf4d('0x12')][_0xdf4d('0x13')]);return _0x34918e(_0x49c7ef[_0xdf4d('0x12')][_0xdf4d('0x13')]);}logger[_0xdf4d('0x12')](_0xdf4d('0xd'),_0x5ee8f5,_0x49c7ef[_0xdf4d('0x12')][_0xdf4d('0x13')]);return _0x4a3e29(_0x49c7ef[_0xdf4d('0x12')][_0xdf4d('0x13')]);}else{logger[_0xdf4d('0xc')](_0xdf4d('0xd'),_0x5ee8f5,_0xdf4d('0xe'));_0x4a3e29(_0x49c7ef[_0xdf4d('0x14')][_0xdf4d('0x13')]);}})[_0xdf4d('0x15')](function(_0x357a70){logger['error']('Campaign,\x20%s,\x20%s',_0x5ee8f5,_0x357a70);_0x34918e(_0x357a70);});});}exports[_0xdf4d('0x16')]=function(_0x95b106){var _0x4f88c3=this;return new Promise(function(_0x4e02f8,_0x48aca2){return db['Campaign'][_0xdf4d('0x17')]({'raw':_0x95b106['options']?_0x95b106[_0xdf4d('0x18')][_0xdf4d('0x19')]===undefined?!![]:![]:!![],'where':_0x95b106[_0xdf4d('0x18')]?_0x95b106['options'][_0xdf4d('0x1a')]||null:null,'attributes':_0x95b106[_0xdf4d('0x18')]?_0x95b106[_0xdf4d('0x18')][_0xdf4d('0x1b')]||null:null,'limit':_0x95b106[_0xdf4d('0x18')]?_0x95b106[_0xdf4d('0x18')][_0xdf4d('0x1c')]||null:null,'include':_0x95b106[_0xdf4d('0x18')]?_0x95b106[_0xdf4d('0x18')][_0xdf4d('0x1d')]?_[_0xdf4d('0x1e')](_0x95b106[_0xdf4d('0x18')][_0xdf4d('0x1d')],function(_0x3e96a0){return{'model':db[_0x3e96a0[_0xdf4d('0x1f')]],'as':_0x3e96a0['as'],'attributes':_0x3e96a0['attributes'],'include':_0x3e96a0[_0xdf4d('0x1d')]?_['map'](_0x3e96a0[_0xdf4d('0x1d')],function(_0x5e6009){return{'model':db[_0x5e6009[_0xdf4d('0x1f')]],'as':_0x5e6009['as'],'attributes':_0x5e6009['attributes'],'include':_0x5e6009['include']?_[_0xdf4d('0x1e')](_0x5e6009[_0xdf4d('0x1d')],function(_0x34eed9){return{'model':db[_0x34eed9[_0xdf4d('0x1f')]],'as':_0x34eed9['as'],'attributes':_0x34eed9['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf4d('0xb')](function(_0x397534){logger[_0xdf4d('0xc')](_0xdf4d('0x16'),_0x95b106);logger['debug'](_0xdf4d('0x16'),_0x95b106,JSON[_0xdf4d('0x11')](_0x397534));_0x4e02f8(_0x397534);})[_0xdf4d('0x15')](function(_0x44e031){logger[_0xdf4d('0x12')](_0xdf4d('0x16'),_0x44e031['message'],_0x95b106);_0x48aca2(_0x4f88c3[_0xdf4d('0x12')](0x1f4,_0x44e031[_0xdf4d('0x13')]));});});};
\ No newline at end of file
+var _0x8a9c=['jayson/promise','http','request','then','request\x20sent','debug','error','message','info','Campaign,\x20%s,\x20%s','Campaign','findAll','options','where','attributes','limit','include','map','model','GetCampaign','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x9347c0,_0x16ab16){var _0xbd1531=function(_0x5d9034){while(--_0x5d9034){_0x9347c0['push'](_0x9347c0['shift']());}};_0xbd1531(++_0x16ab16);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var moment=require(_0xc8a9('0x2'));var BPromise=require(_0xc8a9('0x3'));var rs=require(_0xc8a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8a9('0x5'))['db'];var utils=require(_0xc8a9('0x6'));var logger=require('../../config/logger')(_0xc8a9('0x7'));var config=require(_0xc8a9('0x8'));var jayson=require(_0xc8a9('0x9'));var client=jayson['client'][_0xc8a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dc31c,_0x1d49c8,_0x4520a2){return new BPromise(function(_0x2928f3,_0x241eae){return client[_0xc8a9('0xb')](_0x3dc31c,_0x4520a2)[_0xc8a9('0xc')](function(_0xb079ad){logger['info']('Campaign,\x20%s,\x20%s',_0x1d49c8,_0xc8a9('0xd'));logger[_0xc8a9('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1d49c8,_0xc8a9('0xd'),JSON['stringify'](_0xb079ad));if(_0xb079ad[_0xc8a9('0xf')]){if(_0xb079ad[_0xc8a9('0xf')]['code']===0x1f4){logger[_0xc8a9('0xf')]('Campaign,\x20%s,\x20%s',_0x1d49c8,_0xb079ad[_0xc8a9('0xf')][_0xc8a9('0x10')]);return _0x241eae(_0xb079ad[_0xc8a9('0xf')][_0xc8a9('0x10')]);}logger[_0xc8a9('0xf')]('Campaign,\x20%s,\x20%s',_0x1d49c8,_0xb079ad['error'][_0xc8a9('0x10')]);return _0x2928f3(_0xb079ad['error'][_0xc8a9('0x10')]);}else{logger[_0xc8a9('0x11')](_0xc8a9('0x12'),_0x1d49c8,_0xc8a9('0xd'));_0x2928f3(_0xb079ad['result']['message']);}})['catch'](function(_0x4d03fe){logger[_0xc8a9('0xf')](_0xc8a9('0x12'),_0x1d49c8,_0x4d03fe);_0x241eae(_0x4d03fe);});});}exports['GetCampaign']=function(_0x43f403){var _0x2d894e=this;return new Promise(function(_0x35bd4a,_0x20b70d){return db[_0xc8a9('0x13')][_0xc8a9('0x14')]({'raw':_0x43f403[_0xc8a9('0x15')]?_0x43f403[_0xc8a9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x43f403[_0xc8a9('0x15')]?_0x43f403[_0xc8a9('0x15')][_0xc8a9('0x16')]||null:null,'attributes':_0x43f403[_0xc8a9('0x15')]?_0x43f403[_0xc8a9('0x15')][_0xc8a9('0x17')]||null:null,'limit':_0x43f403[_0xc8a9('0x15')]?_0x43f403[_0xc8a9('0x15')][_0xc8a9('0x18')]||null:null,'include':_0x43f403['options']?_0x43f403[_0xc8a9('0x15')][_0xc8a9('0x19')]?_[_0xc8a9('0x1a')](_0x43f403['options'][_0xc8a9('0x19')],function(_0x1dad26){return{'model':db[_0x1dad26['model']],'as':_0x1dad26['as'],'attributes':_0x1dad26[_0xc8a9('0x17')],'include':_0x1dad26[_0xc8a9('0x19')]?_['map'](_0x1dad26[_0xc8a9('0x19')],function(_0x19f42e){return{'model':db[_0x19f42e[_0xc8a9('0x1b')]],'as':_0x19f42e['as'],'attributes':_0x19f42e[_0xc8a9('0x17')],'include':_0x19f42e[_0xc8a9('0x19')]?_['map'](_0x19f42e[_0xc8a9('0x19')],function(_0x17f08c){return{'model':db[_0x17f08c[_0xc8a9('0x1b')]],'as':_0x17f08c['as'],'attributes':_0x17f08c[_0xc8a9('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25aa4d){logger[_0xc8a9('0x11')](_0xc8a9('0x1c'),_0x43f403);logger['debug'](_0xc8a9('0x1c'),_0x43f403,JSON[_0xc8a9('0x1d')](_0x25aa4d));_0x35bd4a(_0x25aa4d);})[_0xc8a9('0x1e')](function(_0x411e23){logger[_0xc8a9('0xf')](_0xc8a9('0x1c'),_0x411e23[_0xc8a9('0x10')],_0x43f403);_0x20b70d(_0x2d894e[_0xc8a9('0xf')](0x1f4,_0x411e23[_0xc8a9('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 46bec3c..8844bcc 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 _0x02c5=['connect-timeout','fs-extra','./campaign.controller','/:id','isAuthenticated','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','clone','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x02c5,0x178));var _0x502c=function(_0x458656,_0x4292d8){_0x458656=_0x458656-0x0;var _0x24e475=_0x02c5[_0x458656];return _0x24e475;};'use strict';var multer=require(_0x502c('0x0'));var util=require(_0x502c('0x1'));var path=require('path');var timeout=require(_0x502c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x502c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x502c('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x502c('0x5'),auth[_0x502c('0x6')](),controller['show']);router[_0x502c('0x7')](_0x502c('0x8'),auth[_0x502c('0x6')](),controller[_0x502c('0x9')]);router[_0x502c('0x7')]('/:id/hopper_histories',auth[_0x502c('0x6')](),controller[_0x502c('0xa')]);router[_0x502c('0x7')](_0x502c('0xb'),auth[_0x502c('0x6')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x502c('0x6')](),controller[_0x502c('0xc')]);router[_0x502c('0x7')](_0x502c('0xd'),auth[_0x502c('0x6')](),controller[_0x502c('0xe')]);router[_0x502c('0x7')](_0x502c('0xf'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x502c('0x6')](),controller[_0x502c('0x10')]);router[_0x502c('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0x502c('0x12')]);router[_0x502c('0x11')](_0x502c('0xd'),auth[_0x502c('0x6')](),controller[_0x502c('0x13')]);router['post'](_0x502c('0xf'),auth[_0x502c('0x6')](),controller[_0x502c('0x14')]);router[_0x502c('0x15')](_0x502c('0x5'),auth[_0x502c('0x6')](),controller[_0x502c('0x16')]);router[_0x502c('0x17')](_0x502c('0x5'),auth['isAuthenticated'](),controller[_0x502c('0x18')]);router['delete']('/:id/lists',auth[_0x502c('0x6')](),controller['removeLists']);router['delete'](_0x502c('0xf'),auth['isAuthenticated'](),controller[_0x502c('0x19')]);module[_0x502c('0x1a')]=router;
\ No newline at end of file
+var _0x93fa=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x93fa,0x17b));var _0xa93f=function(_0x180391,_0x55d9ff){_0x180391=_0x180391-0x0;var _0x4ded40=_0x93fa[_0x180391];return _0x4ded40;};'use strict';var multer=require(_0xa93f('0x0'));var util=require('util');var path=require(_0xa93f('0x1'));var timeout=require(_0xa93f('0x2'));var express=require(_0xa93f('0x3'));var router=express[_0xa93f('0x4')]();var fs_extra=require(_0xa93f('0x5'));var auth=require(_0xa93f('0x6'));var interaction=require(_0xa93f('0x7'));var config=require(_0xa93f('0x8'));var controller=require(_0xa93f('0x9'));router[_0xa93f('0xa')]('/',auth[_0xa93f('0xb')](),controller[_0xa93f('0xc')]);router[_0xa93f('0xa')](_0xa93f('0xd'),auth['isAuthenticated'](),controller[_0xa93f('0xe')]);router[_0xa93f('0xa')](_0xa93f('0xf'),auth['isAuthenticated'](),controller[_0xa93f('0x10')]);router[_0xa93f('0xa')](_0xa93f('0x11'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x12')]);router[_0xa93f('0xa')](_0xa93f('0x13'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x14')]);router[_0xa93f('0xa')](_0xa93f('0x15'),auth[_0xa93f('0xb')](),controller['getHopperBlacks']);router[_0xa93f('0xa')](_0xa93f('0x16'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x17')]);router[_0xa93f('0xa')]('/:id/blacklists',auth[_0xa93f('0xb')](),controller['getBlackLists']);router[_0xa93f('0x18')]('/',auth[_0xa93f('0xb')](),controller['create']);router[_0xa93f('0x18')](_0xa93f('0x19'),auth[_0xa93f('0xb')](),controller['clone']);router[_0xa93f('0x18')](_0xa93f('0x16'),auth['isAuthenticated'](),controller[_0xa93f('0x1a')]);router[_0xa93f('0x18')](_0xa93f('0x1b'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x1c')]);router[_0xa93f('0x1d')](_0xa93f('0xd'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x1e')]);router[_0xa93f('0x1f')](_0xa93f('0xd'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x20')]);router[_0xa93f('0x1f')](_0xa93f('0x16'),auth[_0xa93f('0xb')](),controller[_0xa93f('0x21')]);router[_0xa93f('0x1f')]('/:id/blacklists',auth[_0xa93f('0xb')](),controller[_0xa93f('0x22')]);module[_0xa93f('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4ce1b81..7022226 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 _0x57f6=['TEXT','VIRTUAL','getDataValue','key','exports','STRING'];(function(_0x3a7fa5,_0x515894){var _0x50319a=function(_0x249631){while(--_0x249631){_0x3a7fa5['push'](_0x3a7fa5['shift']());}};_0x50319a(++_0x515894);}(_0x57f6,0x1e4));var _0x657f=function(_0x350a01,_0x5ed763){_0x350a01=_0x350a01-0x0;var _0xc17c6b=_0x57f6[_0x350a01];return _0xc17c6b;};'use strict';var Sequelize=require('sequelize');module[_0x657f('0x0')]={'key':{'type':Sequelize[_0x657f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x657f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x657f('0x1')]},'name':{'type':Sequelize[_0x657f('0x3')],'get':function(){return this[_0x657f('0x4')](_0x657f('0x5'));}}};
\ No newline at end of file
+var _0x3ba8=['STRING','getDataValue','key','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ba8,0xbc));var _0x83ba=function(_0x341645,_0x408ce0){_0x341645=_0x341645-0x0;var _0x6d5d41=_0x3ba8[_0x341645];return _0x6d5d41;};'use strict';var Sequelize=require(_0x83ba('0x0'));module[_0x83ba('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x83ba('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x83ba('0x3')](_0x83ba('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6a00c9f..95b5933 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 _0x3b0e=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','filter','include','findAll','catch','show','keys','length','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment'];(function(_0x59c14b,_0x1dbdae){var _0x17a621=function(_0x1d51d7){while(--_0x1d51d7){_0x59c14b['push'](_0x59c14b['shift']());}};_0x17a621(++_0x1dbdae);}(_0x3b0e,0xf7));var _0xe3b0=function(_0x35e9e4,_0x54e65c){_0x35e9e4=_0x35e9e4-0x0;var _0x17a7dd=_0x3b0e[_0x35e9e4];return _0x17a7dd;};'use strict';var emlformat=require(_0xe3b0('0x0'));var rimraf=require(_0xe3b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3b0('0x2'));var rp=require(_0xe3b0('0x3'));var moment=require(_0xe3b0('0x4'));var BPromise=require(_0xe3b0('0x5'));var Mustache=require('mustache');var util=require(_0xe3b0('0x6'));var path=require(_0xe3b0('0x7'));var sox=require(_0xe3b0('0x8'));var csv=require('to-csv');var ejs=require(_0xe3b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3b0('0xa'));var squel=require(_0xe3b0('0xb'));var crypto=require(_0xe3b0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe3b0('0xd'));var toCsv=require(_0xe3b0('0xe'));var querystring=require('querystring');var Papa=require(_0xe3b0('0xf'));var Redis=require(_0xe3b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe3b0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe3b0('0x12'));var utils=require('../../config/utils');var config=require(_0xe3b0('0x13'));var licenseUtil=require(_0xe3b0('0x14'));var db=require(_0xe3b0('0x15'))['db'];function respondWithStatusCode(_0x1be7e9,_0x38324c){_0x38324c=_0x38324c||0xcc;return function(_0x36617d){if(_0x36617d){return _0x1be7e9[_0xe3b0('0x16')](_0x38324c);}return _0x1be7e9[_0xe3b0('0x17')](_0x38324c)[_0xe3b0('0x18')]();};}function respondWithResult(_0x5de727,_0x49876d){_0x49876d=_0x49876d||0xc8;return function(_0x525d0f){if(_0x525d0f){return _0x5de727[_0xe3b0('0x17')](_0x49876d)[_0xe3b0('0x19')](_0x525d0f);}};}function respondWithFilteredResult(_0x293ef0,_0x140903){return function(_0x2b488f){if(_0x2b488f){var _0x337006=typeof _0x140903[_0xe3b0('0x1a')]==='undefined'&&typeof _0x140903[_0xe3b0('0x1b')]===_0xe3b0('0x1c');var _0x10da63=_0x2b488f[_0xe3b0('0x1d')];var _0x139383=_0x337006?0x0:_0x140903[_0xe3b0('0x1a')];var _0x587e83=_0x337006?_0x2b488f[_0xe3b0('0x1d')]:_0x140903[_0xe3b0('0x1a')]+_0x140903[_0xe3b0('0x1b')];var _0xac4db7;if(_0x587e83>=_0x10da63){_0x587e83=_0x10da63;_0xac4db7=0xc8;}else{_0xac4db7=0xce;}_0x293ef0[_0xe3b0('0x17')](_0xac4db7);return _0x293ef0[_0xe3b0('0x1e')](_0xe3b0('0x1f'),_0x139383+'-'+_0x587e83+'/'+_0x10da63)[_0xe3b0('0x19')](_0x2b488f);}return null;};}function patchUpdates(_0x54a9ad){return function(_0x5310f9){try{jsonpatch[_0xe3b0('0x20')](_0x5310f9,_0x54a9ad,!![]);}catch(_0x369956){return BPromise['reject'](_0x369956);}return _0x5310f9[_0xe3b0('0x21')]();};}function saveUpdates(_0x25c8ac,_0x449212){return function(_0x2205a5){if(_0x2205a5){return _0x2205a5[_0xe3b0('0x22')](_0x25c8ac)['then'](function(_0x150fc7){return _0x150fc7;});}return null;};}function removeEntity(_0x4688f3,_0x46fafa){return function(_0x4c1503){if(_0x4c1503){return _0x4c1503[_0xe3b0('0x23')]()[_0xe3b0('0x24')](function(){var _0x3c089b=_0x4c1503['get']({'plain':!![]});var _0xf1ad6c=_0xe3b0('0x25');return db['UserProfileResource'][_0xe3b0('0x23')]({'where':{'type':_0xf1ad6c,'resourceId':_0x3c089b['id']}})[_0xe3b0('0x24')](function(){return _0x4c1503;});})[_0xe3b0('0x24')](function(){_0x4688f3['status'](0xcc)[_0xe3b0('0x18')]();});}};}function handleEntityNotFound(_0x6c1837,_0x31dfd8){return function(_0x22b6e4){if(!_0x22b6e4){_0x6c1837['sendStatus'](0x194);}return _0x22b6e4;};}function handleError(_0x32bcae,_0x4bdf78){_0x4bdf78=_0x4bdf78||0x1f4;return function(_0x2660e2){logger[_0xe3b0('0x26')](_0x2660e2[_0xe3b0('0x27')]);if(_0x2660e2[_0xe3b0('0x28')]){delete _0x2660e2[_0xe3b0('0x28')];}_0x32bcae[_0xe3b0('0x17')](_0x4bdf78)[_0xe3b0('0x29')](_0x2660e2);};}exports[_0xe3b0('0x2a')]=function(_0x551987,_0x127da6){var _0x17d3ec={},_0x2aa006={},_0x5c6455={'count':0x0,'rows':[]};var _0x3c9324=_[_0xe3b0('0x2b')](db[_0xe3b0('0x2c')][_0xe3b0('0x2d')],function(_0x4a8f16){return{'name':_0x4a8f16[_0xe3b0('0x2e')],'type':_0x4a8f16[_0xe3b0('0x2f')][_0xe3b0('0x30')]};});_0x2aa006[_0xe3b0('0x31')]=_[_0xe3b0('0x2b')](_0x3c9324,_0xe3b0('0x28'));_0x2aa006[_0xe3b0('0x32')]=_['keys'](_0x551987[_0xe3b0('0x32')]);_0x2aa006[_0xe3b0('0x33')]=_[_0xe3b0('0x34')](_0x2aa006[_0xe3b0('0x31')],_0x2aa006[_0xe3b0('0x32')]);_0x17d3ec[_0xe3b0('0x35')]=_['intersection'](_0x2aa006[_0xe3b0('0x31')],qs['fields'](_0x551987[_0xe3b0('0x32')][_0xe3b0('0x36')]));_0x17d3ec[_0xe3b0('0x35')]=_0x17d3ec[_0xe3b0('0x35')]['length']?_0x17d3ec[_0xe3b0('0x35')]:_0x2aa006[_0xe3b0('0x31')];if(!_0x551987['query'][_0xe3b0('0x37')](_0xe3b0('0x38'))){_0x17d3ec[_0xe3b0('0x1b')]=qs[_0xe3b0('0x1b')](_0x551987['query'][_0xe3b0('0x1b')]);_0x17d3ec[_0xe3b0('0x1a')]=qs[_0xe3b0('0x1a')](_0x551987[_0xe3b0('0x32')][_0xe3b0('0x1a')]);}_0x17d3ec[_0xe3b0('0x39')]=qs[_0xe3b0('0x3a')](_0x551987['query'][_0xe3b0('0x3a')]);_0x17d3ec['where']=qs[_0xe3b0('0x33')](_[_0xe3b0('0x3b')](_0x551987[_0xe3b0('0x32')],_0x2aa006[_0xe3b0('0x33')]),_0x3c9324);if(_0x551987[_0xe3b0('0x32')]['filter']){_0x17d3ec['where']=_[_0xe3b0('0x3c')](_0x17d3ec[_0xe3b0('0x3d')],{'$or':[{'key':{'$like':'%'+_0x551987['query']['filter']+'%'}},{'value':{'$like':'%'+_0x551987['query'][_0xe3b0('0x3e')]+'%'}}]});}_0x17d3ec=_[_0xe3b0('0x3c')]({},_0x17d3ec,_0x551987['options']);var _0x274039={'where':_0x17d3ec['where']};return db[_0xe3b0('0x2c')][_0xe3b0('0x1d')](_0x274039)[_0xe3b0('0x24')](function(_0x47095d){_0x5c6455[_0xe3b0('0x1d')]=_0x47095d;if(_0x551987[_0xe3b0('0x32')]['includeAll']){_0x17d3ec[_0xe3b0('0x3f')]=[{'all':!![]}];}return db[_0xe3b0('0x2c')][_0xe3b0('0x40')](_0x17d3ec);})[_0xe3b0('0x24')](function(_0x2f1314){_0x5c6455['rows']=_0x2f1314;return _0x5c6455;})[_0xe3b0('0x24')](respondWithFilteredResult(_0x127da6,_0x17d3ec))[_0xe3b0('0x41')](handleError(_0x127da6,null));};exports[_0xe3b0('0x42')]=function(_0x238836,_0x53cb05){var _0x389310={'raw':!![],'where':{'id':_0x238836['params']['id']}},_0x4892c4={};_0x4892c4['model']=_[_0xe3b0('0x43')](db[_0xe3b0('0x2c')][_0xe3b0('0x2d')]);_0x4892c4[_0xe3b0('0x32')]=_[_0xe3b0('0x43')](_0x238836['query']);_0x4892c4[_0xe3b0('0x33')]=_['intersection'](_0x4892c4[_0xe3b0('0x31')],_0x4892c4[_0xe3b0('0x32')]);_0x389310['attributes']=_[_0xe3b0('0x34')](_0x4892c4[_0xe3b0('0x31')],qs[_0xe3b0('0x36')](_0x238836[_0xe3b0('0x32')][_0xe3b0('0x36')]));_0x389310[_0xe3b0('0x35')]=_0x389310['attributes'][_0xe3b0('0x44')]?_0x389310['attributes']:_0x4892c4[_0xe3b0('0x31')];if(_0x238836[_0xe3b0('0x32')]['includeAll']){_0x389310['include']=[{'all':!![]}];}_0x389310=_[_0xe3b0('0x3c')]({},_0x389310,_0x238836[_0xe3b0('0x45')]);return db[_0xe3b0('0x2c')][_0xe3b0('0x46')](_0x389310)['then'](handleEntityNotFound(_0x53cb05,null))[_0xe3b0('0x24')](respondWithResult(_0x53cb05,null))[_0xe3b0('0x41')](handleError(_0x53cb05,null));};exports[_0xe3b0('0x22')]=function(_0x335006,_0x52ba48){if(_0x335006[_0xe3b0('0x47')]['id']){delete _0x335006['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x335006['params']['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0x52ba48,null))[_0xe3b0('0x24')](saveUpdates(_0x335006['body'],null))[_0xe3b0('0x24')](respondWithResult(_0x52ba48,null))[_0xe3b0('0x41')](handleError(_0x52ba48,null));};exports[_0xe3b0('0x23')]=function(_0xe4ee3b,_0x1595ab){return db[_0xe3b0('0x2c')][_0xe3b0('0x46')]({'where':{'id':_0xe4ee3b[_0xe3b0('0x48')]['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0x1595ab,null))[_0xe3b0('0x24')](removeEntity(_0x1595ab,null))[_0xe3b0('0x41')](handleError(_0x1595ab,null));};exports[_0xe3b0('0x49')]=function(_0x5b1a4d,_0x576a69){var _0x178f1f={'key':_0x5b1a4d['body'][_0xe3b0('0x30')]};if(_0x5b1a4d['body'][_0xe3b0('0x4a')]){_0x178f1f[_0xe3b0('0x4a')]=_0x5b1a4d['body']['MailAccountId'];}else if(_0x5b1a4d[_0xe3b0('0x47')][_0xe3b0('0x4b')]){_0x178f1f['SmsAccountId']=_0x5b1a4d[_0xe3b0('0x47')][_0xe3b0('0x4b')];}else if(_0x5b1a4d[_0xe3b0('0x47')]['OpenchannelAccountId']){_0x178f1f[_0xe3b0('0x4c')]=_0x5b1a4d[_0xe3b0('0x47')][_0xe3b0('0x4c')];}else if(_0x5b1a4d[_0xe3b0('0x47')]['ChatWebsiteId']){_0x178f1f[_0xe3b0('0x4d')]=_0x5b1a4d[_0xe3b0('0x47')][_0xe3b0('0x4d')];}return db[_0xe3b0('0x2c')][_0xe3b0('0x46')]({'where':_0x178f1f})[_0xe3b0('0x24')](function(_0x166623){if(_0x166623){throw new db[(_0xe3b0('0x4e'))][(_0xe3b0('0x4f'))](_0xe3b0('0x50'));}return db[_0xe3b0('0x2c')][_0xe3b0('0x49')](_0x5b1a4d['body']);})[_0xe3b0('0x24')](function(_0x52b3c0){var _0x7ada84=_0x5b1a4d[_0xe3b0('0x51')]['get']({'plain':!![]});if(!_0x7ada84)throw new Error(_0xe3b0('0x52'));if(_0x7ada84[_0xe3b0('0x53')]==='user'){var _0x35419c=_0x52b3c0[_0xe3b0('0x54')]({'plain':!![]});return db[_0xe3b0('0x55')][_0xe3b0('0x46')]({'where':{'name':_0xe3b0('0x25'),'userProfileId':_0x7ada84[_0xe3b0('0x56')]},'raw':!![]})[_0xe3b0('0x24')](function(_0x371425){if(_0x371425&&_0x371425[_0xe3b0('0x57')]===0x0){return db[_0xe3b0('0x58')]['create']({'name':_0x35419c[_0xe3b0('0x28')],'resourceId':_0x35419c['id'],'type':_0x371425['name'],'sectionId':_0x371425['id']},{})[_0xe3b0('0x24')](function(){return _0x52b3c0;});}else{return _0x52b3c0;}})[_0xe3b0('0x41')](function(_0xbd8ddc){logger[_0xe3b0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbd8ddc);throw _0xbd8ddc;});}return _0x52b3c0;})['then'](respondWithResult(_0x576a69,0xc9))[_0xe3b0('0x41')](handleError(_0x576a69,null));};
\ No newline at end of file
+var _0x2415=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','include','find','body'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2415,0x1bb));var _0x5241=function(_0x4a0d48,_0x4016b3){_0x4a0d48=_0x4a0d48-0x0;var _0x2abde2=_0x2415[_0x4a0d48];return _0x2abde2;};'use strict';var emlformat=require(_0x5241('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5241('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5241('0x2'));var moment=require(_0x5241('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5241('0x4'));var path=require('path');var sox=require(_0x5241('0x5'));var csv=require(_0x5241('0x6'));var ejs=require(_0x5241('0x7'));var fs=require('fs');var fs_extra=require(_0x5241('0x8'));var _=require(_0x5241('0x9'));var squel=require(_0x5241('0xa'));var crypto=require(_0x5241('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5241('0xc'));var toCsv=require(_0x5241('0x6'));var querystring=require(_0x5241('0xd'));var Papa=require(_0x5241('0xe'));var Redis=require('ioredis');var authService=require(_0x5241('0xf'));var qs=require(_0x5241('0x10'));var as=require(_0x5241('0x11'));var hardwareService=require(_0x5241('0x12'));var logger=require('../../config/logger')(_0x5241('0x13'));var utils=require('../../config/utils');var config=require(_0x5241('0x14'));var licenseUtil=require(_0x5241('0x15'));var db=require(_0x5241('0x16'))['db'];function respondWithStatusCode(_0x29e537,_0x29d59a){_0x29d59a=_0x29d59a||0xcc;return function(_0x2bb8d1){if(_0x2bb8d1){return _0x29e537[_0x5241('0x17')](_0x29d59a);}return _0x29e537['status'](_0x29d59a)[_0x5241('0x18')]();};}function respondWithResult(_0x253352,_0x16777b){_0x16777b=_0x16777b||0xc8;return function(_0x4a12ac){if(_0x4a12ac){return _0x253352['status'](_0x16777b)[_0x5241('0x19')](_0x4a12ac);}};}function respondWithFilteredResult(_0x212302,_0x18c71a){return function(_0x5dfc18){if(_0x5dfc18){var _0x4b7255=typeof _0x18c71a[_0x5241('0x1a')]===_0x5241('0x1b')&&typeof _0x18c71a[_0x5241('0x1c')]===_0x5241('0x1b');var _0x108dcd=_0x5dfc18['count'];var _0xaf9c83=_0x4b7255?0x0:_0x18c71a[_0x5241('0x1a')];var _0x567940=_0x4b7255?_0x5dfc18[_0x5241('0x1d')]:_0x18c71a['offset']+_0x18c71a[_0x5241('0x1c')];var _0x5124e5;if(_0x567940>=_0x108dcd){_0x567940=_0x108dcd;_0x5124e5=0xc8;}else{_0x5124e5=0xce;}_0x212302[_0x5241('0x1e')](_0x5124e5);return _0x212302['set'](_0x5241('0x1f'),_0xaf9c83+'-'+_0x567940+'/'+_0x108dcd)['json'](_0x5dfc18);}return null;};}function patchUpdates(_0x5c1e85){return function(_0x424393){try{jsonpatch[_0x5241('0x20')](_0x424393,_0x5c1e85,!![]);}catch(_0x3b98f9){return BPromise[_0x5241('0x21')](_0x3b98f9);}return _0x424393[_0x5241('0x22')]();};}function saveUpdates(_0x46e290,_0x2d54a8){return function(_0x1cbd44){if(_0x1cbd44){return _0x1cbd44[_0x5241('0x23')](_0x46e290)[_0x5241('0x24')](function(_0x39e80b){return _0x39e80b;});}return null;};}function removeEntity(_0x2202d7,_0x14802d){return function(_0x5297a9){if(_0x5297a9){return _0x5297a9['destroy']()[_0x5241('0x24')](function(){var _0x388e41=_0x5297a9[_0x5241('0x25')]({'plain':!![]});var _0x5a67cd=_0x5241('0x26');return db[_0x5241('0x27')]['destroy']({'where':{'type':_0x5a67cd,'resourceId':_0x388e41['id']}})[_0x5241('0x24')](function(){return _0x5297a9;});})[_0x5241('0x24')](function(){_0x2202d7[_0x5241('0x1e')](0xcc)[_0x5241('0x18')]();});}};}function handleEntityNotFound(_0xf26cbf,_0x2298fb){return function(_0x6b0b1c){if(!_0x6b0b1c){_0xf26cbf[_0x5241('0x17')](0x194);}return _0x6b0b1c;};}function handleError(_0x35b8fa,_0x19078e){_0x19078e=_0x19078e||0x1f4;return function(_0x1d62ae){logger[_0x5241('0x28')](_0x1d62ae[_0x5241('0x29')]);if(_0x1d62ae['name']){delete _0x1d62ae[_0x5241('0x2a')];}_0x35b8fa[_0x5241('0x1e')](_0x19078e)[_0x5241('0x2b')](_0x1d62ae);};}exports[_0x5241('0x2c')]=function(_0x596137,_0xf99a08){var _0x2247ea={},_0x179bbb={},_0xc85e50={'count':0x0,'rows':[]};var _0x2e8328=_[_0x5241('0x2d')](db[_0x5241('0x2e')][_0x5241('0x2f')],function(_0x5dba31){return{'name':_0x5dba31['fieldName'],'type':_0x5dba31['type']['key']};});_0x179bbb[_0x5241('0x30')]=_[_0x5241('0x2d')](_0x2e8328,_0x5241('0x2a'));_0x179bbb[_0x5241('0x31')]=_[_0x5241('0x32')](_0x596137[_0x5241('0x31')]);_0x179bbb[_0x5241('0x33')]=_[_0x5241('0x34')](_0x179bbb[_0x5241('0x30')],_0x179bbb[_0x5241('0x31')]);_0x2247ea[_0x5241('0x35')]=_[_0x5241('0x34')](_0x179bbb['model'],qs[_0x5241('0x36')](_0x596137[_0x5241('0x31')]['fields']));_0x2247ea[_0x5241('0x35')]=_0x2247ea[_0x5241('0x35')][_0x5241('0x37')]?_0x2247ea[_0x5241('0x35')]:_0x179bbb['model'];if(!_0x596137['query'][_0x5241('0x38')](_0x5241('0x39'))){_0x2247ea[_0x5241('0x1c')]=qs['limit'](_0x596137[_0x5241('0x31')][_0x5241('0x1c')]);_0x2247ea['offset']=qs[_0x5241('0x1a')](_0x596137[_0x5241('0x31')][_0x5241('0x1a')]);}_0x2247ea['order']=qs[_0x5241('0x3a')](_0x596137[_0x5241('0x31')][_0x5241('0x3a')]);_0x2247ea[_0x5241('0x3b')]=qs[_0x5241('0x33')](_[_0x5241('0x3c')](_0x596137['query'],_0x179bbb['filters']),_0x2e8328);if(_0x596137[_0x5241('0x31')][_0x5241('0x3d')]){_0x2247ea[_0x5241('0x3b')]=_[_0x5241('0x3e')](_0x2247ea[_0x5241('0x3b')],{'$or':[{'key':{'$like':'%'+_0x596137[_0x5241('0x31')][_0x5241('0x3d')]+'%'}},{'value':{'$like':'%'+_0x596137[_0x5241('0x31')]['filter']+'%'}}]});}_0x2247ea=_[_0x5241('0x3e')]({},_0x2247ea,_0x596137[_0x5241('0x3f')]);var _0x62723f={'where':_0x2247ea['where']};return db['CannedAnswer'][_0x5241('0x1d')](_0x62723f)['then'](function(_0x2a49cd){_0xc85e50[_0x5241('0x1d')]=_0x2a49cd;if(_0x596137[_0x5241('0x31')]['includeAll']){_0x2247ea['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x5241('0x40')](_0x2247ea);})[_0x5241('0x24')](function(_0x4be80c){_0xc85e50[_0x5241('0x41')]=_0x4be80c;return _0xc85e50;})['then'](respondWithFilteredResult(_0xf99a08,_0x2247ea))[_0x5241('0x42')](handleError(_0xf99a08,null));};exports[_0x5241('0x43')]=function(_0x58d1ff,_0x4c2271){var _0x207b8b={'raw':!![],'where':{'id':_0x58d1ff[_0x5241('0x44')]['id']}},_0xc6242c={};_0xc6242c[_0x5241('0x30')]=_['keys'](db[_0x5241('0x2e')][_0x5241('0x2f')]);_0xc6242c[_0x5241('0x31')]=_[_0x5241('0x32')](_0x58d1ff[_0x5241('0x31')]);_0xc6242c['filters']=_[_0x5241('0x34')](_0xc6242c[_0x5241('0x30')],_0xc6242c[_0x5241('0x31')]);_0x207b8b[_0x5241('0x35')]=_['intersection'](_0xc6242c['model'],qs[_0x5241('0x36')](_0x58d1ff['query'][_0x5241('0x36')]));_0x207b8b[_0x5241('0x35')]=_0x207b8b[_0x5241('0x35')]['length']?_0x207b8b[_0x5241('0x35')]:_0xc6242c['model'];if(_0x58d1ff['query'][_0x5241('0x45')]){_0x207b8b[_0x5241('0x46')]=[{'all':!![]}];}_0x207b8b=_['merge']({},_0x207b8b,_0x58d1ff[_0x5241('0x3f')]);return db[_0x5241('0x2e')][_0x5241('0x47')](_0x207b8b)[_0x5241('0x24')](handleEntityNotFound(_0x4c2271,null))['then'](respondWithResult(_0x4c2271,null))[_0x5241('0x42')](handleError(_0x4c2271,null));};exports[_0x5241('0x23')]=function(_0x4fa31e,_0x336656){if(_0x4fa31e[_0x5241('0x48')]['id']){delete _0x4fa31e[_0x5241('0x48')]['id'];}return db['CannedAnswer'][_0x5241('0x47')]({'where':{'id':_0x4fa31e[_0x5241('0x44')]['id']}})[_0x5241('0x24')](handleEntityNotFound(_0x336656,null))[_0x5241('0x24')](saveUpdates(_0x4fa31e[_0x5241('0x48')],null))[_0x5241('0x24')](respondWithResult(_0x336656,null))[_0x5241('0x42')](handleError(_0x336656,null));};exports['destroy']=function(_0x2616a9,_0x16d5bf){return db[_0x5241('0x2e')][_0x5241('0x47')]({'where':{'id':_0x2616a9['params']['id']}})['then'](handleEntityNotFound(_0x16d5bf,null))[_0x5241('0x24')](removeEntity(_0x16d5bf,null))[_0x5241('0x42')](handleError(_0x16d5bf,null));};exports[_0x5241('0x49')]=function(_0x1c4e51,_0x3e3cf4){var _0x5cdc07={'key':_0x1c4e51[_0x5241('0x48')]['key']};if(_0x1c4e51[_0x5241('0x48')]['MailAccountId']){_0x5cdc07[_0x5241('0x4a')]=_0x1c4e51[_0x5241('0x48')]['MailAccountId'];}else if(_0x1c4e51[_0x5241('0x48')][_0x5241('0x4b')]){_0x5cdc07[_0x5241('0x4b')]=_0x1c4e51[_0x5241('0x48')][_0x5241('0x4b')];}else if(_0x1c4e51['body'][_0x5241('0x4c')]){_0x5cdc07[_0x5241('0x4c')]=_0x1c4e51[_0x5241('0x48')][_0x5241('0x4c')];}else if(_0x1c4e51[_0x5241('0x48')][_0x5241('0x4d')]){_0x5cdc07['ChatWebsiteId']=_0x1c4e51['body'][_0x5241('0x4d')];}return db[_0x5241('0x2e')][_0x5241('0x47')]({'where':_0x5cdc07})[_0x5241('0x24')](function(_0x14343c){if(_0x14343c){throw new db['Sequelize'][(_0x5241('0x4e'))](_0x5241('0x4f'));}return db['CannedAnswer']['create'](_0x1c4e51[_0x5241('0x48')]);})[_0x5241('0x24')](function(_0x2fa59a){var _0x236d77=_0x1c4e51['user']['get']({'plain':!![]});if(!_0x236d77)throw new Error(_0x5241('0x50'));if(_0x236d77[_0x5241('0x51')]===_0x5241('0x52')){var _0x1d1643=_0x2fa59a[_0x5241('0x25')]({'plain':!![]});return db[_0x5241('0x53')]['find']({'where':{'name':_0x5241('0x26'),'userProfileId':_0x236d77[_0x5241('0x54')]},'raw':!![]})[_0x5241('0x24')](function(_0x14c63b){if(_0x14c63b&&_0x14c63b['autoAssociation']===0x0){return db[_0x5241('0x27')][_0x5241('0x49')]({'name':_0x1d1643[_0x5241('0x2a')],'resourceId':_0x1d1643['id'],'type':_0x14c63b[_0x5241('0x2a')],'sectionId':_0x14c63b['id']},{})[_0x5241('0x24')](function(){return _0x2fa59a;});}else{return _0x2fa59a;}})[_0x5241('0x42')](function(_0x4da32c){logger['error'](_0x5241('0x55'),_0x4da32c);throw _0x4da32c;});}return _0x2fa59a;})['then'](respondWithResult(_0x3e3cf4,0xc9))[_0x5241('0x42')](handleError(_0x3e3cf4,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 159e275..ea253dc 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 _0x5330=['rimraf','../../config/environment','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x589dad,_0x171fb4){var _0x369e10=function(_0x5a5b94){while(--_0x5a5b94){_0x589dad['push'](_0x589dad['shift']());}};_0x369e10(++_0x171fb4);}(_0x5330,0xe4));var _0x0533=function(_0xa1d4e4,_0x40d04b){_0xa1d4e4=_0xa1d4e4-0x0;var _0x49d602=_0x5330[_0xa1d4e4];return _0x49d602;};'use strict';var _=require(_0x0533('0x0'));var util=require('util');var logger=require(_0x0533('0x1'))(_0x0533('0x2'));var moment=require(_0x0533('0x3'));var BPromise=require(_0x0533('0x4'));var rp=require(_0x0533('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0533('0x6'));var config=require(_0x0533('0x7'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x1317ec,_0x18e5b3){return _0x1317ec[_0x0533('0x8')](_0x0533('0x9'),attributes,{'tableName':_0x0533('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0533('0xb'),'collate':_0x0533('0xc')});};
\ No newline at end of file
+var _0x18d8=['rimraf','../../config/environment','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x17f03f,_0xf8510e){var _0x51efbb=function(_0x394384){while(--_0x394384){_0x17f03f['push'](_0x17f03f['shift']());}};_0x51efbb(++_0xf8510e);}(_0x18d8,0xa1));var _0x818d=function(_0x58422c,_0x55903e){_0x58422c=_0x58422c-0x0;var _0x4f4554=_0x18d8[_0x58422c];return _0x4f4554;};'use strict';var _=require(_0x818d('0x0'));var util=require(_0x818d('0x1'));var logger=require('../../config/logger')(_0x818d('0x2'));var moment=require(_0x818d('0x3'));var BPromise=require(_0x818d('0x4'));var rp=require(_0x818d('0x5'));var fs=require('fs');var path=require(_0x818d('0x6'));var rimraf=require(_0x818d('0x7'));var config=require(_0x818d('0x8'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x2a6e55,_0x1bbb8f){return _0x2a6e55[_0x818d('0x9')](_0x818d('0xa'),attributes,{'tableName':_0x818d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x818d('0xc'),'collate':_0x818d('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 7cd09d0..386dc27 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(_0x58cf54,_0x5b78e1){var _0x20d916=function(_0x4d3ae4){while(--_0x4d3ae4){_0x58cf54['push'](_0x58cf54['shift']());}};_0x20d916(++_0x5b78e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x42ffc2,_0x282c59){var _0x31a437=function(_0x10c2c6){while(--_0x10c2c6){_0x42ffc2['push'](_0x42ffc2['shift']());}};_0x31a437(++_0x282c59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 c84d7b9..3cead0c 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 _0xa7dc=['exports','util','connect-timeout','express','fs-extra','isAuthenticated','index','/:id','show','post','put','update'];(function(_0xacc118,_0x3aa0d1){var _0x51c83d=function(_0x2a9e9f){while(--_0x2a9e9f){_0xacc118['push'](_0xacc118['shift']());}};_0x51c83d(++_0x3aa0d1);}(_0xa7dc,0x109));var _0xca7d=function(_0x95bed5,_0x4bcaa9){_0x95bed5=_0x95bed5-0x0;var _0x16adeb=_0xa7dc[_0x95bed5];return _0x16adeb;};'use strict';var multer=require('multer');var util=require(_0xca7d('0x0'));var path=require('path');var timeout=require(_0xca7d('0x1'));var express=require(_0xca7d('0x2'));var router=express['Router']();var fs_extra=require(_0xca7d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xca7d('0x4')](),controller[_0xca7d('0x5')]);router['get'](_0xca7d('0x6'),auth['isAuthenticated'](),controller[_0xca7d('0x7')]);router[_0xca7d('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca7d('0x9')](_0xca7d('0x6'),auth[_0xca7d('0x4')](),controller[_0xca7d('0xa')]);router['delete']('/:id',auth[_0xca7d('0x4')](),controller['destroy']);module[_0xca7d('0xb')]=router;
\ No newline at end of file
+var _0xf740=['create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./cannedAnswer.controller','get','index','/:id','show','isAuthenticated'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xf740,0x138));var _0x0f74=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0xf740[_0x5aa373];return _0x590e8e;};'use strict';var multer=require('multer');var util=require(_0x0f74('0x0'));var path=require(_0x0f74('0x1'));var timeout=require(_0x0f74('0x2'));var express=require('express');var router=express[_0x0f74('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0f74('0x4'));var controller=require(_0x0f74('0x5'));router[_0x0f74('0x6')]('/',auth['isAuthenticated'](),controller[_0x0f74('0x7')]);router['get'](_0x0f74('0x8'),auth['isAuthenticated'](),controller[_0x0f74('0x9')]);router['post']('/',auth[_0x0f74('0xa')](),controller[_0x0f74('0xb')]);router[_0x0f74('0xc')](_0x0f74('0x8'),auth[_0x0f74('0xa')](),controller[_0x0f74('0xd')]);router[_0x0f74('0xe')](_0x0f74('0x8'),auth[_0x0f74('0xa')](),controller[_0x0f74('0xf')]);module[_0x0f74('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 25919bc..d8d30dd 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 _0x86a8=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x55d8ed,_0x2fd844){var _0x5e15c3=function(_0x511b72){while(--_0x511b72){_0x55d8ed['push'](_0x55d8ed['shift']());}};_0x5e15c3(++_0x2fd844);}(_0x86a8,0x1ae));var _0x886a=function(_0x2a4205,_0x1049ee){_0x2a4205=_0x2a4205-0x0;var _0xeb857b=_0x86a8[_0x2a4205];return _0xeb857b;};'use strict';var Sequelize=require(_0x886a('0x0'));module[_0x886a('0x1')]={'calldate':{'type':Sequelize[_0x886a('0x2')],'allowNull':![],'defaultValue':_0x886a('0x3')},'clid':{'type':Sequelize[_0x886a('0x4')]},'src':{'type':Sequelize[_0x886a('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x886a('0x4')]},'channel':{'type':Sequelize[_0x886a('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x886a('0x4')]},'lastdata':{'type':Sequelize[_0x886a('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x886a('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x886a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x886a('0x4')]},'uniqueid':{'type':Sequelize[_0x886a('0x4')]},'linkedid':{'type':Sequelize[_0x886a('0x4')]},'sequence':{'type':Sequelize[_0x886a('0x4')]},'peeraccount':{'type':Sequelize[_0x886a('0x4')]},'type':{'type':Sequelize[_0x886a('0x4')]},'tag':{'type':Sequelize[_0x886a('0x4')]}};
\ No newline at end of file
+var _0x01bb=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0xf7c631,_0x342112){var _0x3f3136=function(_0x53b283){while(--_0x53b283){_0xf7c631['push'](_0xf7c631['shift']());}};_0x3f3136(++_0x342112);}(_0x01bb,0x171));var _0xb01b=function(_0x169121,_0x281dbc){_0x169121=_0x169121-0x0;var _0x731479=_0x01bb[_0x169121];return _0x731479;};'use strict';var Sequelize=require(_0xb01b('0x0'));module[_0xb01b('0x1')]={'calldate':{'type':Sequelize[_0xb01b('0x2')],'allowNull':![],'defaultValue':_0xb01b('0x3')},'clid':{'type':Sequelize[_0xb01b('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb01b('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb01b('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xb01b('0x4')]},'duration':{'type':Sequelize[_0xb01b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb01b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb01b('0x4')]},'amaflags':{'type':Sequelize[_0xb01b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb01b('0x4')]},'userfield':{'type':Sequelize[_0xb01b('0x4')]},'uniqueid':{'type':Sequelize[_0xb01b('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb01b('0x4')]},'peeraccount':{'type':Sequelize[_0xb01b('0x4')]},'type':{'type':Sequelize[_0xb01b('0x4')]},'tag':{'type':Sequelize[_0xb01b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 444218e..2cd5dc5 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 _0x106f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','findAll','params','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0x106f,0x162));var _0xf106=function(_0x4e8b61,_0x424fa7){_0x4e8b61=_0x4e8b61-0x0;var _0x21be7f=_0x106f[_0x4e8b61];return _0x21be7f;};'use strict';var emlformat=require(_0xf106('0x0'));var rimraf=require(_0xf106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf106('0x2'));var rp=require(_0xf106('0x3'));var moment=require('moment');var BPromise=require(_0xf106('0x4'));var Mustache=require('mustache');var util=require(_0xf106('0x5'));var path=require(_0xf106('0x6'));var sox=require(_0xf106('0x7'));var csv=require(_0xf106('0x8'));var ejs=require(_0xf106('0x9'));var fs=require('fs');var fs_extra=require(_0xf106('0xa'));var _=require(_0xf106('0xb'));var squel=require('squel');var crypto=require(_0xf106('0xc'));var jsforce=require(_0xf106('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf106('0xe'));var qs=require(_0xf106('0xf'));var as=require(_0xf106('0x10'));var hardwareService=require(_0xf106('0x11'));var logger=require(_0xf106('0x12'))(_0xf106('0x13'));var utils=require(_0xf106('0x14'));var config=require(_0xf106('0x15'));var licenseUtil=require(_0xf106('0x16'));var db=require(_0xf106('0x17'))['db'];function respondWithStatusCode(_0x31eebf,_0x5e9da8){_0x5e9da8=_0x5e9da8||0xcc;return function(_0x2bd234){if(_0x2bd234){return _0x31eebf[_0xf106('0x18')](_0x5e9da8);}return _0x31eebf['status'](_0x5e9da8)['end']();};}function respondWithResult(_0x322351,_0x2cdbf6){_0x2cdbf6=_0x2cdbf6||0xc8;return function(_0x292a0d){if(_0x292a0d){return _0x322351['status'](_0x2cdbf6)[_0xf106('0x19')](_0x292a0d);}};}function respondWithFilteredResult(_0x26186f,_0xf05683){return function(_0x48bfdd){if(_0x48bfdd){var _0x1e17e6=typeof _0xf05683[_0xf106('0x1a')]==='undefined'&&typeof _0xf05683[_0xf106('0x1b')]===_0xf106('0x1c');var _0x62352=_0x48bfdd['count'];var _0x5d02c0=_0x1e17e6?0x0:_0xf05683[_0xf106('0x1a')];var _0x726d7c=_0x1e17e6?_0x48bfdd[_0xf106('0x1d')]:_0xf05683['offset']+_0xf05683[_0xf106('0x1b')];var _0x1a6816;if(_0x726d7c>=_0x62352){_0x726d7c=_0x62352;_0x1a6816=0xc8;}else{_0x1a6816=0xce;}_0x26186f[_0xf106('0x1e')](_0x1a6816);return _0x26186f[_0xf106('0x1f')](_0xf106('0x20'),_0x5d02c0+'-'+_0x726d7c+'/'+_0x62352)[_0xf106('0x19')](_0x48bfdd);}return null;};}function patchUpdates(_0x29ae70){return function(_0x232a54){try{jsonpatch[_0xf106('0x21')](_0x232a54,_0x29ae70,!![]);}catch(_0x4a9564){return BPromise['reject'](_0x4a9564);}return _0x232a54[_0xf106('0x22')]();};}function saveUpdates(_0x59abbc,_0x32ab30){return function(_0x3c729e){if(_0x3c729e){return _0x3c729e[_0xf106('0x23')](_0x59abbc)[_0xf106('0x24')](function(_0x450451){return _0x450451;});}return null;};}function removeEntity(_0x4f673f,_0x58febd){return function(_0x178890){if(_0x178890){return _0x178890[_0xf106('0x25')]()[_0xf106('0x24')](function(){_0x4f673f[_0xf106('0x1e')](0xcc)[_0xf106('0x26')]();});}};}function handleEntityNotFound(_0xf7de89,_0x9f99bb){return function(_0x118726){if(!_0x118726){_0xf7de89[_0xf106('0x18')](0x194);}return _0x118726;};}function handleError(_0x14b15e,_0x468fce){_0x468fce=_0x468fce||0x1f4;return function(_0x225c15){logger['error'](_0x225c15['stack']);if(_0x225c15['name']){delete _0x225c15[_0xf106('0x27')];}_0x14b15e[_0xf106('0x1e')](_0x468fce)[_0xf106('0x28')](_0x225c15);};}exports[_0xf106('0x29')]=function(_0x4265b3,_0x13b5d7){var _0x4f90d1={},_0x1394e8={},_0x269bff={'count':0x0,'rows':[]};var _0x1f8323=_[_0xf106('0x2a')](db['Cdr'][_0xf106('0x2b')],function(_0x444bde){return{'name':_0x444bde[_0xf106('0x2c')],'type':_0x444bde[_0xf106('0x2d')][_0xf106('0x2e')]};});_0x1394e8[_0xf106('0x2f')]=_['map'](_0x1f8323,_0xf106('0x27'));_0x1394e8[_0xf106('0x30')]=_[_0xf106('0x31')](_0x4265b3[_0xf106('0x30')]);_0x1394e8['filters']=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],_0x1394e8['query']);_0x4f90d1[_0xf106('0x33')]=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x4265b3[_0xf106('0x30')][_0xf106('0x34')]));_0x4f90d1[_0xf106('0x33')]=_0x4f90d1[_0xf106('0x33')][_0xf106('0x35')]?_0x4f90d1[_0xf106('0x33')]:_0x1394e8[_0xf106('0x2f')];if(!_0x4265b3['query']['hasOwnProperty'](_0xf106('0x36'))){_0x4f90d1[_0xf106('0x1b')]=qs[_0xf106('0x1b')](_0x4265b3['query'][_0xf106('0x1b')]);_0x4f90d1[_0xf106('0x1a')]=qs[_0xf106('0x1a')](_0x4265b3[_0xf106('0x30')][_0xf106('0x1a')]);}_0x4f90d1['order']=qs[_0xf106('0x37')](_0x4265b3['query'][_0xf106('0x37')]);_0x4f90d1[_0xf106('0x38')]=qs[_0xf106('0x39')](_[_0xf106('0x3a')](_0x4265b3['query'],_0x1394e8[_0xf106('0x39')]),_0x1f8323);if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3b')]){_0x4f90d1['where']=_['merge'](_0x4f90d1['where'],{'$or':_['map'](_0x1f8323,function(_0x58dba7){if(_0x58dba7[_0xf106('0x2d')]!=='VIRTUAL'){var _0x4beb79={};_0x4beb79[_0x58dba7[_0xf106('0x27')]]={'$like':'%'+_0x4265b3['query']['filter']+'%'};return _0x4beb79;}})});}_0x4f90d1=_[_0xf106('0x3c')]({},_0x4f90d1,_0x4265b3[_0xf106('0x3d')]);var _0x2d4c90={'where':_0x4f90d1[_0xf106('0x38')]};return db['Cdr'][_0xf106('0x1d')](_0x2d4c90)[_0xf106('0x24')](function(_0x583a72){_0x269bff[_0xf106('0x1d')]=_0x583a72;if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3e')]){_0x4f90d1[_0xf106('0x3f')]=[{'all':!![]}];}return db[_0xf106('0x40')][_0xf106('0x41')](_0x4f90d1);})[_0xf106('0x24')](function(_0x57d61e){_0x269bff['rows']=_0x57d61e;return _0x269bff;})[_0xf106('0x24')](respondWithFilteredResult(_0x13b5d7,_0x4f90d1))['catch'](handleError(_0x13b5d7,null));};exports['show']=function(_0x37bb28,_0x390eee){var _0x5e6cb8={'raw':!![],'where':{'id':_0x37bb28[_0xf106('0x42')]['id']}},_0x47f4d3={};_0x47f4d3['model']=_[_0xf106('0x31')](db[_0xf106('0x40')][_0xf106('0x2b')]);_0x47f4d3[_0xf106('0x30')]=_[_0xf106('0x31')](_0x37bb28[_0xf106('0x30')]);_0x47f4d3[_0xf106('0x39')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],_0x47f4d3[_0xf106('0x30')]);_0x5e6cb8[_0xf106('0x33')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x37bb28[_0xf106('0x30')][_0xf106('0x34')]));_0x5e6cb8[_0xf106('0x33')]=_0x5e6cb8[_0xf106('0x33')]['length']?_0x5e6cb8[_0xf106('0x33')]:_0x47f4d3[_0xf106('0x2f')];if(_0x37bb28[_0xf106('0x30')][_0xf106('0x3e')]){_0x5e6cb8[_0xf106('0x3f')]=[{'all':!![]}];}_0x5e6cb8=_['merge']({},_0x5e6cb8,_0x37bb28['options']);return db['Cdr']['find'](_0x5e6cb8)[_0xf106('0x24')](handleEntityNotFound(_0x390eee,null))['then'](respondWithResult(_0x390eee,null))['catch'](handleError(_0x390eee,null));};exports[_0xf106('0x43')]=function(_0x1a686d,_0xd50443){return db[_0xf106('0x40')]['create'](_0x1a686d[_0xf106('0x44')],{})[_0xf106('0x24')](respondWithResult(_0xd50443,0xc9))[_0xf106('0x45')](handleError(_0xd50443,null));};exports[_0xf106('0x23')]=function(_0x1bf065,_0x519192){if(_0x1bf065['body']['id']){delete _0x1bf065[_0xf106('0x44')]['id'];}return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x1bf065['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x519192,null))[_0xf106('0x24')](saveUpdates(_0x1bf065[_0xf106('0x44')],null))[_0xf106('0x24')](respondWithResult(_0x519192,null))['catch'](handleError(_0x519192,null));};exports[_0xf106('0x25')]=function(_0x5b80a8,_0x50798d){return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x5b80a8['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x50798d,null))[_0xf106('0x24')](removeEntity(_0x50798d,null))[_0xf106('0x45')](handleError(_0x50798d,null));};exports[_0xf106('0x47')]=function(_0x14375d,_0x391e3d){return db['Cdr']['describe']()[_0xf106('0x24')](respondWithResult(_0x391e3d,null))['catch'](handleError(_0x391e3d,null));};
\ No newline at end of file
+var _0x4300=['stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4300,0x1a6));var _0x0430=function(_0x59e9ad,_0x4d4fd3){_0x59e9ad=_0x59e9ad-0x0;var _0x192103=_0x4300[_0x59e9ad];return _0x192103;};'use strict';var emlformat=require(_0x0430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0430('0x1'));var BPromise=require(_0x0430('0x2'));var Mustache=require(_0x0430('0x3'));var util=require(_0x0430('0x4'));var path=require(_0x0430('0x5'));var sox=require('sox');var csv=require(_0x0430('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0430('0x7'));var _=require('lodash');var squel=require(_0x0430('0x8'));var crypto=require(_0x0430('0x9'));var jsforce=require(_0x0430('0xa'));var deskjs=require(_0x0430('0xb'));var toCsv=require(_0x0430('0x6'));var querystring=require(_0x0430('0xc'));var Papa=require(_0x0430('0xd'));var Redis=require(_0x0430('0xe'));var authService=require(_0x0430('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0430('0x10'));var hardwareService=require(_0x0430('0x11'));var logger=require(_0x0430('0x12'))(_0x0430('0x13'));var utils=require(_0x0430('0x14'));var config=require(_0x0430('0x15'));var licenseUtil=require(_0x0430('0x16'));var db=require(_0x0430('0x17'))['db'];function respondWithStatusCode(_0x5315a3,_0x4b382a){_0x4b382a=_0x4b382a||0xcc;return function(_0x4292f7){if(_0x4292f7){return _0x5315a3[_0x0430('0x18')](_0x4b382a);}return _0x5315a3[_0x0430('0x19')](_0x4b382a)[_0x0430('0x1a')]();};}function respondWithResult(_0x671534,_0x39d4e2){_0x39d4e2=_0x39d4e2||0xc8;return function(_0x182e2c){if(_0x182e2c){return _0x671534['status'](_0x39d4e2)[_0x0430('0x1b')](_0x182e2c);}};}function respondWithFilteredResult(_0x40e6dc,_0x8fe471){return function(_0x3b34af){if(_0x3b34af){var _0x5c98c9=typeof _0x8fe471['offset']==='undefined'&&typeof _0x8fe471[_0x0430('0x1c')]==='undefined';var _0x495094=_0x3b34af[_0x0430('0x1d')];var _0x2f23b9=_0x5c98c9?0x0:_0x8fe471[_0x0430('0x1e')];var _0xd33c3c=_0x5c98c9?_0x3b34af[_0x0430('0x1d')]:_0x8fe471['offset']+_0x8fe471['limit'];var _0xf11cda;if(_0xd33c3c>=_0x495094){_0xd33c3c=_0x495094;_0xf11cda=0xc8;}else{_0xf11cda=0xce;}_0x40e6dc[_0x0430('0x19')](_0xf11cda);return _0x40e6dc[_0x0430('0x1f')](_0x0430('0x20'),_0x2f23b9+'-'+_0xd33c3c+'/'+_0x495094)['json'](_0x3b34af);}return null;};}function patchUpdates(_0x4d3af1){return function(_0x12a05c){try{jsonpatch[_0x0430('0x21')](_0x12a05c,_0x4d3af1,!![]);}catch(_0x301992){return BPromise[_0x0430('0x22')](_0x301992);}return _0x12a05c[_0x0430('0x23')]();};}function saveUpdates(_0xb17238,_0x5da567){return function(_0x11160f){if(_0x11160f){return _0x11160f[_0x0430('0x24')](_0xb17238)[_0x0430('0x25')](function(_0x1d5b51){return _0x1d5b51;});}return null;};}function removeEntity(_0x54e1a3,_0x188b12){return function(_0x28faa2){if(_0x28faa2){return _0x28faa2[_0x0430('0x26')]()[_0x0430('0x25')](function(){_0x54e1a3[_0x0430('0x19')](0xcc)[_0x0430('0x1a')]();});}};}function handleEntityNotFound(_0x345b8c,_0x3e74d8){return function(_0x36ff02){if(!_0x36ff02){_0x345b8c['sendStatus'](0x194);}return _0x36ff02;};}function handleError(_0x375e54,_0x531611){_0x531611=_0x531611||0x1f4;return function(_0x5a79d6){logger[_0x0430('0x27')](_0x5a79d6[_0x0430('0x28')]);if(_0x5a79d6['name']){delete _0x5a79d6[_0x0430('0x29')];}_0x375e54[_0x0430('0x19')](_0x531611)[_0x0430('0x2a')](_0x5a79d6);};}exports[_0x0430('0x2b')]=function(_0x2b94e4,_0x3805f7){var _0x1df9ec={},_0xd6b31a={},_0x36f6ff={'count':0x0,'rows':[]};var _0x5ae72c=_['map'](db['Cdr'][_0x0430('0x2c')],function(_0x47e1f3){return{'name':_0x47e1f3[_0x0430('0x2d')],'type':_0x47e1f3['type']['key']};});_0xd6b31a[_0x0430('0x2e')]=_[_0x0430('0x2f')](_0x5ae72c,_0x0430('0x29'));_0xd6b31a[_0x0430('0x30')]=_['keys'](_0x2b94e4['query']);_0xd6b31a[_0x0430('0x31')]=_[_0x0430('0x32')](_0xd6b31a['model'],_0xd6b31a['query']);_0x1df9ec[_0x0430('0x33')]=_[_0x0430('0x32')](_0xd6b31a[_0x0430('0x2e')],qs[_0x0430('0x34')](_0x2b94e4[_0x0430('0x30')][_0x0430('0x34')]));_0x1df9ec[_0x0430('0x33')]=_0x1df9ec[_0x0430('0x33')][_0x0430('0x35')]?_0x1df9ec['attributes']:_0xd6b31a[_0x0430('0x2e')];if(!_0x2b94e4[_0x0430('0x30')][_0x0430('0x36')]('nolimit')){_0x1df9ec[_0x0430('0x1c')]=qs['limit'](_0x2b94e4[_0x0430('0x30')]['limit']);_0x1df9ec['offset']=qs[_0x0430('0x1e')](_0x2b94e4[_0x0430('0x30')][_0x0430('0x1e')]);}_0x1df9ec[_0x0430('0x37')]=qs[_0x0430('0x38')](_0x2b94e4[_0x0430('0x30')]['sort']);_0x1df9ec[_0x0430('0x39')]=qs[_0x0430('0x31')](_[_0x0430('0x3a')](_0x2b94e4[_0x0430('0x30')],_0xd6b31a[_0x0430('0x31')]),_0x5ae72c);if(_0x2b94e4[_0x0430('0x30')][_0x0430('0x3b')]){_0x1df9ec[_0x0430('0x39')]=_[_0x0430('0x3c')](_0x1df9ec[_0x0430('0x39')],{'$or':_['map'](_0x5ae72c,function(_0x44c546){if(_0x44c546[_0x0430('0x3d')]!==_0x0430('0x3e')){var _0x314b27={};_0x314b27[_0x44c546[_0x0430('0x29')]]={'$like':'%'+_0x2b94e4[_0x0430('0x30')]['filter']+'%'};return _0x314b27;}})});}_0x1df9ec=_[_0x0430('0x3c')]({},_0x1df9ec,_0x2b94e4[_0x0430('0x3f')]);var _0x50cdcd={'where':_0x1df9ec[_0x0430('0x39')]};return db[_0x0430('0x40')][_0x0430('0x1d')](_0x50cdcd)[_0x0430('0x25')](function(_0x2d6345){_0x36f6ff[_0x0430('0x1d')]=_0x2d6345;if(_0x2b94e4[_0x0430('0x30')][_0x0430('0x41')]){_0x1df9ec[_0x0430('0x42')]=[{'all':!![]}];}return db['Cdr'][_0x0430('0x43')](_0x1df9ec);})[_0x0430('0x25')](function(_0x456f36){_0x36f6ff[_0x0430('0x44')]=_0x456f36;return _0x36f6ff;})['then'](respondWithFilteredResult(_0x3805f7,_0x1df9ec))[_0x0430('0x45')](handleError(_0x3805f7,null));};exports[_0x0430('0x46')]=function(_0x16e96c,_0x435028){var _0x26992f={'raw':!![],'where':{'id':_0x16e96c[_0x0430('0x47')]['id']}},_0x3cc598={};_0x3cc598[_0x0430('0x2e')]=_[_0x0430('0x48')](db[_0x0430('0x40')][_0x0430('0x2c')]);_0x3cc598['query']=_[_0x0430('0x48')](_0x16e96c['query']);_0x3cc598['filters']=_[_0x0430('0x32')](_0x3cc598['model'],_0x3cc598['query']);_0x26992f[_0x0430('0x33')]=_['intersection'](_0x3cc598['model'],qs[_0x0430('0x34')](_0x16e96c['query']['fields']));_0x26992f[_0x0430('0x33')]=_0x26992f['attributes']['length']?_0x26992f[_0x0430('0x33')]:_0x3cc598[_0x0430('0x2e')];if(_0x16e96c[_0x0430('0x30')]['includeAll']){_0x26992f[_0x0430('0x42')]=[{'all':!![]}];}_0x26992f=_[_0x0430('0x3c')]({},_0x26992f,_0x16e96c[_0x0430('0x3f')]);return db['Cdr']['find'](_0x26992f)[_0x0430('0x25')](handleEntityNotFound(_0x435028,null))[_0x0430('0x25')](respondWithResult(_0x435028,null))[_0x0430('0x45')](handleError(_0x435028,null));};exports[_0x0430('0x49')]=function(_0x5e84f4,_0x5a4500){return db['Cdr'][_0x0430('0x49')](_0x5e84f4[_0x0430('0x4a')],{})[_0x0430('0x25')](respondWithResult(_0x5a4500,0xc9))[_0x0430('0x45')](handleError(_0x5a4500,null));};exports[_0x0430('0x24')]=function(_0x421280,_0x5c3184){if(_0x421280['body']['id']){delete _0x421280[_0x0430('0x4a')]['id'];}return db[_0x0430('0x40')][_0x0430('0x4b')]({'where':{'id':_0x421280[_0x0430('0x47')]['id']}})[_0x0430('0x25')](handleEntityNotFound(_0x5c3184,null))[_0x0430('0x25')](saveUpdates(_0x421280[_0x0430('0x4a')],null))[_0x0430('0x25')](respondWithResult(_0x5c3184,null))[_0x0430('0x45')](handleError(_0x5c3184,null));};exports[_0x0430('0x26')]=function(_0x4387db,_0x2bdcd6){return db['Cdr']['find']({'where':{'id':_0x4387db[_0x0430('0x47')]['id']}})[_0x0430('0x25')](handleEntityNotFound(_0x2bdcd6,null))[_0x0430('0x25')](removeEntity(_0x2bdcd6,null))[_0x0430('0x45')](handleError(_0x2bdcd6,null));};exports[_0x0430('0x4c')]=function(_0x261996,_0xfa67a4){return db[_0x0430('0x40')][_0x0430('0x4c')]()[_0x0430('0x25')](respondWithResult(_0xfa67a4,null))[_0x0430('0x45')](handleError(_0xfa67a4,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 43e98a5..22f0f9b 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(_0x5a32b8,_0x54a79f){var _0x34d9af=function(_0x58f6a1){while(--_0x58f6a1){_0x5a32b8['push'](_0x5a32b8['shift']());}};_0x34d9af(++_0x54a79f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x2c25c7,_0x57f2d7){var _0x1e51bd=function(_0x544467){while(--_0x544467){_0x2c25c7['push'](_0x2c25c7['shift']());}};_0x1e51bd(++_0x57f2d7);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 dd26ffd..0972fa0 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 _0xa9ba=['info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x1074cb,_0x132cda){var _0x2aa5c1=function(_0x44ca3d){while(--_0x44ca3d){_0x1074cb['push'](_0x1074cb['shift']());}};_0x2aa5c1(++_0x132cda);}(_0xa9ba,0x12b));var _0xaa9b=function(_0x2246cc,_0x520f93){_0x2246cc=_0x2246cc-0x0;var _0x4e172b=_0xa9ba[_0x2246cc];return _0x4e172b;};'use strict';var _=require(_0xaa9b('0x0'));var util=require('util');var moment=require(_0xaa9b('0x1'));var BPromise=require(_0xaa9b('0x2'));var rs=require(_0xaa9b('0x3'));var fs=require('fs');var Redis=require(_0xaa9b('0x4'));var db=require(_0xaa9b('0x5'))['db'];var utils=require(_0xaa9b('0x6'));var logger=require(_0xaa9b('0x7'))(_0xaa9b('0x8'));var config=require(_0xaa9b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa9b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4374aa,_0x35d0e9,_0x1f848e){return new BPromise(function(_0x478ee7,_0x94411d){return client[_0xaa9b('0xb')](_0x4374aa,_0x1f848e)[_0xaa9b('0xc')](function(_0x45ed2a){logger[_0xaa9b('0xd')]('Cdr,\x20%s,\x20%s',_0x35d0e9,_0xaa9b('0xe'));logger[_0xaa9b('0xf')](_0xaa9b('0x10'),_0x35d0e9,'request\x20sent',JSON[_0xaa9b('0x11')](_0x45ed2a));if(_0x45ed2a[_0xaa9b('0x12')]){if(_0x45ed2a[_0xaa9b('0x12')][_0xaa9b('0x13')]===0x1f4){logger[_0xaa9b('0x12')]('Cdr,\x20%s,\x20%s',_0x35d0e9,_0x45ed2a['error']['message']);return _0x94411d(_0x45ed2a[_0xaa9b('0x12')][_0xaa9b('0x14')]);}logger[_0xaa9b('0x12')](_0xaa9b('0x15'),_0x35d0e9,_0x45ed2a[_0xaa9b('0x12')][_0xaa9b('0x14')]);return _0x478ee7(_0x45ed2a[_0xaa9b('0x12')][_0xaa9b('0x14')]);}else{logger[_0xaa9b('0xd')]('Cdr,\x20%s,\x20%s',_0x35d0e9,'request\x20sent');_0x478ee7(_0x45ed2a[_0xaa9b('0x16')]['message']);}})[_0xaa9b('0x17')](function(_0x139d58){logger[_0xaa9b('0x12')]('Cdr,\x20%s,\x20%s',_0x35d0e9,_0x139d58);_0x94411d(_0x139d58);});});}
\ No newline at end of file
+var _0x06f5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x366aca,_0x12199a){var _0x18e210=function(_0x58b703){while(--_0x58b703){_0x366aca['push'](_0x366aca['shift']());}};_0x18e210(++_0x12199a);}(_0x06f5,0x182));var _0x506f=function(_0x324467,_0x2b4a70){_0x324467=_0x324467-0x0;var _0x3d27d9=_0x06f5[_0x324467];return _0x3d27d9;};'use strict';var _=require(_0x506f('0x0'));var util=require(_0x506f('0x1'));var moment=require(_0x506f('0x2'));var BPromise=require(_0x506f('0x3'));var rs=require(_0x506f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x506f('0x5'))['db'];var utils=require(_0x506f('0x6'));var logger=require(_0x506f('0x7'))(_0x506f('0x8'));var config=require(_0x506f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x506f('0xa')][_0x506f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x284a10,_0x3ec73d,_0x59586c){return new BPromise(function(_0x3449a5,_0x221c55){return client['request'](_0x284a10,_0x59586c)[_0x506f('0xc')](function(_0x47cc78){logger[_0x506f('0xd')](_0x506f('0xe'),_0x3ec73d,_0x506f('0xf'));logger['debug'](_0x506f('0x10'),_0x3ec73d,'request\x20sent',JSON[_0x506f('0x11')](_0x47cc78));if(_0x47cc78[_0x506f('0x12')]){if(_0x47cc78[_0x506f('0x12')][_0x506f('0x13')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x3ec73d,_0x47cc78['error'][_0x506f('0x14')]);return _0x221c55(_0x47cc78['error']['message']);}logger[_0x506f('0x12')]('Cdr,\x20%s,\x20%s',_0x3ec73d,_0x47cc78[_0x506f('0x12')]['message']);return _0x3449a5(_0x47cc78[_0x506f('0x12')]['message']);}else{logger[_0x506f('0xd')]('Cdr,\x20%s,\x20%s',_0x3ec73d,'request\x20sent');_0x3449a5(_0x47cc78[_0x506f('0x15')][_0x506f('0x14')]);}})[_0x506f('0x16')](function(_0x1535aa){logger[_0x506f('0x12')]('Cdr,\x20%s,\x20%s',_0x3ec73d,_0x1535aa);_0x221c55(_0x1535aa);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 66d56d1..8607b1e 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(_0x11c5da,_0x5799cf){var _0x5cfbf1=function(_0x2d23b0){while(--_0x2d23b0){_0x11c5da['push'](_0x11c5da['shift']());}};_0x5cfbf1(++_0x5799cf);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x50ce04,_0xd43127){var _0x4e4f68=function(_0x2c3f66){while(--_0x2c3f66){_0x50ce04['push'](_0x50ce04['shift']());}};_0x4e4f68(++_0xd43127);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f20f8,_0x54a3f2){_0x2f20f8=_0x2f20f8-0x0;var _0xfcb1b7=_0xb10b[_0x2f20f8];return _0xfcb1b7;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 c84b707..1d98f1b 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 _0x73b6=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x31ec29,_0x58915c){var _0x3275fc=function(_0x435075){while(--_0x435075){_0x31ec29['push'](_0x31ec29['shift']());}};_0x3275fc(++_0x58915c);}(_0x73b6,0xce));var _0x673b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x73b6[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x673b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x673b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x673b('0x2')],'allowNull':![],'defaultValue':_0x673b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x673b('0x2')],'defaultValue':_0x673b('0x4')}};
\ No newline at end of file
+var _0x9ba3=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x3c6310,_0x13601d){var _0x320122=function(_0x596176){while(--_0x596176){_0x3c6310['push'](_0x3c6310['shift']());}};_0x320122(++_0x13601d);}(_0x9ba3,0xc4));var _0x39ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9ba3[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x39ba('0x0')]={'priority':{'type':Sequelize[_0x39ba('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x39ba('0x2')],'allowNull':![],'defaultValue':_0x39ba('0x3')},'appdata':{'type':Sequelize[_0x39ba('0x4')]()},'description':{'type':Sequelize[_0x39ba('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e8a2944..b8ef63f 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 _0xf2fa=['api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','show','params','model','ChatApplication','rawAttributes','keys','query','filters','intersection','attributes','fields','length','merge','options','catch','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xaf2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf2f('0x1'));var rp=require(_0xaf2f('0x2'));var moment=require(_0xaf2f('0x3'));var BPromise=require(_0xaf2f('0x4'));var Mustache=require(_0xaf2f('0x5'));var util=require(_0xaf2f('0x6'));var path=require(_0xaf2f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf2f('0x9'));var squel=require(_0xaf2f('0xa'));var crypto=require(_0xaf2f('0xb'));var jsforce=require(_0xaf2f('0xc'));var deskjs=require(_0xaf2f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf2f('0xe'));var authService=require(_0xaf2f('0xf'));var qs=require(_0xaf2f('0x10'));var as=require(_0xaf2f('0x11'));var hardwareService=require(_0xaf2f('0x12'));var logger=require(_0xaf2f('0x13'))(_0xaf2f('0x14'));var utils=require(_0xaf2f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf2f('0x16'));var db=require(_0xaf2f('0x17'))['db'];function respondWithStatusCode(_0x3dea79,_0x578499){_0x578499=_0x578499||0xcc;return function(_0x57cdb0){if(_0x57cdb0){return _0x3dea79['sendStatus'](_0x578499);}return _0x3dea79[_0xaf2f('0x18')](_0x578499)[_0xaf2f('0x19')]();};}function respondWithResult(_0x580fa6,_0x305755){_0x305755=_0x305755||0xc8;return function(_0x131862){if(_0x131862){return _0x580fa6['status'](_0x305755)[_0xaf2f('0x1a')](_0x131862);}};}function respondWithFilteredResult(_0x4db0fc,_0x402485){return function(_0x30905b){if(_0x30905b){var _0x3d475a=typeof _0x402485[_0xaf2f('0x1b')]===_0xaf2f('0x1c')&&typeof _0x402485[_0xaf2f('0x1d')]===_0xaf2f('0x1c');var _0x2a5d4a=_0x30905b[_0xaf2f('0x1e')];var _0x244435=_0x3d475a?0x0:_0x402485['offset'];var _0x1a2d28=_0x3d475a?_0x30905b[_0xaf2f('0x1e')]:_0x402485['offset']+_0x402485['limit'];var _0xb64c0e;if(_0x1a2d28>=_0x2a5d4a){_0x1a2d28=_0x2a5d4a;_0xb64c0e=0xc8;}else{_0xb64c0e=0xce;}_0x4db0fc[_0xaf2f('0x18')](_0xb64c0e);return _0x4db0fc['set'](_0xaf2f('0x1f'),_0x244435+'-'+_0x1a2d28+'/'+_0x2a5d4a)['json'](_0x30905b);}return null;};}function patchUpdates(_0x2dbd9b){return function(_0x5a6c9d){try{jsonpatch[_0xaf2f('0x20')](_0x5a6c9d,_0x2dbd9b,!![]);}catch(_0xccf664){return BPromise['reject'](_0xccf664);}return _0x5a6c9d[_0xaf2f('0x21')]();};}function saveUpdates(_0x42b7ae,_0x359dc2){return function(_0x19da71){if(_0x19da71){return _0x19da71[_0xaf2f('0x22')](_0x42b7ae)[_0xaf2f('0x23')](function(_0x2fe731){return _0x2fe731;});}return null;};}function removeEntity(_0x1da2bb,_0x4f5018){return function(_0x5f199d){if(_0x5f199d){return _0x5f199d[_0xaf2f('0x24')]()[_0xaf2f('0x23')](function(){_0x1da2bb[_0xaf2f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f7440,_0x38ecee){return function(_0x29fc22){if(!_0x29fc22){_0x1f7440[_0xaf2f('0x25')](0x194);}return _0x29fc22;};}function handleError(_0x2f2068,_0x324876){_0x324876=_0x324876||0x1f4;return function(_0x593e4d){logger['error'](_0x593e4d['stack']);if(_0x593e4d[_0xaf2f('0x26')]){delete _0x593e4d['name'];}_0x2f2068['status'](_0x324876)[_0xaf2f('0x27')](_0x593e4d);};}exports[_0xaf2f('0x28')]=function(_0x16eb77,_0x21bf39){var _0x2374dd={'raw':!![],'where':{'id':_0x16eb77[_0xaf2f('0x29')]['id']}},_0x5a752a={};_0x5a752a[_0xaf2f('0x2a')]=_['keys'](db[_0xaf2f('0x2b')][_0xaf2f('0x2c')]);_0x5a752a['query']=_[_0xaf2f('0x2d')](_0x16eb77[_0xaf2f('0x2e')]);_0x5a752a[_0xaf2f('0x2f')]=_[_0xaf2f('0x30')](_0x5a752a['model'],_0x5a752a[_0xaf2f('0x2e')]);_0x2374dd[_0xaf2f('0x31')]=_['intersection'](_0x5a752a['model'],qs[_0xaf2f('0x32')](_0x16eb77['query'][_0xaf2f('0x32')]));_0x2374dd[_0xaf2f('0x31')]=_0x2374dd[_0xaf2f('0x31')][_0xaf2f('0x33')]?_0x2374dd[_0xaf2f('0x31')]:_0x5a752a['model'];if(_0x16eb77[_0xaf2f('0x2e')]['includeAll']){_0x2374dd['include']=[{'all':!![]}];}_0x2374dd=_[_0xaf2f('0x34')]({},_0x2374dd,_0x16eb77[_0xaf2f('0x35')]);return db['ChatApplication']['find'](_0x2374dd)[_0xaf2f('0x23')](handleEntityNotFound(_0x21bf39,null))[_0xaf2f('0x23')](respondWithResult(_0x21bf39,null))[_0xaf2f('0x36')](handleError(_0x21bf39,null));};exports[_0xaf2f('0x22')]=function(_0x4c30e8,_0x552c6e){if(_0x4c30e8[_0xaf2f('0x37')]['id']){delete _0x4c30e8['body']['id'];}return db[_0xaf2f('0x2b')][_0xaf2f('0x38')]({'where':{'id':_0x4c30e8[_0xaf2f('0x29')]['id']}})[_0xaf2f('0x23')](handleEntityNotFound(_0x552c6e,null))[_0xaf2f('0x23')](saveUpdates(_0x4c30e8[_0xaf2f('0x37')],null))[_0xaf2f('0x23')](respondWithResult(_0x552c6e,null))[_0xaf2f('0x36')](handleError(_0x552c6e,null));};exports['destroy']=function(_0x5db64e,_0x3e3ca6){return db['ChatApplication'][_0xaf2f('0x38')]({'where':{'id':_0x5db64e['params']['id']}})[_0xaf2f('0x23')](handleEntityNotFound(_0x3e3ca6,null))[_0xaf2f('0x23')](removeEntity(_0x3e3ca6,null))['catch'](handleError(_0x3e3ca6,null));};
\ No newline at end of file
+var _0xa788=['merge','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa788,0x70));var _0x8a78=function(_0x172da2,_0x1f9378){_0x172da2=_0x172da2-0x0;var _0x3bb8dc=_0xa788[_0x172da2];return _0x3bb8dc;};'use strict';var emlformat=require(_0x8a78('0x0'));var rimraf=require(_0x8a78('0x1'));var zipdir=require(_0x8a78('0x2'));var jsonpatch=require(_0x8a78('0x3'));var rp=require('request-promise');var moment=require(_0x8a78('0x4'));var BPromise=require(_0x8a78('0x5'));var Mustache=require('mustache');var util=require(_0x8a78('0x6'));var path=require(_0x8a78('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a78('0x8'));var _=require(_0x8a78('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a78('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a78('0xb'));var Papa=require(_0x8a78('0xc'));var Redis=require('ioredis');var authService=require(_0x8a78('0xd'));var qs=require(_0x8a78('0xe'));var as=require(_0x8a78('0xf'));var hardwareService=require(_0x8a78('0x10'));var logger=require(_0x8a78('0x11'))(_0x8a78('0x12'));var utils=require(_0x8a78('0x13'));var config=require(_0x8a78('0x14'));var licenseUtil=require(_0x8a78('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x299461,_0x294b34){_0x294b34=_0x294b34||0xcc;return function(_0x31b77e){if(_0x31b77e){return _0x299461['sendStatus'](_0x294b34);}return _0x299461[_0x8a78('0x16')](_0x294b34)[_0x8a78('0x17')]();};}function respondWithResult(_0x18c057,_0x4b073b){_0x4b073b=_0x4b073b||0xc8;return function(_0x423787){if(_0x423787){return _0x18c057['status'](_0x4b073b)[_0x8a78('0x18')](_0x423787);}};}function respondWithFilteredResult(_0x53001e,_0x429b2c){return function(_0x586d47){if(_0x586d47){var _0x57212b=typeof _0x429b2c['offset']===_0x8a78('0x19')&&typeof _0x429b2c[_0x8a78('0x1a')]===_0x8a78('0x19');var _0xf0c379=_0x586d47[_0x8a78('0x1b')];var _0x18269a=_0x57212b?0x0:_0x429b2c[_0x8a78('0x1c')];var _0x1f2cb9=_0x57212b?_0x586d47[_0x8a78('0x1b')]:_0x429b2c[_0x8a78('0x1c')]+_0x429b2c[_0x8a78('0x1a')];var _0x3de1ac;if(_0x1f2cb9>=_0xf0c379){_0x1f2cb9=_0xf0c379;_0x3de1ac=0xc8;}else{_0x3de1ac=0xce;}_0x53001e[_0x8a78('0x16')](_0x3de1ac);return _0x53001e[_0x8a78('0x1d')]('Content-Range',_0x18269a+'-'+_0x1f2cb9+'/'+_0xf0c379)[_0x8a78('0x18')](_0x586d47);}return null;};}function patchUpdates(_0x557e98){return function(_0xa6f4b8){try{jsonpatch[_0x8a78('0x1e')](_0xa6f4b8,_0x557e98,!![]);}catch(_0x5cf33e){return BPromise[_0x8a78('0x1f')](_0x5cf33e);}return _0xa6f4b8[_0x8a78('0x20')]();};}function saveUpdates(_0x2ceb56,_0x43b3b8){return function(_0x2d7d03){if(_0x2d7d03){return _0x2d7d03['update'](_0x2ceb56)[_0x8a78('0x21')](function(_0x4b6618){return _0x4b6618;});}return null;};}function removeEntity(_0x3532d1,_0x43305f){return function(_0x118357){if(_0x118357){return _0x118357[_0x8a78('0x22')]()[_0x8a78('0x21')](function(){_0x3532d1[_0x8a78('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2115,_0x21908e){return function(_0x2737d0){if(!_0x2737d0){_0x5c2115[_0x8a78('0x23')](0x194);}return _0x2737d0;};}function handleError(_0x5c7d00,_0x10e6b6){_0x10e6b6=_0x10e6b6||0x1f4;return function(_0x43f182){logger[_0x8a78('0x24')](_0x43f182[_0x8a78('0x25')]);if(_0x43f182[_0x8a78('0x26')]){delete _0x43f182[_0x8a78('0x26')];}_0x5c7d00[_0x8a78('0x16')](_0x10e6b6)['send'](_0x43f182);};}exports['show']=function(_0x9054ee,_0x370927){var _0x2c26d0={'raw':!![],'where':{'id':_0x9054ee['params']['id']}},_0x19c208={};_0x19c208[_0x8a78('0x27')]=_[_0x8a78('0x28')](db['ChatApplication'][_0x8a78('0x29')]);_0x19c208[_0x8a78('0x2a')]=_[_0x8a78('0x28')](_0x9054ee[_0x8a78('0x2a')]);_0x19c208[_0x8a78('0x2b')]=_[_0x8a78('0x2c')](_0x19c208[_0x8a78('0x27')],_0x19c208[_0x8a78('0x2a')]);_0x2c26d0[_0x8a78('0x2d')]=_[_0x8a78('0x2c')](_0x19c208[_0x8a78('0x27')],qs['fields'](_0x9054ee[_0x8a78('0x2a')][_0x8a78('0x2e')]));_0x2c26d0['attributes']=_0x2c26d0[_0x8a78('0x2d')]['length']?_0x2c26d0[_0x8a78('0x2d')]:_0x19c208[_0x8a78('0x27')];if(_0x9054ee[_0x8a78('0x2a')]['includeAll']){_0x2c26d0['include']=[{'all':!![]}];}_0x2c26d0=_[_0x8a78('0x2f')]({},_0x2c26d0,_0x9054ee['options']);return db[_0x8a78('0x30')][_0x8a78('0x31')](_0x2c26d0)[_0x8a78('0x21')](handleEntityNotFound(_0x370927,null))[_0x8a78('0x21')](respondWithResult(_0x370927,null))[_0x8a78('0x32')](handleError(_0x370927,null));};exports['update']=function(_0x46ea2a,_0x1288a5){if(_0x46ea2a[_0x8a78('0x33')]['id']){delete _0x46ea2a[_0x8a78('0x33')]['id'];}return db[_0x8a78('0x30')]['find']({'where':{'id':_0x46ea2a[_0x8a78('0x34')]['id']}})[_0x8a78('0x21')](handleEntityNotFound(_0x1288a5,null))[_0x8a78('0x21')](saveUpdates(_0x46ea2a['body'],null))[_0x8a78('0x21')](respondWithResult(_0x1288a5,null))[_0x8a78('0x32')](handleError(_0x1288a5,null));};exports[_0x8a78('0x22')]=function(_0x4e1e58,_0x59a03f){return db['ChatApplication']['find']({'where':{'id':_0x4e1e58[_0x8a78('0x34')]['id']}})[_0x8a78('0x21')](handleEntityNotFound(_0x59a03f,null))[_0x8a78('0x21')](removeEntity(_0x59a03f,null))[_0x8a78('0x32')](handleError(_0x59a03f,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index cf1f6a1..f94f86a 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 _0xba91=['request-promise','rimraf','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x4e00ee,_0x1b59a4){var _0x1777ef=function(_0x100880){while(--_0x100880){_0x4e00ee['push'](_0x4e00ee['shift']());}};_0x1777ef(++_0x1b59a4);}(_0xba91,0xac));var _0x1ba9=function(_0x5c8d34,_0x342d14){_0x5c8d34=_0x5c8d34-0x0;var _0x10cecb=_0xba91[_0x5c8d34];return _0x10cecb;};'use strict';var _=require(_0x1ba9('0x0'));var util=require('util');var logger=require(_0x1ba9('0x1'))(_0x1ba9('0x2'));var moment=require(_0x1ba9('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ba9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ba9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1ba9('0x6'));module[_0x1ba9('0x7')]=function(_0x20a5e4,_0x5b7b79){return _0x20a5e4[_0x1ba9('0x8')]('ChatApplication',attributes,{'tableName':_0x1ba9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ba9('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8d4c=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0x8d4c,0x173));var _0xc8d4=function(_0x1e4dca,_0x44147a){_0x1e4dca=_0x1e4dca-0x0;var _0x355ca9=_0x8d4c[_0x1e4dca];return _0x355ca9;};'use strict';var _=require(_0xc8d4('0x0'));var util=require('util');var logger=require(_0xc8d4('0x1'))(_0xc8d4('0x2'));var moment=require(_0xc8d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xc8d4('0x4'));var fs=require('fs');var path=require(_0xc8d4('0x5'));var rimraf=require(_0xc8d4('0x6'));var config=require(_0xc8d4('0x7'));var attributes=require(_0xc8d4('0x8'));module[_0xc8d4('0x9')]=function(_0x1838f5,_0x4258ec){return _0x1838f5[_0xc8d4('0xa')](_0xc8d4('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8d4('0xc'),'collate':_0xc8d4('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 8499c06..1a57ef3 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 _0xfe46=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfe46,0x1d7));var _0x6fe4=function(_0x228a7c,_0x752e07){_0x228a7c=_0x228a7c-0x0;var _0x22e811=_0xfe46[_0x228a7c];return _0x22e811;};'use strict';var _=require(_0x6fe4('0x0'));var util=require(_0x6fe4('0x1'));var moment=require(_0x6fe4('0x2'));var BPromise=require(_0x6fe4('0x3'));var rs=require(_0x6fe4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fe4('0x5'))['db'];var utils=require(_0x6fe4('0x6'));var logger=require('../../config/logger')(_0x6fe4('0x7'));var config=require(_0x6fe4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6fe4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x283467,_0x29201d,_0x433e5d){return new BPromise(function(_0x243cb0,_0x2d7a30){return client['request'](_0x283467,_0x433e5d)[_0x6fe4('0xa')](function(_0x12bb88){logger[_0x6fe4('0xb')](_0x6fe4('0xc'),_0x29201d,_0x6fe4('0xd'));logger[_0x6fe4('0xe')](_0x6fe4('0xf'),_0x29201d,_0x6fe4('0xd'),JSON[_0x6fe4('0x10')](_0x12bb88));if(_0x12bb88[_0x6fe4('0x11')]){if(_0x12bb88[_0x6fe4('0x11')][_0x6fe4('0x12')]===0x1f4){logger['error'](_0x6fe4('0xc'),_0x29201d,_0x12bb88[_0x6fe4('0x11')]['message']);return _0x2d7a30(_0x12bb88[_0x6fe4('0x11')]['message']);}logger['error'](_0x6fe4('0xc'),_0x29201d,_0x12bb88[_0x6fe4('0x11')]['message']);return _0x243cb0(_0x12bb88[_0x6fe4('0x11')][_0x6fe4('0x13')]);}else{logger[_0x6fe4('0xb')](_0x6fe4('0xc'),_0x29201d,'request\x20sent');_0x243cb0(_0x12bb88['result']['message']);}})[_0x6fe4('0x14')](function(_0x5e274c){logger[_0x6fe4('0x11')]('ChatApplication,\x20%s,\x20%s',_0x29201d,_0x5e274c);_0x2d7a30(_0x5e274c);});});}
\ No newline at end of file
+var _0x56b4=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash'];(function(_0x2ca794,_0x3e0030){var _0x27b67b=function(_0x40f96b){while(--_0x40f96b){_0x2ca794['push'](_0x2ca794['shift']());}};_0x27b67b(++_0x3e0030);}(_0x56b4,0x1cb));var _0x456b=function(_0x7f25b3,_0x286413){_0x7f25b3=_0x7f25b3-0x0;var _0xe148f4=_0x56b4[_0x7f25b3];return _0xe148f4;};'use strict';var _=require(_0x456b('0x0'));var util=require(_0x456b('0x1'));var moment=require(_0x456b('0x2'));var BPromise=require(_0x456b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x456b('0x4'));var db=require(_0x456b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x456b('0x6'))(_0x456b('0x7'));var config=require(_0x456b('0x8'));var jayson=require(_0x456b('0x9'));var client=jayson[_0x456b('0xa')][_0x456b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c3868,_0x49c6fb,_0x4f65b3){return new BPromise(function(_0x4b19e,_0x5978c7){return client[_0x456b('0xc')](_0x2c3868,_0x4f65b3)[_0x456b('0xd')](function(_0x37206c){logger['info'](_0x456b('0xe'),_0x49c6fb,'request\x20sent');logger[_0x456b('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x49c6fb,_0x456b('0x10'),JSON[_0x456b('0x11')](_0x37206c));if(_0x37206c['error']){if(_0x37206c[_0x456b('0x12')][_0x456b('0x13')]===0x1f4){logger['error'](_0x456b('0xe'),_0x49c6fb,_0x37206c[_0x456b('0x12')][_0x456b('0x14')]);return _0x5978c7(_0x37206c[_0x456b('0x12')][_0x456b('0x14')]);}logger[_0x456b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x49c6fb,_0x37206c[_0x456b('0x12')][_0x456b('0x14')]);return _0x4b19e(_0x37206c[_0x456b('0x12')][_0x456b('0x14')]);}else{logger[_0x456b('0x15')](_0x456b('0xe'),_0x49c6fb,_0x456b('0x10'));_0x4b19e(_0x37206c['result'][_0x456b('0x14')]);}})[_0x456b('0x16')](function(_0x23ae9e){logger[_0x456b('0x12')](_0x456b('0xe'),_0x49c6fb,_0x23ae9e);_0x5978c7(_0x23ae9e);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ab2ee1f..38d6fdb 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 _0x4ee1=['put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x24efc9,_0x44325b){var _0x3f92cc=function(_0x237fa3){while(--_0x237fa3){_0x24efc9['push'](_0x24efc9['shift']());}};_0x3f92cc(++_0x44325b);}(_0x4ee1,0x8c));var _0x14ee=function(_0x45ded9,_0x138893){_0x45ded9=_0x45ded9-0x0;var _0x23d3e8=_0x4ee1[_0x45ded9];return _0x23d3e8;};'use strict';var multer=require('multer');var util=require(_0x14ee('0x0'));var path=require(_0x14ee('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x14ee('0x2')]();var fs_extra=require(_0x14ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x14ee('0x4'));var config=require(_0x14ee('0x5'));var controller=require('./chatApplication.controller');router[_0x14ee('0x6')](_0x14ee('0x7'),auth[_0x14ee('0x8')](),controller[_0x14ee('0x9')]);router[_0x14ee('0xa')]('/:id',auth[_0x14ee('0x8')](),controller[_0x14ee('0xb')]);router[_0x14ee('0xc')](_0x14ee('0x7'),auth[_0x14ee('0x8')](),controller[_0x14ee('0xd')]);module[_0x14ee('0xe')]=router;
\ No newline at end of file
+var _0x4db0=['express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer','util'];(function(_0x1aa9f3,_0x2f6cd4){var _0x53ef2f=function(_0x3ce1a3){while(--_0x3ce1a3){_0x1aa9f3['push'](_0x1aa9f3['shift']());}};_0x53ef2f(++_0x2f6cd4);}(_0x4db0,0x124));var _0x04db=function(_0x102789,_0x24217f){_0x102789=_0x102789-0x0;var _0x4aeb4f=_0x4db0[_0x102789];return _0x4aeb4f;};'use strict';var multer=require(_0x04db('0x0'));var util=require(_0x04db('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x04db('0x2'));var router=express[_0x04db('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x04db('0x4'));var config=require(_0x04db('0x5'));var controller=require(_0x04db('0x6'));router['get'](_0x04db('0x7'),auth[_0x04db('0x8')](),controller[_0x04db('0x9')]);router[_0x04db('0xa')]('/:id',auth[_0x04db('0x8')](),controller[_0x04db('0xb')]);router[_0x04db('0xc')](_0x04db('0x7'),auth[_0x04db('0x8')](),controller['destroy']);module[_0x04db('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 33d8525..4ed90f7 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 _0x0721=['BOOLEAN','exports','STRING'];(function(_0x1f057b,_0x37d729){var _0x13cb01=function(_0x3aa644){while(--_0x3aa644){_0x1f057b['push'](_0x1f057b['shift']());}};_0x13cb01(++_0x37d729);}(_0x0721,0x9d));var _0x1072=function(_0x50798b,_0x22ccf8){_0x50798b=_0x50798b-0x0;var _0x4b1d26=_0x0721[_0x50798b];return _0x4b1d26;};'use strict';var Sequelize=require('sequelize');module[_0x1072('0x0')]={'name':{'type':Sequelize[_0x1072('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x1072('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4655=['sequelize','exports','STRING','BOOLEAN'];(function(_0x34896a,_0x3d94b5){var _0x5a3a02=function(_0x1e8e60){while(--_0x1e8e60){_0x34896a['push'](_0x34896a['shift']());}};_0x5a3a02(++_0x3d94b5);}(_0x4655,0x70));var _0x5465=function(_0x1613cc,_0x22772b){_0x1613cc=_0x1613cc-0x0;var _0x5bb337=_0x4655[_0x1613cc];return _0x5bb337;};'use strict';var Sequelize=require(_0x5465('0x0'));module[_0x5465('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5465('0x2')]},'write':{'type':Sequelize[_0x5465('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 8153b86..b1ed22d 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 _0x5b4f=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','ChatGroup','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','ChatInternalMessage','$gte','format','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x5b4f,0x16f));var _0xf5b4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x5b4f[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0xf5b4('0x0'));var rimraf=require(_0xf5b4('0x1'));var zipdir=require(_0xf5b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf5b4('0x3'));var moment=require('moment');var BPromise=require(_0xf5b4('0x4'));var Mustache=require(_0xf5b4('0x5'));var util=require(_0xf5b4('0x6'));var path=require('path');var sox=require(_0xf5b4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5b4('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf5b4('0x9'));var jsforce=require(_0xf5b4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf5b4('0xb'));var querystring=require(_0xf5b4('0xc'));var Papa=require('papaparse');var Redis=require(_0xf5b4('0xd'));var authService=require(_0xf5b4('0xe'));var qs=require(_0xf5b4('0xf'));var as=require(_0xf5b4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5b4('0x11'))(_0xf5b4('0x12'));var utils=require('../../config/utils');var config=require(_0xf5b4('0x13'));var licenseUtil=require(_0xf5b4('0x14'));var db=require(_0xf5b4('0x15'))['db'];config[_0xf5b4('0x16')]=_[_0xf5b4('0x17')](config[_0xf5b4('0x16')],{'host':_0xf5b4('0x18'),'port':0x18eb});var socket=require(_0xf5b4('0x19'))(new Redis(config[_0xf5b4('0x16')]));require(_0xf5b4('0x1a'))[_0xf5b4('0x1b')](socket);function respondWithStatusCode(_0x5ba1fc,_0x186b15){_0x186b15=_0x186b15||0xcc;return function(_0x1ccd26){if(_0x1ccd26){return _0x5ba1fc[_0xf5b4('0x1c')](_0x186b15);}return _0x5ba1fc[_0xf5b4('0x1d')](_0x186b15)['end']();};}function respondWithResult(_0x2eef0b,_0x522a19){_0x522a19=_0x522a19||0xc8;return function(_0x3d972f){if(_0x3d972f){return _0x2eef0b['status'](_0x522a19)[_0xf5b4('0x1e')](_0x3d972f);}};}function respondWithFilteredResult(_0x55bae6,_0xafcac6){return function(_0x2e9c4c){if(_0x2e9c4c){var _0x598bbe=typeof _0xafcac6['offset']===_0xf5b4('0x1f')&&typeof _0xafcac6['limit']==='undefined';var _0x49b7d2=_0x2e9c4c[_0xf5b4('0x20')];var _0xd2d0d0=_0x598bbe?0x0:_0xafcac6[_0xf5b4('0x21')];var _0x1c1bce=_0x598bbe?_0x2e9c4c[_0xf5b4('0x20')]:_0xafcac6[_0xf5b4('0x21')]+_0xafcac6[_0xf5b4('0x22')];var _0x1c6248;if(_0x1c1bce>=_0x49b7d2){_0x1c1bce=_0x49b7d2;_0x1c6248=0xc8;}else{_0x1c6248=0xce;}_0x55bae6[_0xf5b4('0x1d')](_0x1c6248);return _0x55bae6[_0xf5b4('0x23')](_0xf5b4('0x24'),_0xd2d0d0+'-'+_0x1c1bce+'/'+_0x49b7d2)[_0xf5b4('0x1e')](_0x2e9c4c);}return null;};}function patchUpdates(_0xa9ac44){return function(_0x505397){try{jsonpatch['apply'](_0x505397,_0xa9ac44,!![]);}catch(_0x34f7c1){return BPromise[_0xf5b4('0x25')](_0x34f7c1);}return _0x505397[_0xf5b4('0x26')]();};}function saveUpdates(_0xd2ac04,_0x4225c3){return function(_0x403e00){if(_0x403e00){return _0x403e00[_0xf5b4('0x27')](_0xd2ac04)[_0xf5b4('0x28')](function(_0x505928){return _0x505928;});}return null;};}function removeEntity(_0x410dac,_0x213d13){return function(_0x27f3ab){if(_0x27f3ab){return _0x27f3ab[_0xf5b4('0x29')]()[_0xf5b4('0x28')](function(){_0x410dac['status'](0xcc)[_0xf5b4('0x2a')]();});}};}function handleEntityNotFound(_0x163557,_0x50d452){return function(_0x56bdff){if(!_0x56bdff){_0x163557[_0xf5b4('0x1c')](0x194);}return _0x56bdff;};}function handleError(_0x553200,_0x348a9c){_0x348a9c=_0x348a9c||0x1f4;return function(_0x330562){logger[_0xf5b4('0x2b')](_0x330562['stack']);if(_0x330562[_0xf5b4('0x2c')]){delete _0x330562[_0xf5b4('0x2c')];}_0x553200['status'](_0x348a9c)[_0xf5b4('0x2d')](_0x330562);};}exports[_0xf5b4('0x2e')]=function(_0x443b35,_0x401408){var _0x23ab64={},_0x392552={},_0x174a26={'count':0x0,'rows':[]};var _0x55b791=_[_0xf5b4('0x2f')](db[_0xf5b4('0x30')]['rawAttributes'],function(_0x34d6ce){return{'name':_0x34d6ce['fieldName'],'type':_0x34d6ce['type'][_0xf5b4('0x31')]};});_0x392552[_0xf5b4('0x32')]=_[_0xf5b4('0x2f')](_0x55b791,'name');_0x392552[_0xf5b4('0x33')]=_[_0xf5b4('0x34')](_0x443b35[_0xf5b4('0x33')]);_0x392552['filters']=_[_0xf5b4('0x35')](_0x392552['model'],_0x392552['query']);_0x23ab64[_0xf5b4('0x36')]=_['intersection'](_0x392552[_0xf5b4('0x32')],qs['fields'](_0x443b35[_0xf5b4('0x33')][_0xf5b4('0x37')]));_0x23ab64[_0xf5b4('0x36')]=_0x23ab64['attributes'][_0xf5b4('0x38')]?_0x23ab64[_0xf5b4('0x36')]:_0x392552[_0xf5b4('0x32')];if(!_0x443b35[_0xf5b4('0x33')][_0xf5b4('0x39')](_0xf5b4('0x3a'))){_0x23ab64['limit']=qs[_0xf5b4('0x22')](_0x443b35[_0xf5b4('0x33')][_0xf5b4('0x22')]);_0x23ab64[_0xf5b4('0x21')]=qs[_0xf5b4('0x21')](_0x443b35[_0xf5b4('0x33')]['offset']);}_0x23ab64[_0xf5b4('0x3b')]=qs[_0xf5b4('0x3c')](_0x443b35[_0xf5b4('0x33')][_0xf5b4('0x3c')]);_0x23ab64[_0xf5b4('0x3d')]=qs[_0xf5b4('0x3e')](_[_0xf5b4('0x3f')](_0x443b35[_0xf5b4('0x33')],_0x392552[_0xf5b4('0x3e')]),_0x55b791);if(_0x443b35[_0xf5b4('0x33')][_0xf5b4('0x40')]){_0x23ab64['where']=_['merge'](_0x23ab64[_0xf5b4('0x3d')],{'$or':_[_0xf5b4('0x2f')](_0x55b791,function(_0x3e9ffc){if(_0x3e9ffc[_0xf5b4('0x41')]!==_0xf5b4('0x42')){var _0x115a7f={};_0x115a7f[_0x3e9ffc['name']]={'$like':'%'+_0x443b35['query']['filter']+'%'};return _0x115a7f;}})});}_0x23ab64=_[_0xf5b4('0x43')]({},_0x23ab64,_0x443b35['options']);var _0x1d628e={'where':_0x23ab64[_0xf5b4('0x3d')]};return db[_0xf5b4('0x30')][_0xf5b4('0x20')](_0x1d628e)[_0xf5b4('0x28')](function(_0x25f969){_0x174a26['count']=_0x25f969;if(_0x443b35[_0xf5b4('0x33')]['includeAll']){_0x23ab64[_0xf5b4('0x44')]=[{'all':!![]}];}return db[_0xf5b4('0x30')][_0xf5b4('0x45')](_0x23ab64);})[_0xf5b4('0x28')](function(_0x55d7aa){_0x174a26[_0xf5b4('0x46')]=_0x55d7aa;return _0x174a26;})['then'](respondWithFilteredResult(_0x401408,_0x23ab64))[_0xf5b4('0x47')](handleError(_0x401408,null));};exports[_0xf5b4('0x48')]=function(_0x243e49,_0x2890af){var _0x1d6552={'raw':!![],'where':{'id':_0x243e49[_0xf5b4('0x49')]['id']}},_0x45f555={};_0x45f555[_0xf5b4('0x32')]=_[_0xf5b4('0x34')](db[_0xf5b4('0x30')][_0xf5b4('0x4a')]);_0x45f555[_0xf5b4('0x33')]=_['keys'](_0x243e49[_0xf5b4('0x33')]);_0x45f555[_0xf5b4('0x3e')]=_['intersection'](_0x45f555['model'],_0x45f555['query']);_0x1d6552[_0xf5b4('0x36')]=_['intersection'](_0x45f555['model'],qs['fields'](_0x243e49[_0xf5b4('0x33')][_0xf5b4('0x37')]));_0x1d6552[_0xf5b4('0x36')]=_0x1d6552['attributes']['length']?_0x1d6552[_0xf5b4('0x36')]:_0x45f555[_0xf5b4('0x32')];if(_0x243e49['query'][_0xf5b4('0x4b')]){_0x1d6552[_0xf5b4('0x44')]=[{'all':!![]}];}_0x1d6552=_[_0xf5b4('0x43')]({},_0x1d6552,_0x243e49[_0xf5b4('0x4c')]);return db['ChatGroup'][_0xf5b4('0x4d')](_0x1d6552)[_0xf5b4('0x28')](handleEntityNotFound(_0x2890af,null))[_0xf5b4('0x28')](respondWithResult(_0x2890af,null))['catch'](handleError(_0x2890af,null));};exports[_0xf5b4('0x4e')]=function(_0x587d36,_0x3c95d4){return db[_0xf5b4('0x30')][_0xf5b4('0x4e')](_0x587d36[_0xf5b4('0x4f')],{})[_0xf5b4('0x28')](respondWithResult(_0x3c95d4,0xc9))[_0xf5b4('0x47')](handleError(_0x3c95d4,null));};exports[_0xf5b4('0x27')]=function(_0x4e837c,_0x5a4dd1){if(_0x4e837c[_0xf5b4('0x4f')]['id']){delete _0x4e837c[_0xf5b4('0x4f')]['id'];}return db['ChatGroup'][_0xf5b4('0x4d')]({'where':{'id':_0x4e837c[_0xf5b4('0x49')]['id']}})[_0xf5b4('0x28')](handleEntityNotFound(_0x5a4dd1,null))['then'](saveUpdates(_0x4e837c[_0xf5b4('0x4f')],null))['then'](respondWithResult(_0x5a4dd1,null))['catch'](handleError(_0x5a4dd1,null));};exports[_0xf5b4('0x29')]=function(_0x47272d,_0x47a57c){return db[_0xf5b4('0x30')][_0xf5b4('0x4d')]({'where':{'id':_0x47272d[_0xf5b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x47a57c,null))[_0xf5b4('0x28')](removeEntity(_0x47a57c,null))[_0xf5b4('0x47')](handleError(_0x47a57c,null));};exports[_0xf5b4('0x50')]=function(_0x5ec771,_0xda4d79){return db[_0xf5b4('0x30')][_0xf5b4('0x50')]()['then'](respondWithResult(_0xda4d79,null))[_0xf5b4('0x47')](handleError(_0xda4d79,null));};exports[_0xf5b4('0x51')]=function(_0x3d31be,_0x315e87,_0x338041){return db['ChatInternalMessage'][_0xf5b4('0x20')]({'where':{'ChatGroupId':_0x3d31be[_0xf5b4('0x49')]['id'],'ToId':_0x3d31be[_0xf5b4('0x52')]['id'],'read':![]}})[_0xf5b4('0x28')](function(_0x1d6623){return{'id':_[_0xf5b4('0x53')](_0x3d31be['params']['id']),'count':_0x1d6623};})[_0xf5b4('0x28')](respondWithResult(_0x315e87,null))[_0xf5b4('0x47')](handleError(_0x315e87,null));};exports[_0xf5b4('0x54')]=function(_0x23854e,_0x49696d,_0x485dba){return db[_0xf5b4('0x30')][_0xf5b4('0x4d')]({'where':{'id':_0x23854e[_0xf5b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x49696d,null))[_0xf5b4('0x28')](function(_0x1db066){if(_0x1db066){return _0x1db066[_0xf5b4('0x54')](_0x23854e[_0xf5b4('0x4f')][_0xf5b4('0x55')],_[_0xf5b4('0x56')](_0x23854e['body'],[_0xf5b4('0x55'),'id'])||{});}})[_0xf5b4('0x28')](respondWithResult(_0x49696d,null))[_0xf5b4('0x47')](handleError(_0x49696d,null));};exports[_0xf5b4('0x57')]=function(_0x266d64,_0x3fbb2a,_0x370114){var _0x358e0d={};var _0x2e9011={};var _0x56815d;var _0x31177a;return db['ChatGroup'][_0xf5b4('0x58')]({'where':{'id':_0x266d64[_0xf5b4('0x49')]['id']}})[_0xf5b4('0x28')](handleEntityNotFound(_0x3fbb2a,null))[_0xf5b4('0x28')](function(_0x492370){if(_0x492370){_0x56815d=_0x492370;_0x2e9011[_0xf5b4('0x32')]=_[_0xf5b4('0x34')](db[_0xf5b4('0x59')][_0xf5b4('0x4a')]);_0x2e9011[_0xf5b4('0x33')]=_[_0xf5b4('0x34')](_0x266d64['query']);_0x2e9011['filters']=_[_0xf5b4('0x35')](_0x2e9011[_0xf5b4('0x32')],_0x2e9011['query']);_0x358e0d[_0xf5b4('0x36')]=_[_0xf5b4('0x35')](_0x2e9011[_0xf5b4('0x32')],qs['fields'](_0x266d64[_0xf5b4('0x33')]['fields']));_0x358e0d[_0xf5b4('0x36')]=_0x358e0d[_0xf5b4('0x36')]['length']?_0x358e0d[_0xf5b4('0x36')]:_0x2e9011[_0xf5b4('0x32')];_0x358e0d[_0xf5b4('0x3b')]=qs[_0xf5b4('0x3c')](_0x266d64[_0xf5b4('0x33')][_0xf5b4('0x3c')]);_0x358e0d[_0xf5b4('0x3d')]=qs[_0xf5b4('0x3e')](_[_0xf5b4('0x3f')](_0x266d64['query'],_0x2e9011['filters']));if(_0x266d64['query'][_0xf5b4('0x40')]){_0x358e0d[_0xf5b4('0x3d')]=_[_0xf5b4('0x43')](_0x358e0d[_0xf5b4('0x3d')],{'$or':_['map'](_0x358e0d[_0xf5b4('0x36')],function(_0x436a70){var _0x9b79b5={};_0x9b79b5[_0x436a70]={'$like':'%'+_0x266d64[_0xf5b4('0x33')][_0xf5b4('0x40')]+'%'};return _0x9b79b5;})});}_0x358e0d=_[_0xf5b4('0x43')]({},_0x358e0d,_0x266d64[_0xf5b4('0x4c')]);return _0x56815d[_0xf5b4('0x57')](_0x358e0d);}})['then'](function(_0x4df36b){if(_0x4df36b){_0x31177a=_0x4df36b['length'];if(!_0x266d64[_0xf5b4('0x33')][_0xf5b4('0x39')](_0xf5b4('0x3a'))){_0x358e0d[_0xf5b4('0x22')]=qs['limit'](_0x266d64[_0xf5b4('0x33')][_0xf5b4('0x22')]);_0x358e0d['offset']=qs[_0xf5b4('0x21')](_0x266d64[_0xf5b4('0x33')]['offset']);}return _0x56815d['getMembers'](_0x358e0d);}})['then'](function(_0x3cffb3){if(_0x3cffb3){return _0x3cffb3?{'count':_0x31177a,'rows':_0x3cffb3}:null;}})[_0xf5b4('0x28')](respondWithResult(_0x3fbb2a,null))['catch'](handleError(_0x3fbb2a,null));};exports[_0xf5b4('0x5a')]=function(_0x122972,_0x2e0eb4,_0x19de99){return db[_0xf5b4('0x30')][_0xf5b4('0x4d')]({'where':{'id':_0x122972[_0xf5b4('0x49')]['id']}})[_0xf5b4('0x28')](handleEntityNotFound(_0x2e0eb4,null))[_0xf5b4('0x28')](function(_0x58a959){if(_0x58a959){return _0x58a959[_0xf5b4('0x5a')](_0x122972[_0xf5b4('0x33')][_0xf5b4('0x55')]);}})[_0xf5b4('0x28')](respondWithStatusCode(_0x2e0eb4,null))[_0xf5b4('0x47')](handleError(_0x2e0eb4,null));};exports[_0xf5b4('0x5b')]=function(_0x79a50a,_0x3ce68d,_0x5d5f9f){if(_0x79a50a[_0xf5b4('0x4f')]['id']){delete _0x79a50a[_0xf5b4('0x4f')]['id'];}return db[_0xf5b4('0x30')]['find']({'where':{'id':_0x79a50a['params']['id']}})[_0xf5b4('0x28')](handleEntityNotFound(_0x3ce68d,null))[_0xf5b4('0x28')](function(_0x561353){if(_0x561353){_0x79a50a[_0xf5b4('0x4f')]['ChatGroupId']=_0x561353['id'];return db['ChatInternalMessage'][_0xf5b4('0x4e')](_0x79a50a[_0xf5b4('0x4f')]);}})[_0xf5b4('0x28')](respondWithResult(_0x3ce68d,null))[_0xf5b4('0x47')](handleError(_0x3ce68d,null));};exports[_0xf5b4('0x5c')]=function(_0x1dad16,_0x51005e,_0x3600f4){var _0x3f5e85={};var _0x348bdf={};var _0x18c092;var _0x508e9e;return db[_0xf5b4('0x30')]['findOne']({'where':{'id':_0x1dad16[_0xf5b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x51005e,null))[_0xf5b4('0x28')](function(_0x1474c6){if(_0x1474c6){_0x18c092=_0x1474c6;_0x348bdf['model']=_[_0xf5b4('0x34')](db[_0xf5b4('0x5d')]['rawAttributes']);_0x348bdf['query']=_['keys'](_0x1dad16['query']);_0x348bdf[_0xf5b4('0x3e')]=_[_0xf5b4('0x35')](_0x348bdf['model'],_0x348bdf[_0xf5b4('0x33')]);_0x3f5e85[_0xf5b4('0x36')]=_[_0xf5b4('0x35')](_0x348bdf[_0xf5b4('0x32')],qs[_0xf5b4('0x37')](_0x1dad16['query'][_0xf5b4('0x37')]));_0x3f5e85['attributes']=_0x3f5e85['attributes'][_0xf5b4('0x38')]?_0x3f5e85[_0xf5b4('0x36')]:_0x348bdf[_0xf5b4('0x32')];_0x3f5e85[_0xf5b4('0x3b')]=qs['sort'](_0x1dad16['query']['sort']);_0x3f5e85['where']=qs[_0xf5b4('0x3e')](_[_0xf5b4('0x3f')](_0x1dad16[_0xf5b4('0x33')],_0x348bdf['filters']));if(_0x1dad16[_0xf5b4('0x33')]['filter']){_0x3f5e85[_0xf5b4('0x3d')]=_[_0xf5b4('0x43')](_0x3f5e85[_0xf5b4('0x3d')],{'$or':_['map'](_0x3f5e85[_0xf5b4('0x36')],function(_0x191d5c){var _0x39c62b={};_0x39c62b[_0x191d5c]={'$like':'%'+_0x1dad16[_0xf5b4('0x33')][_0xf5b4('0x40')]+'%'};return _0x39c62b;})});}if(_0x1dad16[_0xf5b4('0x33')]['$gte']){var _0x47ec9f=_0x1dad16[_0xf5b4('0x33')][_0xf5b4('0x5e')]['split'](',');var _0x277a33={};_0x277a33[_0x47ec9f[0x0]]={'$gte':moment(_0x47ec9f[0x1])[_0xf5b4('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3f5e85['where']=_['merge'](_0x3f5e85[_0xf5b4('0x3d')],_0x277a33);}_0x3f5e85=_[_0xf5b4('0x43')]({},_0x3f5e85,_0x1dad16[_0xf5b4('0x4c')]);return _0x18c092[_0xf5b4('0x5c')](_0x3f5e85);}})[_0xf5b4('0x28')](function(_0x2e8e81){if(_0x2e8e81){_0x508e9e=_0x2e8e81['length'];if(!_0x1dad16[_0xf5b4('0x33')][_0xf5b4('0x39')](_0xf5b4('0x3a'))){_0x3f5e85[_0xf5b4('0x22')]=qs[_0xf5b4('0x22')](_0x1dad16[_0xf5b4('0x33')][_0xf5b4('0x22')]);_0x3f5e85[_0xf5b4('0x21')]=qs[_0xf5b4('0x21')](_0x1dad16['query'][_0xf5b4('0x21')]);}return _0x18c092[_0xf5b4('0x5c')](_0x3f5e85);}})[_0xf5b4('0x28')](function(_0x380e8d){if(_0x380e8d){return _0x380e8d?{'count':_0x508e9e,'rows':_0x380e8d}:null;}})['then'](respondWithResult(_0x51005e,null))[_0xf5b4('0x47')](handleError(_0x51005e,null));};
\ No newline at end of file
+var _0x33a3=['sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','params','find','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x33a3,0x1d7));var _0x333a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x33a3[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x333a('0x0'));var rimraf=require(_0x333a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x333a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x333a('0x3'));var Mustache=require(_0x333a('0x4'));var util=require(_0x333a('0x5'));var path=require('path');var sox=require(_0x333a('0x6'));var csv=require(_0x333a('0x7'));var ejs=require(_0x333a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x333a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x333a('0xa'));var deskjs=require(_0x333a('0xb'));var toCsv=require(_0x333a('0x7'));var querystring=require(_0x333a('0xc'));var Papa=require(_0x333a('0xd'));var Redis=require('ioredis');var authService=require(_0x333a('0xe'));var qs=require(_0x333a('0xf'));var as=require(_0x333a('0x10'));var hardwareService=require(_0x333a('0x11'));var logger=require(_0x333a('0x12'))(_0x333a('0x13'));var utils=require(_0x333a('0x14'));var config=require(_0x333a('0x15'));var licenseUtil=require(_0x333a('0x16'));var db=require(_0x333a('0x17'))['db'];config[_0x333a('0x18')]=_['defaults'](config[_0x333a('0x18')],{'host':_0x333a('0x19'),'port':0x18eb});var socket=require(_0x333a('0x1a'))(new Redis(config['redis']));require(_0x333a('0x1b'))[_0x333a('0x1c')](socket);function respondWithStatusCode(_0xfe222b,_0x3cafd7){_0x3cafd7=_0x3cafd7||0xcc;return function(_0x5d431c){if(_0x5d431c){return _0xfe222b[_0x333a('0x1d')](_0x3cafd7);}return _0xfe222b[_0x333a('0x1e')](_0x3cafd7)['end']();};}function respondWithResult(_0x5dc99f,_0x2ddb0b){_0x2ddb0b=_0x2ddb0b||0xc8;return function(_0x290ad2){if(_0x290ad2){return _0x5dc99f['status'](_0x2ddb0b)[_0x333a('0x1f')](_0x290ad2);}};}function respondWithFilteredResult(_0xaae743,_0x28a4b5){return function(_0x29db3c){if(_0x29db3c){var _0x4844b9=typeof _0x28a4b5[_0x333a('0x20')]===_0x333a('0x21')&&typeof _0x28a4b5[_0x333a('0x22')]===_0x333a('0x21');var _0x1744aa=_0x29db3c[_0x333a('0x23')];var _0x28fcfe=_0x4844b9?0x0:_0x28a4b5[_0x333a('0x20')];var _0xe51adf=_0x4844b9?_0x29db3c[_0x333a('0x23')]:_0x28a4b5['offset']+_0x28a4b5['limit'];var _0x56b0e1;if(_0xe51adf>=_0x1744aa){_0xe51adf=_0x1744aa;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0xaae743[_0x333a('0x1e')](_0x56b0e1);return _0xaae743[_0x333a('0x24')]('Content-Range',_0x28fcfe+'-'+_0xe51adf+'/'+_0x1744aa)['json'](_0x29db3c);}return null;};}function patchUpdates(_0x2e3a18){return function(_0x6d9852){try{jsonpatch['apply'](_0x6d9852,_0x2e3a18,!![]);}catch(_0x365426){return BPromise[_0x333a('0x25')](_0x365426);}return _0x6d9852[_0x333a('0x26')]();};}function saveUpdates(_0x49e85a,_0x2aada6){return function(_0xf2f9a){if(_0xf2f9a){return _0xf2f9a[_0x333a('0x27')](_0x49e85a)[_0x333a('0x28')](function(_0x2fddff){return _0x2fddff;});}return null;};}function removeEntity(_0x2cadaa,_0x32c7c8){return function(_0x476d02){if(_0x476d02){return _0x476d02[_0x333a('0x29')]()[_0x333a('0x28')](function(){_0x2cadaa[_0x333a('0x1e')](0xcc)[_0x333a('0x2a')]();});}};}function handleEntityNotFound(_0x4a1c14,_0x2dd4a2){return function(_0x253d41){if(!_0x253d41){_0x4a1c14[_0x333a('0x1d')](0x194);}return _0x253d41;};}function handleError(_0x59d535,_0x4cdd84){_0x4cdd84=_0x4cdd84||0x1f4;return function(_0x5be71f){logger[_0x333a('0x2b')](_0x5be71f[_0x333a('0x2c')]);if(_0x5be71f[_0x333a('0x2d')]){delete _0x5be71f[_0x333a('0x2d')];}_0x59d535[_0x333a('0x1e')](_0x4cdd84)[_0x333a('0x2e')](_0x5be71f);};}exports[_0x333a('0x2f')]=function(_0x5d09b3,_0x460418){var _0x4815ae={},_0x23e3b3={},_0x3ed64f={'count':0x0,'rows':[]};var _0x4fbad5=_[_0x333a('0x30')](db[_0x333a('0x31')][_0x333a('0x32')],function(_0x1f9264){return{'name':_0x1f9264[_0x333a('0x33')],'type':_0x1f9264[_0x333a('0x34')][_0x333a('0x35')]};});_0x23e3b3['model']=_[_0x333a('0x30')](_0x4fbad5,'name');_0x23e3b3[_0x333a('0x36')]=_[_0x333a('0x37')](_0x5d09b3[_0x333a('0x36')]);_0x23e3b3['filters']=_[_0x333a('0x38')](_0x23e3b3['model'],_0x23e3b3['query']);_0x4815ae['attributes']=_[_0x333a('0x38')](_0x23e3b3['model'],qs[_0x333a('0x39')](_0x5d09b3[_0x333a('0x36')]['fields']));_0x4815ae[_0x333a('0x3a')]=_0x4815ae[_0x333a('0x3a')][_0x333a('0x3b')]?_0x4815ae['attributes']:_0x23e3b3[_0x333a('0x3c')];if(!_0x5d09b3[_0x333a('0x36')][_0x333a('0x3d')](_0x333a('0x3e'))){_0x4815ae[_0x333a('0x22')]=qs['limit'](_0x5d09b3[_0x333a('0x36')][_0x333a('0x22')]);_0x4815ae['offset']=qs['offset'](_0x5d09b3[_0x333a('0x36')][_0x333a('0x20')]);}_0x4815ae[_0x333a('0x3f')]=qs[_0x333a('0x40')](_0x5d09b3[_0x333a('0x36')]['sort']);_0x4815ae[_0x333a('0x41')]=qs[_0x333a('0x42')](_[_0x333a('0x43')](_0x5d09b3['query'],_0x23e3b3[_0x333a('0x42')]),_0x4fbad5);if(_0x5d09b3[_0x333a('0x36')][_0x333a('0x44')]){_0x4815ae[_0x333a('0x41')]=_[_0x333a('0x45')](_0x4815ae[_0x333a('0x41')],{'$or':_[_0x333a('0x30')](_0x4fbad5,function(_0x420b97){if(_0x420b97[_0x333a('0x34')]!==_0x333a('0x46')){var _0x5e9369={};_0x5e9369[_0x420b97[_0x333a('0x2d')]]={'$like':'%'+_0x5d09b3[_0x333a('0x36')]['filter']+'%'};return _0x5e9369;}})});}_0x4815ae=_[_0x333a('0x45')]({},_0x4815ae,_0x5d09b3[_0x333a('0x47')]);var _0x3f9ed8={'where':_0x4815ae['where']};return db[_0x333a('0x31')]['count'](_0x3f9ed8)[_0x333a('0x28')](function(_0x25447e){_0x3ed64f[_0x333a('0x23')]=_0x25447e;if(_0x5d09b3['query'][_0x333a('0x48')]){_0x4815ae['include']=[{'all':!![]}];}return db['ChatGroup'][_0x333a('0x49')](_0x4815ae);})[_0x333a('0x28')](function(_0x23b14f){_0x3ed64f[_0x333a('0x4a')]=_0x23b14f;return _0x3ed64f;})['then'](respondWithFilteredResult(_0x460418,_0x4815ae))[_0x333a('0x4b')](handleError(_0x460418,null));};exports[_0x333a('0x4c')]=function(_0x52a8c8,_0x2f060e){var _0x57d3d5={'raw':!![],'where':{'id':_0x52a8c8['params']['id']}},_0x293dab={};_0x293dab[_0x333a('0x3c')]=_['keys'](db[_0x333a('0x31')][_0x333a('0x32')]);_0x293dab[_0x333a('0x36')]=_['keys'](_0x52a8c8[_0x333a('0x36')]);_0x293dab['filters']=_['intersection'](_0x293dab[_0x333a('0x3c')],_0x293dab[_0x333a('0x36')]);_0x57d3d5['attributes']=_['intersection'](_0x293dab[_0x333a('0x3c')],qs['fields'](_0x52a8c8[_0x333a('0x36')][_0x333a('0x39')]));_0x57d3d5[_0x333a('0x3a')]=_0x57d3d5['attributes']['length']?_0x57d3d5[_0x333a('0x3a')]:_0x293dab[_0x333a('0x3c')];if(_0x52a8c8['query']['includeAll']){_0x57d3d5[_0x333a('0x4d')]=[{'all':!![]}];}_0x57d3d5=_[_0x333a('0x45')]({},_0x57d3d5,_0x52a8c8[_0x333a('0x47')]);return db[_0x333a('0x31')]['find'](_0x57d3d5)[_0x333a('0x28')](handleEntityNotFound(_0x2f060e,null))[_0x333a('0x28')](respondWithResult(_0x2f060e,null))[_0x333a('0x4b')](handleError(_0x2f060e,null));};exports[_0x333a('0x4e')]=function(_0x47a14c,_0xa58f33){return db[_0x333a('0x31')][_0x333a('0x4e')](_0x47a14c[_0x333a('0x4f')],{})[_0x333a('0x28')](respondWithResult(_0xa58f33,0xc9))[_0x333a('0x4b')](handleError(_0xa58f33,null));};exports['update']=function(_0x58cf04,_0x1b71cd){if(_0x58cf04[_0x333a('0x4f')]['id']){delete _0x58cf04[_0x333a('0x4f')]['id'];}return db[_0x333a('0x31')]['find']({'where':{'id':_0x58cf04[_0x333a('0x50')]['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x1b71cd,null))[_0x333a('0x28')](saveUpdates(_0x58cf04[_0x333a('0x4f')],null))[_0x333a('0x28')](respondWithResult(_0x1b71cd,null))['catch'](handleError(_0x1b71cd,null));};exports[_0x333a('0x29')]=function(_0x434d56,_0x1fb36e){return db[_0x333a('0x31')][_0x333a('0x51')]({'where':{'id':_0x434d56[_0x333a('0x50')]['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x1fb36e,null))[_0x333a('0x28')](removeEntity(_0x1fb36e,null))[_0x333a('0x4b')](handleError(_0x1fb36e,null));};exports[_0x333a('0x52')]=function(_0xf729ad,_0x492abe){return db[_0x333a('0x31')]['describe']()[_0x333a('0x28')](respondWithResult(_0x492abe,null))[_0x333a('0x4b')](handleError(_0x492abe,null));};exports[_0x333a('0x53')]=function(_0x1630d8,_0x57833f,_0x1eef68){return db[_0x333a('0x54')][_0x333a('0x23')]({'where':{'ChatGroupId':_0x1630d8['params']['id'],'ToId':_0x1630d8[_0x333a('0x55')]['id'],'read':![]}})[_0x333a('0x28')](function(_0x597114){return{'id':_['toInteger'](_0x1630d8[_0x333a('0x50')]['id']),'count':_0x597114};})['then'](respondWithResult(_0x57833f,null))[_0x333a('0x4b')](handleError(_0x57833f,null));};exports[_0x333a('0x56')]=function(_0x937316,_0x3d0532,_0x4fcbeb){return db[_0x333a('0x31')][_0x333a('0x51')]({'where':{'id':_0x937316[_0x333a('0x50')]['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x3d0532,null))[_0x333a('0x28')](function(_0x595f6e){if(_0x595f6e){return _0x595f6e['addMembers'](_0x937316[_0x333a('0x4f')][_0x333a('0x57')],_[_0x333a('0x58')](_0x937316[_0x333a('0x4f')],['ids','id'])||{});}})[_0x333a('0x28')](respondWithResult(_0x3d0532,null))[_0x333a('0x4b')](handleError(_0x3d0532,null));};exports[_0x333a('0x59')]=function(_0x2e7ed3,_0x46bd87,_0x3be178){var _0x180fcd={};var _0x3933ba={};var _0xb95db1;var _0x3981dd;return db[_0x333a('0x31')][_0x333a('0x5a')]({'where':{'id':_0x2e7ed3['params']['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x46bd87,null))[_0x333a('0x28')](function(_0x418bfd){if(_0x418bfd){_0xb95db1=_0x418bfd;_0x3933ba['model']=_[_0x333a('0x37')](db[_0x333a('0x5b')][_0x333a('0x32')]);_0x3933ba[_0x333a('0x36')]=_[_0x333a('0x37')](_0x2e7ed3[_0x333a('0x36')]);_0x3933ba[_0x333a('0x42')]=_[_0x333a('0x38')](_0x3933ba[_0x333a('0x3c')],_0x3933ba[_0x333a('0x36')]);_0x180fcd[_0x333a('0x3a')]=_['intersection'](_0x3933ba[_0x333a('0x3c')],qs[_0x333a('0x39')](_0x2e7ed3[_0x333a('0x36')][_0x333a('0x39')]));_0x180fcd[_0x333a('0x3a')]=_0x180fcd[_0x333a('0x3a')][_0x333a('0x3b')]?_0x180fcd[_0x333a('0x3a')]:_0x3933ba[_0x333a('0x3c')];_0x180fcd[_0x333a('0x3f')]=qs[_0x333a('0x40')](_0x2e7ed3[_0x333a('0x36')][_0x333a('0x40')]);_0x180fcd[_0x333a('0x41')]=qs['filters'](_[_0x333a('0x43')](_0x2e7ed3[_0x333a('0x36')],_0x3933ba['filters']));if(_0x2e7ed3[_0x333a('0x36')][_0x333a('0x44')]){_0x180fcd[_0x333a('0x41')]=_[_0x333a('0x45')](_0x180fcd['where'],{'$or':_[_0x333a('0x30')](_0x180fcd[_0x333a('0x3a')],function(_0x4b678c){var _0x17447d={};_0x17447d[_0x4b678c]={'$like':'%'+_0x2e7ed3[_0x333a('0x36')][_0x333a('0x44')]+'%'};return _0x17447d;})});}_0x180fcd=_[_0x333a('0x45')]({},_0x180fcd,_0x2e7ed3[_0x333a('0x47')]);return _0xb95db1['getMembers'](_0x180fcd);}})[_0x333a('0x28')](function(_0x23525a){if(_0x23525a){_0x3981dd=_0x23525a[_0x333a('0x3b')];if(!_0x2e7ed3[_0x333a('0x36')][_0x333a('0x3d')](_0x333a('0x3e'))){_0x180fcd[_0x333a('0x22')]=qs[_0x333a('0x22')](_0x2e7ed3[_0x333a('0x36')][_0x333a('0x22')]);_0x180fcd[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x2e7ed3[_0x333a('0x36')][_0x333a('0x20')]);}return _0xb95db1[_0x333a('0x59')](_0x180fcd);}})[_0x333a('0x28')](function(_0xa3760c){if(_0xa3760c){return _0xa3760c?{'count':_0x3981dd,'rows':_0xa3760c}:null;}})[_0x333a('0x28')](respondWithResult(_0x46bd87,null))['catch'](handleError(_0x46bd87,null));};exports[_0x333a('0x5c')]=function(_0x792d2d,_0x44d695,_0x182cd9){return db[_0x333a('0x31')][_0x333a('0x51')]({'where':{'id':_0x792d2d['params']['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x44d695,null))[_0x333a('0x28')](function(_0x1e153d){if(_0x1e153d){return _0x1e153d[_0x333a('0x5c')](_0x792d2d['query'][_0x333a('0x57')]);}})['then'](respondWithStatusCode(_0x44d695,null))['catch'](handleError(_0x44d695,null));};exports[_0x333a('0x5d')]=function(_0x285d29,_0x3646e4,_0x244f1c){if(_0x285d29[_0x333a('0x4f')]['id']){delete _0x285d29[_0x333a('0x4f')]['id'];}return db[_0x333a('0x31')][_0x333a('0x51')]({'where':{'id':_0x285d29[_0x333a('0x50')]['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x3646e4,null))[_0x333a('0x28')](function(_0x5483f0){if(_0x5483f0){_0x285d29[_0x333a('0x4f')][_0x333a('0x5e')]=_0x5483f0['id'];return db[_0x333a('0x54')][_0x333a('0x4e')](_0x285d29['body']);}})['then'](respondWithResult(_0x3646e4,null))[_0x333a('0x4b')](handleError(_0x3646e4,null));};exports[_0x333a('0x5f')]=function(_0x2e86a4,_0x331a43,_0x34163a){var _0x3d3a93={};var _0x561905={};var _0x53271b;var _0x2eacd0;return db[_0x333a('0x31')][_0x333a('0x5a')]({'where':{'id':_0x2e86a4[_0x333a('0x50')]['id']}})[_0x333a('0x28')](handleEntityNotFound(_0x331a43,null))['then'](function(_0x2cfeac){if(_0x2cfeac){_0x53271b=_0x2cfeac;_0x561905[_0x333a('0x3c')]=_[_0x333a('0x37')](db[_0x333a('0x54')][_0x333a('0x32')]);_0x561905[_0x333a('0x36')]=_[_0x333a('0x37')](_0x2e86a4[_0x333a('0x36')]);_0x561905[_0x333a('0x42')]=_['intersection'](_0x561905[_0x333a('0x3c')],_0x561905[_0x333a('0x36')]);_0x3d3a93[_0x333a('0x3a')]=_[_0x333a('0x38')](_0x561905['model'],qs['fields'](_0x2e86a4[_0x333a('0x36')][_0x333a('0x39')]));_0x3d3a93[_0x333a('0x3a')]=_0x3d3a93[_0x333a('0x3a')][_0x333a('0x3b')]?_0x3d3a93['attributes']:_0x561905[_0x333a('0x3c')];_0x3d3a93[_0x333a('0x3f')]=qs[_0x333a('0x40')](_0x2e86a4[_0x333a('0x36')][_0x333a('0x40')]);_0x3d3a93['where']=qs[_0x333a('0x42')](_[_0x333a('0x43')](_0x2e86a4[_0x333a('0x36')],_0x561905['filters']));if(_0x2e86a4[_0x333a('0x36')]['filter']){_0x3d3a93[_0x333a('0x41')]=_['merge'](_0x3d3a93[_0x333a('0x41')],{'$or':_['map'](_0x3d3a93['attributes'],function(_0x3149c2){var _0x120c7d={};_0x120c7d[_0x3149c2]={'$like':'%'+_0x2e86a4['query'][_0x333a('0x44')]+'%'};return _0x120c7d;})});}if(_0x2e86a4[_0x333a('0x36')][_0x333a('0x60')]){var _0x125206=_0x2e86a4[_0x333a('0x36')][_0x333a('0x60')][_0x333a('0x61')](',');var _0x570664={};_0x570664[_0x125206[0x0]]={'$gte':moment(_0x125206[0x1])[_0x333a('0x62')](_0x333a('0x63'))};_0x3d3a93['where']=_[_0x333a('0x45')](_0x3d3a93[_0x333a('0x41')],_0x570664);}_0x3d3a93=_[_0x333a('0x45')]({},_0x3d3a93,_0x2e86a4[_0x333a('0x47')]);return _0x53271b[_0x333a('0x5f')](_0x3d3a93);}})[_0x333a('0x28')](function(_0x19584e){if(_0x19584e){_0x2eacd0=_0x19584e['length'];if(!_0x2e86a4[_0x333a('0x36')][_0x333a('0x3d')]('nolimit')){_0x3d3a93['limit']=qs['limit'](_0x2e86a4[_0x333a('0x36')]['limit']);_0x3d3a93[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x2e86a4[_0x333a('0x36')][_0x333a('0x20')]);}return _0x53271b[_0x333a('0x5f')](_0x3d3a93);}})[_0x333a('0x28')](function(_0x6e6631){if(_0x6e6631){return _0x6e6631?{'count':_0x2eacd0,'rows':_0x6e6631}:null;}})[_0x333a('0x28')](respondWithResult(_0x331a43,null))[_0x333a('0x4b')](handleError(_0x331a43,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index af2bfad..f70d8de 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 _0xe3a5=['../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2e3f06,_0x14f1d3){var _0x278a06=function(_0x51e0b0){while(--_0x51e0b0){_0x2e3f06['push'](_0x2e3f06['shift']());}};_0x278a06(++_0x14f1d3);}(_0xe3a5,0x127));var _0x5e3a=function(_0x4df4de,_0x1a6c46){_0x4df4de=_0x4df4de-0x0;var _0x342f7c=_0xe3a5[_0x4df4de];return _0x342f7c;};'use strict';var EventEmitter=require(_0x5e3a('0x0'));var ChatGroup=require(_0x5e3a('0x1'))['db'][_0x5e3a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e3a('0x3'),'afterDestroy':_0x5e3a('0x4')};function emitEvent(_0x1e867c){return function(_0x597a22,_0x40aa58,_0x30f110){ChatGroupEvents[_0x5e3a('0x5')](_0x1e867c+':'+_0x597a22['id'],_0x597a22);ChatGroupEvents[_0x5e3a('0x5')](_0x1e867c,_0x597a22);_0x30f110(null);};}for(var e in events){if(events[_0x5e3a('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5e3a('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4975=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x4975,0x86));var _0x5497=function(_0x400767,_0x2d2b83){_0x400767=_0x400767-0x0;var _0x5dd559=_0x4975[_0x400767];return _0x5dd559;};'use strict';var EventEmitter=require(_0x5497('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x5497('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5497('0x2')](0x0);var events={'afterCreate':_0x5497('0x3'),'afterUpdate':_0x5497('0x4'),'afterDestroy':_0x5497('0x5')};function emitEvent(_0x235986){return function(_0x14cecb,_0xeb31af,_0xbb1888){ChatGroupEvents[_0x5497('0x6')](_0x235986+':'+_0x14cecb['id'],_0x14cecb);ChatGroupEvents['emit'](_0x235986,_0x14cecb);_0xbb1888(null);};}for(var e in events){if(events[_0x5497('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5497('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 707370c..f8a2ec0 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 _0x5654=['path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2c8743,_0x5e6301){var _0xda5447=function(_0xca8e29){while(--_0xca8e29){_0x2c8743['push'](_0x2c8743['shift']());}};_0xda5447(++_0x5e6301);}(_0x5654,0x89));var _0x4565=function(_0x41ea99,_0x46d575){_0x41ea99=_0x41ea99-0x0;var _0x2a089d=_0x5654[_0x41ea99];return _0x2a089d;};'use strict';var _=require(_0x4565('0x0'));var util=require(_0x4565('0x1'));var logger=require(_0x4565('0x2'))(_0x4565('0x3'));var moment=require(_0x4565('0x4'));var BPromise=require(_0x4565('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4565('0x6'));var rimraf=require(_0x4565('0x7'));var config=require(_0x4565('0x8'));var attributes=require('./chatGroup.attributes');module[_0x4565('0x9')]=function(_0x46c018,_0x36de4c){return _0x46c018[_0x4565('0xa')](_0x4565('0xb'),attributes,{'tableName':_0x4565('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x855d=['path','rimraf','../../config/environment','exports','ChatGroup','chat_groups','lodash','util','api','moment','request-promise'];(function(_0x326acf,_0x211565){var _0x211a77=function(_0x5af4da){while(--_0x5af4da){_0x326acf['push'](_0x326acf['shift']());}};_0x211a77(++_0x211565);}(_0x855d,0x187));var _0xd855=function(_0x406e65,_0x5ccb3b){_0x406e65=_0x406e65-0x0;var _0x69353f=_0x855d[_0x406e65];return _0x69353f;};'use strict';var _=require(_0xd855('0x0'));var util=require(_0xd855('0x1'));var logger=require('../../config/logger')(_0xd855('0x2'));var moment=require(_0xd855('0x3'));var BPromise=require('bluebird');var rp=require(_0xd855('0x4'));var fs=require('fs');var path=require(_0xd855('0x5'));var rimraf=require(_0xd855('0x6'));var config=require(_0xd855('0x7'));var attributes=require('./chatGroup.attributes');module[_0xd855('0x8')]=function(_0x2c8c68,_0x53b620){return _0x2c8c68['define'](_0xd855('0x9'),attributes,{'tableName':_0xd855('0xa'),'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 c3959bd..0b11095 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 _0x41d9=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x26e89e,_0xacad9){var _0x5bf1d3=function(_0x53cbf8){while(--_0x53cbf8){_0x26e89e['push'](_0x26e89e['shift']());}};_0x5bf1d3(++_0xacad9);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var moment=require(_0x941d('0x2'));var BPromise=require(_0x941d('0x3'));var rs=require(_0x941d('0x4'));var fs=require('fs');var Redis=require(_0x941d('0x5'));var db=require(_0x941d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x941d('0x7'))(_0x941d('0x8'));var config=require('../../config/environment');var jayson=require(_0x941d('0x9'));var client=jayson[_0x941d('0xa')]['http']({'port':0x232a});config[_0x941d('0xb')]=_['defaults'](config[_0x941d('0xb')],{'host':_0x941d('0xc'),'port':0x18eb});var socket=require(_0x941d('0xd'))(new Redis(config[_0x941d('0xb')]));require(_0x941d('0xe'))['register'](socket);function respondWithRpcPromise(_0x176430,_0x1c5e4d,_0x40afd7){return new BPromise(function(_0x10d08e,_0x575883){return client[_0x941d('0xf')](_0x176430,_0x40afd7)[_0x941d('0x10')](function(_0xe0743b){logger[_0x941d('0x11')](_0x941d('0x12'),_0x1c5e4d,_0x941d('0x13'));logger['debug'](_0x941d('0x14'),_0x1c5e4d,'request\x20sent',JSON['stringify'](_0xe0743b));if(_0xe0743b[_0x941d('0x15')]){if(_0xe0743b[_0x941d('0x15')][_0x941d('0x16')]===0x1f4){logger[_0x941d('0x15')](_0x941d('0x12'),_0x1c5e4d,_0xe0743b[_0x941d('0x15')][_0x941d('0x17')]);return _0x575883(_0xe0743b[_0x941d('0x15')][_0x941d('0x17')]);}logger[_0x941d('0x15')](_0x941d('0x12'),_0x1c5e4d,_0xe0743b['error'][_0x941d('0x17')]);return _0x10d08e(_0xe0743b[_0x941d('0x15')][_0x941d('0x17')]);}else{logger[_0x941d('0x11')](_0x941d('0x12'),_0x1c5e4d,_0x941d('0x13'));_0x10d08e(_0xe0743b[_0x941d('0x18')][_0x941d('0x17')]);}})[_0x941d('0x19')](function(_0x546a7c){logger[_0x941d('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1c5e4d,_0x546a7c);_0x575883(_0x546a7c);});});}
\ No newline at end of file
+var _0x98a7=['request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x98a7,0x9e));var _0x798a=function(_0x24507f,_0x36c8c5){_0x24507f=_0x24507f-0x0;var _0x585818=_0x98a7[_0x24507f];return _0x585818;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var moment=require(_0x798a('0x2'));var BPromise=require(_0x798a('0x3'));var rs=require(_0x798a('0x4'));var fs=require('fs');var Redis=require(_0x798a('0x5'));var db=require(_0x798a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x798a('0x7'))(_0x798a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x798a('0x9')][_0x798a('0xa')]({'port':0x232a});config[_0x798a('0xb')]=_[_0x798a('0xc')](config[_0x798a('0xb')],{'host':_0x798a('0xd'),'port':0x18eb});var socket=require(_0x798a('0xe'))(new Redis(config[_0x798a('0xb')]));require('./chatGroup.socket')[_0x798a('0xf')](socket);function respondWithRpcPromise(_0x7d5847,_0x18627b,_0x167f76){return new BPromise(function(_0x5aa692,_0x3f6968){return client[_0x798a('0x10')](_0x7d5847,_0x167f76)[_0x798a('0x11')](function(_0x3a21d0){logger[_0x798a('0x12')](_0x798a('0x13'),_0x18627b,'request\x20sent');logger[_0x798a('0x14')](_0x798a('0x15'),_0x18627b,_0x798a('0x16'),JSON[_0x798a('0x17')](_0x3a21d0));if(_0x3a21d0['error']){if(_0x3a21d0[_0x798a('0x18')][_0x798a('0x19')]===0x1f4){logger['error'](_0x798a('0x13'),_0x18627b,_0x3a21d0['error'][_0x798a('0x1a')]);return _0x3f6968(_0x3a21d0[_0x798a('0x18')][_0x798a('0x1a')]);}logger[_0x798a('0x18')]('ChatGroup,\x20%s,\x20%s',_0x18627b,_0x3a21d0[_0x798a('0x18')][_0x798a('0x1a')]);return _0x5aa692(_0x3a21d0['error'][_0x798a('0x1a')]);}else{logger[_0x798a('0x12')](_0x798a('0x13'),_0x18627b,_0x798a('0x16'));_0x5aa692(_0x3a21d0[_0x798a('0x1b')][_0x798a('0x1a')]);}})[_0x798a('0x1c')](function(_0x114d59){logger[_0x798a('0x18')](_0x798a('0x13'),_0x18627b,_0x114d59);_0x3f6968(_0x114d59);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a9d0a29..d6407d9 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 _0xfedb=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0xfedb,0x11c));var _0xbfed=function(_0xd65533,_0xa3acc8){_0xd65533=_0xd65533-0x0;var _0x7a7a9b=_0xfedb[_0xd65533];return _0x7a7a9b;};'use strict';var ChatGroupEvents=require(_0xbfed('0x0'));var events=[_0xbfed('0x1'),_0xbfed('0x2'),_0xbfed('0x3')];function createListener(_0x239717,_0xb043c8){return function(_0x2a88af){_0xb043c8['emit'](_0x239717,_0x2a88af);};}function removeListener(_0x3aa197,_0x5a1350){return function(){ChatGroupEvents[_0xbfed('0x4')](_0x3aa197,_0x5a1350);};}exports[_0xbfed('0x5')]=function(_0x856235){for(var _0x2b1912=0x0,_0x2b1a4d=events[_0xbfed('0x6')];_0x2b1912<_0x2b1a4d;_0x2b1912++){var _0x363a22=events[_0x2b1912];var _0x4fe134=createListener(_0xbfed('0x7')+_0x363a22,_0x856235);ChatGroupEvents['on'](_0x363a22,_0x4fe134);}};
\ No newline at end of file
+var _0x9e39=['register','length','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x380702,_0x938482){var _0x470ecb=function(_0x2331c2){while(--_0x2331c2){_0x380702['push'](_0x380702['shift']());}};_0x470ecb(++_0x938482);}(_0x9e39,0xc2));var _0x99e3=function(_0x6aebb,_0x4107bf){_0x6aebb=_0x6aebb-0x0;var _0x13cfd6=_0x9e39[_0x6aebb];return _0x13cfd6;};'use strict';var ChatGroupEvents=require(_0x99e3('0x0'));var events=[_0x99e3('0x1'),_0x99e3('0x2'),_0x99e3('0x3')];function createListener(_0x4f614a,_0x456f67){return function(_0x2fe763){_0x456f67[_0x99e3('0x4')](_0x4f614a,_0x2fe763);};}function removeListener(_0x1b3f6f,_0x3cc2da){return function(){ChatGroupEvents[_0x99e3('0x5')](_0x1b3f6f,_0x3cc2da);};}exports[_0x99e3('0x6')]=function(_0x4dfae1){for(var _0x5f3a27=0x0,_0x407af4=events[_0x99e3('0x7')];_0x5f3a27<_0x407af4;_0x5f3a27++){var _0x44d667=events[_0x5f3a27];var _0x39fefe=createListener('chatGroup:'+_0x44d667,_0x4dfae1);ChatGroupEvents['on'](_0x44d667,_0x39fefe);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 579e561..807d34a 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 _0x3467=['getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0x3467,0x125));var _0x7346=function(_0x1cb8a0,_0x1dd309){_0x1cb8a0=_0x1cb8a0-0x0;var _0xb3c0bd=_0x3467[_0x1cb8a0];return _0xb3c0bd;};'use strict';var multer=require(_0x7346('0x0'));var util=require(_0x7346('0x1'));var path=require(_0x7346('0x2'));var timeout=require(_0x7346('0x3'));var express=require(_0x7346('0x4'));var router=express[_0x7346('0x5')]();var fs_extra=require(_0x7346('0x6'));var auth=require(_0x7346('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7346('0x8'));var controller=require('./chatGroup.controller');router[_0x7346('0x9')]('/',auth[_0x7346('0xa')](),controller[_0x7346('0xb')]);router[_0x7346('0x9')](_0x7346('0xc'),auth['isAuthenticated'](),controller[_0x7346('0xd')]);router[_0x7346('0x9')](_0x7346('0xe'),auth[_0x7346('0xa')](),controller['show']);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0x7346('0xf')]);router['get'](_0x7346('0x10'),auth[_0x7346('0xa')](),controller[_0x7346('0x11')]);router[_0x7346('0x9')](_0x7346('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7346('0x13')]('/',auth['isAuthenticated'](),controller[_0x7346('0x14')]);router[_0x7346('0x13')](_0x7346('0x10'),auth[_0x7346('0xa')](),controller[_0x7346('0x15')]);router[_0x7346('0x13')](_0x7346('0x12'),auth[_0x7346('0xa')](),controller[_0x7346('0x16')]);router['put'](_0x7346('0xe'),auth[_0x7346('0xa')](),controller[_0x7346('0x17')]);router[_0x7346('0x18')]('/:id',auth[_0x7346('0xa')](),controller[_0x7346('0x19')]);router['delete']('/:id/members',auth[_0x7346('0xa')](),controller[_0x7346('0x1a')]);module[_0x7346('0x1b')]=router;
\ No newline at end of file
+var _0x9021=['util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','destroy','exports','multer'];(function(_0x28aca9,_0x5c9543){var _0x3efdc1=function(_0x56a2d4){while(--_0x56a2d4){_0x28aca9['push'](_0x28aca9['shift']());}};_0x3efdc1(++_0x5c9543);}(_0x9021,0x81));var _0x1902=function(_0x175866,_0x1e48a6){_0x175866=_0x175866-0x0;var _0x4a561b=_0x9021[_0x175866];return _0x4a561b;};'use strict';var multer=require(_0x1902('0x0'));var util=require(_0x1902('0x1'));var path=require(_0x1902('0x2'));var timeout=require('connect-timeout');var express=require(_0x1902('0x3'));var router=express[_0x1902('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1902('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1902('0x6'));var controller=require('./chatGroup.controller');router[_0x1902('0x7')]('/',auth[_0x1902('0x8')](),controller[_0x1902('0x9')]);router[_0x1902('0x7')](_0x1902('0xa'),auth['isAuthenticated'](),controller[_0x1902('0xb')]);router[_0x1902('0x7')]('/:id',auth[_0x1902('0x8')](),controller[_0x1902('0xc')]);router['get'](_0x1902('0xd'),auth[_0x1902('0x8')](),controller[_0x1902('0xe')]);router[_0x1902('0x7')](_0x1902('0xf'),auth[_0x1902('0x8')](),controller[_0x1902('0x10')]);router[_0x1902('0x7')](_0x1902('0x11'),auth[_0x1902('0x8')](),controller[_0x1902('0x12')]);router[_0x1902('0x13')]('/',auth[_0x1902('0x8')](),controller[_0x1902('0x14')]);router[_0x1902('0x13')](_0x1902('0xf'),auth[_0x1902('0x8')](),controller[_0x1902('0x15')]);router[_0x1902('0x13')](_0x1902('0x11'),auth[_0x1902('0x8')](),controller[_0x1902('0x16')]);router[_0x1902('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x1902('0x8')](),controller[_0x1902('0x18')]);router['delete'](_0x1902('0xf'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x1902('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 bef2327..ea117f4 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 _0x6b20=['DATE','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0x3d8085,_0x4f22fe){var _0x5e3ec0=function(_0x17228f){while(--_0x17228f){_0x3d8085['push'](_0x3d8085['shift']());}};_0x5e3ec0(++_0x4f22fe);}(_0x6b20,0xd1));var _0x06b2=function(_0x318559,_0x464bb4){_0x318559=_0x318559-0x0;var _0x1ee5a2=_0x6b20[_0x318559];return _0x1ee5a2;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x06b2('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x06b2('0x3'),_0x06b2('0x4')),'defaultValue':_0x06b2('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x06b2('0x5')]},'mailTranscript':{'type':Sequelize[_0x06b2('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x06b2('0x7')]},'disposition':{'type':Sequelize[_0x06b2('0x6')]},'secondDisposition':{'type':Sequelize[_0x06b2('0x6')]},'thirdDisposition':{'type':Sequelize[_0x06b2('0x6')]},'note':{'type':Sequelize[_0x06b2('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x06b2('0x6')]},'osName':{'type':Sequelize[_0x06b2('0x6')]},'osVersion':{'type':Sequelize[_0x06b2('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x06b2('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x06b2('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x06b2('0x8'))},'read1stAt':{'type':Sequelize[_0x06b2('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x06b2('0x9')]('in',_0x06b2('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x06b2('0x6')]},'customerPort':{'type':Sequelize[_0x06b2('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x06b2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x06b2('0xb')],'defaultValue':![]}};
\ No newline at end of file
+var _0x00ea=['BOOLEAN','ENUM','star','thumb','TEXT','DATE','STRING','long','exports'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x00ea,0x19d));var _0xa00e=function(_0x17a6aa,_0x4d33bf){_0x17a6aa=_0x17a6aa-0x0;var _0x475154=_0x00ea[_0x17a6aa];return _0x475154;};'use strict';var Sequelize=require('sequelize');module[_0xa00e('0x0')]={'closed':{'type':Sequelize[_0xa00e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa00e('0x2')](_0xa00e('0x3'),_0xa00e('0x4')),'defaultValue':_0xa00e('0x3')},'ratingMessage':{'type':Sequelize[_0xa00e('0x5')]},'pathTranscript':{'type':Sequelize[_0xa00e('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa00e('0x6')]},'disposition':{'type':Sequelize[_0xa00e('0x7')]},'secondDisposition':{'type':Sequelize[_0xa00e('0x7')]},'thirdDisposition':{'type':Sequelize[_0xa00e('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa00e('0x7')]},'browserVersion':{'type':Sequelize[_0xa00e('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa00e('0x7')]},'deviceModel':{'type':Sequelize[_0xa00e('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa00e('0x7')]},'referer':{'type':Sequelize[_0xa00e('0x5')]},'customerIp':{'type':Sequelize[_0xa00e('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xa00e('0x8'))},'read1stAt':{'type':Sequelize[_0xa00e('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa00e('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa00e('0x7')]},'customerPort':{'type':Sequelize[_0xa00e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xa00e('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xa00e('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 273bcf1..2d5a38e 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 _0x087b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','render','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','include','options','catch','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','disposition','file','filename','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','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','omit','ids','getMessages','nolimit','filter','findAll','rows','getMyMessages','includeAll','addTags','setTags','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x5ab321,_0x543926){var _0x1dc03c=function(_0x3a4545){while(--_0x3a4545){_0x5ab321['push'](_0x5ab321['shift']());}};_0x1dc03c(++_0x543926);}(_0x087b,0x11a));var _0xb087=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x087b[_0x9dfc10];return _0x4f938a;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var pdf=require(_0xb087('0x15'));var hardwareService=require(_0xb087('0x16'));var logger=require(_0xb087('0x17'))(_0xb087('0x18'));var utils=require(_0xb087('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb087('0x1a'));var db=require(_0xb087('0x1b'))['db'];config[_0xb087('0x1c')]=_['defaults'](config[_0xb087('0x1c')],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1c')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);var jayson=require(_0xb087('0x21'));var client=jayson[_0xb087('0x22')][_0xb087('0x23')]({'port':0x232b});var client9004=jayson[_0xb087('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x43e576,_0x412b48,_0x597478,_0xcc4426){return new BPromise(function(_0x2b83b7,_0x2e9e74){var _0x5bb80b=_0xcc4426||client;return _0x5bb80b[_0xb087('0x24')](_0x43e576,_0x597478)[_0xb087('0x25')](function(_0x17200d){logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));logger[_0xb087('0x28')](_0xb087('0x29'),_0x412b48,_0xb087('0x27'),JSON['stringify'](_0x17200d));if(_0x17200d['error']){if(_0x17200d['error']['code']===0x1f4){logger[_0xb087('0x2a')](_0xb087('0x2b'),_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2e9e74(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}logger[_0xb087('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2b83b7(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}else{logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));_0x2b83b7(_0x17200d[_0xb087('0x2d')]['message']);}})['catch'](function(_0x50745a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x50745a);_0x2e9e74(_0x50745a);});});}function respondWithStatusCode(_0x304840,_0x45685d){_0x45685d=_0x45685d||0xcc;return function(_0x1d124f){if(_0x1d124f){return _0x304840[_0xb087('0x2e')](_0x45685d);}return _0x304840[_0xb087('0x2f')](_0x45685d)[_0xb087('0x30')]();};}function respondWithResult(_0xf3f41f,_0x35a52c){_0x35a52c=_0x35a52c||0xc8;return function(_0x6cfb22){if(_0x6cfb22){return _0xf3f41f[_0xb087('0x2f')](_0x35a52c)[_0xb087('0x31')](_0x6cfb22);}};}function respondWithFilteredResult(_0x31e3e6,_0xb0baf6){return function(_0x263259){if(_0x263259){var _0x593b78=typeof _0xb0baf6[_0xb087('0x32')]===_0xb087('0x33')&&typeof _0xb0baf6[_0xb087('0x34')]===_0xb087('0x33');var _0x22d441=_0x263259[_0xb087('0x35')];var _0x2e1c57=_0x593b78?0x0:_0xb0baf6[_0xb087('0x32')];var _0x53a535=_0x593b78?_0x263259['count']:_0xb0baf6[_0xb087('0x32')]+_0xb0baf6[_0xb087('0x34')];var _0x4cb5a8;if(_0x53a535>=_0x22d441){_0x53a535=_0x22d441;_0x4cb5a8=0xc8;}else{_0x4cb5a8=0xce;}_0x31e3e6[_0xb087('0x2f')](_0x4cb5a8);return _0x31e3e6[_0xb087('0x36')](_0xb087('0x37'),_0x2e1c57+'-'+_0x53a535+'/'+_0x22d441)[_0xb087('0x31')](_0x263259);}return null;};}function patchUpdates(_0x3c61c4){return function(_0x427905){try{jsonpatch[_0xb087('0x38')](_0x427905,_0x3c61c4,!![]);}catch(_0x3b7ace){return BPromise[_0xb087('0x39')](_0x3b7ace);}return _0x427905[_0xb087('0x3a')]();};}function saveUpdates(_0x442a5e,_0x3069b5){return function(_0x57ae94){if(_0x57ae94){return _0x57ae94[_0xb087('0x3b')](_0x442a5e)['then'](function(_0x906987){return _0x906987;});}return null;};}function removeEntity(_0x296e9b,_0x738e68){return function(_0xd0659e){if(_0xd0659e){return _0xd0659e[_0xb087('0x3c')]()[_0xb087('0x25')](function(){_0x296e9b[_0xb087('0x2f')](0xcc)[_0xb087('0x30')]();});}};}function handleEntityNotFound(_0x8a4c3c,_0x521c3f){return function(_0x5814c2){if(!_0x5814c2){_0x8a4c3c[_0xb087('0x2e')](0x194);}return _0x5814c2;};}function handleError(_0x3c4f33,_0x1ce1ef){_0x1ce1ef=_0x1ce1ef||0x1f4;return function(_0x2d2902){logger[_0xb087('0x2a')](_0x2d2902['stack']);if(_0x2d2902[_0xb087('0x3d')]){delete _0x2d2902[_0xb087('0x3d')];}_0x3c4f33['status'](_0x1ce1ef)['send'](_0x2d2902);};}function getMustacheRender(_0x1726c2,_0x1c7d90){return Mustache[_0xb087('0x3e')](_0x1726c2,_['merge'](_0x1c7d90[_0xb087('0x3f')],{'contact':_0x1c7d90[_0xb087('0x40')],'message':_0x1c7d90[_0xb087('0x2c')],'agent':_0x1c7d90[_0xb087('0x41')],'interaction':_0x1c7d90[_0xb087('0x42')],'account':_0x1c7d90['account']}))||'';}function getInteractionUsers(_0x7e1315,_0x5bb6bc){return new BPromise(function(_0x18e23f,_0x5a582d){try{if(_0x5bb6bc[_0x7e1315['id']]){_0x7e1315[_0xb087('0x43')]=_[_0xb087('0x44')](_0x5bb6bc[_0x7e1315['id']],function(_0x513332){return{'id':_0x513332['id'],'fullname':_0x513332[_0xb087('0x45')]};});}}catch(_0x5aa11d){_0x5a582d(_0x5aa11d);}_0x18e23f(_0x7e1315);});}function getInteractionTags(_0x46d12a,_0x4a360c){return new BPromise(function(_0x2d2c74,_0x326934){try{if(_0x46d12a[_0xb087('0x46')]){_0x46d12a[_0xb087('0x47')]=[];_0x46d12a[_0xb087('0x46')][_0xb087('0x48')](',')[_0xb087('0x49')](function(_0x5e7690){_0x46d12a[_0xb087('0x47')]['push'](_0x4a360c[_0x5e7690]);});}delete _0x46d12a[_0xb087('0x46')];}catch(_0x2d71c2){_0x326934(_0x2d71c2);}_0x2d2c74(_0x46d12a);});}function updateChatInteraction(_0x5b6924,_0xb662bf,_0x45dc6f){return new BPromise(function(_0x7650c5,_0x4c33cc){return getInteractionUsers(_0x5b6924,_0x45dc6f)[_0xb087('0x25')](function(_0x4a9ccb){return getInteractionTags(_0x4a9ccb,_0xb662bf);})[_0xb087('0x25')](function(_0x32b9d3){_0x7650c5(_0x32b9d3);})['catch'](function(_0x38cb9d){_0x4c33cc(_0x38cb9d);});});}exports[_0xb087('0x4a')]=function(_0x4addbd,_0x2b969a){var _0x171778={},_0x54eb11={},_0x93ada7={'count':0x0,'rows':[]};var _0x46c713=_[_0xb087('0x44')](db[_0xb087('0x4b')]['rawAttributes'],function(_0x47902e){return{'name':_0x47902e[_0xb087('0x4c')],'type':_0x47902e[_0xb087('0x4d')][_0xb087('0x4e')]};});_0x54eb11[_0xb087('0x4f')]=_[_0xb087('0x44')](_0x46c713,_0xb087('0x3d'));_0x54eb11['query']=_['keys'](_0x4addbd[_0xb087('0x50')]);_0x54eb11['filters']=_[_0xb087('0x51')](_0x54eb11[_0xb087('0x4f')],_0x54eb11[_0xb087('0x50')]);_0x171778[_0xb087('0x52')]=_['intersection'](_0x54eb11[_0xb087('0x4f')],qs['fields'](_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]));_0x171778[_0xb087('0x52')]=_0x171778[_0xb087('0x52')][_0xb087('0x54')]?_0x171778['attributes']:_0x54eb11[_0xb087('0x4f')];if(!_0x4addbd[_0xb087('0x50')][_0xb087('0x55')]('nolimit')){_0x171778[_0xb087('0x34')]=qs['limit'](_0x4addbd['query'][_0xb087('0x34')]);_0x171778[_0xb087('0x32')]=qs['offset'](_0x4addbd[_0xb087('0x50')][_0xb087('0x32')]);}_0x171778[_0xb087('0x56')]=qs['sort'](_0x4addbd['query'][_0xb087('0x57')]);_0x171778['where']=qs['filters'](_[_0xb087('0x58')](_0x4addbd[_0xb087('0x50')],_0x54eb11[_0xb087('0x59')]),_0x46c713);var _0x4067cf=[];var _0x2bf92f=squel[_0xb087('0x5a')]()[_0xb087('0x5b')]('id')[_0xb087('0x5b')](_0xb087('0x3d'))[_0xb087('0x5b')](_0xb087('0x5c'))[_0xb087('0x5d')]('tools_tags');var _0x46d570=squel[_0xb087('0x5a')]()['field'](_0xb087('0x5e'))[_0xb087('0x5b')](_0xb087('0x5f'))[_0xb087('0x5b')](_0xb087('0x60'))[_0xb087('0x5d')](_0xb087('0x61'),'ui')[_0xb087('0x62')](_0xb087('0x63'),'u',_0xb087('0x64'));var _0x17c6d0=squel['select']()[_0xb087('0x5d')]('chat_interactions','i')[_0xb087('0x62')]('cm_contacts','c',_0xb087('0x65'))[_0xb087('0x62')](_0xb087('0x63'),'o',_0xb087('0x66'))[_0xb087('0x62')](_0xb087('0x67'),'a',_0xb087('0x68'))[_0xb087('0x62')](_0xb087('0x69'),'me',_0xb087('0x6a'))[_0xb087('0x62')](_0xb087('0x6b'),'it',_0xb087('0x6c'))[_0xb087('0x62')](_0xb087('0x6d'),'t',_0xb087('0x6e'));var _0x217f26=squel[_0xb087('0x6f')]();var _0x40ff74=[];var _0xe3cb2=squel[_0xb087('0x6f')]();var _0x459c5b;if(_0x4addbd['query'][_0xb087('0x70')]){_0x459c5b=as[_0xb087('0x71')](_0x4addbd[_0xb087('0x50')]['search']);var _0x4099cc=_0x459c5b[_0xb087('0x72')];for(var _0x5685b1=0x0;_0x5685b1<_0x459c5b[_0xb087('0x73')][_0xb087('0x54')];_0x5685b1++){var _0x2e3a14=_0x459c5b['conditions'][_0x5685b1];var _0x133c58='i';var _0x257894=_[_0xb087('0x74')](_0x46c713,[_0xb087('0x3d'),_0x2e3a14[_0xb087('0x5b')]]);if(!_0x257894){switch(_0x2e3a14[_0xb087('0x5b')]){case _0xb087('0x75'):if(_0x2e3a14[_0xb087('0x76')]==0x1){_0x17c6d0['having']('`'+_0x2e3a14[_0xb087('0x5b')]+_0xb087('0x77'));}else{_0x17c6d0[_0xb087('0x78')]('`'+_0x2e3a14['field']+_0xb087('0x79'));}break;case'Contact':if(_0x2e3a14['operator']===_0xb087('0x7a')){if(_0x2e3a14[_0xb087('0x76')]['split']('\x20')[_0xb087('0x54')]>0x1){_0x217f26[_0x4099cc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb087('0x7b')](_0x2e3a14[_0xb087('0x76')]),null);}else{var _0x5938ad='%'+_0x2e3a14['value']+'%';_0x217f26[_0x4099cc](_0xb087('0x7c'),_0x5938ad,_0x5938ad,_0x5938ad);}}else{_0x257894=_['find'](_0x46c713,['name',_0xb087('0x7d')]);_0x2e3a14['field']=_0xb087('0x7d');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case'Tag':var _0x200869=_0x2e3a14['value'][_0xb087('0x48')](',')[_0xb087('0x44')](function(_0x1060e1){return Number(_0x1060e1);});_0x200869['forEach'](function(_0x298bbb){_0xe3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298bbb+',%');});_0x40ff74=_[_0xb087('0x80')](_0x40ff74,_0x200869);break;case _0xb087('0x81'):if(_0x2e3a14[_0xb087('0x82')]===_0xb087('0x7a')){_0x217f26[_0x4099cc](_0xb087('0x83'),'%'+_0x2e3a14[_0xb087('0x76')]+'%',null);}else{_0x257894=_['find'](_0x46c713,[_0xb087('0x3d'),_0xb087('0x84')]);_0x2e3a14['field']=_0xb087('0x84');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case _0xb087('0x3f'):_0x390309=as[_0xb087('0x85')]('me',null,_0x2e3a14);_0x217f26[_0x4099cc](_0x390309['text'],_0x390309['value']['start'],_0x390309[_0xb087('0x76')]['end']);break;}}else{var _0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309['value'][_0xb087('0x30')]);}}}else{var _0x53f04a=_(_0x4addbd[_0xb087('0x50')])[_0xb087('0x86')]()[_0xb087('0x44')](function(_0x42f4a3){return _['some'](_0x46c713,['name',_0x42f4a3])?_0x42f4a3:undefined;})[_0xb087('0x87')]()['value']();if(!_[_0xb087('0x88')](_0x53f04a)){_0x53f04a[_0xb087('0x49')](function(_0x2ca987){if(_0x2ca987===_0xb087('0x89')){_0x17c6d0['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xb087('0x8a')](_0x4addbd['query'][_0x2ca987]));}else if(_0x2ca987===_0xb087('0x8b')){var _0x1c7cd7=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])[_0xb087('0x8d')];var _0x581ad4=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])['$lte'];_0x17c6d0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c7cd7,_0x581ad4);}else{if(_0x4addbd[_0xb087('0x50')][_0x2ca987]===_0xb087('0x8e')){_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x90'));}else{_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x91'),_0x4addbd['query'][_0x2ca987]);}}});}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]==0x1){_0x17c6d0[_0xb087('0x78')](_0xb087('0x93'));}else{_0x17c6d0[_0xb087('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]){_0x40ff74=_[_0xb087('0x95')](_0x4addbd['query'][_0xb087('0x94')])?_0x4addbd['query'][_0xb087('0x94')]:new Array(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]);_0x40ff74[_0xb087('0x49')](function(_0x463791){_0xe3cb2['or'](_0xb087('0x96'),'%,'+_0x463791+',%');});}if(_0x4addbd['query']['filter']){var _0x1e7a22=_0x4addbd[_0xb087('0x50')]['filter'][_0xb087('0x97')]('\x5c','\x5c\x5c')[_0xb087('0x97')](/'/g,'\x27\x27');if(qs[_0xb087('0x98')](_0x1e7a22)){_0x217f26['or'](_0xb087('0x99'),_0x1e7a22+'%');}else{_0x217f26['or'](_0xb087('0x9a'),qs[_0xb087('0x7b')](_0x1e7a22))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e7a22+'%');}}}_0x17c6d0[_0xb087('0x8f')](_0x217f26);_0x17c6d0[_0xb087('0x9b')](_0xb087('0x9c'));var _0x3114ce={'type':db[_0xb087('0x9d')][_0xb087('0x9e')][_0xb087('0x9f')],'raw':!![]};var _0x1fc613=_0x17c6d0[_0xb087('0xa0')]();_0x1fc613['field'](_0xb087('0x9c'));_0x1fc613['field'](_0xb087('0xa1'),_0xb087('0x75'));if(_0x171778['order']){_0x171778[_0xb087('0x56')][_0xb087('0x49')](function(_0x8b1a5b){var _0x2a076b=_0x8b1a5b[0x0]===_0xb087('0xa2')?_0x8b1a5b[0x0]:'i.'+_0x8b1a5b[0x0];_0x17c6d0[_0xb087('0x56')](_0x2a076b,_0x8b1a5b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb087('0x88')](_0x40ff74)){_0x17c6d0[_0xb087('0x78')](_0xe3cb2);_0x1fc613[_0xb087('0x8f')](_0xb087('0xa3'),_0x40ff74);}BPromise[_0xb087('0xa4')]()['then'](function(){if(!_0x459c5b){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x89')])return;_0x1fc613[_0xb087('0x8f')](_0xb087('0xa5'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa5'));return;}if(_0x4addbd[_0xb087('0xa6')][_0xb087('0xa7')]!==_0xb087('0x41'))return;return _0x4addbd[_0xb087('0xa6')][_0xb087('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59121a){if(_[_0xb087('0x88')](_0x59121a)){_0x1fc613[_0xb087('0x8f')](_0xb087('0xa9'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa9'));}else{_0x1fc613['where'](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));}});})[_0xb087('0x25')](function(){if(_0x4addbd['user'][_0xb087('0xa7')]==='agent'&&!_0x459c5b&&!_0x4addbd['query'][_0xb087('0x89')])return[];return db[_0xb087('0xab')][_0xb087('0x50')](_0x1fc613[_0xb087('0xac')](),_0x3114ce);})['then'](function(_0x313c9b){_0x93ada7[_0xb087('0x35')]=_0x313c9b['length'];if(_0x93ada7[_0xb087('0x35')]===0x0)return[];return db['sequelize']['query'](_0x2bf92f[_0xb087('0xac')](),_0x3114ce)[_0xb087('0x25')](function(_0x414cb4){_0x4067cf=_[_0xb087('0xad')](_0x414cb4,'id');_0x3114ce=_[_0xb087('0xae')](_0x3114ce,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]){_0x171778[_0xb087('0x52')][_0xb087('0x49')](function(_0x48e2c6){_0x17c6d0['field']('i.'+_0x48e2c6);});}else{_0x17c6d0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb087('0x75'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xaf'),_0xb087('0xb0'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb1'),_0xb087('0xb2'));_0x17c6d0['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',_0xb087('0xa2'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb3'));_0x17c6d0[_0xb087('0x5b')]('c.firstName',_0xb087('0xb4'));_0x17c6d0['field'](_0xb087('0xb5'),'Contact.lastName');_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb6'),_0xb087('0xb7'));_0x17c6d0[_0xb087('0x5b')]('c.phone',_0xb087('0xb8'));_0x17c6d0['field']('c.mobile','Contact.mobile');_0x17c6d0[_0xb087('0x5b')]('c.fax',_0xb087('0xb9'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xba'),_0xb087('0xbb'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbc'),_0xb087('0xbd'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbe'),_0xb087('0x46'));}if(_0x171778[_0xb087('0x34')])_0x17c6d0[_0xb087('0x34')](_0x171778[_0xb087('0x34')]);if(_0x171778[_0xb087('0x32')])_0x17c6d0[_0xb087('0x32')](_0x171778[_0xb087('0x32')]);return db[_0xb087('0xab')][_0xb087('0x50')](_0x17c6d0['toString'](),_0x3114ce);})[_0xb087('0x25')](function(_0x5c2a14){if(_0x5c2a14[_0xb087('0x54')]>0x0)_0x46d570[_0xb087('0x8f')](_0xb087('0xbf'),_[_0xb087('0x44')](_0x5c2a14,'id'));return db[_0xb087('0xab')][_0xb087('0x50')](_0x46d570[_0xb087('0xac')](),_0x3114ce)['then'](function(_0x5103ab){var _0x5194f2=_[_0xb087('0xc0')](_0x5103ab,_0xb087('0xc1'));var _0x3a403f=[];_0x5c2a14[_0xb087('0x49')](function(_0x18b90b){_0x3a403f[_0xb087('0xc2')](updateChatInteraction(_0x18b90b,_0x4067cf,_0x5194f2));});return BPromise[_0xb087('0xc3')](_0x3a403f);});});})[_0xb087('0x25')](function(_0x181c56){_0x93ada7['rows']=_0x181c56;return _0x93ada7;})[_0xb087('0x25')](respondWithFilteredResult(_0x2b969a,_0x171778))['catch'](handleError(_0x2b969a,null));};exports[_0xb087('0xc4')]=function(_0x25910a,_0x597d80){var _0x4c3aef={'raw':![],'where':{'id':_0x25910a[_0xb087('0xc5')]['id']}},_0x2f2597={};_0x2f2597[_0xb087('0x4f')]=_[_0xb087('0x86')](db['ChatInteraction'][_0xb087('0xc6')]);_0x2f2597[_0xb087('0x50')]=_['keys'](_0x25910a['query']);_0x2f2597[_0xb087('0x59')]=_['intersection'](_0x2f2597['model'],_0x2f2597[_0xb087('0x50')]);_0x4c3aef['attributes']=_[_0xb087('0x51')](_0x2f2597[_0xb087('0x4f')],qs[_0xb087('0x53')](_0x25910a[_0xb087('0x50')][_0xb087('0x53')]));_0x4c3aef[_0xb087('0x52')]=_0x4c3aef[_0xb087('0x52')][_0xb087('0x54')]?_0x4c3aef['attributes']:_0x2f2597[_0xb087('0x4f')];if(_0x25910a['query']['includeAll']){_0x4c3aef[_0xb087('0xc7')]=[{'all':!![]}];}_0x4c3aef=_[_0xb087('0xae')]({},_0x4c3aef,_0x25910a[_0xb087('0xc8')]);return db['ChatInteraction'][_0xb087('0x74')](_0x4c3aef)[_0xb087('0x25')](handleEntityNotFound(_0x597d80,null))[_0xb087('0x25')](respondWithResult(_0x597d80,null))[_0xb087('0xc9')](handleError(_0x597d80,null));};exports['create']=function(_0x1f3ecb,_0x3e865d){return db[_0xb087('0x4b')][_0xb087('0xca')](_0x1f3ecb[_0xb087('0x3f')],{})[_0xb087('0x25')](respondWithResult(_0x3e865d,0xc9))[_0xb087('0xc9')](handleError(_0x3e865d,null));};exports['update']=function(_0x1de68b,_0xfc3490){if(_0x1de68b[_0xb087('0x3f')]['id']){delete _0x1de68b[_0xb087('0x3f')]['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1de68b['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xfc3490,null))[_0xb087('0x25')](saveUpdates(_0x1de68b[_0xb087('0x3f')],null))['then'](respondWithResult(_0xfc3490,null))['catch'](handleError(_0xfc3490,null));};exports[_0xb087('0x3c')]=function(_0x12c676,_0xee09f5){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x12c676[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xee09f5,null))[_0xb087('0x25')](removeEntity(_0xee09f5,null))[_0xb087('0xc9')](handleError(_0xee09f5,null));};exports[_0xb087('0xcb')]=function(_0x5ef263,_0x1a7486){return db[_0xb087('0x4b')][_0xb087('0xcb')]()[_0xb087('0x25')](respondWithResult(_0x1a7486,null))[_0xb087('0xc9')](handleError(_0x1a7486,null));};exports['createVidaooSession']=function(_0x33756c,_0x2e8eb1){var _0x189e0a=_0x33756c[_0xb087('0xc5')]['id'];var _0x52268a;var _0x259ac0;var _0x547968;return db[_0xb087('0x4b')]['findOne']({'where':{'id':_0x189e0a}})['then'](function(_0x321da9){_0x52268a=_0x321da9;return db[_0xb087('0xcc')][_0xb087('0xcd')]({'where':{'id':_0x321da9['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xb087('0xce'),_0xb087('0xcf'),_0xb087('0xd0'),_0xb087('0xd1')],'raw':!![]});})[_0xb087('0x25')](function(_0x48a94f){if(_0x48a94f&&_0x48a94f[_0xb087('0xd2')]&&_0x48a94f[_0xb087('0xce')]){_0x259ac0=_0x48a94f;var _0x290338={'interaction':{'id':_0x189e0a},'agent':{'id':_0x33756c[_0xb087('0xa6')]['id'],'name':_0x33756c[_0xb087('0xa6')][_0xb087('0x3d')],'fullname':_0x33756c['user']['fullname'],'email':_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]},'contact':_0x33756c['body'][_0xb087('0x40')],'account':_0x33756c['body']['account']};var _0x471c54={'rejectUnauthorized':![],'method':_0xb087('0xd4'),'url':_0xb087('0xd5'),'headers':{'X-APIKEY':_0x48a94f[_0xb087('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]],'buttons':null,'topic':_0x259ac0[_0xb087('0xcf')],'note':_[_0xb087('0xd6')](_0x259ac0[_0xb087('0xd0')])?null:getMustacheRender(_0x259ac0[_0xb087('0xd0')],_0x290338),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x259ac0['vidaooMetadata'])){var _0x2ebe58=getMustacheRender(_0x259ac0['vidaooMetadata'],_0x290338);var _0x173a1b=JSON['parse'](_0x2ebe58);_0x471c54['body'][_0xb087('0xd7')]=_0x173a1b;}}catch(_0x2e3036){throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xd9'));}return rp(_0x471c54);}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xda'));}})[_0xb087('0x25')](function(_0x2fdcee){_0x547968=_0x2fdcee;if(_0x547968['id']){var _0x5ae13d={'body':_0x547968[_0xb087('0xdb')],'ChatWebsiteId':_0x259ac0['id'],'ChatInteractionId':_0x52268a['id'],'direction':'out','UserId':_0x33756c[_0xb087('0xa6')]['id']};return db[_0xb087('0xdc')]['create'](_0x5ae13d,{});}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52268a[_0xb087('0xdd')]({'vidaooSessionId':_0x547968['id']});})['then'](respondWithResult(_0x2e8eb1,null))[_0xb087('0xc9')](handleError(_0x2e8eb1,null));};exports['customUpdate']=function(_0x1e04ff,_0x1a99a3){if(_0x1e04ff[_0xb087('0x3f')]['id']){delete _0x1e04ff['body']['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1e04ff[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xde')],'as':_0xb087('0xdf')}]})[_0xb087('0x25')](handleEntityNotFound(_0x1a99a3,null))[_0xb087('0x25')](saveUpdates(_0x1e04ff[_0xb087('0x3f')],null))[_0xb087('0x25')](respondWithResult(_0x1a99a3,null))[_0xb087('0xc9')](handleError(_0x1a99a3,null));};exports['abandon']=function(_0x3a5432,_0x520aa9,_0x31d03d){if(_0x3a5432[_0xb087('0x3f')]['id']){delete _0x3a5432[_0xb087('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3a5432['params']['id']}})[_0xb087('0x25')](function(_0xfaa17f){if(!_0xfaa17f){logger[_0xb087('0x2a')](_0xb087('0xe0'),_0xb087('0xe1'),0x194,_0xb087('0xe2'));_0x520aa9[_0xb087('0x2e')](0x194);}else{if(_0xfaa17f['UserId']){throw new db[(_0xb087('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfaa17f;})['then'](function(_0x4cde01){if(_0x4cde01){return _0x4cde01[_0xb087('0x3b')]({'closed':_0x3a5432[_0xb087('0x3f')]['closed'],'disposition':_0x3a5432[_0xb087('0x3f')][_0xb087('0xe3')]})[_0xb087('0x25')](function(_0x500a2b){return _0x500a2b;});}})[_0xb087('0x25')](function(_0x11a1a5){return respondWithRpcPromise('AbandonInteraction',_0xb087('0xe1'),_0x3a5432[_0xb087('0x3f')],client9004);})[_0xb087('0x25')](respondWithResult(_0x520aa9,null))[_0xb087('0xc9')](handleError(_0x520aa9,null));};exports['attachmentUpload']=function(_0x270e65,_0x10c680,_0x164371){_0x270e65[_0xb087('0x3f')][_0xb087('0x3d')]=_0x270e65[_0xb087('0xe4')]['originalname'];_0x270e65[_0xb087('0x3f')]['basename']=_0x270e65[_0xb087('0xe4')][_0xb087('0xe5')];_0x270e65['body'][_0xb087('0x4d')]=_0x270e65['file']['mimetype'];return db['Attachment'][_0xb087('0xca')](_0x270e65[_0xb087('0x3f')])[_0xb087('0x25')](respondWithResult(_0x10c680,0xc9))[_0xb087('0xc9')](handleError(_0x10c680,null));};exports[_0xb087('0xe6')]=function(_0x1e0751,_0x2831b4,_0x218fe3){return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1e0751['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2831b4,null))[_0xb087('0x25')](function(_0x1babd3){if(_0x1babd3){if(_0x1babd3[_0xb087('0xe7')]){return _0x2831b4['status'](0x193)['json']({'status':0x193,'message':_0xb087('0xe8')});}return db[_0xb087('0xe9')][_0xb087('0xcd')]({'where':{'id':_0x1e0751[_0xb087('0x50')][_0xb087('0xea')]},'raw':!![]})[_0xb087('0x25')](handleEntityNotFound(_0x2831b4,null));}})['then'](function(_0x52341e){if(_0x52341e){var _0x54eed6=_0x52341e[_0xb087('0xeb')]!==null;var _0x12d277=path[_0xb087('0xec')](config[_0xb087('0xed')],'server/files/attachments/');if(_0x54eed6){_0x12d277=path[_0xb087('0xec')](_0x12d277,_0xb087('0xee'));}var _0x1b5422=path[_0xb087('0xec')](_0x12d277,_0x52341e[_0xb087('0xef')]);return _0x2831b4[_0xb087('0xf0')](_0x1b5422);}})[_0xb087('0xc9')](handleError(_0x2831b4,null));};exports[_0xb087('0xf1')]=function(_0x120012,_0x385065){var _0x56e768=null;var _0x5a2142=null;var _0x24171a=null;var _0x39577d=null;if(_0x120012[_0xb087('0x3f')]['id']){delete _0x120012[_0xb087('0x3f')]['id'];}if(_0x120012[_0xb087('0x3f')][_0xb087('0xf2')]){_0x39577d=path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0xf3'),util[_0xb087('0xf4')](_0xb087('0xf5'),Date[_0xb087('0xf6')]()));_0x120012[_0xb087('0x3f')][_0xb087('0xf7')]=_0x39577d;}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x120012[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xdc')],'as':_0xb087('0xf8'),'include':[{'model':db[_0xb087('0x81')],'as':_0xb087('0x81')}]}]})[_0xb087('0x25')](handleEntityNotFound(_0x385065,null))[_0xb087('0x25')](saveUpdates(_0x120012[_0xb087('0x3f')],null))[_0xb087('0x25')](function(_0x365d41){if(_0x365d41){_0x56e768=_0x365d41;return db[_0xb087('0xcc')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x89')]}});}})[_0xb087('0x25')](function(_0x159082){if(_0x159082){_0x24171a=_0x159082;return db[_0xb087('0xde')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x7d')]}});}})[_0xb087('0x25')](function(_0x2d8c34){if(_0x2d8c34){_0x5a2142=_0x2d8c34;if(_0x39577d){var _0x5a50a1=null;for(var _0x57186a=0x1;_0x57186a<_0x56e768['Messages'][_0xb087('0x54')];++_0x57186a){_0x5a50a1=_0x56e768[_0xb087('0xf8')][_0x57186a];var _0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util['format'](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');var _0x39f701=_0x120012[_0xb087('0x3f')][_0xb087('0xfc')]||util[_0xb087('0xf4')](_0xb087('0xf9'),_0xb087('0xfd'),_0x5a50a1[_0xb087('0x7d')]);switch(_0x24171a['agentIdentifier']){case _0xb087('0xfe'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a['agentAlias'],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');break;case _0xb087('0xff'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x100')]||_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;case _0xb087('0x101'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;default:_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1['UserId']):_0xb087('0xfb');}var _0x2c85ed=util[_0xb087('0xf4')](_0xb087('0x102'),moment(_0x5a50a1['createdAt'])[_0xb087('0xf4')](_0xb087('0x103')),_0x5a50a1[_0xb087('0x104')]==='in'?_0x39f701:_0x4cbc90,_0x5a50a1[_0xb087('0x3f')]);if(!_0x5a50a1[_0xb087('0x105')]){fs['appendFileSync'](_0x39577d,_0x2c85ed);}}return db[_0xb087('0x106')][_0xb087('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0xb087('0x107')],'as':_0xb087('0x108'),'raw':!![]}]});}}})[_0xb087('0x25')](function(_0x17ad89){if(_0x17ad89&&_0x17ad89[_0xb087('0x108')]&&_0x120012[_0xb087('0x3f')]){var _0x58a76b={'tls':{'rejectUnauthorized':![]}};if(_0x17ad89[_0xb087('0x108')][_0xb087('0x109')]){_0x58a76b['service']=_0x17ad89[_0xb087('0x108')][_0xb087('0x109')];}else{_0x58a76b['host']=_0x17ad89[_0xb087('0x108')][_0xb087('0x10a')];_0x58a76b[_0xb087('0x10b')]=_0x17ad89[_0xb087('0x108')][_0xb087('0x10b')];_0x58a76b[_0xb087('0x10c')]=_0x17ad89[_0xb087('0x108')]['secure'];}if(_0x17ad89[_0xb087('0x108')][_0xb087('0x10d')]){_0x58a76b[_0xb087('0x10e')]={'user':_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')],'pass':_0x17ad89[_0xb087('0x108')]['pass']};}return respondWithRpcPromise(_0xb087('0x10f'),_0xb087('0x110'),{'account':_0x58a76b,'message':{'from':util[_0xb087('0xf4')](_0xb087('0x111'),_0x17ad89[_0xb087('0x3d')],_0x17ad89['email']||_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')]),'to':_0x120012[_0xb087('0x3f')]['mailTranscript'],'subject':_0xb087('0x112'),'text':util['format'](_0xb087('0x113'),_0x120012['body'][_0xb087('0xf2')]),'attachments':[{'path':_0x39577d}]}})['then'](function(){return _0x56e768;})[_0xb087('0xc9')](function(_0x3d916e){console['error'](_0x3d916e);});}else{return _0x56e768;}})[_0xb087('0x25')](respondWithStatusCode(_0x385065,0xc8))['catch'](handleError(_0x385065,null));};exports['addMessage']=function(_0x5180ad,_0x396660,_0x4b2169){return db[_0xb087('0xdc')]['find']({'where':{'id':_0x5180ad['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x396660,null))[_0xb087('0x25')](function(_0x371655){if(_0x371655){return _0x371655[_0xb087('0x114')](_0x5180ad[_0xb087('0x3f')]['ids'],_[_0xb087('0x115')](_0x5180ad[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{});}})[_0xb087('0x25')](respondWithResult(_0x396660,null))[_0xb087('0xc9')](handleError(_0x396660,null));};exports[_0xb087('0x117')]=function(_0x1ca818,_0x2ec638,_0x57d42a){var _0x451c8a={'raw':![],'where':{}};var _0x3768db={};var _0x1db8ba={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1ca818[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x2ec638,null))['then'](function(_0x4904ea){if(_0x4904ea){_0x3768db[_0xb087('0x4f')]=_[_0xb087('0x86')](db[_0xb087('0xdc')][_0xb087('0xc6')]);_0x3768db['query']=_[_0xb087('0x86')](_0x1ca818[_0xb087('0x50')]);_0x3768db[_0xb087('0x59')]=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],_0x3768db['query']);_0x451c8a['attributes']=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],qs['fields'](_0x1ca818[_0xb087('0x50')][_0xb087('0x53')]));_0x451c8a[_0xb087('0x52')]=_0x451c8a[_0xb087('0x52')][_0xb087('0x54')]?_0x451c8a[_0xb087('0x52')]:_0x3768db[_0xb087('0x4f')];if(!_0x1ca818['query'][_0xb087('0x55')](_0xb087('0x118'))){_0x451c8a[_0xb087('0x34')]=qs['limit'](_0x1ca818['query'][_0xb087('0x34')]);_0x451c8a[_0xb087('0x32')]=qs[_0xb087('0x32')](_0x1ca818[_0xb087('0x50')]['offset']);}_0x451c8a[_0xb087('0x56')]=qs[_0xb087('0x57')](_0x1ca818[_0xb087('0x50')]['sort']);_0x451c8a['where']=qs[_0xb087('0x59')](_['pick'](_0x1ca818[_0xb087('0x50')],_0x3768db[_0xb087('0x59')]));_0x451c8a['where']['ChatInteractionId']=_0x4904ea['id'];if(_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]){_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a['where'],{'$or':_[_0xb087('0x44')](_0x451c8a['attributes'],function(_0x52cc1a){var _0x117552={};_0x117552[_0x52cc1a]={'$like':'%'+_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]+'%'};return _0x117552;})});}if(_0x1ca818[_0xb087('0x50')][_0xb087('0x8d')]){var _0x484bb5=_0x1ca818[_0xb087('0x50')]['$gte']['split'](',');var _0x46f8cf={};_0x46f8cf[_0x484bb5[0x0]]={'$gte':moment(_0x484bb5[0x1])[_0xb087('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a[_0xb087('0x8f')],_0x46f8cf);}_0x451c8a=_[_0xb087('0xae')]({},_0x451c8a,_0x1ca818['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x451c8a[_0xb087('0x8f')]})[_0xb087('0x25')](function(_0x2c3d1b){_0x1db8ba['count']=_0x2c3d1b;if(_0x1ca818['query']['includeAll']){_0x451c8a[_0xb087('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb087('0x11a')](_0x451c8a);})[_0xb087('0x25')](function(_0x4c1577){_0x1db8ba[_0xb087('0x11b')]=_0x4c1577;return _0x1db8ba;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x2ec638,_0x451c8a))[_0xb087('0xc9')](handleError(_0x2ec638,null));};exports[_0xb087('0x11c')]=function(_0xad3eae,_0xb6682a,_0x1dbeb1){var _0x2caa79={'where':{}},_0x521e0c={},_0x1ffbd9={'count':0x0,'rows':[]};return db[_0xb087('0x4b')][_0xb087('0xcd')]({'where':{'id':_0xad3eae['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xb6682a,null))[_0xb087('0x25')](function(_0x3fd51b){if(_0x3fd51b){_0x521e0c[_0xb087('0x4f')]=_['keys'](db['ChatMessage'][_0xb087('0xc6')]);_0x521e0c[_0xb087('0x50')]=_[_0xb087('0x86')](_0xad3eae[_0xb087('0x50')]);_0x521e0c[_0xb087('0x59')]=_[_0xb087('0x51')](_0x521e0c['model'],_0x521e0c['query']);_0x2caa79[_0xb087('0x52')]=_[_0xb087('0x51')](_0x521e0c[_0xb087('0x4f')],qs[_0xb087('0x53')](_0xad3eae['query'][_0xb087('0x53')]));_0x2caa79[_0xb087('0x52')]=_0x2caa79[_0xb087('0x52')][_0xb087('0x54')]?_0x2caa79[_0xb087('0x52')]:_0x521e0c[_0xb087('0x4f')];if(!_0xad3eae[_0xb087('0x50')][_0xb087('0x55')](_0xb087('0x118'))){_0x2caa79[_0xb087('0x34')]=qs[_0xb087('0x34')](_0xad3eae[_0xb087('0x50')][_0xb087('0x34')]);_0x2caa79[_0xb087('0x32')]=qs[_0xb087('0x32')](_0xad3eae[_0xb087('0x50')][_0xb087('0x32')]);}_0x2caa79[_0xb087('0x56')]=qs[_0xb087('0x57')](_0xad3eae[_0xb087('0x50')]['sort']);_0x2caa79[_0xb087('0x8f')]=qs[_0xb087('0x59')](_['pick'](_0xad3eae[_0xb087('0x50')],_0x521e0c[_0xb087('0x59')]));_0x2caa79[_0xb087('0x8f')]['ChatInteractionId']=_0x3fd51b['id'];if(_0xad3eae[_0xb087('0x50')]['filter']){_0x2caa79['where']=_[_0xb087('0xae')](_0x2caa79[_0xb087('0x8f')],{'$or':_[_0xb087('0x44')](_0x2caa79[_0xb087('0x52')],function(_0x4a1749){var _0x300e08={};_0x300e08[_0x4a1749]={'$like':'%'+_0xad3eae['query'][_0xb087('0x119')]+'%'};return _0x300e08;})});}_0x2caa79[_0xb087('0x8f')][_0xb087('0x105')]=![];if(_0xad3eae['query']['id']){_0x2caa79['where']['id']={'$gt':_0xad3eae[_0xb087('0x50')]['id']};}_0x2caa79=_['merge']({},_0x2caa79,_0xad3eae['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x2caa79['where']})[_0xb087('0x25')](function(_0x241c68){_0x1ffbd9[_0xb087('0x35')]=_0x241c68;_0x2caa79[_0xb087('0xc7')]=[];if(_0xad3eae['query']['includeAgent']){_0x2caa79[_0xb087('0xc7')][_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id','fullname',_0xb087('0x100')]});}if(_0xad3eae[_0xb087('0x50')][_0xb087('0x11d')]){_0x2caa79[_0xb087('0xc7')]=[{'all':!![]}];}return db[_0xb087('0xdc')][_0xb087('0x11a')](_0x2caa79);})[_0xb087('0x25')](function(_0x3b5740){_0x1ffbd9['rows']=_0x3b5740;return _0x1ffbd9;});}})[_0xb087('0x25')](respondWithFilteredResult(_0xb6682a,_0x2caa79))[_0xb087('0xc9')](handleError(_0xb6682a,null));};exports[_0xb087('0x11e')]=function(_0x594ddc,_0x30521e,_0x13acd8){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x594ddc[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x30521e,null))['then'](function(_0x528edd){if(_0x528edd){return _0x528edd[_0xb087('0x11f')](_0x594ddc[_0xb087('0x3f')][_0xb087('0x116')],_[_0xb087('0x115')](_0x594ddc[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{})['spread'](function(){return db['Tag'][_0xb087('0x11a')]({'attributes':['id',_0xb087('0x3d'),'color'],'where':{'id':_0x594ddc['body'][_0xb087('0x116')]}});})[_0xb087('0x25')](function(_0x24ae87){socket['emit'](_0xb087('0x120'),{'id':Number(_0x594ddc[_0xb087('0xc5')]['id']),'tags':_0x24ae87||[]});return{'id':Number(_0x594ddc['params']['id']),'tags':_0x24ae87||[]};});}})[_0xb087('0x25')](respondWithResult(_0x30521e,null))['catch'](handleError(_0x30521e,null));};exports['removeTags']=function(_0x592d18,_0x5cbda4,_0x5a182e){return db[_0xb087('0x4b')]['find']({'where':{'id':_0x592d18[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x5cbda4,null))['then'](function(_0x12f2b2){if(_0x12f2b2){return _0x12f2b2[_0xb087('0x121')](_0x592d18[_0xb087('0x50')][_0xb087('0x116')]);}})['then'](respondWithStatusCode(_0x5cbda4,null))[_0xb087('0xc9')](handleError(_0x5cbda4,null));};exports[_0xb087('0xf0')]=function(_0x17d60b,_0x5df18d){var _0x538812=moment()[_0xb087('0x122')]()[_0xb087('0xac')]();var _0x39732b=path[_0xb087('0xec')](config[_0xb087('0xed')],'server',_0xb087('0x123'),'tmp');var _0x1d8582=path[_0xb087('0xec')](config['root'],_0xb087('0x124'),'files',_0xb087('0x125'));var _0x3f2e19=path[_0xb087('0xec')](_0x39732b,_0x538812);var _0x2d500c=util[_0xb087('0xf4')](_0xb087('0x126'),_0x17d60b[_0xb087('0xc5')]['id'],_0x538812);var _0x407837=path['join'](_0x39732b,_0x2d500c);var _0x220896=[];_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id',_0xb087('0x45')],'raw':!![]});_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xde')],'as':_0xb087('0xdf'),'attributes':['id',_0xb087('0x127'),'lastName'],'raw':!![]});if(_0x17d60b[_0xb087('0x50')][_0xb087('0x125')]){_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xe9')],'as':_0xb087('0xe9'),'raw':!![]});}var _0x6fa760=[{'model':db['ChatMessage'],'as':_0xb087('0xf8'),'attributes':['id',_0xb087('0x3f'),_0xb087('0x8b'),'direction',_0xb087('0x105'),_0xb087('0x92')],'include':_0x220896}];_0x6fa760[_0xb087('0xc2')]({'model':db['ChatWebsite'],'as':_0xb087('0x128'),'attributes':['id',_0xb087('0x3d')]});_0x6fa760['push']({'model':db[_0xb087('0x81')],'as':_0xb087('0x129'),'attributes':['id',_0xb087('0x45')]});return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x17d60b['params']['id']},'include':_0x6fa760})[_0xb087('0x25')](handleEntityNotFound(_0x5df18d,null))[_0xb087('0x25')](function(_0x196111){if(_0x196111){var _0x2711ed=_0x196111['get']({'plain':!![]});fs['mkdirSync'](_0x3f2e19);var _0x2aa136={'channel':'Chat','account':_0x2711ed[_0xb087('0x128')][_0xb087('0x3d')],'agent':_0x2711ed['Owner']?_0x2711ed[_0xb087('0x129')][_0xb087('0x45')]:'N.A.','createdAt':moment(_0x2711ed['createdAt'])[_0xb087('0xf4')](_0xb087('0x12a'))[_0xb087('0xac')](),'closedAt':_0x2711ed['closed']?moment(_0x2711ed['closedAt'])['format'](_0xb087('0x12a'))[_0xb087('0xac')]():'','disposition':_0x2711ed[_0xb087('0xe3')],'chatInfo':{'browser':_0x2711ed['browserName'],'os':_0x2711ed['osName'],'referer':_0x2711ed[_0xb087('0x12b')],'customerIp':_0x2711ed[_0xb087('0x12c')],'customerPort':_0x2711ed[_0xb087('0x12d')]?_0x2711ed[_0xb087('0x12d')]:_0xb087('0x12e')},'messages':_(_0x2711ed[_0xb087('0xf8')])[_0xb087('0x12f')]()[_0xb087('0x119')]({'secret':![]})[_0xb087('0x44')](function(_0x4392f7){if(_0x4392f7[_0xb087('0xe9')]){var _0x2ce41b=path[_0xb087('0xec')](_0x1d8582,_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]);if(fs[_0xb087('0x130')](_0x2ce41b)){fs['createReadStream'](_0x2ce41b)[_0xb087('0x131')](fs[_0xb087('0x132')](path['join'](_0x3f2e19,_0x4392f7['Attachment'][_0xb087('0xef')])));}}return{'date':moment(_0x4392f7[_0xb087('0x8b')])[_0xb087('0xf4')](_0xb087('0x12a'))['toString'](),'sender':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?_0x4392f7['User']?_0x4392f7['User'][_0xb087('0x45')]:_0xb087('0xfb'):_0x4392f7[_0xb087('0xdf')]['firstName']+(_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]?'\x20'+_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]:''),'body':_0x4392f7[_0xb087('0xe9')]?_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]:_0x4392f7['body'],'direction':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?'A':'C','secret':_0x4392f7[_0xb087('0x105')],'read':_0x4392f7[_0xb087('0x92')],'attachment':_0x4392f7[_0xb087('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0x124'),'views',_0xb087('0x135')),{'interaction':_0x2aa136})[_0xb087('0x25')](function(_0x3e4bec){var _0x52b038=path[_0xb087('0xec')](_0x3f2e19,_0xb087('0x136')+_0x2711ed['id']+'-'+_0x538812+_0xb087('0x137'));var _0x4e6b9f={'path':_0x52b038,'channel':'Chat','interactionId':_0x2711ed['id']};return pdf['createPdfFromHTML'](_0x3e4bec,_0x4e6b9f);})[_0xb087('0x25')](function(){return new BPromise(function(_0x22dea9,_0x1c9337){zipdir(_0x3f2e19,{'saveTo':_0x407837},function(_0x3d0278,_0x1c8982){if(_0x3d0278)return _0x1c9337(_0x3d0278);return _0x22dea9(_0x1c8982);});})[_0xb087('0x25')](function(){return new BPromise(function(_0x31b3e7,_0x6b8337){rimraf(_0x3f2e19,function(_0x348c92){if(_0x348c92)_0x6b8337(_0x348c92);return _0x31b3e7();});});})[_0xb087('0x25')](function(){return _0x5df18d[_0xb087('0xf0')](_0x407837,_0x2d500c,function(_0x218e1c){if(_0x218e1c){console[_0xb087('0x138')](_0xb087('0x139'),_0x218e1c);}else{fs[_0xb087('0x13a')](_0x407837);}});});});}else{return _0x5df18d[_0xb087('0x2e')](0xc8);}})[_0xb087('0xc9')](handleError(_0x5df18d,null));};
\ No newline at end of file
+var _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','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','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x42cb8d,_0x273bca){var _0x2713b6=function(_0x15b77f){while(--_0x15b77f){_0x42cb8d['push'](_0x42cb8d['shift']());}};_0x2713b6(++_0x273bca);}(_0xea28,0x13a));var _0x8ea2=function(_0x588881,_0xda26b8){_0x588881=_0x588881-0x0;var _0x4d3d2c=_0xea28[_0x588881];return _0x4d3d2c;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 600604d..1a7660c 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 _0xfe58=['hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','length','emit','catch'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xfe58,0x145));var _0x8fe5=function(_0x681d17,_0x163432){_0x681d17=_0x681d17-0x0;var _0x1fdb92=_0xfe58[_0x681d17];return _0x1fdb92;};'use strict';var EventEmitter=require(_0x8fe5('0x0'));var ChatInteraction=require(_0x8fe5('0x1'))['db'][_0x8fe5('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8fe5('0x3')](0x0);var events={'afterCreate':_0x8fe5('0x4'),'afterUpdate':_0x8fe5('0x5'),'afterDestroy':_0x8fe5('0x6')};function emitEvent(_0x22a257){return function(_0x35c983,_0x55b0a9,_0x1360cf){_0x35c983[_0x8fe5('0x7')]({'attributes':['id'],'raw':!![]})[_0x8fe5('0x8')](function(_0x2ebfde){_0x35c983['setDataValue']('Users',_0x2ebfde[_0x8fe5('0x9')](function(_0x4b362e){return{'id':_0x4b362e['id']};}));return ChatMessage[_0x8fe5('0xa')]({'where':{'ChatInteractionId':_0x35c983['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8fe5('0x8')](function(_0x4fa36){_0x35c983[_0x8fe5('0xb')]('unreadMessages',_0x4fa36[_0x8fe5('0xc')]);ChatInteractionEvents['emit'](_0x22a257+':'+_0x35c983['id'],_0x35c983);ChatInteractionEvents[_0x8fe5('0xd')](_0x22a257,_0x35c983);_0x1360cf(null);})[_0x8fe5('0xe')](_0x1360cf(null));};}for(var e in events){if(events[_0x8fe5('0xf')](e)){var event=events[e];ChatInteraction[_0x8fe5('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x423a=['length','emit','catch','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x4032c2,_0x5e5fd8){var _0x22fa70=function(_0x3723ca){while(--_0x3723ca){_0x4032c2['push'](_0x4032c2['shift']());}};_0x22fa70(++_0x5e5fd8);}(_0x423a,0x1a2));var _0xa423=function(_0xead522,_0x43b39b){_0xead522=_0xead522-0x0;var _0x4fb90a=_0x423a[_0xead522];return _0x4fb90a;};'use strict';var EventEmitter=require(_0xa423('0x0'));var ChatInteraction=require(_0xa423('0x1'))['db'][_0xa423('0x2')];var ChatMessage=require(_0xa423('0x1'))['db'][_0xa423('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa423('0x4')](0x0);var events={'afterCreate':_0xa423('0x5'),'afterUpdate':_0xa423('0x6'),'afterDestroy':_0xa423('0x7')};function emitEvent(_0x12738e){return function(_0x19e1b3,_0x536c83,_0x49f6b5){_0x19e1b3['getUsers']({'attributes':['id'],'raw':!![]})[_0xa423('0x8')](function(_0x4be3b3){_0x19e1b3[_0xa423('0x9')](_0xa423('0xa'),_0x4be3b3[_0xa423('0xb')](function(_0x11afa4){return{'id':_0x11afa4['id']};}));return ChatMessage[_0xa423('0xc')]({'where':{'ChatInteractionId':_0x19e1b3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa423('0x8')](function(_0x42e9d1){_0x19e1b3[_0xa423('0x9')](_0xa423('0xd'),_0x42e9d1[_0xa423('0xe')]);ChatInteractionEvents[_0xa423('0xf')](_0x12738e+':'+_0x19e1b3['id'],_0x19e1b3);ChatInteractionEvents['emit'](_0x12738e,_0x19e1b3);_0x49f6b5(null);})[_0xa423('0x10')](_0x49f6b5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xa423('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 5a7a529..7d7786c 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 _0x88a9=['../../config/environment','./chatInteraction.attributes','exports','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2baa3a,_0x25661f){var _0x2f724a=function(_0x194380){while(--_0x194380){_0x2baa3a['push'](_0x2baa3a['shift']());}};_0x2f724a(++_0x25661f);}(_0x88a9,0x81));var _0x988a=function(_0x5c09a7,_0x27f20e){_0x5c09a7=_0x5c09a7-0x0;var _0x4cb42b=_0x88a9[_0x5c09a7];return _0x4cb42b;};'use strict';var _=require(_0x988a('0x0'));var util=require(_0x988a('0x1'));var logger=require(_0x988a('0x2'))(_0x988a('0x3'));var moment=require(_0x988a('0x4'));var BPromise=require('bluebird');var rp=require(_0x988a('0x5'));var fs=require('fs');var path=require(_0x988a('0x6'));var rimraf=require('rimraf');var config=require(_0x988a('0x7'));var attributes=require(_0x988a('0x8'));module[_0x988a('0x9')]=function(_0x6fc154,_0xa9620){return _0x6fc154['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22ed02,_0x38ce12,_0x50fbfe){if(_0x22ed02[_0x988a('0xa')](_0x988a('0xb'))){_0x22ed02[_0x988a('0xc')]=moment()[_0x988a('0xd')](_0x988a('0xe'));}_0x50fbfe(null,_0x22ed02);}},'charset':_0x988a('0xf'),'collate':_0x988a('0x10')});};
\ No newline at end of file
+var _0x0564=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','rimraf'];(function(_0x2d0d25,_0x3c8a96){var _0x5c3fbf=function(_0x263e59){while(--_0x263e59){_0x2d0d25['push'](_0x2d0d25['shift']());}};_0x5c3fbf(++_0x3c8a96);}(_0x0564,0x108));var _0x4056=function(_0x3f8b13,_0x3ddfd7){_0x3f8b13=_0x3f8b13-0x0;var _0x1ce0af=_0x0564[_0x3f8b13];return _0x1ce0af;};'use strict';var _=require(_0x4056('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4056('0x1'));var moment=require(_0x4056('0x2'));var BPromise=require(_0x4056('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4056('0x4'));var rimraf=require(_0x4056('0x5'));var config=require(_0x4056('0x6'));var attributes=require(_0x4056('0x7'));module[_0x4056('0x8')]=function(_0x39801d,_0x27e002){return _0x39801d[_0x4056('0x9')](_0x4056('0xa'),attributes,{'tableName':_0x4056('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34d231,_0x4a83eb,_0x12bcbf){if(_0x34d231[_0x4056('0xc')](_0x4056('0xd'))){_0x34d231['closedAt']=moment()[_0x4056('0xe')](_0x4056('0xf'));}_0x12bcbf(null,_0x34d231);}},'charset':_0x4056('0x10'),'collate':_0x4056('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 652548c..a0beae4 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 _0x9325=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','./chatInteraction.socket','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','catch','lodash','util'];(function(_0x198fd7,_0x1aa9b1){var _0x574ead=function(_0x311fc3){while(--_0x311fc3){_0x198fd7['push'](_0x198fd7['shift']());}};_0x574ead(++_0x1aa9b1);}(_0x9325,0xd0));var _0x5932=function(_0x3f0f9a,_0x3aec73){_0x3f0f9a=_0x3f0f9a-0x0;var _0x1c1a4b=_0x9325[_0x3f0f9a];return _0x1c1a4b;};'use strict';var _=require(_0x5932('0x0'));var util=require(_0x5932('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5932('0x2'));var fs=require('fs');var Redis=require(_0x5932('0x3'));var db=require(_0x5932('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5932('0x5'))(_0x5932('0x6'));var config=require('../../config/environment');var jayson=require(_0x5932('0x7'));var client=jayson[_0x5932('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5932('0x9')]));require(_0x5932('0xa'))['register'](socket);function respondWithRpcPromise(_0x392e12,_0x2b00d9,_0x5c8482){return new BPromise(function(_0x248abe,_0x595fac){return client[_0x5932('0xb')](_0x392e12,_0x5c8482)[_0x5932('0xc')](function(_0x342cf2){logger[_0x5932('0xd')]('ChatInteraction,\x20%s,\x20%s',_0x2b00d9,_0x5932('0xe'));logger[_0x5932('0xf')](_0x5932('0x10'),_0x2b00d9,_0x5932('0xe'),JSON[_0x5932('0x11')](_0x342cf2));if(_0x342cf2[_0x5932('0x12')]){if(_0x342cf2[_0x5932('0x12')][_0x5932('0x13')]===0x1f4){logger['error'](_0x5932('0x14'),_0x2b00d9,_0x342cf2['error'][_0x5932('0x15')]);return _0x595fac(_0x342cf2[_0x5932('0x12')]['message']);}logger[_0x5932('0x12')](_0x5932('0x14'),_0x2b00d9,_0x342cf2['error'][_0x5932('0x15')]);return _0x248abe(_0x342cf2[_0x5932('0x12')][_0x5932('0x15')]);}else{logger['info'](_0x5932('0x14'),_0x2b00d9,'request\x20sent');_0x248abe(_0x342cf2['result'][_0x5932('0x15')]);}})['catch'](function(_0x5f5130){logger[_0x5932('0x12')](_0x5932('0x14'),_0x2b00d9,_0x5f5130);_0x595fac(_0x5f5130);});});}exports[_0x5932('0x16')]=function(_0x4552e6){var _0x3f9edc=this;return new Promise(function(_0x291d64,_0x2060d2){return db[_0x5932('0x17')]['update'](_0x4552e6[_0x5932('0x18')],{'raw':_0x4552e6[_0x5932('0x19')]?_0x4552e6[_0x5932('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4552e6[_0x5932('0x19')]?_0x4552e6[_0x5932('0x19')][_0x5932('0x1a')]||null:null,'attributes':_0x4552e6[_0x5932('0x19')]?_0x4552e6['options'][_0x5932('0x1b')]||null:null,'limit':_0x4552e6[_0x5932('0x19')]?_0x4552e6[_0x5932('0x19')]['limit']||null:null})[_0x5932('0xc')](function(_0x4a6257){logger[_0x5932('0xd')](_0x5932('0x16'),_0x4552e6);logger['debug']('UpdateChatInteraction',_0x4552e6,JSON[_0x5932('0x11')](_0x4a6257));_0x291d64(_0x4a6257);})['catch'](function(_0x787348){logger[_0x5932('0x12')](_0x5932('0x16'),_0x787348[_0x5932('0x15')],_0x4552e6);_0x2060d2(_0x3f9edc[_0x5932('0x12')](0x1f4,_0x787348[_0x5932('0x15')]));});});};exports[_0x5932('0x1c')]=function(_0x3a9d86){return new Promise(function(_0x194588,_0x1ef947){return db['ChatInteraction'][_0x5932('0x1d')]({'where':_0x3a9d86['options']?_0x3a9d86[_0x5932('0x19')][_0x5932('0x1a')]||null:null})[_0x5932('0xc')](function(_0x15d699){if(_0x15d699){return _0x15d699['addTags'](_0x3a9d86[_0x5932('0x18')][_0x5932('0x1e')],_[_0x5932('0x1f')](_0x3a9d86[_0x5932('0x18')],[_0x5932('0x1e'),'id'])||{});}})[_0x5932('0x20')](function(_0x59c4d0){logger[_0x5932('0xd')](_0x5932('0x21'),_0x3a9d86);logger[_0x5932('0xf')](_0x5932('0x21'),_0x3a9d86,JSON[_0x5932('0x11')](_0x59c4d0));_0x194588(_0x59c4d0);})[_0x5932('0x22')](function(_0x30b24a){logger[_0x5932('0x12')](_0x5932('0x21'),_0x30b24a[_0x5932('0x15')],_0x3a9d86);_0x1ef947(_this[_0x5932('0x12')](0x1f4,_0x30b24a[_0x5932('0x15')]));});});};
\ No newline at end of file
+var _0x189c=['AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','info','debug','AddTagsToChatInteraction','addTags','ids','omit','spread'];(function(_0x537dc2,_0x1fc1d6){var _0x1224b8=function(_0xd166e3){while(--_0xd166e3){_0x537dc2['push'](_0x537dc2['shift']());}};_0x1224b8(++_0x1fc1d6);}(_0x189c,0x159));var _0xc189=function(_0xf9bdd8,_0x30938e){_0xf9bdd8=_0xf9bdd8-0x0;var _0x4133e8=_0x189c[_0xf9bdd8];return _0x4133e8;};'use strict';var _=require(_0xc189('0x0'));var util=require('util');var moment=require(_0xc189('0x1'));var BPromise=require(_0xc189('0x2'));var rs=require(_0xc189('0x3'));var fs=require('fs');var Redis=require(_0xc189('0x4'));var db=require(_0xc189('0x5'))['db'];var utils=require(_0xc189('0x6'));var logger=require(_0xc189('0x7'))(_0xc189('0x8'));var config=require('../../config/environment');var jayson=require(_0xc189('0x9'));var client=jayson[_0xc189('0xa')][_0xc189('0xb')]({'port':0x232a});config['redis']=_[_0xc189('0xc')](config[_0xc189('0xd')],{'host':_0xc189('0xe'),'port':0x18eb});var socket=require(_0xc189('0xf'))(new Redis(config[_0xc189('0xd')]));require('./chatInteraction.socket')[_0xc189('0x10')](socket);function respondWithRpcPromise(_0x10c720,_0x5ca777,_0x11479c){return new BPromise(function(_0x1ce57a,_0x3dbf60){return client[_0xc189('0x11')](_0x10c720,_0x11479c)[_0xc189('0x12')](function(_0x3af765){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5ca777,_0xc189('0x13'));logger['debug'](_0xc189('0x14'),_0x5ca777,_0xc189('0x13'),JSON[_0xc189('0x15')](_0x3af765));if(_0x3af765[_0xc189('0x16')]){if(_0x3af765[_0xc189('0x16')]['code']===0x1f4){logger[_0xc189('0x16')](_0xc189('0x17'),_0x5ca777,_0x3af765[_0xc189('0x16')]['message']);return _0x3dbf60(_0x3af765['error'][_0xc189('0x18')]);}logger[_0xc189('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x5ca777,_0x3af765[_0xc189('0x16')][_0xc189('0x18')]);return _0x1ce57a(_0x3af765[_0xc189('0x16')][_0xc189('0x18')]);}else{logger['info'](_0xc189('0x17'),_0x5ca777,'request\x20sent');_0x1ce57a(_0x3af765[_0xc189('0x19')][_0xc189('0x18')]);}})[_0xc189('0x1a')](function(_0xece6e0){logger[_0xc189('0x16')](_0xc189('0x17'),_0x5ca777,_0xece6e0);_0x3dbf60(_0xece6e0);});});}exports[_0xc189('0x1b')]=function(_0x14aa57){var _0x33f08f=this;return new Promise(function(_0x552150,_0x314837){return db[_0xc189('0x1c')][_0xc189('0x1d')](_0x14aa57[_0xc189('0x1e')],{'raw':_0x14aa57[_0xc189('0x1f')]?_0x14aa57[_0xc189('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14aa57[_0xc189('0x1f')]?_0x14aa57[_0xc189('0x1f')][_0xc189('0x20')]||null:null,'attributes':_0x14aa57[_0xc189('0x1f')]?_0x14aa57[_0xc189('0x1f')][_0xc189('0x21')]||null:null,'limit':_0x14aa57[_0xc189('0x1f')]?_0x14aa57['options'][_0xc189('0x22')]||null:null})[_0xc189('0x12')](function(_0x471455){logger[_0xc189('0x23')](_0xc189('0x1b'),_0x14aa57);logger[_0xc189('0x24')](_0xc189('0x1b'),_0x14aa57,JSON[_0xc189('0x15')](_0x471455));_0x552150(_0x471455);})['catch'](function(_0x43b942){logger['error'](_0xc189('0x1b'),_0x43b942[_0xc189('0x18')],_0x14aa57);_0x314837(_0x33f08f[_0xc189('0x16')](0x1f4,_0x43b942[_0xc189('0x18')]));});});};exports[_0xc189('0x25')]=function(_0x7eb374){return new Promise(function(_0x3a5965,_0x531048){return db['ChatInteraction']['find']({'where':_0x7eb374['options']?_0x7eb374[_0xc189('0x1f')][_0xc189('0x20')]||null:null})[_0xc189('0x12')](function(_0x1a98ce){if(_0x1a98ce){return _0x1a98ce[_0xc189('0x26')](_0x7eb374[_0xc189('0x1e')][_0xc189('0x27')],_[_0xc189('0x28')](_0x7eb374[_0xc189('0x1e')],[_0xc189('0x27'),'id'])||{});}})[_0xc189('0x29')](function(_0x6c144a){logger[_0xc189('0x23')](_0xc189('0x2a'),_0x7eb374);logger[_0xc189('0x24')](_0xc189('0x2a'),_0x7eb374,JSON['stringify'](_0x6c144a));_0x3a5965(_0x6c144a);})[_0xc189('0x1a')](function(_0xd8e5f2){logger[_0xc189('0x16')](_0xc189('0x2a'),_0xd8e5f2[_0xc189('0x18')],_0x7eb374);_0x531048(_this['error'](0x1f4,_0xd8e5f2[_0xc189('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 1365755..e28338e 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 _0x29f0=['remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x29f0,0x172));var _0x029f=function(_0x44d6b3,_0x12ca0b){_0x44d6b3=_0x44d6b3-0x0;var _0x4aae79=_0x29f0[_0x44d6b3];return _0x4aae79;};'use strict';var ChatInteractionEvents=require(_0x029f('0x0'));var events=['save',_0x029f('0x1'),_0x029f('0x2')];function createListener(_0x9b27a6,_0x2dd961){return function(_0x3f5c90){_0x2dd961[_0x029f('0x3')](_0x9b27a6,_0x3f5c90);};}function removeListener(_0x3173b3,_0x36087a){return function(){ChatInteractionEvents[_0x029f('0x4')](_0x3173b3,_0x36087a);};}exports[_0x029f('0x5')]=function(_0x147275){for(var _0x4162c8=0x0,_0x50d9dd=events['length'];_0x4162c8<_0x50d9dd;_0x4162c8++){var _0x1c15c9=events[_0x4162c8];var _0x491263=createListener(_0x029f('0x6')+_0x1c15c9,_0x147275);ChatInteractionEvents['on'](_0x1c15c9,_0x491263);}};
\ No newline at end of file
+var _0x6d4f=['removeListener','register','length','chatInteraction:','./chatInteraction.events','emit'];(function(_0x4831d7,_0x384d17){var _0x1ea2e8=function(_0xdd1209){while(--_0xdd1209){_0x4831d7['push'](_0x4831d7['shift']());}};_0x1ea2e8(++_0x384d17);}(_0x6d4f,0xee));var _0xf6d4=function(_0xf43cb,_0x465374){_0xf43cb=_0xf43cb-0x0;var _0x14e869=_0x6d4f[_0xf43cb];return _0x14e869;};'use strict';var ChatInteractionEvents=require(_0xf6d4('0x0'));var events=['save','remove','update'];function createListener(_0x32b23d,_0x191fde){return function(_0x1dfb1d){_0x191fde[_0xf6d4('0x1')](_0x32b23d,_0x1dfb1d);};}function removeListener(_0x247b57,_0x3168d3){return function(){ChatInteractionEvents[_0xf6d4('0x2')](_0x247b57,_0x3168d3);};}exports[_0xf6d4('0x3')]=function(_0xac0926){for(var _0x40088e=0x0,_0x303ece=events[_0xf6d4('0x4')];_0x40088e<_0x303ece;_0x40088e++){var _0xfe5a6a=events[_0x40088e];var _0x46f8c5=createListener(_0xf6d4('0x5')+_0xfe5a6a,_0xac0926);ChatInteractionEvents['on'](_0xfe5a6a,_0x46f8c5);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 7efa0a0..dbedeea 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 _0x24db=['isAuthenticated','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','replace','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download'];(function(_0x3bbd7a,_0x381a73){var _0x3d3166=function(_0x2ae67d){while(--_0x2ae67d){_0x3bbd7a['push'](_0x3bbd7a['shift']());}};_0x3d3166(++_0x381a73);}(_0x24db,0x148));var _0xb24d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24db[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb24d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb24d('0x1'));var express=require(_0xb24d('0x2'));var router=express['Router']();var fs_extra=require(_0xb24d('0x3'));var auth=require(_0xb24d('0x4'));var interaction=require(_0xb24d('0x5'));var config=require(_0xb24d('0x6'));var controller=require(_0xb24d('0x7'));router[_0xb24d('0x8')]('/',auth['isAuthenticated'](),controller[_0xb24d('0x9')]);router[_0xb24d('0x8')](_0xb24d('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb24d('0xb'),auth[_0xb24d('0xc')](),controller[_0xb24d('0xd')]);router[_0xb24d('0x8')](_0xb24d('0xe'),auth[_0xb24d('0xc')](),controller['attachmentDownload']);router[_0xb24d('0x8')]('/:id/messages',auth[_0xb24d('0xf')](),controller['getMessages']);router[_0xb24d('0x8')](_0xb24d('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xb24d('0x11')]);router[_0xb24d('0x8')](_0xb24d('0x12'),auth[_0xb24d('0xf')](),controller[_0xb24d('0x13')]);router[_0xb24d('0x14')]('/',auth[_0xb24d('0xf')](),controller['create']);router[_0xb24d('0x14')](_0xb24d('0x15'),auth['isAuthenticated'](),controller[_0xb24d('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x10398e,_0x18d501,_0x34e4d3){_0x34e4d3(null,path[_0xb24d('0x17')](config[_0xb24d('0x18')],_0xb24d('0x19')));},'filename':function(_0x5373b4,_0x572b14,_0x4056a4){_0x4056a4(null,util[_0xb24d('0x1a')](_0xb24d('0x1b'),Date[_0xb24d('0x1c')](),_0x572b14['originalname'][_0xb24d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb24d('0x14')]('/:id/attachment_upload',upload[_0xb24d('0x1e')](_0xb24d('0x1f')),controller[_0xb24d('0x20')]);router[_0xb24d('0x14')](_0xb24d('0x21'),auth[_0xb24d('0xc')](),controller[_0xb24d('0x22')]);router[_0xb24d('0x14')](_0xb24d('0x23'),auth['isAuthenticated'](),interaction[_0xb24d('0x24')](_0xb24d('0x25'),_0xb24d('0x26')),controller[_0xb24d('0x27')]);router[_0xb24d('0x28')](_0xb24d('0xb'),auth['isAuthenticated'](),interaction[_0xb24d('0x24')]('chat','chatinteraction:update'),controller['update']);router[_0xb24d('0x28')](_0xb24d('0x29'),controller[_0xb24d('0x2a')]);router[_0xb24d('0x28')]('/:id/abandon',auth[_0xb24d('0xc')](),controller[_0xb24d('0x2b')]);router[_0xb24d('0x28')](_0xb24d('0x2c'),controller[_0xb24d('0x2d')]);router[_0xb24d('0x2e')]('/:id',auth[_0xb24d('0xf')](),interaction['tracked'](_0xb24d('0x25'),_0xb24d('0x2f')),controller[_0xb24d('0x30')]);router[_0xb24d('0x2e')](_0xb24d('0x23'),auth[_0xb24d('0xf')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x853f=['%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','destroy','delete','removeTags','exports','multer','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format'];(function(_0x7d1a4c,_0x10187e){var _0x74453c=function(_0x46f176){while(--_0x46f176){_0x7d1a4c['push'](_0x7d1a4c['shift']());}};_0x74453c(++_0x10187e);}(_0x853f,0xdf));var _0xf853=function(_0x328c26,_0x468b31){_0x328c26=_0x328c26-0x0;var _0x3ac777=_0x853f[_0x328c26];return _0x3ac777;};'use strict';var multer=require(_0xf853('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf853('0x1'));var router=express[_0xf853('0x2')]();var fs_extra=require(_0xf853('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf853('0x4'));var controller=require(_0xf853('0x5'));router[_0xf853('0x6')]('/',auth[_0xf853('0x7')](),controller['index']);router['get'](_0xf853('0x8'),auth[_0xf853('0x7')](),controller[_0xf853('0x9')]);router[_0xf853('0x6')](_0xf853('0xa'),auth['isChatInteractionAuthorized'](),controller[_0xf853('0xb')]);router[_0xf853('0x6')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xf853('0xc')]);router['get'](_0xf853('0xd'),auth[_0xf853('0x7')](),controller[_0xf853('0xe')]);router['get'](_0xf853('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xf853('0x10')]);router[_0xf853('0x6')](_0xf853('0x11'),auth[_0xf853('0x7')](),controller[_0xf853('0x12')]);router[_0xf853('0x13')]('/',auth[_0xf853('0x7')](),controller[_0xf853('0x14')]);router[_0xf853('0x13')](_0xf853('0x15'),auth['isAuthenticated'](),controller[_0xf853('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fb3c5,_0x369592,_0x407868){_0x407868(null,path[_0xf853('0x17')](config[_0xf853('0x18')],_0xf853('0x19')));},'filename':function(_0x5baa53,_0x1bf73c,_0x145732){_0x145732(null,util[_0xf853('0x1a')](_0xf853('0x1b'),Date[_0xf853('0x1c')](),_0x1bf73c[_0xf853('0x1d')][_0xf853('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf853('0x13')](_0xf853('0x1f'),upload[_0xf853('0x20')](_0xf853('0x21')),controller[_0xf853('0x22')]);router[_0xf853('0x13')](_0xf853('0xd'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xf853('0x13')](_0xf853('0x23'),auth[_0xf853('0x7')](),interaction[_0xf853('0x24')](_0xf853('0x25'),_0xf853('0x26')),controller['addTags']);router[_0xf853('0x27')](_0xf853('0xa'),auth[_0xf853('0x7')](),interaction[_0xf853('0x24')](_0xf853('0x25'),_0xf853('0x28')),controller['update']);router['put'](_0xf853('0x29'),controller[_0xf853('0x2a')]);router[_0xf853('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xf853('0x2b')]);router['put'](_0xf853('0x2c'),controller[_0xf853('0x2d')]);router['delete'](_0xf853('0xa'),auth[_0xf853('0x7')](),interaction[_0xf853('0x24')](_0xf853('0x25'),'chatinteraction:destroy'),controller[_0xf853('0x2e')]);router[_0xf853('0x2f')]('/:id/tags',auth[_0xf853('0x7')](),controller[_0xf853('0x30')]);module[_0xf853('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5a1a162..be4650b 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 _0xe416=['BOOLEAN','INTEGER','exports','medium'];(function(_0x467ca1,_0xf345b5){var _0x280dd8=function(_0x5b6a04){while(--_0x5b6a04){_0x467ca1['push'](_0x467ca1['shift']());}};_0x280dd8(++_0xf345b5);}(_0xe416,0x14a));var _0x6e41=function(_0x4d5103,_0x3129b8){_0x4d5103=_0x4d5103-0x0;var _0x447fa5=_0xe416[_0x4d5103];return _0x447fa5;};'use strict';var Sequelize=require('sequelize');module[_0x6e41('0x0')]={'body':{'type':Sequelize['TEXT'](_0x6e41('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6e41('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6e41('0x3')]}};
\ No newline at end of file
+var _0xb0db=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x1fa5c1,_0x2e45c0){var _0x31b578=function(_0x5c634b){while(--_0x5c634b){_0x1fa5c1['push'](_0x1fa5c1['shift']());}};_0x31b578(++_0x2e45c0);}(_0xb0db,0x183));var _0xbb0d=function(_0x2f1be2,_0x377541){_0x2f1be2=_0x2f1be2-0x0;var _0x31c5aa=_0xb0db[_0x2f1be2];return _0x31c5aa;};'use strict';var Sequelize=require(_0xbb0d('0x0'));module[_0xbb0d('0x1')]={'body':{'type':Sequelize[_0xbb0d('0x2')](_0xbb0d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbb0d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xbb0d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index d53c5e6..6547d1d 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 _0x7f82=['UserProfileResource','isEmpty','filter','agent','push','messages','FromId','ToId','read','-createdAt','eml-format','rimraf','fast-json-patch','request-promise','moment','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','name','query','attributes','intersection','fields','length','order','sort','filters','pick','where','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','findAll','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','role','user','userProfileId'];(function(_0x121203,_0x48082e){var _0x15e54d=function(_0x526e40){while(--_0x526e40){_0x121203['push'](_0x121203['shift']());}};_0x15e54d(++_0x48082e);}(_0x7f82,0x1ae));var _0x27f8=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7f82[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0x27f8('0x0'));var rimraf=require(_0x27f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27f8('0x2'));var rp=require(_0x27f8('0x3'));var moment=require(_0x27f8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x27f8('0x5'));var sox=require('sox');var csv=require(_0x27f8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27f8('0x7'));var squel=require(_0x27f8('0x8'));var crypto=require(_0x27f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x27f8('0xa'));var toCsv=require('to-csv');var querystring=require(_0x27f8('0xb'));var Papa=require('papaparse');var Redis=require(_0x27f8('0xc'));var authService=require(_0x27f8('0xd'));var qs=require(_0x27f8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x27f8('0xf'));var utils=require(_0x27f8('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x27f8('0x11'))['db'];config[_0x27f8('0x12')]=_[_0x27f8('0x13')](config[_0x27f8('0x12')],{'host':_0x27f8('0x14'),'port':0x18eb});var socket=require(_0x27f8('0x15'))(new Redis(config[_0x27f8('0x12')]));require(_0x27f8('0x16'))[_0x27f8('0x17')](socket);function respondWithStatusCode(_0x359ece,_0x1a40eb){_0x1a40eb=_0x1a40eb||0xcc;return function(_0x26ec9d){if(_0x26ec9d){return _0x359ece[_0x27f8('0x18')](_0x1a40eb);}return _0x359ece[_0x27f8('0x19')](_0x1a40eb)['end']();};}function respondWithResult(_0x126ed9,_0x45cf2f){_0x45cf2f=_0x45cf2f||0xc8;return function(_0x3b52c3){if(_0x3b52c3){return _0x126ed9['status'](_0x45cf2f)[_0x27f8('0x1a')](_0x3b52c3);}};}function respondWithFilteredResult(_0x37123c,_0x674723){return function(_0x4f7e8a){if(_0x4f7e8a){var _0x6af749=typeof _0x674723[_0x27f8('0x1b')]===_0x27f8('0x1c')&&typeof _0x674723[_0x27f8('0x1d')]===_0x27f8('0x1c');var _0x26d296=_0x4f7e8a['count'];var _0x542972=_0x6af749?0x0:_0x674723['offset'];var _0x2b23b1=_0x6af749?_0x4f7e8a[_0x27f8('0x1e')]:_0x674723['offset']+_0x674723['limit'];var _0x2a7bea;if(_0x2b23b1>=_0x26d296){_0x2b23b1=_0x26d296;_0x2a7bea=0xc8;}else{_0x2a7bea=0xce;}_0x37123c[_0x27f8('0x19')](_0x2a7bea);return _0x37123c[_0x27f8('0x1f')](_0x27f8('0x20'),_0x542972+'-'+_0x2b23b1+'/'+_0x26d296)[_0x27f8('0x1a')](_0x4f7e8a);}return null;};}function patchUpdates(_0x5c9bf0){return function(_0x58188c){try{jsonpatch[_0x27f8('0x21')](_0x58188c,_0x5c9bf0,!![]);}catch(_0x29c0b7){return BPromise[_0x27f8('0x22')](_0x29c0b7);}return _0x58188c[_0x27f8('0x23')]();};}function saveUpdates(_0x2c16ce,_0x1d811b){return function(_0x4253a3){if(_0x4253a3){return _0x4253a3[_0x27f8('0x24')](_0x2c16ce)[_0x27f8('0x25')](function(_0x34e787){return _0x34e787;});}return null;};}function removeEntity(_0x31451e,_0x4cdf01){return function(_0x3b92ba){if(_0x3b92ba){return _0x3b92ba['destroy']()[_0x27f8('0x25')](function(){_0x31451e[_0x27f8('0x19')](0xcc)[_0x27f8('0x26')]();});}};}function handleEntityNotFound(_0x1c358f,_0x5329f6){return function(_0x8cf9fa){if(!_0x8cf9fa){_0x1c358f[_0x27f8('0x18')](0x194);}return _0x8cf9fa;};}function handleError(_0x35f0f4,_0x4b2910){_0x4b2910=_0x4b2910||0x1f4;return function(_0x16bd46){logger[_0x27f8('0x27')](_0x16bd46[_0x27f8('0x28')]);if(_0x16bd46['name']){delete _0x16bd46['name'];}_0x35f0f4['status'](_0x4b2910)['send'](_0x16bd46);};}exports[_0x27f8('0x29')]=function(_0x6fb526,_0x357e17){var _0x3ff2b1={},_0xee079f={},_0x488bc5={'count':0x0,'rows':[]};var _0x3cb594=_[_0x27f8('0x2a')](db[_0x27f8('0x2b')][_0x27f8('0x2c')],function(_0x1b256f){return{'name':_0x1b256f[_0x27f8('0x2d')],'type':_0x1b256f[_0x27f8('0x2e')][_0x27f8('0x2f')]};});_0xee079f[_0x27f8('0x30')]=_[_0x27f8('0x2a')](_0x3cb594,_0x27f8('0x31'));_0xee079f['query']=_['keys'](_0x6fb526[_0x27f8('0x32')]);_0xee079f['filters']=_['intersection'](_0xee079f[_0x27f8('0x30')],_0xee079f[_0x27f8('0x32')]);_0x3ff2b1[_0x27f8('0x33')]=_[_0x27f8('0x34')](_0xee079f[_0x27f8('0x30')],qs[_0x27f8('0x35')](_0x6fb526[_0x27f8('0x32')][_0x27f8('0x35')]));_0x3ff2b1['attributes']=_0x3ff2b1[_0x27f8('0x33')][_0x27f8('0x36')]?_0x3ff2b1[_0x27f8('0x33')]:_0xee079f['model'];if(!_0x6fb526['query']['hasOwnProperty']('nolimit')){_0x3ff2b1[_0x27f8('0x1d')]=qs['limit'](_0x6fb526[_0x27f8('0x32')][_0x27f8('0x1d')]);_0x3ff2b1[_0x27f8('0x1b')]=qs['offset'](_0x6fb526[_0x27f8('0x32')]['offset']);}_0x3ff2b1[_0x27f8('0x37')]=qs[_0x27f8('0x38')](_0x6fb526['query'][_0x27f8('0x38')]);_0x3ff2b1['where']=qs[_0x27f8('0x39')](_[_0x27f8('0x3a')](_0x6fb526[_0x27f8('0x32')],_0xee079f[_0x27f8('0x39')]),_0x3cb594);if(_0x6fb526[_0x27f8('0x32')]['filter']){_0x3ff2b1[_0x27f8('0x3b')]=_['merge'](_0x3ff2b1[_0x27f8('0x3b')],{'$or':_[_0x27f8('0x2a')](_0x3cb594,function(_0xff4097){if(_0xff4097[_0x27f8('0x2e')]!==_0x27f8('0x3c')){var _0x483c37={};_0x483c37[_0xff4097[_0x27f8('0x31')]]={'$like':'%'+_0x6fb526[_0x27f8('0x32')]['filter']+'%'};return _0x483c37;}})});}_0x3ff2b1=_[_0x27f8('0x3d')]({},_0x3ff2b1,_0x6fb526[_0x27f8('0x3e')]);var _0x5a4e45={'where':_0x3ff2b1[_0x27f8('0x3b')]};return db[_0x27f8('0x2b')]['count'](_0x5a4e45)['then'](function(_0x5116f6){_0x488bc5[_0x27f8('0x1e')]=_0x5116f6;if(_0x6fb526[_0x27f8('0x32')][_0x27f8('0x3f')]){_0x3ff2b1[_0x27f8('0x40')]=[{'all':!![]}];}return db[_0x27f8('0x2b')]['findAll'](_0x3ff2b1);})[_0x27f8('0x25')](function(_0x5f05e8){_0x488bc5['rows']=_0x5f05e8;return _0x488bc5;})['then'](respondWithFilteredResult(_0x357e17,_0x3ff2b1))[_0x27f8('0x41')](handleError(_0x357e17,null));};exports[_0x27f8('0x42')]=function(_0x35bc05,_0x53ff6d){var _0x46fa8e={'raw':!![],'where':{'id':_0x35bc05[_0x27f8('0x43')]['id']}},_0x2f9930={};_0x2f9930[_0x27f8('0x30')]=_['keys'](db[_0x27f8('0x2b')][_0x27f8('0x2c')]);_0x2f9930[_0x27f8('0x32')]=_[_0x27f8('0x44')](_0x35bc05[_0x27f8('0x32')]);_0x2f9930[_0x27f8('0x39')]=_[_0x27f8('0x34')](_0x2f9930[_0x27f8('0x30')],_0x2f9930['query']);_0x46fa8e[_0x27f8('0x33')]=_[_0x27f8('0x34')](_0x2f9930[_0x27f8('0x30')],qs[_0x27f8('0x35')](_0x35bc05[_0x27f8('0x32')][_0x27f8('0x35')]));_0x46fa8e[_0x27f8('0x33')]=_0x46fa8e[_0x27f8('0x33')]['length']?_0x46fa8e[_0x27f8('0x33')]:_0x2f9930[_0x27f8('0x30')];if(_0x35bc05[_0x27f8('0x32')][_0x27f8('0x3f')]){_0x46fa8e[_0x27f8('0x40')]=[{'all':!![]}];}_0x46fa8e=_['merge']({},_0x46fa8e,_0x35bc05['options']);return db[_0x27f8('0x2b')][_0x27f8('0x45')](_0x46fa8e)[_0x27f8('0x25')](handleEntityNotFound(_0x53ff6d,null))['then'](respondWithResult(_0x53ff6d,null))[_0x27f8('0x41')](handleError(_0x53ff6d,null));};exports[_0x27f8('0x46')]=function(_0xb7460d,_0x46f2dc){return db[_0x27f8('0x2b')][_0x27f8('0x46')](_0xb7460d['body'],{})[_0x27f8('0x25')](respondWithResult(_0x46f2dc,0xc9))[_0x27f8('0x41')](handleError(_0x46f2dc,null));};exports['update']=function(_0x5a8db0,_0x55308c){if(_0x5a8db0[_0x27f8('0x47')]['id']){delete _0x5a8db0[_0x27f8('0x47')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x5a8db0[_0x27f8('0x43')]['id']}})[_0x27f8('0x25')](handleEntityNotFound(_0x55308c,null))[_0x27f8('0x25')](saveUpdates(_0x5a8db0['body'],null))[_0x27f8('0x25')](respondWithResult(_0x55308c,null))[_0x27f8('0x41')](handleError(_0x55308c,null));};exports[_0x27f8('0x48')]=function(_0xf33a1,_0x1be763){return db[_0x27f8('0x2b')][_0x27f8('0x45')]({'where':{'id':_0xf33a1[_0x27f8('0x43')]['id']}})[_0x27f8('0x25')](handleEntityNotFound(_0x1be763,null))['then'](removeEntity(_0x1be763,null))[_0x27f8('0x41')](handleError(_0x1be763,null));};exports[_0x27f8('0x49')]=function(_0x4fcc91,_0x472110){return db[_0x27f8('0x2b')][_0x27f8('0x49')]()[_0x27f8('0x25')](respondWithResult(_0x472110,null))[_0x27f8('0x41')](handleError(_0x472110,null));};function wrapUser(_0x2bbbd6){return function(_0x103d04){var _0x1f36a7=_0x2bbbd6['get']({'plain':!![]});_0x1f36a7['messages']=[];if(_0x103d04){_0x1f36a7[_0x27f8('0x4a')]=_0x103d04[_0x27f8('0x4b')];_0x1f36a7['lastMessage']=_0x103d04;}else{_0x1f36a7[_0x27f8('0x4a')]=moment(0x0)['format'](_0x27f8('0x4c'));_0x1f36a7[_0x27f8('0x4d')]={};}return _0x1f36a7;};}exports['getUsers']=function(_0x242f2e,_0x48acc1,_0x42323d){var _0x374731=[];return db[_0x27f8('0x4e')][_0x27f8('0x4f')]({'where':{'role':['agent',_0x27f8('0x50'),'user']},'attributes':['id',_0x27f8('0x51'),_0x27f8('0x31'),'role',_0x27f8('0x52'),_0x27f8('0x53'),_0x27f8('0x54'),_0x27f8('0x55'),_0x27f8('0x56'),_0x27f8('0x57')],'order':qs[_0x27f8('0x38')](_0x27f8('0x58')),'include':[{'model':db[_0x27f8('0x59')],'as':_0x27f8('0x5a'),'attributes':['id',_0x27f8('0x31'),_0x27f8('0x2e')],'through':{'attributes':[]}}]})[_0x27f8('0x25')](function(_0x2ae14f){if(_0x2ae14f){var _0x3d4a7c=_0x242f2e['user'][_0x27f8('0x5b')]({'plain':!![]});if(!_0x3d4a7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d4a7c[_0x27f8('0x5c')]===_0x27f8('0x5d')){return db['UserProfileSection'][_0x27f8('0x45')]({'where':{'name':'Agents','userProfileId':_0x3d4a7c[_0x27f8('0x5e')]},'raw':!![]})[_0x27f8('0x25')](function(_0x4743e3){if(_0x4743e3){if(_0x4743e3['autoAssociation']===0x0){return db[_0x27f8('0x5f')][_0x27f8('0x4f')]({'where':{'sectionId':_0x4743e3['id']},'raw':!![]})['then'](function(_0x4a6415){var _0x385b2b=[];if(_[_0x27f8('0x60')](_0x4a6415)){_0x385b2b=_[_0x27f8('0x61')](_0x2ae14f,function(_0x167893){if(_0x167893['role']!==_0x27f8('0x62')){return _0x167893;}});return _0x385b2b;}else{for(var _0x489d0f=0x0;_0x489d0f<_0x2ae14f[_0x27f8('0x36')];_0x489d0f++){var _0xa1c2c0=_0x2ae14f[_0x489d0f];if(_0xa1c2c0[_0x27f8('0x5c')]===_0x27f8('0x62')){var _0x4d84b8=_[_0x27f8('0x45')](_0x4a6415,function(_0x1bec8a){return _0x1bec8a['resourceId']===_0xa1c2c0['id'];});if(_0x4d84b8)_0x385b2b[_0x27f8('0x63')](_0xa1c2c0);}else{_0x385b2b[_0x27f8('0x63')](_0xa1c2c0);}}return _0x385b2b;}});}else{return _0x2ae14f;}}else{var _0x15c6b5=_[_0x27f8('0x61')](_0x2ae14f,function(_0x475460){if(_0x475460['role']!==_0x27f8('0x62')){return _0x475460;}});return _0x15c6b5;}});}else{return _0x2ae14f;}}})[_0x27f8('0x25')](function(_0x3bcbb1){var _0x167ea4=[];if(_0x3bcbb1){_0x374731=_0x3bcbb1;for(var _0x284346=0x0;_0x284346<_0x3bcbb1[_0x27f8('0x36')];_0x284346+=0x1){_0x374731[_0x284346][_0x27f8('0x64')]=[];_0x167ea4[_0x27f8('0x63')](db[_0x27f8('0x2b')][_0x27f8('0x45')]({'where':{'FromId':[_0x242f2e[_0x27f8('0x5d')]['id'],_0x3bcbb1[_0x284346]['id']],'ToId':[_0x242f2e[_0x27f8('0x5d')]['id'],_0x3bcbb1[_0x284346]['id']],'ChatGroupId':null},'attributes':['id',_0x27f8('0x4b'),_0x27f8('0x65'),_0x27f8('0x66'),_0x27f8('0x67'),_0x27f8('0x47')],'order':qs[_0x27f8('0x38')](_0x27f8('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x27f8('0x25')](wrapUser(_0x3bcbb1[_0x284346])));}return BPromise['all'](_0x167ea4);}return[];})[_0x27f8('0x25')](function(_0x35b16e){return{'rows':_0x35b16e,'count':_0x35b16e[_0x27f8('0x36')]};})[_0x27f8('0x25')](respondWithResult(_0x48acc1,null))[_0x27f8('0x41')](handleError(_0x48acc1,null));};
\ No newline at end of file
+var _0xa4d5=['register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','find','create','body','catch','describe','get','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','UserProfileResource','isEmpty','agent','resourceId','push','messages','createdAt','ToId','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa4d5,0x1f3));var _0x5a4d=function(_0x3369c5,_0xce66ba){_0x3369c5=_0x3369c5-0x0;var _0x10fae9=_0xa4d5[_0x3369c5];return _0x10fae9;};'use strict';var emlformat=require(_0x5a4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a4d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a4d('0x2'));var moment=require('moment');var BPromise=require(_0x5a4d('0x3'));var Mustache=require(_0x5a4d('0x4'));var util=require('util');var path=require(_0x5a4d('0x5'));var sox=require(_0x5a4d('0x6'));var csv=require(_0x5a4d('0x7'));var ejs=require(_0x5a4d('0x8'));var fs=require('fs');var fs_extra=require(_0x5a4d('0x9'));var _=require(_0x5a4d('0xa'));var squel=require(_0x5a4d('0xb'));var crypto=require(_0x5a4d('0xc'));var jsforce=require(_0x5a4d('0xd'));var deskjs=require(_0x5a4d('0xe'));var toCsv=require(_0x5a4d('0x7'));var querystring=require(_0x5a4d('0xf'));var Papa=require(_0x5a4d('0x10'));var Redis=require(_0x5a4d('0x11'));var authService=require(_0x5a4d('0x12'));var qs=require(_0x5a4d('0x13'));var as=require(_0x5a4d('0x14'));var hardwareService=require(_0x5a4d('0x15'));var logger=require(_0x5a4d('0x16'))(_0x5a4d('0x17'));var utils=require(_0x5a4d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5a4d('0x19'));var db=require(_0x5a4d('0x1a'))['db'];config[_0x5a4d('0x1b')]=_[_0x5a4d('0x1c')](config[_0x5a4d('0x1b')],{'host':_0x5a4d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a4d('0x1b')]));require(_0x5a4d('0x1e'))[_0x5a4d('0x1f')](socket);function respondWithStatusCode(_0x2293de,_0x14a0e4){_0x14a0e4=_0x14a0e4||0xcc;return function(_0x1a28de){if(_0x1a28de){return _0x2293de[_0x5a4d('0x20')](_0x14a0e4);}return _0x2293de[_0x5a4d('0x21')](_0x14a0e4)['end']();};}function respondWithResult(_0x3f9861,_0x2e85a0){_0x2e85a0=_0x2e85a0||0xc8;return function(_0x118161){if(_0x118161){return _0x3f9861['status'](_0x2e85a0)[_0x5a4d('0x22')](_0x118161);}};}function respondWithFilteredResult(_0x1ebc24,_0x3a1e23){return function(_0x23ca2d){if(_0x23ca2d){var _0x24cd21=typeof _0x3a1e23[_0x5a4d('0x23')]==='undefined'&&typeof _0x3a1e23[_0x5a4d('0x24')]==='undefined';var _0x3d65de=_0x23ca2d['count'];var _0x2fc15c=_0x24cd21?0x0:_0x3a1e23[_0x5a4d('0x23')];var _0x30d4df=_0x24cd21?_0x23ca2d[_0x5a4d('0x25')]:_0x3a1e23[_0x5a4d('0x23')]+_0x3a1e23[_0x5a4d('0x24')];var _0x42a2f2;if(_0x30d4df>=_0x3d65de){_0x30d4df=_0x3d65de;_0x42a2f2=0xc8;}else{_0x42a2f2=0xce;}_0x1ebc24[_0x5a4d('0x21')](_0x42a2f2);return _0x1ebc24[_0x5a4d('0x26')](_0x5a4d('0x27'),_0x2fc15c+'-'+_0x30d4df+'/'+_0x3d65de)[_0x5a4d('0x22')](_0x23ca2d);}return null;};}function patchUpdates(_0x2458fb){return function(_0x276e64){try{jsonpatch[_0x5a4d('0x28')](_0x276e64,_0x2458fb,!![]);}catch(_0x1dd9d0){return BPromise[_0x5a4d('0x29')](_0x1dd9d0);}return _0x276e64['save']();};}function saveUpdates(_0x4e262c,_0x193380){return function(_0xadbded){if(_0xadbded){return _0xadbded[_0x5a4d('0x2a')](_0x4e262c)['then'](function(_0x482b16){return _0x482b16;});}return null;};}function removeEntity(_0x16dfd3,_0x54aa02){return function(_0x5b60e3){if(_0x5b60e3){return _0x5b60e3[_0x5a4d('0x2b')]()[_0x5a4d('0x2c')](function(){_0x16dfd3[_0x5a4d('0x21')](0xcc)[_0x5a4d('0x2d')]();});}};}function handleEntityNotFound(_0x325edb,_0x5e3257){return function(_0x4c8574){if(!_0x4c8574){_0x325edb[_0x5a4d('0x20')](0x194);}return _0x4c8574;};}function handleError(_0x343bfd,_0x48c0c1){_0x48c0c1=_0x48c0c1||0x1f4;return function(_0x58ade6){logger[_0x5a4d('0x2e')](_0x58ade6['stack']);if(_0x58ade6[_0x5a4d('0x2f')]){delete _0x58ade6[_0x5a4d('0x2f')];}_0x343bfd[_0x5a4d('0x21')](_0x48c0c1)[_0x5a4d('0x30')](_0x58ade6);};}exports[_0x5a4d('0x31')]=function(_0xbd61b1,_0x3dbcfa){var _0x46b166={},_0x461e74={},_0x13561f={'count':0x0,'rows':[]};var _0xe202b4=_[_0x5a4d('0x32')](db[_0x5a4d('0x33')][_0x5a4d('0x34')],function(_0x1cfe14){return{'name':_0x1cfe14[_0x5a4d('0x35')],'type':_0x1cfe14[_0x5a4d('0x36')]['key']};});_0x461e74[_0x5a4d('0x37')]=_[_0x5a4d('0x32')](_0xe202b4,_0x5a4d('0x2f'));_0x461e74[_0x5a4d('0x38')]=_[_0x5a4d('0x39')](_0xbd61b1[_0x5a4d('0x38')]);_0x461e74[_0x5a4d('0x3a')]=_[_0x5a4d('0x3b')](_0x461e74[_0x5a4d('0x37')],_0x461e74['query']);_0x46b166[_0x5a4d('0x3c')]=_[_0x5a4d('0x3b')](_0x461e74[_0x5a4d('0x37')],qs[_0x5a4d('0x3d')](_0xbd61b1['query'][_0x5a4d('0x3d')]));_0x46b166['attributes']=_0x46b166['attributes'][_0x5a4d('0x3e')]?_0x46b166['attributes']:_0x461e74[_0x5a4d('0x37')];if(!_0xbd61b1['query']['hasOwnProperty'](_0x5a4d('0x3f'))){_0x46b166[_0x5a4d('0x24')]=qs[_0x5a4d('0x24')](_0xbd61b1[_0x5a4d('0x38')][_0x5a4d('0x24')]);_0x46b166[_0x5a4d('0x23')]=qs['offset'](_0xbd61b1['query'][_0x5a4d('0x23')]);}_0x46b166['order']=qs[_0x5a4d('0x40')](_0xbd61b1[_0x5a4d('0x38')][_0x5a4d('0x40')]);_0x46b166['where']=qs[_0x5a4d('0x3a')](_[_0x5a4d('0x41')](_0xbd61b1[_0x5a4d('0x38')],_0x461e74[_0x5a4d('0x3a')]),_0xe202b4);if(_0xbd61b1[_0x5a4d('0x38')]['filter']){_0x46b166[_0x5a4d('0x42')]=_['merge'](_0x46b166[_0x5a4d('0x42')],{'$or':_[_0x5a4d('0x32')](_0xe202b4,function(_0x29be2c){if(_0x29be2c[_0x5a4d('0x36')]!==_0x5a4d('0x43')){var _0x31d48f={};_0x31d48f[_0x29be2c[_0x5a4d('0x2f')]]={'$like':'%'+_0xbd61b1[_0x5a4d('0x38')][_0x5a4d('0x44')]+'%'};return _0x31d48f;}})});}_0x46b166=_['merge']({},_0x46b166,_0xbd61b1[_0x5a4d('0x45')]);var _0x209c49={'where':_0x46b166[_0x5a4d('0x42')]};return db[_0x5a4d('0x33')][_0x5a4d('0x25')](_0x209c49)['then'](function(_0x2260ad){_0x13561f[_0x5a4d('0x25')]=_0x2260ad;if(_0xbd61b1[_0x5a4d('0x38')]['includeAll']){_0x46b166[_0x5a4d('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5a4d('0x47')](_0x46b166);})[_0x5a4d('0x2c')](function(_0x57c148){_0x13561f[_0x5a4d('0x48')]=_0x57c148;return _0x13561f;})[_0x5a4d('0x2c')](respondWithFilteredResult(_0x3dbcfa,_0x46b166))['catch'](handleError(_0x3dbcfa,null));};exports['show']=function(_0x545d6c,_0x1ea000){var _0x445dfe={'raw':!![],'where':{'id':_0x545d6c[_0x5a4d('0x49')]['id']}},_0x292faf={};_0x292faf[_0x5a4d('0x37')]=_['keys'](db['ChatInternalMessage'][_0x5a4d('0x34')]);_0x292faf[_0x5a4d('0x38')]=_[_0x5a4d('0x39')](_0x545d6c[_0x5a4d('0x38')]);_0x292faf['filters']=_[_0x5a4d('0x3b')](_0x292faf[_0x5a4d('0x37')],_0x292faf[_0x5a4d('0x38')]);_0x445dfe[_0x5a4d('0x3c')]=_[_0x5a4d('0x3b')](_0x292faf[_0x5a4d('0x37')],qs[_0x5a4d('0x3d')](_0x545d6c[_0x5a4d('0x38')][_0x5a4d('0x3d')]));_0x445dfe[_0x5a4d('0x3c')]=_0x445dfe[_0x5a4d('0x3c')]['length']?_0x445dfe[_0x5a4d('0x3c')]:_0x292faf['model'];if(_0x545d6c[_0x5a4d('0x38')][_0x5a4d('0x4a')]){_0x445dfe[_0x5a4d('0x46')]=[{'all':!![]}];}_0x445dfe=_['merge']({},_0x445dfe,_0x545d6c[_0x5a4d('0x45')]);return db[_0x5a4d('0x33')][_0x5a4d('0x4b')](_0x445dfe)[_0x5a4d('0x2c')](handleEntityNotFound(_0x1ea000,null))[_0x5a4d('0x2c')](respondWithResult(_0x1ea000,null))['catch'](handleError(_0x1ea000,null));};exports[_0x5a4d('0x4c')]=function(_0x325250,_0x552f80){return db['ChatInternalMessage'][_0x5a4d('0x4c')](_0x325250[_0x5a4d('0x4d')],{})[_0x5a4d('0x2c')](respondWithResult(_0x552f80,0xc9))['catch'](handleError(_0x552f80,null));};exports['update']=function(_0x9ecdbc,_0x74dbe2){if(_0x9ecdbc[_0x5a4d('0x4d')]['id']){delete _0x9ecdbc[_0x5a4d('0x4d')]['id'];}return db[_0x5a4d('0x33')]['find']({'where':{'id':_0x9ecdbc[_0x5a4d('0x49')]['id']}})['then'](handleEntityNotFound(_0x74dbe2,null))[_0x5a4d('0x2c')](saveUpdates(_0x9ecdbc['body'],null))['then'](respondWithResult(_0x74dbe2,null))[_0x5a4d('0x4e')](handleError(_0x74dbe2,null));};exports[_0x5a4d('0x2b')]=function(_0x312d3b,_0x13a04e){return db[_0x5a4d('0x33')][_0x5a4d('0x4b')]({'where':{'id':_0x312d3b[_0x5a4d('0x49')]['id']}})[_0x5a4d('0x2c')](handleEntityNotFound(_0x13a04e,null))[_0x5a4d('0x2c')](removeEntity(_0x13a04e,null))['catch'](handleError(_0x13a04e,null));};exports[_0x5a4d('0x4f')]=function(_0x1ac9b6,_0x204009){return db[_0x5a4d('0x33')][_0x5a4d('0x4f')]()[_0x5a4d('0x2c')](respondWithResult(_0x204009,null))[_0x5a4d('0x4e')](handleError(_0x204009,null));};function wrapUser(_0x104109){return function(_0x1afb99){var _0x373feb=_0x104109[_0x5a4d('0x50')]({'plain':!![]});_0x373feb['messages']=[];if(_0x1afb99){_0x373feb[_0x5a4d('0x51')]=_0x1afb99['createdAt'];_0x373feb[_0x5a4d('0x52')]=_0x1afb99;}else{_0x373feb['lastMessageAt']=moment(0x0)['format'](_0x5a4d('0x53'));_0x373feb['lastMessage']={};}return _0x373feb;};}exports[_0x5a4d('0x54')]=function(_0x4869fb,_0x14c6f8,_0x29c317){var _0x253b93=[];return db[_0x5a4d('0x55')][_0x5a4d('0x47')]({'where':{'role':['agent',_0x5a4d('0x56'),_0x5a4d('0x57')]},'attributes':['id','fullname',_0x5a4d('0x2f'),_0x5a4d('0x58'),_0x5a4d('0x59'),_0x5a4d('0x5a'),_0x5a4d('0x5b'),_0x5a4d('0x5c'),'allowmessenger',_0x5a4d('0x5d')],'order':qs['sort'](_0x5a4d('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0x5a4d('0x5f'),'attributes':['id','name',_0x5a4d('0x36')],'through':{'attributes':[]}}]})['then'](function(_0x12d387){if(_0x12d387){var _0xc416fa=_0x4869fb['user'][_0x5a4d('0x50')]({'plain':!![]});if(!_0xc416fa)throw new Error(_0x5a4d('0x60'));if(_0xc416fa[_0x5a4d('0x58')]===_0x5a4d('0x57')){return db['UserProfileSection'][_0x5a4d('0x4b')]({'where':{'name':_0x5a4d('0x61'),'userProfileId':_0xc416fa['userProfileId']},'raw':!![]})[_0x5a4d('0x2c')](function(_0x5577f8){if(_0x5577f8){if(_0x5577f8['autoAssociation']===0x0){return db[_0x5a4d('0x62')][_0x5a4d('0x47')]({'where':{'sectionId':_0x5577f8['id']},'raw':!![]})[_0x5a4d('0x2c')](function(_0x1ccafc){var _0x26b9e7=[];if(_[_0x5a4d('0x63')](_0x1ccafc)){_0x26b9e7=_[_0x5a4d('0x44')](_0x12d387,function(_0x3cfc31){if(_0x3cfc31[_0x5a4d('0x58')]!=='agent'){return _0x3cfc31;}});return _0x26b9e7;}else{for(var _0x297280=0x0;_0x297280<_0x12d387[_0x5a4d('0x3e')];_0x297280++){var _0x2bebf1=_0x12d387[_0x297280];if(_0x2bebf1[_0x5a4d('0x58')]===_0x5a4d('0x64')){var _0x90d312=_['find'](_0x1ccafc,function(_0x5ac6dc){return _0x5ac6dc[_0x5a4d('0x65')]===_0x2bebf1['id'];});if(_0x90d312)_0x26b9e7[_0x5a4d('0x66')](_0x2bebf1);}else{_0x26b9e7[_0x5a4d('0x66')](_0x2bebf1);}}return _0x26b9e7;}});}else{return _0x12d387;}}else{var _0x429dd4=_['filter'](_0x12d387,function(_0x3b5819){if(_0x3b5819['role']!==_0x5a4d('0x64')){return _0x3b5819;}});return _0x429dd4;}});}else{return _0x12d387;}}})[_0x5a4d('0x2c')](function(_0x591a53){var _0x31caae=[];if(_0x591a53){_0x253b93=_0x591a53;for(var _0x520f24=0x0;_0x520f24<_0x591a53['length'];_0x520f24+=0x1){_0x253b93[_0x520f24][_0x5a4d('0x67')]=[];_0x31caae[_0x5a4d('0x66')](db[_0x5a4d('0x33')][_0x5a4d('0x4b')]({'where':{'FromId':[_0x4869fb['user']['id'],_0x591a53[_0x520f24]['id']],'ToId':[_0x4869fb[_0x5a4d('0x57')]['id'],_0x591a53[_0x520f24]['id']],'ChatGroupId':null},'attributes':['id',_0x5a4d('0x68'),'FromId',_0x5a4d('0x69'),'read',_0x5a4d('0x4d')],'order':qs[_0x5a4d('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5a4d('0x2c')](wrapUser(_0x591a53[_0x520f24])));}return BPromise['all'](_0x31caae);}return[];})[_0x5a4d('0x2c')](function(_0x5e0101){return{'rows':_0x5e0101,'count':_0x5e0101[_0x5a4d('0x3e')]};})['then'](respondWithResult(_0x14c6f8,null))['catch'](handleError(_0x14c6f8,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index eafee73..0dcc7e9 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 _0x0ca9=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1f11e1,_0xd4457){var _0x205483=function(_0x27f7ba){while(--_0x27f7ba){_0x1f11e1['push'](_0x1f11e1['shift']());}};_0x205483(++_0xd4457);}(_0x0ca9,0x99));var _0x90ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ca9[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x90ca('0x0'));var ChatInternalMessage=require(_0x90ca('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x90ca('0x2')](0x0);var events={'afterCreate':_0x90ca('0x3'),'afterUpdate':_0x90ca('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5de2ae){return function(_0x5e0176,_0xd0d745,_0x1e2a91){ChatInternalMessageEvents[_0x90ca('0x5')](_0x5de2ae+':'+_0x5e0176['id'],_0x5e0176);ChatInternalMessageEvents[_0x90ca('0x5')](_0x5de2ae,_0x5e0176);_0x1e2a91(null);};}for(var e in events){if(events[_0x90ca('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x90ca('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x0490=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5628b8,_0x145582){var _0x3ce423=function(_0x114c97){while(--_0x114c97){_0x5628b8['push'](_0x5628b8['shift']());}};_0x3ce423(++_0x145582);}(_0x0490,0x14d));var _0x0049=function(_0x1464f3,_0x7e1fd7){_0x1464f3=_0x1464f3-0x0;var _0x5730f8=_0x0490[_0x1464f3];return _0x5730f8;};'use strict';var EventEmitter=require(_0x0049('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x0049('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0049('0x2')](0x0);var events={'afterCreate':_0x0049('0x3'),'afterUpdate':_0x0049('0x4'),'afterDestroy':_0x0049('0x5')};function emitEvent(_0x3a6ba7){return function(_0x3e2b3c,_0x503c9a,_0x1878d2){ChatInternalMessageEvents[_0x0049('0x6')](_0x3a6ba7+':'+_0x3e2b3c['id'],_0x3e2b3c);ChatInternalMessageEvents[_0x0049('0x6')](_0x3a6ba7,_0x3e2b3c);_0x1878d2(null);};}for(var e in events){if(events[_0x0049('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x0049('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 1e37049..9945278 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 _0x94ab=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x94ab,0x7c));var _0xb94a=function(_0x17da1b,_0x3db616){_0x17da1b=_0x17da1b-0x0;var _0x1bc8ca=_0x94ab[_0x17da1b];return _0x1bc8ca;};'use strict';var _=require(_0xb94a('0x0'));var util=require(_0xb94a('0x1'));var logger=require(_0xb94a('0x2'))(_0xb94a('0x3'));var moment=require(_0xb94a('0x4'));var BPromise=require(_0xb94a('0x5'));var rp=require(_0xb94a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb94a('0x7'));var config=require(_0xb94a('0x8'));var attributes=require(_0xb94a('0x9'));module[_0xb94a('0xa')]=function(_0x4f1f98,_0x4e30d9){return _0x4f1f98['define'](_0xb94a('0xb'),attributes,{'tableName':_0xb94a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb94a('0xd'),'collate':_0xb94a('0xe')});};
\ No newline at end of file
+var _0xeb10=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x29d132,_0x545dcf){var _0x161e31=function(_0x32ddb6){while(--_0x32ddb6){_0x29d132['push'](_0x29d132['shift']());}};_0x161e31(++_0x545dcf);}(_0xeb10,0x147));var _0x0eb1=function(_0x3fb8a9,_0x112ea9){_0x3fb8a9=_0x3fb8a9-0x0;var _0x33fe3b=_0xeb10[_0x3fb8a9];return _0x33fe3b;};'use strict';var _=require(_0x0eb1('0x0'));var util=require('util');var logger=require(_0x0eb1('0x1'))(_0x0eb1('0x2'));var moment=require('moment');var BPromise=require(_0x0eb1('0x3'));var rp=require(_0x0eb1('0x4'));var fs=require('fs');var path=require(_0x0eb1('0x5'));var rimraf=require(_0x0eb1('0x6'));var config=require(_0x0eb1('0x7'));var attributes=require(_0x0eb1('0x8'));module[_0x0eb1('0x9')]=function(_0x45ff24,_0x11e765){return _0x45ff24[_0x0eb1('0xa')](_0x0eb1('0xb'),attributes,{'tableName':_0x0eb1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0eb1('0xd'),'collate':_0x0eb1('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 962ff5b..09f73c8 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 _0x7de4=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x7de4,0xb4));var _0x47de=function(_0x49ee1d,_0x5d8938){_0x49ee1d=_0x49ee1d-0x0;var _0x2af3ed=_0x7de4[_0x49ee1d];return _0x2af3ed;};'use strict';var _=require(_0x47de('0x0'));var util=require('util');var moment=require(_0x47de('0x1'));var BPromise=require(_0x47de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47de('0x3'));var db=require(_0x47de('0x4'))['db'];var utils=require(_0x47de('0x5'));var logger=require(_0x47de('0x6'))(_0x47de('0x7'));var config=require(_0x47de('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x47de('0x9')]({'port':0x232a});config['redis']=_[_0x47de('0xa')](config[_0x47de('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x47de('0xc'))(new Redis(config[_0x47de('0xb')]));require(_0x47de('0xd'))[_0x47de('0xe')](socket);function respondWithRpcPromise(_0x1aeb62,_0x52a64c,_0x533eb5){return new BPromise(function(_0x3ce7b2,_0x54cded){return client[_0x47de('0xf')](_0x1aeb62,_0x533eb5)['then'](function(_0xaaa70c){logger[_0x47de('0x10')](_0x47de('0x11'),_0x52a64c,_0x47de('0x12'));logger[_0x47de('0x13')](_0x47de('0x14'),_0x52a64c,'request\x20sent',JSON['stringify'](_0xaaa70c));if(_0xaaa70c[_0x47de('0x15')]){if(_0xaaa70c[_0x47de('0x15')][_0x47de('0x16')]===0x1f4){logger[_0x47de('0x15')](_0x47de('0x11'),_0x52a64c,_0xaaa70c['error'][_0x47de('0x17')]);return _0x54cded(_0xaaa70c[_0x47de('0x15')][_0x47de('0x17')]);}logger[_0x47de('0x15')](_0x47de('0x11'),_0x52a64c,_0xaaa70c['error'][_0x47de('0x17')]);return _0x3ce7b2(_0xaaa70c[_0x47de('0x15')][_0x47de('0x17')]);}else{logger['info'](_0x47de('0x11'),_0x52a64c,_0x47de('0x12'));_0x3ce7b2(_0xaaa70c[_0x47de('0x18')][_0x47de('0x17')]);}})['catch'](function(_0x3b3c82){logger[_0x47de('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x52a64c,_0x3b3c82);_0x54cded(_0x3b3c82);});});}
\ No newline at end of file
+var _0x4874=['result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3b35ff,_0x1f5e62){var _0x2f737c=function(_0x58ff61){while(--_0x58ff61){_0x3b35ff['push'](_0x3b35ff['shift']());}};_0x2f737c(++_0x1f5e62);}(_0x4874,0x17b));var _0x4487=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4874[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x4487('0x0'));var moment=require(_0x4487('0x1'));var BPromise=require(_0x4487('0x2'));var rs=require(_0x4487('0x3'));var fs=require('fs');var Redis=require(_0x4487('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4487('0x5'));var logger=require(_0x4487('0x6'))('rpc');var config=require(_0x4487('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4487('0x8')][_0x4487('0x9')]({'port':0x232a});config['redis']=_[_0x4487('0xa')](config['redis'],{'host':_0x4487('0xb'),'port':0x18eb});var socket=require(_0x4487('0xc'))(new Redis(config[_0x4487('0xd')]));require(_0x4487('0xe'))[_0x4487('0xf')](socket);function respondWithRpcPromise(_0x2165b7,_0x1ed07f,_0x646303){return new BPromise(function(_0x4f2a37,_0x43fc17){return client[_0x4487('0x10')](_0x2165b7,_0x646303)[_0x4487('0x11')](function(_0x58811a){logger[_0x4487('0x12')](_0x4487('0x13'),_0x1ed07f,_0x4487('0x14'));logger[_0x4487('0x15')](_0x4487('0x16'),_0x1ed07f,_0x4487('0x14'),JSON['stringify'](_0x58811a));if(_0x58811a[_0x4487('0x17')]){if(_0x58811a[_0x4487('0x17')][_0x4487('0x18')]===0x1f4){logger[_0x4487('0x17')](_0x4487('0x13'),_0x1ed07f,_0x58811a[_0x4487('0x17')][_0x4487('0x19')]);return _0x43fc17(_0x58811a[_0x4487('0x17')]['message']);}logger[_0x4487('0x17')](_0x4487('0x13'),_0x1ed07f,_0x58811a[_0x4487('0x17')][_0x4487('0x19')]);return _0x4f2a37(_0x58811a['error'][_0x4487('0x19')]);}else{logger[_0x4487('0x12')](_0x4487('0x13'),_0x1ed07f,_0x4487('0x14'));_0x4f2a37(_0x58811a[_0x4487('0x1a')][_0x4487('0x19')]);}})['catch'](function(_0x24c7e2){logger[_0x4487('0x17')](_0x4487('0x13'),_0x1ed07f,_0x24c7e2);_0x43fc17(_0x24c7e2);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 48648d3..4f0b9b1 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 _0x73a1=['update','emit','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x3f7854,_0x58eeae){var _0x119409=function(_0xc2d98e){while(--_0xc2d98e){_0x3f7854['push'](_0x3f7854['shift']());}};_0x119409(++_0x58eeae);}(_0x73a1,0x83));var _0x173a=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0x73a1[_0x5e3701];return _0x345dcf;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x173a('0x0'),_0x173a('0x1'),_0x173a('0x2')];function createListener(_0x51b0ce,_0x3c4e86){return function(_0x21c93f){_0x3c4e86[_0x173a('0x3')](_0x51b0ce,_0x21c93f);};}function removeListener(_0x28bab5,_0x14e7e0){return function(){ChatInternalMessageEvents[_0x173a('0x4')](_0x28bab5,_0x14e7e0);};}exports[_0x173a('0x5')]=function(_0x4e5915){for(var _0x57480e=0x0,_0x337c01=events['length'];_0x57480e<_0x337c01;_0x57480e++){var _0x41b677=events[_0x57480e];var _0x2fc183=createListener(_0x173a('0x6')+_0x41b677,_0x4e5915);ChatInternalMessageEvents['on'](_0x41b677,_0x2fc183);}};
\ No newline at end of file
+var _0x69cb=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x5f5769,_0x20bcd4){var _0x1c5f91=function(_0x59fcae){while(--_0x59fcae){_0x5f5769['push'](_0x5f5769['shift']());}};_0x1c5f91(++_0x20bcd4);}(_0x69cb,0x11d));var _0xb69c=function(_0x253b45,_0x32b9da){_0x253b45=_0x253b45-0x0;var _0x3e1947=_0x69cb[_0x253b45];return _0x3e1947;};'use strict';var ChatInternalMessageEvents=require(_0xb69c('0x0'));var events=[_0xb69c('0x1'),'remove','update'];function createListener(_0x40c987,_0x2c10c3){return function(_0x15b8ad){_0x2c10c3[_0xb69c('0x2')](_0x40c987,_0x15b8ad);};}function removeListener(_0x4e851f,_0x144579){return function(){ChatInternalMessageEvents[_0xb69c('0x3')](_0x4e851f,_0x144579);};}exports[_0xb69c('0x4')]=function(_0x1d88ef){for(var _0x4a5818=0x0,_0x56419=events[_0xb69c('0x5')];_0x4a5818<_0x56419;_0x4a5818++){var _0x7dfd33=events[_0x4a5818];var _0x2328fb=createListener(_0xb69c('0x6')+_0x7dfd33,_0x1d88ef);ChatInternalMessageEvents['on'](_0x7dfd33,_0x2328fb);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 921a69f..ea2dd60 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 _0x94e3=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0xe2b9bf,_0x567caf){var _0x3a5d23=function(_0x1a3765){while(--_0x1a3765){_0xe2b9bf['push'](_0xe2b9bf['shift']());}};_0x3a5d23(++_0x567caf);}(_0x94e3,0x1c4));var _0x394e=function(_0x10ebe3,_0x44f9d5){_0x10ebe3=_0x10ebe3-0x0;var _0x269243=_0x94e3[_0x10ebe3];return _0x269243;};'use strict';var multer=require(_0x394e('0x0'));var util=require(_0x394e('0x1'));var path=require('path');var timeout=require(_0x394e('0x2'));var express=require(_0x394e('0x3'));var router=express[_0x394e('0x4')]();var fs_extra=require(_0x394e('0x5'));var auth=require(_0x394e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x394e('0x7'));var controller=require(_0x394e('0x8'));router[_0x394e('0x9')]('/',auth[_0x394e('0xa')](),controller[_0x394e('0xb')]);router[_0x394e('0x9')](_0x394e('0xc'),auth[_0x394e('0xa')](),controller['describe']);router[_0x394e('0x9')](_0x394e('0xd'),auth[_0x394e('0xa')](),controller[_0x394e('0xe')]);router['get'](_0x394e('0xf'),auth[_0x394e('0xa')](),controller[_0x394e('0x10')]);router[_0x394e('0x11')]('/',auth[_0x394e('0xa')](),controller[_0x394e('0x12')]);router[_0x394e('0x13')](_0x394e('0xf'),controller[_0x394e('0x14')]);router[_0x394e('0x15')]('/:id',auth[_0x394e('0xa')](),controller[_0x394e('0x16')]);module[_0x394e('0x17')]=router;
\ No newline at end of file
+var _0x397d=['/users','getUsers','/:id','show','post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x397d,0xb9));var _0xd397=function(_0x5b13be,_0x470b8c){_0x5b13be=_0x5b13be-0x0;var _0x118500=_0x397d[_0x5b13be];return _0x118500;};'use strict';var multer=require(_0xd397('0x0'));var util=require(_0xd397('0x1'));var path=require(_0xd397('0x2'));var timeout=require('connect-timeout');var express=require(_0xd397('0x3'));var router=express[_0xd397('0x4')]();var fs_extra=require(_0xd397('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd397('0x6'));var config=require(_0xd397('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xd397('0x8')]('/',auth['isAuthenticated'](),controller[_0xd397('0x9')]);router[_0xd397('0x8')](_0xd397('0xa'),auth[_0xd397('0xb')](),controller[_0xd397('0xc')]);router[_0xd397('0x8')](_0xd397('0xd'),auth[_0xd397('0xb')](),controller[_0xd397('0xe')]);router[_0xd397('0x8')](_0xd397('0xf'),auth[_0xd397('0xb')](),controller[_0xd397('0x10')]);router[_0xd397('0x11')]('/',auth[_0xd397('0xb')](),controller[_0xd397('0x12')]);router[_0xd397('0x13')](_0xd397('0xf'),controller[_0xd397('0x14')]);router[_0xd397('0x15')](_0xd397('0xf'),auth[_0xd397('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 166f8a4..0838971 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 _0x80cd=['BOOLEAN','ENUM','out','STRING','exports','TEXT','medium'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x80cd,0x146));var _0xd80c=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x80cd[_0x12d6c2];return _0x1c9825;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'body':{'type':Sequelize[_0xd80c('0x1')](_0xd80c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd80c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd80c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd80c('0x4')]('in',_0xd80c('0x5')),'defaultValue':_0xd80c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd80c('0x6')]},'providerResponse':{'type':Sequelize[_0xd80c('0x1')]}};
\ No newline at end of file
+var _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0x1d21,0x158));var _0x11d2=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x1d21[_0x28e2cd];return _0x11fd46;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index d4d4b7a..5ecc023 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x4f50aa,_0x4f0efd){var _0x4a675b=function(_0x43559d){while(--_0x43559d){_0x4f50aa['push'](_0x4f50aa['shift']());}};_0x4a675b(++_0x4f0efd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x18ecae,_0x2bf366){var _0x2fe95b=function(_0x5143a5){while(--_0x5143a5){_0x18ecae['push'](_0x18ecae['shift']());}};_0x2fe95b(++_0x2bf366);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 39c0c60..c0e8add 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 _0x4494=['save','remove','emit','hook','events','setMaxListeners'];(function(_0x590e74,_0x49de34){var _0x192110=function(_0x479fad){while(--_0x479fad){_0x590e74['push'](_0x590e74['shift']());}};_0x192110(++_0x49de34);}(_0x4494,0x1c0));var _0x4449=function(_0x227fba,_0x33df5c){_0x227fba=_0x227fba-0x0;var _0x56ff80=_0x4494[_0x227fba];return _0x56ff80;};'use strict';var EventEmitter=require(_0x4449('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4449('0x1')](0x0);var events={'afterCreate':_0x4449('0x2'),'afterUpdate':'update','afterDestroy':_0x4449('0x3')};function emitEvent(_0xa9be76){return function(_0x1dc84d,_0x2cd062,_0x5a7f25){ChatMessageEvents[_0x4449('0x4')](_0xa9be76+':'+_0x1dc84d['id'],_0x1dc84d);ChatMessageEvents['emit'](_0xa9be76,_0x1dc84d);_0x5a7f25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x4449('0x5')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x3a36=['update','remove','emit','hook','exports','ChatMessage','setMaxListeners','save'];(function(_0x12c3d7,_0x30320a){var _0x43178f=function(_0x5cb92b){while(--_0x5cb92b){_0x12c3d7['push'](_0x12c3d7['shift']());}};_0x43178f(++_0x30320a);}(_0x3a36,0x12d));var _0x63a3=function(_0x29f07b,_0x20fc7a){_0x29f07b=_0x29f07b-0x0;var _0x24f90d=_0x3a36[_0x29f07b];return _0x24f90d;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x63a3('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x63a3('0x1')](0x0);var events={'afterCreate':_0x63a3('0x2'),'afterUpdate':_0x63a3('0x3'),'afterDestroy':_0x63a3('0x4')};function emitEvent(_0x1b3fe5){return function(_0x512b92,_0x100d1e,_0x1f345f){ChatMessageEvents[_0x63a3('0x5')](_0x1b3fe5+':'+_0x512b92['id'],_0x512b92);ChatMessageEvents[_0x63a3('0x5')](_0x1b3fe5,_0x512b92);_0x1f345f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x63a3('0x6')](e,emitEvent(event));}}module[_0x63a3('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 03e3d48..ef156a1 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 _0x4907=['get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','fti_chat_messages','body','FULLTEXT','models'];(function(_0x56ab7e,_0x3d47af){var _0x4205b9=function(_0x362220){while(--_0x362220){_0x56ab7e['push'](_0x56ab7e['shift']());}};_0x4205b9(++_0x3d47af);}(_0x4907,0x131));var _0x7490=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4907[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7490('0x0'));var util=require(_0x7490('0x1'));var logger=require(_0x7490('0x2'))(_0x7490('0x3'));var moment=require('moment');var BPromise=require(_0x7490('0x4'));var rp=require(_0x7490('0x5'));var fs=require('fs');var path=require(_0x7490('0x6'));var rimraf=require('rimraf');var config=require(_0x7490('0x7'));var attributes=require(_0x7490('0x8'));module['exports']=function(_0x383096,_0x2e88c3){return _0x383096[_0x7490('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x7490('0xa'),'fields':[_0x7490('0xb')],'type':_0x7490('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x163606,_0x2b65e0,_0x24eb89){var _0x2e84b6=_0x383096[_0x7490('0xd')];var _0x4297b9=_0x163606[_0x7490('0xe')]({'plain':!![]});if(_0x4297b9['direction']['toLowerCase']()==='in'||_0x4297b9[_0x7490('0xf')][_0x7490('0x10')]()===_0x7490('0x11')&&!_0x4297b9['secret']&&!_[_0x7490('0x12')](_0x4297b9[_0x7490('0x13')])){_0x2e84b6[_0x7490('0x14')][_0x7490('0x15')]({'where':{'id':_0x4297b9[_0x7490('0x16')]}})['then'](function(_0x49c919){if(_0x49c919){_0x49c919[_0x7490('0x17')]({'lastMsgAt':_0x4297b9[_0x7490('0x18')],'lastMsgDirection':_0x4297b9[_0x7490('0xf')]['toLowerCase']()});}})[_0x7490('0x19')](function(_0xb2d744){console[_0x7490('0x1a')](_0xb2d744);});}_0x24eb89();}},'charset':_0x7490('0x1b'),'collate':_0x7490('0x1c')});};
\ No newline at end of file
+var _0x4d84=['body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x5801f9,_0x3d95dd){var _0x34230d=function(_0x58150b){while(--_0x58150b){_0x5801f9['push'](_0x5801f9['shift']());}};_0x34230d(++_0x3d95dd);}(_0x4d84,0xad));var _0x44d8=function(_0x55c76f,_0x13b7f4){_0x55c76f=_0x55c76f-0x0;var _0x1571ff=_0x4d84[_0x55c76f];return _0x1571ff;};'use strict';var _=require(_0x44d8('0x0'));var util=require(_0x44d8('0x1'));var logger=require(_0x44d8('0x2'))(_0x44d8('0x3'));var moment=require(_0x44d8('0x4'));var BPromise=require(_0x44d8('0x5'));var rp=require(_0x44d8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44d8('0x7'));module[_0x44d8('0x8')]=function(_0x2cade6,_0x4ade8b){return _0x2cade6[_0x44d8('0x9')](_0x44d8('0xa'),attributes,{'tableName':_0x44d8('0xb'),'paranoid':![],'indexes':[{'name':_0x44d8('0xc'),'fields':[_0x44d8('0xd')],'type':_0x44d8('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31a49c,_0x37201b,_0x5ea9ef){var _0x55e275=_0x2cade6['models'];var _0x454fcf=_0x31a49c[_0x44d8('0xf')]({'plain':!![]});if(_0x454fcf[_0x44d8('0x10')][_0x44d8('0x11')]()==='in'||_0x454fcf['direction'][_0x44d8('0x11')]()===_0x44d8('0x12')&&!_0x454fcf[_0x44d8('0x13')]&&!_[_0x44d8('0x14')](_0x454fcf[_0x44d8('0x15')])){_0x55e275[_0x44d8('0x16')][_0x44d8('0x17')]({'where':{'id':_0x454fcf[_0x44d8('0x18')]}})[_0x44d8('0x19')](function(_0xe4150c){if(_0xe4150c){_0xe4150c['update']({'lastMsgAt':_0x454fcf[_0x44d8('0x1a')],'lastMsgDirection':_0x454fcf[_0x44d8('0x10')][_0x44d8('0x11')]()});}})[_0x44d8('0x1b')](function(_0xf2f189){console[_0x44d8('0x1c')](_0xf2f189);});}_0x5ea9ef();}},'charset':_0x44d8('0x1d'),'collate':_0x44d8('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9508601..a4f1205 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 _0xf69c=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','info','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request'];(function(_0x3ad9b3,_0x5c76e9){var _0x4ef8d1=function(_0x239036){while(--_0x239036){_0x3ad9b3['push'](_0x3ad9b3['shift']());}};_0x4ef8d1(++_0x5c76e9);}(_0xf69c,0x151));var _0xcf69=function(_0x55a7c2,_0x365314){_0x55a7c2=_0x55a7c2-0x0;var _0xd12715=_0xf69c[_0x55a7c2];return _0xd12715;};'use strict';var _=require(_0xcf69('0x0'));var util=require('util');var moment=require(_0xcf69('0x1'));var BPromise=require(_0xcf69('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf69('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf69('0x4'));var logger=require('../../config/logger')(_0xcf69('0x5'));var config=require('../../config/environment');var jayson=require(_0xcf69('0x6'));var client=jayson[_0xcf69('0x7')][_0xcf69('0x8')]({'port':0x232a});config[_0xcf69('0x9')]=_[_0xcf69('0xa')](config['redis'],{'host':_0xcf69('0xb'),'port':0x18eb});var socket=require(_0xcf69('0xc'))(new Redis(config[_0xcf69('0x9')]));require(_0xcf69('0xd'))['register'](socket);function respondWithRpcPromise(_0xd73ebd,_0x38489e,_0x914e95){return new BPromise(function(_0x19b782,_0x449f75){return client[_0xcf69('0xe')](_0xd73ebd,_0x914e95)['then'](function(_0x1e4e74){logger['info'](_0xcf69('0xf'),_0x38489e,_0xcf69('0x10'));logger[_0xcf69('0x11')](_0xcf69('0x12'),_0x38489e,_0xcf69('0x10'),JSON[_0xcf69('0x13')](_0x1e4e74));if(_0x1e4e74[_0xcf69('0x14')]){if(_0x1e4e74[_0xcf69('0x14')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x38489e,_0x1e4e74['error'][_0xcf69('0x15')]);return _0x449f75(_0x1e4e74['error'][_0xcf69('0x15')]);}logger[_0xcf69('0x14')](_0xcf69('0xf'),_0x38489e,_0x1e4e74[_0xcf69('0x14')]['message']);return _0x19b782(_0x1e4e74[_0xcf69('0x14')][_0xcf69('0x15')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x38489e,_0xcf69('0x10'));_0x19b782(_0x1e4e74[_0xcf69('0x16')][_0xcf69('0x15')]);}})[_0xcf69('0x17')](function(_0xcdd2d8){logger[_0xcf69('0x14')](_0xcf69('0xf'),_0x38489e,_0xcdd2d8);_0x449f75(_0xcdd2d8);});});}exports[_0xcf69('0x18')]=function(_0x53666e){var _0x19b5ed=this;return new Promise(function(_0x5c35e3,_0xbe9cd5){return db[_0xcf69('0x19')][_0xcf69('0x1a')](_0x53666e[_0xcf69('0x1b')],{'raw':_0x53666e[_0xcf69('0x1c')]?_0x53666e[_0xcf69('0x1c')][_0xcf69('0x1d')]===undefined?!![]:![]:!![]})[_0xcf69('0x1e')](function(_0x3a159f){logger[_0xcf69('0x1f')](_0xcf69('0x18'),_0x53666e);logger[_0xcf69('0x11')](_0xcf69('0x18'),_0x53666e,JSON[_0xcf69('0x13')](_0x3a159f));_0x5c35e3(_0x3a159f);})[_0xcf69('0x17')](function(_0x5d16ef){logger[_0xcf69('0x14')](_0xcf69('0x18'),_0x5d16ef[_0xcf69('0x15')],_0x53666e);_0xbe9cd5(_0x19b5ed[_0xcf69('0x14')](0x1f4,_0x5d16ef[_0xcf69('0x15')]));});});};
\ No newline at end of file
+var _0xdf55=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','create','body','options','raw','then','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x1d900d,_0x1dcaf4){var _0x500261=function(_0x1bb144){while(--_0x1bb144){_0x1d900d['push'](_0x1d900d['shift']());}};_0x500261(++_0x1dcaf4);}(_0xdf55,0x83));var _0x5df5=function(_0xc5775d,_0x3701ab){_0xc5775d=_0xc5775d-0x0;var _0x3b4edd=_0xdf55[_0xc5775d];return _0x3b4edd;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});config[_0x5df5('0xb')]=_[_0x5df5('0xc')](config[_0x5df5('0xb')],{'host':_0x5df5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5df5('0xb')]));require(_0x5df5('0xe'))[_0x5df5('0xf')](socket);function respondWithRpcPromise(_0x4787f1,_0x52ed26,_0x39711b){return new BPromise(function(_0x4e80bd,_0x45ad13){return client[_0x5df5('0x10')](_0x4787f1,_0x39711b)['then'](function(_0x59d273){logger[_0x5df5('0x11')](_0x5df5('0x12'),_0x52ed26,_0x5df5('0x13'));logger[_0x5df5('0x14')](_0x5df5('0x15'),_0x52ed26,_0x5df5('0x13'),JSON[_0x5df5('0x16')](_0x59d273));if(_0x59d273[_0x5df5('0x17')]){if(_0x59d273[_0x5df5('0x17')][_0x5df5('0x18')]===0x1f4){logger['error'](_0x5df5('0x12'),_0x52ed26,_0x59d273['error'][_0x5df5('0x19')]);return _0x45ad13(_0x59d273[_0x5df5('0x17')][_0x5df5('0x19')]);}logger[_0x5df5('0x17')](_0x5df5('0x12'),_0x52ed26,_0x59d273['error'][_0x5df5('0x19')]);return _0x4e80bd(_0x59d273[_0x5df5('0x17')]['message']);}else{logger[_0x5df5('0x11')](_0x5df5('0x12'),_0x52ed26,_0x5df5('0x13'));_0x4e80bd(_0x59d273[_0x5df5('0x1a')][_0x5df5('0x19')]);}})['catch'](function(_0x589093){logger[_0x5df5('0x17')]('ChatMessage,\x20%s,\x20%s',_0x52ed26,_0x589093);_0x45ad13(_0x589093);});});}exports[_0x5df5('0x1b')]=function(_0x40a8f5){var _0xa939e4=this;return new Promise(function(_0x34b107,_0x1deae7){return db['ChatMessage'][_0x5df5('0x1c')](_0x40a8f5[_0x5df5('0x1d')],{'raw':_0x40a8f5[_0x5df5('0x1e')]?_0x40a8f5[_0x5df5('0x1e')][_0x5df5('0x1f')]===undefined?!![]:![]:!![]})[_0x5df5('0x20')](function(_0x59ff67){logger[_0x5df5('0x11')](_0x5df5('0x1b'),_0x40a8f5);logger[_0x5df5('0x14')](_0x5df5('0x1b'),_0x40a8f5,JSON['stringify'](_0x59ff67));_0x34b107(_0x59ff67);})[_0x5df5('0x21')](function(_0x13369c){logger[_0x5df5('0x17')]('CreateChatMessage',_0x13369c['message'],_0x40a8f5);_0x1deae7(_0xa939e4['error'](0x1f4,_0x13369c[_0x5df5('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ecb4cca..37264dc 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 _0xfd6e=['./chatMessage.events','remove','length'];(function(_0x2c3ff1,_0x4999f6){var _0x296c5e=function(_0x560c05){while(--_0x560c05){_0x2c3ff1['push'](_0x2c3ff1['shift']());}};_0x296c5e(++_0x4999f6);}(_0xfd6e,0x16e));var _0xefd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd6e[_0x2641f9];return _0x585741;};'use strict';var ChatMessageEvents=require(_0xefd6('0x0'));var events=['save',_0xefd6('0x1'),'update'];function createListener(_0x229dfe,_0x41b7d0){return function(_0x54e608){_0x41b7d0['emit'](_0x229dfe,_0x54e608);};}function removeListener(_0x5f4c49,_0x27d881){return function(){ChatMessageEvents['removeListener'](_0x5f4c49,_0x27d881);};}exports['register']=function(_0x24af45){for(var _0x23f8c3=0x0,_0x26e108=events[_0xefd6('0x2')];_0x23f8c3<_0x26e108;_0x23f8c3++){var _0x340765=events[_0x23f8c3];var _0x5da399=createListener('chatMessage:'+_0x340765,_0x24af45);ChatMessageEvents['on'](_0x340765,_0x5da399);}};
\ No newline at end of file
+var _0x207c=['length','chatMessage:','save','remove','update','emit'];(function(_0x339781,_0xe299e9){var _0x5cfb6a=function(_0x37f3de){while(--_0x37f3de){_0x339781['push'](_0x339781['shift']());}};_0x5cfb6a(++_0xe299e9);}(_0x207c,0x1e8));var _0xc207=function(_0x4583d0,_0x24551f){_0x4583d0=_0x4583d0-0x0;var _0x7b3c5a=_0x207c[_0x4583d0];return _0x7b3c5a;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xc207('0x0'),_0xc207('0x1'),_0xc207('0x2')];function createListener(_0xaaba3d,_0x2b40be){return function(_0x12f1f2){_0x2b40be[_0xc207('0x3')](_0xaaba3d,_0x12f1f2);};}function removeListener(_0x4b9daa,_0x38ff02){return function(){ChatMessageEvents['removeListener'](_0x4b9daa,_0x38ff02);};}exports['register']=function(_0x55023e){for(var _0xc88789=0x0,_0x314561=events[_0xc207('0x4')];_0xc88789<_0x314561;_0xc88789++){var _0x59ff6f=events[_0xc88789];var _0x25cb97=createListener(_0xc207('0x5')+_0x59ff6f,_0x55023e);ChatMessageEvents['on'](_0x59ff6f,_0x25cb97);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 36b2d15..44a46ea 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 _0x2503=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','accept','/:id/reject','reject','delete'];(function(_0x264ff9,_0x39585b){var _0x59485a=function(_0x3372de){while(--_0x3372de){_0x264ff9['push'](_0x264ff9['shift']());}};_0x59485a(++_0x39585b);}(_0x2503,0x1dc));var _0x3250=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2503[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3250('0x0'));var util=require(_0x3250('0x1'));var path=require(_0x3250('0x2'));var timeout=require(_0x3250('0x3'));var express=require(_0x3250('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3250('0x5'));var config=require(_0x3250('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x3250('0x7')](),controller[_0x3250('0x8')]);router[_0x3250('0x9')](_0x3250('0xa'),auth[_0x3250('0x7')](),controller[_0x3250('0xb')]);router['get'](_0x3250('0xc'),auth[_0x3250('0x7')](),controller[_0x3250('0xd')]);router[_0x3250('0xe')]('/',auth['isAuthenticated'](),interaction[_0x3250('0xf')](_0x3250('0x10'),_0x3250('0x11')),controller[_0x3250('0x12')]);router[_0x3250('0x13')](_0x3250('0xc'),controller['update']);router[_0x3250('0x13')]('/:id/accept',auth[_0x3250('0x7')](),controller[_0x3250('0x14')]);router['put'](_0x3250('0x15'),auth['isAuthenticated'](),controller[_0x3250('0x16')]);router[_0x3250('0x17')](_0x3250('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3250('0x18')]=router;
\ No newline at end of file
+var _0x0e6b=['/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','chatmessage:create','put'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x0e6b,0x74));var _0xb0e6=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0x0e6b[_0x284bc3];return _0x41ac81;};'use strict';var multer=require(_0xb0e6('0x0'));var util=require(_0xb0e6('0x1'));var path=require(_0xb0e6('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e6('0x3'));var router=express[_0xb0e6('0x4')]();var fs_extra=require(_0xb0e6('0x5'));var auth=require(_0xb0e6('0x6'));var interaction=require(_0xb0e6('0x7'));var config=require(_0xb0e6('0x8'));var controller=require('./chatMessage.controller');router[_0xb0e6('0x9')]('/',auth[_0xb0e6('0xa')](),controller['index']);router[_0xb0e6('0x9')]('/describe',auth[_0xb0e6('0xa')](),controller[_0xb0e6('0xb')]);router[_0xb0e6('0x9')](_0xb0e6('0xc'),auth[_0xb0e6('0xa')](),controller['show']);router[_0xb0e6('0xd')]('/',auth[_0xb0e6('0xa')](),interaction['tracked']('chat',_0xb0e6('0xe')),controller['create']);router[_0xb0e6('0xf')](_0xb0e6('0xc'),controller['update']);router[_0xb0e6('0xf')](_0xb0e6('0x10'),auth['isAuthenticated'](),controller[_0xb0e6('0x11')]);router[_0xb0e6('0xf')](_0xb0e6('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xb0e6('0x13')]('/:id',auth[_0xb0e6('0xa')](),controller[_0xb0e6('0x14')]);module[_0xb0e6('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index aae9873..c3e55fa 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 _0x8ae1=['sequelize','exports','TEXT','medium'];(function(_0x39a06d,_0x2c467c){var _0x11db85=function(_0x20e6d4){while(--_0x20e6d4){_0x39a06d['push'](_0x39a06d['shift']());}};_0x11db85(++_0x2c467c);}(_0x8ae1,0x1c8));var _0x18ae=function(_0x2e4a,_0x5a9111){_0x2e4a=_0x2e4a-0x0;var _0x590ee8=_0x8ae1[_0x2e4a];return _0x590ee8;};'use strict';var Sequelize=require(_0x18ae('0x0'));module[_0x18ae('0x1')]={'body':{'type':Sequelize[_0x18ae('0x2')](_0x18ae('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xf246=['exports','TEXT','sequelize'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xf246,0x74));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6f24('0x0'));module[_0x6f24('0x1')]={'body':{'type':Sequelize[_0x6f24('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 3dac645..0abaff9 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(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x7a54,0x106));var _0x47a5=function(_0x2700c5,_0x5c4c1e){_0x2700c5=_0x2700c5-0x0;var _0xf2dc53=_0x7a54[_0x2700c5];return _0xf2dc53;};'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 _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(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1187,_0x16d9e1){_0x5e1187=_0x5e1187-0x0;var _0x58fbd4=_0x7a54[_0x5e1187];return _0x58fbd4;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index eba1530..b653e14 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 _0x2ed7=['api','moment','bluebird','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ed7,0xfa));var _0x72ed=function(_0x3e3bbc,_0x327081){_0x3e3bbc=_0x3e3bbc-0x0;var _0x1c2330=_0x2ed7[_0x3e3bbc];return _0x1c2330;};'use strict';var _=require(_0x72ed('0x0'));var util=require(_0x72ed('0x1'));var logger=require('../../config/logger')(_0x72ed('0x2'));var moment=require(_0x72ed('0x3'));var BPromise=require(_0x72ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x72ed('0x5'));var config=require('../../config/environment');var attributes=require(_0x72ed('0x6'));module[_0x72ed('0x7')]=function(_0x4f6707,_0x548eb0){return _0x4f6707[_0x72ed('0x8')](_0x72ed('0x9'),attributes,{'tableName':_0x72ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x72ed('0xb')});};
\ No newline at end of file
+var _0x7881=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','util'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x7881,0xd7));var _0x1788=function(_0x24e9f2,_0x187ea5){_0x24e9f2=_0x24e9f2-0x0;var _0x359108=_0x7881[_0x24e9f2];return _0x359108;};'use strict';var _=require('lodash');var util=require(_0x1788('0x0'));var logger=require(_0x1788('0x1'))('api');var moment=require(_0x1788('0x2'));var BPromise=require(_0x1788('0x3'));var rp=require(_0x1788('0x4'));var fs=require('fs');var path=require(_0x1788('0x5'));var rimraf=require('rimraf');var config=require(_0x1788('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x1788('0x7')]=function(_0x46aaea,_0x377c24){return _0x46aaea[_0x1788('0x8')](_0x1788('0x9'),attributes,{'tableName':_0x1788('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1788('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index e4df8f5..a2853f0 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 _0x91c7=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x91c7,0x10e));var _0x791c=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x91c7[_0xb301d4];return _0x3b5bde;};'use strict';var _=require(_0x791c('0x0'));var util=require(_0x791c('0x1'));var moment=require(_0x791c('0x2'));var BPromise=require(_0x791c('0x3'));var rs=require(_0x791c('0x4'));var fs=require('fs');var Redis=require(_0x791c('0x5'));var db=require(_0x791c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x791c('0x7'))(_0x791c('0x8'));var config=require('../../config/environment');var jayson=require(_0x791c('0x9'));var client=jayson[_0x791c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9ceea4,_0x3027e4,_0x34a4ab){return new BPromise(function(_0x36ba9c,_0x32c2c7){return client[_0x791c('0xb')](_0x9ceea4,_0x34a4ab)['then'](function(_0x32136e){logger[_0x791c('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3027e4,_0x791c('0xd'));logger[_0x791c('0xe')](_0x791c('0xf'),_0x3027e4,_0x791c('0xd'),JSON[_0x791c('0x10')](_0x32136e));if(_0x32136e[_0x791c('0x11')]){if(_0x32136e[_0x791c('0x11')][_0x791c('0x12')]===0x1f4){logger[_0x791c('0x11')](_0x791c('0x13'),_0x3027e4,_0x32136e[_0x791c('0x11')][_0x791c('0x14')]);return _0x32c2c7(_0x32136e[_0x791c('0x11')][_0x791c('0x14')]);}logger[_0x791c('0x11')](_0x791c('0x13'),_0x3027e4,_0x32136e[_0x791c('0x11')][_0x791c('0x14')]);return _0x36ba9c(_0x32136e[_0x791c('0x11')][_0x791c('0x14')]);}else{logger[_0x791c('0xc')](_0x791c('0x13'),_0x3027e4,_0x791c('0xd'));_0x36ba9c(_0x32136e[_0x791c('0x15')][_0x791c('0x14')]);}})[_0x791c('0x16')](function(_0x3b7f91){logger['error'](_0x791c('0x13'),_0x3027e4,_0x3b7f91);_0x32c2c7(_0x3b7f91);});});}
\ No newline at end of file
+var _0x1b4e=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x1b4e,0x1ad));var _0xe1b4=function(_0x300f1c,_0x34005a){_0x300f1c=_0x300f1c-0x0;var _0x3b1556=_0x1b4e[_0x300f1c];return _0x3b1556;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var moment=require(_0xe1b4('0x2'));var BPromise=require(_0xe1b4('0x3'));var rs=require(_0xe1b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1b4('0x5'))['db'];var utils=require(_0xe1b4('0x6'));var logger=require(_0xe1b4('0x7'))(_0xe1b4('0x8'));var config=require(_0xe1b4('0x9'));var jayson=require(_0xe1b4('0xa'));var client=jayson[_0xe1b4('0xb')][_0xe1b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5648fb,_0x310fb6,_0x13f259){return new BPromise(function(_0x2ba587,_0x4e5583){return client[_0xe1b4('0xd')](_0x5648fb,_0x13f259)['then'](function(_0x37154f){logger['info'](_0xe1b4('0xe'),_0x310fb6,_0xe1b4('0xf'));logger[_0xe1b4('0x10')](_0xe1b4('0x11'),_0x310fb6,_0xe1b4('0xf'),JSON[_0xe1b4('0x12')](_0x37154f));if(_0x37154f[_0xe1b4('0x13')]){if(_0x37154f[_0xe1b4('0x13')][_0xe1b4('0x14')]===0x1f4){logger[_0xe1b4('0x13')](_0xe1b4('0xe'),_0x310fb6,_0x37154f[_0xe1b4('0x13')][_0xe1b4('0x15')]);return _0x4e5583(_0x37154f[_0xe1b4('0x13')][_0xe1b4('0x15')]);}logger[_0xe1b4('0x13')](_0xe1b4('0xe'),_0x310fb6,_0x37154f[_0xe1b4('0x13')][_0xe1b4('0x15')]);return _0x2ba587(_0x37154f[_0xe1b4('0x13')][_0xe1b4('0x15')]);}else{logger[_0xe1b4('0x16')](_0xe1b4('0xe'),_0x310fb6,'request\x20sent');_0x2ba587(_0x37154f[_0xe1b4('0x17')][_0xe1b4('0x15')]);}})[_0xe1b4('0x18')](function(_0x33586a){logger[_0xe1b4('0x13')](_0xe1b4('0xe'),_0x310fb6,_0x33586a);_0x4e5583(_0x33586a);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index ba237ea..3b89d9f 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 _0x5539=['put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5539,0x192));var _0x9553=function(_0xc064ef,_0x4fcf13){_0xc064ef=_0xc064ef-0x0;var _0x43bed0=_0x5539[_0xc064ef];return _0x43bed0;};'use strict';var multer=require(_0x9553('0x0'));var util=require(_0x9553('0x1'));var path=require(_0x9553('0x2'));var timeout=require(_0x9553('0x3'));var express=require(_0x9553('0x4'));var router=express[_0x9553('0x5')]();var fs_extra=require(_0x9553('0x6'));var auth=require(_0x9553('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9553('0x8'));var controller=require(_0x9553('0x9'));router['get']('/',auth[_0x9553('0xa')](),controller[_0x9553('0xb')]);router['get'](_0x9553('0xc'),auth['isAuthenticated'](),controller[_0x9553('0xd')]);router[_0x9553('0xe')](_0x9553('0xf'),auth[_0x9553('0xa')](),controller[_0x9553('0x10')]);router[_0x9553('0x11')]('/',auth[_0x9553('0xa')](),controller['create']);router[_0x9553('0x12')](_0x9553('0xf'),auth[_0x9553('0xa')](),controller['update']);router['delete'](_0x9553('0xf'),auth[_0x9553('0xa')](),controller[_0x9553('0x13')]);module[_0x9553('0x14')]=router;
\ No newline at end of file
+var _0x7bc7=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7bc7,0x8c));var _0x77bc=function(_0x5bdad6,_0x665e9a){_0x5bdad6=_0x5bdad6-0x0;var _0x223c78=_0x7bc7[_0x5bdad6];return _0x223c78;};'use strict';var multer=require(_0x77bc('0x0'));var util=require('util');var path=require(_0x77bc('0x1'));var timeout=require(_0x77bc('0x2'));var express=require('express');var router=express[_0x77bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x77bc('0x4'));var interaction=require(_0x77bc('0x5'));var config=require(_0x77bc('0x6'));var controller=require(_0x77bc('0x7'));router[_0x77bc('0x8')]('/',auth['isAuthenticated'](),controller[_0x77bc('0x9')]);router[_0x77bc('0x8')](_0x77bc('0xa'),auth[_0x77bc('0xb')](),controller[_0x77bc('0xc')]);router[_0x77bc('0x8')](_0x77bc('0xd'),auth[_0x77bc('0xb')](),controller[_0x77bc('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x77bc('0xf')]);router[_0x77bc('0x10')](_0x77bc('0xd'),auth[_0x77bc('0xb')](),controller[_0x77bc('0x11')]);router[_0x77bc('0x12')](_0x77bc('0xd'),auth['isAuthenticated'](),controller[_0x77bc('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 76230d7..bd151e2 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 _0x4a8a=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x9e74e6,_0x27eaf4){var _0x14de1c=function(_0x5a4163){while(--_0x5a4163){_0x9e74e6['push'](_0x9e74e6['shift']());}};_0x14de1c(++_0x27eaf4);}(_0x4a8a,0x182));var _0xa4a8=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x4a8a[_0xfedc72];return _0x2c7c78;};'use strict';var Sequelize=require(_0xa4a8('0x0'));module[_0xa4a8('0x1')]={'name':{'type':Sequelize[_0xa4a8('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa4a8('0x3'),_0xa4a8('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa4a8('0x2')]},'timeout':{'type':Sequelize[_0xa4a8('0x5')]}};
\ No newline at end of file
+var _0xda68=['ENUM','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x293837,_0x4d44e3){var _0x2d84d2=function(_0x4caa58){while(--_0x4caa58){_0x293837['push'](_0x293837['shift']());}};_0x2d84d2(++_0x4d44e3);}(_0xda68,0x76));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8da6('0x0'));module[_0x8da6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8da6('0x2')]('mouseOver',_0x8da6('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x8da6('0x4')]},'timeout':{'type':Sequelize[_0x8da6('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 17a1321..4f1b1e2 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 _0xb717=['limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0xb717,0x1b4));var _0x7b71=function(_0xed6bab,_0x5b0a47){_0xed6bab=_0xed6bab-0x0;var _0x45c2b0=_0xb717[_0xed6bab];return _0x45c2b0;};'use strict';var emlformat=require(_0x7b71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b71('0x2'));var moment=require(_0x7b71('0x3'));var BPromise=require(_0x7b71('0x4'));var Mustache=require('mustache');var util=require(_0x7b71('0x5'));var path=require(_0x7b71('0x6'));var sox=require(_0x7b71('0x7'));var csv=require(_0x7b71('0x8'));var ejs=require(_0x7b71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b71('0xa'));var squel=require(_0x7b71('0xb'));var crypto=require(_0x7b71('0xc'));var jsforce=require(_0x7b71('0xd'));var deskjs=require(_0x7b71('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b71('0xf'));var Papa=require(_0x7b71('0x10'));var Redis=require('ioredis');var authService=require(_0x7b71('0x11'));var qs=require(_0x7b71('0x12'));var as=require(_0x7b71('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b71('0x14'))('api');var utils=require(_0x7b71('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7b71('0x16'));var db=require(_0x7b71('0x17'))['db'];function respondWithStatusCode(_0x291ba5,_0x101181){_0x101181=_0x101181||0xcc;return function(_0x45c890){if(_0x45c890){return _0x291ba5['sendStatus'](_0x101181);}return _0x291ba5[_0x7b71('0x18')](_0x101181)['end']();};}function respondWithResult(_0x121e8f,_0x22114a){_0x22114a=_0x22114a||0xc8;return function(_0x4f1f41){if(_0x4f1f41){return _0x121e8f[_0x7b71('0x18')](_0x22114a)[_0x7b71('0x19')](_0x4f1f41);}};}function respondWithFilteredResult(_0x4266e5,_0x5888f9){return function(_0x5e7c3a){if(_0x5e7c3a){var _0xadd51e=typeof _0x5888f9[_0x7b71('0x1a')]===_0x7b71('0x1b')&&typeof _0x5888f9[_0x7b71('0x1c')]==='undefined';var _0x268090=_0x5e7c3a['count'];var _0x4adce8=_0xadd51e?0x0:_0x5888f9[_0x7b71('0x1a')];var _0xbde25=_0xadd51e?_0x5e7c3a[_0x7b71('0x1d')]:_0x5888f9[_0x7b71('0x1a')]+_0x5888f9[_0x7b71('0x1c')];var _0x51d647;if(_0xbde25>=_0x268090){_0xbde25=_0x268090;_0x51d647=0xc8;}else{_0x51d647=0xce;}_0x4266e5[_0x7b71('0x18')](_0x51d647);return _0x4266e5[_0x7b71('0x1e')](_0x7b71('0x1f'),_0x4adce8+'-'+_0xbde25+'/'+_0x268090)[_0x7b71('0x19')](_0x5e7c3a);}return null;};}function patchUpdates(_0x206000){return function(_0x297918){try{jsonpatch['apply'](_0x297918,_0x206000,!![]);}catch(_0x459c8b){return BPromise[_0x7b71('0x20')](_0x459c8b);}return _0x297918[_0x7b71('0x21')]();};}function saveUpdates(_0x375f85,_0x47d933){return function(_0x55ed9c){if(_0x55ed9c){return _0x55ed9c[_0x7b71('0x22')](_0x375f85)[_0x7b71('0x23')](function(_0x467f1a){return _0x467f1a;});}return null;};}function removeEntity(_0x33ad80,_0x3aca34){return function(_0x478dd8){if(_0x478dd8){return _0x478dd8[_0x7b71('0x24')]()['then'](function(){_0x33ad80[_0x7b71('0x18')](0xcc)[_0x7b71('0x25')]();});}};}function handleEntityNotFound(_0x19a6f5,_0x292430){return function(_0x49ce76){if(!_0x49ce76){_0x19a6f5['sendStatus'](0x194);}return _0x49ce76;};}function handleError(_0x103774,_0x28841d){_0x28841d=_0x28841d||0x1f4;return function(_0x598102){logger[_0x7b71('0x26')](_0x598102[_0x7b71('0x27')]);if(_0x598102[_0x7b71('0x28')]){delete _0x598102[_0x7b71('0x28')];}_0x103774[_0x7b71('0x18')](_0x28841d)['send'](_0x598102);};}exports['show']=function(_0x2b323b,_0x57c86c){var _0x360d4c={'raw':!![],'where':{'id':_0x2b323b[_0x7b71('0x29')]['id']}},_0x514237={};_0x514237[_0x7b71('0x2a')]=_[_0x7b71('0x2b')](db['ChatProactiveAction'][_0x7b71('0x2c')]);_0x514237[_0x7b71('0x2d')]=_[_0x7b71('0x2b')](_0x2b323b['query']);_0x514237[_0x7b71('0x2e')]=_[_0x7b71('0x2f')](_0x514237[_0x7b71('0x2a')],_0x514237[_0x7b71('0x2d')]);_0x360d4c[_0x7b71('0x30')]=_[_0x7b71('0x2f')](_0x514237[_0x7b71('0x2a')],qs[_0x7b71('0x31')](_0x2b323b['query'][_0x7b71('0x31')]));_0x360d4c[_0x7b71('0x30')]=_0x360d4c[_0x7b71('0x30')]['length']?_0x360d4c[_0x7b71('0x30')]:_0x514237[_0x7b71('0x2a')];if(_0x2b323b[_0x7b71('0x2d')][_0x7b71('0x32')]){_0x360d4c[_0x7b71('0x33')]=[{'all':!![]}];}_0x360d4c=_[_0x7b71('0x34')]({},_0x360d4c,_0x2b323b['options']);return db[_0x7b71('0x35')][_0x7b71('0x36')](_0x360d4c)[_0x7b71('0x23')](handleEntityNotFound(_0x57c86c,null))[_0x7b71('0x23')](respondWithResult(_0x57c86c,null))[_0x7b71('0x37')](handleError(_0x57c86c,null));};exports['create']=function(_0x32bcbd,_0x31e0d1){return db[_0x7b71('0x35')][_0x7b71('0x38')](_0x32bcbd[_0x7b71('0x39')],{})[_0x7b71('0x23')](respondWithResult(_0x31e0d1,0xc9))[_0x7b71('0x37')](handleError(_0x31e0d1,null));};exports[_0x7b71('0x22')]=function(_0x53fffa,_0x3be99c){if(_0x53fffa[_0x7b71('0x39')]['id']){delete _0x53fffa[_0x7b71('0x39')]['id'];}return db[_0x7b71('0x35')][_0x7b71('0x36')]({'where':{'id':_0x53fffa[_0x7b71('0x29')]['id']}})[_0x7b71('0x23')](handleEntityNotFound(_0x3be99c,null))['then'](saveUpdates(_0x53fffa[_0x7b71('0x39')],null))[_0x7b71('0x23')](respondWithResult(_0x3be99c,null))[_0x7b71('0x37')](handleError(_0x3be99c,null));};exports[_0x7b71('0x24')]=function(_0x568c7b,_0x15676c){return db[_0x7b71('0x35')][_0x7b71('0x36')]({'where':{'id':_0x568c7b[_0x7b71('0x29')]['id']}})[_0x7b71('0x23')](handleEntityNotFound(_0x15676c,null))[_0x7b71('0x23')](removeEntity(_0x15676c,null))[_0x7b71('0x37')](handleError(_0x15676c,null));};
\ No newline at end of file
+var _0x9f75=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2b3696,_0x2b45ca){var _0x56a91c=function(_0x1723c6){while(--_0x1723c6){_0x2b3696['push'](_0x2b3696['shift']());}};_0x56a91c(++_0x2b45ca);}(_0x9f75,0x15a));var _0x59f7=function(_0x4fc100,_0x177252){_0x4fc100=_0x4fc100-0x0;var _0x2d204a=_0x9f75[_0x4fc100];return _0x2d204a;};'use strict';var emlformat=require(_0x59f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59f7('0x1'));var jsonpatch=require(_0x59f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x59f7('0x3'));var Mustache=require(_0x59f7('0x4'));var util=require(_0x59f7('0x5'));var path=require(_0x59f7('0x6'));var sox=require('sox');var csv=require(_0x59f7('0x7'));var ejs=require(_0x59f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x59f7('0x9'));var crypto=require(_0x59f7('0xa'));var jsforce=require(_0x59f7('0xb'));var deskjs=require(_0x59f7('0xc'));var toCsv=require(_0x59f7('0x7'));var querystring=require(_0x59f7('0xd'));var Papa=require('papaparse');var Redis=require(_0x59f7('0xe'));var authService=require(_0x59f7('0xf'));var qs=require(_0x59f7('0x10'));var as=require(_0x59f7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59f7('0x12'))('api');var utils=require(_0x59f7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x59f7('0x14'));var db=require(_0x59f7('0x15'))['db'];function respondWithStatusCode(_0x4cee9f,_0x585044){_0x585044=_0x585044||0xcc;return function(_0xf44f98){if(_0xf44f98){return _0x4cee9f[_0x59f7('0x16')](_0x585044);}return _0x4cee9f[_0x59f7('0x17')](_0x585044)[_0x59f7('0x18')]();};}function respondWithResult(_0x3b97ec,_0x2e9923){_0x2e9923=_0x2e9923||0xc8;return function(_0x5c5167){if(_0x5c5167){return _0x3b97ec['status'](_0x2e9923)['json'](_0x5c5167);}};}function respondWithFilteredResult(_0x232f99,_0x512067){return function(_0xa3aa79){if(_0xa3aa79){var _0x446b66=typeof _0x512067[_0x59f7('0x19')]===_0x59f7('0x1a')&&typeof _0x512067[_0x59f7('0x1b')]===_0x59f7('0x1a');var _0x21ca8d=_0xa3aa79[_0x59f7('0x1c')];var _0x2f1d2b=_0x446b66?0x0:_0x512067[_0x59f7('0x19')];var _0x1f14f4=_0x446b66?_0xa3aa79[_0x59f7('0x1c')]:_0x512067['offset']+_0x512067[_0x59f7('0x1b')];var _0x21d0af;if(_0x1f14f4>=_0x21ca8d){_0x1f14f4=_0x21ca8d;_0x21d0af=0xc8;}else{_0x21d0af=0xce;}_0x232f99[_0x59f7('0x17')](_0x21d0af);return _0x232f99[_0x59f7('0x1d')](_0x59f7('0x1e'),_0x2f1d2b+'-'+_0x1f14f4+'/'+_0x21ca8d)[_0x59f7('0x1f')](_0xa3aa79);}return null;};}function patchUpdates(_0x4986ce){return function(_0x2d2990){try{jsonpatch[_0x59f7('0x20')](_0x2d2990,_0x4986ce,!![]);}catch(_0x5f4394){return BPromise[_0x59f7('0x21')](_0x5f4394);}return _0x2d2990[_0x59f7('0x22')]();};}function saveUpdates(_0x2d658c,_0x2ca762){return function(_0x1a4d80){if(_0x1a4d80){return _0x1a4d80[_0x59f7('0x23')](_0x2d658c)[_0x59f7('0x24')](function(_0x25c521){return _0x25c521;});}return null;};}function removeEntity(_0x1cc78d,_0xeff590){return function(_0x1cdb9f){if(_0x1cdb9f){return _0x1cdb9f[_0x59f7('0x25')]()[_0x59f7('0x24')](function(){_0x1cc78d[_0x59f7('0x17')](0xcc)[_0x59f7('0x18')]();});}};}function handleEntityNotFound(_0x2b83c0,_0xd2ea31){return function(_0x1edda0){if(!_0x1edda0){_0x2b83c0[_0x59f7('0x16')](0x194);}return _0x1edda0;};}function handleError(_0x38a21c,_0x246ab4){_0x246ab4=_0x246ab4||0x1f4;return function(_0x5751f0){logger[_0x59f7('0x26')](_0x5751f0['stack']);if(_0x5751f0[_0x59f7('0x27')]){delete _0x5751f0['name'];}_0x38a21c[_0x59f7('0x17')](_0x246ab4)[_0x59f7('0x28')](_0x5751f0);};}exports[_0x59f7('0x29')]=function(_0x4c01f9,_0x659655){var _0x179526={'raw':!![],'where':{'id':_0x4c01f9[_0x59f7('0x2a')]['id']}},_0x392b5f={};_0x392b5f[_0x59f7('0x2b')]=_['keys'](db[_0x59f7('0x2c')][_0x59f7('0x2d')]);_0x392b5f[_0x59f7('0x2e')]=_[_0x59f7('0x2f')](_0x4c01f9[_0x59f7('0x2e')]);_0x392b5f[_0x59f7('0x30')]=_[_0x59f7('0x31')](_0x392b5f[_0x59f7('0x2b')],_0x392b5f['query']);_0x179526[_0x59f7('0x32')]=_['intersection'](_0x392b5f['model'],qs[_0x59f7('0x33')](_0x4c01f9[_0x59f7('0x2e')]['fields']));_0x179526[_0x59f7('0x32')]=_0x179526[_0x59f7('0x32')][_0x59f7('0x34')]?_0x179526[_0x59f7('0x32')]:_0x392b5f[_0x59f7('0x2b')];if(_0x4c01f9[_0x59f7('0x2e')]['includeAll']){_0x179526[_0x59f7('0x35')]=[{'all':!![]}];}_0x179526=_[_0x59f7('0x36')]({},_0x179526,_0x4c01f9[_0x59f7('0x37')]);return db[_0x59f7('0x2c')][_0x59f7('0x38')](_0x179526)[_0x59f7('0x24')](handleEntityNotFound(_0x659655,null))[_0x59f7('0x24')](respondWithResult(_0x659655,null))[_0x59f7('0x39')](handleError(_0x659655,null));};exports[_0x59f7('0x3a')]=function(_0x5d0c87,_0x42aedc){return db['ChatProactiveAction'][_0x59f7('0x3a')](_0x5d0c87['body'],{})[_0x59f7('0x24')](respondWithResult(_0x42aedc,0xc9))['catch'](handleError(_0x42aedc,null));};exports['update']=function(_0x494b26,_0x4ab3c5){if(_0x494b26[_0x59f7('0x3b')]['id']){delete _0x494b26[_0x59f7('0x3b')]['id'];}return db[_0x59f7('0x2c')][_0x59f7('0x38')]({'where':{'id':_0x494b26[_0x59f7('0x2a')]['id']}})[_0x59f7('0x24')](handleEntityNotFound(_0x4ab3c5,null))[_0x59f7('0x24')](saveUpdates(_0x494b26[_0x59f7('0x3b')],null))[_0x59f7('0x24')](respondWithResult(_0x4ab3c5,null))[_0x59f7('0x39')](handleError(_0x4ab3c5,null));};exports[_0x59f7('0x25')]=function(_0x32d108,_0x4062fa){return db[_0x59f7('0x2c')][_0x59f7('0x38')]({'where':{'id':_0x32d108[_0x59f7('0x2a')]['id']}})[_0x59f7('0x24')](handleEntityNotFound(_0x4062fa,null))[_0x59f7('0x24')](removeEntity(_0x4062fa,null))[_0x59f7('0x39')](handleError(_0x4062fa,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c67ce58..3d42033 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 _0xa830=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','moment','bluebird','request-promise'];(function(_0x3a2b17,_0x57d0f3){var _0x413e3c=function(_0x175aa5){while(--_0x175aa5){_0x3a2b17['push'](_0x3a2b17['shift']());}};_0x413e3c(++_0x57d0f3);}(_0xa830,0x131));var _0x0a83=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xa830[_0x254d9f];return _0x1eedb9;};'use strict';var _=require(_0x0a83('0x0'));var util=require(_0x0a83('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a83('0x2'));var BPromise=require(_0x0a83('0x3'));var rp=require(_0x0a83('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a83('0x5'));var config=require(_0x0a83('0x6'));var attributes=require(_0x0a83('0x7'));module[_0x0a83('0x8')]=function(_0x5bd97a,_0x56ca1f){return _0x5bd97a['define'](_0x0a83('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f1f=['define','util','../../config/logger','api','request-promise','path','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x425f01,_0x383af5){var _0x455e9d=function(_0x4bb062){while(--_0x4bb062){_0x425f01['push'](_0x425f01['shift']());}};_0x455e9d(++_0x383af5);}(_0x9f1f,0xc7));var _0xf9f1=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x9f1f[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0xf9f1('0x0'));var logger=require(_0xf9f1('0x1'))(_0xf9f1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf9f1('0x3'));var fs=require('fs');var path=require(_0xf9f1('0x4'));var rimraf=require(_0xf9f1('0x5'));var config=require('../../config/environment');var attributes=require(_0xf9f1('0x6'));module[_0xf9f1('0x7')]=function(_0x40ad8b,_0x214725){return _0x40ad8b[_0xf9f1('0x8')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 8fd08c4..d114404 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 _0x6321=['jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6321,0x158));var _0x1632=function(_0x5b95f3,_0x576375){_0x5b95f3=_0x5b95f3-0x0;var _0x58a5ef=_0x6321[_0x5b95f3];return _0x58a5ef;};'use strict';var _=require(_0x1632('0x0'));var util=require(_0x1632('0x1'));var moment=require('moment');var BPromise=require(_0x1632('0x2'));var rs=require(_0x1632('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1632('0x4'))['db'];var utils=require(_0x1632('0x5'));var logger=require(_0x1632('0x6'))(_0x1632('0x7'));var config=require('../../config/environment');var jayson=require(_0x1632('0x8'));var client=jayson[_0x1632('0x9')][_0x1632('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ba65,_0x2ad7dc,_0x5cbf44){return new BPromise(function(_0x42f940,_0x367f8d){return client[_0x1632('0xb')](_0x52ba65,_0x5cbf44)[_0x1632('0xc')](function(_0x1b1c9c){logger[_0x1632('0xd')](_0x1632('0xe'),_0x2ad7dc,_0x1632('0xf'));logger[_0x1632('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2ad7dc,'request\x20sent',JSON[_0x1632('0x11')](_0x1b1c9c));if(_0x1b1c9c[_0x1632('0x12')]){if(_0x1b1c9c[_0x1632('0x12')]['code']===0x1f4){logger[_0x1632('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2ad7dc,_0x1b1c9c['error'][_0x1632('0x13')]);return _0x367f8d(_0x1b1c9c[_0x1632('0x12')][_0x1632('0x13')]);}logger[_0x1632('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2ad7dc,_0x1b1c9c['error'][_0x1632('0x13')]);return _0x42f940(_0x1b1c9c[_0x1632('0x12')][_0x1632('0x13')]);}else{logger[_0x1632('0xd')](_0x1632('0xe'),_0x2ad7dc,'request\x20sent');_0x42f940(_0x1b1c9c[_0x1632('0x14')][_0x1632('0x13')]);}})[_0x1632('0x15')](function(_0x2a4434){logger['error'](_0x1632('0xe'),_0x2ad7dc,_0x2a4434);_0x367f8d(_0x2a4434);});});}
\ No newline at end of file
+var _0x753c=['request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b3e6e,_0x210ab2){var _0x493c1d=function(_0x400d0d){while(--_0x400d0d){_0x5b3e6e['push'](_0x5b3e6e['shift']());}};_0x493c1d(++_0x210ab2);}(_0x753c,0x79));var _0xc753=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x753c[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xc753('0x0'));var util=require(_0xc753('0x1'));var moment=require(_0xc753('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require('../../config/logger')(_0xc753('0x6'));var config=require(_0xc753('0x7'));var jayson=require(_0xc753('0x8'));var client=jayson[_0xc753('0x9')][_0xc753('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e55e8,_0x272691,_0x33c5b3){return new BPromise(function(_0x1c0e83,_0x216e92){return client[_0xc753('0xb')](_0x4e55e8,_0x33c5b3)['then'](function(_0x49df66){logger['info'](_0xc753('0xc'),_0x272691,_0xc753('0xd'));logger[_0xc753('0xe')](_0xc753('0xf'),_0x272691,_0xc753('0xd'),JSON[_0xc753('0x10')](_0x49df66));if(_0x49df66[_0xc753('0x11')]){if(_0x49df66[_0xc753('0x11')][_0xc753('0x12')]===0x1f4){logger['error'](_0xc753('0xc'),_0x272691,_0x49df66[_0xc753('0x11')][_0xc753('0x13')]);return _0x216e92(_0x49df66['error']['message']);}logger[_0xc753('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x272691,_0x49df66['error'][_0xc753('0x13')]);return _0x1c0e83(_0x49df66[_0xc753('0x11')][_0xc753('0x13')]);}else{logger[_0xc753('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x272691,_0xc753('0xd'));_0x1c0e83(_0x49df66[_0xc753('0x15')][_0xc753('0x13')]);}})['catch'](function(_0x1b515d){logger[_0xc753('0x11')](_0xc753('0xc'),_0x272691,_0x1b515d);_0x216e92(_0x1b515d);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index ecfb422..dad08bc 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 _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x1e70e2,_0x2dbc29){var _0x3aff27=function(_0x3625d2){while(--_0x3625d2){_0x1e70e2['push'](_0x1e70e2['shift']());}};_0x3aff27(++_0x2dbc29);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x38223f,_0x3a0dfc){_0x38223f=_0x38223f-0x0;var _0x3e3fab=_0x7fbe[_0x38223f];return _0x3e3fab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router;
\ No newline at end of file
+var _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x544cd7,_0x20f588){var _0x43c000=function(_0x3d71cf){while(--_0x3d71cf){_0x544cd7['push'](_0x544cd7['shift']());}};_0x43c000(++_0x20f588);}(_0xae24,0x182));var _0x4ae2=function(_0x3735f4,_0x3c81c2){_0x3735f4=_0x3735f4-0x0;var _0x40e0e3=_0xae24[_0x3735f4];return _0x40e0e3;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 41ea1e4..e485868 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 _0x82d0=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1395eb,_0x271736){var _0x2f0c26=function(_0xb19134){while(--_0xb19134){_0x1395eb['push'](_0x1395eb['shift']());}};_0x2f0c26(++_0x271736);}(_0x82d0,0x120));var _0x082d=function(_0x312428,_0x458f28){_0x312428=_0x312428-0x0;var _0x583514=_0x82d0[_0x312428];return _0x583514;};'use strict';var Sequelize=require(_0x082d('0x0'));module[_0x082d('0x1')]={'name':{'type':Sequelize[_0x082d('0x2')],'unique':_0x082d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x082d('0x2')]},'timeout':{'type':Sequelize[_0x082d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x082d('0x5')](_0x082d('0x6'),_0x082d('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0x803c=['roundrobin','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x163b15,_0x35758d){var _0xa1fc11=function(_0x1dc11f){while(--_0x1dc11f){_0x163b15['push'](_0x163b15['shift']());}};_0xa1fc11(++_0x35758d);}(_0x803c,0xd3));var _0xc803=function(_0x3b2df4,_0x524a3e){_0x3b2df4=_0x3b2df4-0x0;var _0x2d9395=_0x803c[_0x3b2df4];return _0x2d9395;};'use strict';var Sequelize=require(_0xc803('0x0'));module['exports']={'name':{'type':Sequelize[_0xc803('0x1')],'unique':_0xc803('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc803('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc803('0x3')](_0xc803('0x4'),'beepall',_0xc803('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index e7d3c5b..fc55aac 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 _0xbbea=['getAgents','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','get','ChatQueues','UserProfileResource','destroy','end','name','index','ChatQueue','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','VIRTUAL','options','show','params','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','nolimit','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','order','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','removeAgents','emit','userChatQueue:remove','addAgents','ids','omit','isArray'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xbbea,0x95));var _0xabbe=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbbea[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabbe('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xabbe('0x1'));var BPromise=require(_0xabbe('0x2'));var Mustache=require('mustache');var util=require(_0xabbe('0x3'));var path=require(_0xabbe('0x4'));var sox=require(_0xabbe('0x5'));var csv=require('to-csv');var ejs=require(_0xabbe('0x6'));var fs=require('fs');var fs_extra=require(_0xabbe('0x7'));var _=require('lodash');var squel=require(_0xabbe('0x8'));var crypto=require(_0xabbe('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xabbe('0xa'));var toCsv=require('to-csv');var querystring=require(_0xabbe('0xb'));var Papa=require(_0xabbe('0xc'));var Redis=require('ioredis');var authService=require(_0xabbe('0xd'));var qs=require(_0xabbe('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabbe('0xf'));var logger=require(_0xabbe('0x10'))(_0xabbe('0x11'));var utils=require(_0xabbe('0x12'));var config=require(_0xabbe('0x13'));var licenseUtil=require(_0xabbe('0x14'));var db=require('../../mysqldb')['db'];config[_0xabbe('0x15')]=_[_0xabbe('0x16')](config[_0xabbe('0x15')],{'host':_0xabbe('0x17'),'port':0x18eb});var socket=require(_0xabbe('0x18'))(new Redis(config['redis']));require(_0xabbe('0x19'))[_0xabbe('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xabbe('0x1b')][_0xabbe('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x51f933,_0x500c13,_0x4d1c31,_0x2e7ff7){return new BPromise(function(_0x3bfcee,_0x14b567){var _0x4d2b1c=_0x2e7ff7||client;return _0x4d2b1c[_0xabbe('0x1d')](_0x51f933,_0x4d1c31)['then'](function(_0x57001d){logger[_0xabbe('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x500c13,_0xabbe('0x1f'));logger[_0xabbe('0x20')](_0xabbe('0x21'),_0x500c13,'request\x20sent',JSON['stringify'](_0x57001d));if(_0x57001d[_0xabbe('0x22')]){if(_0x57001d[_0xabbe('0x22')][_0xabbe('0x23')]===0x1f4){logger[_0xabbe('0x22')](_0xabbe('0x24'),_0x500c13,_0x57001d[_0xabbe('0x22')]['message']);return _0x14b567(_0x57001d[_0xabbe('0x22')][_0xabbe('0x25')]);}logger[_0xabbe('0x22')](_0xabbe('0x24'),_0x500c13,_0x57001d[_0xabbe('0x22')][_0xabbe('0x25')]);return _0x3bfcee(_0x57001d['error']['message']);}else{logger['info'](_0xabbe('0x24'),_0x500c13,_0xabbe('0x1f'));_0x3bfcee(_0x57001d[_0xabbe('0x26')][_0xabbe('0x25')]);}})[_0xabbe('0x27')](function(_0x2fcfc4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x500c13,_0x2fcfc4);_0x14b567(_0x2fcfc4);});});}function respondWithStatusCode(_0x5b2af6,_0x249ca9){_0x249ca9=_0x249ca9||0xcc;return function(_0x192bd9){if(_0x192bd9){return _0x5b2af6[_0xabbe('0x28')](_0x249ca9);}return _0x5b2af6[_0xabbe('0x29')](_0x249ca9)['end']();};}function respondWithResult(_0x245933,_0x1e73b8){_0x1e73b8=_0x1e73b8||0xc8;return function(_0x12efec){if(_0x12efec){return _0x245933[_0xabbe('0x29')](_0x1e73b8)[_0xabbe('0x2a')](_0x12efec);}};}function respondWithFilteredResult(_0x3e2792,_0x501f3d){return function(_0x482973){if(_0x482973){var _0x419d62=typeof _0x501f3d[_0xabbe('0x2b')]===_0xabbe('0x2c')&&typeof _0x501f3d['limit']===_0xabbe('0x2c');var _0x41bc9f=_0x482973[_0xabbe('0x2d')];var _0x54fda6=_0x419d62?0x0:_0x501f3d['offset'];var _0x4a5c6d=_0x419d62?_0x482973[_0xabbe('0x2d')]:_0x501f3d[_0xabbe('0x2b')]+_0x501f3d[_0xabbe('0x2e')];var _0xdc1978;if(_0x4a5c6d>=_0x41bc9f){_0x4a5c6d=_0x41bc9f;_0xdc1978=0xc8;}else{_0xdc1978=0xce;}_0x3e2792[_0xabbe('0x29')](_0xdc1978);return _0x3e2792[_0xabbe('0x2f')](_0xabbe('0x30'),_0x54fda6+'-'+_0x4a5c6d+'/'+_0x41bc9f)['json'](_0x482973);}return null;};}function patchUpdates(_0x46fffd){return function(_0x2e8aa2){try{jsonpatch[_0xabbe('0x31')](_0x2e8aa2,_0x46fffd,!![]);}catch(_0x22c2ef){return BPromise['reject'](_0x22c2ef);}return _0x2e8aa2['save']();};}function saveUpdates(_0x3f1c6e,_0x5f2f35){return function(_0x10e2b4){if(_0x10e2b4){return _0x10e2b4[_0xabbe('0x32')](_0x3f1c6e)[_0xabbe('0x33')](function(_0x2ecaff){return _0x2ecaff;});}return null;};}function removeEntity(_0x1185e5,_0x23813a){return function(_0x595d4d){if(_0x595d4d){return _0x595d4d['destroy']()[_0xabbe('0x33')](function(){var _0x5c6679=_0x595d4d[_0xabbe('0x34')]({'plain':!![]});var _0x7e7766=_0xabbe('0x35');return db[_0xabbe('0x36')][_0xabbe('0x37')]({'where':{'type':_0x7e7766,'resourceId':_0x5c6679['id']}})[_0xabbe('0x33')](function(){return _0x595d4d;});})[_0xabbe('0x33')](function(){_0x1185e5[_0xabbe('0x29')](0xcc)[_0xabbe('0x38')]();});}};}function handleEntityNotFound(_0x1ae953,_0x4a2d6f){return function(_0x3ab75d){if(!_0x3ab75d){_0x1ae953[_0xabbe('0x28')](0x194);}return _0x3ab75d;};}function handleError(_0x330dc7,_0x27390f){_0x27390f=_0x27390f||0x1f4;return function(_0x1615c9){logger['error'](_0x1615c9['stack']);if(_0x1615c9[_0xabbe('0x39')]){delete _0x1615c9[_0xabbe('0x39')];}_0x330dc7[_0xabbe('0x29')](_0x27390f)['send'](_0x1615c9);};}exports[_0xabbe('0x3a')]=function(_0x393d2d,_0x1fa7ff){var _0x1aedda={},_0x519816={},_0x58d9fa={'count':0x0,'rows':[]};var _0x42dd47=_['map'](db[_0xabbe('0x3b')][_0xabbe('0x3c')],function(_0x1c3add){return{'name':_0x1c3add['fieldName'],'type':_0x1c3add['type'][_0xabbe('0x3d')]};});_0x519816[_0xabbe('0x3e')]=_['map'](_0x42dd47,_0xabbe('0x39'));_0x519816[_0xabbe('0x3f')]=_[_0xabbe('0x40')](_0x393d2d[_0xabbe('0x3f')]);_0x519816[_0xabbe('0x41')]=_[_0xabbe('0x42')](_0x519816[_0xabbe('0x3e')],_0x519816[_0xabbe('0x3f')]);_0x1aedda['attributes']=_['intersection'](_0x519816['model'],qs[_0xabbe('0x43')](_0x393d2d[_0xabbe('0x3f')][_0xabbe('0x43')]));_0x1aedda[_0xabbe('0x44')]=_0x1aedda['attributes'][_0xabbe('0x45')]?_0x1aedda[_0xabbe('0x44')]:_0x519816[_0xabbe('0x3e')];if(!_0x393d2d[_0xabbe('0x3f')][_0xabbe('0x46')]('nolimit')){_0x1aedda[_0xabbe('0x2e')]=qs[_0xabbe('0x2e')](_0x393d2d['query'][_0xabbe('0x2e')]);_0x1aedda[_0xabbe('0x2b')]=qs[_0xabbe('0x2b')](_0x393d2d[_0xabbe('0x3f')][_0xabbe('0x2b')]);}_0x1aedda['order']=qs[_0xabbe('0x47')](_0x393d2d[_0xabbe('0x3f')][_0xabbe('0x47')]);_0x1aedda[_0xabbe('0x48')]=qs[_0xabbe('0x41')](_[_0xabbe('0x49')](_0x393d2d[_0xabbe('0x3f')],_0x519816[_0xabbe('0x41')]),_0x42dd47);if(_0x393d2d[_0xabbe('0x3f')][_0xabbe('0x4a')]){_0x1aedda[_0xabbe('0x48')]=_[_0xabbe('0x4b')](_0x1aedda['where'],{'$or':_[_0xabbe('0x4c')](_0x42dd47,function(_0x359bea){if(_0x359bea[_0xabbe('0x4d')]!==_0xabbe('0x4e')){var _0x46f52b={};_0x46f52b[_0x359bea[_0xabbe('0x39')]]={'$like':'%'+_0x393d2d[_0xabbe('0x3f')][_0xabbe('0x4a')]+'%'};return _0x46f52b;}})});}_0x1aedda=_['merge']({},_0x1aedda,_0x393d2d[_0xabbe('0x4f')]);var _0x3148f7={'where':_0x1aedda[_0xabbe('0x48')]};return db['ChatQueue'][_0xabbe('0x2d')](_0x3148f7)[_0xabbe('0x33')](function(_0x1a7861){_0x58d9fa[_0xabbe('0x2d')]=_0x1a7861;if(_0x393d2d[_0xabbe('0x3f')]['includeAll']){_0x1aedda['include']=[{'all':!![]}];}return db[_0xabbe('0x3b')]['findAll'](_0x1aedda);})[_0xabbe('0x33')](function(_0x5976bc){_0x58d9fa['rows']=_0x5976bc;return _0x58d9fa;})[_0xabbe('0x33')](respondWithFilteredResult(_0x1fa7ff,_0x1aedda))[_0xabbe('0x27')](handleError(_0x1fa7ff,null));};exports[_0xabbe('0x50')]=function(_0x540994,_0x3d0d10){var _0x25ed27={'raw':!![],'where':{'id':_0x540994[_0xabbe('0x51')]['id']}},_0x15f87b={};_0x15f87b[_0xabbe('0x3e')]=_[_0xabbe('0x40')](db[_0xabbe('0x3b')][_0xabbe('0x3c')]);_0x15f87b[_0xabbe('0x3f')]=_[_0xabbe('0x40')](_0x540994[_0xabbe('0x3f')]);_0x15f87b['filters']=_[_0xabbe('0x42')](_0x15f87b[_0xabbe('0x3e')],_0x15f87b[_0xabbe('0x3f')]);_0x25ed27[_0xabbe('0x44')]=_[_0xabbe('0x42')](_0x15f87b[_0xabbe('0x3e')],qs['fields'](_0x540994[_0xabbe('0x3f')]['fields']));_0x25ed27['attributes']=_0x25ed27['attributes'][_0xabbe('0x45')]?_0x25ed27[_0xabbe('0x44')]:_0x15f87b[_0xabbe('0x3e')];if(_0x540994[_0xabbe('0x3f')][_0xabbe('0x52')]){_0x25ed27[_0xabbe('0x53')]=[{'all':!![]}];}_0x25ed27=_[_0xabbe('0x4b')]({},_0x25ed27,_0x540994[_0xabbe('0x4f')]);return db[_0xabbe('0x3b')][_0xabbe('0x54')](_0x25ed27)[_0xabbe('0x33')](handleEntityNotFound(_0x3d0d10,null))[_0xabbe('0x33')](respondWithResult(_0x3d0d10,null))['catch'](handleError(_0x3d0d10,null));};exports[_0xabbe('0x55')]=function(_0x185438,_0x1d4443){return db[_0xabbe('0x3b')][_0xabbe('0x55')](_0x185438['body'],{})['then'](function(_0x414a12){var _0x3308c5=_0x185438['user'][_0xabbe('0x34')]({'plain':!![]});if(!_0x3308c5)throw new Error(_0xabbe('0x56'));if(_0x3308c5['role']===_0xabbe('0x57')){var _0x414283=_0x414a12[_0xabbe('0x34')]({'plain':!![]});var _0x1a1d5b='ChatQueues';return db[_0xabbe('0x58')][_0xabbe('0x54')]({'where':{'name':_0x1a1d5b,'userProfileId':_0x3308c5[_0xabbe('0x59')]},'raw':!![]})['then'](function(_0x307a2e){if(_0x307a2e&&_0x307a2e[_0xabbe('0x5a')]===0x0){return db[_0xabbe('0x36')][_0xabbe('0x55')]({'name':_0x414283[_0xabbe('0x39')],'resourceId':_0x414283['id'],'type':_0x307a2e['name'],'sectionId':_0x307a2e['id']},{})[_0xabbe('0x33')](function(){return _0x414a12;});}else{return _0x414a12;}})['catch'](function(_0x4f0fb7){logger[_0xabbe('0x22')](_0xabbe('0x5b'),_0x4f0fb7);throw _0x4f0fb7;});}return _0x414a12;})[_0xabbe('0x33')](respondWithResult(_0x1d4443,0xc9))['catch'](handleError(_0x1d4443,null));};exports[_0xabbe('0x32')]=function(_0x998032,_0x34eefb){if(_0x998032[_0xabbe('0x5c')]['id']){delete _0x998032[_0xabbe('0x5c')]['id'];}return db[_0xabbe('0x3b')][_0xabbe('0x54')]({'where':{'id':_0x998032[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](handleEntityNotFound(_0x34eefb,null))[_0xabbe('0x33')](saveUpdates(_0x998032['body'],null))[_0xabbe('0x33')](respondWithResult(_0x34eefb,null))[_0xabbe('0x27')](handleError(_0x34eefb,null));};exports[_0xabbe('0x37')]=function(_0x256a64,_0xd7c9a7){return db[_0xabbe('0x3b')]['find']({'where':{'id':_0x256a64[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](handleEntityNotFound(_0xd7c9a7,null))[_0xabbe('0x33')](removeEntity(_0xd7c9a7,null))['catch'](handleError(_0xd7c9a7,null));};exports[_0xabbe('0x5d')]=function(_0x7a0b69,_0xe0dde8){return db[_0xabbe('0x3b')]['describe']()[_0xabbe('0x33')](respondWithResult(_0xe0dde8,null))[_0xabbe('0x27')](handleError(_0xe0dde8,null));};exports[_0xabbe('0x5e')]=function(_0x386b3a,_0x5c599c,_0x2cf71c){var _0x4638a3={'raw':!![],'where':{}},_0x49fd89={},_0x53bb5b;return db[_0xabbe('0x3b')]['findOne']({'where':{'id':_0x386b3a[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](handleEntityNotFound(_0x5c599c,null))['then'](function(_0x17c1a3){if(_0x17c1a3){_0x53bb5b=_0x17c1a3[_0xabbe('0x34')]({'plain':!![]});_0x49fd89['model']=_[_0xabbe('0x40')](db[_0xabbe('0x5f')][_0xabbe('0x3c')]);_0x49fd89['query']=_[_0xabbe('0x40')](_0x386b3a['query']);_0x49fd89[_0xabbe('0x41')]=_[_0xabbe('0x42')](_0x49fd89[_0xabbe('0x3e')],_0x49fd89['query']);_0x4638a3['attributes']=_[_0xabbe('0x42')](_0x49fd89[_0xabbe('0x3e')],qs['fields'](_0x386b3a['query'][_0xabbe('0x43')]));_0x4638a3['attributes']=_0x4638a3[_0xabbe('0x44')][_0xabbe('0x45')]?_0x4638a3[_0xabbe('0x44')]:_0x49fd89['model'];if(!_0x386b3a[_0xabbe('0x3f')][_0xabbe('0x46')](_0xabbe('0x60'))){_0x4638a3[_0xabbe('0x2e')]=qs[_0xabbe('0x2e')](_0x386b3a[_0xabbe('0x3f')][_0xabbe('0x2e')]);_0x4638a3[_0xabbe('0x2b')]=qs['offset'](_0x386b3a[_0xabbe('0x3f')]['offset']);}_0x4638a3['order']=qs[_0xabbe('0x47')](_0x386b3a[_0xabbe('0x3f')][_0xabbe('0x47')]);_0x4638a3[_0xabbe('0x48')]=qs[_0xabbe('0x41')](_['pick'](_0x386b3a[_0xabbe('0x3f')],_0x49fd89[_0xabbe('0x41')]));_0x4638a3['where']['ChatQueueId']=_0x17c1a3['id'];if(_0x386b3a[_0xabbe('0x3f')][_0xabbe('0x4a')]){_0x4638a3[_0xabbe('0x48')]=_[_0xabbe('0x4b')](_0x4638a3[_0xabbe('0x48')],{'$or':_[_0xabbe('0x4c')](_0x4638a3[_0xabbe('0x44')],function(_0x56b6dd){var _0x29b81={};_0x29b81[_0x56b6dd]={'$like':'%'+_0x386b3a[_0xabbe('0x3f')][_0xabbe('0x4a')]+'%'};return _0x29b81;})});}_0x4638a3=_[_0xabbe('0x4b')]({},_0x4638a3,_0x386b3a[_0xabbe('0x4f')]);return db['UserChatQueue'][_0xabbe('0x61')](_0x4638a3);}})[_0xabbe('0x33')](function(_0x4c4510){if(_0x4c4510){return db[_0xabbe('0x62')][_0xabbe('0x63')]({'where':{'id':_[_0xabbe('0x4c')](_0x4c4510,_0xabbe('0x64')),'role':_0xabbe('0x65')},'attributes':['id','name',_0xabbe('0x66'),_0xabbe('0x67'),_0xabbe('0x68')]});}})[_0xabbe('0x33')](function(_0x46f1d9){if(_0x46f1d9){return{'count':_0x46f1d9[_0xabbe('0x2d')],'rows':_['map'](_0x46f1d9[_0xabbe('0x69')],function(_0x464128){return{'membername':_0x464128[_0xabbe('0x39')],'UserId':_0x464128['id'],'queue_name':_0x53bb5b[_0xabbe('0x39')],'ChatQueueId':_0x53bb5b['id'],'interface':util[_0xabbe('0x6a')](_0xabbe('0x6b'),_0xabbe('0x6c'),_0x464128[_0xabbe('0x39')]),'penalty':0x0,'paused':_0x464128[_0xabbe('0x66')],'createdAt':_0x464128[_0xabbe('0x68')],'updatedAt':_0x464128[_0xabbe('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xabbe('0x33')](respondWithFilteredResult(_0x5c599c,_0x4638a3))[_0xabbe('0x27')](handleError(_0x5c599c,null));};exports[_0xabbe('0x6d')]=function(_0x5a547f,_0x10ebe0,_0x4d21c2){var _0x4905ad={};var _0x182a7f={};var _0x481f49;var _0x22672a;return db[_0xabbe('0x3b')][_0xabbe('0x6e')]({'where':{'id':_0x5a547f[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](handleEntityNotFound(_0x10ebe0,null))[_0xabbe('0x33')](function(_0x4ba9ec){if(_0x4ba9ec){_0x481f49=_0x4ba9ec;_0x182a7f[_0xabbe('0x3e')]=_[_0xabbe('0x40')](db[_0xabbe('0x6f')][_0xabbe('0x3c')]);_0x182a7f[_0xabbe('0x3f')]=_[_0xabbe('0x40')](_0x5a547f[_0xabbe('0x3f')]);_0x182a7f['filters']=_['intersection'](_0x182a7f['model'],_0x182a7f[_0xabbe('0x3f')]);_0x4905ad[_0xabbe('0x44')]=_[_0xabbe('0x42')](_0x182a7f['model'],qs[_0xabbe('0x43')](_0x5a547f['query'][_0xabbe('0x43')]));_0x4905ad['attributes']=_0x4905ad[_0xabbe('0x44')][_0xabbe('0x45')]?_0x4905ad[_0xabbe('0x44')]:_0x182a7f[_0xabbe('0x3e')];_0x4905ad[_0xabbe('0x70')]=qs[_0xabbe('0x47')](_0x5a547f['query']['sort']);_0x4905ad['where']=qs[_0xabbe('0x41')](_[_0xabbe('0x49')](_0x5a547f['query'],_0x182a7f[_0xabbe('0x41')]));if(_0x5a547f[_0xabbe('0x3f')][_0xabbe('0x4a')]){_0x4905ad['where']=_[_0xabbe('0x4b')](_0x4905ad[_0xabbe('0x48')],{'$or':_[_0xabbe('0x4c')](_0x4905ad[_0xabbe('0x44')],function(_0x287283){var _0x5c9844={};_0x5c9844[_0x287283]={'$like':'%'+_0x5a547f[_0xabbe('0x3f')]['filter']+'%'};return _0x5c9844;})});}_0x4905ad=_[_0xabbe('0x4b')]({},_0x4905ad,_0x5a547f[_0xabbe('0x4f')]);return _0x481f49[_0xabbe('0x6d')](_0x4905ad);}})[_0xabbe('0x33')](function(_0xf29ef4){if(_0xf29ef4){_0x22672a=_0xf29ef4[_0xabbe('0x45')];if(!_0x5a547f[_0xabbe('0x3f')][_0xabbe('0x46')](_0xabbe('0x60'))){_0x4905ad[_0xabbe('0x2e')]=qs[_0xabbe('0x2e')](_0x5a547f[_0xabbe('0x3f')][_0xabbe('0x2e')]);_0x4905ad[_0xabbe('0x2b')]=qs[_0xabbe('0x2b')](_0x5a547f['query'][_0xabbe('0x2b')]);}return _0x481f49[_0xabbe('0x6d')](_0x4905ad);}})[_0xabbe('0x33')](function(_0x3f5c02){if(_0x3f5c02){return _0x3f5c02?{'count':_0x22672a,'rows':_0x3f5c02}:null;}})[_0xabbe('0x33')](respondWithResult(_0x10ebe0,null))[_0xabbe('0x27')](handleError(_0x10ebe0,null));};exports[_0xabbe('0x71')]=function(_0x2d70c4,_0x4f55c7,_0x5246ac){var _0x4a91ad=_0x2d70c4['body']['ids'];return db['Team'][_0xabbe('0x61')]({'where':{'id':_0x4a91ad},'attributes':['id'],'include':[{'model':db[_0xabbe('0x62')],'as':_0xabbe('0x72'),'attributes':['id',_0xabbe('0x39'),_0xabbe('0x73'),'voicePause',_0xabbe('0x74')],'raw':!![]}]})[_0xabbe('0x33')](function(_0x19860a){if(_0x19860a){var _0x174eaf=_[_0xabbe('0x75')](_0x19860a,function(_0x500915){var _0x389428=_0x500915['get']({'plain':!![]});return _0x389428[_0xabbe('0x72')];});return db[_0xabbe('0x3b')][_0xabbe('0x54')]({'where':{'id':_0x2d70c4[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](function(_0x28737b){return db[_0xabbe('0x76')][_0xabbe('0x77')](function(_0x31c59b){return _0x28737b[_0xabbe('0x71')](_0x4a91ad,{'transaction':_0x31c59b})[_0xabbe('0x33')](function(){return BPromise[_0xabbe('0x78')](_0x174eaf,function(_0x48e894){return db[_0xabbe('0x5f')]['findOrCreate']({'where':{'UserId':_0x48e894['id'],'ChatQueueId':_0x2d70c4[_0xabbe('0x51')]['id']},'transaction':_0x31c59b});});})[_0xabbe('0x33')](function(){_0x174eaf[_0xabbe('0x79')](function(_0xad26b5){socket['emit']('userChatQueue:save',{'UserId':_0xad26b5['id'],'ChatQueueId':_0x28737b['id']});});});});});}})[_0xabbe('0x33')](respondWithStatusCode(_0x4f55c7,null))[_0xabbe('0x27')](handleError(_0x4f55c7,null));};exports[_0xabbe('0x7a')]=function(_0x3f8a36,_0x337d17,_0x330d6b){return db[_0xabbe('0x6f')]['findAll']({'where':{'id':_0x3f8a36[_0xabbe('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xabbe('0x72'),'attributes':['id'],'raw':!![]}]})[_0xabbe('0x33')](handleEntityNotFound(_0x337d17,null))['then'](function(_0x3c0008){var _0x1e25bf=_[_0xabbe('0x4c')](_0x3c0008,'id');var _0x2ccd36=[];var _0x29b3c6=[];var _0x3539dc=squel[_0xabbe('0x7b')]();_0x3539dc[_0xabbe('0x7c')](_0xabbe('0x7d'))[_0xabbe('0x7e')](_0xabbe('0x7f'),'tq')['join'](_0xabbe('0x80'),'ut',_0xabbe('0x81'))['where'](_0xabbe('0x82'),_0x3f8a36[_0xabbe('0x51')]['id']);for(var _0x2f6568=0x0;_0x2f6568<_0x3c0008[_0xabbe('0x45')];_0x2f6568+=0x1){let _0x272156=_0x3c0008[_0x2f6568];for(var _0x5d203b=0x0;_0x5d203b<_0x272156[_0xabbe('0x72')]['length'];_0x5d203b+=0x1){let _0x46fb47=_0x272156[_0xabbe('0x72')][_0x5d203b];var _0x1794b4=_0x3539dc[_0xabbe('0x83')]();_0x1794b4[_0xabbe('0x48')](_0xabbe('0x84'),_0x46fb47['id']);_0x29b3c6[_0xabbe('0x85')](db[_0xabbe('0x76')][_0xabbe('0x3f')](_0x1794b4[_0xabbe('0x86')](),{'type':db[_0xabbe('0x76')]['QueryTypes'][_0xabbe('0x87')]})[_0xabbe('0x33')](function(_0x5f5dba){if(_0x5f5dba['length']===0x1){return _0x46fb47['id'];}else{var _0xe03452=_[_0xabbe('0x88')](_['map'](_0x5f5dba,_0xabbe('0x89')),function(_0x1ffc2b){return _['includes'](_0x1e25bf,_0x1ffc2b);});if(_0xe03452){return _0x46fb47['id'];}}}));}}return BPromise['all'](_0x29b3c6)[_0xabbe('0x33')](function(_0x3c0da2){_0x2ccd36=_(_0x2ccd36)[_0xabbe('0x8a')](_0x3c0da2)[_0xabbe('0x8b')]()['value']();return db[_0xabbe('0x3b')][_0xabbe('0x54')]({'where':{'id':_0x3f8a36[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](function(_0x143ac8){return db[_0xabbe('0x76')][_0xabbe('0x77')](function(_0x7fc9fa){return _0x143ac8[_0xabbe('0x7a')](_0x3f8a36[_0xabbe('0x3f')]['ids'],{'transaction':_0x7fc9fa})[_0xabbe('0x33')](function(){if(!_['isEmpty'](_0x2ccd36)){return _0x143ac8[_0xabbe('0x8c')](_0x2ccd36,{'transaction':_0x7fc9fa});}})[_0xabbe('0x33')](function(){_0x2ccd36[_0xabbe('0x79')](function(_0x308a7e){socket[_0xabbe('0x8d')](_0xabbe('0x8e'),{'UserId':_0x308a7e,'ChatQueueId':_0x143ac8['id']});});});});});});})[_0xabbe('0x33')](respondWithStatusCode(_0x337d17,null))[_0xabbe('0x27')](handleError(_0x337d17,null));};exports[_0xabbe('0x8f')]=function(_0x1b5595,_0x53d711,_0x5906d5){return db['ChatQueue']['find']({'where':{'id':_0x1b5595[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](handleEntityNotFound(_0x53d711,null))[_0xabbe('0x33')](function(_0x499bf6){if(_0x499bf6){return _0x499bf6['addAgents'](_0x1b5595['body'][_0xabbe('0x90')],_[_0xabbe('0x91')](_0x1b5595['body'],[_0xabbe('0x90'),'id'])||{})['spread'](function(_0x51d238){for(var _0x12b5e3=0x0;_0x12b5e3<_0x1b5595[_0xabbe('0x5c')][_0xabbe('0x90')]['length'];_0x12b5e3+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x1b5595[_0xabbe('0x5c')][_0xabbe('0x90')][_0x12b5e3]),'ChatQueueId':Number(_0x1b5595[_0xabbe('0x51')]['id'])});}return _0x51d238;});}})[_0xabbe('0x33')](respondWithResult(_0x53d711,null))[_0xabbe('0x27')](handleError(_0x53d711,null));};exports[_0xabbe('0x8c')]=function(_0x26a4db,_0x9b4570,_0x3bee24){return db[_0xabbe('0x3b')][_0xabbe('0x54')]({'where':{'id':_0x26a4db[_0xabbe('0x51')]['id']}})['then'](handleEntityNotFound(_0x9b4570,null))[_0xabbe('0x33')](function(_0x1cb056){if(_0x1cb056){return _0x1cb056['removeAgents'](_0x26a4db[_0xabbe('0x3f')]['ids'])['then'](function(){if(_[_0xabbe('0x92')](_0x26a4db[_0xabbe('0x3f')]['ids'])){for(var _0x1bc803=0x0;_0x1bc803<_0x26a4db[_0xabbe('0x3f')]['ids'][_0xabbe('0x45')];_0x1bc803+=0x1){socket[_0xabbe('0x8d')](_0xabbe('0x8e'),{'UserId':Number(_0x26a4db[_0xabbe('0x3f')][_0xabbe('0x90')][_0x1bc803]),'ChatQueueId':Number(_0x26a4db[_0xabbe('0x51')]['id'])});}}else{socket[_0xabbe('0x8d')](_0xabbe('0x8e'),{'UserId':Number(_0x26a4db[_0xabbe('0x3f')][_0xabbe('0x90')]),'ChatQueueId':Number(_0x26a4db[_0xabbe('0x51')]['id'])});}});}})[_0xabbe('0x33')](respondWithStatusCode(_0x9b4570,null))[_0xabbe('0x27')](handleError(_0x9b4570,null));};exports['getAgents']=function(_0x2862ca,_0xe5a4ec,_0x18d0cb){var _0x575bcd={};var _0x3ea8ff={};var _0x475d74;var _0x1cc4ea;return db[_0xabbe('0x3b')]['findOne']({'where':{'id':_0x2862ca[_0xabbe('0x51')]['id']}})[_0xabbe('0x33')](handleEntityNotFound(_0xe5a4ec,null))[_0xabbe('0x33')](function(_0x1cf424){if(_0x1cf424){_0x475d74=_0x1cf424;_0x3ea8ff[_0xabbe('0x3e')]=_[_0xabbe('0x40')](db[_0xabbe('0x62')][_0xabbe('0x3c')]);_0x3ea8ff[_0xabbe('0x3f')]=_[_0xabbe('0x40')](_0x2862ca[_0xabbe('0x3f')]);_0x3ea8ff[_0xabbe('0x41')]=_[_0xabbe('0x42')](_0x3ea8ff[_0xabbe('0x3e')],_0x3ea8ff[_0xabbe('0x3f')]);_0x575bcd['attributes']=_[_0xabbe('0x42')](_0x3ea8ff[_0xabbe('0x3e')],qs['fields'](_0x2862ca[_0xabbe('0x3f')][_0xabbe('0x43')]));_0x575bcd[_0xabbe('0x44')]=_0x575bcd[_0xabbe('0x44')][_0xabbe('0x45')]?_0x575bcd[_0xabbe('0x44')]:_0x3ea8ff['model'];_0x575bcd[_0xabbe('0x70')]=qs[_0xabbe('0x47')](_0x2862ca[_0xabbe('0x3f')][_0xabbe('0x47')]);_0x575bcd[_0xabbe('0x48')]=qs[_0xabbe('0x41')](_['pick'](_0x2862ca[_0xabbe('0x3f')],_0x3ea8ff[_0xabbe('0x41')]));if(_0x2862ca[_0xabbe('0x3f')][_0xabbe('0x4a')]){_0x575bcd[_0xabbe('0x48')]=_[_0xabbe('0x4b')](_0x575bcd[_0xabbe('0x48')],{'$or':_[_0xabbe('0x4c')](_0x575bcd[_0xabbe('0x44')],function(_0x108876){var _0x5b2d95={};_0x5b2d95[_0x108876]={'$like':'%'+_0x2862ca['query']['filter']+'%'};return _0x5b2d95;})});}_0x575bcd=_[_0xabbe('0x4b')]({},_0x575bcd,_0x2862ca['options']);return _0x475d74[_0xabbe('0x93')](_0x575bcd);}})[_0xabbe('0x33')](function(_0x217f4d){if(_0x217f4d){_0x1cc4ea=_0x217f4d[_0xabbe('0x45')];if(!_0x2862ca[_0xabbe('0x3f')][_0xabbe('0x46')]('nolimit')){_0x575bcd[_0xabbe('0x2e')]=qs[_0xabbe('0x2e')](_0x2862ca[_0xabbe('0x3f')][_0xabbe('0x2e')]);_0x575bcd['offset']=qs[_0xabbe('0x2b')](_0x2862ca['query'][_0xabbe('0x2b')]);}return _0x475d74['getAgents'](_0x575bcd);}})['then'](function(_0x429d20){if(_0x429d20){return _0x429d20?{'count':_0x1cc4ea,'rows':_0x429d20}:null;}})[_0xabbe('0x33')](respondWithResult(_0xe5a4ec,null))[_0xabbe('0x27')](handleError(_0xe5a4ec,null));};
\ No newline at end of file
+var _0xa7a4=['lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','sort','ChatQueueId','merge','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0x1573cb,_0xb77ccf){var _0x3da854=function(_0x2dfc20){while(--_0x2dfc20){_0x1573cb['push'](_0x1573cb['shift']());}};_0x3da854(++_0xb77ccf);}(_0xa7a4,0x1d9));var _0x4a7a=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0xa7a4[_0x187718];return _0x29ddf4;};'use strict';var emlformat=require(_0x4a7a('0x0'));var rimraf=require(_0x4a7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a7a('0x2'));var moment=require(_0x4a7a('0x3'));var BPromise=require(_0x4a7a('0x4'));var Mustache=require('mustache');var util=require(_0x4a7a('0x5'));var path=require(_0x4a7a('0x6'));var sox=require('sox');var csv=require(_0x4a7a('0x7'));var ejs=require(_0x4a7a('0x8'));var fs=require('fs');var fs_extra=require(_0x4a7a('0x9'));var _=require(_0x4a7a('0xa'));var squel=require(_0x4a7a('0xb'));var crypto=require(_0x4a7a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4a7a('0xd'));var toCsv=require(_0x4a7a('0x7'));var querystring=require('querystring');var Papa=require(_0x4a7a('0xe'));var Redis=require(_0x4a7a('0xf'));var authService=require(_0x4a7a('0x10'));var qs=require(_0x4a7a('0x11'));var as=require(_0x4a7a('0x12'));var hardwareService=require(_0x4a7a('0x13'));var logger=require(_0x4a7a('0x14'))(_0x4a7a('0x15'));var utils=require(_0x4a7a('0x16'));var config=require(_0x4a7a('0x17'));var licenseUtil=require(_0x4a7a('0x18'));var db=require('../../mysqldb')['db'];config[_0x4a7a('0x19')]=_[_0x4a7a('0x1a')](config[_0x4a7a('0x19')],{'host':_0x4a7a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a7a('0x19')]));require(_0x4a7a('0x1c'))[_0x4a7a('0x1d')](socket);var jayson=require(_0x4a7a('0x1e'));var client=jayson[_0x4a7a('0x1f')][_0x4a7a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2be882,_0x382574,_0x4ecd4a,_0x327d62){return new BPromise(function(_0x1b904c,_0x12e737){var _0x167ff9=_0x327d62||client;return _0x167ff9[_0x4a7a('0x21')](_0x2be882,_0x4ecd4a)[_0x4a7a('0x22')](function(_0x251c7f){logger[_0x4a7a('0x23')](_0x4a7a('0x24'),_0x382574,_0x4a7a('0x25'));logger[_0x4a7a('0x26')](_0x4a7a('0x27'),_0x382574,_0x4a7a('0x25'),JSON[_0x4a7a('0x28')](_0x251c7f));if(_0x251c7f['error']){if(_0x251c7f[_0x4a7a('0x29')][_0x4a7a('0x2a')]===0x1f4){logger[_0x4a7a('0x29')](_0x4a7a('0x24'),_0x382574,_0x251c7f[_0x4a7a('0x29')][_0x4a7a('0x2b')]);return _0x12e737(_0x251c7f[_0x4a7a('0x29')]['message']);}logger[_0x4a7a('0x29')]('ChatQueue,\x20%s,\x20%s',_0x382574,_0x251c7f[_0x4a7a('0x29')][_0x4a7a('0x2b')]);return _0x1b904c(_0x251c7f[_0x4a7a('0x29')][_0x4a7a('0x2b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x382574,_0x4a7a('0x25'));_0x1b904c(_0x251c7f[_0x4a7a('0x2c')][_0x4a7a('0x2b')]);}})[_0x4a7a('0x2d')](function(_0x4aabe4){logger[_0x4a7a('0x29')](_0x4a7a('0x24'),_0x382574,_0x4aabe4);_0x12e737(_0x4aabe4);});});}function respondWithStatusCode(_0x3e1687,_0x238702){_0x238702=_0x238702||0xcc;return function(_0x48b0de){if(_0x48b0de){return _0x3e1687[_0x4a7a('0x2e')](_0x238702);}return _0x3e1687[_0x4a7a('0x2f')](_0x238702)[_0x4a7a('0x30')]();};}function respondWithResult(_0x378c9b,_0x35b01f){_0x35b01f=_0x35b01f||0xc8;return function(_0x3da849){if(_0x3da849){return _0x378c9b[_0x4a7a('0x2f')](_0x35b01f)[_0x4a7a('0x31')](_0x3da849);}};}function respondWithFilteredResult(_0x13cf7a,_0x56bfb0){return function(_0xd192f8){if(_0xd192f8){var _0x5c540e=typeof _0x56bfb0[_0x4a7a('0x32')]===_0x4a7a('0x33')&&typeof _0x56bfb0[_0x4a7a('0x34')]===_0x4a7a('0x33');var _0xa033f1=_0xd192f8['count'];var _0x5c33b7=_0x5c540e?0x0:_0x56bfb0['offset'];var _0x215ccf=_0x5c540e?_0xd192f8[_0x4a7a('0x35')]:_0x56bfb0[_0x4a7a('0x32')]+_0x56bfb0[_0x4a7a('0x34')];var _0xc7552d;if(_0x215ccf>=_0xa033f1){_0x215ccf=_0xa033f1;_0xc7552d=0xc8;}else{_0xc7552d=0xce;}_0x13cf7a[_0x4a7a('0x2f')](_0xc7552d);return _0x13cf7a[_0x4a7a('0x36')](_0x4a7a('0x37'),_0x5c33b7+'-'+_0x215ccf+'/'+_0xa033f1)[_0x4a7a('0x31')](_0xd192f8);}return null;};}function patchUpdates(_0x2eecd2){return function(_0x23dd62){try{jsonpatch['apply'](_0x23dd62,_0x2eecd2,!![]);}catch(_0x50edc1){return BPromise[_0x4a7a('0x38')](_0x50edc1);}return _0x23dd62[_0x4a7a('0x39')]();};}function saveUpdates(_0x467de1,_0x50a28b){return function(_0x2c4509){if(_0x2c4509){return _0x2c4509[_0x4a7a('0x3a')](_0x467de1)[_0x4a7a('0x22')](function(_0x4031a4){return _0x4031a4;});}return null;};}function removeEntity(_0x4f606d,_0x40d416){return function(_0x6aef06){if(_0x6aef06){return _0x6aef06[_0x4a7a('0x3b')]()[_0x4a7a('0x22')](function(){var _0x10e04e=_0x6aef06[_0x4a7a('0x3c')]({'plain':!![]});var _0x1c7813=_0x4a7a('0x3d');return db['UserProfileResource'][_0x4a7a('0x3b')]({'where':{'type':_0x1c7813,'resourceId':_0x10e04e['id']}})[_0x4a7a('0x22')](function(){return _0x6aef06;});})[_0x4a7a('0x22')](function(){_0x4f606d[_0x4a7a('0x2f')](0xcc)[_0x4a7a('0x30')]();});}};}function handleEntityNotFound(_0x3201b4,_0x4df310){return function(_0x209504){if(!_0x209504){_0x3201b4[_0x4a7a('0x2e')](0x194);}return _0x209504;};}function handleError(_0xf64f23,_0x52fc3f){_0x52fc3f=_0x52fc3f||0x1f4;return function(_0x306642){logger[_0x4a7a('0x29')](_0x306642[_0x4a7a('0x3e')]);if(_0x306642[_0x4a7a('0x3f')]){delete _0x306642[_0x4a7a('0x3f')];}_0xf64f23[_0x4a7a('0x2f')](_0x52fc3f)[_0x4a7a('0x40')](_0x306642);};}exports[_0x4a7a('0x41')]=function(_0x29d762,_0x323997){var _0x5ba9e2={},_0x242b8d={},_0x7c2d72={'count':0x0,'rows':[]};var _0x3cb8bb=_[_0x4a7a('0x42')](db[_0x4a7a('0x43')][_0x4a7a('0x44')],function(_0x4e3789){return{'name':_0x4e3789['fieldName'],'type':_0x4e3789[_0x4a7a('0x45')][_0x4a7a('0x46')]};});_0x242b8d[_0x4a7a('0x47')]=_[_0x4a7a('0x42')](_0x3cb8bb,'name');_0x242b8d[_0x4a7a('0x48')]=_[_0x4a7a('0x49')](_0x29d762[_0x4a7a('0x48')]);_0x242b8d['filters']=_[_0x4a7a('0x4a')](_0x242b8d['model'],_0x242b8d[_0x4a7a('0x48')]);_0x5ba9e2[_0x4a7a('0x4b')]=_['intersection'](_0x242b8d['model'],qs[_0x4a7a('0x4c')](_0x29d762['query'][_0x4a7a('0x4c')]));_0x5ba9e2[_0x4a7a('0x4b')]=_0x5ba9e2[_0x4a7a('0x4b')][_0x4a7a('0x4d')]?_0x5ba9e2[_0x4a7a('0x4b')]:_0x242b8d[_0x4a7a('0x47')];if(!_0x29d762[_0x4a7a('0x48')]['hasOwnProperty'](_0x4a7a('0x4e'))){_0x5ba9e2[_0x4a7a('0x34')]=qs['limit'](_0x29d762['query']['limit']);_0x5ba9e2[_0x4a7a('0x32')]=qs['offset'](_0x29d762[_0x4a7a('0x48')][_0x4a7a('0x32')]);}_0x5ba9e2[_0x4a7a('0x4f')]=qs['sort'](_0x29d762[_0x4a7a('0x48')]['sort']);_0x5ba9e2[_0x4a7a('0x50')]=qs[_0x4a7a('0x51')](_[_0x4a7a('0x52')](_0x29d762[_0x4a7a('0x48')],_0x242b8d[_0x4a7a('0x51')]),_0x3cb8bb);if(_0x29d762['query'][_0x4a7a('0x53')]){_0x5ba9e2[_0x4a7a('0x50')]=_['merge'](_0x5ba9e2[_0x4a7a('0x50')],{'$or':_[_0x4a7a('0x42')](_0x3cb8bb,function(_0x10176a){if(_0x10176a[_0x4a7a('0x45')]!==_0x4a7a('0x54')){var _0xea891f={};_0xea891f[_0x10176a[_0x4a7a('0x3f')]]={'$like':'%'+_0x29d762[_0x4a7a('0x48')][_0x4a7a('0x53')]+'%'};return _0xea891f;}})});}_0x5ba9e2=_['merge']({},_0x5ba9e2,_0x29d762[_0x4a7a('0x55')]);var _0x2eedca={'where':_0x5ba9e2['where']};return db[_0x4a7a('0x43')][_0x4a7a('0x35')](_0x2eedca)[_0x4a7a('0x22')](function(_0x17634d){_0x7c2d72[_0x4a7a('0x35')]=_0x17634d;if(_0x29d762[_0x4a7a('0x48')][_0x4a7a('0x56')]){_0x5ba9e2[_0x4a7a('0x57')]=[{'all':!![]}];}return db[_0x4a7a('0x43')]['findAll'](_0x5ba9e2);})[_0x4a7a('0x22')](function(_0x485064){_0x7c2d72[_0x4a7a('0x58')]=_0x485064;return _0x7c2d72;})[_0x4a7a('0x22')](respondWithFilteredResult(_0x323997,_0x5ba9e2))['catch'](handleError(_0x323997,null));};exports[_0x4a7a('0x59')]=function(_0x47250b,_0x3a7b60){var _0x7d0937={'raw':!![],'where':{'id':_0x47250b[_0x4a7a('0x5a')]['id']}},_0x3bb8ea={};_0x3bb8ea[_0x4a7a('0x47')]=_[_0x4a7a('0x49')](db[_0x4a7a('0x43')][_0x4a7a('0x44')]);_0x3bb8ea[_0x4a7a('0x48')]=_[_0x4a7a('0x49')](_0x47250b[_0x4a7a('0x48')]);_0x3bb8ea[_0x4a7a('0x51')]=_['intersection'](_0x3bb8ea[_0x4a7a('0x47')],_0x3bb8ea[_0x4a7a('0x48')]);_0x7d0937['attributes']=_[_0x4a7a('0x4a')](_0x3bb8ea['model'],qs['fields'](_0x47250b[_0x4a7a('0x48')][_0x4a7a('0x4c')]));_0x7d0937[_0x4a7a('0x4b')]=_0x7d0937[_0x4a7a('0x4b')]['length']?_0x7d0937[_0x4a7a('0x4b')]:_0x3bb8ea[_0x4a7a('0x47')];if(_0x47250b[_0x4a7a('0x48')][_0x4a7a('0x56')]){_0x7d0937[_0x4a7a('0x57')]=[{'all':!![]}];}_0x7d0937=_['merge']({},_0x7d0937,_0x47250b[_0x4a7a('0x55')]);return db['ChatQueue']['find'](_0x7d0937)[_0x4a7a('0x22')](handleEntityNotFound(_0x3a7b60,null))[_0x4a7a('0x22')](respondWithResult(_0x3a7b60,null))['catch'](handleError(_0x3a7b60,null));};exports[_0x4a7a('0x5b')]=function(_0xcdbfc1,_0x321577){return db['ChatQueue'][_0x4a7a('0x5b')](_0xcdbfc1[_0x4a7a('0x5c')],{})[_0x4a7a('0x22')](function(_0x3cd85e){var _0x19ac61=_0xcdbfc1['user']['get']({'plain':!![]});if(!_0x19ac61)throw new Error(_0x4a7a('0x5d'));if(_0x19ac61[_0x4a7a('0x5e')]===_0x4a7a('0x5f')){var _0x39a274=_0x3cd85e[_0x4a7a('0x3c')]({'plain':!![]});var _0x4becb6=_0x4a7a('0x3d');return db[_0x4a7a('0x60')][_0x4a7a('0x61')]({'where':{'name':_0x4becb6,'userProfileId':_0x19ac61[_0x4a7a('0x62')]},'raw':!![]})[_0x4a7a('0x22')](function(_0x1eb32a){if(_0x1eb32a&&_0x1eb32a[_0x4a7a('0x63')]===0x0){return db[_0x4a7a('0x64')][_0x4a7a('0x5b')]({'name':_0x39a274[_0x4a7a('0x3f')],'resourceId':_0x39a274['id'],'type':_0x1eb32a[_0x4a7a('0x3f')],'sectionId':_0x1eb32a['id']},{})[_0x4a7a('0x22')](function(){return _0x3cd85e;});}else{return _0x3cd85e;}})[_0x4a7a('0x2d')](function(_0x5824da){logger[_0x4a7a('0x29')](_0x4a7a('0x65'),_0x5824da);throw _0x5824da;});}return _0x3cd85e;})[_0x4a7a('0x22')](respondWithResult(_0x321577,0xc9))[_0x4a7a('0x2d')](handleError(_0x321577,null));};exports['update']=function(_0x3dc776,_0x3c146c){if(_0x3dc776[_0x4a7a('0x5c')]['id']){delete _0x3dc776[_0x4a7a('0x5c')]['id'];}return db[_0x4a7a('0x43')]['find']({'where':{'id':_0x3dc776['params']['id']}})['then'](handleEntityNotFound(_0x3c146c,null))[_0x4a7a('0x22')](saveUpdates(_0x3dc776['body'],null))[_0x4a7a('0x22')](respondWithResult(_0x3c146c,null))[_0x4a7a('0x2d')](handleError(_0x3c146c,null));};exports[_0x4a7a('0x3b')]=function(_0x55bb13,_0x1bdfab){return db['ChatQueue'][_0x4a7a('0x61')]({'where':{'id':_0x55bb13['params']['id']}})[_0x4a7a('0x22')](handleEntityNotFound(_0x1bdfab,null))['then'](removeEntity(_0x1bdfab,null))[_0x4a7a('0x2d')](handleError(_0x1bdfab,null));};exports[_0x4a7a('0x66')]=function(_0x4503fc,_0x5a6e5a){return db['ChatQueue'][_0x4a7a('0x66')]()['then'](respondWithResult(_0x5a6e5a,null))['catch'](handleError(_0x5a6e5a,null));};exports[_0x4a7a('0x67')]=function(_0x505af4,_0xa71e7c,_0x3dfe77){var _0x4af9ec={'raw':!![],'where':{}},_0x2af79d={},_0x5b572e;return db[_0x4a7a('0x43')][_0x4a7a('0x68')]({'where':{'id':_0x505af4[_0x4a7a('0x5a')]['id']}})[_0x4a7a('0x22')](handleEntityNotFound(_0xa71e7c,null))[_0x4a7a('0x22')](function(_0x17abd5){if(_0x17abd5){_0x5b572e=_0x17abd5['get']({'plain':!![]});_0x2af79d[_0x4a7a('0x47')]=_[_0x4a7a('0x49')](db[_0x4a7a('0x69')][_0x4a7a('0x44')]);_0x2af79d[_0x4a7a('0x48')]=_[_0x4a7a('0x49')](_0x505af4[_0x4a7a('0x48')]);_0x2af79d[_0x4a7a('0x51')]=_[_0x4a7a('0x4a')](_0x2af79d['model'],_0x2af79d[_0x4a7a('0x48')]);_0x4af9ec[_0x4a7a('0x4b')]=_[_0x4a7a('0x4a')](_0x2af79d[_0x4a7a('0x47')],qs[_0x4a7a('0x4c')](_0x505af4[_0x4a7a('0x48')][_0x4a7a('0x4c')]));_0x4af9ec[_0x4a7a('0x4b')]=_0x4af9ec[_0x4a7a('0x4b')][_0x4a7a('0x4d')]?_0x4af9ec[_0x4a7a('0x4b')]:_0x2af79d[_0x4a7a('0x47')];if(!_0x505af4[_0x4a7a('0x48')][_0x4a7a('0x6a')](_0x4a7a('0x4e'))){_0x4af9ec[_0x4a7a('0x34')]=qs[_0x4a7a('0x34')](_0x505af4['query']['limit']);_0x4af9ec['offset']=qs[_0x4a7a('0x32')](_0x505af4[_0x4a7a('0x48')][_0x4a7a('0x32')]);}_0x4af9ec[_0x4a7a('0x4f')]=qs['sort'](_0x505af4['query'][_0x4a7a('0x6b')]);_0x4af9ec[_0x4a7a('0x50')]=qs[_0x4a7a('0x51')](_['pick'](_0x505af4[_0x4a7a('0x48')],_0x2af79d['filters']));_0x4af9ec[_0x4a7a('0x50')][_0x4a7a('0x6c')]=_0x17abd5['id'];if(_0x505af4[_0x4a7a('0x48')][_0x4a7a('0x53')]){_0x4af9ec[_0x4a7a('0x50')]=_[_0x4a7a('0x6d')](_0x4af9ec[_0x4a7a('0x50')],{'$or':_[_0x4a7a('0x42')](_0x4af9ec[_0x4a7a('0x4b')],function(_0x9743a9){var _0xb05a2a={};_0xb05a2a[_0x9743a9]={'$like':'%'+_0x505af4[_0x4a7a('0x48')]['filter']+'%'};return _0xb05a2a;})});}_0x4af9ec=_[_0x4a7a('0x6d')]({},_0x4af9ec,_0x505af4[_0x4a7a('0x55')]);return db[_0x4a7a('0x69')][_0x4a7a('0x6e')](_0x4af9ec);}})[_0x4a7a('0x22')](function(_0x17c0f4){if(_0x17c0f4){return db[_0x4a7a('0x6f')]['findAndCountAll']({'where':{'id':_[_0x4a7a('0x42')](_0x17c0f4,_0x4a7a('0x70')),'role':_0x4a7a('0x71')},'attributes':['id',_0x4a7a('0x3f'),_0x4a7a('0x72'),_0x4a7a('0x73'),_0x4a7a('0x74')]});}})[_0x4a7a('0x22')](function(_0x1b5234){if(_0x1b5234){return{'count':_0x1b5234[_0x4a7a('0x35')],'rows':_[_0x4a7a('0x42')](_0x1b5234[_0x4a7a('0x58')],function(_0x19045f){return{'membername':_0x19045f['name'],'UserId':_0x19045f['id'],'queue_name':_0x5b572e[_0x4a7a('0x3f')],'ChatQueueId':_0x5b572e['id'],'interface':util[_0x4a7a('0x75')]('%s/%s',_0x4a7a('0x76'),_0x19045f[_0x4a7a('0x3f')]),'penalty':0x0,'paused':_0x19045f['chatPause'],'createdAt':_0x19045f['createdAt'],'updatedAt':_0x19045f[_0x4a7a('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4a7a('0x22')](respondWithFilteredResult(_0xa71e7c,_0x4af9ec))[_0x4a7a('0x2d')](handleError(_0xa71e7c,null));};exports[_0x4a7a('0x77')]=function(_0x1d88c3,_0x16d4bc,_0x1b44ce){var _0x371161={};var _0x146cf6={};var _0x31d69c;var _0x430128;return db[_0x4a7a('0x43')][_0x4a7a('0x68')]({'where':{'id':_0x1d88c3['params']['id']}})[_0x4a7a('0x22')](handleEntityNotFound(_0x16d4bc,null))[_0x4a7a('0x22')](function(_0x4bfccc){if(_0x4bfccc){_0x31d69c=_0x4bfccc;_0x146cf6[_0x4a7a('0x47')]=_[_0x4a7a('0x49')](db[_0x4a7a('0x78')][_0x4a7a('0x44')]);_0x146cf6[_0x4a7a('0x48')]=_[_0x4a7a('0x49')](_0x1d88c3[_0x4a7a('0x48')]);_0x146cf6[_0x4a7a('0x51')]=_[_0x4a7a('0x4a')](_0x146cf6[_0x4a7a('0x47')],_0x146cf6[_0x4a7a('0x48')]);_0x371161['attributes']=_['intersection'](_0x146cf6['model'],qs[_0x4a7a('0x4c')](_0x1d88c3[_0x4a7a('0x48')][_0x4a7a('0x4c')]));_0x371161['attributes']=_0x371161[_0x4a7a('0x4b')][_0x4a7a('0x4d')]?_0x371161['attributes']:_0x146cf6['model'];_0x371161['order']=qs['sort'](_0x1d88c3[_0x4a7a('0x48')][_0x4a7a('0x6b')]);_0x371161[_0x4a7a('0x50')]=qs[_0x4a7a('0x51')](_[_0x4a7a('0x52')](_0x1d88c3[_0x4a7a('0x48')],_0x146cf6['filters']));if(_0x1d88c3['query'][_0x4a7a('0x53')]){_0x371161['where']=_[_0x4a7a('0x6d')](_0x371161[_0x4a7a('0x50')],{'$or':_['map'](_0x371161[_0x4a7a('0x4b')],function(_0x1f3ebd){var _0x3227f1={};_0x3227f1[_0x1f3ebd]={'$like':'%'+_0x1d88c3[_0x4a7a('0x48')][_0x4a7a('0x53')]+'%'};return _0x3227f1;})});}_0x371161=_[_0x4a7a('0x6d')]({},_0x371161,_0x1d88c3['options']);return _0x31d69c[_0x4a7a('0x77')](_0x371161);}})['then'](function(_0x49f7b2){if(_0x49f7b2){_0x430128=_0x49f7b2['length'];if(!_0x1d88c3[_0x4a7a('0x48')]['hasOwnProperty'](_0x4a7a('0x4e'))){_0x371161['limit']=qs[_0x4a7a('0x34')](_0x1d88c3[_0x4a7a('0x48')][_0x4a7a('0x34')]);_0x371161['offset']=qs[_0x4a7a('0x32')](_0x1d88c3[_0x4a7a('0x48')][_0x4a7a('0x32')]);}return _0x31d69c['getTeams'](_0x371161);}})[_0x4a7a('0x22')](function(_0x2294ee){if(_0x2294ee){return _0x2294ee?{'count':_0x430128,'rows':_0x2294ee}:null;}})[_0x4a7a('0x22')](respondWithResult(_0x16d4bc,null))['catch'](handleError(_0x16d4bc,null));};exports[_0x4a7a('0x79')]=function(_0x409ced,_0x539020,_0x597f68){var _0x56098c=_0x409ced[_0x4a7a('0x5c')][_0x4a7a('0x7a')];return db[_0x4a7a('0x78')]['findAll']({'where':{'id':_0x56098c},'attributes':['id'],'include':[{'model':db[_0x4a7a('0x6f')],'as':_0x4a7a('0x7b'),'attributes':['id',_0x4a7a('0x3f'),_0x4a7a('0x7c'),_0x4a7a('0x7d'),_0x4a7a('0x7e')],'raw':!![]}]})['then'](function(_0x2fcb9b){if(_0x2fcb9b){var _0x4fb27c=_[_0x4a7a('0x7f')](_0x2fcb9b,function(_0x508ed3){var _0x534d97=_0x508ed3[_0x4a7a('0x3c')]({'plain':!![]});return _0x534d97[_0x4a7a('0x7b')];});return db['ChatQueue'][_0x4a7a('0x61')]({'where':{'id':_0x409ced['params']['id']}})[_0x4a7a('0x22')](function(_0x52c039){return db['sequelize'][_0x4a7a('0x80')](function(_0x2b7c40){return _0x52c039[_0x4a7a('0x79')](_0x56098c,{'transaction':_0x2b7c40})[_0x4a7a('0x22')](function(){return BPromise[_0x4a7a('0x81')](_0x4fb27c,function(_0x56aac){return db['UserChatQueue'][_0x4a7a('0x82')]({'where':{'UserId':_0x56aac['id'],'ChatQueueId':_0x409ced[_0x4a7a('0x5a')]['id']},'transaction':_0x2b7c40});});})[_0x4a7a('0x22')](function(){_0x4fb27c[_0x4a7a('0x83')](function(_0x39b51b){socket[_0x4a7a('0x84')](_0x4a7a('0x85'),{'UserId':_0x39b51b['id'],'ChatQueueId':_0x52c039['id']});});});});});}})[_0x4a7a('0x22')](respondWithStatusCode(_0x539020,null))['catch'](handleError(_0x539020,null));};exports[_0x4a7a('0x86')]=function(_0x154038,_0x179a7f,_0x4d5922){return db[_0x4a7a('0x78')][_0x4a7a('0x6e')]({'where':{'id':_0x154038[_0x4a7a('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4a7a('0x6f')],'as':_0x4a7a('0x7b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x179a7f,null))[_0x4a7a('0x22')](function(_0x267f15){var _0x467fbd=_['map'](_0x267f15,'id');var _0x50b80d=[];var _0x23c150=[];var _0x222fc9=squel[_0x4a7a('0x87')]();_0x222fc9['field'](_0x4a7a('0x88'))[_0x4a7a('0x89')]('team_has_chat_queues','tq')[_0x4a7a('0x8a')](_0x4a7a('0x8b'),'ut',_0x4a7a('0x8c'))[_0x4a7a('0x50')](_0x4a7a('0x8d'),_0x154038[_0x4a7a('0x5a')]['id']);for(var _0xd7ec96=0x0;_0xd7ec96<_0x267f15[_0x4a7a('0x4d')];_0xd7ec96+=0x1){let _0x4c4d8e=_0x267f15[_0xd7ec96];for(var _0x2ce28e=0x0;_0x2ce28e<_0x4c4d8e[_0x4a7a('0x7b')][_0x4a7a('0x4d')];_0x2ce28e+=0x1){let _0x3b45d8=_0x4c4d8e[_0x4a7a('0x7b')][_0x2ce28e];var _0x5c13b6=_0x222fc9[_0x4a7a('0x8e')]();_0x5c13b6[_0x4a7a('0x50')](_0x4a7a('0x8f'),_0x3b45d8['id']);_0x23c150[_0x4a7a('0x90')](db[_0x4a7a('0x91')][_0x4a7a('0x48')](_0x5c13b6[_0x4a7a('0x92')](),{'type':db[_0x4a7a('0x91')][_0x4a7a('0x93')][_0x4a7a('0x94')]})[_0x4a7a('0x22')](function(_0x3a542d){if(_0x3a542d[_0x4a7a('0x4d')]===0x1){return _0x3b45d8['id'];}else{var _0x5067a7=_[_0x4a7a('0x95')](_[_0x4a7a('0x42')](_0x3a542d,_0x4a7a('0x96')),function(_0x2a42e3){return _['includes'](_0x467fbd,_0x2a42e3);});if(_0x5067a7){return _0x3b45d8['id'];}}}));}}return BPromise['all'](_0x23c150)[_0x4a7a('0x22')](function(_0x5e421d){_0x50b80d=_(_0x50b80d)[_0x4a7a('0x97')](_0x5e421d)['compact']()[_0x4a7a('0x98')]();return db[_0x4a7a('0x43')][_0x4a7a('0x61')]({'where':{'id':_0x154038['params']['id']}})[_0x4a7a('0x22')](function(_0x31df6d){return db[_0x4a7a('0x91')]['transaction'](function(_0x45dde8){return _0x31df6d['removeTeams'](_0x154038['query'][_0x4a7a('0x7a')],{'transaction':_0x45dde8})['then'](function(){if(!_[_0x4a7a('0x99')](_0x50b80d)){return _0x31df6d[_0x4a7a('0x9a')](_0x50b80d,{'transaction':_0x45dde8});}})[_0x4a7a('0x22')](function(){_0x50b80d['forEach'](function(_0x13a6db){socket[_0x4a7a('0x84')](_0x4a7a('0x9b'),{'UserId':_0x13a6db,'ChatQueueId':_0x31df6d['id']});});});});});});})[_0x4a7a('0x22')](respondWithStatusCode(_0x179a7f,null))['catch'](handleError(_0x179a7f,null));};exports['addAgents']=function(_0x406787,_0xc8dde3,_0xc93ed9){return db['ChatQueue'][_0x4a7a('0x61')]({'where':{'id':_0x406787[_0x4a7a('0x5a')]['id']}})['then'](handleEntityNotFound(_0xc8dde3,null))['then'](function(_0x3143c2){if(_0x3143c2){return _0x3143c2[_0x4a7a('0x9c')](_0x406787[_0x4a7a('0x5c')][_0x4a7a('0x7a')],_[_0x4a7a('0x9d')](_0x406787['body'],[_0x4a7a('0x7a'),'id'])||{})[_0x4a7a('0x9e')](function(_0x3a65e6){for(var _0x5968e7=0x0;_0x5968e7<_0x406787['body'][_0x4a7a('0x7a')][_0x4a7a('0x4d')];_0x5968e7+=0x1){socket[_0x4a7a('0x84')](_0x4a7a('0x85'),{'UserId':Number(_0x406787[_0x4a7a('0x5c')][_0x4a7a('0x7a')][_0x5968e7]),'ChatQueueId':Number(_0x406787[_0x4a7a('0x5a')]['id'])});}return _0x3a65e6;});}})[_0x4a7a('0x22')](respondWithResult(_0xc8dde3,null))[_0x4a7a('0x2d')](handleError(_0xc8dde3,null));};exports[_0x4a7a('0x9a')]=function(_0x153092,_0x54bdc6,_0xbb2a9a){return db['ChatQueue']['find']({'where':{'id':_0x153092[_0x4a7a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x54bdc6,null))[_0x4a7a('0x22')](function(_0x66657b){if(_0x66657b){return _0x66657b[_0x4a7a('0x9a')](_0x153092['query'][_0x4a7a('0x7a')])['then'](function(){if(_[_0x4a7a('0x9f')](_0x153092[_0x4a7a('0x48')][_0x4a7a('0x7a')])){for(var _0x7c780b=0x0;_0x7c780b<_0x153092['query']['ids'][_0x4a7a('0x4d')];_0x7c780b+=0x1){socket[_0x4a7a('0x84')](_0x4a7a('0x9b'),{'UserId':Number(_0x153092[_0x4a7a('0x48')][_0x4a7a('0x7a')][_0x7c780b]),'ChatQueueId':Number(_0x153092['params']['id'])});}}else{socket[_0x4a7a('0x84')](_0x4a7a('0x9b'),{'UserId':Number(_0x153092[_0x4a7a('0x48')][_0x4a7a('0x7a')]),'ChatQueueId':Number(_0x153092[_0x4a7a('0x5a')]['id'])});}});}})[_0x4a7a('0x22')](respondWithStatusCode(_0x54bdc6,null))[_0x4a7a('0x2d')](handleError(_0x54bdc6,null));};exports[_0x4a7a('0xa0')]=function(_0x12a0b0,_0x5c1b8d,_0x1f3a2b){var _0x5f5cd3={};var _0x4204ad={};var _0xdd72ca;var _0x49a932;return db[_0x4a7a('0x43')][_0x4a7a('0x68')]({'where':{'id':_0x12a0b0['params']['id']}})[_0x4a7a('0x22')](handleEntityNotFound(_0x5c1b8d,null))[_0x4a7a('0x22')](function(_0x597272){if(_0x597272){_0xdd72ca=_0x597272;_0x4204ad[_0x4a7a('0x47')]=_[_0x4a7a('0x49')](db['User'][_0x4a7a('0x44')]);_0x4204ad['query']=_[_0x4a7a('0x49')](_0x12a0b0[_0x4a7a('0x48')]);_0x4204ad['filters']=_[_0x4a7a('0x4a')](_0x4204ad[_0x4a7a('0x47')],_0x4204ad[_0x4a7a('0x48')]);_0x5f5cd3[_0x4a7a('0x4b')]=_[_0x4a7a('0x4a')](_0x4204ad[_0x4a7a('0x47')],qs['fields'](_0x12a0b0['query'][_0x4a7a('0x4c')]));_0x5f5cd3[_0x4a7a('0x4b')]=_0x5f5cd3[_0x4a7a('0x4b')]['length']?_0x5f5cd3[_0x4a7a('0x4b')]:_0x4204ad['model'];_0x5f5cd3[_0x4a7a('0x4f')]=qs[_0x4a7a('0x6b')](_0x12a0b0[_0x4a7a('0x48')][_0x4a7a('0x6b')]);_0x5f5cd3[_0x4a7a('0x50')]=qs[_0x4a7a('0x51')](_['pick'](_0x12a0b0[_0x4a7a('0x48')],_0x4204ad[_0x4a7a('0x51')]));if(_0x12a0b0['query'][_0x4a7a('0x53')]){_0x5f5cd3['where']=_['merge'](_0x5f5cd3[_0x4a7a('0x50')],{'$or':_[_0x4a7a('0x42')](_0x5f5cd3[_0x4a7a('0x4b')],function(_0xe20af3){var _0x2acba4={};_0x2acba4[_0xe20af3]={'$like':'%'+_0x12a0b0['query'][_0x4a7a('0x53')]+'%'};return _0x2acba4;})});}_0x5f5cd3=_[_0x4a7a('0x6d')]({},_0x5f5cd3,_0x12a0b0[_0x4a7a('0x55')]);return _0xdd72ca['getAgents'](_0x5f5cd3);}})['then'](function(_0x1a2953){if(_0x1a2953){_0x49a932=_0x1a2953[_0x4a7a('0x4d')];if(!_0x12a0b0['query']['hasOwnProperty'](_0x4a7a('0x4e'))){_0x5f5cd3[_0x4a7a('0x34')]=qs[_0x4a7a('0x34')](_0x12a0b0[_0x4a7a('0x48')][_0x4a7a('0x34')]);_0x5f5cd3[_0x4a7a('0x32')]=qs[_0x4a7a('0x32')](_0x12a0b0[_0x4a7a('0x48')]['offset']);}return _0xdd72ca[_0x4a7a('0xa0')](_0x5f5cd3);}})[_0x4a7a('0x22')](function(_0x47bdc5){if(_0x47bdc5){return _0x47bdc5?{'count':_0x49a932,'rows':_0x47bdc5}:null;}})['then'](respondWithResult(_0x5c1b8d,null))['catch'](handleError(_0x5c1b8d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 46337b0..e038c83 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 _0xa372=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x537c37,_0x536e74){var _0x241f84=function(_0x3fe709){while(--_0x3fe709){_0x537c37['push'](_0x537c37['shift']());}};_0x241f84(++_0x536e74);}(_0xa372,0x133));var _0x2a37=function(_0x1051c7,_0x116ac5){_0x1051c7=_0x1051c7-0x0;var _0x5828b6=_0xa372[_0x1051c7];return _0x5828b6;};'use strict';var EventEmitter=require(_0x2a37('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2a37('0x1')](0x0);var events={'afterCreate':_0x2a37('0x2'),'afterUpdate':_0x2a37('0x3'),'afterDestroy':_0x2a37('0x4')};function emitEvent(_0x5e1068){return function(_0x581fce,_0x188768,_0x2078f2){ChatQueueEvents[_0x2a37('0x5')](_0x5e1068+':'+_0x581fce['id'],_0x581fce);ChatQueueEvents[_0x2a37('0x5')](_0x5e1068,_0x581fce);_0x2078f2(null);};}for(var e in events){if(events[_0x2a37('0x6')](e)){var event=events[e];ChatQueue[_0x2a37('0x7')](e,emitEvent(event));}}module[_0x2a37('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe7e4=['emit','hasOwnProperty','exports','../../mysqldb','ChatQueue','save','update','remove'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0xe7e4,0xa3));var _0x4e7e=function(_0x15dda5,_0x4fd827){_0x15dda5=_0x15dda5-0x0;var _0x446d4e=_0xe7e4[_0x15dda5];return _0x446d4e;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4e7e('0x0'))['db'][_0x4e7e('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4e7e('0x2'),'afterUpdate':_0x4e7e('0x3'),'afterDestroy':_0x4e7e('0x4')};function emitEvent(_0x3d4f7e){return function(_0x2d15e4,_0x2eaf1e,_0x224848){ChatQueueEvents[_0x4e7e('0x5')](_0x3d4f7e+':'+_0x2d15e4['id'],_0x2d15e4);ChatQueueEvents['emit'](_0x3d4f7e,_0x2d15e4);_0x224848(null);};}for(var e in events){if(events[_0x4e7e('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4e7e('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 59d43d7..ad26868 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 _0x0169=['bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment'];(function(_0x4dc57d,_0x2a4081){var _0x1f8a87=function(_0x408b27){while(--_0x408b27){_0x4dc57d['push'](_0x4dc57d['shift']());}};_0x1f8a87(++_0x2a4081);}(_0x0169,0x14e));var _0x9016=function(_0x33b257,_0x392a6b){_0x33b257=_0x33b257-0x0;var _0x36ba13=_0x0169[_0x33b257];return _0x36ba13;};'use strict';var _=require(_0x9016('0x0'));var util=require(_0x9016('0x1'));var logger=require('../../config/logger')(_0x9016('0x2'));var moment=require(_0x9016('0x3'));var BPromise=require(_0x9016('0x4'));var rp=require(_0x9016('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9016('0x6'));var config=require(_0x9016('0x7'));var attributes=require(_0x9016('0x8'));module[_0x9016('0x9')]=function(_0x33263e,_0x16002c){return _0x33263e[_0x9016('0xa')](_0x9016('0xb'),attributes,{'tableName':_0x9016('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b1c=['rimraf','../../config/environment','exports','define','ChatQueue','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3b1c,0x6d));var _0xc3b1=function(_0xd3fc0b,_0x596d26){_0xd3fc0b=_0xd3fc0b-0x0;var _0x542125=_0x3b1c[_0xd3fc0b];return _0x542125;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc3b1('0x0'));var moment=require(_0xc3b1('0x1'));var BPromise=require('bluebird');var rp=require(_0xc3b1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3b1('0x3'));var config=require(_0xc3b1('0x4'));var attributes=require('./chatQueue.attributes');module[_0xc3b1('0x5')]=function(_0x435b49,_0x6a202a){return _0x435b49[_0xc3b1('0x6')](_0xc3b1('0x7'),attributes,{'tableName':'chat_queues','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 7ef0d5f..9afe527 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 _0x8185=['register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x26647c,_0x45c83a){var _0x3fbf4d=function(_0x47fd85){while(--_0x47fd85){_0x26647c['push'](_0x26647c['shift']());}};_0x3fbf4d(++_0x45c83a);}(_0x8185,0xb8));var _0x5818=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x8185[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x5818('0x0'));var util=require(_0x5818('0x1'));var moment=require(_0x5818('0x2'));var BPromise=require('bluebird');var rs=require(_0x5818('0x3'));var fs=require('fs');var Redis=require(_0x5818('0x4'));var db=require(_0x5818('0x5'))['db'];var utils=require(_0x5818('0x6'));var logger=require(_0x5818('0x7'))('rpc');var config=require(_0x5818('0x8'));var jayson=require(_0x5818('0x9'));var client=jayson[_0x5818('0xa')][_0x5818('0xb')]({'port':0x232a});config[_0x5818('0xc')]=_[_0x5818('0xd')](config[_0x5818('0xc')],{'host':_0x5818('0xe'),'port':0x18eb});var socket=require(_0x5818('0xf'))(new Redis(config[_0x5818('0xc')]));require('./chatQueue.socket')[_0x5818('0x10')](socket);function respondWithRpcPromise(_0x1196f7,_0x5ec895,_0x3f18d7){return new BPromise(function(_0x1154bc,_0x54f7f2){return client['request'](_0x1196f7,_0x3f18d7)[_0x5818('0x11')](function(_0x21df2b){logger['info'](_0x5818('0x12'),_0x5ec895,_0x5818('0x13'));logger[_0x5818('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5ec895,_0x5818('0x13'),JSON[_0x5818('0x15')](_0x21df2b));if(_0x21df2b[_0x5818('0x16')]){if(_0x21df2b[_0x5818('0x16')][_0x5818('0x17')]===0x1f4){logger['error'](_0x5818('0x12'),_0x5ec895,_0x21df2b[_0x5818('0x16')][_0x5818('0x18')]);return _0x54f7f2(_0x21df2b[_0x5818('0x16')][_0x5818('0x18')]);}logger[_0x5818('0x16')](_0x5818('0x12'),_0x5ec895,_0x21df2b['error'][_0x5818('0x18')]);return _0x1154bc(_0x21df2b['error']['message']);}else{logger[_0x5818('0x19')]('ChatQueue,\x20%s,\x20%s',_0x5ec895,_0x5818('0x13'));_0x1154bc(_0x21df2b[_0x5818('0x1a')][_0x5818('0x18')]);}})[_0x5818('0x1b')](function(_0x4501dc){logger['error'](_0x5818('0x12'),_0x5ec895,_0x4501dc);_0x54f7f2(_0x4501dc);});});}exports[_0x5818('0x1c')]=function(_0x3e49ba){var _0x1d7873=this;return new Promise(function(_0xae2494,_0x381da6){return db[_0x5818('0x1d')][_0x5818('0x1e')]({'raw':_0x3e49ba[_0x5818('0x1f')]?_0x3e49ba[_0x5818('0x1f')][_0x5818('0x20')]===undefined?!![]:![]:!![],'where':_0x3e49ba[_0x5818('0x1f')]?_0x3e49ba['options'][_0x5818('0x21')]||null:null,'attributes':_0x3e49ba['options']?_0x3e49ba[_0x5818('0x1f')][_0x5818('0x22')]||null:null,'limit':_0x3e49ba[_0x5818('0x1f')]?_0x3e49ba[_0x5818('0x1f')]['limit']||null:null,'include':_0x3e49ba[_0x5818('0x1f')]?_0x3e49ba['options'][_0x5818('0x23')]?_[_0x5818('0x24')](_0x3e49ba[_0x5818('0x1f')][_0x5818('0x23')],function(_0x350fdf){return{'model':db[_0x350fdf['model']],'as':_0x350fdf['as'],'attributes':_0x350fdf[_0x5818('0x22')],'include':_0x350fdf[_0x5818('0x23')]?_[_0x5818('0x24')](_0x350fdf[_0x5818('0x23')],function(_0x504efd){return{'model':db[_0x504efd[_0x5818('0x25')]],'as':_0x504efd['as'],'attributes':_0x504efd[_0x5818('0x22')],'include':_0x504efd['include']?_[_0x5818('0x24')](_0x504efd[_0x5818('0x23')],function(_0x5e3a6f){return{'model':db[_0x5e3a6f['model']],'as':_0x5e3a6f['as'],'attributes':_0x5e3a6f[_0x5818('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5818('0x11')](function(_0x2ae9b7){logger['info'](_0x5818('0x1c'),_0x3e49ba);logger[_0x5818('0x14')]('GetChatQueue',_0x3e49ba,JSON[_0x5818('0x15')](_0x2ae9b7));_0xae2494(_0x2ae9b7);})['catch'](function(_0x2c110f){logger['error']('GetChatQueue',_0x2c110f['message'],_0x3e49ba);_0x381da6(_0x1d7873[_0x5818('0x16')](0x1f4,_0x2c110f[_0x5818('0x18')]));});});};exports[_0x5818('0x26')]=function(_0xf639fb){var _0x44c2ad=this;return new Promise(function(_0x28df75,_0x303901){return db[_0x5818('0x1d')][_0x5818('0x27')]({'raw':_0xf639fb[_0x5818('0x1f')]?_0xf639fb['options'][_0x5818('0x20')]===undefined?!![]:![]:!![],'where':_0xf639fb[_0x5818('0x1f')]?_0xf639fb[_0x5818('0x1f')][_0x5818('0x21')]||null:null,'attributes':_0xf639fb['options']?_0xf639fb['options']['attributes']||null:null,'include':_0xf639fb[_0x5818('0x1f')]?_0xf639fb[_0x5818('0x1f')]['include']?_[_0x5818('0x24')](_0xf639fb[_0x5818('0x1f')][_0x5818('0x23')],function(_0x5a8df1){return{'model':db[_0x5a8df1['model']],'as':_0x5a8df1['as'],'attributes':_0x5a8df1[_0x5818('0x22')],'include':_0x5a8df1[_0x5818('0x23')]?_[_0x5818('0x24')](_0x5a8df1['include'],function(_0x305987){return{'model':db[_0x305987[_0x5818('0x25')]],'as':_0x305987['as'],'attributes':_0x305987[_0x5818('0x22')],'include':_0x305987['include']?_[_0x5818('0x24')](_0x305987['include'],function(_0x3d54a0){return{'model':db[_0x3d54a0[_0x5818('0x25')]],'as':_0x3d54a0['as'],'attributes':_0x3d54a0[_0x5818('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ef890){logger[_0x5818('0x19')](_0x5818('0x26'),_0xf639fb);logger[_0x5818('0x14')](_0x5818('0x26'),_0xf639fb,JSON[_0x5818('0x15')](_0x1ef890));_0x28df75(_0x1ef890);})[_0x5818('0x1b')](function(_0xade866){logger['error'](_0x5818('0x26'),_0xade866[_0x5818('0x18')],_0xf639fb);_0x303901(_0x44c2ad[_0x5818('0x16')](0x1f4,_0xade866[_0x5818('0x18')]));});});};
\ No newline at end of file
+var _0xa24a=['where','attributes','include','map','model','debug','ShowChatQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x5c4d21,_0x2df83f){var _0x30f18c=function(_0x422df5){while(--_0x422df5){_0x5c4d21['push'](_0x5c4d21['shift']());}};_0x30f18c(++_0x2df83f);}(_0xa24a,0x1a2));var _0xaa24=function(_0x4dd465,_0x28b334){_0x4dd465=_0x4dd465-0x0;var _0x4c7c91=_0xa24a[_0x4dd465];return _0x4c7c91;};'use strict';var _=require(_0xaa24('0x0'));var util=require(_0xaa24('0x1'));var moment=require(_0xaa24('0x2'));var BPromise=require(_0xaa24('0x3'));var rs=require(_0xaa24('0x4'));var fs=require('fs');var Redis=require(_0xaa24('0x5'));var db=require(_0xaa24('0x6'))['db'];var utils=require(_0xaa24('0x7'));var logger=require(_0xaa24('0x8'))(_0xaa24('0x9'));var config=require('../../config/environment');var jayson=require(_0xaa24('0xa'));var client=jayson[_0xaa24('0xb')]['http']({'port':0x232a});config[_0xaa24('0xc')]=_[_0xaa24('0xd')](config['redis'],{'host':_0xaa24('0xe'),'port':0x18eb});var socket=require(_0xaa24('0xf'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xaa24('0x10')](socket);function respondWithRpcPromise(_0x3537b3,_0x385743,_0x325ffb){return new BPromise(function(_0x16a029,_0x3667ee){return client[_0xaa24('0x11')](_0x3537b3,_0x325ffb)[_0xaa24('0x12')](function(_0x212c67){logger['info']('ChatQueue,\x20%s,\x20%s',_0x385743,_0xaa24('0x13'));logger['debug'](_0xaa24('0x14'),_0x385743,_0xaa24('0x13'),JSON[_0xaa24('0x15')](_0x212c67));if(_0x212c67[_0xaa24('0x16')]){if(_0x212c67['error'][_0xaa24('0x17')]===0x1f4){logger[_0xaa24('0x16')](_0xaa24('0x18'),_0x385743,_0x212c67[_0xaa24('0x16')][_0xaa24('0x19')]);return _0x3667ee(_0x212c67['error'][_0xaa24('0x19')]);}logger['error'](_0xaa24('0x18'),_0x385743,_0x212c67[_0xaa24('0x16')][_0xaa24('0x19')]);return _0x16a029(_0x212c67[_0xaa24('0x16')][_0xaa24('0x19')]);}else{logger[_0xaa24('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x385743,_0xaa24('0x13'));_0x16a029(_0x212c67[_0xaa24('0x1b')]['message']);}})[_0xaa24('0x1c')](function(_0xcddd8a){logger[_0xaa24('0x16')](_0xaa24('0x18'),_0x385743,_0xcddd8a);_0x3667ee(_0xcddd8a);});});}exports[_0xaa24('0x1d')]=function(_0xfd43c9){var _0xcbcafd=this;return new Promise(function(_0x81723c,_0x181c7e){return db[_0xaa24('0x1e')][_0xaa24('0x1f')]({'raw':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9[_0xaa24('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9['options'][_0xaa24('0x21')]||null:null,'attributes':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9[_0xaa24('0x20')][_0xaa24('0x22')]||null:null,'limit':_0xfd43c9['options']?_0xfd43c9['options']['limit']||null:null,'include':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9[_0xaa24('0x20')][_0xaa24('0x23')]?_[_0xaa24('0x24')](_0xfd43c9['options'][_0xaa24('0x23')],function(_0x53eaae){return{'model':db[_0x53eaae['model']],'as':_0x53eaae['as'],'attributes':_0x53eaae[_0xaa24('0x22')],'include':_0x53eaae['include']?_[_0xaa24('0x24')](_0x53eaae['include'],function(_0x1f85f9){return{'model':db[_0x1f85f9[_0xaa24('0x25')]],'as':_0x1f85f9['as'],'attributes':_0x1f85f9['attributes'],'include':_0x1f85f9[_0xaa24('0x23')]?_[_0xaa24('0x24')](_0x1f85f9[_0xaa24('0x23')],function(_0x40dbdd){return{'model':db[_0x40dbdd[_0xaa24('0x25')]],'as':_0x40dbdd['as'],'attributes':_0x40dbdd[_0xaa24('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaa24('0x12')](function(_0x5b8539){logger['info'](_0xaa24('0x1d'),_0xfd43c9);logger[_0xaa24('0x26')]('GetChatQueue',_0xfd43c9,JSON[_0xaa24('0x15')](_0x5b8539));_0x81723c(_0x5b8539);})[_0xaa24('0x1c')](function(_0x59c675){logger[_0xaa24('0x16')](_0xaa24('0x1d'),_0x59c675[_0xaa24('0x19')],_0xfd43c9);_0x181c7e(_0xcbcafd[_0xaa24('0x16')](0x1f4,_0x59c675[_0xaa24('0x19')]));});});};exports[_0xaa24('0x27')]=function(_0xb69c6){var _0x877767=this;return new Promise(function(_0x415701,_0x2c2ca4){return db[_0xaa24('0x1e')]['find']({'raw':_0xb69c6[_0xaa24('0x20')]?_0xb69c6[_0xaa24('0x20')][_0xaa24('0x28')]===undefined?!![]:![]:!![],'where':_0xb69c6[_0xaa24('0x20')]?_0xb69c6[_0xaa24('0x20')]['where']||null:null,'attributes':_0xb69c6[_0xaa24('0x20')]?_0xb69c6['options']['attributes']||null:null,'include':_0xb69c6[_0xaa24('0x20')]?_0xb69c6[_0xaa24('0x20')]['include']?_[_0xaa24('0x24')](_0xb69c6[_0xaa24('0x20')][_0xaa24('0x23')],function(_0xe1e920){return{'model':db[_0xe1e920[_0xaa24('0x25')]],'as':_0xe1e920['as'],'attributes':_0xe1e920[_0xaa24('0x22')],'include':_0xe1e920['include']?_[_0xaa24('0x24')](_0xe1e920[_0xaa24('0x23')],function(_0x2e9d92){return{'model':db[_0x2e9d92[_0xaa24('0x25')]],'as':_0x2e9d92['as'],'attributes':_0x2e9d92['attributes'],'include':_0x2e9d92[_0xaa24('0x23')]?_[_0xaa24('0x24')](_0x2e9d92[_0xaa24('0x23')],function(_0x2809b1){return{'model':db[_0x2809b1[_0xaa24('0x25')]],'as':_0x2809b1['as'],'attributes':_0x2809b1[_0xaa24('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1421a1){logger[_0xaa24('0x1a')](_0xaa24('0x27'),_0xb69c6);logger[_0xaa24('0x26')](_0xaa24('0x27'),_0xb69c6,JSON[_0xaa24('0x15')](_0x1421a1));_0x415701(_0x1421a1);})[_0xaa24('0x1c')](function(_0x40c0e2){logger['error'](_0xaa24('0x27'),_0x40c0e2[_0xaa24('0x19')],_0xb69c6);_0x2c2ca4(_0x877767[_0xaa24('0x16')](0x1f4,_0x40c0e2[_0xaa24('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index bd346c8..196aed1 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 _0xa8a8=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x24c984,_0x5a2069){var _0x3c872e=function(_0x3c47cb){while(--_0x3c47cb){_0x24c984['push'](_0x24c984['shift']());}};_0x3c872e(++_0x5a2069);}(_0xa8a8,0xec));var _0x8a8a=function(_0x53820f,_0x5e03c7){_0x53820f=_0x53820f-0x0;var _0x558393=_0xa8a8[_0x53820f];return _0x558393;};'use strict';var ChatQueueEvents=require(_0x8a8a('0x0'));var events=[_0x8a8a('0x1'),_0x8a8a('0x2'),_0x8a8a('0x3')];function createListener(_0x5221bc,_0x2a2676){return function(_0x3296a6){_0x2a2676[_0x8a8a('0x4')](_0x5221bc,_0x3296a6);};}function removeListener(_0x3ed1de,_0x45515d){return function(){ChatQueueEvents[_0x8a8a('0x5')](_0x3ed1de,_0x45515d);};}exports[_0x8a8a('0x6')]=function(_0x12db82){for(var _0x2e8193=0x0,_0x315fe9=events[_0x8a8a('0x7')];_0x2e8193<_0x315fe9;_0x2e8193++){var _0x8e7aa0=events[_0x2e8193];var _0x4225b9=createListener(_0x8a8a('0x8')+_0x8e7aa0,_0x12db82);ChatQueueEvents['on'](_0x8e7aa0,_0x4225b9);}};
\ No newline at end of file
+var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xb66c,0x175));var _0xcb66=function(_0x2dfcb0,_0x516f3a){_0x2dfcb0=_0x2dfcb0-0x0;var _0x4de6e2=_0xb66c[_0x2dfcb0];return _0x4de6e2;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 780947a..f0ae2f5 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(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x5fc3,0xa8));var _0x35fc=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0x5fc3[_0x533110];return _0xc3c866;};'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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x23b56d,_0x769483){var _0x3e2c6f=function(_0x53b369){while(--_0x53b369){_0x23b56d['push'](_0x23b56d['shift']());}};_0x3e2c6f(++_0x769483);}(_0xe14b,0x93));var _0xbe14=function(_0x1d617f,_0x131c06){_0x1d617f=_0x1d617f-0x0;var _0xc07500=_0xe14b[_0x1d617f];return _0xc07500;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 1e4148c..42485ec 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 _0x5872=['moment','sequelize','exports','STRING','DATE'];(function(_0x12f570,_0x2bdad1){var _0x820efc=function(_0xb209d7){while(--_0xb209d7){_0x12f570['push'](_0x12f570['shift']());}};_0x820efc(++_0x2bdad1);}(_0x5872,0x18b));var _0x2587=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x5872[_0x28e2cd];return _0x11fd46;};'use strict';var moment=require(_0x2587('0x0'));var Sequelize=require(_0x2587('0x1'));module[_0x2587('0x2')]={'uniqueid':{'type':Sequelize[_0x2587('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2587('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2587('0x4')]},'acceptAt':{'type':Sequelize[_0x2587('0x4')]},'exitAt':{'type':Sequelize[_0x2587('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xed1f=['DATE','moment','sequelize','exports','STRING'];(function(_0x488e3d,_0x4f7e2a){var _0x3ee2b2=function(_0x5b6b37){while(--_0x5b6b37){_0x488e3d['push'](_0x488e3d['shift']());}};_0x3ee2b2(++_0x4f7e2a);}(_0xed1f,0x6a));var _0xfed1=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xed1f[_0x3e44fa];return _0x2a0aba;};'use strict';var moment=require(_0xfed1('0x0'));var Sequelize=require(_0xfed1('0x1'));module[_0xfed1('0x2')]={'uniqueid':{'type':Sequelize[_0xfed1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfed1('0x3')]},'joinAt':{'type':Sequelize[_0xfed1('0x4')]},'leaveAt':{'type':Sequelize[_0xfed1('0x4')]},'acceptAt':{'type':Sequelize[_0xfed1('0x4')]},'exitAt':{'type':Sequelize[_0xfed1('0x4')]},'reason':{'type':Sequelize[_0xfed1('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b589dc0..6207c3f 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 _0xe944=['destroy','describe','eml-format','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find'];(function(_0x1e1b18,_0x5d471b){var _0x3da8f2=function(_0x51fe71){while(--_0x51fe71){_0x1e1b18['push'](_0x1e1b18['shift']());}};_0x3da8f2(++_0x5d471b);}(_0xe944,0x174));var _0x4e94=function(_0x2b3e9d,_0x4d4cf6){_0x2b3e9d=_0x2b3e9d-0x0;var _0x3c1bc8=_0xe944[_0x2b3e9d];return _0x3c1bc8;};'use strict';var emlformat=require(_0x4e94('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4e94('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4e94('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4e94('0x3'));var sox=require(_0x4e94('0x4'));var csv=require(_0x4e94('0x5'));var ejs=require(_0x4e94('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e94('0x7'));var squel=require(_0x4e94('0x8'));var crypto=require(_0x4e94('0x9'));var jsforce=require(_0x4e94('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4e94('0x5'));var querystring=require('querystring');var Papa=require(_0x4e94('0xb'));var Redis=require(_0x4e94('0xc'));var authService=require(_0x4e94('0xd'));var qs=require(_0x4e94('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e94('0xf'));var logger=require(_0x4e94('0x10'))(_0x4e94('0x11'));var utils=require(_0x4e94('0x12'));var config=require(_0x4e94('0x13'));var licenseUtil=require(_0x4e94('0x14'));var db=require(_0x4e94('0x15'))['db'];function respondWithStatusCode(_0x5b7b98,_0x5f14cc){_0x5f14cc=_0x5f14cc||0xcc;return function(_0x132129){if(_0x132129){return _0x5b7b98[_0x4e94('0x16')](_0x5f14cc);}return _0x5b7b98[_0x4e94('0x17')](_0x5f14cc)[_0x4e94('0x18')]();};}function respondWithResult(_0x2e2350,_0x538498){_0x538498=_0x538498||0xc8;return function(_0x377212){if(_0x377212){return _0x2e2350[_0x4e94('0x17')](_0x538498)[_0x4e94('0x19')](_0x377212);}};}function respondWithFilteredResult(_0x17d5a9,_0x14b942){return function(_0x3ea67f){if(_0x3ea67f){var _0x22b4ca=typeof _0x14b942[_0x4e94('0x1a')]===_0x4e94('0x1b')&&typeof _0x14b942[_0x4e94('0x1c')]===_0x4e94('0x1b');var _0x41d8dc=_0x3ea67f['count'];var _0x58034c=_0x22b4ca?0x0:_0x14b942[_0x4e94('0x1a')];var _0x950aba=_0x22b4ca?_0x3ea67f[_0x4e94('0x1d')]:_0x14b942[_0x4e94('0x1a')]+_0x14b942[_0x4e94('0x1c')];var _0x4ddddf;if(_0x950aba>=_0x41d8dc){_0x950aba=_0x41d8dc;_0x4ddddf=0xc8;}else{_0x4ddddf=0xce;}_0x17d5a9[_0x4e94('0x17')](_0x4ddddf);return _0x17d5a9[_0x4e94('0x1e')](_0x4e94('0x1f'),_0x58034c+'-'+_0x950aba+'/'+_0x41d8dc)[_0x4e94('0x19')](_0x3ea67f);}return null;};}function patchUpdates(_0x4f2107){return function(_0xf1d49a){try{jsonpatch['apply'](_0xf1d49a,_0x4f2107,!![]);}catch(_0x2c4c7){return BPromise[_0x4e94('0x20')](_0x2c4c7);}return _0xf1d49a['save']();};}function saveUpdates(_0x596039,_0xf03522){return function(_0xe3ad9c){if(_0xe3ad9c){return _0xe3ad9c[_0x4e94('0x21')](_0x596039)[_0x4e94('0x22')](function(_0x2c93de){return _0x2c93de;});}return null;};}function removeEntity(_0x3b5f86,_0x2edbd5){return function(_0x1ea50b){if(_0x1ea50b){return _0x1ea50b['destroy']()[_0x4e94('0x22')](function(){_0x3b5f86[_0x4e94('0x17')](0xcc)[_0x4e94('0x18')]();});}};}function handleEntityNotFound(_0x57178a,_0x2b9e93){return function(_0x567cd8){if(!_0x567cd8){_0x57178a['sendStatus'](0x194);}return _0x567cd8;};}function handleError(_0x1b10b3,_0x3e8f86){_0x3e8f86=_0x3e8f86||0x1f4;return function(_0x4a0f22){logger[_0x4e94('0x23')](_0x4a0f22[_0x4e94('0x24')]);if(_0x4a0f22[_0x4e94('0x25')]){delete _0x4a0f22['name'];}_0x1b10b3[_0x4e94('0x17')](_0x3e8f86)[_0x4e94('0x26')](_0x4a0f22);};}exports[_0x4e94('0x27')]=function(_0xf6ef8e,_0x543a94){var _0x3b0d27={},_0x100b68={},_0x25bd26={'count':0x0,'rows':[]};var _0xa7d015=_[_0x4e94('0x28')](db[_0x4e94('0x29')][_0x4e94('0x2a')],function(_0x42ea2a){return{'name':_0x42ea2a[_0x4e94('0x2b')],'type':_0x42ea2a['type'][_0x4e94('0x2c')]};});_0x100b68[_0x4e94('0x2d')]=_[_0x4e94('0x28')](_0xa7d015,_0x4e94('0x25'));_0x100b68[_0x4e94('0x2e')]=_[_0x4e94('0x2f')](_0xf6ef8e[_0x4e94('0x2e')]);_0x100b68['filters']=_[_0x4e94('0x30')](_0x100b68[_0x4e94('0x2d')],_0x100b68['query']);_0x3b0d27[_0x4e94('0x31')]=_[_0x4e94('0x30')](_0x100b68[_0x4e94('0x2d')],qs['fields'](_0xf6ef8e['query'][_0x4e94('0x32')]));_0x3b0d27['attributes']=_0x3b0d27[_0x4e94('0x31')][_0x4e94('0x33')]?_0x3b0d27[_0x4e94('0x31')]:_0x100b68[_0x4e94('0x2d')];if(!_0xf6ef8e[_0x4e94('0x2e')][_0x4e94('0x34')](_0x4e94('0x35'))){_0x3b0d27[_0x4e94('0x1c')]=qs[_0x4e94('0x1c')](_0xf6ef8e['query'][_0x4e94('0x1c')]);_0x3b0d27[_0x4e94('0x1a')]=qs[_0x4e94('0x1a')](_0xf6ef8e['query'][_0x4e94('0x1a')]);}_0x3b0d27[_0x4e94('0x36')]=qs[_0x4e94('0x37')](_0xf6ef8e[_0x4e94('0x2e')][_0x4e94('0x37')]);_0x3b0d27[_0x4e94('0x38')]=qs[_0x4e94('0x39')](_[_0x4e94('0x3a')](_0xf6ef8e[_0x4e94('0x2e')],_0x100b68[_0x4e94('0x39')]),_0xa7d015);if(_0xf6ef8e[_0x4e94('0x2e')][_0x4e94('0x3b')]){_0x3b0d27[_0x4e94('0x38')]=_[_0x4e94('0x3c')](_0x3b0d27['where'],{'$or':_[_0x4e94('0x28')](_0xa7d015,function(_0x198bb4){if(_0x198bb4['type']!==_0x4e94('0x3d')){var _0x5765f0={};_0x5765f0[_0x198bb4['name']]={'$like':'%'+_0xf6ef8e[_0x4e94('0x2e')]['filter']+'%'};return _0x5765f0;}})});}_0x3b0d27=_[_0x4e94('0x3c')]({},_0x3b0d27,_0xf6ef8e[_0x4e94('0x3e')]);var _0x7ce1ce={'where':_0x3b0d27[_0x4e94('0x38')]};return db['ChatQueueReport'][_0x4e94('0x1d')](_0x7ce1ce)[_0x4e94('0x22')](function(_0x33bb9d){_0x25bd26[_0x4e94('0x1d')]=_0x33bb9d;if(_0xf6ef8e['query'][_0x4e94('0x3f')]){_0x3b0d27[_0x4e94('0x40')]=[{'all':!![]}];}return db[_0x4e94('0x29')][_0x4e94('0x41')](_0x3b0d27);})[_0x4e94('0x22')](function(_0x1cd95a){_0x25bd26['rows']=_0x1cd95a;return _0x25bd26;})[_0x4e94('0x22')](respondWithFilteredResult(_0x543a94,_0x3b0d27))[_0x4e94('0x42')](handleError(_0x543a94,null));};exports[_0x4e94('0x43')]=function(_0x4acb90,_0x366f70){var _0x16bc26={'raw':!![],'where':{'id':_0x4acb90[_0x4e94('0x44')]['id']}},_0x5424d6={};_0x5424d6[_0x4e94('0x2d')]=_[_0x4e94('0x2f')](db['ChatQueueReport']['rawAttributes']);_0x5424d6[_0x4e94('0x2e')]=_[_0x4e94('0x2f')](_0x4acb90[_0x4e94('0x2e')]);_0x5424d6['filters']=_[_0x4e94('0x30')](_0x5424d6[_0x4e94('0x2d')],_0x5424d6[_0x4e94('0x2e')]);_0x16bc26[_0x4e94('0x31')]=_[_0x4e94('0x30')](_0x5424d6[_0x4e94('0x2d')],qs['fields'](_0x4acb90[_0x4e94('0x2e')]['fields']));_0x16bc26[_0x4e94('0x31')]=_0x16bc26[_0x4e94('0x31')]['length']?_0x16bc26[_0x4e94('0x31')]:_0x5424d6['model'];if(_0x4acb90[_0x4e94('0x2e')]['includeAll']){_0x16bc26[_0x4e94('0x40')]=[{'all':!![]}];}_0x16bc26=_[_0x4e94('0x3c')]({},_0x16bc26,_0x4acb90[_0x4e94('0x3e')]);return db[_0x4e94('0x29')]['find'](_0x16bc26)['then'](handleEntityNotFound(_0x366f70,null))[_0x4e94('0x22')](respondWithResult(_0x366f70,null))[_0x4e94('0x42')](handleError(_0x366f70,null));};exports[_0x4e94('0x45')]=function(_0x3dfe12,_0xb955f7){return db[_0x4e94('0x29')][_0x4e94('0x45')](_0x3dfe12[_0x4e94('0x46')],{})['then'](respondWithResult(_0xb955f7,0xc9))['catch'](handleError(_0xb955f7,null));};exports[_0x4e94('0x21')]=function(_0x3d3040,_0x4779b7){if(_0x3d3040[_0x4e94('0x46')]['id']){delete _0x3d3040['body']['id'];}return db[_0x4e94('0x29')][_0x4e94('0x47')]({'where':{'id':_0x3d3040['params']['id']}})['then'](handleEntityNotFound(_0x4779b7,null))[_0x4e94('0x22')](saveUpdates(_0x3d3040[_0x4e94('0x46')],null))[_0x4e94('0x22')](respondWithResult(_0x4779b7,null))['catch'](handleError(_0x4779b7,null));};exports[_0x4e94('0x48')]=function(_0x4340f4,_0x59bd65){return db[_0x4e94('0x29')][_0x4e94('0x47')]({'where':{'id':_0x4340f4[_0x4e94('0x44')]['id']}})[_0x4e94('0x22')](handleEntityNotFound(_0x59bd65,null))['then'](removeEntity(_0x59bd65,null))[_0x4e94('0x42')](handleError(_0x59bd65,null));};exports['describe']=function(_0x4611d3,_0x318073){return db[_0x4e94('0x29')][_0x4e94('0x49')]()[_0x4e94('0x22')](respondWithResult(_0x318073,null))['catch'](handleError(_0x318073,null));};
\ No newline at end of file
+var _0xa498=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge'];(function(_0x654add,_0x551f9){var _0x393413=function(_0x27eab0){while(--_0x27eab0){_0x654add['push'](_0x654add['shift']());}};_0x393413(++_0x551f9);}(_0xa498,0x1d6));var _0x8a49=function(_0x15482e,_0x25b23c){_0x15482e=_0x15482e-0x0;var _0x4a0651=_0xa498[_0x15482e];return _0x4a0651;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a49('0x0'));var zipdir=require(_0x8a49('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8a49('0x2'));var BPromise=require(_0x8a49('0x3'));var Mustache=require(_0x8a49('0x4'));var util=require(_0x8a49('0x5'));var path=require(_0x8a49('0x6'));var sox=require('sox');var csv=require(_0x8a49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a49('0x8'));var _=require(_0x8a49('0x9'));var squel=require(_0x8a49('0xa'));var crypto=require('crypto');var jsforce=require(_0x8a49('0xb'));var deskjs=require(_0x8a49('0xc'));var toCsv=require(_0x8a49('0x7'));var querystring=require(_0x8a49('0xd'));var Papa=require(_0x8a49('0xe'));var Redis=require(_0x8a49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x10'));var as=require(_0x8a49('0x11'));var hardwareService=require(_0x8a49('0x12'));var logger=require(_0x8a49('0x13'))(_0x8a49('0x14'));var utils=require(_0x8a49('0x15'));var config=require(_0x8a49('0x16'));var licenseUtil=require(_0x8a49('0x17'));var db=require(_0x8a49('0x18'))['db'];function respondWithStatusCode(_0x5b8111,_0x352528){_0x352528=_0x352528||0xcc;return function(_0x6ee27b){if(_0x6ee27b){return _0x5b8111[_0x8a49('0x19')](_0x352528);}return _0x5b8111['status'](_0x352528)[_0x8a49('0x1a')]();};}function respondWithResult(_0x57b350,_0x4454de){_0x4454de=_0x4454de||0xc8;return function(_0x2fe212){if(_0x2fe212){return _0x57b350['status'](_0x4454de)[_0x8a49('0x1b')](_0x2fe212);}};}function respondWithFilteredResult(_0x902ee2,_0x329a7b){return function(_0x4760d7){if(_0x4760d7){var _0x5275aa=typeof _0x329a7b['offset']===_0x8a49('0x1c')&&typeof _0x329a7b[_0x8a49('0x1d')]===_0x8a49('0x1c');var _0x2d0261=_0x4760d7['count'];var _0x47604e=_0x5275aa?0x0:_0x329a7b[_0x8a49('0x1e')];var _0x47328a=_0x5275aa?_0x4760d7[_0x8a49('0x1f')]:_0x329a7b[_0x8a49('0x1e')]+_0x329a7b['limit'];var _0x5ac3ca;if(_0x47328a>=_0x2d0261){_0x47328a=_0x2d0261;_0x5ac3ca=0xc8;}else{_0x5ac3ca=0xce;}_0x902ee2[_0x8a49('0x20')](_0x5ac3ca);return _0x902ee2[_0x8a49('0x21')](_0x8a49('0x22'),_0x47604e+'-'+_0x47328a+'/'+_0x2d0261)['json'](_0x4760d7);}return null;};}function patchUpdates(_0x2baa30){return function(_0x2e45fc){try{jsonpatch[_0x8a49('0x23')](_0x2e45fc,_0x2baa30,!![]);}catch(_0x21f407){return BPromise[_0x8a49('0x24')](_0x21f407);}return _0x2e45fc[_0x8a49('0x25')]();};}function saveUpdates(_0x16072f,_0x4bc3bc){return function(_0x304372){if(_0x304372){return _0x304372[_0x8a49('0x26')](_0x16072f)['then'](function(_0x3b6220){return _0x3b6220;});}return null;};}function removeEntity(_0x479bca,_0x41bee7){return function(_0x52811c){if(_0x52811c){return _0x52811c[_0x8a49('0x27')]()[_0x8a49('0x28')](function(){_0x479bca[_0x8a49('0x20')](0xcc)[_0x8a49('0x1a')]();});}};}function handleEntityNotFound(_0xe2ca8b,_0x2b5d8b){return function(_0x1b0a01){if(!_0x1b0a01){_0xe2ca8b['sendStatus'](0x194);}return _0x1b0a01;};}function handleError(_0x2fc60e,_0x4d72a3){_0x4d72a3=_0x4d72a3||0x1f4;return function(_0x29af9f){logger['error'](_0x29af9f[_0x8a49('0x29')]);if(_0x29af9f[_0x8a49('0x2a')]){delete _0x29af9f['name'];}_0x2fc60e['status'](_0x4d72a3)[_0x8a49('0x2b')](_0x29af9f);};}exports[_0x8a49('0x2c')]=function(_0x387b06,_0x30fffd){var _0x484a57={},_0x29de89={},_0xef6542={'count':0x0,'rows':[]};var _0x33d7c6=_[_0x8a49('0x2d')](db[_0x8a49('0x2e')]['rawAttributes'],function(_0x223ed9){return{'name':_0x223ed9[_0x8a49('0x2f')],'type':_0x223ed9[_0x8a49('0x30')][_0x8a49('0x31')]};});_0x29de89[_0x8a49('0x32')]=_[_0x8a49('0x2d')](_0x33d7c6,_0x8a49('0x2a'));_0x29de89['query']=_['keys'](_0x387b06[_0x8a49('0x33')]);_0x29de89[_0x8a49('0x34')]=_[_0x8a49('0x35')](_0x29de89[_0x8a49('0x32')],_0x29de89['query']);_0x484a57[_0x8a49('0x36')]=_[_0x8a49('0x35')](_0x29de89['model'],qs[_0x8a49('0x37')](_0x387b06['query'][_0x8a49('0x37')]));_0x484a57[_0x8a49('0x36')]=_0x484a57[_0x8a49('0x36')][_0x8a49('0x38')]?_0x484a57['attributes']:_0x29de89[_0x8a49('0x32')];if(!_0x387b06[_0x8a49('0x33')][_0x8a49('0x39')]('nolimit')){_0x484a57[_0x8a49('0x1d')]=qs['limit'](_0x387b06['query'][_0x8a49('0x1d')]);_0x484a57[_0x8a49('0x1e')]=qs[_0x8a49('0x1e')](_0x387b06[_0x8a49('0x33')]['offset']);}_0x484a57['order']=qs[_0x8a49('0x3a')](_0x387b06[_0x8a49('0x33')][_0x8a49('0x3a')]);_0x484a57[_0x8a49('0x3b')]=qs['filters'](_[_0x8a49('0x3c')](_0x387b06[_0x8a49('0x33')],_0x29de89[_0x8a49('0x34')]),_0x33d7c6);if(_0x387b06['query']['filter']){_0x484a57[_0x8a49('0x3b')]=_[_0x8a49('0x3d')](_0x484a57[_0x8a49('0x3b')],{'$or':_['map'](_0x33d7c6,function(_0x158d8c){if(_0x158d8c[_0x8a49('0x30')]!==_0x8a49('0x3e')){var _0x7b71bb={};_0x7b71bb[_0x158d8c[_0x8a49('0x2a')]]={'$like':'%'+_0x387b06[_0x8a49('0x33')]['filter']+'%'};return _0x7b71bb;}})});}_0x484a57=_[_0x8a49('0x3d')]({},_0x484a57,_0x387b06[_0x8a49('0x3f')]);var _0x309482={'where':_0x484a57[_0x8a49('0x3b')]};return db[_0x8a49('0x2e')][_0x8a49('0x1f')](_0x309482)['then'](function(_0x2c9838){_0xef6542[_0x8a49('0x1f')]=_0x2c9838;if(_0x387b06[_0x8a49('0x33')][_0x8a49('0x40')]){_0x484a57[_0x8a49('0x41')]=[{'all':!![]}];}return db[_0x8a49('0x2e')][_0x8a49('0x42')](_0x484a57);})[_0x8a49('0x28')](function(_0x41b6c2){_0xef6542[_0x8a49('0x43')]=_0x41b6c2;return _0xef6542;})[_0x8a49('0x28')](respondWithFilteredResult(_0x30fffd,_0x484a57))['catch'](handleError(_0x30fffd,null));};exports[_0x8a49('0x44')]=function(_0x1b4b6d,_0x2938a8){var _0x4aac2b={'raw':!![],'where':{'id':_0x1b4b6d[_0x8a49('0x45')]['id']}},_0x411c9d={};_0x411c9d[_0x8a49('0x32')]=_[_0x8a49('0x46')](db[_0x8a49('0x2e')]['rawAttributes']);_0x411c9d[_0x8a49('0x33')]=_[_0x8a49('0x46')](_0x1b4b6d['query']);_0x411c9d[_0x8a49('0x34')]=_['intersection'](_0x411c9d['model'],_0x411c9d[_0x8a49('0x33')]);_0x4aac2b['attributes']=_[_0x8a49('0x35')](_0x411c9d[_0x8a49('0x32')],qs[_0x8a49('0x37')](_0x1b4b6d[_0x8a49('0x33')]['fields']));_0x4aac2b[_0x8a49('0x36')]=_0x4aac2b[_0x8a49('0x36')][_0x8a49('0x38')]?_0x4aac2b[_0x8a49('0x36')]:_0x411c9d[_0x8a49('0x32')];if(_0x1b4b6d[_0x8a49('0x33')][_0x8a49('0x40')]){_0x4aac2b['include']=[{'all':!![]}];}_0x4aac2b=_['merge']({},_0x4aac2b,_0x1b4b6d[_0x8a49('0x3f')]);return db[_0x8a49('0x2e')][_0x8a49('0x47')](_0x4aac2b)[_0x8a49('0x28')](handleEntityNotFound(_0x2938a8,null))[_0x8a49('0x28')](respondWithResult(_0x2938a8,null))[_0x8a49('0x48')](handleError(_0x2938a8,null));};exports[_0x8a49('0x49')]=function(_0x33ec7a,_0x5a428a){return db[_0x8a49('0x2e')][_0x8a49('0x49')](_0x33ec7a[_0x8a49('0x4a')],{})[_0x8a49('0x28')](respondWithResult(_0x5a428a,0xc9))[_0x8a49('0x48')](handleError(_0x5a428a,null));};exports[_0x8a49('0x26')]=function(_0x3d8fcc,_0xe3e213){if(_0x3d8fcc[_0x8a49('0x4a')]['id']){delete _0x3d8fcc[_0x8a49('0x4a')]['id'];}return db[_0x8a49('0x2e')]['find']({'where':{'id':_0x3d8fcc['params']['id']}})[_0x8a49('0x28')](handleEntityNotFound(_0xe3e213,null))[_0x8a49('0x28')](saveUpdates(_0x3d8fcc[_0x8a49('0x4a')],null))[_0x8a49('0x28')](respondWithResult(_0xe3e213,null))[_0x8a49('0x48')](handleError(_0xe3e213,null));};exports[_0x8a49('0x27')]=function(_0x3e066e,_0x4d9306){return db['ChatQueueReport']['find']({'where':{'id':_0x3e066e[_0x8a49('0x45')]['id']}})[_0x8a49('0x28')](handleEntityNotFound(_0x4d9306,null))[_0x8a49('0x28')](removeEntity(_0x4d9306,null))['catch'](handleError(_0x4d9306,null));};exports[_0x8a49('0x4b')]=function(_0x1debb8,_0x3746ff){return db[_0x8a49('0x2e')][_0x8a49('0x4b')]()[_0x8a49('0x28')](respondWithResult(_0x3746ff,null))[_0x8a49('0x48')](handleError(_0x3746ff,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 31c8797..f44af31 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1b166c,_0x39300f){var _0x5d3a16=function(_0x45b75d){while(--_0x45b75d){_0x1b166c['push'](_0x1b166c['shift']());}};_0x5d3a16(++_0x39300f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 66efac1..47b61c7 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 _0xb7f9=['CreateChatQueueReport','ChatQueueReport','body','options','debug','UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5e05be,_0x4dd828){var _0x5a0d61=function(_0x2b3e23){while(--_0x2b3e23){_0x5e05be['push'](_0x5e05be['shift']());}};_0x5a0d61(++_0x4dd828);}(_0xb7f9,0xab));var _0x9b7f=function(_0x171ca9,_0x2bb32d){_0x171ca9=_0x171ca9-0x0;var _0x31668f=_0xb7f9[_0x171ca9];return _0x31668f;};'use strict';var _=require(_0x9b7f('0x0'));var util=require(_0x9b7f('0x1'));var moment=require(_0x9b7f('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b7f('0x3'));var fs=require('fs');var Redis=require(_0x9b7f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b7f('0x5'));var config=require(_0x9b7f('0x6'));var jayson=require(_0x9b7f('0x7'));var client=jayson[_0x9b7f('0x8')][_0x9b7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415ec9,_0x522dc,_0x3d95ac){return new BPromise(function(_0x2287a3,_0x4f39cc){return client[_0x9b7f('0xa')](_0x415ec9,_0x3d95ac)[_0x9b7f('0xb')](function(_0x462385){logger[_0x9b7f('0xc')](_0x9b7f('0xd'),_0x522dc,_0x9b7f('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x522dc,_0x9b7f('0xe'),JSON[_0x9b7f('0xf')](_0x462385));if(_0x462385[_0x9b7f('0x10')]){if(_0x462385[_0x9b7f('0x10')][_0x9b7f('0x11')]===0x1f4){logger[_0x9b7f('0x10')](_0x9b7f('0xd'),_0x522dc,_0x462385['error'][_0x9b7f('0x12')]);return _0x4f39cc(_0x462385[_0x9b7f('0x10')][_0x9b7f('0x12')]);}logger[_0x9b7f('0x10')](_0x9b7f('0xd'),_0x522dc,_0x462385[_0x9b7f('0x10')][_0x9b7f('0x12')]);return _0x2287a3(_0x462385[_0x9b7f('0x10')][_0x9b7f('0x12')]);}else{logger[_0x9b7f('0xc')](_0x9b7f('0xd'),_0x522dc,'request\x20sent');_0x2287a3(_0x462385[_0x9b7f('0x13')][_0x9b7f('0x12')]);}})[_0x9b7f('0x14')](function(_0x4ee6e6){logger['error'](_0x9b7f('0xd'),_0x522dc,_0x4ee6e6);_0x4f39cc(_0x4ee6e6);});});}exports[_0x9b7f('0x15')]=function(_0x22e0e5){var _0x408034=this;return new Promise(function(_0x40f98a,_0x4733d9){return db[_0x9b7f('0x16')]['create'](_0x22e0e5[_0x9b7f('0x17')],{'raw':_0x22e0e5['options']?_0x22e0e5[_0x9b7f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9b7f('0xb')](function(_0x2923cc){logger[_0x9b7f('0xc')](_0x9b7f('0x15'),_0x22e0e5);logger[_0x9b7f('0x19')](_0x9b7f('0x15'),_0x22e0e5,JSON['stringify'](_0x2923cc));_0x40f98a(_0x2923cc);})[_0x9b7f('0x14')](function(_0x3c8fda){logger[_0x9b7f('0x10')](_0x9b7f('0x15'),_0x3c8fda[_0x9b7f('0x12')],_0x22e0e5);_0x4733d9(_0x408034[_0x9b7f('0x10')](0x1f4,_0x3c8fda[_0x9b7f('0x12')]));});});};exports[_0x9b7f('0x1a')]=function(_0x3e8b77){var _0x279875=this;return new Promise(function(_0x1bf87d,_0x19d635){return db['ChatQueueReport'][_0x9b7f('0x1b')](_0x3e8b77[_0x9b7f('0x17')],{'raw':_0x3e8b77[_0x9b7f('0x18')]?_0x3e8b77['options'][_0x9b7f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e8b77['options']?_0x3e8b77[_0x9b7f('0x18')][_0x9b7f('0x1d')]||null:null,'attributes':_0x3e8b77[_0x9b7f('0x18')]?_0x3e8b77['options'][_0x9b7f('0x1e')]||null:null,'limit':_0x3e8b77[_0x9b7f('0x18')]?_0x3e8b77[_0x9b7f('0x18')][_0x9b7f('0x1f')]||null:null})[_0x9b7f('0xb')](function(_0x2e6134){logger[_0x9b7f('0xc')]('UpdateChatQueueReport',_0x3e8b77);logger['debug']('UpdateChatQueueReport',_0x3e8b77,JSON['stringify'](_0x2e6134));_0x1bf87d(_0x2e6134);})[_0x9b7f('0x14')](function(_0x395f11){logger[_0x9b7f('0x10')](_0x9b7f('0x1a'),_0x395f11[_0x9b7f('0x12')],_0x3e8b77);_0x19d635(_0x279875['error'](0x1f4,_0x395f11[_0x9b7f('0x12')]));});});};
\ No newline at end of file
+var _0x75b5=['ioredis','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','catch','UpdateChatQueueReport','update','body','where','lodash','util','moment','bluebird','randomstring'];(function(_0x521956,_0x37281f){var _0x25a9a1=function(_0x5ce9c7){while(--_0x5ce9c7){_0x521956['push'](_0x521956['shift']());}};_0x25a9a1(++_0x37281f);}(_0x75b5,0x11d));var _0x575b=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x75b5[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x575b('0x0'));var util=require(_0x575b('0x1'));var moment=require(_0x575b('0x2'));var BPromise=require(_0x575b('0x3'));var rs=require(_0x575b('0x4'));var fs=require('fs');var Redis=require(_0x575b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x575b('0x6'))(_0x575b('0x7'));var config=require('../../config/environment');var jayson=require(_0x575b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e7541,_0x4d6cec,_0x3a312b){return new BPromise(function(_0x2854b0,_0x3a1071){return client[_0x575b('0x9')](_0x3e7541,_0x3a312b)[_0x575b('0xa')](function(_0x28fd9a){logger[_0x575b('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x4d6cec,_0x575b('0xc'));logger[_0x575b('0xd')](_0x575b('0xe'),_0x4d6cec,_0x575b('0xc'),JSON[_0x575b('0xf')](_0x28fd9a));if(_0x28fd9a[_0x575b('0x10')]){if(_0x28fd9a[_0x575b('0x10')]['code']===0x1f4){logger[_0x575b('0x10')](_0x575b('0x11'),_0x4d6cec,_0x28fd9a[_0x575b('0x10')][_0x575b('0x12')]);return _0x3a1071(_0x28fd9a[_0x575b('0x10')][_0x575b('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4d6cec,_0x28fd9a['error'][_0x575b('0x12')]);return _0x2854b0(_0x28fd9a['error'][_0x575b('0x12')]);}else{logger['info'](_0x575b('0x11'),_0x4d6cec,'request\x20sent');_0x2854b0(_0x28fd9a[_0x575b('0x13')]['message']);}})['catch'](function(_0x15af02){logger[_0x575b('0x10')](_0x575b('0x11'),_0x4d6cec,_0x15af02);_0x3a1071(_0x15af02);});});}exports[_0x575b('0x14')]=function(_0x3d627e){var _0x504ac3=this;return new Promise(function(_0x3ce80d,_0x46243f){return db[_0x575b('0x15')]['create'](_0x3d627e['body'],{'raw':_0x3d627e[_0x575b('0x16')]?_0x3d627e[_0x575b('0x16')][_0x575b('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x434b19){logger[_0x575b('0xb')]('CreateChatQueueReport',_0x3d627e);logger[_0x575b('0xd')](_0x575b('0x14'),_0x3d627e,JSON[_0x575b('0xf')](_0x434b19));_0x3ce80d(_0x434b19);})[_0x575b('0x18')](function(_0xdfa4b){logger[_0x575b('0x10')]('CreateChatQueueReport',_0xdfa4b[_0x575b('0x12')],_0x3d627e);_0x46243f(_0x504ac3[_0x575b('0x10')](0x1f4,_0xdfa4b[_0x575b('0x12')]));});});};exports[_0x575b('0x19')]=function(_0x1c77d2){var _0x2a3286=this;return new Promise(function(_0x4cd39f,_0x2f0048){return db['ChatQueueReport'][_0x575b('0x1a')](_0x1c77d2[_0x575b('0x1b')],{'raw':_0x1c77d2[_0x575b('0x16')]?_0x1c77d2[_0x575b('0x16')][_0x575b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c77d2[_0x575b('0x16')]?_0x1c77d2[_0x575b('0x16')][_0x575b('0x1c')]||null:null,'attributes':_0x1c77d2['options']?_0x1c77d2['options']['attributes']||null:null,'limit':_0x1c77d2[_0x575b('0x16')]?_0x1c77d2[_0x575b('0x16')]['limit']||null:null})['then'](function(_0x556556){logger[_0x575b('0xb')](_0x575b('0x19'),_0x1c77d2);logger['debug']('UpdateChatQueueReport',_0x1c77d2,JSON[_0x575b('0xf')](_0x556556));_0x4cd39f(_0x556556);})['catch'](function(_0x1169a0){logger[_0x575b('0x10')](_0x575b('0x19'),_0x1169a0[_0x575b('0x12')],_0x1c77d2);_0x2f0048(_0x2a3286[_0x575b('0x10')](0x1f4,_0x1169a0[_0x575b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index f89a412..2e5f78a 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 _0x3b2e=['get','/describe','describe','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index'];(function(_0x27c515,_0x3e122e){var _0x180319=function(_0x3002e3){while(--_0x3002e3){_0x27c515['push'](_0x27c515['shift']());}};_0x180319(++_0x3e122e);}(_0x3b2e,0xb3));var _0xe3b2=function(_0x1e49ee,_0x3257b6){_0x1e49ee=_0x1e49ee-0x0;var _0x3dcf1e=_0x3b2e[_0x1e49ee];return _0x3dcf1e;};'use strict';var multer=require('multer');var util=require(_0xe3b2('0x0'));var path=require(_0xe3b2('0x1'));var timeout=require(_0xe3b2('0x2'));var express=require(_0xe3b2('0x3'));var router=express[_0xe3b2('0x4')]();var fs_extra=require(_0xe3b2('0x5'));var auth=require(_0xe3b2('0x6'));var interaction=require(_0xe3b2('0x7'));var config=require('../../config/environment');var controller=require(_0xe3b2('0x8'));router['get']('/',auth[_0xe3b2('0x9')](),controller[_0xe3b2('0xa')]);router[_0xe3b2('0xb')](_0xe3b2('0xc'),auth[_0xe3b2('0x9')](),controller[_0xe3b2('0xd')]);router[_0xe3b2('0xb')](_0xe3b2('0xe'),auth[_0xe3b2('0x9')](),controller['show']);router['post']('/',auth[_0xe3b2('0x9')](),controller['create']);router['put'](_0xe3b2('0xe'),auth['isAuthenticated'](),controller[_0xe3b2('0xf')]);router[_0xe3b2('0x10')](_0xe3b2('0xe'),auth[_0xe3b2('0x9')](),controller[_0xe3b2('0x11')]);module[_0xe3b2('0x12')]=router;
\ No newline at end of file
+var _0x4346=['util','path','connect-timeout','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','create','put','/:id','update','destroy','exports','multer'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0x4346,0x120));var _0x6434=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x4346[_0x5de532];return _0x4e9192;};'use strict';var multer=require(_0x6434('0x0'));var util=require(_0x6434('0x1'));var path=require(_0x6434('0x2'));var timeout=require(_0x6434('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6434('0x4'));var config=require('../../config/environment');var controller=require(_0x6434('0x5'));router[_0x6434('0x6')]('/',auth[_0x6434('0x7')](),controller['index']);router['get'](_0x6434('0x8'),auth['isAuthenticated'](),controller[_0x6434('0x9')]);router[_0x6434('0x6')]('/:id',auth[_0x6434('0x7')](),controller[_0x6434('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6434('0xb')]);router[_0x6434('0xc')](_0x6434('0xd'),auth[_0x6434('0x7')](),controller[_0x6434('0xe')]);router['delete'](_0x6434('0xd'),auth[_0x6434('0x7')](),controller[_0x6434('0xf')]);module[_0x6434('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index a10cdaf..e0eae61 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x19046c,_0x2494b5){var _0x469c79=function(_0x59cd03){while(--_0x59cd03){_0x19046c['push'](_0x19046c['shift']());}};_0x469c79(++_0x2494b5);}(_0x008c,0x188));var _0xc008=function(_0x5657bb,_0x2f1219){_0x5657bb=_0x5657bb-0x0;var _0x2a5ecb=_0x008c[_0x5657bb];return _0x2a5ecb;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5d6cf0,_0x3296fa){var _0x664405=function(_0x4e3027){while(--_0x4e3027){_0x5d6cf0['push'](_0x5d6cf0['shift']());}};_0x664405(++_0x3296fa);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 05b7ad3..997c3e3 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 _0xe824=['create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','find'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xe824,0x98));var _0x4e82=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xe824[_0x316904];return _0xfa9a21;};'use strict';var emlformat=require(_0x4e82('0x0'));var rimraf=require(_0x4e82('0x1'));var zipdir=require(_0x4e82('0x2'));var jsonpatch=require(_0x4e82('0x3'));var rp=require('request-promise');var moment=require(_0x4e82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e82('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4e82('0x6'));var ejs=require(_0x4e82('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e82('0x8'));var crypto=require('crypto');var jsforce=require(_0x4e82('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4e82('0xa'));var Papa=require(_0x4e82('0xb'));var Redis=require('ioredis');var authService=require(_0x4e82('0xc'));var qs=require(_0x4e82('0xd'));var as=require(_0x4e82('0xe'));var hardwareService=require(_0x4e82('0xf'));var logger=require(_0x4e82('0x10'))('api');var utils=require(_0x4e82('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4e82('0x12'));var db=require(_0x4e82('0x13'))['db'];function respondWithStatusCode(_0x109560,_0x140270){_0x140270=_0x140270||0xcc;return function(_0x2fbdf4){if(_0x2fbdf4){return _0x109560['sendStatus'](_0x140270);}return _0x109560[_0x4e82('0x14')](_0x140270)[_0x4e82('0x15')]();};}function respondWithResult(_0x3b8a7c,_0x56c5ee){_0x56c5ee=_0x56c5ee||0xc8;return function(_0x4e46b4){if(_0x4e46b4){return _0x3b8a7c[_0x4e82('0x14')](_0x56c5ee)[_0x4e82('0x16')](_0x4e46b4);}};}function respondWithFilteredResult(_0x50f432,_0xbce717){return function(_0x3db3dd){if(_0x3db3dd){var _0x48a7c7=typeof _0xbce717[_0x4e82('0x17')]===_0x4e82('0x18')&&typeof _0xbce717[_0x4e82('0x19')]===_0x4e82('0x18');var _0x518594=_0x3db3dd[_0x4e82('0x1a')];var _0x1f4f79=_0x48a7c7?0x0:_0xbce717[_0x4e82('0x17')];var _0x4b794b=_0x48a7c7?_0x3db3dd[_0x4e82('0x1a')]:_0xbce717[_0x4e82('0x17')]+_0xbce717[_0x4e82('0x19')];var _0x1d9c6a;if(_0x4b794b>=_0x518594){_0x4b794b=_0x518594;_0x1d9c6a=0xc8;}else{_0x1d9c6a=0xce;}_0x50f432[_0x4e82('0x14')](_0x1d9c6a);return _0x50f432[_0x4e82('0x1b')](_0x4e82('0x1c'),_0x1f4f79+'-'+_0x4b794b+'/'+_0x518594)[_0x4e82('0x16')](_0x3db3dd);}return null;};}function patchUpdates(_0x20ce54){return function(_0x563701){try{jsonpatch[_0x4e82('0x1d')](_0x563701,_0x20ce54,!![]);}catch(_0x439638){return BPromise[_0x4e82('0x1e')](_0x439638);}return _0x563701[_0x4e82('0x1f')]();};}function saveUpdates(_0xedd5dc,_0x52e13e){return function(_0x4889f8){if(_0x4889f8){return _0x4889f8[_0x4e82('0x20')](_0xedd5dc)[_0x4e82('0x21')](function(_0x9d1bab){return _0x9d1bab;});}return null;};}function removeEntity(_0x31bb77,_0x3a6815){return function(_0xafd8e0){if(_0xafd8e0){return _0xafd8e0[_0x4e82('0x22')]()[_0x4e82('0x21')](function(){_0x31bb77[_0x4e82('0x14')](0xcc)[_0x4e82('0x15')]();});}};}function handleEntityNotFound(_0x11b05f,_0x1b08ed){return function(_0x2c75eb){if(!_0x2c75eb){_0x11b05f[_0x4e82('0x23')](0x194);}return _0x2c75eb;};}function handleError(_0x592116,_0x24d0d0){_0x24d0d0=_0x24d0d0||0x1f4;return function(_0x23fc77){logger[_0x4e82('0x24')](_0x23fc77[_0x4e82('0x25')]);if(_0x23fc77[_0x4e82('0x26')]){delete _0x23fc77[_0x4e82('0x26')];}_0x592116[_0x4e82('0x14')](_0x24d0d0)[_0x4e82('0x27')](_0x23fc77);};}exports['index']=function(_0x3f0d0a,_0x1fe362){var _0x17c854={},_0x3cde2f={},_0x337f4d={'count':0x0,'rows':[]};var _0x558a91=_[_0x4e82('0x28')](db['ChatTransferReport'][_0x4e82('0x29')],function(_0x230779){return{'name':_0x230779[_0x4e82('0x2a')],'type':_0x230779[_0x4e82('0x2b')]['key']};});_0x3cde2f['model']=_[_0x4e82('0x28')](_0x558a91,_0x4e82('0x26'));_0x3cde2f[_0x4e82('0x2c')]=_[_0x4e82('0x2d')](_0x3f0d0a['query']);_0x3cde2f[_0x4e82('0x2e')]=_[_0x4e82('0x2f')](_0x3cde2f['model'],_0x3cde2f[_0x4e82('0x2c')]);_0x17c854[_0x4e82('0x30')]=_[_0x4e82('0x2f')](_0x3cde2f['model'],qs[_0x4e82('0x31')](_0x3f0d0a[_0x4e82('0x2c')]['fields']));_0x17c854[_0x4e82('0x30')]=_0x17c854[_0x4e82('0x30')][_0x4e82('0x32')]?_0x17c854[_0x4e82('0x30')]:_0x3cde2f[_0x4e82('0x33')];if(!_0x3f0d0a['query'][_0x4e82('0x34')](_0x4e82('0x35'))){_0x17c854[_0x4e82('0x19')]=qs[_0x4e82('0x19')](_0x3f0d0a[_0x4e82('0x2c')][_0x4e82('0x19')]);_0x17c854['offset']=qs[_0x4e82('0x17')](_0x3f0d0a['query']['offset']);}_0x17c854[_0x4e82('0x36')]=qs[_0x4e82('0x37')](_0x3f0d0a['query'][_0x4e82('0x37')]);_0x17c854[_0x4e82('0x38')]=qs['filters'](_[_0x4e82('0x39')](_0x3f0d0a[_0x4e82('0x2c')],_0x3cde2f[_0x4e82('0x2e')]),_0x558a91);if(_0x3f0d0a['query'][_0x4e82('0x3a')]){_0x17c854[_0x4e82('0x38')]=_[_0x4e82('0x3b')](_0x17c854['where'],{'$or':_[_0x4e82('0x28')](_0x558a91,function(_0x311c03){if(_0x311c03['type']!==_0x4e82('0x3c')){var _0x5783ad={};_0x5783ad[_0x311c03[_0x4e82('0x26')]]={'$like':'%'+_0x3f0d0a[_0x4e82('0x2c')][_0x4e82('0x3a')]+'%'};return _0x5783ad;}})});}_0x17c854=_['merge']({},_0x17c854,_0x3f0d0a[_0x4e82('0x3d')]);var _0x3b23ef={'where':_0x17c854['where']};return db[_0x4e82('0x3e')][_0x4e82('0x1a')](_0x3b23ef)['then'](function(_0x4af23b){_0x337f4d['count']=_0x4af23b;if(_0x3f0d0a[_0x4e82('0x2c')][_0x4e82('0x3f')]){_0x17c854[_0x4e82('0x40')]=[{'all':!![]}];}return db[_0x4e82('0x3e')][_0x4e82('0x41')](_0x17c854);})[_0x4e82('0x21')](function(_0x27eabb){_0x337f4d[_0x4e82('0x42')]=_0x27eabb;return _0x337f4d;})['then'](respondWithFilteredResult(_0x1fe362,_0x17c854))[_0x4e82('0x43')](handleError(_0x1fe362,null));};exports[_0x4e82('0x44')]=function(_0x30a905,_0x43b8d7){var _0x1e4e6d={'raw':!![],'where':{'id':_0x30a905['params']['id']}},_0x124b60={};_0x124b60[_0x4e82('0x33')]=_[_0x4e82('0x2d')](db[_0x4e82('0x3e')][_0x4e82('0x29')]);_0x124b60['query']=_['keys'](_0x30a905[_0x4e82('0x2c')]);_0x124b60['filters']=_[_0x4e82('0x2f')](_0x124b60['model'],_0x124b60['query']);_0x1e4e6d['attributes']=_[_0x4e82('0x2f')](_0x124b60[_0x4e82('0x33')],qs[_0x4e82('0x31')](_0x30a905[_0x4e82('0x2c')]['fields']));_0x1e4e6d[_0x4e82('0x30')]=_0x1e4e6d['attributes'][_0x4e82('0x32')]?_0x1e4e6d[_0x4e82('0x30')]:_0x124b60[_0x4e82('0x33')];if(_0x30a905['query']['includeAll']){_0x1e4e6d[_0x4e82('0x40')]=[{'all':!![]}];}_0x1e4e6d=_[_0x4e82('0x3b')]({},_0x1e4e6d,_0x30a905['options']);return db[_0x4e82('0x3e')][_0x4e82('0x45')](_0x1e4e6d)[_0x4e82('0x21')](handleEntityNotFound(_0x43b8d7,null))[_0x4e82('0x21')](respondWithResult(_0x43b8d7,null))[_0x4e82('0x43')](handleError(_0x43b8d7,null));};exports[_0x4e82('0x46')]=function(_0x8526e7,_0x20b633){return db[_0x4e82('0x3e')][_0x4e82('0x46')](_0x8526e7[_0x4e82('0x47')],{})[_0x4e82('0x21')](respondWithResult(_0x20b633,0xc9))[_0x4e82('0x43')](handleError(_0x20b633,null));};exports[_0x4e82('0x20')]=function(_0x2696b6,_0x48bb38){if(_0x2696b6[_0x4e82('0x47')]['id']){delete _0x2696b6[_0x4e82('0x47')]['id'];}return db['ChatTransferReport'][_0x4e82('0x45')]({'where':{'id':_0x2696b6['params']['id']}})[_0x4e82('0x21')](handleEntityNotFound(_0x48bb38,null))[_0x4e82('0x21')](saveUpdates(_0x2696b6[_0x4e82('0x47')],null))[_0x4e82('0x21')](respondWithResult(_0x48bb38,null))[_0x4e82('0x43')](handleError(_0x48bb38,null));};exports[_0x4e82('0x22')]=function(_0x44ddfa,_0x31648a){return db['ChatTransferReport']['find']({'where':{'id':_0x44ddfa[_0x4e82('0x48')]['id']}})['then'](handleEntityNotFound(_0x31648a,null))[_0x4e82('0x21')](removeEntity(_0x31648a,null))['catch'](handleError(_0x31648a,null));};exports[_0x4e82('0x49')]=function(_0x273fce,_0x140555){return db[_0x4e82('0x3e')][_0x4e82('0x49')]()[_0x4e82('0x21')](respondWithResult(_0x140555,null))[_0x4e82('0x43')](handleError(_0x140555,null));};
\ No newline at end of file
+var _0x1264=['fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','update','describe','eml-format','rimraf','zip-dir'];(function(_0xda501a,_0x159d6a){var _0x44be3a=function(_0x5c1c5f){while(--_0x5c1c5f){_0xda501a['push'](_0xda501a['shift']());}};_0x44be3a(++_0x159d6a);}(_0x1264,0xde));var _0x4126=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x1264[_0x4fbb86];return _0xb141fe;};'use strict';var emlformat=require(_0x4126('0x0'));var rimraf=require(_0x4126('0x1'));var zipdir=require(_0x4126('0x2'));var jsonpatch=require(_0x4126('0x3'));var rp=require(_0x4126('0x4'));var moment=require(_0x4126('0x5'));var BPromise=require(_0x4126('0x6'));var Mustache=require('mustache');var util=require(_0x4126('0x7'));var path=require('path');var sox=require(_0x4126('0x8'));var csv=require(_0x4126('0x9'));var ejs=require(_0x4126('0xa'));var fs=require('fs');var fs_extra=require(_0x4126('0xb'));var _=require(_0x4126('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4126('0xd'));var deskjs=require(_0x4126('0xe'));var toCsv=require(_0x4126('0x9'));var querystring=require(_0x4126('0xf'));var Papa=require(_0x4126('0x10'));var Redis=require('ioredis');var authService=require(_0x4126('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4126('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4126('0x13'))(_0x4126('0x14'));var utils=require(_0x4126('0x15'));var config=require(_0x4126('0x16'));var licenseUtil=require(_0x4126('0x17'));var db=require(_0x4126('0x18'))['db'];function respondWithStatusCode(_0x4e2f27,_0x590a82){_0x590a82=_0x590a82||0xcc;return function(_0x42aa52){if(_0x42aa52){return _0x4e2f27[_0x4126('0x19')](_0x590a82);}return _0x4e2f27[_0x4126('0x1a')](_0x590a82)[_0x4126('0x1b')]();};}function respondWithResult(_0x16da8e,_0x2d1602){_0x2d1602=_0x2d1602||0xc8;return function(_0x51917b){if(_0x51917b){return _0x16da8e[_0x4126('0x1a')](_0x2d1602)[_0x4126('0x1c')](_0x51917b);}};}function respondWithFilteredResult(_0x147f3d,_0x173400){return function(_0x5c4510){if(_0x5c4510){var _0x13ff17=typeof _0x173400[_0x4126('0x1d')]==='undefined'&&typeof _0x173400[_0x4126('0x1e')]==='undefined';var _0x578820=_0x5c4510['count'];var _0x139425=_0x13ff17?0x0:_0x173400[_0x4126('0x1d')];var _0x49a0de=_0x13ff17?_0x5c4510[_0x4126('0x1f')]:_0x173400['offset']+_0x173400[_0x4126('0x1e')];var _0x1e7e87;if(_0x49a0de>=_0x578820){_0x49a0de=_0x578820;_0x1e7e87=0xc8;}else{_0x1e7e87=0xce;}_0x147f3d[_0x4126('0x1a')](_0x1e7e87);return _0x147f3d[_0x4126('0x20')](_0x4126('0x21'),_0x139425+'-'+_0x49a0de+'/'+_0x578820)['json'](_0x5c4510);}return null;};}function patchUpdates(_0x1b8987){return function(_0x1565cc){try{jsonpatch[_0x4126('0x22')](_0x1565cc,_0x1b8987,!![]);}catch(_0x2015db){return BPromise['reject'](_0x2015db);}return _0x1565cc['save']();};}function saveUpdates(_0x52d98a,_0x10db53){return function(_0x58846f){if(_0x58846f){return _0x58846f['update'](_0x52d98a)[_0x4126('0x23')](function(_0x221bb3){return _0x221bb3;});}return null;};}function removeEntity(_0xaff954,_0x50bf8a){return function(_0x4df224){if(_0x4df224){return _0x4df224['destroy']()[_0x4126('0x23')](function(){_0xaff954[_0x4126('0x1a')](0xcc)[_0x4126('0x1b')]();});}};}function handleEntityNotFound(_0x6db5f4,_0x12a947){return function(_0xc6e1b9){if(!_0xc6e1b9){_0x6db5f4[_0x4126('0x19')](0x194);}return _0xc6e1b9;};}function handleError(_0x2079de,_0x3a4df5){_0x3a4df5=_0x3a4df5||0x1f4;return function(_0x1834a3){logger[_0x4126('0x24')](_0x1834a3[_0x4126('0x25')]);if(_0x1834a3[_0x4126('0x26')]){delete _0x1834a3[_0x4126('0x26')];}_0x2079de[_0x4126('0x1a')](_0x3a4df5)[_0x4126('0x27')](_0x1834a3);};}exports[_0x4126('0x28')]=function(_0x36633e,_0x51c5b7){var _0x5d9a96={},_0x1c4aca={},_0x19e481={'count':0x0,'rows':[]};var _0x6bacec=_[_0x4126('0x29')](db[_0x4126('0x2a')][_0x4126('0x2b')],function(_0x201691){return{'name':_0x201691[_0x4126('0x2c')],'type':_0x201691[_0x4126('0x2d')][_0x4126('0x2e')]};});_0x1c4aca[_0x4126('0x2f')]=_['map'](_0x6bacec,'name');_0x1c4aca[_0x4126('0x30')]=_['keys'](_0x36633e[_0x4126('0x30')]);_0x1c4aca[_0x4126('0x31')]=_[_0x4126('0x32')](_0x1c4aca[_0x4126('0x2f')],_0x1c4aca[_0x4126('0x30')]);_0x5d9a96[_0x4126('0x33')]=_[_0x4126('0x32')](_0x1c4aca[_0x4126('0x2f')],qs['fields'](_0x36633e[_0x4126('0x30')][_0x4126('0x34')]));_0x5d9a96[_0x4126('0x33')]=_0x5d9a96[_0x4126('0x33')][_0x4126('0x35')]?_0x5d9a96[_0x4126('0x33')]:_0x1c4aca[_0x4126('0x2f')];if(!_0x36633e[_0x4126('0x30')][_0x4126('0x36')](_0x4126('0x37'))){_0x5d9a96['limit']=qs[_0x4126('0x1e')](_0x36633e[_0x4126('0x30')][_0x4126('0x1e')]);_0x5d9a96[_0x4126('0x1d')]=qs[_0x4126('0x1d')](_0x36633e[_0x4126('0x30')][_0x4126('0x1d')]);}_0x5d9a96[_0x4126('0x38')]=qs[_0x4126('0x39')](_0x36633e[_0x4126('0x30')][_0x4126('0x39')]);_0x5d9a96[_0x4126('0x3a')]=qs[_0x4126('0x31')](_[_0x4126('0x3b')](_0x36633e[_0x4126('0x30')],_0x1c4aca[_0x4126('0x31')]),_0x6bacec);if(_0x36633e['query'][_0x4126('0x3c')]){_0x5d9a96[_0x4126('0x3a')]=_[_0x4126('0x3d')](_0x5d9a96[_0x4126('0x3a')],{'$or':_[_0x4126('0x29')](_0x6bacec,function(_0x44797b){if(_0x44797b[_0x4126('0x2d')]!==_0x4126('0x3e')){var _0xbe3211={};_0xbe3211[_0x44797b[_0x4126('0x26')]]={'$like':'%'+_0x36633e[_0x4126('0x30')]['filter']+'%'};return _0xbe3211;}})});}_0x5d9a96=_[_0x4126('0x3d')]({},_0x5d9a96,_0x36633e[_0x4126('0x3f')]);var _0xe8cd52={'where':_0x5d9a96[_0x4126('0x3a')]};return db[_0x4126('0x2a')][_0x4126('0x1f')](_0xe8cd52)[_0x4126('0x23')](function(_0x1ea540){_0x19e481[_0x4126('0x1f')]=_0x1ea540;if(_0x36633e['query'][_0x4126('0x40')]){_0x5d9a96['include']=[{'all':!![]}];}return db[_0x4126('0x2a')]['findAll'](_0x5d9a96);})[_0x4126('0x23')](function(_0x4dc8f3){_0x19e481[_0x4126('0x41')]=_0x4dc8f3;return _0x19e481;})[_0x4126('0x23')](respondWithFilteredResult(_0x51c5b7,_0x5d9a96))[_0x4126('0x42')](handleError(_0x51c5b7,null));};exports[_0x4126('0x43')]=function(_0x234704,_0x4180df){var _0xbb5415={'raw':!![],'where':{'id':_0x234704[_0x4126('0x44')]['id']}},_0x333b6e={};_0x333b6e[_0x4126('0x2f')]=_[_0x4126('0x45')](db[_0x4126('0x2a')][_0x4126('0x2b')]);_0x333b6e[_0x4126('0x30')]=_[_0x4126('0x45')](_0x234704[_0x4126('0x30')]);_0x333b6e['filters']=_['intersection'](_0x333b6e[_0x4126('0x2f')],_0x333b6e['query']);_0xbb5415[_0x4126('0x33')]=_['intersection'](_0x333b6e[_0x4126('0x2f')],qs['fields'](_0x234704[_0x4126('0x30')][_0x4126('0x34')]));_0xbb5415[_0x4126('0x33')]=_0xbb5415[_0x4126('0x33')][_0x4126('0x35')]?_0xbb5415['attributes']:_0x333b6e[_0x4126('0x2f')];if(_0x234704[_0x4126('0x30')][_0x4126('0x40')]){_0xbb5415[_0x4126('0x46')]=[{'all':!![]}];}_0xbb5415=_[_0x4126('0x3d')]({},_0xbb5415,_0x234704['options']);return db[_0x4126('0x2a')][_0x4126('0x47')](_0xbb5415)['then'](handleEntityNotFound(_0x4180df,null))['then'](respondWithResult(_0x4180df,null))[_0x4126('0x42')](handleError(_0x4180df,null));};exports[_0x4126('0x48')]=function(_0x31fd6a,_0x40e586){return db['ChatTransferReport'][_0x4126('0x48')](_0x31fd6a['body'],{})[_0x4126('0x23')](respondWithResult(_0x40e586,0xc9))['catch'](handleError(_0x40e586,null));};exports[_0x4126('0x49')]=function(_0x4a27c2,_0x54506f){if(_0x4a27c2['body']['id']){delete _0x4a27c2['body']['id'];}return db[_0x4126('0x2a')][_0x4126('0x47')]({'where':{'id':_0x4a27c2[_0x4126('0x44')]['id']}})[_0x4126('0x23')](handleEntityNotFound(_0x54506f,null))['then'](saveUpdates(_0x4a27c2['body'],null))['then'](respondWithResult(_0x54506f,null))[_0x4126('0x42')](handleError(_0x54506f,null));};exports['destroy']=function(_0x6a31f4,_0x1bee92){return db[_0x4126('0x2a')]['find']({'where':{'id':_0x6a31f4[_0x4126('0x44')]['id']}})[_0x4126('0x23')](handleEntityNotFound(_0x1bee92,null))[_0x4126('0x23')](removeEntity(_0x1bee92,null))[_0x4126('0x42')](handleError(_0x1bee92,null));};exports['describe']=function(_0x2e50a5,_0x4342f7){return db[_0x4126('0x2a')][_0x4126('0x4a')]()['then'](respondWithResult(_0x4342f7,null))[_0x4126('0x42')](handleError(_0x4342f7,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index ee36713..c5125aa 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 _0x305c=['moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','lodash','util','api'];(function(_0x20e555,_0x40aea6){var _0x182077=function(_0x1d0d69){while(--_0x1d0d69){_0x20e555['push'](_0x20e555['shift']());}};_0x182077(++_0x40aea6);}(_0x305c,0x75));var _0xc305=function(_0xca78f1,_0x2c90c8){_0xca78f1=_0xca78f1-0x0;var _0xda435e=_0x305c[_0xca78f1];return _0xda435e;};'use strict';var _=require(_0xc305('0x0'));var util=require(_0xc305('0x1'));var logger=require('../../config/logger')(_0xc305('0x2'));var moment=require(_0xc305('0x3'));var BPromise=require(_0xc305('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc305('0x5'));var config=require(_0xc305('0x6'));var attributes=require(_0xc305('0x7'));module[_0xc305('0x8')]=function(_0x553e0a,_0x5d1a9f){return _0x553e0a[_0xc305('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x760d=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util'];(function(_0xcfe623,_0x4d1bc7){var _0x2a9a3c=function(_0x407ae0){while(--_0x407ae0){_0xcfe623['push'](_0xcfe623['shift']());}};_0x2a9a3c(++_0x4d1bc7);}(_0x760d,0x1c5));var _0xd760=function(_0x588a77,_0x1fefc7){_0x588a77=_0x588a77-0x0;var _0xa808b8=_0x760d[_0x588a77];return _0xa808b8;};'use strict';var _=require(_0xd760('0x0'));var util=require(_0xd760('0x1'));var logger=require(_0xd760('0x2'))(_0xd760('0x3'));var moment=require('moment');var BPromise=require(_0xd760('0x4'));var rp=require(_0xd760('0x5'));var fs=require('fs');var path=require(_0xd760('0x6'));var rimraf=require(_0xd760('0x7'));var config=require('../../config/environment');var attributes=require(_0xd760('0x8'));module[_0xd760('0x9')]=function(_0x2063c6,_0x57627a){return _0x2063c6[_0xd760('0xa')]('ChatTransferReport',attributes,{'tableName':_0xd760('0xb'),'paranoid':![],'indexes':[{'name':_0xd760('0xc'),'fields':[_0xd760('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 3fd4603..4ec1192 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 _0x7045=['code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b3248,_0x4681c3){var _0x4c273=function(_0xd66761){while(--_0xd66761){_0x2b3248['push'](_0x2b3248['shift']());}};_0x4c273(++_0x4681c3);}(_0x7045,0xec));var _0x5704=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7045[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5704('0x0'));var util=require(_0x5704('0x1'));var moment=require(_0x5704('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5704('0x3'))['db'];var utils=require(_0x5704('0x4'));var logger=require(_0x5704('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5704('0x6'));var client=jayson[_0x5704('0x7')][_0x5704('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50f8a2,_0x390b31,_0x2cdf7f){return new BPromise(function(_0x577c2c,_0xad0d2){return client[_0x5704('0x9')](_0x50f8a2,_0x2cdf7f)['then'](function(_0x1ae945){logger[_0x5704('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x390b31,_0x5704('0xb'));logger[_0x5704('0xc')](_0x5704('0xd'),_0x390b31,_0x5704('0xb'),JSON[_0x5704('0xe')](_0x1ae945));if(_0x1ae945[_0x5704('0xf')]){if(_0x1ae945[_0x5704('0xf')][_0x5704('0x10')]===0x1f4){logger['error'](_0x5704('0x11'),_0x390b31,_0x1ae945['error'][_0x5704('0x12')]);return _0xad0d2(_0x1ae945[_0x5704('0xf')][_0x5704('0x12')]);}logger['error'](_0x5704('0x11'),_0x390b31,_0x1ae945['error']['message']);return _0x577c2c(_0x1ae945[_0x5704('0xf')][_0x5704('0x12')]);}else{logger['info'](_0x5704('0x11'),_0x390b31,_0x5704('0xb'));_0x577c2c(_0x1ae945[_0x5704('0x13')][_0x5704('0x12')]);}})[_0x5704('0x14')](function(_0x32d994){logger[_0x5704('0xf')](_0x5704('0x11'),_0x390b31,_0x32d994);_0xad0d2(_0x32d994);});});}
\ No newline at end of file
+var _0xe678=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xe678,0x1ce));var _0x8e67=function(_0x1d3f85,_0x23b5b2){_0x1d3f85=_0x1d3f85-0x0;var _0x448d86=_0xe678[_0x1d3f85];return _0x448d86;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e67('0x0'));var BPromise=require(_0x8e67('0x1'));var rs=require(_0x8e67('0x2'));var fs=require('fs');var Redis=require(_0x8e67('0x3'));var db=require(_0x8e67('0x4'))['db'];var utils=require(_0x8e67('0x5'));var logger=require(_0x8e67('0x6'))(_0x8e67('0x7'));var config=require(_0x8e67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e67('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187ed0,_0x3f2bc9,_0x5c9acd){return new BPromise(function(_0x36811f,_0x5223bc){return client[_0x8e67('0xa')](_0x187ed0,_0x5c9acd)[_0x8e67('0xb')](function(_0x3c4308){logger[_0x8e67('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x3f2bc9,_0x8e67('0xd'));logger[_0x8e67('0xe')](_0x8e67('0xf'),_0x3f2bc9,_0x8e67('0xd'),JSON[_0x8e67('0x10')](_0x3c4308));if(_0x3c4308[_0x8e67('0x11')]){if(_0x3c4308[_0x8e67('0x11')][_0x8e67('0x12')]===0x1f4){logger[_0x8e67('0x11')](_0x8e67('0x13'),_0x3f2bc9,_0x3c4308['error'][_0x8e67('0x14')]);return _0x5223bc(_0x3c4308[_0x8e67('0x11')][_0x8e67('0x14')]);}logger[_0x8e67('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3f2bc9,_0x3c4308[_0x8e67('0x11')][_0x8e67('0x14')]);return _0x36811f(_0x3c4308['error'][_0x8e67('0x14')]);}else{logger[_0x8e67('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x3f2bc9,_0x8e67('0xd'));_0x36811f(_0x3c4308[_0x8e67('0x15')][_0x8e67('0x14')]);}})[_0x8e67('0x16')](function(_0x14291c){logger[_0x8e67('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3f2bc9,_0x14291c);_0x5223bc(_0x14291c);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 00b699a..66226ac 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 _0xe403=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete'];(function(_0x2abe83,_0x224e2f){var _0x4a5f74=function(_0xf82f58){while(--_0xf82f58){_0x2abe83['push'](_0x2abe83['shift']());}};_0x4a5f74(++_0x224e2f);}(_0xe403,0x166));var _0x3e40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe403[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e40('0x0'));var util=require(_0x3e40('0x1'));var path=require(_0x3e40('0x2'));var timeout=require(_0x3e40('0x3'));var express=require('express');var router=express[_0x3e40('0x4')]();var fs_extra=require(_0x3e40('0x5'));var auth=require(_0x3e40('0x6'));var interaction=require(_0x3e40('0x7'));var config=require(_0x3e40('0x8'));var controller=require(_0x3e40('0x9'));router[_0x3e40('0xa')]('/',auth[_0x3e40('0xb')](),controller[_0x3e40('0xc')]);router[_0x3e40('0xa')](_0x3e40('0xd'),auth[_0x3e40('0xb')](),controller['describe']);router[_0x3e40('0xa')](_0x3e40('0xe'),auth[_0x3e40('0xb')](),controller['show']);router[_0x3e40('0xf')]('/',auth[_0x3e40('0xb')](),controller[_0x3e40('0x10')]);router[_0x3e40('0x11')](_0x3e40('0xe'),auth['isAuthenticated'](),controller[_0x3e40('0x12')]);router[_0x3e40('0x13')](_0x3e40('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3e40('0x14')]=router;
\ No newline at end of file
+var _0x4f49=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f49,0xdf));var _0x94f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4f49[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x94f4('0x0'));var util=require(_0x94f4('0x1'));var path=require(_0x94f4('0x2'));var timeout=require(_0x94f4('0x3'));var express=require('express');var router=express[_0x94f4('0x4')]();var fs_extra=require(_0x94f4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x94f4('0x6'));var controller=require(_0x94f4('0x7'));router[_0x94f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x94f4('0x9')]);router['get']('/describe',auth[_0x94f4('0xa')](),controller[_0x94f4('0xb')]);router[_0x94f4('0x8')](_0x94f4('0xc'),auth['isAuthenticated'](),controller[_0x94f4('0xd')]);router['post']('/',auth[_0x94f4('0xa')](),controller[_0x94f4('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x94f4('0xf')](_0x94f4('0xc'),auth[_0x94f4('0xa')](),controller[_0x94f4('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 3bdcc6a..f92756e 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 _0xe9db=['Send','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','input','onlineForm','parse','getDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat'];(function(_0x2c41b9,_0x3e8305){var _0x52e0a5=function(_0x49e469){while(--_0x49e469){_0x2c41b9['push'](_0x2c41b9['shift']());}};_0x52e0a5(++_0x3e8305);}(_0xe9db,0xd8));var _0xbe9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9db[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbe9d('0x0'));module[_0xbe9d('0x1')]={'name':{'type':Sequelize[_0xbe9d('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbe9d('0x3')},'description':{'type':Sequelize[_0xbe9d('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x5')},'customerAlias':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbe9d('0x2')],'allowNull':![],'defaultValue':_0xbe9d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbe9d('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbe9d('0x2')],'allowNull':![],'defaultValue':_0xbe9d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbe9d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbe9d('0x2')]},'animation':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbe9d('0xa')](_0xbe9d('0xb'),_0xbe9d('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0xd')},'offline_chat_button':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0xe')},'header_offline':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbe9d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbe9d('0xf')]},'closingQuestion':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbe9d('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbe9d('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbe9d('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbe9d('0x14')},'closingMessageButton':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x15')},'conditionAgreement':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbe9d('0x16')},'ratingType':{'type':Sequelize[_0xbe9d('0xa')](_0xbe9d('0x17'),_0xbe9d('0x18')),'defaultValue':_0xbe9d('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xbe9d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbe9d('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xbe9d('0x19'),'type':'text','required':!![]},'props':{'title':_0xbe9d('0x19'),'helpText':''}},{'type':_0xbe9d('0x1a'),'props':{'title':_0xbe9d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbe9d('0x4'),'type':_0xbe9d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xbe9d('0x1b'))?JSON[_0xbe9d('0x1c')](this[_0xbe9d('0x1d')](_0xbe9d('0x1b'))):{};},'set':function(_0x39d58f){return this['setDataValue'](_0xbe9d('0x1b'),JSON[_0xbe9d('0x1e')](_0x39d58f));}},'offlineForm':{'type':Sequelize[_0xbe9d('0xf')],'defaultValue':function(){return JSON[_0xbe9d('0x1e')]({'items':[{'type':_0xbe9d('0x1a'),'props':{'title':_0xbe9d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xbe9d('0x4')},'variable':null},{'type':_0xbe9d('0x1f'),'config':{'placeholder':_0xbe9d('0x20')},'props':{'title':_0xbe9d('0x20'),'helpText':_0xbe9d('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xbe9d('0x1d')]('offlineForm')?JSON[_0xbe9d('0x1c')](this[_0xbe9d('0x1d')](_0xbe9d('0x22'))):{};},'set':function(_0x1ddce1){return this[_0xbe9d('0x23')]('offlineForm',JSON[_0xbe9d('0x1e')](_0x1ddce1));}},'token':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbe9d('0x2')]},'forwardOffline':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbe9d('0x2')]},'waitingTitle':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x24')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbe9d('0x15')},'sendUnmanaged':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbe9d('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbe9d('0x2')]},'notificationTemplate':{'type':Sequelize[_0xbe9d('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x25')},'verticalAlignment':{'type':Sequelize[_0xbe9d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x26')},'defaultTitle':{'type':Sequelize[_0xbe9d('0x2')]},'customerAvatar':{'type':Sequelize[_0xbe9d('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbe9d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe9d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe9d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':_0xbe9d('0x27')},'systemAvatar':{'type':Sequelize[_0xbe9d('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe9d('0x8')],'comment':_0xbe9d('0x28')},'mandatoryDisposition':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![],'comment':_0xbe9d('0x29'),'set':function(_0x34ef02){if(!_0x34ef02)this[_0xbe9d('0x23')](_0xbe9d('0x2a'),null);this[_0xbe9d('0x23')](_0xbe9d('0x2b'),_0x34ef02);}},'vidaooEscalation':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbe9d('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbe9d('0x2')],'allowNull':![],'defaultValue':_0xbe9d('0x2c')},'vidaooNote':{'type':Sequelize[_0xbe9d('0x2')],'defaultValue':function(){return _0xbe9d('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0xbe9d('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbe9d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbe9d('0xf')]}};
\ No newline at end of file
+var _0x1380=['star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM'];(function(_0x12fb2c,_0xad4eb9){var _0x1431cf=function(_0x387d5d){while(--_0x387d5d){_0x12fb2c['push'](_0x12fb2c['shift']());}};_0x1431cf(++_0xad4eb9);}(_0x1380,0x80));var _0x0138=function(_0x5a333e,_0x43d78c){_0x5a333e=_0x5a333e-0x0;var _0x5c9ba5=_0x1380[_0x5a333e];return _0x5c9ba5;};'use strict';var Sequelize=require(_0x0138('0x0'));var rs=require(_0x0138('0x1'));module[_0x0138('0x2')]={'name':{'type':Sequelize[_0x0138('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0138('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x0138('0x3')]},'mapKey':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x5')},'customerAlias':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0138('0x3')],'allowNull':![],'defaultValue':_0x0138('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0138('0x3')],'allowNull':![],'defaultValue':_0x0138('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0138('0x3')],'allowNull':![],'defaultValue':_0x0138('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0138('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0138('0x3')]},'animation':{'type':Sequelize[_0x0138('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0138('0xa'),_0x0138('0xb')),'defaultValue':_0x0138('0xa')},'header_online':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0xc')},'start_chat_button':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0138('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x0138('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x0138('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0138('0x11')]},'closingQuestion':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0138('0x14')},'closingMessage':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x15')},'closingMessageButton':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x0138('0x16')},'conditionAgreement':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x17')},'ratingType':{'type':Sequelize[_0x0138('0x18')](_0x0138('0x19'),'thumb'),'defaultValue':_0x0138('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x0138('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0138('0x11')],'defaultValue':function(){return JSON[_0x0138('0x1a')]({'items':[{'type':_0x0138('0x1b'),'variable':null,'config':{'placeholder':_0x0138('0x1c'),'type':_0x0138('0x1d'),'required':!![]},'props':{'title':_0x0138('0x1c'),'helpText':''}},{'type':_0x0138('0x1b'),'props':{'title':_0x0138('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0138('0x4'),'type':_0x0138('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0138('0x1e')](_0x0138('0x1f'))?JSON[_0x0138('0x20')](this['getDataValue'](_0x0138('0x1f'))):{};},'set':function(_0x517282){return this[_0x0138('0x21')](_0x0138('0x1f'),JSON['stringify'](_0x517282));}},'offlineForm':{'type':Sequelize[_0x0138('0x11')],'defaultValue':function(){return JSON[_0x0138('0x1a')]({'items':[{'type':_0x0138('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0138('0x4'),'type':_0x0138('0x4')},'variable':null},{'type':_0x0138('0x22'),'config':{'placeholder':_0x0138('0x23')},'props':{'title':_0x0138('0x23'),'helpText':_0x0138('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x0138('0x1e')]('offlineForm')?JSON[_0x0138('0x20')](this[_0x0138('0x1e')]('offlineForm')):{};},'set':function(_0x158184){return this['setDataValue'](_0x0138('0x25'),JSON[_0x0138('0x1a')](_0x158184));}},'token':{'type':Sequelize[_0x0138('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x0138('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0138('0x3')]},'forwardOffline':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0138('0x3')]},'waitingTitle':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x26')},'waitingMessage':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x28')},'offlineMessageBody':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x0138('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0138('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0138('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0138('0x11')],'defaultValue':function(){return _0x0138('0x2b');}},'notificationSound':{'type':Sequelize[_0x0138('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0138('0x3')],'defaultValue':_0x0138('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0138('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0138('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0138('0x3')],'allowNull':![],'defaultValue':_0x0138('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0138('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0138('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0138('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x0138('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![],'comment':_0x0138('0x2f'),'set':function(_0x5401c7){if(!_0x5401c7)this[_0x0138('0x21')](_0x0138('0x30'),null);this['setDataValue'](_0x0138('0x31'),_0x5401c7);}},'vidaooEscalation':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0138('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0138('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0138('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index be64269..689ae41 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 _0x2afc=['server/files/images/logos/default_logo.svg','getLicense','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/customer_avatar.png','isNil','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','server/files/images/avatars/','notify','user-agent-parser','headers','CmContact','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','List','account','applications','list','orderBy','priority','Applications','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','name','version','format','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','readFileSync','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','UserProfileResource','end','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','mandatoryDispositionPause','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root'];(function(_0x48749c,_0x354f08){var _0x211834=function(_0x248187){while(--_0x248187){_0x48749c['push'](_0x48749c['shift']());}};_0x211834(++_0x354f08);}(_0x2afc,0x1df));var _0xc2af=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0x2afc[_0x5933fb];return _0x44d988;};'use strict';var emlformat=require(_0xc2af('0x0'));var rimraf=require(_0xc2af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc2af('0x2'));var rp=require(_0xc2af('0x3'));var moment=require(_0xc2af('0x4'));var BPromise=require(_0xc2af('0x5'));var Mustache=require('mustache');var util=require(_0xc2af('0x6'));var path=require(_0xc2af('0x7'));var sox=require(_0xc2af('0x8'));var csv=require(_0xc2af('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2af('0xa'));var squel=require(_0xc2af('0xb'));var crypto=require(_0xc2af('0xc'));var jsforce=require(_0xc2af('0xd'));var deskjs=require(_0xc2af('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc2af('0xf'));var Redis=require(_0xc2af('0x10'));var authService=require(_0xc2af('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc2af('0x12'));var hardwareService=require(_0xc2af('0x13'));var logger=require(_0xc2af('0x14'))(_0xc2af('0x15'));var utils=require(_0xc2af('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc2af('0x17'));var db=require(_0xc2af('0x18'))['db'];config[_0xc2af('0x19')]=_[_0xc2af('0x1a')](config[_0xc2af('0x19')],{'host':_0xc2af('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc2af('0x19')]));require(_0xc2af('0x1c'))['register'](socket);var jayson=require(_0xc2af('0x1d'));var client=jayson[_0xc2af('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xc2af('0x1e')][_0xc2af('0x1f')]({'port':0x232a});var client9003=jayson['client'][_0xc2af('0x1f')]({'port':0x232b});var client9001=jayson[_0xc2af('0x1e')][_0xc2af('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x34de65,_0x5d66c8,_0x9b6135,_0x46af9c){return new BPromise(function(_0x4b616d,_0x216224){var _0x341725=_0x46af9c||client;return _0x341725[_0xc2af('0x20')](_0x34de65,_0x9b6135)[_0xc2af('0x21')](function(_0x12af6c){logger[_0xc2af('0x22')](_0xc2af('0x23'),_0x5d66c8,_0xc2af('0x24'));logger[_0xc2af('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5d66c8,'request\x20sent',JSON[_0xc2af('0x26')](_0x12af6c));if(_0x12af6c['error']){if(_0x12af6c[_0xc2af('0x27')]['code']===0x1f4){logger[_0xc2af('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x5d66c8,_0x12af6c['error'][_0xc2af('0x28')]);return _0x216224(_0x12af6c[_0xc2af('0x27')][_0xc2af('0x28')]);}logger[_0xc2af('0x27')](_0xc2af('0x23'),_0x5d66c8,_0x12af6c[_0xc2af('0x27')]['message']);return _0x4b616d(_0x12af6c[_0xc2af('0x27')][_0xc2af('0x28')]);}else{logger[_0xc2af('0x22')](_0xc2af('0x23'),_0x5d66c8,'request\x20sent');_0x4b616d(_0x12af6c[_0xc2af('0x29')][_0xc2af('0x28')]);}})['catch'](function(_0x369bd1){logger[_0xc2af('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x5d66c8,_0x369bd1);_0x216224(_0x369bd1);});});}function respondWithStatusCode(_0x54a522,_0xf64819){_0xf64819=_0xf64819||0xcc;return function(_0xd2a9c){if(_0xd2a9c){return _0x54a522[_0xc2af('0x2a')](_0xf64819);}return _0x54a522[_0xc2af('0x2b')](_0xf64819)['end']();};}function respondWithResult(_0x1cc106,_0x4a8dc4){_0x4a8dc4=_0x4a8dc4||0xc8;return function(_0xd97387){if(_0xd97387){return _0x1cc106[_0xc2af('0x2b')](_0x4a8dc4)[_0xc2af('0x2c')](_0xd97387);}};}function respondWithFilteredResult(_0x2eaa9e,_0x5d71a4){return function(_0x155c19){if(_0x155c19){var _0x3b2693=typeof _0x5d71a4[_0xc2af('0x2d')]===_0xc2af('0x2e')&&typeof _0x5d71a4[_0xc2af('0x2f')]===_0xc2af('0x2e');var _0x3049dd=_0x155c19[_0xc2af('0x30')];var _0x3f5877=_0x3b2693?0x0:_0x5d71a4[_0xc2af('0x2d')];var _0x38d710=_0x3b2693?_0x155c19[_0xc2af('0x30')]:_0x5d71a4[_0xc2af('0x2d')]+_0x5d71a4[_0xc2af('0x2f')];var _0x582bff;if(_0x38d710>=_0x3049dd){_0x38d710=_0x3049dd;_0x582bff=0xc8;}else{_0x582bff=0xce;}_0x2eaa9e[_0xc2af('0x2b')](_0x582bff);return _0x2eaa9e['set'](_0xc2af('0x31'),_0x3f5877+'-'+_0x38d710+'/'+_0x3049dd)['json'](_0x155c19);}return null;};}function patchUpdates(_0x12d45b){return function(_0x245d89){try{jsonpatch[_0xc2af('0x32')](_0x245d89,_0x12d45b,!![]);}catch(_0x1671c3){return BPromise['reject'](_0x1671c3);}return _0x245d89[_0xc2af('0x33')]();};}function saveUpdates(_0x47827c,_0x1fff4e){return function(_0x3db82d){if(_0x3db82d){return _0x3db82d[_0xc2af('0x34')](_0x47827c)[_0xc2af('0x21')](function(_0x457651){return _0x457651;});}return null;};}function removeEntity(_0x163d5d,_0x3afe59){return function(_0x21847a){if(_0x21847a){return _0x21847a[_0xc2af('0x35')]()[_0xc2af('0x21')](function(){var _0x455e06=_0x21847a['get']({'plain':!![]});var _0x5b87c2='ChatWebsites';return db[_0xc2af('0x36')][_0xc2af('0x35')]({'where':{'type':_0x5b87c2,'resourceId':_0x455e06['id']}})[_0xc2af('0x21')](function(){return _0x21847a;});})[_0xc2af('0x21')](function(){_0x163d5d[_0xc2af('0x2b')](0xcc)[_0xc2af('0x37')]();});}};}function handleEntityNotFound(_0x126607,_0x59034a){return function(_0x27927c){if(!_0x27927c){_0x126607[_0xc2af('0x2a')](0x194);}return _0x27927c;};}function handleError(_0x36f462,_0x303683){_0x303683=_0x303683||0x1f4;return function(_0x3ac046){logger[_0xc2af('0x27')](_0x3ac046['stack']);if(_0x3ac046['name']){delete _0x3ac046['name'];}_0x36f462[_0xc2af('0x2b')](_0x303683)[_0xc2af('0x38')](_0x3ac046);};}exports[_0xc2af('0x39')]=function(_0x1f3207,_0x495c05){var _0xcfaee9={'include':[{'model':db[_0xc2af('0x3a')],'as':'mandatoryDispositionPause'}]},_0x388035={},_0x6c4256={'count':0x0,'rows':[]};var _0xad0f9=_[_0xc2af('0x3b')](db[_0xc2af('0x3c')][_0xc2af('0x3d')],function(_0x26c9de){return{'name':_0x26c9de[_0xc2af('0x3e')],'type':_0x26c9de[_0xc2af('0x3f')][_0xc2af('0x40')]};});_0x388035[_0xc2af('0x41')]=_['map'](_0xad0f9,'name');_0x388035[_0xc2af('0x42')]=_[_0xc2af('0x43')](_0x1f3207[_0xc2af('0x42')]);_0x388035['filters']=_[_0xc2af('0x44')](_0x388035[_0xc2af('0x41')],_0x388035[_0xc2af('0x42')]);_0xcfaee9[_0xc2af('0x45')]=_[_0xc2af('0x44')](_0x388035[_0xc2af('0x41')],qs[_0xc2af('0x46')](_0x1f3207[_0xc2af('0x42')][_0xc2af('0x46')]));_0xcfaee9['attributes']=_0xcfaee9[_0xc2af('0x45')][_0xc2af('0x47')]?_0xcfaee9[_0xc2af('0x45')]:_0x388035['model'];if(!_0x1f3207[_0xc2af('0x42')][_0xc2af('0x48')](_0xc2af('0x49'))){_0xcfaee9[_0xc2af('0x2f')]=qs['limit'](_0x1f3207[_0xc2af('0x42')][_0xc2af('0x2f')]);_0xcfaee9['offset']=qs[_0xc2af('0x2d')](_0x1f3207[_0xc2af('0x42')][_0xc2af('0x2d')]);}_0xcfaee9[_0xc2af('0x4a')]=qs[_0xc2af('0x4b')](_0x1f3207[_0xc2af('0x42')]['sort']);_0xcfaee9[_0xc2af('0x4c')]=qs[_0xc2af('0x4d')](_[_0xc2af('0x4e')](_0x1f3207[_0xc2af('0x42')],_0x388035[_0xc2af('0x4d')]),_0xad0f9);if(_0x1f3207[_0xc2af('0x42')]['filter']){_0xcfaee9[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0xcfaee9[_0xc2af('0x4c')],{'$or':_[_0xc2af('0x3b')](_0xad0f9,function(_0xdd06d2){if(_0xdd06d2[_0xc2af('0x3f')]!==_0xc2af('0x50')){var _0x54e939={};_0x54e939[_0xdd06d2['name']]={'$like':'%'+_0x1f3207['query'][_0xc2af('0x51')]+'%'};return _0x54e939;}})});}_0xcfaee9=_['merge']({},_0xcfaee9,_0x1f3207[_0xc2af('0x52')]);var _0x455596={'where':_0xcfaee9[_0xc2af('0x4c')]};return db[_0xc2af('0x3c')]['count'](_0x455596)['then'](function(_0xdf5581){_0x6c4256[_0xc2af('0x30')]=_0xdf5581;if(_0x1f3207[_0xc2af('0x42')]['includeAll']){_0xcfaee9[_0xc2af('0x53')]=[{'all':!![]}];}return db[_0xc2af('0x3c')][_0xc2af('0x54')](_0xcfaee9);})['then'](function(_0x8c69d8){_0x6c4256['rows']=_0x8c69d8;return _0x6c4256;})[_0xc2af('0x21')](respondWithFilteredResult(_0x495c05,_0xcfaee9))['catch'](handleError(_0x495c05,null));};exports[_0xc2af('0x55')]=function(_0x16feed,_0x569ce6){var _0x2433b9={'raw':![],'where':{'id':_0x16feed[_0xc2af('0x56')]['id']},'include':[{'model':db[_0xc2af('0x3a')],'as':_0xc2af('0x57')}]},_0x5b801c={};_0x5b801c[_0xc2af('0x41')]=_[_0xc2af('0x43')](db[_0xc2af('0x3c')][_0xc2af('0x3d')]);_0x5b801c[_0xc2af('0x42')]=_[_0xc2af('0x43')](_0x16feed['query']);_0x5b801c[_0xc2af('0x4d')]=_[_0xc2af('0x44')](_0x5b801c[_0xc2af('0x41')],_0x5b801c[_0xc2af('0x42')]);_0x2433b9['attributes']=_[_0xc2af('0x44')](_0x5b801c[_0xc2af('0x41')],qs[_0xc2af('0x46')](_0x16feed[_0xc2af('0x42')]['fields']));_0x2433b9[_0xc2af('0x45')]=_0x2433b9['attributes'][_0xc2af('0x47')]?_0x2433b9[_0xc2af('0x45')]:_0x5b801c[_0xc2af('0x41')];if(_0x16feed[_0xc2af('0x42')][_0xc2af('0x58')]){_0x2433b9[_0xc2af('0x53')]=[{'all':!![]}];}_0x2433b9=_['merge']({},_0x2433b9,_0x16feed['options']);return db[_0xc2af('0x3c')][_0xc2af('0x59')](_0x2433b9)[_0xc2af('0x21')](handleEntityNotFound(_0x569ce6,null))[_0xc2af('0x21')](respondWithResult(_0x569ce6,null))[_0xc2af('0x5a')](handleError(_0x569ce6,null));};exports[_0xc2af('0x5b')]=function(_0x33faf4,_0x40e315){return db[_0xc2af('0x3c')]['create'](_0x33faf4[_0xc2af('0x5c')],{})[_0xc2af('0x21')](function(_0x22e883){var _0xf1e4d3=_0x33faf4[_0xc2af('0x5d')][_0xc2af('0x5e')]({'plain':!![]});if(!_0xf1e4d3)throw new Error(_0xc2af('0x5f'));if(_0xf1e4d3[_0xc2af('0x60')]==='user'){var _0x3e4ef2=_0x22e883[_0xc2af('0x5e')]({'plain':!![]});var _0x546043=_0xc2af('0x61');return db[_0xc2af('0x62')]['find']({'where':{'name':_0x546043,'userProfileId':_0xf1e4d3['userProfileId']},'raw':!![]})[_0xc2af('0x21')](function(_0x1d0051){if(_0x1d0051&&_0x1d0051[_0xc2af('0x63')]===0x0){return db[_0xc2af('0x36')]['create']({'name':_0x3e4ef2['name'],'resourceId':_0x3e4ef2['id'],'type':_0x1d0051['name'],'sectionId':_0x1d0051['id']},{})['then'](function(){return _0x22e883;});}else{return _0x22e883;}})[_0xc2af('0x5a')](function(_0x6cb3a){logger['error'](_0xc2af('0x64'),_0x6cb3a);throw _0x6cb3a;});}return _0x22e883;})['then'](respondWithResult(_0x40e315,0xc9))[_0xc2af('0x5a')](handleError(_0x40e315,null));};exports['update']=function(_0xaabf1d,_0x1281ba){if(_0xaabf1d[_0xc2af('0x5c')]['id']){delete _0xaabf1d[_0xc2af('0x5c')]['id'];}return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0xaabf1d[_0xc2af('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xc2af('0x57')}]})['then'](handleEntityNotFound(_0x1281ba,null))[_0xc2af('0x21')](saveUpdates(_0xaabf1d[_0xc2af('0x5c')],null))['then'](respondWithResult(_0x1281ba,null))['catch'](handleError(_0x1281ba,null));};exports['destroy']=function(_0xbf98d5,_0x53245d){return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0xbf98d5['params']['id']}})['then'](handleEntityNotFound(_0x53245d,null))[_0xc2af('0x21')](removeEntity(_0x53245d,null))['catch'](handleError(_0x53245d,null));};exports[_0xc2af('0x65')]=function(_0x1323da,_0x4ad28e){return db['ChatWebsite'][_0xc2af('0x65')]()[_0xc2af('0x21')](respondWithResult(_0x4ad28e,null))[_0xc2af('0x5a')](handleError(_0x4ad28e,null));};exports['addDisposition']=function(_0x2b3ed6,_0x1a669d,_0x4a060e){if(_0x2b3ed6[_0xc2af('0x5c')]['id']){delete _0x2b3ed6[_0xc2af('0x5c')]['id'];}return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x2b3ed6[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x1a669d,null))[_0xc2af('0x21')](function(_0x101f44){if(_0x101f44){_0x2b3ed6[_0xc2af('0x5c')][_0xc2af('0x66')]=_0x101f44['id'];return db[_0xc2af('0x67')][_0xc2af('0x5b')](_0x2b3ed6[_0xc2af('0x5c')]);}})[_0xc2af('0x21')](respondWithResult(_0x1a669d,null))[_0xc2af('0x5a')](handleError(_0x1a669d,null));};exports[_0xc2af('0x68')]=function(_0x40c825,_0x31a9a2,_0x2e588f){var _0xb025f5={'raw':![],'where':{}};var _0x1b29dd={};var _0x4e82bc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc2af('0x69')]({'where':{'id':_0x40c825[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x31a9a2,null))['then'](function(_0x32bfbb){if(_0x32bfbb){_0x1b29dd[_0xc2af('0x41')]=_['keys'](db[_0xc2af('0x67')]['rawAttributes']);_0x1b29dd['query']=_[_0xc2af('0x43')](_0x40c825['query']);_0x1b29dd['filters']=_[_0xc2af('0x44')](_0x1b29dd[_0xc2af('0x41')],_0x1b29dd[_0xc2af('0x42')]);_0xb025f5[_0xc2af('0x45')]=_[_0xc2af('0x44')](_0x1b29dd[_0xc2af('0x41')],qs[_0xc2af('0x46')](_0x40c825[_0xc2af('0x42')][_0xc2af('0x46')]));_0xb025f5[_0xc2af('0x45')]=_0xb025f5['attributes'][_0xc2af('0x47')]?_0xb025f5[_0xc2af('0x45')]:_0x1b29dd[_0xc2af('0x41')];if(!_0x40c825[_0xc2af('0x42')][_0xc2af('0x48')]('nolimit')){_0xb025f5[_0xc2af('0x2f')]=qs[_0xc2af('0x2f')](_0x40c825[_0xc2af('0x42')][_0xc2af('0x2f')]);_0xb025f5['offset']=qs[_0xc2af('0x2d')](_0x40c825[_0xc2af('0x42')]['offset']);}_0xb025f5['order']=qs[_0xc2af('0x4b')](_0x40c825[_0xc2af('0x42')]['sort']);_0xb025f5[_0xc2af('0x4c')]=qs[_0xc2af('0x4d')](_['pick'](_0x40c825[_0xc2af('0x42')],_0x1b29dd[_0xc2af('0x4d')]));_0xb025f5[_0xc2af('0x4c')][_0xc2af('0x66')]=_0x32bfbb['id'];if(_0x40c825['query'][_0xc2af('0x51')]){_0xb025f5['where']=_[_0xc2af('0x4f')](_0xb025f5[_0xc2af('0x4c')],{'$or':_[_0xc2af('0x3b')](_0xb025f5[_0xc2af('0x45')],function(_0x460878){var _0x26224b={};_0x26224b[_0x460878]={'$like':'%'+_0x40c825[_0xc2af('0x42')][_0xc2af('0x51')]+'%'};return _0x26224b;})});}_0xb025f5=_[_0xc2af('0x4f')]({},_0xb025f5,_0x40c825[_0xc2af('0x52')]);return db[_0xc2af('0x67')][_0xc2af('0x30')]({'where':_0xb025f5['where']})[_0xc2af('0x21')](function(_0x4c5ac9){_0x4e82bc[_0xc2af('0x30')]=_0x4c5ac9;if(_0x40c825[_0xc2af('0x42')][_0xc2af('0x58')]){_0xb025f5[_0xc2af('0x53')]=[{'all':!![]}];}return db[_0xc2af('0x67')]['findAll'](_0xb025f5);})[_0xc2af('0x21')](function(_0x4ffeb8){_0x4e82bc[_0xc2af('0x6a')]=_0x4ffeb8;return _0x4e82bc;});}})['then'](respondWithFilteredResult(_0x31a9a2,_0xb025f5))[_0xc2af('0x5a')](handleError(_0x31a9a2,null));};exports[_0xc2af('0x6b')]=function(_0x376bea,_0x46d043,_0x356dfa){return db[_0xc2af('0x3c')]['find']({'where':{'id':_0x376bea['params']['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x46d043,null))[_0xc2af('0x21')](function(_0x32e4cd){if(_0x32e4cd){return _0x32e4cd[_0xc2af('0x6b')](_0x376bea[_0xc2af('0x42')][_0xc2af('0x6c')]);}})[_0xc2af('0x21')](respondWithStatusCode(_0x46d043,null))[_0xc2af('0x5a')](handleError(_0x46d043,null));};exports['addAnswer']=function(_0x308a78,_0x3f7893,_0x5ad490){if(_0x308a78[_0xc2af('0x5c')]['id']){delete _0x308a78[_0xc2af('0x5c')]['id'];}return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x308a78[_0xc2af('0x56')]['id']}})['then'](handleEntityNotFound(_0x3f7893,null))[_0xc2af('0x21')](function(_0x5db8de){if(_0x5db8de){_0x308a78[_0xc2af('0x5c')][_0xc2af('0x66')]=_0x5db8de['id'];return db[_0xc2af('0x6d')][_0xc2af('0x5b')](_0x308a78[_0xc2af('0x5c')]);}})['then'](respondWithResult(_0x3f7893,null))['catch'](handleError(_0x3f7893,null));};exports[_0xc2af('0x6e')]=function(_0xc8903,_0x42ac8c,_0x574374){var _0x304f42={'raw':![],'where':{}};var _0x206e6a={};var _0x1811db={'count':0x0,'rows':[]};return db[_0xc2af('0x3c')]['findOne']({'where':{'id':_0xc8903[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x42ac8c,null))[_0xc2af('0x21')](function(_0xc7c192){if(_0xc7c192){_0x206e6a[_0xc2af('0x41')]=_[_0xc2af('0x43')](db['CannedAnswer'][_0xc2af('0x3d')]);_0x206e6a['query']=_[_0xc2af('0x43')](_0xc8903[_0xc2af('0x42')]);_0x206e6a[_0xc2af('0x4d')]=_[_0xc2af('0x44')](_0x206e6a[_0xc2af('0x41')],_0x206e6a[_0xc2af('0x42')]);_0x304f42[_0xc2af('0x45')]=_[_0xc2af('0x44')](_0x206e6a[_0xc2af('0x41')],qs[_0xc2af('0x46')](_0xc8903['query'][_0xc2af('0x46')]));_0x304f42[_0xc2af('0x45')]=_0x304f42[_0xc2af('0x45')][_0xc2af('0x47')]?_0x304f42['attributes']:_0x206e6a[_0xc2af('0x41')];if(!_0xc8903[_0xc2af('0x42')][_0xc2af('0x48')](_0xc2af('0x49'))){_0x304f42[_0xc2af('0x2f')]=qs[_0xc2af('0x2f')](_0xc8903['query'][_0xc2af('0x2f')]);_0x304f42[_0xc2af('0x2d')]=qs[_0xc2af('0x2d')](_0xc8903[_0xc2af('0x42')][_0xc2af('0x2d')]);}_0x304f42[_0xc2af('0x4a')]=qs[_0xc2af('0x4b')](_0xc8903['query'][_0xc2af('0x4b')]);_0x304f42[_0xc2af('0x4c')]=qs[_0xc2af('0x4d')](_['pick'](_0xc8903[_0xc2af('0x42')],_0x206e6a[_0xc2af('0x4d')]));_0x304f42[_0xc2af('0x4c')][_0xc2af('0x66')]=_0xc7c192['id'];if(_0xc8903[_0xc2af('0x42')][_0xc2af('0x51')]){_0x304f42[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0x304f42['where'],{'$or':_[_0xc2af('0x3b')](_0x304f42[_0xc2af('0x45')],function(_0x402ade){var _0x535114={};_0x535114[_0x402ade]={'$like':'%'+_0xc8903['query'][_0xc2af('0x51')]+'%'};return _0x535114;})});}_0x304f42=_['merge']({},_0x304f42,_0xc8903[_0xc2af('0x52')]);return db[_0xc2af('0x6d')][_0xc2af('0x30')]({'where':_0x304f42[_0xc2af('0x4c')]})[_0xc2af('0x21')](function(_0x11ba68){_0x1811db[_0xc2af('0x30')]=_0x11ba68;if(_0xc8903['query']['includeAll']){_0x304f42[_0xc2af('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc2af('0x54')](_0x304f42);})[_0xc2af('0x21')](function(_0x5f3937){_0x1811db[_0xc2af('0x6a')]=_0x5f3937;return _0x1811db;});}})[_0xc2af('0x21')](respondWithFilteredResult(_0x42ac8c,_0x304f42))[_0xc2af('0x5a')](handleError(_0x42ac8c,null));};exports[_0xc2af('0x6f')]=function(_0x175822,_0x3348c2,_0x3b1338){return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x175822['params']['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x3348c2,null))[_0xc2af('0x21')](function(_0x5cc600){if(_0x5cc600){return _0x5cc600[_0xc2af('0x6f')](_0x175822[_0xc2af('0x42')]['ids']);}})[_0xc2af('0x21')](respondWithStatusCode(_0x3348c2,null))[_0xc2af('0x5a')](handleError(_0x3348c2,null));};exports[_0xc2af('0x70')]=function(_0x12b2e3,_0x49eb92,_0x573e76){_0x12b2e3[_0xc2af('0x5c')][_0xc2af('0x71')]=_0x12b2e3[_0xc2af('0x72')]['filename'];return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x12b2e3[_0xc2af('0x56')]['id']}})['then'](handleEntityNotFound(_0x49eb92,null))[_0xc2af('0x21')](saveUpdates(_0x12b2e3[_0xc2af('0x5c')],null))[_0xc2af('0x21')](respondWithResult(_0x49eb92,null))['catch'](handleError(_0x49eb92,null));};exports[_0xc2af('0x73')]=function(_0x39de08,_0x4595e4,_0x8c78e0){_0x39de08[_0xc2af('0x5c')][_0xc2af('0x74')]=_0x39de08[_0xc2af('0x72')]['filename'];return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x39de08[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x4595e4,null))[_0xc2af('0x21')](saveUpdates(_0x39de08[_0xc2af('0x5c')],null))[_0xc2af('0x21')](respondWithResult(_0x4595e4,null))['catch'](handleError(_0x4595e4,null));};exports[_0xc2af('0x75')]=function(_0x6328c0,_0x159d62,_0x6f7da1){_0x6328c0[_0xc2af('0x5c')][_0xc2af('0x76')]=_0x6328c0['file'][_0xc2af('0x77')];return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x6328c0[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x159d62,null))['then'](saveUpdates(_0x6328c0[_0xc2af('0x5c')],null))[_0xc2af('0x21')](respondWithResult(_0x159d62,null))[_0xc2af('0x5a')](handleError(_0x159d62,null));};exports[_0xc2af('0x78')]=function(_0x18bdc1,_0x22334d,_0x193fa2){_0x18bdc1[_0xc2af('0x5c')][_0xc2af('0x79')]=_0x18bdc1[_0xc2af('0x72')][_0xc2af('0x77')];return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x18bdc1[_0xc2af('0x56')]['id']}})['then'](handleEntityNotFound(_0x22334d,null))[_0xc2af('0x21')](saveUpdates(_0x18bdc1[_0xc2af('0x5c')],null))['then'](respondWithResult(_0x22334d,null))[_0xc2af('0x5a')](handleError(_0x22334d,null));};exports[_0xc2af('0x7a')]=function(_0x2f9d84,_0x1b23c9,_0x24c4a0){var _0x276a0b=path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],_0xc2af('0x7d'));var _0x3aad6d={'where':{'id':_0x2f9d84[_0xc2af('0x56')]['id']},'attributes':['id',_0xc2af('0x71')],'raw':!![]};var _0x13542f=![];return require(_0xc2af('0x17'))[_0xc2af('0x7e')]()['then'](function(_0x2ebc4d){if(_0x2ebc4d){_0x13542f=_0x2ebc4d[_0xc2af('0x7f')];}})[_0xc2af('0x21')](function(){return db[_0xc2af('0x3c')]['find'](_0x3aad6d);})[_0xc2af('0x21')](handleEntityNotFound(_0x1b23c9,null))[_0xc2af('0x21')](function(_0x553bfd){if(_0x553bfd){if(!_['isNil'](_0x553bfd[_0xc2af('0x71')])){if(fs['existsSync'](path[_0xc2af('0x7b')](config['root'],'server/files/images/logos/',_0x553bfd[_0xc2af('0x71')]))&&_0x13542f){_0x276a0b=path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],_0xc2af('0x80'),_0x553bfd[_0xc2af('0x71')]);}}return _0x1b23c9[_0xc2af('0x81')](_0x276a0b);}})[_0xc2af('0x5a')](handleError(_0x1b23c9,null));};exports[_0xc2af('0x82')]=function(_0x33f754,_0x155c75,_0x406ede){var _0x262687=path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],_0xc2af('0x83'));var _0x136eb0={'where':{'id':_0x33f754[_0xc2af('0x56')]['id']},'attributes':['id',_0xc2af('0x74')],'raw':!![]};return db[_0xc2af('0x3c')]['find'](_0x136eb0)[_0xc2af('0x21')](handleEntityNotFound(_0x155c75,null))[_0xc2af('0x21')](function(_0x3614e4){if(_0x3614e4){if(!_['isNil'](_0x3614e4[_0xc2af('0x74')])){if(fs['existsSync'](path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],'server/files/images/avatars/',_0x3614e4[_0xc2af('0x74')]))){_0x262687=path['join'](config[_0xc2af('0x7c')],'server/files/images/avatars/',_0x3614e4['agentAvatar']);}}return _0x155c75['download'](_0x262687);}})['catch'](handleError(_0x155c75,null));};exports['getCustomerAvatar']=function(_0x448e81,_0x27c536,_0x4b5dbe){var _0x1f9f80=path['join'](config[_0xc2af('0x7c')],_0xc2af('0x84'));var _0x1e4925={'where':{'id':_0x448e81[_0xc2af('0x56')]['id']},'attributes':['id',_0xc2af('0x76'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc2af('0x59')](_0x1e4925)['then'](handleEntityNotFound(_0x27c536,null))[_0xc2af('0x21')](function(_0x42c194){if(_0x42c194){if(!_[_0xc2af('0x85')](_0x42c194[_0xc2af('0x76')])){if(fs[_0xc2af('0x86')](path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],'server/files/images/avatars/',_0x42c194[_0xc2af('0x76')]))&&_0x42c194['showCustomerAvatar']){_0x1f9f80=path['join'](config[_0xc2af('0x7c')],'server/files/images/avatars/',_0x42c194[_0xc2af('0x76')]);}}return _0x27c536[_0xc2af('0x81')](_0x1f9f80);}})['catch'](handleError(_0x27c536,null));};exports[_0xc2af('0x87')]=function(_0x5e3d96,_0x29a5e3,_0x430c70){var _0x19a923=path[_0xc2af('0x7b')](config['root'],_0xc2af('0x88'));var _0x26641c={'where':{'id':_0x5e3d96[_0xc2af('0x56')]['id']},'attributes':['id',_0xc2af('0x79')],'raw':!![]};return db[_0xc2af('0x3c')][_0xc2af('0x59')](_0x26641c)['then'](handleEntityNotFound(_0x29a5e3,null))[_0xc2af('0x21')](function(_0x570d3d){if(_0x570d3d){if(!_[_0xc2af('0x85')](_0x570d3d[_0xc2af('0x79')])){if(fs[_0xc2af('0x86')](path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],'server/files/images/avatars/',_0x570d3d[_0xc2af('0x79')]))){_0x19a923=path['join'](config[_0xc2af('0x7c')],_0xc2af('0x89'),_0x570d3d[_0xc2af('0x79')]);}}return _0x29a5e3[_0xc2af('0x81')](_0x19a923);}})[_0xc2af('0x5a')](handleError(_0x29a5e3,null));};exports[_0xc2af('0x8a')]=function(_0x4ce57d,_0x23786c,_0x2f655f){var _0x138bcc=require(_0xc2af('0x8b'));var _0x1c8b3a=new _0x138bcc();var _0x14daab=_0x1c8b3a['setUA'](_0x4ce57d[_0xc2af('0x8c')]['user-agent'])['getResult']();var _0x1700f9={'body':_0x4ce57d['body'],'channel':'chat'};var _0x52baf5=[];var _0x4caca6=[];var _0x48f0d9={};var _0x507aed=![];return db[_0xc2af('0x8d')]['describe']()[_0xc2af('0x21')](function(_0x40e622){if(!_0x40e622){throw new db[(_0xc2af('0x8e'))][(_0xc2af('0x8f'))]('no\x20available\x20attributes');}_0x52baf5=_['difference'](_[_0xc2af('0x43')](_0x40e622),['createdAt',_0xc2af('0x90')]);_0x4caca6=_[_0xc2af('0x91')](_['keys'](_0x40e622),[_0xc2af('0x92'),_0xc2af('0x90'),_0xc2af('0x93'),_0xc2af('0x94')]);if(_0x4ce57d[_0xc2af('0x5c')]['id']){delete _0x4ce57d[_0xc2af('0x5c')]['id'];}if(_[_0xc2af('0x85')](_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0x95')])){throw new db[(_0xc2af('0x8e'))][(_0xc2af('0x8f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x4ce57d['body'][_0xc2af('0x5c')])||_0x4ce57d[_0xc2af('0x5c')]['body']===''){throw new db[(_0xc2af('0x8e'))]['ValidationError'](_0xc2af('0x96'));}if(_['isNil'](_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0x97')])){throw new db[(_0xc2af('0x8e'))][(_0xc2af('0x8f'))](_0xc2af('0x98')+_0x4caca6);}if(!_['includes'](_0x4caca6,_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0x97')])){throw new db[(_0xc2af('0x8e'))][(_0xc2af('0x8f'))](_0xc2af('0x99')+_0x4caca6);}_0x48f0d9[_0x4ce57d[_0xc2af('0x5c')]['mapKey']]=_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0x95')];})[_0xc2af('0x21')](function(){return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x4ce57d[_0xc2af('0x56')]['id']},'include':[{'model':db[_0xc2af('0x9a')],'as':'List','include':[{'model':db[_0xc2af('0x8d')],'as':'Contacts','where':_0x48f0d9,'limit':0x1,'order':[[_0xc2af('0x90'),_0xc2af('0x9b')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0xc2af('0x21')](handleEntityNotFound(_0x23786c,null))[_0xc2af('0x21')](function(_0x83ce56){if(_0x83ce56&&_0x83ce56[_0xc2af('0x9c')]){_0x1700f9[_0xc2af('0x9d')]=_0x83ce56;_0x1700f9[_0xc2af('0x9e')]=_0x83ce56['Applications'];_0x1700f9[_0xc2af('0x9f')]=_0x83ce56[_0xc2af('0x9c')];_0x1700f9[_0xc2af('0x9e')]=_[_0xc2af('0xa0')](_0x1700f9[_0xc2af('0x9e')],[_0xc2af('0xa1')],['asc']);if(_0x1700f9[_0xc2af('0x9d')][_0xc2af('0xa2')]){delete _0x1700f9[_0xc2af('0x9d')][_0xc2af('0xa2')];}if(_0x1700f9[_0xc2af('0x9d')]['List']&&_0x1700f9[_0xc2af('0x9d')][_0xc2af('0x9c')][_0xc2af('0xa3')][_0xc2af('0x47')]){return _0x1700f9['account'][_0xc2af('0x9c')][_0xc2af('0xa3')][0x0];}var _0x51790e=_['defaults'](_0x4ce57d[_0xc2af('0x5c')],{'firstName':_0x4ce57d['body'][_0xc2af('0x95')],'ListId':_0x83ce56[_0xc2af('0x94')]});_0x51790e[_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0x97')]]=_0x4ce57d['body'][_0xc2af('0x95')];return db[_0xc2af('0x8d')]['create'](_0x51790e,{'fields':_0x52baf5,'raw':!![]});}})['then'](handleEntityNotFound(_0x23786c,null))[_0xc2af('0x21')](function(_0x194855){_0x1700f9[_0xc2af('0xa4')]=_0x194855;var _0x211c34=_0x4ce57d['body'][_0xc2af('0xa5')];if(_0x4ce57d[_0xc2af('0x8c')][_0xc2af('0xa6')]){_0x211c34=_0x4ce57d[_0xc2af('0x8c')][_0xc2af('0xa6')];}else if(_0x4ce57d['headers'][_0xc2af('0xa7')]){_0x211c34=_[_0xc2af('0xa8')](_0x4ce57d[_0xc2af('0x8c')][_0xc2af('0xa7')][_0xc2af('0xa9')](','));}if(_0x194855){var _0x39588e={'ContactId':_0x194855['id'],'ChatWebsiteId':_0x4ce57d[_0xc2af('0x56')]['id'],'from':(_0x194855[_0xc2af('0xaa')]||'')+'\x20'+(_0x194855[_0xc2af('0xab')]||''),'customerIp':_0x211c34,'customerPort':_0x4ce57d[_0xc2af('0x8c')][_0xc2af('0xac')]?_0x4ce57d['headers']['x-real-port']:null,'referer':_0x4ce57d['body']['referer'],'browserName':_0x14daab[_0xc2af('0xad')][_0xc2af('0xae')]&&_0x14daab['browser'][_0xc2af('0xaf')]?util['format']('%s\x20%s',_0x14daab[_0xc2af('0xad')]['name'],_0x14daab[_0xc2af('0xad')][_0xc2af('0xaf')]):'unknown','browserVersion':_0x14daab[_0xc2af('0xad')][_0xc2af('0xaf')]||'unknown','osName':util[_0xc2af('0xb0')](_0xc2af('0xb1'),_0x14daab['os'][_0xc2af('0xae')],_0x14daab['os'][_0xc2af('0xaf')]),'osVersion':_0x14daab['os']['version'],'deviceModel':_0x14daab[_0xc2af('0xb2')]['model']&&_0x14daab[_0xc2af('0xb2')]['vendor']?util[_0xc2af('0xb0')](_0xc2af('0xb3'),_0x14daab[_0xc2af('0xb2')]['model'],_0x14daab[_0xc2af('0xb2')][_0xc2af('0xb4')],_0x14daab[_0xc2af('0xb2')]['type']):null,'deviceVendor':_0x14daab[_0xc2af('0xb2')][_0xc2af('0xb4')],'deviceType':_0x14daab[_0xc2af('0xb2')][_0xc2af('0x3f')],'formData':JSON[_0xc2af('0x26')](_0x4ce57d[_0xc2af('0x5c')])};var _0x173b0d={'ChatWebsiteId':_0x4ce57d[_0xc2af('0x56')]['id'],'closed':![]};if(_0x4ce57d['body'][_0xc2af('0xb5')]){_0x173b0d['threadId']=_0x4ce57d['body'][_0xc2af('0xb5')];return db[_0xc2af('0xb6')]['find']({'where':_0x173b0d})[_0xc2af('0x21')](function(_0x3acdae){if(_0x3acdae){return[_0x3acdae,![]];}_0x39588e['threadId']=_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xb5')];_0x39588e[_0xc2af('0xb7')]=_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xb7')];return db[_0xc2af('0xb6')][_0xc2af('0x5b')](_0x39588e)[_0xc2af('0x21')](function(_0xbb0ad9){return[_0xbb0ad9,!![]];});});}_0x173b0d['ContactId']=_0x194855['id'];if(_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xb8')]&&_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xb8')]['id']){_0x173b0d['id']=_0x4ce57d[_0xc2af('0x5c')]['interaction']['id'];return db[_0xc2af('0xb6')][_0xc2af('0x59')]({'where':_0x173b0d})['then'](function(_0x1bb302){if(_0x1bb302){return[_0x1bb302,![]];}return db[_0xc2af('0xb6')]['create'](_0x39588e)['then'](function(_0x331ea4){return[_0x331ea4,!![]];});});}return db[_0xc2af('0xb6')][_0xc2af('0x5b')](_0x39588e)[_0xc2af('0x21')](function(_0x35957f){return[_0x35957f,!![]];});}})['spread'](function(_0x16ed69,_0x4975e6){if(_0x16ed69){_0x507aed=_0x4975e6;if(!_0x4975e6){var _0x555498={'from':(_0x1700f9['contact'][_0xc2af('0xaa')]||'')+'\x20'+(_0x1700f9[_0xc2af('0xa4')][_0xc2af('0xab')]||'')};if(_0x4ce57d['body']['threadId']&&_0x4ce57d[_0xc2af('0x5c')]['messageId']&&_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xb5')]!=_0x4ce57d[_0xc2af('0x5c')]['messageId']){_0x555498[_0xc2af('0xb5')]=_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xb9')];}return _0x16ed69['update'](_0x555498);}else{return _0x16ed69;}}})[_0xc2af('0x21')](function(_0x507a55){_0x1700f9[_0xc2af('0xb8')]=_0x507a55[_0xc2af('0x5e')]({'plain':!![]});_0x1700f9[_0xc2af('0xb8')]['created']=_0x507aed;if(_0x1700f9[_0xc2af('0xb8')][_0xc2af('0xba')]){if(_0x1700f9[_0xc2af('0x9d')][_0xc2af('0xbb')]){_0x1700f9['applications'][_0xc2af('0xbc')]({'id':0x0,'priority':_0x1700f9['applications'][_0xc2af('0x47')]+0x1,'app':_0xc2af('0xbd'),'appdata':_0xc2af('0xbe'),'interval':_0xc2af('0xbf')});}}return db[_0xc2af('0xc0')]['create']({'body':_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0x5c')],'ChatWebsiteId':_0x4ce57d[_0xc2af('0x56')]['id'],'ChatInteractionId':_0x507a55['id'],'direction':'in','ContactId':_0x1700f9[_0xc2af('0xa4')]['id'],'AttachmentId':_0x4ce57d[_0xc2af('0x5c')][_0xc2af('0xc1')]});})[_0xc2af('0x21')](function(_0x4bf0fc){_0x1700f9[_0xc2af('0x28')]=_0x4bf0fc;if(_0x1700f9[_0xc2af('0xb8')]['UserId']){return db[_0xc2af('0xc2')]['find']({'attributes':['id',_0xc2af('0xae')],'where':{'id':_0x1700f9['interaction']['UserId']}})['then'](function(_0x1caeb0){if(_0x1caeb0){_0x1700f9[_0xc2af('0x9e')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1caeb0[_0xc2af('0xae')]+','+(_0x1700f9[_0xc2af('0x9d')][_0xc2af('0xc3')]||0xa),'interval':'*,*,*,*'});_0x1700f9[_0xc2af('0xc4')]=!![];}return respondWithRpcPromise(_0xc2af('0xc5'),_0xc2af('0xc6'),_0x1700f9);});}return respondWithRpcPromise('Start',_0xc2af('0xc6'),_0x1700f9);})[_0xc2af('0x21')](function(_0x10044d){respondWithRpcPromise(_0xc2af('0xc7'),'EventManager',{'event':_0xc2af('0x8a'),'message':_0x10044d},client9002);return _0x10044d;})[_0xc2af('0x21')](respondWithResult(_0x23786c,null))[_0xc2af('0x5a')](handleError(_0x23786c,null));};exports['offline']=function(_0x5a0f53,_0x3cbd60,_0x251dcb){var _0x2eecab,_0x55fa15,_0x236b6e;var _0xc24b11=[];var _0x45a98e=[];var _0x56fc89={};var _0x34e418=_0x5a0f53[_0xc2af('0xc8')]||[];var _0x40e680=[];var _0x489a01;return db[_0xc2af('0x8d')][_0xc2af('0x65')]()[_0xc2af('0x21')](function(_0x529e7e){if(!_0x529e7e){throw new db[(_0xc2af('0x8e'))][(_0xc2af('0x8f'))](_0xc2af('0xc9'));}_0x45a98e=_[_0xc2af('0x91')](_[_0xc2af('0x43')](_0x529e7e),[_0xc2af('0x92'),_0xc2af('0x90')]);_0xc24b11=_['difference'](_[_0xc2af('0x43')](_0x529e7e),[_0xc2af('0x92'),_0xc2af('0x90'),_0xc2af('0x93'),'ListId']);if(_0x5a0f53[_0xc2af('0x5c')]['id']){delete _0x5a0f53[_0xc2af('0x5c')]['id'];}if(_[_0xc2af('0x85')](_0x5a0f53[_0xc2af('0x5c')]['from'])){throw _0x3cbd60['status'](0x1f4)['send'](new db[(_0xc2af('0x8e'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xc2af('0x85')](_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0x5c')])||_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0x5c')]===''){throw _0x3cbd60[_0xc2af('0x2b')](0x1f4)[_0xc2af('0x38')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xc2af('0x85')](_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0xca')])){throw _0x3cbd60[_0xc2af('0x2b')](0x1f4)[_0xc2af('0x38')](new db['Sequelize'][(_0xc2af('0x8f'))](_0xc2af('0xcb')+_0xc24b11));}if(!_[_0xc2af('0xcc')](_0xc24b11,_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0xca')])){throw _0x3cbd60[_0xc2af('0x2b')](0x1f4)[_0xc2af('0x38')](new db[(_0xc2af('0x8e'))][(_0xc2af('0x8f'))](_0xc2af('0xcd')+_0xc24b11));}_0x56fc89[_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0xca')]]=_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0x95')];})[_0xc2af('0x21')](function(){return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x5a0f53['params']['id']},'include':[{'model':db[_0xc2af('0x9a')],'as':_0xc2af('0x9c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xc2af('0x21')](handleEntityNotFound(_0x3cbd60,null))[_0xc2af('0x21')](function(_0xd7fe6c){if(_0xd7fe6c&&_0xd7fe6c[_0xc2af('0x9c')]){_0x55fa15=_0xd7fe6c;var _0x4ff4a1=_['defaults'](_0x5a0f53['body'],{'firstName':_0x5a0f53[_0xc2af('0x5c')]['from'],'phone':_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0x95')],'ListId':_0xd7fe6c[_0xc2af('0x94')]});_0x4ff4a1[_0x5a0f53['body'][_0xc2af('0xca')]]=_0x5a0f53[_0xc2af('0x5c')][_0xc2af('0x95')];return db['CmContact']['findOrCreate']({'where':_0x56fc89,'defaults':_0x4ff4a1});}})[_0xc2af('0xce')](function(_0x3368d1){if(_0x3368d1){_0x236b6e=_0x3368d1;var _0x3e641e=fs[_0xc2af('0xcf')](path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xc2af('0xd0'));var _0x37048d=ejs[_0xc2af('0xd1')](_0x3e641e,{'body':_['toPairs'](_0x5a0f53[_0xc2af('0x5c')]['body']),'bodyTitle':_0x55fa15[_0xc2af('0xd2')]});return db[_0xc2af('0xd3')]['create']({'body':_0x37048d,'ContactId':_0x3368d1['id'],'ChatWebsiteId':_0x55fa15['id']});}})[_0xc2af('0x21')](function(_0xb27a44){_0x489a01=_0xb27a44;if(_0x34e418['length']){var _0x2be0d5=_0x34e418[_0xc2af('0x3b')](function(_0xf06f04){return{'name':_0xf06f04[_0xc2af('0xd4')],'basename':_0xf06f04[_0xc2af('0x77')],'type':_0xf06f04[_0xc2af('0xd5')],'ChatOfflineMessageId':_0xb27a44['id']};});_0x40e680=_0x2be0d5['map'](_0x5cafc1=>{var _0xe96109={'filename':_0x5cafc1['name'],'path':path['join'](config[_0xc2af('0x7c')],_0xc2af('0xd6'),_0xc2af('0xc8'),_0xc2af('0xd7'),_0xc2af('0xd8'),_0x5cafc1['basename'])};return _0xe96109;});if(!_0x55fa15[_0xc2af('0xd9')]){return db[_0xc2af('0xda')][_0xc2af('0xdb')](function(_0x947c1){return db[_0xc2af('0xdc')][_0xc2af('0xdd')](_0x2be0d5,{'transaction':_0x947c1});});}}})[_0xc2af('0x21')](function(){if(_0x489a01){_0x2eecab=_0x489a01;return db[_0xc2af('0xde')][_0xc2af('0x69')]({'where':{'active':!![]},'include':[{'model':db[_0xc2af('0xdf')],'as':_0xc2af('0xe0'),'raw':!![]}]});}})[_0xc2af('0x21')](function(_0xbde353){if(_0xbde353&&_0xbde353[_0xc2af('0xe0')]&&_0x55fa15['forwardOffline']&&_0x55fa15['forwardOfflineAddress']){var _0x2e9fae={'tls':{'rejectUnauthorized':![]}};if(_0xbde353[_0xc2af('0xe0')][_0xc2af('0xe1')]){_0x2e9fae[_0xc2af('0xe1')]=_0xbde353['Smtp']['service'];}else{_0x2e9fae[_0xc2af('0xe2')]=_0xbde353[_0xc2af('0xe0')]['host'];_0x2e9fae[_0xc2af('0xe3')]=_0xbde353['Smtp']['port'];_0x2e9fae[_0xc2af('0xe4')]=_0xbde353[_0xc2af('0xe0')]['secure'];}if(_0xbde353['Smtp']['authentication']){_0x2e9fae[_0xc2af('0xe5')]={'user':_0xbde353[_0xc2af('0xe0')][_0xc2af('0x5d')],'pass':_0xbde353['Smtp'][_0xc2af('0xe6')]};}return respondWithRpcPromise(_0xc2af('0xe7'),_0xc2af('0xe8'),{'account':_0x2e9fae,'message':{'from':util[_0xc2af('0xb0')]('\x22%s\x22\x20<%s>',_0xbde353[_0xc2af('0xae')],_0xbde353[_0xc2af('0xe9')]||_0xbde353[_0xc2af('0xe0')][_0xc2af('0x5d')]),'to':_0x55fa15[_0xc2af('0xea')],'subject':_0x55fa15[_0xc2af('0xeb')],'html':_0x2eecab[_0xc2af('0x5c')],'attachments':_0x40e680}},client9003)[_0xc2af('0x21')](function(){return _0x2eecab;})[_0xc2af('0x5a')](function(_0x5b33e3){console[_0xc2af('0x27')](_0x5b33e3);});}})[_0xc2af('0x21')](function(){if(_0x55fa15&&_0x55fa15['openNewInteraction']&&_0x55fa15['MailAccountId']){var _0x369edb=[];if(_0x34e418['length']){_0x369edb=_0x34e418[_0xc2af('0x3b')](function(_0x16e671){return{'name':_0x16e671[_0xc2af('0xd4')],'basename':_0x16e671[_0xc2af('0x77')],'type':_0x16e671[_0xc2af('0xd5')],'ChatOfflineMessageId':_0x489a01['id']};});}var _0x1fd7ad;if(!_[_0xc2af('0x85')](_0x55fa15['subjectOffline'])){var _0x29b502=_[_0xc2af('0x3b')](_0x5a0f53[_0xc2af('0x5c')],function(_0x255c1d){return _0x255c1d;});var _0x382790=_['toPairsIn'](_0x29b502)[0x0];var _0x5cee0b=_[_0xc2af('0xec')](_0x382790,function(_0x2fb0ef){return _0x2fb0ef;});_0x1fd7ad=_0x5cee0b[0x1][_0x55fa15['subjectOffline']];}var _0x640006={'from':_0x236b6e[_0xc2af('0xe9')],'firstName':_0x236b6e[_0xc2af('0xaa')],'lastName':_0x236b6e[_0xc2af('0xab')],'mapKey':_0xc2af('0xe9'),'message':{'from':_0x236b6e['email'],'to':_0x55fa15['MailAccount'][_0xc2af('0xe9')],'cc':'','subject':_[_0xc2af('0x85')](_0x1fd7ad)?_0x55fa15['offlineMessageSubject']:_0x1fd7ad,'messageId':'','sentAt':new Date(),'attach':_0x369edb[_0xc2af('0x47')],'attachments':_0x369edb,'originChannel':_0xc2af('0xed'),'ChatWebsiteId':_0x55fa15['id'],'ChatOfflineMessageId':_0x2eecab['id'],'originTo':_0x55fa15[_0xc2af('0xde')][_0xc2af('0xe9')]},'body':_0x2eecab[_0xc2af('0x5c')]};var _0x242f9f={'account':{'id':_0x55fa15[_0xc2af('0xee')]},'body':_0x640006,'log':_0xc2af('0xef')};return respondWithRpcPromise(_0xc2af('0xef'),_0xc2af('0xf0'),_0x242f9f,client9001)[_0xc2af('0x21')](function(){return _0x2eecab;})[_0xc2af('0x5a')](function(_0x149270){console[_0xc2af('0x27')](_0x149270);});}return;})[_0xc2af('0x21')](function(){if(_0x2eecab){return _0x2eecab;}})[_0xc2af('0x21')](respondWithResult(_0x3cbd60,null))[_0xc2af('0x5a')](function(_0x2fe569){console[_0xc2af('0x27')](_0xc2af('0x5a'),_0x2fe569);for(var _0x4206b5 of _0x34e418){var _0x4e7dd1=path[_0xc2af('0x7b')](config[_0xc2af('0x7c')],_0xc2af('0xd6'),_0xc2af('0xc8'),'attachments',_0xc2af('0xd8'),_0x4206b5[_0xc2af('0x77')]);fs_extra[_0xc2af('0xf1')](_0x4e7dd1)[_0xc2af('0x5a')](function(_0x2967b4){console[_0xc2af('0x27')](_0xc2af('0xf2'),_0x4e7dd1,_0x2967b4);});}});};exports[_0xc2af('0xf3')]=function(_0x295848,_0x57d256,_0x376fd2){return db[_0xc2af('0xb6')][_0xc2af('0x59')]({'where':{'id':_0x295848['params']['id']}})['then'](handleEntityNotFound(_0x57d256,null))['then'](function(_0x48e7c5){if(_0x48e7c5){return _0x48e7c5[_0xc2af('0xf3')](_0x295848[_0xc2af('0x5c')][_0xc2af('0x6c')],_[_0xc2af('0xf4')](_0x295848['body'],[_0xc2af('0x6c'),'id'])||{});}})[_0xc2af('0x21')](respondWithResult(_0x57d256,null))['catch'](handleError(_0x57d256,null));};exports[_0xc2af('0xf5')]=function(_0x263cf9,_0x366c4c,_0x434e7e){var _0x1880dd={'raw':![],'where':{}};var _0xbf9eaf={};var _0x2fb30a={'count':0x0,'rows':[]};return db[_0xc2af('0x3c')][_0xc2af('0x69')]({'where':{'id':_0x263cf9['params']['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x366c4c,null))['then'](function(_0x33978b){if(_0x33978b){_0xbf9eaf[_0xc2af('0x41')]=_[_0xc2af('0x43')](db['ChatInteraction']['rawAttributes']);_0xbf9eaf[_0xc2af('0x42')]=_['keys'](_0x263cf9[_0xc2af('0x42')]);_0xbf9eaf[_0xc2af('0x4d')]=_[_0xc2af('0x44')](_0xbf9eaf[_0xc2af('0x41')],_0xbf9eaf['query']);_0x1880dd['attributes']=_['intersection'](_0xbf9eaf[_0xc2af('0x41')],qs[_0xc2af('0x46')](_0x263cf9[_0xc2af('0x42')][_0xc2af('0x46')]));_0x1880dd[_0xc2af('0x45')]=_0x1880dd[_0xc2af('0x45')][_0xc2af('0x47')]?_0x1880dd[_0xc2af('0x45')]:_0xbf9eaf['model'];if(!_0x263cf9[_0xc2af('0x42')]['hasOwnProperty'](_0xc2af('0x49'))){_0x1880dd[_0xc2af('0x2f')]=qs[_0xc2af('0x2f')](_0x263cf9[_0xc2af('0x42')][_0xc2af('0x2f')]);_0x1880dd['offset']=qs[_0xc2af('0x2d')](_0x263cf9[_0xc2af('0x42')][_0xc2af('0x2d')]);}_0x1880dd['order']=qs[_0xc2af('0x4b')](_0x263cf9['query'][_0xc2af('0x4b')]);_0x1880dd[_0xc2af('0x4c')]=qs[_0xc2af('0x4d')](_[_0xc2af('0x4e')](_0x263cf9[_0xc2af('0x42')],_0xbf9eaf['filters']));_0x1880dd[_0xc2af('0x4c')][_0xc2af('0x66')]=_0x33978b['id'];if(_0x263cf9[_0xc2af('0x42')][_0xc2af('0x51')]){_0x1880dd[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0x1880dd['where'],{'$or':_[_0xc2af('0x3b')](_0x1880dd[_0xc2af('0x45')],function(_0x33c2d3){var _0x441e20={};_0x441e20[_0x33c2d3]={'$like':'%'+_0x263cf9[_0xc2af('0x42')]['filter']+'%'};return _0x441e20;})});}_0x1880dd=_[_0xc2af('0x4f')]({},_0x1880dd,_0x263cf9[_0xc2af('0x52')]);return db[_0xc2af('0xb6')]['count']({'where':_0x1880dd[_0xc2af('0x4c')]})[_0xc2af('0x21')](function(_0x49d5d0){_0x2fb30a[_0xc2af('0x30')]=_0x49d5d0;if(_0x263cf9[_0xc2af('0x42')]['includeAll']){_0x1880dd['include']=[{'model':db[_0xc2af('0x8d')],'as':_0xc2af('0xf6'),'required':![]},{'model':db[_0xc2af('0xc2')],'as':'Owner','attributes':[_0xc2af('0xae'),_0xc2af('0xf7'),_0xc2af('0xf8')],'required':![]},{'model':db[_0xc2af('0xf9')],'as':_0xc2af('0xfa'),'attributes':['id',_0xc2af('0xae'),_0xc2af('0xfb')],'where':_0x263cf9[_0xc2af('0x42')][_0xc2af('0xfc')]?{'id':_0x263cf9[_0xc2af('0x42')][_0xc2af('0xfc')]}:undefined,'required':_0x263cf9['query'][_0xc2af('0xfc')]?!![]:![]}];}return db['ChatInteraction'][_0xc2af('0x54')](_0x1880dd);})[_0xc2af('0x21')](function(_0xd6fe25){_0x2fb30a[_0xc2af('0x6a')]=_0xd6fe25;return _0x2fb30a;});}})[_0xc2af('0x21')](respondWithFilteredResult(_0x366c4c,_0x1880dd))[_0xc2af('0x5a')](handleError(_0x366c4c,null));};function iftimePromise(_0x2fe776,_0x5ea18b){return respondWithRpcPromise(_0xc2af('0xfd'),_0xc2af('0xfe'),{'command':_0x5ea18b[_0xc2af('0xff')]?util[_0xc2af('0xb0')](_0xc2af('0x100'),_0x2fe776[_0xc2af('0x101')],_0x5ea18b[_0xc2af('0xff')]):util['format'](_0xc2af('0x102'),_0x2fe776[_0xc2af('0x101')])},client9002)[_0xc2af('0x21')](function(_0x154d7f){var _0x5bd51a=_0x154d7f&&_0x154d7f['indexOf']('true')>=0x0?!![]:![];logger[_0xc2af('0x22')](_0xc2af('0x103'),_0x5ea18b['id'],_0x2fe776['id'],_0x2fe776[_0xc2af('0x101')],_0x5bd51a?_0xc2af('0x104'):_0xc2af('0x105'),_0x5ea18b[_0xc2af('0xff')]?_0x5ea18b[_0xc2af('0xff')]:'No\x20timezone');return _0x5bd51a;})[_0xc2af('0x5a')](function(_0x598a80){logger['error'](_0xc2af('0x103'),_0x5ea18b['id'],_0x2fe776['id'],_0x2fe776[_0xc2af('0x101')],util[_0xc2af('0x106')](_0x598a80,{'showHidden':![],'depth':null}),_0x5ea18b[_0xc2af('0xff')]?_0x5ea18b[_0xc2af('0xff')]:_0xc2af('0x107'));return![];});}exports[_0xc2af('0xfe')]=function(_0x395d44,_0x5c8423,_0x23add1){var _0x16ecc3=0x0;var _0x16e3a5=0x0;var _0x43481f=![];var _0x4c5c35;var _0x31f963;return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x395d44[_0xc2af('0x56')]['id']},'include':[{'model':db[_0xc2af('0x108')],'as':_0xc2af('0x108'),'include':[{'model':db[_0xc2af('0x108')],'as':_0xc2af('0x109'),'attributes':['id',_0xc2af('0x101')],'raw':!![]}]}]})[_0xc2af('0x21')](handleEntityNotFound(_0x5c8423,null))[_0xc2af('0x21')](function(_0xd83dfe){if(_0xd83dfe){_0x4c5c35=_0xd83dfe;return _0xd83dfe[_0xc2af('0x10a')]({'raw':!![]});}})[_0xc2af('0x21')](function(_0x5d415e){if(_0x4c5c35){if(_0x5d415e){_0x31f963=_0x5d415e;}}return require(_0xc2af('0x17'))['getLicense']();})['then'](function(_0x12bddf){if(_0x12bddf){_0x16e3a5=_0x12bddf[_0xc2af('0x10b')];_0x43481f=_0x12bddf['custom'];}})[_0xc2af('0x21')](function(){return db['ChatInteraction'][_0xc2af('0x30')]({'where':{'closed':![]}});})[_0xc2af('0x21')](function(_0x349b6f){_0x16ecc3=_0x349b6f;if(_0x16e3a5&&_0x349b6f>_0x16e3a5){return db['License'][_0xc2af('0x69')]({'where':{'id':0x1}})[_0xc2af('0x21')](function(_0x374559){if(_0x374559){_0x374559[_0xc2af('0x10c')](_0xc2af('0x10d'));}});}})['then'](function(){if(_0x4c5c35[_0xc2af('0x108')]&&_0x4c5c35[_0xc2af('0x108')][_0xc2af('0x109')]){var _0x21db72=[];for(var _0x2a3fce=0x0;_0x2a3fce<_0x4c5c35['Interval']['Intervals'][_0xc2af('0x47')];_0x2a3fce++){var _0x26d3b3=_0x4c5c35['Interval'][_0xc2af('0x109')][_0x2a3fce][_0xc2af('0x5e')]({'plain':!![]});_0x21db72[_0xc2af('0xbc')](iftimePromise(_0x26d3b3,_0x4c5c35));}return BPromise['all'](_0x21db72)['then'](function(_0x1eb706){return _[_0xc2af('0x10e')](_0x1eb706);});}else{return!![];}})[_0xc2af('0x21')](function(_0xc209e){var _0x479020=fs[_0xc2af('0xcf')](path['join'](config[_0xc2af('0x7c')],_0xc2af('0x10f')),'utf8');var _0x174a9a={'remote':_0x4c5c35[_0xc2af('0x110')],'query':querystring[_0xc2af('0x26')](_[_0xc2af('0x4f')](_0x4c5c35[_0xc2af('0x5e')]({'plain':!![]}),{'customerIp':_0x395d44['headers']['x-forwarded-for']||_0x395d44[_0xc2af('0x8c')][_0xc2af('0x111')]||_0x395d44[_0xc2af('0x112')][_0xc2af('0x113')]||_0x395d44['ip'],'referer':_0x395d44[_0xc2af('0x8c')][_0xc2af('0x114')],'openedInteractions':_0x16ecc3,'maxInteractions':_0x16e3a5,'virtual':_0x43481f['virtual'],'online':_0xc209e,'custom':_0x43481f}))[_0xc2af('0x115')](/'/g,'\x5c\x27')};_0x5c8423[_0xc2af('0x38')](ejs[_0xc2af('0xd1')](Mustache[_0xc2af('0xd1')](_0x479020,_0x174a9a),{'proactiveActions':_0x31f963,'alignment':_0x4c5c35[_0xc2af('0x116')],'verticalAlignment':_0x4c5c35[_0xc2af('0x117')],'div_color':_0x4c5c35[_0xc2af('0xfb')],'text_color':_0x4c5c35[_0xc2af('0x118')],'button_color':_0x4c5c35['color_button'],'background_color':_0x4c5c35[_0xc2af('0x119')]}));})[_0xc2af('0x5a')](handleError(_0x5c8423,null));};exports[_0xc2af('0x11a')]=function(_0x159288,_0x329de5,_0x38df63){return db['ChatWebsite'][_0xc2af('0x69')]({'where':{'id':_0x159288['params']['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x329de5,null))['then'](function(_0x4149ce){if(_0x4149ce){return db[_0xc2af('0xda')][_0xc2af('0xdb')](function(_0xa4b71e){return db[_0xc2af('0x11b')][_0xc2af('0x35')]({'where':{'ChatWebsiteId':_0x159288[_0xc2af('0x56')]['id']},'transaction':_0xa4b71e})['then'](function(_0x4f3089){var _0x45b1a4=_[_0xc2af('0x3b')](_0x159288[_0xc2af('0x5c')],function(_0x502ad8){_0x502ad8[_0xc2af('0x66')]=_0x159288[_0xc2af('0x56')]['id'];return _0x502ad8;});return db[_0xc2af('0x11b')]['bulkCreate'](_0x45b1a4,{'transaction':_0xa4b71e});});})['then'](function(){return db[_0xc2af('0x11b')][_0xc2af('0x11c')]({'where':{'ChatWebsiteId':_0x159288['params']['id']},'order':_0xc2af('0xa1')});});}})['then'](respondWithResult(_0x329de5,null))[_0xc2af('0x5a')](handleError(_0x329de5,null));};exports[_0xc2af('0x11d')]=function(_0x4f4adc,_0xc97bf6,_0x3e5d29){var _0x1d30e1={};var _0x5491c2={};var _0x1dbf30;var _0x33be67;return db['ChatWebsite'][_0xc2af('0x69')]({'where':{'id':_0x4f4adc['params']['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0xc97bf6,null))['then'](function(_0x2d3d92){if(_0x2d3d92){_0x1dbf30=_0x2d3d92;_0x5491c2[_0xc2af('0x41')]=_[_0xc2af('0x43')](db[_0xc2af('0x11b')][_0xc2af('0x3d')]);_0x5491c2[_0xc2af('0x42')]=_[_0xc2af('0x43')](_0x4f4adc['query']);_0x5491c2[_0xc2af('0x4d')]=_[_0xc2af('0x44')](_0x5491c2[_0xc2af('0x41')],_0x5491c2[_0xc2af('0x42')]);_0x1d30e1[_0xc2af('0x45')]=_[_0xc2af('0x44')](_0x5491c2[_0xc2af('0x41')],qs['fields'](_0x4f4adc[_0xc2af('0x42')]['fields']));_0x1d30e1[_0xc2af('0x45')]=_0x1d30e1[_0xc2af('0x45')][_0xc2af('0x47')]?_0x1d30e1['attributes']:_0x5491c2[_0xc2af('0x41')];_0x1d30e1[_0xc2af('0x4a')]=qs[_0xc2af('0x4b')](_0x4f4adc[_0xc2af('0x42')]['sort']);_0x1d30e1['where']=qs[_0xc2af('0x4d')](_[_0xc2af('0x4e')](_0x4f4adc[_0xc2af('0x42')],_0x5491c2[_0xc2af('0x4d')]));if(_0x4f4adc[_0xc2af('0x42')][_0xc2af('0x51')]){_0x1d30e1[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0x1d30e1[_0xc2af('0x4c')],{'$or':_[_0xc2af('0x3b')](_0x1d30e1[_0xc2af('0x45')],function(_0x42895a){var _0x4afc0e={};_0x4afc0e[_0x42895a]={'$like':'%'+_0x4f4adc[_0xc2af('0x42')]['filter']+'%'};return _0x4afc0e;})});}_0x1d30e1=_[_0xc2af('0x4f')]({},_0x1d30e1,_0x4f4adc[_0xc2af('0x52')]);return _0x1dbf30['getApplications'](_0x1d30e1);}})[_0xc2af('0x21')](function(_0x31e56e){if(_0x31e56e){_0x33be67=_0x31e56e['length'];if(!_0x4f4adc[_0xc2af('0x42')][_0xc2af('0x48')](_0xc2af('0x49'))){_0x1d30e1[_0xc2af('0x2f')]=qs[_0xc2af('0x2f')](_0x4f4adc['query'][_0xc2af('0x2f')]);_0x1d30e1[_0xc2af('0x2d')]=qs[_0xc2af('0x2d')](_0x4f4adc[_0xc2af('0x42')][_0xc2af('0x2d')]);}return _0x1dbf30[_0xc2af('0x11d')](_0x1d30e1);}})[_0xc2af('0x21')](function(_0xf1b60){if(_0xf1b60){return _0xf1b60?{'count':_0x33be67,'rows':_0xf1b60}:null;}})[_0xc2af('0x21')](respondWithResult(_0xc97bf6,null))['catch'](handleError(_0xc97bf6,null));};exports[_0xc2af('0x11e')]=function(_0x1dc14c,_0x171dce,_0xb8df3){return db[_0xc2af('0x11f')]['find']({'where':{'id':_0x1dc14c['params']['id']}})['then'](handleEntityNotFound(_0x171dce,null))['then'](function(_0x5b3015){if(_0x5b3015){return _0x5b3015['addProactiveActions'](_0x1dc14c[_0xc2af('0x5c')][_0xc2af('0x6c')],_[_0xc2af('0xf4')](_0x1dc14c[_0xc2af('0x5c')],[_0xc2af('0x6c'),'id'])||{});}})[_0xc2af('0x21')](respondWithResult(_0x171dce,null))[_0xc2af('0x5a')](handleError(_0x171dce,null));};exports[_0xc2af('0x10a')]=function(_0x2db5cd,_0x4cc6c2,_0x2d5cdc){var _0x32fb54={};var _0x346c88={};var _0x4d7bac;var _0x3926d6;return db[_0xc2af('0x3c')][_0xc2af('0x69')]({'where':{'id':_0x2db5cd[_0xc2af('0x56')]['id']}})['then'](handleEntityNotFound(_0x4cc6c2,null))[_0xc2af('0x21')](function(_0xb7f547){if(_0xb7f547){_0x4d7bac=_0xb7f547;_0x346c88['model']=_[_0xc2af('0x43')](db['ChatProactiveAction'][_0xc2af('0x3d')]);_0x346c88[_0xc2af('0x42')]=_['keys'](_0x2db5cd[_0xc2af('0x42')]);_0x346c88[_0xc2af('0x4d')]=_[_0xc2af('0x44')](_0x346c88[_0xc2af('0x41')],_0x346c88[_0xc2af('0x42')]);_0x32fb54[_0xc2af('0x45')]=_[_0xc2af('0x44')](_0x346c88['model'],qs[_0xc2af('0x46')](_0x2db5cd[_0xc2af('0x42')][_0xc2af('0x46')]));_0x32fb54['attributes']=_0x32fb54['attributes'][_0xc2af('0x47')]?_0x32fb54['attributes']:_0x346c88[_0xc2af('0x41')];_0x32fb54[_0xc2af('0x4a')]=qs[_0xc2af('0x4b')](_0x2db5cd['query'][_0xc2af('0x4b')]);_0x32fb54['where']=qs[_0xc2af('0x4d')](_[_0xc2af('0x4e')](_0x2db5cd['query'],_0x346c88[_0xc2af('0x4d')]));if(_0x2db5cd['query']['filter']){_0x32fb54[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0x32fb54['where'],{'$or':_['map'](_0x32fb54[_0xc2af('0x45')],function(_0x54a0c6){var _0x235e57={};_0x235e57[_0x54a0c6]={'$like':'%'+_0x2db5cd[_0xc2af('0x42')][_0xc2af('0x51')]+'%'};return _0x235e57;})});}_0x32fb54=_[_0xc2af('0x4f')]({},_0x32fb54,_0x2db5cd['options']);return _0x4d7bac[_0xc2af('0x10a')](_0x32fb54);}})[_0xc2af('0x21')](function(_0x3e5214){if(_0x3e5214){_0x3926d6=_0x3e5214['length'];if(!_0x2db5cd[_0xc2af('0x42')][_0xc2af('0x48')](_0xc2af('0x49'))){_0x32fb54['limit']=qs[_0xc2af('0x2f')](_0x2db5cd[_0xc2af('0x42')][_0xc2af('0x2f')]);_0x32fb54[_0xc2af('0x2d')]=qs[_0xc2af('0x2d')](_0x2db5cd['query'][_0xc2af('0x2d')]);}return _0x4d7bac['getProactiveActions'](_0x32fb54);}})[_0xc2af('0x21')](function(_0x19d2fa){if(_0x19d2fa){return _0x19d2fa?{'count':_0x3926d6,'rows':_0x19d2fa}:null;}})[_0xc2af('0x21')](respondWithResult(_0x4cc6c2,null))[_0xc2af('0x5a')](handleError(_0x4cc6c2,null));};exports[_0xc2af('0x120')]=function(_0x35366d,_0x4eadd9,_0x485f3e){var _0x4e5183=_0x35366d[_0xc2af('0x42')][_0xc2af('0x121')]==='false'?_0xc2af('0x122'):_0xc2af('0x123');return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'attributes':['id',_0x4e5183],'where':{'id':_0x35366d['params']['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x4eadd9,null))[_0xc2af('0x21')](function(_0x491b36){if(_0x491b36){var _0x3d8033=_0x491b36[_0x4e5183];var _0x3f58fa=_0x3d8033&&_0x3d8033['items']?_0x3d8033[_0xc2af('0x124')]:[];_0x4eadd9[_0xc2af('0x38')]({'fromKey':_[_0xc2af('0x85')](_0x3d8033[_0xc2af('0x125')])?undefined:_0x3d8033['fromKey'],'count':_0x3f58fa[_0xc2af('0x47')],'rows':_0x3f58fa});}})[_0xc2af('0x5a')](handleError(_0x4eadd9,null));};exports[_0xc2af('0x126')]=function(_0xdf2c35,_0x4a940c,_0x5a0f47){var _0x4f9b58={'raw':![],'where':{}};var _0x4e7776={};var _0x36bb0b={'count':0x0,'rows':[]};return db[_0xc2af('0x3c')][_0xc2af('0x69')]({'where':{'id':_0xdf2c35[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x4a940c,null))['then'](function(_0x298684){if(_0x298684){_0x4e7776[_0xc2af('0x41')]=_[_0xc2af('0x43')](db[_0xc2af('0xd3')][_0xc2af('0x3d')]);_0x4e7776['query']=_['keys'](_0xdf2c35['query']);_0x4e7776[_0xc2af('0x4d')]=_['intersection'](_0x4e7776['model'],_0x4e7776['query']);_0x4f9b58[_0xc2af('0x45')]=_[_0xc2af('0x44')](_0x4e7776[_0xc2af('0x41')],qs[_0xc2af('0x46')](_0xdf2c35[_0xc2af('0x42')][_0xc2af('0x46')]));_0x4f9b58[_0xc2af('0x45')]=_0x4f9b58[_0xc2af('0x45')][_0xc2af('0x47')]?_0x4f9b58[_0xc2af('0x45')]:_0x4e7776[_0xc2af('0x41')];if(!_0xdf2c35[_0xc2af('0x42')][_0xc2af('0x48')](_0xc2af('0x49'))){_0x4f9b58[_0xc2af('0x2f')]=qs[_0xc2af('0x2f')](_0xdf2c35[_0xc2af('0x42')][_0xc2af('0x2f')]);_0x4f9b58['offset']=qs[_0xc2af('0x2d')](_0xdf2c35['query'][_0xc2af('0x2d')]);}_0x4f9b58[_0xc2af('0x4a')]=qs[_0xc2af('0x4b')](_0xdf2c35[_0xc2af('0x42')][_0xc2af('0x4b')]);_0x4f9b58[_0xc2af('0x4c')]=qs[_0xc2af('0x4d')](_['pick'](_0xdf2c35['query'],_0x4e7776['filters']));_0x4f9b58[_0xc2af('0x4c')][_0xc2af('0x66')]=_0x298684['id'];if(_0xdf2c35[_0xc2af('0x42')]['filter']){_0x4f9b58[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0x4f9b58[_0xc2af('0x4c')],{'$or':_[_0xc2af('0x3b')](_0x4f9b58[_0xc2af('0x45')],function(_0xcdde2f){var _0xa1ce75={};_0xa1ce75[_0xcdde2f]={'$like':'%'+_0xdf2c35[_0xc2af('0x42')]['filter']+'%'};return _0xa1ce75;})});}_0x4f9b58=_[_0xc2af('0x4f')]({},_0x4f9b58,_0xdf2c35[_0xc2af('0x52')]);return db['ChatOfflineMessage'][_0xc2af('0x30')]({'where':_0x4f9b58['where']})[_0xc2af('0x21')](function(_0x239616){_0x36bb0b[_0xc2af('0x30')]=_0x239616;if(_0xdf2c35[_0xc2af('0x42')][_0xc2af('0x58')]){_0x4f9b58[_0xc2af('0x53')]=[{'all':!![]}];}else{_0x4f9b58['include']=[{'model':db[_0xc2af('0x8d')],'as':'Contact','required':![]},{'model':db[_0xc2af('0xdc')],'as':'Attachments','required':![]}];}return db[_0xc2af('0xd3')][_0xc2af('0x54')](_0x4f9b58);})[_0xc2af('0x21')](function(_0xf9bfbc){_0x36bb0b[_0xc2af('0x6a')]=_0xf9bfbc;return _0x36bb0b;});}})[_0xc2af('0x21')](respondWithFilteredResult(_0x4a940c,_0x4f9b58))[_0xc2af('0x5a')](handleError(_0x4a940c,null));};exports[_0xc2af('0x127')]=function(_0x406fe4,_0x36420d,_0x2bf29a){return db[_0xc2af('0x3c')][_0xc2af('0x59')]({'where':{'id':_0x406fe4[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x36420d,null))[_0xc2af('0x21')](function(_0x4cd1d7){if(_0x4cd1d7){return _0x4cd1d7[_0xc2af('0x127')](_0x406fe4[_0xc2af('0x5c')][_0xc2af('0x6c')],_[_0xc2af('0xf4')](_0x406fe4[_0xc2af('0x5c')],[_0xc2af('0x6c'),'id'])||{})[_0xc2af('0xce')](function(_0x4af09f){for(var _0x393a31=0x0;_0x393a31<_0x406fe4[_0xc2af('0x5c')]['ids'][_0xc2af('0x47')];_0x393a31+=0x1){socket[_0xc2af('0x128')](_0xc2af('0x129'),{'UserId':Number(_0x406fe4[_0xc2af('0x5c')][_0xc2af('0x6c')][_0x393a31]),'ChatWebsiteId':Number(_0x406fe4[_0xc2af('0x56')]['id'])});}return _0x4af09f;});}})[_0xc2af('0x21')](respondWithResult(_0x36420d,null))[_0xc2af('0x5a')](handleError(_0x36420d,null));};exports['removeAgents']=function(_0x243ba0,_0x426db0,_0x2d5158){return db['ChatWebsite'][_0xc2af('0x59')]({'where':{'id':_0x243ba0['params']['id']}})['then'](handleEntityNotFound(_0x426db0,null))['then'](function(_0x33b4f9){if(_0x33b4f9){return _0x33b4f9[_0xc2af('0x12a')](_0x243ba0[_0xc2af('0x42')][_0xc2af('0x6c')])[_0xc2af('0x21')](function(){if(_[_0xc2af('0x12b')](_0x243ba0[_0xc2af('0x42')][_0xc2af('0x6c')])){for(var _0x4ccddf=0x0;_0x4ccddf<_0x243ba0[_0xc2af('0x42')][_0xc2af('0x6c')][_0xc2af('0x47')];_0x4ccddf+=0x1){socket[_0xc2af('0x128')](_0xc2af('0x12c'),{'UserId':Number(_0x243ba0[_0xc2af('0x42')][_0xc2af('0x6c')][_0x4ccddf]),'ChatWebsiteId':Number(_0x243ba0[_0xc2af('0x56')]['id'])});}}else{socket[_0xc2af('0x128')](_0xc2af('0x12c'),{'UserId':Number(_0x243ba0['query'][_0xc2af('0x6c')]),'ChatWebsiteId':Number(_0x243ba0[_0xc2af('0x56')]['id'])});}});}})[_0xc2af('0x21')](respondWithStatusCode(_0x426db0,null))['catch'](handleError(_0x426db0,null));};exports[_0xc2af('0x12d')]=function(_0x213e20,_0x4f0db2,_0x310804){var _0x211df2={};var _0x3efce2={};var _0x5d2b75;var _0x508cc7;return db[_0xc2af('0x3c')][_0xc2af('0x69')]({'where':{'id':_0x213e20[_0xc2af('0x56')]['id']}})[_0xc2af('0x21')](handleEntityNotFound(_0x4f0db2,null))[_0xc2af('0x21')](function(_0x5088d8){if(_0x5088d8){_0x5d2b75=_0x5088d8;_0x3efce2[_0xc2af('0x41')]=_['keys'](db['User']['rawAttributes']);_0x3efce2[_0xc2af('0x42')]=_[_0xc2af('0x43')](_0x213e20['query']);_0x3efce2[_0xc2af('0x4d')]=_[_0xc2af('0x44')](_0x3efce2[_0xc2af('0x41')],_0x3efce2['query']);_0x211df2['attributes']=_[_0xc2af('0x44')](_0x3efce2['model'],qs['fields'](_0x213e20['query'][_0xc2af('0x46')]));_0x211df2['attributes']=_0x211df2['attributes'][_0xc2af('0x47')]?_0x211df2['attributes']:_0x3efce2[_0xc2af('0x41')];_0x211df2['order']=qs[_0xc2af('0x4b')](_0x213e20[_0xc2af('0x42')][_0xc2af('0x4b')]);_0x211df2[_0xc2af('0x4c')]=qs['filters'](_['pick'](_0x213e20[_0xc2af('0x42')],_0x3efce2[_0xc2af('0x4d')]));if(_0x213e20[_0xc2af('0x42')][_0xc2af('0x51')]){_0x211df2[_0xc2af('0x4c')]=_[_0xc2af('0x4f')](_0x211df2[_0xc2af('0x4c')],{'$or':_[_0xc2af('0x3b')](_0x211df2[_0xc2af('0x45')],function(_0xddd97f){var _0x5a5f25={};_0x5a5f25[_0xddd97f]={'$like':'%'+_0x213e20[_0xc2af('0x42')]['filter']+'%'};return _0x5a5f25;})});}_0x211df2=_['merge']({},_0x211df2,_0x213e20[_0xc2af('0x52')]);return _0x5d2b75[_0xc2af('0x12d')](_0x211df2);}})[_0xc2af('0x21')](function(_0x2de575){if(_0x2de575){_0x508cc7=_0x2de575[_0xc2af('0x47')];if(!_0x213e20[_0xc2af('0x42')][_0xc2af('0x48')](_0xc2af('0x49'))){_0x211df2[_0xc2af('0x2f')]=qs[_0xc2af('0x2f')](_0x213e20[_0xc2af('0x42')]['limit']);_0x211df2['offset']=qs['offset'](_0x213e20[_0xc2af('0x42')][_0xc2af('0x2d')]);}return _0x5d2b75[_0xc2af('0x12d')](_0x211df2);}})[_0xc2af('0x21')](function(_0x4256f7){if(_0x4256f7){return _0x4256f7?{'count':_0x508cc7,'rows':_0x4256f7}:null;}})[_0xc2af('0x21')](respondWithResult(_0x4f0db2,null))[_0xc2af('0x5a')](handleError(_0x4f0db2,null));};
\ No newline at end of file
+var _0xadd4=['notify','offline','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailAccount','Smtp','forwardOfflineAddress','service','host','port','authentication','pass','sendMail','email','MailAccountId','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','tag','Command','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Intervals','getProactiveActions','getLicense','virtual','custom','License','increment','chatLicenseExceeded','Interval','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','color','textColor','color_button','backgroundColor','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','end','status','json','offset','undefined','count','limit','apply','reject','save','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','filter','where','map','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','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','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','join','root','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','*,*,*,*','AttachmentId','UserId','unshift','forcedOwnership','Start','startRouting','EventManager'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0xadd4,0x6d));var _0x4add=function(_0x14997d,_0x23725b){_0x14997d=_0x14997d-0x0;var _0x2ae1e4=_0xadd4[_0x14997d];return _0x2ae1e4;};'use strict';var emlformat=require(_0x4add('0x0'));var rimraf=require(_0x4add('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4add('0x2'));var rp=require(_0x4add('0x3'));var moment=require(_0x4add('0x4'));var BPromise=require(_0x4add('0x5'));var Mustache=require(_0x4add('0x6'));var util=require(_0x4add('0x7'));var path=require(_0x4add('0x8'));var sox=require(_0x4add('0x9'));var csv=require(_0x4add('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4add('0xb'));var _=require(_0x4add('0xc'));var squel=require(_0x4add('0xd'));var crypto=require(_0x4add('0xe'));var jsforce=require(_0x4add('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4add('0xa'));var querystring=require(_0x4add('0x10'));var Papa=require(_0x4add('0x11'));var Redis=require(_0x4add('0x12'));var authService=require(_0x4add('0x13'));var qs=require(_0x4add('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4add('0x15'));var logger=require(_0x4add('0x16'))(_0x4add('0x17'));var utils=require('../../config/utils');var config=require(_0x4add('0x18'));var licenseUtil=require(_0x4add('0x19'));var db=require(_0x4add('0x1a'))['db'];config[_0x4add('0x1b')]=_[_0x4add('0x1c')](config['redis'],{'host':_0x4add('0x1d'),'port':0x18eb});var socket=require(_0x4add('0x1e'))(new Redis(config[_0x4add('0x1b')]));require('./chatWebsite.socket')[_0x4add('0x1f')](socket);var jayson=require(_0x4add('0x20'));var client=jayson['client'][_0x4add('0x21')]({'port':0x232c});var client9002=jayson[_0x4add('0x22')][_0x4add('0x21')]({'port':0x232a});var client9003=jayson[_0x4add('0x22')][_0x4add('0x21')]({'port':0x232b});var client9001=jayson[_0x4add('0x22')][_0x4add('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x3c503f,_0x270ecd,_0x154f02,_0x5361b4){return new BPromise(function(_0x5ada18,_0x3ba57){var _0x392d0c=_0x5361b4||client;return _0x392d0c['request'](_0x3c503f,_0x154f02)[_0x4add('0x23')](function(_0xa9a9df){logger[_0x4add('0x24')](_0x4add('0x25'),_0x270ecd,_0x4add('0x26'));logger[_0x4add('0x27')](_0x4add('0x28'),_0x270ecd,_0x4add('0x26'),JSON['stringify'](_0xa9a9df));if(_0xa9a9df[_0x4add('0x29')]){if(_0xa9a9df[_0x4add('0x29')]['code']===0x1f4){logger[_0x4add('0x29')](_0x4add('0x25'),_0x270ecd,_0xa9a9df[_0x4add('0x29')][_0x4add('0x2a')]);return _0x3ba57(_0xa9a9df[_0x4add('0x29')][_0x4add('0x2a')]);}logger['error'](_0x4add('0x25'),_0x270ecd,_0xa9a9df[_0x4add('0x29')][_0x4add('0x2a')]);return _0x5ada18(_0xa9a9df[_0x4add('0x29')][_0x4add('0x2a')]);}else{logger[_0x4add('0x24')](_0x4add('0x25'),_0x270ecd,_0x4add('0x26'));_0x5ada18(_0xa9a9df[_0x4add('0x2b')]['message']);}})['catch'](function(_0x18d5bb){logger[_0x4add('0x29')](_0x4add('0x25'),_0x270ecd,_0x18d5bb);_0x3ba57(_0x18d5bb);});});}function respondWithStatusCode(_0x1d2ab4,_0x13ef8e){_0x13ef8e=_0x13ef8e||0xcc;return function(_0x3edebe){if(_0x3edebe){return _0x1d2ab4['sendStatus'](_0x13ef8e);}return _0x1d2ab4['status'](_0x13ef8e)[_0x4add('0x2c')]();};}function respondWithResult(_0x4103e2,_0x499578){_0x499578=_0x499578||0xc8;return function(_0x370a22){if(_0x370a22){return _0x4103e2[_0x4add('0x2d')](_0x499578)[_0x4add('0x2e')](_0x370a22);}};}function respondWithFilteredResult(_0x2be470,_0x576a0d){return function(_0x1b9d46){if(_0x1b9d46){var _0x39f28f=typeof _0x576a0d[_0x4add('0x2f')]===_0x4add('0x30')&&typeof _0x576a0d['limit']===_0x4add('0x30');var _0x1d4351=_0x1b9d46[_0x4add('0x31')];var _0x450248=_0x39f28f?0x0:_0x576a0d[_0x4add('0x2f')];var _0x42b49d=_0x39f28f?_0x1b9d46[_0x4add('0x31')]:_0x576a0d[_0x4add('0x2f')]+_0x576a0d[_0x4add('0x32')];var _0x3d61cd;if(_0x42b49d>=_0x1d4351){_0x42b49d=_0x1d4351;_0x3d61cd=0xc8;}else{_0x3d61cd=0xce;}_0x2be470[_0x4add('0x2d')](_0x3d61cd);return _0x2be470['set']('Content-Range',_0x450248+'-'+_0x42b49d+'/'+_0x1d4351)[_0x4add('0x2e')](_0x1b9d46);}return null;};}function patchUpdates(_0x3933c7){return function(_0x3ba2d6){try{jsonpatch[_0x4add('0x33')](_0x3ba2d6,_0x3933c7,!![]);}catch(_0x4622da){return BPromise[_0x4add('0x34')](_0x4622da);}return _0x3ba2d6[_0x4add('0x35')]();};}function saveUpdates(_0x229f00,_0x34062b){return function(_0x55f73b){if(_0x55f73b){return _0x55f73b['update'](_0x229f00)['then'](function(_0x3a64a5){return _0x3a64a5;});}return null;};}function removeEntity(_0x1547cb,_0x21edc8){return function(_0x2c40f5){if(_0x2c40f5){return _0x2c40f5[_0x4add('0x36')]()[_0x4add('0x23')](function(){var _0x331fbb=_0x2c40f5[_0x4add('0x37')]({'plain':!![]});var _0x54f9d6=_0x4add('0x38');return db[_0x4add('0x39')]['destroy']({'where':{'type':_0x54f9d6,'resourceId':_0x331fbb['id']}})[_0x4add('0x23')](function(){return _0x2c40f5;});})['then'](function(){_0x1547cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf3f6cf,_0x297647){return function(_0x1c0316){if(!_0x1c0316){_0xf3f6cf['sendStatus'](0x194);}return _0x1c0316;};}function handleError(_0x22354e,_0x18a35c){_0x18a35c=_0x18a35c||0x1f4;return function(_0x5c851f){logger[_0x4add('0x29')](_0x5c851f[_0x4add('0x3a')]);if(_0x5c851f[_0x4add('0x3b')]){delete _0x5c851f[_0x4add('0x3b')];}_0x22354e[_0x4add('0x2d')](_0x18a35c)[_0x4add('0x3c')](_0x5c851f);};}exports[_0x4add('0x3d')]=function(_0x648350,_0x2bc14d){var _0x1a7d7a={'include':[{'model':db[_0x4add('0x3e')],'as':'mandatoryDispositionPause'}]},_0x54eea2={},_0x29ab30={'count':0x0,'rows':[]};var _0x48a567=_['map'](db[_0x4add('0x3f')][_0x4add('0x40')],function(_0x25c2a3){return{'name':_0x25c2a3[_0x4add('0x41')],'type':_0x25c2a3[_0x4add('0x42')][_0x4add('0x43')]};});_0x54eea2[_0x4add('0x44')]=_['map'](_0x48a567,'name');_0x54eea2['query']=_[_0x4add('0x45')](_0x648350[_0x4add('0x46')]);_0x54eea2[_0x4add('0x47')]=_['intersection'](_0x54eea2[_0x4add('0x44')],_0x54eea2[_0x4add('0x46')]);_0x1a7d7a['attributes']=_[_0x4add('0x48')](_0x54eea2[_0x4add('0x44')],qs[_0x4add('0x49')](_0x648350['query']['fields']));_0x1a7d7a[_0x4add('0x4a')]=_0x1a7d7a[_0x4add('0x4a')]['length']?_0x1a7d7a[_0x4add('0x4a')]:_0x54eea2[_0x4add('0x44')];if(!_0x648350['query']['hasOwnProperty'](_0x4add('0x4b'))){_0x1a7d7a[_0x4add('0x32')]=qs[_0x4add('0x32')](_0x648350[_0x4add('0x46')][_0x4add('0x32')]);_0x1a7d7a[_0x4add('0x2f')]=qs[_0x4add('0x2f')](_0x648350[_0x4add('0x46')]['offset']);}_0x1a7d7a['order']=qs[_0x4add('0x4c')](_0x648350[_0x4add('0x46')][_0x4add('0x4c')]);_0x1a7d7a['where']=qs[_0x4add('0x47')](_['pick'](_0x648350[_0x4add('0x46')],_0x54eea2[_0x4add('0x47')]),_0x48a567);if(_0x648350[_0x4add('0x46')][_0x4add('0x4d')]){_0x1a7d7a[_0x4add('0x4e')]=_['merge'](_0x1a7d7a[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x48a567,function(_0x496272){if(_0x496272[_0x4add('0x42')]!==_0x4add('0x50')){var _0x4fcdf5={};_0x4fcdf5[_0x496272['name']]={'$like':'%'+_0x648350[_0x4add('0x46')][_0x4add('0x4d')]+'%'};return _0x4fcdf5;}})});}_0x1a7d7a=_[_0x4add('0x51')]({},_0x1a7d7a,_0x648350[_0x4add('0x52')]);var _0x5ef35c={'where':_0x1a7d7a[_0x4add('0x4e')]};return db[_0x4add('0x3f')][_0x4add('0x31')](_0x5ef35c)[_0x4add('0x23')](function(_0x396322){_0x29ab30[_0x4add('0x31')]=_0x396322;if(_0x648350[_0x4add('0x46')][_0x4add('0x53')]){_0x1a7d7a[_0x4add('0x54')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4add('0x55')](_0x1a7d7a);})['then'](function(_0x1b01b3){_0x29ab30['rows']=_0x1b01b3;return _0x29ab30;})[_0x4add('0x23')](respondWithFilteredResult(_0x2bc14d,_0x1a7d7a))['catch'](handleError(_0x2bc14d,null));};exports[_0x4add('0x56')]=function(_0x13a9e7,_0x1d05f0){var _0x17e67c={'raw':![],'where':{'id':_0x13a9e7[_0x4add('0x57')]['id']},'include':[{'model':db[_0x4add('0x3e')],'as':'mandatoryDispositionPause'}]},_0x1db69f={};_0x1db69f[_0x4add('0x44')]=_[_0x4add('0x45')](db[_0x4add('0x3f')][_0x4add('0x40')]);_0x1db69f[_0x4add('0x46')]=_[_0x4add('0x45')](_0x13a9e7[_0x4add('0x46')]);_0x1db69f[_0x4add('0x47')]=_['intersection'](_0x1db69f['model'],_0x1db69f[_0x4add('0x46')]);_0x17e67c[_0x4add('0x4a')]=_[_0x4add('0x48')](_0x1db69f[_0x4add('0x44')],qs['fields'](_0x13a9e7[_0x4add('0x46')][_0x4add('0x49')]));_0x17e67c[_0x4add('0x4a')]=_0x17e67c[_0x4add('0x4a')][_0x4add('0x58')]?_0x17e67c[_0x4add('0x4a')]:_0x1db69f[_0x4add('0x44')];if(_0x13a9e7[_0x4add('0x46')][_0x4add('0x53')]){_0x17e67c[_0x4add('0x54')]=[{'all':!![]}];}_0x17e67c=_[_0x4add('0x51')]({},_0x17e67c,_0x13a9e7[_0x4add('0x52')]);return db[_0x4add('0x3f')][_0x4add('0x59')](_0x17e67c)[_0x4add('0x23')](handleEntityNotFound(_0x1d05f0,null))[_0x4add('0x23')](respondWithResult(_0x1d05f0,null))[_0x4add('0x5a')](handleError(_0x1d05f0,null));};exports[_0x4add('0x5b')]=function(_0x47935b,_0x2fad3e){return db[_0x4add('0x3f')][_0x4add('0x5b')](_0x47935b[_0x4add('0x5c')],{})['then'](function(_0x8b41a6){var _0x36dff9=_0x47935b[_0x4add('0x5d')][_0x4add('0x37')]({'plain':!![]});if(!_0x36dff9)throw new Error(_0x4add('0x5e'));if(_0x36dff9[_0x4add('0x5f')]==='user'){var _0x4c8818=_0x8b41a6[_0x4add('0x37')]({'plain':!![]});var _0x519203=_0x4add('0x38');return db[_0x4add('0x60')][_0x4add('0x59')]({'where':{'name':_0x519203,'userProfileId':_0x36dff9[_0x4add('0x61')]},'raw':!![]})[_0x4add('0x23')](function(_0x2e2ab3){if(_0x2e2ab3&&_0x2e2ab3[_0x4add('0x62')]===0x0){return db[_0x4add('0x39')][_0x4add('0x5b')]({'name':_0x4c8818[_0x4add('0x3b')],'resourceId':_0x4c8818['id'],'type':_0x2e2ab3[_0x4add('0x3b')],'sectionId':_0x2e2ab3['id']},{})[_0x4add('0x23')](function(){return _0x8b41a6;});}else{return _0x8b41a6;}})[_0x4add('0x5a')](function(_0x1d87d7){logger[_0x4add('0x29')](_0x4add('0x63'),_0x1d87d7);throw _0x1d87d7;});}return _0x8b41a6;})[_0x4add('0x23')](respondWithResult(_0x2fad3e,0xc9))[_0x4add('0x5a')](handleError(_0x2fad3e,null));};exports[_0x4add('0x64')]=function(_0x2753b3,_0x44ad90){if(_0x2753b3['body']['id']){delete _0x2753b3['body']['id'];}return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x2753b3['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x44ad90,null))[_0x4add('0x23')](saveUpdates(_0x2753b3[_0x4add('0x5c')],null))[_0x4add('0x23')](respondWithResult(_0x44ad90,null))[_0x4add('0x5a')](handleError(_0x44ad90,null));};exports['destroy']=function(_0xba682,_0x39143b){return db[_0x4add('0x3f')]['find']({'where':{'id':_0xba682[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x39143b,null))['then'](removeEntity(_0x39143b,null))[_0x4add('0x5a')](handleError(_0x39143b,null));};exports[_0x4add('0x65')]=function(_0xa8da51,_0x4a66f6){return db[_0x4add('0x3f')]['describe']()['then'](respondWithResult(_0x4a66f6,null))[_0x4add('0x5a')](handleError(_0x4a66f6,null));};exports[_0x4add('0x66')]=function(_0x3cb710,_0x5b326f,_0x2b8e71){if(_0x3cb710[_0x4add('0x5c')]['id']){delete _0x3cb710[_0x4add('0x5c')]['id'];}return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x3cb710[_0x4add('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b326f,null))['then'](function(_0x563a09){if(_0x563a09){_0x3cb710[_0x4add('0x5c')][_0x4add('0x67')]=_0x563a09['id'];return db[_0x4add('0x68')][_0x4add('0x5b')](_0x3cb710[_0x4add('0x5c')]);}})[_0x4add('0x23')](respondWithResult(_0x5b326f,null))[_0x4add('0x5a')](handleError(_0x5b326f,null));};exports[_0x4add('0x69')]=function(_0x2b7614,_0x3e8c3c,_0x268d2d){var _0x25d7f0={'raw':![],'where':{}};var _0x5771b2={};var _0xf96746={'count':0x0,'rows':[]};return db[_0x4add('0x3f')][_0x4add('0x6a')]({'where':{'id':_0x2b7614['params']['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x3e8c3c,null))[_0x4add('0x23')](function(_0x4ad22b){if(_0x4ad22b){_0x5771b2['model']=_[_0x4add('0x45')](db[_0x4add('0x68')][_0x4add('0x40')]);_0x5771b2[_0x4add('0x46')]=_[_0x4add('0x45')](_0x2b7614['query']);_0x5771b2[_0x4add('0x47')]=_[_0x4add('0x48')](_0x5771b2[_0x4add('0x44')],_0x5771b2['query']);_0x25d7f0[_0x4add('0x4a')]=_['intersection'](_0x5771b2[_0x4add('0x44')],qs['fields'](_0x2b7614[_0x4add('0x46')][_0x4add('0x49')]));_0x25d7f0[_0x4add('0x4a')]=_0x25d7f0[_0x4add('0x4a')]['length']?_0x25d7f0['attributes']:_0x5771b2[_0x4add('0x44')];if(!_0x2b7614[_0x4add('0x46')][_0x4add('0x6b')](_0x4add('0x4b'))){_0x25d7f0[_0x4add('0x32')]=qs['limit'](_0x2b7614[_0x4add('0x46')][_0x4add('0x32')]);_0x25d7f0[_0x4add('0x2f')]=qs['offset'](_0x2b7614[_0x4add('0x46')][_0x4add('0x2f')]);}_0x25d7f0[_0x4add('0x6c')]=qs[_0x4add('0x4c')](_0x2b7614[_0x4add('0x46')][_0x4add('0x4c')]);_0x25d7f0[_0x4add('0x4e')]=qs[_0x4add('0x47')](_[_0x4add('0x6d')](_0x2b7614[_0x4add('0x46')],_0x5771b2[_0x4add('0x47')]));_0x25d7f0['where'][_0x4add('0x67')]=_0x4ad22b['id'];if(_0x2b7614[_0x4add('0x46')][_0x4add('0x4d')]){_0x25d7f0['where']=_['merge'](_0x25d7f0[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x25d7f0[_0x4add('0x4a')],function(_0x5acb8f){var _0x13c4bd={};_0x13c4bd[_0x5acb8f]={'$like':'%'+_0x2b7614[_0x4add('0x46')][_0x4add('0x4d')]+'%'};return _0x13c4bd;})});}_0x25d7f0=_[_0x4add('0x51')]({},_0x25d7f0,_0x2b7614['options']);return db[_0x4add('0x68')][_0x4add('0x31')]({'where':_0x25d7f0[_0x4add('0x4e')]})[_0x4add('0x23')](function(_0x38e706){_0xf96746[_0x4add('0x31')]=_0x38e706;if(_0x2b7614[_0x4add('0x46')][_0x4add('0x53')]){_0x25d7f0[_0x4add('0x54')]=[{'all':!![]}];}return db[_0x4add('0x68')][_0x4add('0x55')](_0x25d7f0);})[_0x4add('0x23')](function(_0x48e7a9){_0xf96746['rows']=_0x48e7a9;return _0xf96746;});}})[_0x4add('0x23')](respondWithFilteredResult(_0x3e8c3c,_0x25d7f0))[_0x4add('0x5a')](handleError(_0x3e8c3c,null));};exports[_0x4add('0x6e')]=function(_0x52cefc,_0x9ea819,_0x429164){return db[_0x4add('0x3f')]['find']({'where':{'id':_0x52cefc['params']['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x9ea819,null))[_0x4add('0x23')](function(_0x24855b){if(_0x24855b){return _0x24855b[_0x4add('0x6e')](_0x52cefc['query']['ids']);}})[_0x4add('0x23')](respondWithStatusCode(_0x9ea819,null))[_0x4add('0x5a')](handleError(_0x9ea819,null));};exports[_0x4add('0x6f')]=function(_0x14a31b,_0x504f45,_0x493591){if(_0x14a31b[_0x4add('0x5c')]['id']){delete _0x14a31b[_0x4add('0x5c')]['id'];}return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x14a31b['params']['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x504f45,null))[_0x4add('0x23')](function(_0x578a9a){if(_0x578a9a){_0x14a31b['body'][_0x4add('0x67')]=_0x578a9a['id'];return db[_0x4add('0x70')][_0x4add('0x5b')](_0x14a31b[_0x4add('0x5c')]);}})[_0x4add('0x23')](respondWithResult(_0x504f45,null))[_0x4add('0x5a')](handleError(_0x504f45,null));};exports[_0x4add('0x71')]=function(_0x24297e,_0x15ac76,_0x2dede6){var _0x244104={'raw':![],'where':{}};var _0x44364d={};var _0x42a102={'count':0x0,'rows':[]};return db[_0x4add('0x3f')][_0x4add('0x6a')]({'where':{'id':_0x24297e['params']['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x15ac76,null))[_0x4add('0x23')](function(_0x1fe271){if(_0x1fe271){_0x44364d['model']=_[_0x4add('0x45')](db[_0x4add('0x70')][_0x4add('0x40')]);_0x44364d[_0x4add('0x46')]=_[_0x4add('0x45')](_0x24297e[_0x4add('0x46')]);_0x44364d[_0x4add('0x47')]=_[_0x4add('0x48')](_0x44364d[_0x4add('0x44')],_0x44364d[_0x4add('0x46')]);_0x244104[_0x4add('0x4a')]=_[_0x4add('0x48')](_0x44364d['model'],qs[_0x4add('0x49')](_0x24297e[_0x4add('0x46')][_0x4add('0x49')]));_0x244104[_0x4add('0x4a')]=_0x244104[_0x4add('0x4a')][_0x4add('0x58')]?_0x244104[_0x4add('0x4a')]:_0x44364d[_0x4add('0x44')];if(!_0x24297e[_0x4add('0x46')][_0x4add('0x6b')](_0x4add('0x4b'))){_0x244104[_0x4add('0x32')]=qs[_0x4add('0x32')](_0x24297e[_0x4add('0x46')][_0x4add('0x32')]);_0x244104['offset']=qs[_0x4add('0x2f')](_0x24297e[_0x4add('0x46')][_0x4add('0x2f')]);}_0x244104['order']=qs['sort'](_0x24297e['query'][_0x4add('0x4c')]);_0x244104[_0x4add('0x4e')]=qs[_0x4add('0x47')](_[_0x4add('0x6d')](_0x24297e[_0x4add('0x46')],_0x44364d[_0x4add('0x47')]));_0x244104[_0x4add('0x4e')]['ChatWebsiteId']=_0x1fe271['id'];if(_0x24297e[_0x4add('0x46')][_0x4add('0x4d')]){_0x244104[_0x4add('0x4e')]=_[_0x4add('0x51')](_0x244104[_0x4add('0x4e')],{'$or':_['map'](_0x244104[_0x4add('0x4a')],function(_0xa7bee){var _0x4a15f4={};_0x4a15f4[_0xa7bee]={'$like':'%'+_0x24297e[_0x4add('0x46')][_0x4add('0x4d')]+'%'};return _0x4a15f4;})});}_0x244104=_[_0x4add('0x51')]({},_0x244104,_0x24297e[_0x4add('0x52')]);return db['CannedAnswer'][_0x4add('0x31')]({'where':_0x244104[_0x4add('0x4e')]})['then'](function(_0x1a6ecb){_0x42a102[_0x4add('0x31')]=_0x1a6ecb;if(_0x24297e[_0x4add('0x46')]['includeAll']){_0x244104['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x244104);})[_0x4add('0x23')](function(_0x582993){_0x42a102[_0x4add('0x72')]=_0x582993;return _0x42a102;});}})[_0x4add('0x23')](respondWithFilteredResult(_0x15ac76,_0x244104))[_0x4add('0x5a')](handleError(_0x15ac76,null));};exports['removeAnswers']=function(_0x5c9110,_0x2e46a8,_0x5f046c){return db[_0x4add('0x3f')]['find']({'where':{'id':_0x5c9110[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x2e46a8,null))[_0x4add('0x23')](function(_0x4fba48){if(_0x4fba48){return _0x4fba48[_0x4add('0x73')](_0x5c9110[_0x4add('0x46')]['ids']);}})[_0x4add('0x23')](respondWithStatusCode(_0x2e46a8,null))[_0x4add('0x5a')](handleError(_0x2e46a8,null));};exports[_0x4add('0x74')]=function(_0x220632,_0x1e3ca3,_0x438365){_0x220632[_0x4add('0x5c')][_0x4add('0x75')]=_0x220632[_0x4add('0x76')][_0x4add('0x77')];return db['ChatWebsite'][_0x4add('0x59')]({'where':{'id':_0x220632[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x1e3ca3,null))[_0x4add('0x23')](saveUpdates(_0x220632[_0x4add('0x5c')],null))[_0x4add('0x23')](respondWithResult(_0x1e3ca3,null))['catch'](handleError(_0x1e3ca3,null));};exports[_0x4add('0x78')]=function(_0x1a6c64,_0x14cf44,_0x11805c){_0x1a6c64[_0x4add('0x5c')][_0x4add('0x79')]=_0x1a6c64[_0x4add('0x76')][_0x4add('0x77')];return db[_0x4add('0x3f')]['find']({'where':{'id':_0x1a6c64[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x14cf44,null))[_0x4add('0x23')](saveUpdates(_0x1a6c64['body'],null))['then'](respondWithResult(_0x14cf44,null))['catch'](handleError(_0x14cf44,null));};exports[_0x4add('0x7a')]=function(_0xdd5fd2,_0x20e812,_0x20771b){_0xdd5fd2[_0x4add('0x5c')][_0x4add('0x7b')]=_0xdd5fd2[_0x4add('0x76')][_0x4add('0x77')];return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0xdd5fd2[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x20e812,null))[_0x4add('0x23')](saveUpdates(_0xdd5fd2[_0x4add('0x5c')],null))['then'](respondWithResult(_0x20e812,null))['catch'](handleError(_0x20e812,null));};exports['addSystemAvatar']=function(_0x204219,_0x1b5350,_0x2c856e){_0x204219['body'][_0x4add('0x7c')]=_0x204219[_0x4add('0x76')][_0x4add('0x77')];return db['ChatWebsite'][_0x4add('0x59')]({'where':{'id':_0x204219[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x1b5350,null))[_0x4add('0x23')](saveUpdates(_0x204219['body'],null))[_0x4add('0x23')](respondWithResult(_0x1b5350,null))[_0x4add('0x5a')](handleError(_0x1b5350,null));};exports['getLogo']=function(_0x3d1153,_0x2dc1fa,_0x22eefa){var _0x517df8=path[_0x4add('0x7d')](config[_0x4add('0x7e')],'server/files/images/logos/default_logo.svg');var _0x3c84d1={'where':{'id':_0x3d1153[_0x4add('0x57')]['id']},'attributes':['id',_0x4add('0x75')],'raw':!![]};var _0x10085c=![];return require(_0x4add('0x19'))['getLicense']()[_0x4add('0x23')](function(_0x561673){if(_0x561673){_0x10085c=_0x561673['custom'];}})[_0x4add('0x23')](function(){return db[_0x4add('0x3f')][_0x4add('0x59')](_0x3c84d1);})[_0x4add('0x23')](handleEntityNotFound(_0x2dc1fa,null))[_0x4add('0x23')](function(_0xaf9864){if(_0xaf9864){if(!_[_0x4add('0x7f')](_0xaf9864[_0x4add('0x75')])){if(fs[_0x4add('0x80')](path[_0x4add('0x7d')](config[_0x4add('0x7e')],'server/files/images/logos/',_0xaf9864[_0x4add('0x75')]))&&_0x10085c){_0x517df8=path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0x81'),_0xaf9864['sitepic']);}}return _0x2dc1fa[_0x4add('0x82')](_0x517df8);}})['catch'](handleError(_0x2dc1fa,null));};exports[_0x4add('0x83')]=function(_0x373fb9,_0x4b9871,_0x1a1969){var _0x104b70=path[_0x4add('0x7d')](config[_0x4add('0x7e')],'server/files/images/avatars/default_avatar.png');var _0xb0838a={'where':{'id':_0x373fb9[_0x4add('0x57')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x4add('0x59')](_0xb0838a)[_0x4add('0x23')](handleEntityNotFound(_0x4b9871,null))['then'](function(_0x42dc62){if(_0x42dc62){if(!_[_0x4add('0x7f')](_0x42dc62[_0x4add('0x79')])){if(fs['existsSync'](path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0x84'),_0x42dc62[_0x4add('0x79')]))){_0x104b70=path['join'](config[_0x4add('0x7e')],_0x4add('0x84'),_0x42dc62[_0x4add('0x79')]);}}return _0x4b9871[_0x4add('0x82')](_0x104b70);}})[_0x4add('0x5a')](handleError(_0x4b9871,null));};exports[_0x4add('0x85')]=function(_0x4d4349,_0x11f438,_0xad69ac){var _0x239598=path['join'](config[_0x4add('0x7e')],'server/files/images/avatars/customer_avatar.png');var _0x585100={'where':{'id':_0x4d4349['params']['id']},'attributes':['id','customerAvatar',_0x4add('0x86')],'raw':!![]};return db[_0x4add('0x3f')][_0x4add('0x59')](_0x585100)[_0x4add('0x23')](handleEntityNotFound(_0x11f438,null))[_0x4add('0x23')](function(_0x2af3c3){if(_0x2af3c3){if(!_[_0x4add('0x7f')](_0x2af3c3['customerAvatar'])){if(fs[_0x4add('0x80')](path[_0x4add('0x7d')](config[_0x4add('0x7e')],'server/files/images/avatars/',_0x2af3c3[_0x4add('0x7b')]))&&_0x2af3c3['showCustomerAvatar']){_0x239598=path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0x84'),_0x2af3c3['customerAvatar']);}}return _0x11f438[_0x4add('0x82')](_0x239598);}})['catch'](handleError(_0x11f438,null));};exports[_0x4add('0x87')]=function(_0x3ad71d,_0x39edb5,_0x38c586){var _0x339415=path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0x88'));var _0x385229={'where':{'id':_0x3ad71d[_0x4add('0x57')]['id']},'attributes':['id',_0x4add('0x7c')],'raw':!![]};return db[_0x4add('0x3f')]['find'](_0x385229)[_0x4add('0x23')](handleEntityNotFound(_0x39edb5,null))[_0x4add('0x23')](function(_0xf67285){if(_0xf67285){if(!_[_0x4add('0x7f')](_0xf67285[_0x4add('0x7c')])){if(fs[_0x4add('0x80')](path[_0x4add('0x7d')](config[_0x4add('0x7e')],'server/files/images/avatars/',_0xf67285[_0x4add('0x7c')]))){_0x339415=path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0x84'),_0xf67285[_0x4add('0x7c')]);}}return _0x39edb5[_0x4add('0x82')](_0x339415);}})[_0x4add('0x5a')](handleError(_0x39edb5,null));};exports['notify']=function(_0x38dec5,_0x1cbe43,_0x2c891b){var _0x3e0b24=require('user-agent-parser');var _0x2152c9=new _0x3e0b24();var _0x995697=_0x2152c9[_0x4add('0x89')](_0x38dec5[_0x4add('0x8a')][_0x4add('0x8b')])[_0x4add('0x8c')]();var _0x5a0150={'body':_0x38dec5['body'],'channel':_0x4add('0x8d')};var _0x168dfe=[];var _0x5cc9bc=[];var _0x331c40={};var _0x3969c9=![];return db[_0x4add('0x8e')][_0x4add('0x65')]()[_0x4add('0x23')](function(_0x439e9c){if(!_0x439e9c){throw new db[(_0x4add('0x8f'))][(_0x4add('0x90'))]('no\x20available\x20attributes');}_0x168dfe=_[_0x4add('0x91')](_['keys'](_0x439e9c),[_0x4add('0x92'),_0x4add('0x93')]);_0x5cc9bc=_[_0x4add('0x91')](_[_0x4add('0x45')](_0x439e9c),['createdAt',_0x4add('0x93'),_0x4add('0x94'),_0x4add('0x95')]);if(_0x38dec5['body']['id']){delete _0x38dec5['body']['id'];}if(_[_0x4add('0x7f')](_0x38dec5['body'][_0x4add('0x96')])){throw new db[(_0x4add('0x8f'))]['ValidationError'](_0x4add('0x97'));}if(_[_0x4add('0x7f')](_0x38dec5['body']['body'])||_0x38dec5[_0x4add('0x5c')][_0x4add('0x5c')]===''){throw new db[(_0x4add('0x8f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4add('0x7f')](_0x38dec5[_0x4add('0x5c')][_0x4add('0x98')])){throw new db[(_0x4add('0x8f'))]['ValidationError'](_0x4add('0x99')+_0x5cc9bc);}if(!_[_0x4add('0x9a')](_0x5cc9bc,_0x38dec5['body'][_0x4add('0x98')])){throw new db['Sequelize'][(_0x4add('0x90'))](_0x4add('0x9b')+_0x5cc9bc);}_0x331c40[_0x38dec5[_0x4add('0x5c')][_0x4add('0x98')]]=_0x38dec5['body'][_0x4add('0x96')];})[_0x4add('0x23')](function(){return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x38dec5['params']['id']},'include':[{'model':db[_0x4add('0x9c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4add('0x9d'),'where':_0x331c40,'limit':0x1,'order':[['updatedAt',_0x4add('0x9e')]]}]},{'model':db[_0x4add('0x9f')],'as':_0x4add('0xa0')}]});})[_0x4add('0x23')](handleEntityNotFound(_0x1cbe43,null))[_0x4add('0x23')](function(_0x19b573){if(_0x19b573&&_0x19b573[_0x4add('0xa1')]){_0x5a0150[_0x4add('0xa2')]=_0x19b573;_0x5a0150[_0x4add('0xa3')]=_0x19b573[_0x4add('0xa0')];_0x5a0150[_0x4add('0xa4')]=_0x19b573['List'];_0x5a0150['applications']=_['orderBy'](_0x5a0150['applications'],['priority'],['asc']);if(_0x5a0150[_0x4add('0xa2')][_0x4add('0xa0')]){delete _0x5a0150[_0x4add('0xa2')][_0x4add('0xa0')];}if(_0x5a0150[_0x4add('0xa2')]['List']&&_0x5a0150[_0x4add('0xa2')][_0x4add('0xa1')][_0x4add('0x9d')][_0x4add('0x58')]){return _0x5a0150['account'][_0x4add('0xa1')][_0x4add('0x9d')][0x0];}var _0x25706c=_[_0x4add('0x1c')](_0x38dec5[_0x4add('0x5c')],{'firstName':_0x38dec5['body'][_0x4add('0x96')],'ListId':_0x19b573[_0x4add('0x95')]});_0x25706c[_0x38dec5['body'][_0x4add('0x98')]]=_0x38dec5[_0x4add('0x5c')][_0x4add('0x96')];return db[_0x4add('0x8e')][_0x4add('0x5b')](_0x25706c,{'fields':_0x168dfe,'raw':!![]});}})[_0x4add('0x23')](handleEntityNotFound(_0x1cbe43,null))[_0x4add('0x23')](function(_0x19f08d){_0x5a0150['contact']=_0x19f08d;var _0x14d282=_0x38dec5[_0x4add('0x5c')][_0x4add('0xa5')];if(_0x38dec5[_0x4add('0x8a')]['cf-connecting-ip']){_0x14d282=_0x38dec5[_0x4add('0x8a')][_0x4add('0xa6')];}else if(_0x38dec5['headers']['x-forwarded-for']){_0x14d282=_[_0x4add('0xa7')](_0x38dec5['headers'][_0x4add('0xa8')][_0x4add('0xa9')](','));}if(_0x19f08d){var _0x574b8d={'ContactId':_0x19f08d['id'],'ChatWebsiteId':_0x38dec5[_0x4add('0x57')]['id'],'from':(_0x19f08d[_0x4add('0xaa')]||'')+'\x20'+(_0x19f08d[_0x4add('0xab')]||''),'customerIp':_0x14d282,'customerPort':_0x38dec5['headers'][_0x4add('0xac')]?_0x38dec5[_0x4add('0x8a')][_0x4add('0xac')]:null,'referer':_0x38dec5[_0x4add('0x5c')]['referer'],'browserName':_0x995697[_0x4add('0xad')]['name']&&_0x995697[_0x4add('0xad')][_0x4add('0xae')]?util[_0x4add('0xaf')](_0x4add('0xb0'),_0x995697[_0x4add('0xad')][_0x4add('0x3b')],_0x995697['browser'][_0x4add('0xae')]):_0x4add('0xb1'),'browserVersion':_0x995697['browser'][_0x4add('0xae')]||_0x4add('0xb1'),'osName':util[_0x4add('0xaf')]('%s\x20%s',_0x995697['os'][_0x4add('0x3b')],_0x995697['os'][_0x4add('0xae')]),'osVersion':_0x995697['os']['version'],'deviceModel':_0x995697[_0x4add('0xb2')][_0x4add('0x44')]&&_0x995697[_0x4add('0xb2')][_0x4add('0xb3')]?util['format'](_0x4add('0xb4'),_0x995697[_0x4add('0xb2')][_0x4add('0x44')],_0x995697[_0x4add('0xb2')][_0x4add('0xb3')],_0x995697[_0x4add('0xb2')]['type']):null,'deviceVendor':_0x995697[_0x4add('0xb2')]['vendor'],'deviceType':_0x995697[_0x4add('0xb2')][_0x4add('0x42')],'formData':JSON[_0x4add('0xb5')](_0x38dec5['body'])};var _0x51d1d0={'ChatWebsiteId':_0x38dec5['params']['id'],'closed':![]};if(_0x38dec5[_0x4add('0x5c')][_0x4add('0xb6')]){_0x51d1d0['threadId']=_0x38dec5[_0x4add('0x5c')]['threadId'];return db[_0x4add('0xb7')]['find']({'where':_0x51d1d0})['then'](function(_0x339e28){if(_0x339e28){return[_0x339e28,![]];}_0x574b8d[_0x4add('0xb6')]=_0x38dec5[_0x4add('0x5c')][_0x4add('0xb6')];_0x574b8d[_0x4add('0xb8')]=_0x38dec5[_0x4add('0x5c')][_0x4add('0xb8')];return db[_0x4add('0xb7')][_0x4add('0x5b')](_0x574b8d)['then'](function(_0x58b10c){return[_0x58b10c,!![]];});});}_0x51d1d0[_0x4add('0xb9')]=_0x19f08d['id'];if(_0x38dec5[_0x4add('0x5c')]['interaction']&&_0x38dec5[_0x4add('0x5c')]['interaction']['id']){_0x51d1d0['id']=_0x38dec5['body'][_0x4add('0xba')]['id'];return db[_0x4add('0xb7')][_0x4add('0x59')]({'where':_0x51d1d0})[_0x4add('0x23')](function(_0x35bc1e){if(_0x35bc1e){return[_0x35bc1e,![]];}return db[_0x4add('0xb7')][_0x4add('0x5b')](_0x574b8d)[_0x4add('0x23')](function(_0x493cde){return[_0x493cde,!![]];});});}return db[_0x4add('0xb7')][_0x4add('0x5b')](_0x574b8d)[_0x4add('0x23')](function(_0x17d409){return[_0x17d409,!![]];});}})[_0x4add('0xbb')](function(_0x4619cc,_0x2019c9){if(_0x4619cc){_0x3969c9=_0x2019c9;if(!_0x2019c9){var _0x2f2649={'from':(_0x5a0150[_0x4add('0xbc')]['firstName']||'')+'\x20'+(_0x5a0150['contact'][_0x4add('0xab')]||'')};if(_0x38dec5[_0x4add('0x5c')][_0x4add('0xb6')]&&_0x38dec5['body'][_0x4add('0xbd')]&&_0x38dec5[_0x4add('0x5c')][_0x4add('0xb6')]!=_0x38dec5[_0x4add('0x5c')][_0x4add('0xbd')]){_0x2f2649['threadId']=_0x38dec5[_0x4add('0x5c')][_0x4add('0xbd')];}return _0x4619cc['update'](_0x2f2649);}else{return _0x4619cc;}}})['then'](function(_0x44953a){_0x5a0150[_0x4add('0xba')]=_0x44953a[_0x4add('0x37')]({'plain':!![]});_0x5a0150['interaction'][_0x4add('0xbe')]=_0x3969c9;if(_0x5a0150['interaction'][_0x4add('0xbe')]){if(_0x5a0150[_0x4add('0xa2')][_0x4add('0xbf')]){_0x5a0150[_0x4add('0xa3')][_0x4add('0xc0')]({'id':0x0,'priority':_0x5a0150['applications'][_0x4add('0x58')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x4add('0xc1')});}}return db['ChatMessage'][_0x4add('0x5b')]({'body':_0x38dec5[_0x4add('0x5c')][_0x4add('0x5c')],'ChatWebsiteId':_0x38dec5[_0x4add('0x57')]['id'],'ChatInteractionId':_0x44953a['id'],'direction':'in','ContactId':_0x5a0150['contact']['id'],'AttachmentId':_0x38dec5[_0x4add('0x5c')][_0x4add('0xc2')]});})[_0x4add('0x23')](function(_0x2732cc){_0x5a0150[_0x4add('0x2a')]=_0x2732cc;if(_0x5a0150['interaction'][_0x4add('0xc3')]){return db['User']['find']({'attributes':['id',_0x4add('0x3b')],'where':{'id':_0x5a0150[_0x4add('0xba')][_0x4add('0xc3')]}})['then'](function(_0x2aa186){if(_0x2aa186){_0x5a0150[_0x4add('0xa3')][_0x4add('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2aa186[_0x4add('0x3b')]+','+(_0x5a0150[_0x4add('0xa2')]['waitForTheAssignedAgent']||0xa),'interval':_0x4add('0xc1')});_0x5a0150[_0x4add('0xc5')]=!![];}return respondWithRpcPromise(_0x4add('0xc6'),_0x4add('0xc7'),_0x5a0150);});}return respondWithRpcPromise(_0x4add('0xc6'),_0x4add('0xc7'),_0x5a0150);})[_0x4add('0x23')](function(_0x512539){respondWithRpcPromise(_0x4add('0xc8'),_0x4add('0xc8'),{'event':_0x4add('0xc9'),'message':_0x512539},client9002);return _0x512539;})[_0x4add('0x23')](respondWithResult(_0x1cbe43,null))[_0x4add('0x5a')](handleError(_0x1cbe43,null));};exports[_0x4add('0xca')]=function(_0x582cce,_0x524c77,_0x5f106d){var _0x3b824b,_0x364f6d,_0x1b48b9;var _0x27ad05=[];var _0x2a9609=[];var _0x3fefd9={};var _0x2954b1=_0x582cce[_0x4add('0xcb')]||[];var _0x59d08f=[];var _0x57829d;return db['CmContact'][_0x4add('0x65')]()['then'](function(_0x26fe6a){if(!_0x26fe6a){throw new db[(_0x4add('0x8f'))]['ValidationError'](_0x4add('0xcc'));}_0x2a9609=_['difference'](_[_0x4add('0x45')](_0x26fe6a),[_0x4add('0x92'),'updatedAt']);_0x27ad05=_[_0x4add('0x91')](_['keys'](_0x26fe6a),[_0x4add('0x92'),_0x4add('0x93'),_0x4add('0x94'),_0x4add('0x95')]);if(_0x582cce[_0x4add('0x5c')]['id']){delete _0x582cce['body']['id'];}if(_[_0x4add('0x7f')](_0x582cce[_0x4add('0x5c')][_0x4add('0x96')])){throw _0x524c77[_0x4add('0x2d')](0x1f4)[_0x4add('0x3c')](new db['Sequelize'][(_0x4add('0x90'))](_0x4add('0x97')));}if(_['isNil'](_0x582cce[_0x4add('0x5c')][_0x4add('0x5c')])||_0x582cce[_0x4add('0x5c')][_0x4add('0x5c')]===''){throw _0x524c77['status'](0x1f4)['send'](new db['Sequelize'][(_0x4add('0x90'))](_0x4add('0xcd')));}if(_[_0x4add('0x7f')](_0x582cce[_0x4add('0x5c')]['mapKeyOffline'])){throw _0x524c77['status'](0x1f4)['send'](new db[(_0x4add('0x8f'))][(_0x4add('0x90'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27ad05));}if(!_[_0x4add('0x9a')](_0x27ad05,_0x582cce[_0x4add('0x5c')][_0x4add('0xce')])){throw _0x524c77['status'](0x1f4)[_0x4add('0x3c')](new db[(_0x4add('0x8f'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27ad05));}_0x3fefd9[_0x582cce['body'][_0x4add('0xce')]]=_0x582cce[_0x4add('0x5c')]['from'];})[_0x4add('0x23')](function(){return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x582cce[_0x4add('0x57')]['id']},'include':[{'model':db[_0x4add('0x9c')],'as':_0x4add('0xa1')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x4add('0x23')](handleEntityNotFound(_0x524c77,null))[_0x4add('0x23')](function(_0x37a4ab){if(_0x37a4ab&&_0x37a4ab[_0x4add('0xa1')]){_0x364f6d=_0x37a4ab;var _0x50fbf9=_[_0x4add('0x1c')](_0x582cce['body'],{'firstName':_0x582cce[_0x4add('0x5c')][_0x4add('0x96')],'phone':_0x582cce[_0x4add('0x5c')][_0x4add('0x96')],'ListId':_0x37a4ab[_0x4add('0x95')]});_0x50fbf9[_0x582cce[_0x4add('0x5c')][_0x4add('0xce')]]=_0x582cce['body'][_0x4add('0x96')];return db['CmContact'][_0x4add('0xcf')]({'where':_0x3fefd9,'defaults':_0x50fbf9});}})['spread'](function(_0x1ed0cf){if(_0x1ed0cf){_0x1b48b9=_0x1ed0cf;var _0x3fa542=fs['readFileSync'](path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0xd0')),_0x4add('0xd1'));var _0x38ae3d=ejs[_0x4add('0xd2')](_0x3fa542,{'body':_[_0x4add('0xd3')](_0x582cce[_0x4add('0x5c')][_0x4add('0x5c')]),'bodyTitle':_0x364f6d[_0x4add('0xd4')]});return db[_0x4add('0xd5')][_0x4add('0x5b')]({'body':_0x38ae3d,'ContactId':_0x1ed0cf['id'],'ChatWebsiteId':_0x364f6d['id']});}})['then'](function(_0xf94f1f){_0x57829d=_0xf94f1f;if(_0x2954b1[_0x4add('0x58')]){var _0x5548e4=_0x2954b1[_0x4add('0x4f')](function(_0x132671){return{'name':_0x132671[_0x4add('0xd6')],'basename':_0x132671['filename'],'type':_0x132671[_0x4add('0xd7')],'ChatOfflineMessageId':_0xf94f1f['id']};});_0x59d08f=_0x5548e4[_0x4add('0x4f')](_0x2bac54=>{var _0x564cc9={'filename':_0x2bac54['name'],'path':path[_0x4add('0x7d')](config[_0x4add('0x7e')],'server',_0x4add('0xcb'),_0x4add('0xd8'),_0x4add('0xd9'),_0x2bac54[_0x4add('0xda')])};return _0x564cc9;});if(!_0x364f6d[_0x4add('0xdb')]){return db[_0x4add('0xdc')][_0x4add('0xdd')](function(_0x180a43){return db[_0x4add('0xde')]['bulkCreate'](_0x5548e4,{'transaction':_0x180a43});});}}})[_0x4add('0x23')](function(){if(_0x57829d){_0x3b824b=_0x57829d;return db[_0x4add('0xdf')][_0x4add('0x6a')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4add('0xe0'),'raw':!![]}]});}})[_0x4add('0x23')](function(_0x423b04){if(_0x423b04&&_0x423b04[_0x4add('0xe0')]&&_0x364f6d['forwardOffline']&&_0x364f6d[_0x4add('0xe1')]){var _0x13b52a={'tls':{'rejectUnauthorized':![]}};if(_0x423b04['Smtp']['service']){_0x13b52a[_0x4add('0xe2')]=_0x423b04[_0x4add('0xe0')]['service'];}else{_0x13b52a[_0x4add('0xe3')]=_0x423b04[_0x4add('0xe0')]['host'];_0x13b52a[_0x4add('0xe4')]=_0x423b04[_0x4add('0xe0')][_0x4add('0xe4')];_0x13b52a['secure']=_0x423b04[_0x4add('0xe0')]['secure'];}if(_0x423b04['Smtp'][_0x4add('0xe5')]){_0x13b52a['auth']={'user':_0x423b04['Smtp'][_0x4add('0x5d')],'pass':_0x423b04[_0x4add('0xe0')][_0x4add('0xe6')]};}return respondWithRpcPromise('SendMail',_0x4add('0xe7'),{'account':_0x13b52a,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x423b04[_0x4add('0x3b')],_0x423b04[_0x4add('0xe8')]||_0x423b04[_0x4add('0xe0')][_0x4add('0x5d')]),'to':_0x364f6d[_0x4add('0xe1')],'subject':_0x364f6d['offlineMessageSubject'],'html':_0x3b824b['body'],'attachments':_0x59d08f}},client9003)[_0x4add('0x23')](function(){return _0x3b824b;})[_0x4add('0x5a')](function(_0x5e0444){console[_0x4add('0x29')](_0x5e0444);});}})[_0x4add('0x23')](function(){if(_0x364f6d&&_0x364f6d[_0x4add('0xdb')]&&_0x364f6d[_0x4add('0xe9')]){var _0x5613b1=[];if(_0x2954b1['length']){_0x5613b1=_0x2954b1[_0x4add('0x4f')](function(_0x57955b){return{'name':_0x57955b[_0x4add('0xd6')],'basename':_0x57955b[_0x4add('0x77')],'type':_0x57955b[_0x4add('0xd7')],'ChatOfflineMessageId':_0x57829d['id']};});}var _0x54b884;if(!_[_0x4add('0x7f')](_0x364f6d['subjectOffline'])){var _0x20d9fb=_[_0x4add('0x4f')](_0x582cce[_0x4add('0x5c')],function(_0x400600){return _0x400600;});var _0x138f29=_['toPairsIn'](_0x20d9fb)[0x0];var _0x36bd44=_[_0x4add('0xea')](_0x138f29,function(_0x469210){return _0x469210;});_0x54b884=_0x36bd44[0x1][_0x364f6d[_0x4add('0xeb')]];}var _0x1986d5={'from':_0x1b48b9[_0x4add('0xe8')],'firstName':_0x1b48b9[_0x4add('0xaa')],'lastName':_0x1b48b9[_0x4add('0xab')],'mapKey':_0x4add('0xe8'),'message':{'from':_0x1b48b9[_0x4add('0xe8')],'to':_0x364f6d[_0x4add('0xdf')][_0x4add('0xe8')],'cc':'','subject':_['isNil'](_0x54b884)?_0x364f6d[_0x4add('0xec')]:_0x54b884,'messageId':'','sentAt':new Date(),'attach':_0x5613b1['length'],'attachments':_0x5613b1,'originChannel':_0x4add('0xed'),'ChatWebsiteId':_0x364f6d['id'],'ChatOfflineMessageId':_0x3b824b['id'],'originTo':_0x364f6d[_0x4add('0xdf')][_0x4add('0xe8')]},'body':_0x3b824b[_0x4add('0x5c')]};var _0x410254={'account':{'id':_0x364f6d[_0x4add('0xe9')]},'body':_0x1986d5,'log':_0x4add('0xee')};return respondWithRpcPromise('NotifyMailAccount',_0x4add('0xef'),_0x410254,client9001)[_0x4add('0x23')](function(){return _0x3b824b;})[_0x4add('0x5a')](function(_0x133846){console[_0x4add('0x29')](_0x133846);});}return;})[_0x4add('0x23')](function(){if(_0x3b824b){return _0x3b824b;}})[_0x4add('0x23')](respondWithResult(_0x524c77,null))[_0x4add('0x5a')](function(_0x1fbc02){console[_0x4add('0x29')](_0x4add('0x5a'),_0x1fbc02);for(var _0x5e4501 of _0x2954b1){var _0x3e010b=path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0xf0'),_0x4add('0xcb'),_0x4add('0xd8'),_0x4add('0xd9'),_0x5e4501[_0x4add('0x77')]);fs_extra[_0x4add('0xf1')](_0x3e010b)['catch'](function(_0x1965a3){console[_0x4add('0x29')](_0x4add('0xf2'),_0x3e010b,_0x1965a3);});}});};exports[_0x4add('0xf3')]=function(_0x16071a,_0x413ff0,_0x62ca3d){return db[_0x4add('0xb7')][_0x4add('0x59')]({'where':{'id':_0x16071a[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x413ff0,null))['then'](function(_0x5d08c3){if(_0x5d08c3){return _0x5d08c3[_0x4add('0xf3')](_0x16071a[_0x4add('0x5c')][_0x4add('0xf4')],_[_0x4add('0xf5')](_0x16071a[_0x4add('0x5c')],[_0x4add('0xf4'),'id'])||{});}})[_0x4add('0x23')](respondWithResult(_0x413ff0,null))[_0x4add('0x5a')](handleError(_0x413ff0,null));};exports[_0x4add('0xf6')]=function(_0x21fe08,_0x3069a7,_0x3f9fb6){var _0x1cf852={'raw':![],'where':{}};var _0x59fe65={};var _0x314586={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4add('0x6a')]({'where':{'id':_0x21fe08[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x3069a7,null))[_0x4add('0x23')](function(_0x2489e7){if(_0x2489e7){_0x59fe65[_0x4add('0x44')]=_[_0x4add('0x45')](db[_0x4add('0xb7')]['rawAttributes']);_0x59fe65['query']=_[_0x4add('0x45')](_0x21fe08[_0x4add('0x46')]);_0x59fe65['filters']=_['intersection'](_0x59fe65[_0x4add('0x44')],_0x59fe65['query']);_0x1cf852['attributes']=_[_0x4add('0x48')](_0x59fe65['model'],qs[_0x4add('0x49')](_0x21fe08[_0x4add('0x46')][_0x4add('0x49')]));_0x1cf852[_0x4add('0x4a')]=_0x1cf852[_0x4add('0x4a')][_0x4add('0x58')]?_0x1cf852[_0x4add('0x4a')]:_0x59fe65[_0x4add('0x44')];if(!_0x21fe08[_0x4add('0x46')][_0x4add('0x6b')](_0x4add('0x4b'))){_0x1cf852[_0x4add('0x32')]=qs[_0x4add('0x32')](_0x21fe08[_0x4add('0x46')]['limit']);_0x1cf852[_0x4add('0x2f')]=qs['offset'](_0x21fe08[_0x4add('0x46')][_0x4add('0x2f')]);}_0x1cf852['order']=qs[_0x4add('0x4c')](_0x21fe08[_0x4add('0x46')]['sort']);_0x1cf852[_0x4add('0x4e')]=qs[_0x4add('0x47')](_[_0x4add('0x6d')](_0x21fe08[_0x4add('0x46')],_0x59fe65['filters']));_0x1cf852['where'][_0x4add('0x67')]=_0x2489e7['id'];if(_0x21fe08[_0x4add('0x46')][_0x4add('0x4d')]){_0x1cf852['where']=_[_0x4add('0x51')](_0x1cf852[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x1cf852['attributes'],function(_0x213386){var _0x31aef5={};_0x31aef5[_0x213386]={'$like':'%'+_0x21fe08['query']['filter']+'%'};return _0x31aef5;})});}_0x1cf852=_[_0x4add('0x51')]({},_0x1cf852,_0x21fe08[_0x4add('0x52')]);return db['ChatInteraction'][_0x4add('0x31')]({'where':_0x1cf852[_0x4add('0x4e')]})[_0x4add('0x23')](function(_0x5862dc){_0x314586[_0x4add('0x31')]=_0x5862dc;if(_0x21fe08[_0x4add('0x46')][_0x4add('0x53')]){_0x1cf852[_0x4add('0x54')]=[{'model':db[_0x4add('0x8e')],'as':_0x4add('0xf7'),'required':![]},{'model':db[_0x4add('0xf8')],'as':_0x4add('0xf9'),'attributes':[_0x4add('0x3b'),_0x4add('0xfa'),_0x4add('0xfb')],'required':![]},{'model':db[_0x4add('0xfc')],'as':'Tags','attributes':['id',_0x4add('0x3b'),'color'],'where':_0x21fe08['query'][_0x4add('0xfd')]?{'id':_0x21fe08[_0x4add('0x46')]['tag']}:undefined,'required':_0x21fe08[_0x4add('0x46')][_0x4add('0xfd')]?!![]:![]}];}return db[_0x4add('0xb7')][_0x4add('0x55')](_0x1cf852);})[_0x4add('0x23')](function(_0x209550){_0x314586[_0x4add('0x72')]=_0x209550;return _0x314586;});}})[_0x4add('0x23')](respondWithFilteredResult(_0x3069a7,_0x1cf852))['catch'](handleError(_0x3069a7,null));};function iftimePromise(_0xfaada6,_0x4b52db){return respondWithRpcPromise(_0x4add('0xfe'),'getSnippet',{'command':_0x4b52db['timezone']?util['format']('iftime\x20%s,%s',_0xfaada6[_0x4add('0xff')],_0x4b52db[_0x4add('0x100')]):util['format'](_0x4add('0x101'),_0xfaada6[_0x4add('0xff')])},client9002)['then'](function(_0xeabea1){var _0x559d46=_0xeabea1&&_0xeabea1[_0x4add('0x102')](_0x4add('0x103'))>=0x0?!![]:![];logger['info'](_0x4add('0x104'),_0x4b52db['id'],_0xfaada6['id'],_0xfaada6[_0x4add('0xff')],_0x559d46?_0x4add('0x105'):'OFFLINE',_0x4b52db['timezone']?_0x4b52db[_0x4add('0x100')]:_0x4add('0x106'));return _0x559d46;})[_0x4add('0x5a')](function(_0xf4479a){logger[_0x4add('0x29')](_0x4add('0x104'),_0x4b52db['id'],_0xfaada6['id'],_0xfaada6[_0x4add('0xff')],util[_0x4add('0x107')](_0xf4479a,{'showHidden':![],'depth':null}),_0x4b52db[_0x4add('0x100')]?_0x4b52db[_0x4add('0x100')]:'No\x20timezone');return![];});}exports[_0x4add('0x108')]=function(_0x142b29,_0x509b70,_0x53c6e2){var _0x2bce66=0x0;var _0x36b97c=0x0;var _0x45fba2=![];var _0x1ce64e;var _0x5c6e6d;return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x142b29[_0x4add('0x57')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':_0x4add('0x109'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x4add('0x23')](handleEntityNotFound(_0x509b70,null))[_0x4add('0x23')](function(_0x5969f6){if(_0x5969f6){_0x1ce64e=_0x5969f6;return _0x5969f6[_0x4add('0x10a')]({'raw':!![]});}})['then'](function(_0x4170ff){if(_0x1ce64e){if(_0x4170ff){_0x5c6e6d=_0x4170ff;}}return require(_0x4add('0x19'))[_0x4add('0x10b')]();})[_0x4add('0x23')](function(_0x8a3b91){if(_0x8a3b91){_0x36b97c=_0x8a3b91[_0x4add('0x10c')];_0x45fba2=_0x8a3b91[_0x4add('0x10d')];}})[_0x4add('0x23')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x4add('0x23')](function(_0x3032a5){_0x2bce66=_0x3032a5;if(_0x36b97c&&_0x3032a5>_0x36b97c){return db[_0x4add('0x10e')][_0x4add('0x6a')]({'where':{'id':0x1}})[_0x4add('0x23')](function(_0x2a1f28){if(_0x2a1f28){_0x2a1f28[_0x4add('0x10f')](_0x4add('0x110'));}});}})[_0x4add('0x23')](function(){if(_0x1ce64e['Interval']&&_0x1ce64e[_0x4add('0x111')][_0x4add('0x109')]){var _0x21a58e=[];for(var _0x1cc67b=0x0;_0x1cc67b<_0x1ce64e[_0x4add('0x111')][_0x4add('0x109')][_0x4add('0x58')];_0x1cc67b++){var _0x368cb8=_0x1ce64e[_0x4add('0x111')][_0x4add('0x109')][_0x1cc67b][_0x4add('0x37')]({'plain':!![]});_0x21a58e[_0x4add('0xc0')](iftimePromise(_0x368cb8,_0x1ce64e));}return BPromise[_0x4add('0x112')](_0x21a58e)['then'](function(_0x9a36ef){return _[_0x4add('0x113')](_0x9a36ef);});}else{return!![];}})[_0x4add('0x23')](function(_0x540cee){var _0x58baa2=fs['readFileSync'](path[_0x4add('0x7d')](config[_0x4add('0x7e')],_0x4add('0x114')),_0x4add('0xd1'));var _0x317d0a={'remote':_0x1ce64e[_0x4add('0x115')],'query':querystring[_0x4add('0xb5')](_[_0x4add('0x51')](_0x1ce64e[_0x4add('0x37')]({'plain':!![]}),{'customerIp':_0x142b29[_0x4add('0x8a')][_0x4add('0xa8')]||_0x142b29[_0x4add('0x8a')][_0x4add('0x116')]||_0x142b29[_0x4add('0x117')][_0x4add('0x118')]||_0x142b29['ip'],'referer':_0x142b29[_0x4add('0x8a')][_0x4add('0x119')],'openedInteractions':_0x2bce66,'maxInteractions':_0x36b97c,'virtual':_0x45fba2[_0x4add('0x10c')],'online':_0x540cee,'custom':_0x45fba2}))[_0x4add('0x11a')](/'/g,'\x5c\x27')};_0x509b70[_0x4add('0x3c')](ejs[_0x4add('0xd2')](Mustache[_0x4add('0xd2')](_0x58baa2,_0x317d0a),{'proactiveActions':_0x5c6e6d,'alignment':_0x1ce64e[_0x4add('0x11b')],'verticalAlignment':_0x1ce64e[_0x4add('0x11c')],'div_color':_0x1ce64e[_0x4add('0x11d')],'text_color':_0x1ce64e[_0x4add('0x11e')],'button_color':_0x1ce64e[_0x4add('0x11f')],'background_color':_0x1ce64e[_0x4add('0x120')]}));})[_0x4add('0x5a')](handleError(_0x509b70,null));};exports['addApplications']=function(_0x4921f8,_0x3321b0,_0x25d3fa){return db['ChatWebsite'][_0x4add('0x6a')]({'where':{'id':_0x4921f8[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x3321b0,null))[_0x4add('0x23')](function(_0x2ab334){if(_0x2ab334){return db['sequelize']['transaction'](function(_0x14a0a9){return db[_0x4add('0x9f')][_0x4add('0x36')]({'where':{'ChatWebsiteId':_0x4921f8['params']['id']},'transaction':_0x14a0a9})[_0x4add('0x23')](function(_0x388f0c){var _0x11306b=_[_0x4add('0x4f')](_0x4921f8[_0x4add('0x5c')],function(_0x249ec4){_0x249ec4[_0x4add('0x67')]=_0x4921f8[_0x4add('0x57')]['id'];return _0x249ec4;});return db[_0x4add('0x9f')][_0x4add('0x121')](_0x11306b,{'transaction':_0x14a0a9});});})['then'](function(){return db[_0x4add('0x9f')][_0x4add('0x122')]({'where':{'ChatWebsiteId':_0x4921f8[_0x4add('0x57')]['id']},'order':_0x4add('0x123')});});}})[_0x4add('0x23')](respondWithResult(_0x3321b0,null))[_0x4add('0x5a')](handleError(_0x3321b0,null));};exports['getApplications']=function(_0x2bfa05,_0x2afcec,_0x5244bc){var _0x566147={};var _0x10375c={};var _0x3331f4;var _0x3a4dd8;return db['ChatWebsite']['findOne']({'where':{'id':_0x2bfa05[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x2afcec,null))['then'](function(_0x458f35){if(_0x458f35){_0x3331f4=_0x458f35;_0x10375c['model']=_[_0x4add('0x45')](db['ChatApplication'][_0x4add('0x40')]);_0x10375c['query']=_['keys'](_0x2bfa05[_0x4add('0x46')]);_0x10375c['filters']=_[_0x4add('0x48')](_0x10375c['model'],_0x10375c[_0x4add('0x46')]);_0x566147[_0x4add('0x4a')]=_['intersection'](_0x10375c[_0x4add('0x44')],qs['fields'](_0x2bfa05[_0x4add('0x46')][_0x4add('0x49')]));_0x566147[_0x4add('0x4a')]=_0x566147['attributes']['length']?_0x566147[_0x4add('0x4a')]:_0x10375c[_0x4add('0x44')];_0x566147['order']=qs[_0x4add('0x4c')](_0x2bfa05[_0x4add('0x46')][_0x4add('0x4c')]);_0x566147[_0x4add('0x4e')]=qs[_0x4add('0x47')](_[_0x4add('0x6d')](_0x2bfa05['query'],_0x10375c[_0x4add('0x47')]));if(_0x2bfa05[_0x4add('0x46')]['filter']){_0x566147[_0x4add('0x4e')]=_[_0x4add('0x51')](_0x566147[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x566147['attributes'],function(_0x484972){var _0x453e42={};_0x453e42[_0x484972]={'$like':'%'+_0x2bfa05[_0x4add('0x46')][_0x4add('0x4d')]+'%'};return _0x453e42;})});}_0x566147=_[_0x4add('0x51')]({},_0x566147,_0x2bfa05['options']);return _0x3331f4[_0x4add('0x124')](_0x566147);}})[_0x4add('0x23')](function(_0x4239d3){if(_0x4239d3){_0x3a4dd8=_0x4239d3['length'];if(!_0x2bfa05[_0x4add('0x46')][_0x4add('0x6b')](_0x4add('0x4b'))){_0x566147[_0x4add('0x32')]=qs['limit'](_0x2bfa05[_0x4add('0x46')][_0x4add('0x32')]);_0x566147[_0x4add('0x2f')]=qs[_0x4add('0x2f')](_0x2bfa05[_0x4add('0x46')]['offset']);}return _0x3331f4[_0x4add('0x124')](_0x566147);}})[_0x4add('0x23')](function(_0x6c7647){if(_0x6c7647){return _0x6c7647?{'count':_0x3a4dd8,'rows':_0x6c7647}:null;}})[_0x4add('0x23')](respondWithResult(_0x2afcec,null))[_0x4add('0x5a')](handleError(_0x2afcec,null));};exports[_0x4add('0x125')]=function(_0x40b05e,_0x4b2b27,_0x3a9775){return db[_0x4add('0x126')][_0x4add('0x59')]({'where':{'id':_0x40b05e[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x4b2b27,null))[_0x4add('0x23')](function(_0x58cae6){if(_0x58cae6){return _0x58cae6[_0x4add('0x125')](_0x40b05e[_0x4add('0x5c')][_0x4add('0xf4')],_[_0x4add('0xf5')](_0x40b05e[_0x4add('0x5c')],[_0x4add('0xf4'),'id'])||{});}})[_0x4add('0x23')](respondWithResult(_0x4b2b27,null))['catch'](handleError(_0x4b2b27,null));};exports['getProactiveActions']=function(_0x4f6574,_0x37163b,_0x111968){var _0x2f0874={};var _0x34d4f3={};var _0x35b5ad;var _0x1b6973;return db[_0x4add('0x3f')][_0x4add('0x6a')]({'where':{'id':_0x4f6574[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x37163b,null))[_0x4add('0x23')](function(_0x1bad4d){if(_0x1bad4d){_0x35b5ad=_0x1bad4d;_0x34d4f3[_0x4add('0x44')]=_[_0x4add('0x45')](db[_0x4add('0x127')]['rawAttributes']);_0x34d4f3[_0x4add('0x46')]=_[_0x4add('0x45')](_0x4f6574['query']);_0x34d4f3[_0x4add('0x47')]=_[_0x4add('0x48')](_0x34d4f3[_0x4add('0x44')],_0x34d4f3[_0x4add('0x46')]);_0x2f0874[_0x4add('0x4a')]=_[_0x4add('0x48')](_0x34d4f3[_0x4add('0x44')],qs[_0x4add('0x49')](_0x4f6574[_0x4add('0x46')]['fields']));_0x2f0874[_0x4add('0x4a')]=_0x2f0874[_0x4add('0x4a')][_0x4add('0x58')]?_0x2f0874[_0x4add('0x4a')]:_0x34d4f3[_0x4add('0x44')];_0x2f0874['order']=qs[_0x4add('0x4c')](_0x4f6574[_0x4add('0x46')][_0x4add('0x4c')]);_0x2f0874[_0x4add('0x4e')]=qs[_0x4add('0x47')](_[_0x4add('0x6d')](_0x4f6574[_0x4add('0x46')],_0x34d4f3[_0x4add('0x47')]));if(_0x4f6574[_0x4add('0x46')][_0x4add('0x4d')]){_0x2f0874['where']=_[_0x4add('0x51')](_0x2f0874[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x2f0874['attributes'],function(_0x151e03){var _0x108b1f={};_0x108b1f[_0x151e03]={'$like':'%'+_0x4f6574[_0x4add('0x46')]['filter']+'%'};return _0x108b1f;})});}_0x2f0874=_[_0x4add('0x51')]({},_0x2f0874,_0x4f6574[_0x4add('0x52')]);return _0x35b5ad[_0x4add('0x10a')](_0x2f0874);}})['then'](function(_0x2ddc0b){if(_0x2ddc0b){_0x1b6973=_0x2ddc0b[_0x4add('0x58')];if(!_0x4f6574[_0x4add('0x46')][_0x4add('0x6b')](_0x4add('0x4b'))){_0x2f0874['limit']=qs[_0x4add('0x32')](_0x4f6574['query']['limit']);_0x2f0874['offset']=qs[_0x4add('0x2f')](_0x4f6574[_0x4add('0x46')][_0x4add('0x2f')]);}return _0x35b5ad[_0x4add('0x10a')](_0x2f0874);}})[_0x4add('0x23')](function(_0x555b99){if(_0x555b99){return _0x555b99?{'count':_0x1b6973,'rows':_0x555b99}:null;}})[_0x4add('0x23')](respondWithResult(_0x37163b,null))[_0x4add('0x5a')](handleError(_0x37163b,null));};exports[_0x4add('0x128')]=function(_0x55eb63,_0x48e970,_0xc41f41){var _0x2b4ad9=_0x55eb63[_0x4add('0x46')]['online']===_0x4add('0x129')?_0x4add('0x12a'):'onlineForm';return db[_0x4add('0x3f')][_0x4add('0x59')]({'attributes':['id',_0x2b4ad9],'where':{'id':_0x55eb63['params']['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x48e970,null))['then'](function(_0x2704b0){if(_0x2704b0){var _0x3e7bb8=_0x2704b0[_0x2b4ad9];var _0xecfc41=_0x3e7bb8&&_0x3e7bb8[_0x4add('0x12b')]?_0x3e7bb8['items']:[];_0x48e970[_0x4add('0x3c')]({'fromKey':_[_0x4add('0x7f')](_0x3e7bb8['fromKey'])?undefined:_0x3e7bb8[_0x4add('0x12c')],'count':_0xecfc41['length'],'rows':_0xecfc41});}})[_0x4add('0x5a')](handleError(_0x48e970,null));};exports[_0x4add('0x12d')]=function(_0x55dcc6,_0x41626b,_0x1d060a){var _0x196a5e={'raw':![],'where':{}};var _0x168058={};var _0x9f192d={'count':0x0,'rows':[]};return db[_0x4add('0x3f')][_0x4add('0x6a')]({'where':{'id':_0x55dcc6[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x41626b,null))[_0x4add('0x23')](function(_0x2ca2bc){if(_0x2ca2bc){_0x168058[_0x4add('0x44')]=_[_0x4add('0x45')](db['ChatOfflineMessage'][_0x4add('0x40')]);_0x168058[_0x4add('0x46')]=_['keys'](_0x55dcc6['query']);_0x168058[_0x4add('0x47')]=_[_0x4add('0x48')](_0x168058['model'],_0x168058[_0x4add('0x46')]);_0x196a5e[_0x4add('0x4a')]=_['intersection'](_0x168058['model'],qs[_0x4add('0x49')](_0x55dcc6[_0x4add('0x46')][_0x4add('0x49')]));_0x196a5e[_0x4add('0x4a')]=_0x196a5e['attributes'][_0x4add('0x58')]?_0x196a5e[_0x4add('0x4a')]:_0x168058['model'];if(!_0x55dcc6[_0x4add('0x46')][_0x4add('0x6b')](_0x4add('0x4b'))){_0x196a5e['limit']=qs[_0x4add('0x32')](_0x55dcc6[_0x4add('0x46')]['limit']);_0x196a5e[_0x4add('0x2f')]=qs[_0x4add('0x2f')](_0x55dcc6['query']['offset']);}_0x196a5e['order']=qs[_0x4add('0x4c')](_0x55dcc6[_0x4add('0x46')][_0x4add('0x4c')]);_0x196a5e[_0x4add('0x4e')]=qs[_0x4add('0x47')](_['pick'](_0x55dcc6[_0x4add('0x46')],_0x168058[_0x4add('0x47')]));_0x196a5e[_0x4add('0x4e')][_0x4add('0x67')]=_0x2ca2bc['id'];if(_0x55dcc6['query'][_0x4add('0x4d')]){_0x196a5e[_0x4add('0x4e')]=_[_0x4add('0x51')](_0x196a5e[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x196a5e['attributes'],function(_0x4c7521){var _0x522348={};_0x522348[_0x4c7521]={'$like':'%'+_0x55dcc6[_0x4add('0x46')][_0x4add('0x4d')]+'%'};return _0x522348;})});}_0x196a5e=_[_0x4add('0x51')]({},_0x196a5e,_0x55dcc6['options']);return db[_0x4add('0xd5')][_0x4add('0x31')]({'where':_0x196a5e[_0x4add('0x4e')]})[_0x4add('0x23')](function(_0x1ccafd){_0x9f192d[_0x4add('0x31')]=_0x1ccafd;if(_0x55dcc6['query'][_0x4add('0x53')]){_0x196a5e[_0x4add('0x54')]=[{'all':!![]}];}else{_0x196a5e[_0x4add('0x54')]=[{'model':db[_0x4add('0x8e')],'as':'Contact','required':![]},{'model':db[_0x4add('0xde')],'as':_0x4add('0x12e'),'required':![]}];}return db[_0x4add('0xd5')][_0x4add('0x55')](_0x196a5e);})[_0x4add('0x23')](function(_0x23284c){_0x9f192d[_0x4add('0x72')]=_0x23284c;return _0x9f192d;});}})[_0x4add('0x23')](respondWithFilteredResult(_0x41626b,_0x196a5e))['catch'](handleError(_0x41626b,null));};exports[_0x4add('0x12f')]=function(_0x49a89b,_0x214cbd,_0x379af6){return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x49a89b[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x214cbd,null))[_0x4add('0x23')](function(_0xaf5cdc){if(_0xaf5cdc){return _0xaf5cdc[_0x4add('0x12f')](_0x49a89b['body'][_0x4add('0xf4')],_[_0x4add('0xf5')](_0x49a89b['body'],[_0x4add('0xf4'),'id'])||{})['spread'](function(_0x46f35c){for(var _0x5c9988=0x0;_0x5c9988<_0x49a89b['body'][_0x4add('0xf4')][_0x4add('0x58')];_0x5c9988+=0x1){socket[_0x4add('0x130')](_0x4add('0x131'),{'UserId':Number(_0x49a89b[_0x4add('0x5c')][_0x4add('0xf4')][_0x5c9988]),'ChatWebsiteId':Number(_0x49a89b[_0x4add('0x57')]['id'])});}return _0x46f35c;});}})[_0x4add('0x23')](respondWithResult(_0x214cbd,null))[_0x4add('0x5a')](handleError(_0x214cbd,null));};exports[_0x4add('0x132')]=function(_0x5ab8d0,_0x1dc37f,_0x203a05){return db[_0x4add('0x3f')][_0x4add('0x59')]({'where':{'id':_0x5ab8d0[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x1dc37f,null))['then'](function(_0xbf48f1){if(_0xbf48f1){return _0xbf48f1['removeAgents'](_0x5ab8d0['query'][_0x4add('0xf4')])[_0x4add('0x23')](function(){if(_[_0x4add('0x133')](_0x5ab8d0[_0x4add('0x46')][_0x4add('0xf4')])){for(var _0x12c275=0x0;_0x12c275<_0x5ab8d0[_0x4add('0x46')][_0x4add('0xf4')][_0x4add('0x58')];_0x12c275+=0x1){socket[_0x4add('0x130')](_0x4add('0x134'),{'UserId':Number(_0x5ab8d0[_0x4add('0x46')][_0x4add('0xf4')][_0x12c275]),'ChatWebsiteId':Number(_0x5ab8d0['params']['id'])});}}else{socket[_0x4add('0x130')](_0x4add('0x134'),{'UserId':Number(_0x5ab8d0[_0x4add('0x46')][_0x4add('0xf4')]),'ChatWebsiteId':Number(_0x5ab8d0['params']['id'])});}});}})[_0x4add('0x23')](respondWithStatusCode(_0x1dc37f,null))['catch'](handleError(_0x1dc37f,null));};exports[_0x4add('0x135')]=function(_0x4ca47a,_0x4ca917,_0xb166d5){var _0x42b640={};var _0x5bc2dc={};var _0x684b3f;var _0x52a17b;return db[_0x4add('0x3f')]['findOne']({'where':{'id':_0x4ca47a[_0x4add('0x57')]['id']}})[_0x4add('0x23')](handleEntityNotFound(_0x4ca917,null))['then'](function(_0x18a5d3){if(_0x18a5d3){_0x684b3f=_0x18a5d3;_0x5bc2dc[_0x4add('0x44')]=_['keys'](db[_0x4add('0xf8')][_0x4add('0x40')]);_0x5bc2dc[_0x4add('0x46')]=_[_0x4add('0x45')](_0x4ca47a[_0x4add('0x46')]);_0x5bc2dc[_0x4add('0x47')]=_[_0x4add('0x48')](_0x5bc2dc['model'],_0x5bc2dc[_0x4add('0x46')]);_0x42b640[_0x4add('0x4a')]=_[_0x4add('0x48')](_0x5bc2dc[_0x4add('0x44')],qs['fields'](_0x4ca47a[_0x4add('0x46')][_0x4add('0x49')]));_0x42b640[_0x4add('0x4a')]=_0x42b640[_0x4add('0x4a')][_0x4add('0x58')]?_0x42b640[_0x4add('0x4a')]:_0x5bc2dc[_0x4add('0x44')];_0x42b640[_0x4add('0x6c')]=qs[_0x4add('0x4c')](_0x4ca47a[_0x4add('0x46')][_0x4add('0x4c')]);_0x42b640[_0x4add('0x4e')]=qs['filters'](_[_0x4add('0x6d')](_0x4ca47a['query'],_0x5bc2dc[_0x4add('0x47')]));if(_0x4ca47a[_0x4add('0x46')]['filter']){_0x42b640[_0x4add('0x4e')]=_[_0x4add('0x51')](_0x42b640[_0x4add('0x4e')],{'$or':_[_0x4add('0x4f')](_0x42b640[_0x4add('0x4a')],function(_0x2c1a16){var _0x39fc2a={};_0x39fc2a[_0x2c1a16]={'$like':'%'+_0x4ca47a['query'][_0x4add('0x4d')]+'%'};return _0x39fc2a;})});}_0x42b640=_[_0x4add('0x51')]({},_0x42b640,_0x4ca47a[_0x4add('0x52')]);return _0x684b3f[_0x4add('0x135')](_0x42b640);}})[_0x4add('0x23')](function(_0x26c004){if(_0x26c004){_0x52a17b=_0x26c004['length'];if(!_0x4ca47a[_0x4add('0x46')]['hasOwnProperty']('nolimit')){_0x42b640[_0x4add('0x32')]=qs['limit'](_0x4ca47a['query'][_0x4add('0x32')]);_0x42b640[_0x4add('0x2f')]=qs[_0x4add('0x2f')](_0x4ca47a[_0x4add('0x46')][_0x4add('0x2f')]);}return _0x684b3f[_0x4add('0x135')](_0x42b640);}})[_0x4add('0x23')](function(_0x286721){if(_0x286721){return _0x286721?{'count':_0x52a17b,'rows':_0x286721}:null;}})['then'](respondWithResult(_0x4ca917,null))[_0x4add('0x5a')](handleError(_0x4ca917,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index ac517ac..8b9ea93 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 _0xef39=['hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x586c70,_0x4a8cb3){var _0x26db79=function(_0xbfa842){while(--_0xbfa842){_0x586c70['push'](_0x586c70['shift']());}};_0x26db79(++_0x4a8cb3);}(_0xef39,0x92));var _0x9ef3=function(_0x2bcc6c,_0x4f54af){_0x2bcc6c=_0x2bcc6c-0x0;var _0x37c9ac=_0xef39[_0x2bcc6c];return _0x37c9ac;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x9ef3('0x0'))['db'][_0x9ef3('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9ef3('0x2')](0x0);var events={'afterCreate':_0x9ef3('0x3'),'afterUpdate':_0x9ef3('0x4'),'afterDestroy':_0x9ef3('0x5')};function emitEvent(_0x15e14e){return function(_0x162196,_0x2c4541,_0x2e1afa){ChatWebsiteEvents[_0x9ef3('0x6')](_0x15e14e+':'+_0x162196['id'],_0x162196);ChatWebsiteEvents[_0x9ef3('0x6')](_0x15e14e,_0x162196);_0x2e1afa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x9ef3('0x7')](e,emitEvent(event));}}module[_0x9ef3('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8ccb=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0x8ccb[_0x244862];return _0x2bce23;};'use strict';var EventEmitter=require(_0xb8cc('0x0'));var ChatWebsite=require(_0xb8cc('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8cc('0x2')](0x0);var events={'afterCreate':_0xb8cc('0x3'),'afterUpdate':_0xb8cc('0x4'),'afterDestroy':_0xb8cc('0x5')};function emitEvent(_0x5ede44){return function(_0x4e1ed7,_0x115fdc,_0x3672bc){ChatWebsiteEvents[_0xb8cc('0x6')](_0x5ede44+':'+_0x4e1ed7['id'],_0x4e1ed7);ChatWebsiteEvents['emit'](_0x5ede44,_0x4e1ed7);_0x3672bc(null);};}for(var e in events){if(events[_0xb8cc('0x7')](e)){var event=events[e];ChatWebsite[_0xb8cc('0x8')](e,emitEvent(event));}}module[_0xb8cc('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ad87c73..6157e92 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 _0x4a7c=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','util','../../config/logger'];(function(_0x188cc8,_0xd39746){var _0x4cb155=function(_0x2d2a6c){while(--_0x2d2a6c){_0x188cc8['push'](_0x188cc8['shift']());}};_0x4cb155(++_0xd39746);}(_0x4a7c,0x129));var _0xc4a7=function(_0x25184c,_0x31c137){_0x25184c=_0x25184c-0x0;var _0x10ea3f=_0x4a7c[_0x25184c];return _0x10ea3f;};'use strict';var _=require(_0xc4a7('0x0'));var util=require(_0xc4a7('0x1'));var logger=require(_0xc4a7('0x2'))(_0xc4a7('0x3'));var moment=require(_0xc4a7('0x4'));var BPromise=require(_0xc4a7('0x5'));var rp=require(_0xc4a7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4a7('0x7'));var config=require(_0xc4a7('0x8'));var attributes=require(_0xc4a7('0x9'));module[_0xc4a7('0xa')]=function(_0x5b97a8,_0x3be6b6){return _0x5b97a8['define']('ChatWebsite',attributes,{'tableName':_0xc4a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00b6=['./chatWebsite.attributes','exports','ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x22608c,_0x20fac7){var _0xf01d6d=function(_0x31ffbc){while(--_0x31ffbc){_0x22608c['push'](_0x22608c['shift']());}};_0xf01d6d(++_0x20fac7);}(_0x00b6,0x16b));var _0x600b=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x00b6[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x600b('0x0'));var util=require(_0x600b('0x1'));var logger=require(_0x600b('0x2'))(_0x600b('0x3'));var moment=require(_0x600b('0x4'));var BPromise=require(_0x600b('0x5'));var rp=require(_0x600b('0x6'));var fs=require('fs');var path=require(_0x600b('0x7'));var rimraf=require(_0x600b('0x8'));var config=require('../../config/environment');var attributes=require(_0x600b('0x9'));module[_0x600b('0xa')]=function(_0x2a3d4b,_0x20b164){return _0x2a3d4b['define'](_0x600b('0xb'),attributes,{'tableName':'chat_websites','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 adb813b..b7a045e 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 _0x6b52=['ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x1dc7c8,_0x1c18f9){var _0x4c3b3e=function(_0x537222){while(--_0x537222){_0x1dc7c8['push'](_0x1dc7c8['shift']());}};_0x4c3b3e(++_0x1c18f9);}(_0x6b52,0xaf));var _0x26b5=function(_0x38e233,_0x42e068){_0x38e233=_0x38e233-0x0;var _0x488064=_0x6b52[_0x38e233];return _0x488064;};'use strict';var _=require(_0x26b5('0x0'));var util=require(_0x26b5('0x1'));var moment=require(_0x26b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26b5('0x3'));var db=require(_0x26b5('0x4'))['db'];var utils=require(_0x26b5('0x5'));var logger=require(_0x26b5('0x6'))('rpc');var config=require(_0x26b5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x26b5('0x8')][_0x26b5('0x9')]({'port':0x232a});config[_0x26b5('0xa')]=_['defaults'](config[_0x26b5('0xa')],{'host':_0x26b5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26b5('0xa')]));require('./chatWebsite.socket')[_0x26b5('0xc')](socket);function respondWithRpcPromise(_0x130fef,_0x36e7a5,_0x297c83){return new BPromise(function(_0x578948,_0x2f555a){return client[_0x26b5('0xd')](_0x130fef,_0x297c83)['then'](function(_0x4ce244){logger[_0x26b5('0xe')](_0x26b5('0xf'),_0x36e7a5,_0x26b5('0x10'));logger['debug'](_0x26b5('0x11'),_0x36e7a5,_0x26b5('0x10'),JSON[_0x26b5('0x12')](_0x4ce244));if(_0x4ce244[_0x26b5('0x13')]){if(_0x4ce244['error'][_0x26b5('0x14')]===0x1f4){logger[_0x26b5('0x13')](_0x26b5('0xf'),_0x36e7a5,_0x4ce244[_0x26b5('0x13')]['message']);return _0x2f555a(_0x4ce244[_0x26b5('0x13')][_0x26b5('0x15')]);}logger[_0x26b5('0x13')](_0x26b5('0xf'),_0x36e7a5,_0x4ce244[_0x26b5('0x13')][_0x26b5('0x15')]);return _0x578948(_0x4ce244[_0x26b5('0x13')]['message']);}else{logger['info'](_0x26b5('0xf'),_0x36e7a5,_0x26b5('0x10'));_0x578948(_0x4ce244[_0x26b5('0x16')][_0x26b5('0x15')]);}})[_0x26b5('0x17')](function(_0xe7d175){logger['error'](_0x26b5('0xf'),_0x36e7a5,_0xe7d175);_0x2f555a(_0xe7d175);});});}
\ No newline at end of file
+var _0x4f73=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','./chatWebsite.socket','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash'];(function(_0x42e988,_0xd8abe0){var _0x5ce1fb=function(_0x2531bc){while(--_0x2531bc){_0x42e988['push'](_0x42e988['shift']());}};_0x5ce1fb(++_0xd8abe0);}(_0x4f73,0xe0));var _0x34f7=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0x4f73[_0x5b013d];return _0x2b6eef;};'use strict';var _=require(_0x34f7('0x0'));var util=require(_0x34f7('0x1'));var moment=require(_0x34f7('0x2'));var BPromise=require(_0x34f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34f7('0x4'));var db=require(_0x34f7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x34f7('0x6'))('rpc');var config=require(_0x34f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x34f7('0x8')][_0x34f7('0x9')]({'port':0x232a});config[_0x34f7('0xa')]=_[_0x34f7('0xb')](config[_0x34f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34f7('0xa')]));require(_0x34f7('0xc'))[_0x34f7('0xd')](socket);function respondWithRpcPromise(_0x50f35d,_0x1b5893,_0x52abe8){return new BPromise(function(_0x161af4,_0x1e74ed){return client[_0x34f7('0xe')](_0x50f35d,_0x52abe8)[_0x34f7('0xf')](function(_0x367c5b){logger[_0x34f7('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x1b5893,_0x34f7('0x11'));logger['debug'](_0x34f7('0x12'),_0x1b5893,_0x34f7('0x11'),JSON[_0x34f7('0x13')](_0x367c5b));if(_0x367c5b['error']){if(_0x367c5b[_0x34f7('0x14')]['code']===0x1f4){logger[_0x34f7('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1b5893,_0x367c5b[_0x34f7('0x14')]['message']);return _0x1e74ed(_0x367c5b[_0x34f7('0x14')][_0x34f7('0x15')]);}logger[_0x34f7('0x14')](_0x34f7('0x16'),_0x1b5893,_0x367c5b[_0x34f7('0x14')][_0x34f7('0x15')]);return _0x161af4(_0x367c5b[_0x34f7('0x14')][_0x34f7('0x15')]);}else{logger[_0x34f7('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x1b5893,_0x34f7('0x11'));_0x161af4(_0x367c5b[_0x34f7('0x17')][_0x34f7('0x15')]);}})[_0x34f7('0x18')](function(_0x579cac){logger[_0x34f7('0x14')](_0x34f7('0x16'),_0x1b5893,_0x579cac);_0x1e74ed(_0x579cac);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a916200..93672e8 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 _0x434d=['update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x11e001,_0xb3367b){var _0x417419=function(_0x33f535){while(--_0x33f535){_0x11e001['push'](_0x11e001['shift']());}};_0x417419(++_0xb3367b);}(_0x434d,0x1ce));var _0xd434=function(_0x5e6473,_0x2ad2a6){_0x5e6473=_0x5e6473-0x0;var _0x3b4f9a=_0x434d[_0x5e6473];return _0x3b4f9a;};'use strict';var ChatWebsiteEvents=require(_0xd434('0x0'));var events=[_0xd434('0x1'),'remove',_0xd434('0x2')];function createListener(_0x200bd0,_0x1d4827){return function(_0x15ced3){_0x1d4827[_0xd434('0x3')](_0x200bd0,_0x15ced3);};}function removeListener(_0x526ed7,_0x114cf4){return function(){ChatWebsiteEvents[_0xd434('0x4')](_0x526ed7,_0x114cf4);};}exports[_0xd434('0x5')]=function(_0x2cab73){for(var _0x43b52e=0x0,_0x472cde=events[_0xd434('0x6')];_0x43b52e<_0x472cde;_0x43b52e++){var _0x1341b3=events[_0x43b52e];var _0x2a1aab=createListener(_0xd434('0x7')+_0x1341b3,_0x2cab73);ChatWebsiteEvents['on'](_0x1341b3,_0x2a1aab);}};
\ No newline at end of file
+var _0xb3aa=['remove','register','chatWebsite:','save'];(function(_0x5e95cd,_0x5f49be){var _0x386bb6=function(_0x4d5e19){while(--_0x4d5e19){_0x5e95cd['push'](_0x5e95cd['shift']());}};_0x386bb6(++_0x5f49be);}(_0xb3aa,0xd7));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xab3a('0x0'),_0xab3a('0x1'),'update'];function createListener(_0x1a638a,_0x202181){return function(_0x3f87cb){_0x202181['emit'](_0x1a638a,_0x3f87cb);};}function removeListener(_0x399c3e,_0x233977){return function(){ChatWebsiteEvents['removeListener'](_0x399c3e,_0x233977);};}exports[_0xab3a('0x2')]=function(_0x4f6cd5){for(var _0x749db0=0x0,_0x554d96=events['length'];_0x749db0<_0x554d96;_0x749db0++){var _0x55b7b8=events[_0x749db0];var _0x31a30d=createListener(_0xab3a('0x3')+_0x55b7b8,_0x4f6cd5);ChatWebsiteEvents['on'](_0x55b7b8,_0x31a30d);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2e3ce88..cdec796 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 _0xc5d7=['server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeAnswers','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/users','getAgents','post','create','addDisposition','join'];(function(_0x4c5778,_0x499674){var _0xaacba6=function(_0x3d6029){while(--_0x3d6029){_0x4c5778['push'](_0x4c5778['shift']());}};_0xaacba6(++_0x499674);}(_0xc5d7,0x13e));var _0x7c5d=function(_0x20768a,_0xc40b0e){_0x20768a=_0x20768a-0x0;var _0x2c5006=_0xc5d7[_0x20768a];return _0x2c5006;};'use strict';var multer=require('multer');var util=require(_0x7c5d('0x0'));var path=require(_0x7c5d('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c5d('0x2'));var router=express[_0x7c5d('0x3')]();var fs_extra=require(_0x7c5d('0x4'));var auth=require(_0x7c5d('0x5'));var interaction=require(_0x7c5d('0x6'));var config=require(_0x7c5d('0x7'));var controller=require(_0x7c5d('0x8'));router[_0x7c5d('0x9')]('/',auth['isAuthenticated'](),controller[_0x7c5d('0xa')]);router[_0x7c5d('0x9')](_0x7c5d('0xb'),auth[_0x7c5d('0xc')](),controller['describe']);router['get']('/:id',auth[_0x7c5d('0xc')](),controller['show']);router[_0x7c5d('0x9')](_0x7c5d('0xd'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0xe')]);router[_0x7c5d('0x9')](_0x7c5d('0xf'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x10')]);router[_0x7c5d('0x9')](_0x7c5d('0x11'),controller[_0x7c5d('0x12')]);router[_0x7c5d('0x9')](_0x7c5d('0x13'),controller['getAvatar']);router[_0x7c5d('0x9')](_0x7c5d('0x14'),controller['getCustomerAvatar']);router[_0x7c5d('0x9')](_0x7c5d('0x15'),controller[_0x7c5d('0x16')]);router[_0x7c5d('0x9')](_0x7c5d('0x17'),auth['isAuthenticated'](),controller[_0x7c5d('0x18')]);router[_0x7c5d('0x9')]('/:id/snippet',controller[_0x7c5d('0x19')]);router[_0x7c5d('0x9')](_0x7c5d('0x1a'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x1b')]);router['get'](_0x7c5d('0x1c'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x1d')]);router[_0x7c5d('0x9')]('/:id/fields',controller[_0x7c5d('0x1e')]);router[_0x7c5d('0x9')]('/:id/offline_messages',auth[_0x7c5d('0xc')](),controller['getOfflineMessages']);router['get'](_0x7c5d('0x1f'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x20')]);router[_0x7c5d('0x21')]('/',auth['isAuthenticated'](),controller[_0x7c5d('0x22')]);router[_0x7c5d('0x21')](_0x7c5d('0xd'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x23')]);router[_0x7c5d('0x21')](_0x7c5d('0xf'),auth[_0x7c5d('0xc')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53d913,_0x5f1c1c,_0x19a96f){_0x19a96f(null,path[_0x7c5d('0x24')](config['root'],_0x7c5d('0x25')));},'filename':function(_0x36c887,_0x199621,_0x38e0f7){_0x38e0f7(null,util[_0x7c5d('0x26')](_0x7c5d('0x27'),Date[_0x7c5d('0x28')](),_0x199621[_0x7c5d('0x29')]));}})});router[_0x7c5d('0x21')](_0x7c5d('0x11'),upload[_0x7c5d('0x2a')](_0x7c5d('0x2b')),controller[_0x7c5d('0x2c')]);var upload=multer({'storage':multer[_0x7c5d('0x2d')]({'destination':function(_0x516c52,_0x1a6916,_0x349d82){_0x349d82(null,path['join'](config[_0x7c5d('0x2e')],_0x7c5d('0x2f')));},'filename':function(_0x479a29,_0x29b533,_0x23dfe1){_0x23dfe1(null,util[_0x7c5d('0x26')](_0x7c5d('0x27'),Date[_0x7c5d('0x28')](),_0x29b533[_0x7c5d('0x29')]));}})});router[_0x7c5d('0x21')](_0x7c5d('0x13'),upload[_0x7c5d('0x2a')](_0x7c5d('0x2b')),controller[_0x7c5d('0x30')]);var upload=multer({'storage':multer[_0x7c5d('0x2d')]({'destination':function(_0x23778d,_0x2a8b19,_0x4c635c){_0x4c635c(null,path[_0x7c5d('0x24')](config[_0x7c5d('0x2e')],_0x7c5d('0x2f')));},'filename':function(_0x4b1060,_0x17665e,_0xaa734c){_0xaa734c(null,util[_0x7c5d('0x26')](_0x7c5d('0x27'),Date[_0x7c5d('0x28')](),_0x17665e['originalname']));}})});router[_0x7c5d('0x21')]('/:id/customer_avatar',upload[_0x7c5d('0x2a')](_0x7c5d('0x2b')),controller[_0x7c5d('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2432ab,_0x14ae16,_0x542c4e){_0x542c4e(null,path[_0x7c5d('0x24')](config[_0x7c5d('0x2e')],_0x7c5d('0x2f')));},'filename':function(_0x349034,_0x20ebd7,_0x4638a8){_0x4638a8(null,util['format']('%s-%s',Date[_0x7c5d('0x28')](),_0x20ebd7[_0x7c5d('0x29')]));}})});router[_0x7c5d('0x21')](_0x7c5d('0x15'),upload[_0x7c5d('0x2a')](_0x7c5d('0x2b')),controller[_0x7c5d('0x32')]);router['post'](_0x7c5d('0x33'),controller[_0x7c5d('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x7c5d('0x2d')]({'destination':function(_0x1627c4,_0x12e11c,_0x3836da){const _0xeb5229=path[_0x7c5d('0x24')](config[_0x7c5d('0x2e')],_0x7c5d('0x35'),'attachments',_0x7c5d('0x36'));fs_extra['ensureDir'](_0xeb5229,function(){_0x3836da(null,_0xeb5229);});},'filename':function(_0x38de49,_0x35bd1d,_0x549c79){const _0x152dc5=_0x35bd1d[_0x7c5d('0x29')][_0x7c5d('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a3280=path[_0x7c5d('0x38')](_0x152dc5);const _0x509784=Date[_0x7c5d('0x28')]()+'-'+_0x152dc5['replace'](_0x2a3280,'')+_0x2a3280;_0x549c79(null,_0x509784);}})});router[_0x7c5d('0x21')](_0x7c5d('0x39'),offlineUploadMulter['any'](),controller[_0x7c5d('0x3a')]);router['post'](_0x7c5d('0x17'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x3b')]);router[_0x7c5d('0x21')](_0x7c5d('0x1a'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x3c')]);router[_0x7c5d('0x21')]('/:id/proactive_actions',auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x3d')]);router[_0x7c5d('0x21')](_0x7c5d('0x1f'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x3e')]);router[_0x7c5d('0x3f')](_0x7c5d('0x40'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x41')]);router['delete'](_0x7c5d('0x40'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x42')]);router[_0x7c5d('0x43')](_0x7c5d('0xd'),auth[_0x7c5d('0xc')](),controller['removeDispositions']);router['delete'](_0x7c5d('0xf'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x44')]);router[_0x7c5d('0x43')](_0x7c5d('0x1f'),auth[_0x7c5d('0xc')](),controller[_0x7c5d('0x45')]);module[_0x7c5d('0x46')]=router;
\ No newline at end of file
+var _0x268c=['server/files','ensureDir','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','/:id/dispositions','getDispositions','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','create','addDisposition','post','/:id/canned_answers','addAnswer','diskStorage','join','format','%s-%s','now','originalname','file','addLogo','root','server/files/images/avatars/','/:id/avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify'];(function(_0x1c296e,_0x39ce65){var _0x108ba1=function(_0x316fd1){while(--_0x316fd1){_0x1c296e['push'](_0x1c296e['shift']());}};_0x108ba1(++_0x39ce65);}(_0x268c,0x158));var _0xc268=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x268c[_0x34a8c8];return _0x1fe6e5;};'use strict';var multer=require(_0xc268('0x0'));var util=require('util');var path=require(_0xc268('0x1'));var timeout=require('connect-timeout');var express=require(_0xc268('0x2'));var router=express[_0xc268('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc268('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc268('0x5'));var controller=require(_0xc268('0x6'));router[_0xc268('0x7')]('/',auth[_0xc268('0x8')](),controller[_0xc268('0x9')]);router[_0xc268('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc268('0x7')](_0xc268('0xa'),auth[_0xc268('0x8')](),controller['show']);router['get'](_0xc268('0xb'),auth[_0xc268('0x8')](),controller[_0xc268('0xc')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc268('0xd')]);router[_0xc268('0x7')]('/:id/logo',controller[_0xc268('0xe')]);router[_0xc268('0x7')]('/:id/avatar',controller[_0xc268('0xf')]);router[_0xc268('0x7')](_0xc268('0x10'),controller[_0xc268('0x11')]);router[_0xc268('0x7')](_0xc268('0x12'),controller[_0xc268('0x13')]);router[_0xc268('0x7')](_0xc268('0x14'),auth[_0xc268('0x8')](),controller[_0xc268('0x15')]);router[_0xc268('0x7')](_0xc268('0x16'),controller[_0xc268('0x17')]);router[_0xc268('0x7')](_0xc268('0x18'),auth[_0xc268('0x8')](),controller['getApplications']);router[_0xc268('0x7')](_0xc268('0x19'),auth[_0xc268('0x8')](),controller[_0xc268('0x1a')]);router['get'](_0xc268('0x1b'),controller[_0xc268('0x1c')]);router[_0xc268('0x7')](_0xc268('0x1d'),auth['isAuthenticated'](),controller[_0xc268('0x1e')]);router[_0xc268('0x7')]('/:id/users',auth[_0xc268('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xc268('0x1f')]);router['post'](_0xc268('0xb'),auth[_0xc268('0x8')](),controller[_0xc268('0x20')]);router[_0xc268('0x21')](_0xc268('0x22'),auth[_0xc268('0x8')](),controller[_0xc268('0x23')]);var upload=multer({'storage':multer[_0xc268('0x24')]({'destination':function(_0x2c43a8,_0x40242b,_0x3fdccf){_0x3fdccf(null,path[_0xc268('0x25')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1783a7,_0x16b366,_0x3a4471){_0x3a4471(null,util[_0xc268('0x26')](_0xc268('0x27'),Date[_0xc268('0x28')](),_0x16b366[_0xc268('0x29')]));}})});router[_0xc268('0x21')]('/:id/logo',upload['single'](_0xc268('0x2a')),controller[_0xc268('0x2b')]);var upload=multer({'storage':multer[_0xc268('0x24')]({'destination':function(_0x562aad,_0x28f0aa,_0x370713){_0x370713(null,path['join'](config[_0xc268('0x2c')],_0xc268('0x2d')));},'filename':function(_0xf6e923,_0x2590d8,_0x2a8394){_0x2a8394(null,util['format'](_0xc268('0x27'),Date[_0xc268('0x28')](),_0x2590d8[_0xc268('0x29')]));}})});router['post'](_0xc268('0x2e'),upload[_0xc268('0x2f')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xc268('0x24')]({'destination':function(_0x387b1b,_0x5ca419,_0x57ac59){_0x57ac59(null,path[_0xc268('0x25')](config[_0xc268('0x2c')],_0xc268('0x2d')));},'filename':function(_0xa3c1a6,_0x56688e,_0x5ecc35){_0x5ecc35(null,util[_0xc268('0x26')](_0xc268('0x27'),Date['now'](),_0x56688e['originalname']));}})});router[_0xc268('0x21')](_0xc268('0x10'),upload[_0xc268('0x2f')]('file'),controller[_0xc268('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19ca3f,_0x40cdb5,_0x5cbc2a){_0x5cbc2a(null,path[_0xc268('0x25')](config[_0xc268('0x2c')],_0xc268('0x2d')));},'filename':function(_0x594481,_0x1ef7cf,_0x4018e6){_0x4018e6(null,util[_0xc268('0x26')](_0xc268('0x27'),Date['now'](),_0x1ef7cf['originalname']));}})});router['post'](_0xc268('0x12'),upload[_0xc268('0x2f')]('file'),controller[_0xc268('0x31')]);router[_0xc268('0x21')](_0xc268('0x32'),controller[_0xc268('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xc268('0x24')]({'destination':function(_0x3998fa,_0x437bf4,_0x32caec){const _0x176522=path[_0xc268('0x25')](config[_0xc268('0x2c')],_0xc268('0x34'),'attachments','offline-chat');fs_extra[_0xc268('0x35')](_0x176522,function(){_0x32caec(null,_0x176522);});},'filename':function(_0x5bb95b,_0x9e5f55,_0x3b48b9){const _0x4dca9c=_0x9e5f55[_0xc268('0x29')][_0xc268('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x326fc7=path[_0xc268('0x37')](_0x4dca9c);const _0x468653=Date[_0xc268('0x28')]()+'-'+_0x4dca9c[_0xc268('0x36')](_0x326fc7,'')+_0x326fc7;_0x3b48b9(null,_0x468653);}})});router['post'](_0xc268('0x38'),offlineUploadMulter['any'](),controller['offline']);router[_0xc268('0x21')](_0xc268('0x14'),auth[_0xc268('0x8')](),controller[_0xc268('0x39')]);router[_0xc268('0x21')](_0xc268('0x18'),auth[_0xc268('0x8')](),controller[_0xc268('0x3a')]);router[_0xc268('0x21')](_0xc268('0x19'),auth['isAuthenticated'](),controller[_0xc268('0x3b')]);router[_0xc268('0x21')](_0xc268('0x3c'),auth[_0xc268('0x8')](),controller[_0xc268('0x3d')]);router['put'](_0xc268('0xa'),auth[_0xc268('0x8')](),controller[_0xc268('0x3e')]);router[_0xc268('0x3f')](_0xc268('0xa'),auth[_0xc268('0x8')](),controller[_0xc268('0x40')]);router[_0xc268('0x3f')](_0xc268('0xb'),auth[_0xc268('0x8')](),controller['removeDispositions']);router[_0xc268('0x3f')]('/:id/canned_answers',auth[_0xc268('0x8')](),controller['removeAnswers']);router[_0xc268('0x3f')]('/:id/users',auth[_0xc268('0x8')](),controller['removeAgents']);module[_0xc268('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 7e3f07b..6d423bb 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 _0x2e88=['exports','STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x52a529,_0x42c718){var _0x3668e7=function(_0x5e7297){while(--_0x5e7297){_0x52a529['push'](_0x52a529['shift']());}};_0x3668e7(++_0x42c718);}(_0x2e88,0x95));var _0x82e8=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x2e88[_0x4164f2];return _0x2575c7;};'use strict';var Sequelize=require(_0x82e8('0x0'));module[_0x82e8('0x1')]={'name':{'type':Sequelize[_0x82e8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x82e8('0x3')](_0x82e8('0x4'),_0x82e8('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x82e8('0x2')]}};
\ No newline at end of file
+var _0xc963=['AmazonAWS','Google','STRING','sequelize','ENUM'];(function(_0x5d6c36,_0x20eba2){var _0x40ce50=function(_0x60281a){while(--_0x60281a){_0x5d6c36['push'](_0x5d6c36['shift']());}};_0x40ce50(++_0x20eba2);}(_0xc963,0x17f));var _0x3c96=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0xc963[_0x5a7e78];return _0xa8d4a1;};'use strict';var Sequelize=require(_0x3c96('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3c96('0x1')](_0x3c96('0x2'),_0x3c96('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3c96('0x4')]},'data2':{'type':Sequelize[_0x3c96('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 5dfef50..bb2cde2 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x3a9e33,_0x5bbf05){var _0x19064f=function(_0x5374be){while(--_0x5374be){_0x3a9e33['push'](_0x3a9e33['shift']());}};_0x19064f(++_0x5bbf05);}(_0x7a54,0x106));var _0x47a5=function(_0x2472a6,_0x3f9da9){_0x2472a6=_0x2472a6-0x0;var _0x6a0cf3=_0x7a54[_0x2472a6];return _0x6a0cf3;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x15b6d8,_0x5dc45a){var _0x403ec4=function(_0x58f80e){while(--_0x58f80e){_0x15b6d8['push'](_0x15b6d8['shift']());}};_0x403ec4(++_0x5dc45a);}(_0x7a54,0x106));var _0x47a5=function(_0x3f22e3,_0x361330){_0x3f22e3=_0x3f22e3-0x0;var _0x2b6428=_0x7a54[_0x3f22e3];return _0x2b6428;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index be2836a..d46fecd 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 _0x9104=['path','../../config/environment','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','bluebird','request-promise'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x9104,0x69));var _0x4910=function(_0x1cddba,_0x24ce1a){_0x1cddba=_0x1cddba-0x0;var _0x492533=_0x9104[_0x1cddba];return _0x492533;};'use strict';var _=require('lodash');var util=require(_0x4910('0x0'));var logger=require(_0x4910('0x1'))(_0x4910('0x2'));var moment=require('moment');var BPromise=require(_0x4910('0x3'));var rp=require(_0x4910('0x4'));var fs=require('fs');var path=require(_0x4910('0x5'));var rimraf=require('rimraf');var config=require(_0x4910('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x4910('0x7')]=function(_0x1ff4ca,_0x2f7b45){return _0x1ff4ca[_0x4910('0x8')](_0x4910('0x9'),attributes,{'tableName':_0x4910('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc645=['bluebird','request-promise','path','rimraf','../../config/environment','lodash','moment'];(function(_0x3f61ae,_0xb85d6c){var _0x57d7e7=function(_0x23226a){while(--_0x23226a){_0x3f61ae['push'](_0x3f61ae['shift']());}};_0x57d7e7(++_0xb85d6c);}(_0xc645,0x18d));var _0x5c64=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xc645[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x5c64('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5c64('0x1'));var BPromise=require(_0x5c64('0x2'));var rp=require(_0x5c64('0x3'));var fs=require('fs');var path=require(_0x5c64('0x4'));var rimraf=require(_0x5c64('0x5'));var config=require(_0x5c64('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x134d1e,_0x51740e){return _0x134d1e['define']('CloudProvider',attributes,{'tableName':'cloud_providers','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 574df63..7b3bb3f 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 _0xf1f9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x50bd30,_0x45ecd0){var _0x5bdd72=function(_0x59638a){while(--_0x59638a){_0x50bd30['push'](_0x50bd30['shift']());}};_0x5bdd72(++_0x45ecd0);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x26997d,_0x5a64f8){_0x26997d=_0x26997d-0x0;var _0x44fe89=_0xf1f9[_0x26997d];return _0x44fe89;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});}
\ No newline at end of file
+var _0xd448=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x1a5ec7,_0x471384){var _0x54d7a7=function(_0x353ebc){while(--_0x353ebc){_0x1a5ec7['push'](_0x1a5ec7['shift']());}};_0x54d7a7(++_0x471384);}(_0xd448,0x172));var _0x8d44=function(_0x40dcfe,_0xea7784){_0x40dcfe=_0x40dcfe-0x0;var _0x389191=_0xd448[_0x40dcfe];return _0x389191;};'use strict';var _=require('lodash');var util=require(_0x8d44('0x0'));var moment=require(_0x8d44('0x1'));var BPromise=require(_0x8d44('0x2'));var rs=require(_0x8d44('0x3'));var fs=require('fs');var Redis=require(_0x8d44('0x4'));var db=require(_0x8d44('0x5'))['db'];var utils=require(_0x8d44('0x6'));var logger=require(_0x8d44('0x7'))(_0x8d44('0x8'));var config=require(_0x8d44('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d44('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56539b,_0x3b352e,_0x2cdb53){return new BPromise(function(_0x1680eb,_0x441fd3){return client['request'](_0x56539b,_0x2cdb53)[_0x8d44('0xb')](function(_0x2a5da6){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3b352e,_0x8d44('0xc'));logger[_0x8d44('0xd')](_0x8d44('0xe'),_0x3b352e,'request\x20sent',JSON[_0x8d44('0xf')](_0x2a5da6));if(_0x2a5da6[_0x8d44('0x10')]){if(_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x11')]===0x1f4){logger['error'](_0x8d44('0x12'),_0x3b352e,_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);return _0x441fd3(_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);}logger['error'](_0x8d44('0x12'),_0x3b352e,_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);return _0x1680eb(_0x2a5da6[_0x8d44('0x10')][_0x8d44('0x13')]);}else{logger['info'](_0x8d44('0x12'),_0x3b352e,_0x8d44('0xc'));_0x1680eb(_0x2a5da6[_0x8d44('0x14')][_0x8d44('0x13')]);}})[_0x8d44('0x15')](function(_0x2e7d11){logger[_0x8d44('0x10')](_0x8d44('0x12'),_0x3b352e,_0x2e7d11);_0x441fd3(_0x2e7d11);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index d6200cb..633de6a 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 _0xe676=['isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get'];(function(_0x149b83,_0x3d5689){var _0x142701=function(_0x26d0da){while(--_0x26d0da){_0x149b83['push'](_0x149b83['shift']());}};_0x142701(++_0x3d5689);}(_0xe676,0x1d5));var _0x6e67=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0xe676[_0x54de5d];return _0x1b349e;};'use strict';var multer=require(_0x6e67('0x0'));var util=require(_0x6e67('0x1'));var path=require(_0x6e67('0x2'));var timeout=require(_0x6e67('0x3'));var express=require(_0x6e67('0x4'));var router=express[_0x6e67('0x5')]();var fs_extra=require(_0x6e67('0x6'));var auth=require(_0x6e67('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6e67('0x8'));var controller=require(_0x6e67('0x9'));router[_0x6e67('0xa')]('/',auth[_0x6e67('0xb')](),controller['index']);router[_0x6e67('0xa')](_0x6e67('0xc'),auth['isAuthenticated'](),controller[_0x6e67('0xd')]);router[_0x6e67('0xe')]('/',auth[_0x6e67('0xb')](),controller[_0x6e67('0xf')]);router[_0x6e67('0x10')](_0x6e67('0xc'),auth[_0x6e67('0xb')](),controller['update']);router[_0x6e67('0x11')](_0x6e67('0xc'),auth['isAuthenticated'](),controller[_0x6e67('0x12')]);module[_0x6e67('0x13')]=router;
\ No newline at end of file
+var _0xec79=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0xd25b59,_0x217f8a){var _0x4cab47=function(_0x26362d){while(--_0x26362d){_0xd25b59['push'](_0xd25b59['shift']());}};_0x4cab47(++_0x217f8a);}(_0xec79,0x1b7));var _0x9ec7=function(_0x37f030,_0x1d5e22){_0x37f030=_0x37f030-0x0;var _0x55a37f=_0xec79[_0x37f030];return _0x55a37f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9ec7('0x0'));var timeout=require(_0x9ec7('0x1'));var express=require(_0x9ec7('0x2'));var router=express[_0x9ec7('0x3')]();var fs_extra=require(_0x9ec7('0x4'));var auth=require(_0x9ec7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ec7('0x6'));var controller=require('./cloudProvider.controller');router[_0x9ec7('0x7')]('/',auth[_0x9ec7('0x8')](),controller[_0x9ec7('0x9')]);router[_0x9ec7('0x7')](_0x9ec7('0xa'),auth[_0x9ec7('0x8')](),controller[_0x9ec7('0xb')]);router['post']('/',auth[_0x9ec7('0x8')](),controller['create']);router[_0x9ec7('0xc')](_0x9ec7('0xa'),auth['isAuthenticated'](),controller[_0x9ec7('0xd')]);router[_0x9ec7('0xe')](_0x9ec7('0xa'),auth['isAuthenticated'](),controller[_0x9ec7('0xf')]);module[_0x9ec7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 4a906b9..bd5b01e 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 _0x1641=['sequelize','exports','STRING'];(function(_0x558269,_0x54602e){var _0x15fd3c=function(_0x3a5a21){while(--_0x3a5a21){_0x558269['push'](_0x558269['shift']());}};_0x15fd3c(++_0x54602e);}(_0x1641,0x153));var _0x1164=function(_0x98b329,_0x534954){_0x98b329=_0x98b329-0x0;var _0x3afe18=_0x1641[_0x98b329];return _0x3afe18;};'use strict';var Sequelize=require(_0x1164('0x0'));module[_0x1164('0x1')]={'name':{'type':Sequelize[_0x1164('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1164('0x2')]},'companyId':{'type':Sequelize[_0x1164('0x2')]},'website':{'type':Sequelize[_0x1164('0x2')]},'phone':{'type':Sequelize[_0x1164('0x2')]},'fax':{'type':Sequelize[_0x1164('0x2')]},'type':{'type':Sequelize[_0x1164('0x2')]},'street':{'type':Sequelize[_0x1164('0x2')]},'postalCode':{'type':Sequelize[_0x1164('0x2')]},'city':{'type':Sequelize[_0x1164('0x2')]},'country':{'type':Sequelize[_0x1164('0x2')]},'email':{'type':Sequelize[_0x1164('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1164('0x2')]},'sStreet':{'type':Sequelize[_0x1164('0x2')]},'sPostalCode':{'type':Sequelize[_0x1164('0x2')]},'sCity':{'type':Sequelize[_0x1164('0x2')]},'sCountry':{'type':Sequelize[_0x1164('0x2')]},'description':{'type':Sequelize[_0x1164('0x2')]}};
\ No newline at end of file
+var _0xc16b=['STRING','name','sequelize','exports'];(function(_0x4579cb,_0x3d835d){var _0xf31830=function(_0x58825b){while(--_0x58825b){_0x4579cb['push'](_0x4579cb['shift']());}};_0xf31830(++_0x3d835d);}(_0xc16b,0x76));var _0xbc16=function(_0xa665a8,_0x5e7725){_0xa665a8=_0xa665a8-0x0;var _0x1ae40d=_0xc16b[_0xa665a8];return _0x1ae40d;};'use strict';var Sequelize=require(_0xbc16('0x0'));module[_0xbc16('0x1')]={'name':{'type':Sequelize[_0xbc16('0x2')],'unique':_0xbc16('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbc16('0x2')]},'companyId':{'type':Sequelize[_0xbc16('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbc16('0x2')]},'street':{'type':Sequelize[_0xbc16('0x2')]},'postalCode':{'type':Sequelize[_0xbc16('0x2')]},'city':{'type':Sequelize[_0xbc16('0x2')]},'country':{'type':Sequelize[_0xbc16('0x2')]},'email':{'type':Sequelize[_0xbc16('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xbc16('0x2')]},'sPostalCode':{'type':Sequelize[_0xbc16('0x2')]},'sCity':{'type':Sequelize[_0xbc16('0x2')]},'sCountry':{'type':Sequelize[_0xbc16('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d97a4c1..9eb32ac 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 _0x92c5=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','name','index','describe','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','filter','CmCompany','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','addContacts','CmContact','ids','omit','getContacts','findOne','rimraf'];(function(_0x9f2ed2,_0x575454){var _0x524305=function(_0x5ae103){while(--_0x5ae103){_0x9f2ed2['push'](_0x9f2ed2['shift']());}};_0x524305(++_0x575454);}(_0x92c5,0x18f));var _0x592c=function(_0x113c0f,_0x56aeec){_0x113c0f=_0x113c0f-0x0;var _0x19bdab=_0x92c5[_0x113c0f];return _0x19bdab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x592c('0x0'));var zipdir=require(_0x592c('0x1'));var jsonpatch=require(_0x592c('0x2'));var rp=require(_0x592c('0x3'));var moment=require(_0x592c('0x4'));var BPromise=require(_0x592c('0x5'));var Mustache=require('mustache');var util=require(_0x592c('0x6'));var path=require(_0x592c('0x7'));var sox=require(_0x592c('0x8'));var csv=require('to-csv');var ejs=require(_0x592c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x592c('0xa'));var crypto=require(_0x592c('0xb'));var jsforce=require(_0x592c('0xc'));var deskjs=require(_0x592c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x592c('0xe'));var authService=require(_0x592c('0xf'));var qs=require(_0x592c('0x10'));var as=require(_0x592c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x592c('0x12'))(_0x592c('0x13'));var utils=require(_0x592c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x592c('0x15'))['db'];function respondWithStatusCode(_0x20a5ff,_0x426a44){_0x426a44=_0x426a44||0xcc;return function(_0xf565f4){if(_0xf565f4){return _0x20a5ff[_0x592c('0x16')](_0x426a44);}return _0x20a5ff['status'](_0x426a44)['end']();};}function respondWithResult(_0x4b2a58,_0x3700fa){_0x3700fa=_0x3700fa||0xc8;return function(_0x316265){if(_0x316265){return _0x4b2a58[_0x592c('0x17')](_0x3700fa)[_0x592c('0x18')](_0x316265);}};}function respondWithFilteredResult(_0x36608a,_0x329320){return function(_0x43853f){if(_0x43853f){var _0x463e2d=typeof _0x329320['offset']==='undefined'&&typeof _0x329320[_0x592c('0x19')]===_0x592c('0x1a');var _0x42c44a=_0x43853f[_0x592c('0x1b')];var _0x585f7a=_0x463e2d?0x0:_0x329320[_0x592c('0x1c')];var _0x53e9e8=_0x463e2d?_0x43853f[_0x592c('0x1b')]:_0x329320[_0x592c('0x1c')]+_0x329320[_0x592c('0x19')];var _0x4183a0;if(_0x53e9e8>=_0x42c44a){_0x53e9e8=_0x42c44a;_0x4183a0=0xc8;}else{_0x4183a0=0xce;}_0x36608a[_0x592c('0x17')](_0x4183a0);return _0x36608a[_0x592c('0x1d')](_0x592c('0x1e'),_0x585f7a+'-'+_0x53e9e8+'/'+_0x42c44a)['json'](_0x43853f);}return null;};}function patchUpdates(_0x2b70ee){return function(_0x29be7b){try{jsonpatch['apply'](_0x29be7b,_0x2b70ee,!![]);}catch(_0x2b01eb){return BPromise[_0x592c('0x1f')](_0x2b01eb);}return _0x29be7b[_0x592c('0x20')]();};}function saveUpdates(_0x3b461f,_0x7fd1c1){return function(_0x588403){if(_0x588403){return _0x588403[_0x592c('0x21')](_0x3b461f)[_0x592c('0x22')](function(_0x1c7684){return _0x1c7684;});}return null;};}function removeEntity(_0x39d209,_0x4dd8fc){return function(_0x2fca76){if(_0x2fca76){return _0x2fca76[_0x592c('0x23')]()[_0x592c('0x22')](function(){var _0x384c8c=_0x2fca76['get']({'plain':!![]});var _0x151dd8='Companies';return db[_0x592c('0x24')][_0x592c('0x23')]({'where':{'type':_0x151dd8,'resourceId':_0x384c8c['id']}})[_0x592c('0x22')](function(){return _0x2fca76;});})[_0x592c('0x22')](function(){_0x39d209[_0x592c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5acc11,_0x2c76eb){return function(_0x5a85b6){if(!_0x5a85b6){_0x5acc11['sendStatus'](0x194);}return _0x5a85b6;};}function handleError(_0x3cf9cd,_0x24b680){_0x24b680=_0x24b680||0x1f4;return function(_0x3508ce){logger['error'](_0x3508ce['stack']);if(_0x3508ce['name']){delete _0x3508ce[_0x592c('0x25')];}_0x3cf9cd['status'](_0x24b680)['send'](_0x3508ce);};}exports[_0x592c('0x26')]=function(_0x2970d8,_0x1213b3){var _0x26f864={},_0x41218f={},_0xe7395={'count':0x0,'rows':[]};return db['CmCompany'][_0x592c('0x27')]()['then'](function(_0x292e78){_0x41218f[_0x592c('0x28')]=_[_0x592c('0x29')](_0x292e78);_0x41218f['query']=_['keys'](_0x2970d8['query']);_0x41218f['filters']=_[_0x592c('0x2a')](_0x41218f[_0x592c('0x28')],_0x41218f[_0x592c('0x2b')]);_0x26f864[_0x592c('0x2c')]=_['intersection'](_0x41218f[_0x592c('0x28')],qs[_0x592c('0x2d')](_0x2970d8['query'][_0x592c('0x2d')]));_0x26f864[_0x592c('0x2c')]=_0x26f864[_0x592c('0x2c')][_0x592c('0x2e')]?_0x26f864[_0x592c('0x2c')]:_0x41218f[_0x592c('0x28')];if(!_0x2970d8['query'][_0x592c('0x2f')](_0x592c('0x30'))){_0x26f864[_0x592c('0x19')]=qs['limit'](_0x2970d8[_0x592c('0x2b')][_0x592c('0x19')]);_0x26f864[_0x592c('0x1c')]=qs[_0x592c('0x1c')](_0x2970d8[_0x592c('0x2b')][_0x592c('0x1c')]);}_0x26f864[_0x592c('0x31')]=qs[_0x592c('0x32')](_0x2970d8[_0x592c('0x2b')]['sort']);_0x26f864[_0x592c('0x33')]=qs[_0x592c('0x34')](_[_0x592c('0x35')](_0x2970d8['query'],_0x41218f[_0x592c('0x34')]),_0x292e78);if(_0x2970d8['query']['filter']){_0x26f864[_0x592c('0x33')]=_[_0x592c('0x36')](_0x26f864[_0x592c('0x33')],{'$or':_[_0x592c('0x37')](_0x26f864['attributes'],function(_0x4840b){var _0x1ba059={};_0x1ba059[_0x4840b]={'$like':'%'+_0x2970d8[_0x592c('0x2b')][_0x592c('0x38')]+'%'};return _0x1ba059;})});}_0x26f864=_[_0x592c('0x36')]({},_0x26f864,_0x2970d8['options']);var _0x2e3f15={'where':_0x26f864[_0x592c('0x33')]};return db[_0x592c('0x39')]['count'](_0x2e3f15)[_0x592c('0x22')](function(_0x56876f){_0xe7395[_0x592c('0x1b')]=_0x56876f;if(_0x2970d8[_0x592c('0x2b')][_0x592c('0x3a')]){_0x26f864[_0x592c('0x3b')]=[{'all':!![]}];}return db[_0x592c('0x39')][_0x592c('0x3c')](_0x26f864);})[_0x592c('0x22')](function(_0x33220b){_0xe7395[_0x592c('0x3d')]=_0x33220b;return _0xe7395;})[_0x592c('0x22')](respondWithFilteredResult(_0x1213b3,_0x26f864))[_0x592c('0x3e')](handleError(_0x1213b3,null));})[_0x592c('0x3e')](handleError(_0x1213b3,null));};exports['show']=function(_0x5477d9,_0x559480){var _0x3fee88={'raw':![],'where':{'id':_0x5477d9[_0x592c('0x3f')]['id']}},_0x2db637={};_0x2db637['model']=_['keys'](db[_0x592c('0x39')][_0x592c('0x40')]);_0x2db637[_0x592c('0x2b')]=_[_0x592c('0x29')](_0x5477d9[_0x592c('0x2b')]);_0x2db637[_0x592c('0x34')]=_[_0x592c('0x2a')](_0x2db637[_0x592c('0x28')],_0x2db637[_0x592c('0x2b')]);_0x3fee88[_0x592c('0x2c')]=_[_0x592c('0x2a')](_0x2db637['model'],qs['fields'](_0x5477d9['query']['fields']));_0x3fee88[_0x592c('0x2c')]=_0x3fee88['attributes'][_0x592c('0x2e')]?_0x3fee88[_0x592c('0x2c')]:_0x2db637[_0x592c('0x28')];if(_0x5477d9[_0x592c('0x2b')][_0x592c('0x3a')]){_0x3fee88[_0x592c('0x3b')]=[{'all':!![]}];}_0x3fee88=_[_0x592c('0x36')]({},_0x3fee88,_0x5477d9[_0x592c('0x41')]);return db[_0x592c('0x39')]['find'](_0x3fee88)[_0x592c('0x22')](handleEntityNotFound(_0x559480,null))[_0x592c('0x22')](respondWithResult(_0x559480,null))[_0x592c('0x3e')](handleError(_0x559480,null));};exports[_0x592c('0x42')]=function(_0x4dbd59,_0x59bf59){return db[_0x592c('0x39')][_0x592c('0x42')](_0x4dbd59[_0x592c('0x43')],{})[_0x592c('0x22')](function(_0x2ead30){var _0x118c5c=_0x4dbd59['user'][_0x592c('0x44')]({'plain':!![]});if(!_0x118c5c)throw new Error(_0x592c('0x45'));if(_0x118c5c[_0x592c('0x46')]==='user'){var _0x37f482=_0x2ead30[_0x592c('0x44')]({'plain':!![]});var _0x3af676=_0x592c('0x47');return db[_0x592c('0x48')][_0x592c('0x49')]({'where':{'name':_0x3af676,'userProfileId':_0x118c5c['userProfileId']},'raw':!![]})[_0x592c('0x22')](function(_0xaa9bdb){if(_0xaa9bdb&&_0xaa9bdb['autoAssociation']===0x0){return db[_0x592c('0x24')][_0x592c('0x42')]({'name':_0x37f482[_0x592c('0x25')],'resourceId':_0x37f482['id'],'type':_0xaa9bdb['name'],'sectionId':_0xaa9bdb['id']},{})['then'](function(){return _0x2ead30;});}else{return _0x2ead30;}})[_0x592c('0x3e')](function(_0x1077b4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1077b4);throw _0x1077b4;});}return _0x2ead30;})[_0x592c('0x22')](respondWithResult(_0x59bf59,0xc9))[_0x592c('0x3e')](handleError(_0x59bf59,null));};exports['update']=function(_0xed0663,_0x596e18){if(_0xed0663['body']['id']){delete _0xed0663['body']['id'];}return db[_0x592c('0x39')]['find']({'where':{'id':_0xed0663['params']['id']}})[_0x592c('0x22')](handleEntityNotFound(_0x596e18,null))[_0x592c('0x22')](saveUpdates(_0xed0663[_0x592c('0x43')],null))[_0x592c('0x22')](respondWithResult(_0x596e18,null))[_0x592c('0x3e')](handleError(_0x596e18,null));};exports[_0x592c('0x23')]=function(_0x1a12b7,_0x42d73c){return db[_0x592c('0x39')][_0x592c('0x49')]({'where':{'id':_0x1a12b7[_0x592c('0x3f')]['id']}})[_0x592c('0x22')](handleEntityNotFound(_0x42d73c,null))[_0x592c('0x22')](removeEntity(_0x42d73c,null))[_0x592c('0x3e')](handleError(_0x42d73c,null));};exports[_0x592c('0x27')]=function(_0x971ed0,_0x1235a8){return db[_0x592c('0x39')]['describe']()[_0x592c('0x22')](respondWithResult(_0x1235a8,null))[_0x592c('0x3e')](handleError(_0x1235a8,null));};exports[_0x592c('0x4a')]=function(_0x2001c6,_0x36a21f,_0x216178){return db[_0x592c('0x4b')][_0x592c('0x49')]({'where':{'id':_0x2001c6[_0x592c('0x3f')]['id']}})[_0x592c('0x22')](handleEntityNotFound(_0x36a21f,null))[_0x592c('0x22')](function(_0x53e01c){if(_0x53e01c){return _0x53e01c['addContacts'](_0x2001c6[_0x592c('0x43')][_0x592c('0x4c')],_[_0x592c('0x4d')](_0x2001c6['body'],[_0x592c('0x4c'),'id'])||{});}})[_0x592c('0x22')](respondWithResult(_0x36a21f,null))[_0x592c('0x3e')](handleError(_0x36a21f,null));};exports[_0x592c('0x4e')]=function(_0x16ee9f,_0x20c874,_0x216a1c){var _0xbcab10={};var _0x3fc9a8={};var _0x425025;var _0x5afbed;return db['CmCompany'][_0x592c('0x4f')]({'where':{'id':_0x16ee9f[_0x592c('0x3f')]['id']}})[_0x592c('0x22')](handleEntityNotFound(_0x20c874,null))[_0x592c('0x22')](function(_0x5cc0b3){if(_0x5cc0b3){_0x425025=_0x5cc0b3;_0x3fc9a8[_0x592c('0x28')]=_[_0x592c('0x29')](db[_0x592c('0x4b')][_0x592c('0x40')]);_0x3fc9a8['query']=_[_0x592c('0x29')](_0x16ee9f[_0x592c('0x2b')]);_0x3fc9a8['filters']=_['intersection'](_0x3fc9a8['model'],_0x3fc9a8['query']);_0xbcab10[_0x592c('0x2c')]=_[_0x592c('0x2a')](_0x3fc9a8[_0x592c('0x28')],qs['fields'](_0x16ee9f[_0x592c('0x2b')][_0x592c('0x2d')]));_0xbcab10[_0x592c('0x2c')]=_0xbcab10[_0x592c('0x2c')][_0x592c('0x2e')]?_0xbcab10['attributes']:_0x3fc9a8[_0x592c('0x28')];_0xbcab10[_0x592c('0x31')]=qs[_0x592c('0x32')](_0x16ee9f[_0x592c('0x2b')][_0x592c('0x32')]);_0xbcab10['where']=qs['filters'](_['pick'](_0x16ee9f[_0x592c('0x2b')],_0x3fc9a8[_0x592c('0x34')]));if(_0x16ee9f[_0x592c('0x2b')][_0x592c('0x38')]){_0xbcab10[_0x592c('0x33')]=_[_0x592c('0x36')](_0xbcab10[_0x592c('0x33')],{'$or':_['map'](_0xbcab10[_0x592c('0x2c')],function(_0x57bcfb){var _0x487454={};_0x487454[_0x57bcfb]={'$like':'%'+_0x16ee9f[_0x592c('0x2b')]['filter']+'%'};return _0x487454;})});}_0xbcab10=_[_0x592c('0x36')]({},_0xbcab10,_0x16ee9f[_0x592c('0x41')]);return _0x425025[_0x592c('0x4e')](_0xbcab10);}})[_0x592c('0x22')](function(_0x56d07e){if(_0x56d07e){_0x5afbed=_0x56d07e[_0x592c('0x2e')];if(!_0x16ee9f[_0x592c('0x2b')][_0x592c('0x2f')](_0x592c('0x30'))){_0xbcab10[_0x592c('0x19')]=qs['limit'](_0x16ee9f[_0x592c('0x2b')][_0x592c('0x19')]);_0xbcab10[_0x592c('0x1c')]=qs['offset'](_0x16ee9f['query'][_0x592c('0x1c')]);}return _0x425025[_0x592c('0x4e')](_0xbcab10);}})[_0x592c('0x22')](function(_0x5176ec){if(_0x5176ec){return _0x5176ec?{'count':_0x5afbed,'rows':_0x5176ec}:null;}})[_0x592c('0x22')](respondWithResult(_0x20c874,null))[_0x592c('0x3e')](handleError(_0x20c874,null));};
\ No newline at end of file
+var _0x0854=['where','pick','filter','merge','map','options','include','findAll','rows','catch','show','rawAttributes','intersection','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','findOne','order','getContacts','eml-format','rimraf','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x3fd782,_0x86863){var _0x2bef90=function(_0x1301ce){while(--_0x1301ce){_0x3fd782['push'](_0x3fd782['shift']());}};_0x2bef90(++_0x86863);}(_0x0854,0x168));var _0x4085=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0854[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x4085('0x0'));var rimraf=require(_0x4085('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4085('0x2'));var rp=require('request-promise');var moment=require(_0x4085('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4085('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4085('0x5'));var csv=require('to-csv');var ejs=require(_0x4085('0x6'));var fs=require('fs');var fs_extra=require(_0x4085('0x7'));var _=require(_0x4085('0x8'));var squel=require(_0x4085('0x9'));var crypto=require(_0x4085('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4085('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4085('0xc'));var Papa=require(_0x4085('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4085('0xe'));var as=require(_0x4085('0xf'));var hardwareService=require(_0x4085('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4085('0x11'));var config=require(_0x4085('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4085('0x13'))['db'];function respondWithStatusCode(_0x2a388e,_0x2285ab){_0x2285ab=_0x2285ab||0xcc;return function(_0x3d6f3c){if(_0x3d6f3c){return _0x2a388e['sendStatus'](_0x2285ab);}return _0x2a388e[_0x4085('0x14')](_0x2285ab)[_0x4085('0x15')]();};}function respondWithResult(_0x6e810,_0x54d3a8){_0x54d3a8=_0x54d3a8||0xc8;return function(_0x2a8b53){if(_0x2a8b53){return _0x6e810['status'](_0x54d3a8)[_0x4085('0x16')](_0x2a8b53);}};}function respondWithFilteredResult(_0x1d3371,_0x20231c){return function(_0x3baafc){if(_0x3baafc){var _0x117546=typeof _0x20231c[_0x4085('0x17')]===_0x4085('0x18')&&typeof _0x20231c[_0x4085('0x19')]==='undefined';var _0x461d81=_0x3baafc[_0x4085('0x1a')];var _0x218411=_0x117546?0x0:_0x20231c[_0x4085('0x17')];var _0x5041df=_0x117546?_0x3baafc[_0x4085('0x1a')]:_0x20231c[_0x4085('0x17')]+_0x20231c[_0x4085('0x19')];var _0x6124c7;if(_0x5041df>=_0x461d81){_0x5041df=_0x461d81;_0x6124c7=0xc8;}else{_0x6124c7=0xce;}_0x1d3371[_0x4085('0x14')](_0x6124c7);return _0x1d3371[_0x4085('0x1b')](_0x4085('0x1c'),_0x218411+'-'+_0x5041df+'/'+_0x461d81)[_0x4085('0x16')](_0x3baafc);}return null;};}function patchUpdates(_0x3227da){return function(_0x2c1ca7){try{jsonpatch['apply'](_0x2c1ca7,_0x3227da,!![]);}catch(_0x5edd2f){return BPromise['reject'](_0x5edd2f);}return _0x2c1ca7[_0x4085('0x1d')]();};}function saveUpdates(_0x5326c0,_0x4b1a2a){return function(_0x338dc5){if(_0x338dc5){return _0x338dc5[_0x4085('0x1e')](_0x5326c0)['then'](function(_0x5c165e){return _0x5c165e;});}return null;};}function removeEntity(_0x553b90,_0x5b7d30){return function(_0x4b9f9b){if(_0x4b9f9b){return _0x4b9f9b[_0x4085('0x1f')]()[_0x4085('0x20')](function(){var _0x444ad2=_0x4b9f9b['get']({'plain':!![]});var _0x82fa77=_0x4085('0x21');return db[_0x4085('0x22')]['destroy']({'where':{'type':_0x82fa77,'resourceId':_0x444ad2['id']}})[_0x4085('0x20')](function(){return _0x4b9f9b;});})[_0x4085('0x20')](function(){_0x553b90[_0x4085('0x14')](0xcc)[_0x4085('0x15')]();});}};}function handleEntityNotFound(_0x328386,_0x5dc080){return function(_0x42c8e1){if(!_0x42c8e1){_0x328386['sendStatus'](0x194);}return _0x42c8e1;};}function handleError(_0x139823,_0x4aca23){_0x4aca23=_0x4aca23||0x1f4;return function(_0x48118a){logger[_0x4085('0x23')](_0x48118a['stack']);if(_0x48118a[_0x4085('0x24')]){delete _0x48118a[_0x4085('0x24')];}_0x139823[_0x4085('0x14')](_0x4aca23)[_0x4085('0x25')](_0x48118a);};}exports[_0x4085('0x26')]=function(_0x10e2a0,_0x47cabd){var _0x882601={},_0x24b67a={},_0x6326f8={'count':0x0,'rows':[]};return db[_0x4085('0x27')][_0x4085('0x28')]()[_0x4085('0x20')](function(_0x35d960){_0x24b67a[_0x4085('0x29')]=_[_0x4085('0x2a')](_0x35d960);_0x24b67a[_0x4085('0x2b')]=_[_0x4085('0x2a')](_0x10e2a0[_0x4085('0x2b')]);_0x24b67a[_0x4085('0x2c')]=_['intersection'](_0x24b67a[_0x4085('0x29')],_0x24b67a[_0x4085('0x2b')]);_0x882601[_0x4085('0x2d')]=_['intersection'](_0x24b67a[_0x4085('0x29')],qs[_0x4085('0x2e')](_0x10e2a0[_0x4085('0x2b')]['fields']));_0x882601[_0x4085('0x2d')]=_0x882601[_0x4085('0x2d')]['length']?_0x882601[_0x4085('0x2d')]:_0x24b67a[_0x4085('0x29')];if(!_0x10e2a0[_0x4085('0x2b')][_0x4085('0x2f')](_0x4085('0x30'))){_0x882601[_0x4085('0x19')]=qs[_0x4085('0x19')](_0x10e2a0[_0x4085('0x2b')][_0x4085('0x19')]);_0x882601['offset']=qs[_0x4085('0x17')](_0x10e2a0[_0x4085('0x2b')]['offset']);}_0x882601['order']=qs['sort'](_0x10e2a0[_0x4085('0x2b')][_0x4085('0x31')]);_0x882601[_0x4085('0x32')]=qs[_0x4085('0x2c')](_[_0x4085('0x33')](_0x10e2a0[_0x4085('0x2b')],_0x24b67a[_0x4085('0x2c')]),_0x35d960);if(_0x10e2a0[_0x4085('0x2b')][_0x4085('0x34')]){_0x882601[_0x4085('0x32')]=_[_0x4085('0x35')](_0x882601[_0x4085('0x32')],{'$or':_[_0x4085('0x36')](_0x882601[_0x4085('0x2d')],function(_0x5c821f){var _0x464579={};_0x464579[_0x5c821f]={'$like':'%'+_0x10e2a0[_0x4085('0x2b')]['filter']+'%'};return _0x464579;})});}_0x882601=_[_0x4085('0x35')]({},_0x882601,_0x10e2a0[_0x4085('0x37')]);var _0x23565c={'where':_0x882601[_0x4085('0x32')]};return db['CmCompany'][_0x4085('0x1a')](_0x23565c)[_0x4085('0x20')](function(_0x4a21ca){_0x6326f8[_0x4085('0x1a')]=_0x4a21ca;if(_0x10e2a0[_0x4085('0x2b')]['includeAll']){_0x882601[_0x4085('0x38')]=[{'all':!![]}];}return db[_0x4085('0x27')][_0x4085('0x39')](_0x882601);})[_0x4085('0x20')](function(_0x54e255){_0x6326f8[_0x4085('0x3a')]=_0x54e255;return _0x6326f8;})[_0x4085('0x20')](respondWithFilteredResult(_0x47cabd,_0x882601))[_0x4085('0x3b')](handleError(_0x47cabd,null));})['catch'](handleError(_0x47cabd,null));};exports[_0x4085('0x3c')]=function(_0x35a58f,_0x962f34){var _0x58f74e={'raw':![],'where':{'id':_0x35a58f['params']['id']}},_0x4c0d6b={};_0x4c0d6b[_0x4085('0x29')]=_[_0x4085('0x2a')](db[_0x4085('0x27')][_0x4085('0x3d')]);_0x4c0d6b[_0x4085('0x2b')]=_[_0x4085('0x2a')](_0x35a58f[_0x4085('0x2b')]);_0x4c0d6b[_0x4085('0x2c')]=_['intersection'](_0x4c0d6b['model'],_0x4c0d6b[_0x4085('0x2b')]);_0x58f74e['attributes']=_[_0x4085('0x3e')](_0x4c0d6b[_0x4085('0x29')],qs['fields'](_0x35a58f[_0x4085('0x2b')]['fields']));_0x58f74e[_0x4085('0x2d')]=_0x58f74e[_0x4085('0x2d')][_0x4085('0x3f')]?_0x58f74e[_0x4085('0x2d')]:_0x4c0d6b[_0x4085('0x29')];if(_0x35a58f[_0x4085('0x2b')][_0x4085('0x40')]){_0x58f74e[_0x4085('0x38')]=[{'all':!![]}];}_0x58f74e=_[_0x4085('0x35')]({},_0x58f74e,_0x35a58f[_0x4085('0x37')]);return db[_0x4085('0x27')][_0x4085('0x41')](_0x58f74e)[_0x4085('0x20')](handleEntityNotFound(_0x962f34,null))['then'](respondWithResult(_0x962f34,null))[_0x4085('0x3b')](handleError(_0x962f34,null));};exports[_0x4085('0x42')]=function(_0x9f030f,_0xbd228e){return db[_0x4085('0x27')]['create'](_0x9f030f[_0x4085('0x43')],{})[_0x4085('0x20')](function(_0x2ddfaa){var _0x47c575=_0x9f030f[_0x4085('0x44')][_0x4085('0x45')]({'plain':!![]});if(!_0x47c575)throw new Error(_0x4085('0x46'));if(_0x47c575[_0x4085('0x47')]===_0x4085('0x44')){var _0x3567c5=_0x2ddfaa[_0x4085('0x45')]({'plain':!![]});var _0x5b868e='Companies';return db[_0x4085('0x48')][_0x4085('0x41')]({'where':{'name':_0x5b868e,'userProfileId':_0x47c575['userProfileId']},'raw':!![]})[_0x4085('0x20')](function(_0x4d8597){if(_0x4d8597&&_0x4d8597['autoAssociation']===0x0){return db[_0x4085('0x22')]['create']({'name':_0x3567c5[_0x4085('0x24')],'resourceId':_0x3567c5['id'],'type':_0x4d8597[_0x4085('0x24')],'sectionId':_0x4d8597['id']},{})['then'](function(){return _0x2ddfaa;});}else{return _0x2ddfaa;}})[_0x4085('0x3b')](function(_0x4b1503){logger[_0x4085('0x23')](_0x4085('0x49'),_0x4b1503);throw _0x4b1503;});}return _0x2ddfaa;})[_0x4085('0x20')](respondWithResult(_0xbd228e,0xc9))['catch'](handleError(_0xbd228e,null));};exports[_0x4085('0x1e')]=function(_0xb40a8a,_0x24019b){if(_0xb40a8a[_0x4085('0x43')]['id']){delete _0xb40a8a[_0x4085('0x43')]['id'];}return db[_0x4085('0x27')][_0x4085('0x41')]({'where':{'id':_0xb40a8a['params']['id']}})[_0x4085('0x20')](handleEntityNotFound(_0x24019b,null))[_0x4085('0x20')](saveUpdates(_0xb40a8a[_0x4085('0x43')],null))[_0x4085('0x20')](respondWithResult(_0x24019b,null))[_0x4085('0x3b')](handleError(_0x24019b,null));};exports[_0x4085('0x1f')]=function(_0x389a6c,_0x1a9027){return db['CmCompany']['find']({'where':{'id':_0x389a6c[_0x4085('0x4a')]['id']}})[_0x4085('0x20')](handleEntityNotFound(_0x1a9027,null))[_0x4085('0x20')](removeEntity(_0x1a9027,null))['catch'](handleError(_0x1a9027,null));};exports[_0x4085('0x28')]=function(_0x1f2d1d,_0x4835b0){return db[_0x4085('0x27')][_0x4085('0x28')]()[_0x4085('0x20')](respondWithResult(_0x4835b0,null))[_0x4085('0x3b')](handleError(_0x4835b0,null));};exports['addContacts']=function(_0x33b685,_0x134ebd,_0x5838a1){return db[_0x4085('0x4b')]['find']({'where':{'id':_0x33b685['params']['id']}})[_0x4085('0x20')](handleEntityNotFound(_0x134ebd,null))[_0x4085('0x20')](function(_0x3cf41a){if(_0x3cf41a){return _0x3cf41a[_0x4085('0x4c')](_0x33b685[_0x4085('0x43')][_0x4085('0x4d')],_[_0x4085('0x4e')](_0x33b685[_0x4085('0x43')],[_0x4085('0x4d'),'id'])||{});}})[_0x4085('0x20')](respondWithResult(_0x134ebd,null))[_0x4085('0x3b')](handleError(_0x134ebd,null));};exports['getContacts']=function(_0x34846e,_0x4905e5,_0x49c211){var _0x5edf7c={};var _0x377005={};var _0x76838a;var _0x451c16;return db[_0x4085('0x27')][_0x4085('0x4f')]({'where':{'id':_0x34846e[_0x4085('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4905e5,null))[_0x4085('0x20')](function(_0x2c5b81){if(_0x2c5b81){_0x76838a=_0x2c5b81;_0x377005[_0x4085('0x29')]=_[_0x4085('0x2a')](db[_0x4085('0x4b')][_0x4085('0x3d')]);_0x377005[_0x4085('0x2b')]=_[_0x4085('0x2a')](_0x34846e['query']);_0x377005[_0x4085('0x2c')]=_['intersection'](_0x377005[_0x4085('0x29')],_0x377005[_0x4085('0x2b')]);_0x5edf7c['attributes']=_[_0x4085('0x3e')](_0x377005['model'],qs['fields'](_0x34846e[_0x4085('0x2b')][_0x4085('0x2e')]));_0x5edf7c[_0x4085('0x2d')]=_0x5edf7c['attributes']['length']?_0x5edf7c[_0x4085('0x2d')]:_0x377005[_0x4085('0x29')];_0x5edf7c[_0x4085('0x50')]=qs['sort'](_0x34846e[_0x4085('0x2b')][_0x4085('0x31')]);_0x5edf7c[_0x4085('0x32')]=qs[_0x4085('0x2c')](_[_0x4085('0x33')](_0x34846e[_0x4085('0x2b')],_0x377005[_0x4085('0x2c')]));if(_0x34846e['query']['filter']){_0x5edf7c[_0x4085('0x32')]=_[_0x4085('0x35')](_0x5edf7c[_0x4085('0x32')],{'$or':_[_0x4085('0x36')](_0x5edf7c['attributes'],function(_0x2a6d77){var _0x4b3c7b={};_0x4b3c7b[_0x2a6d77]={'$like':'%'+_0x34846e['query'][_0x4085('0x34')]+'%'};return _0x4b3c7b;})});}_0x5edf7c=_[_0x4085('0x35')]({},_0x5edf7c,_0x34846e[_0x4085('0x37')]);return _0x76838a[_0x4085('0x51')](_0x5edf7c);}})[_0x4085('0x20')](function(_0x522ca3){if(_0x522ca3){_0x451c16=_0x522ca3[_0x4085('0x3f')];if(!_0x34846e[_0x4085('0x2b')][_0x4085('0x2f')](_0x4085('0x30'))){_0x5edf7c[_0x4085('0x19')]=qs[_0x4085('0x19')](_0x34846e[_0x4085('0x2b')][_0x4085('0x19')]);_0x5edf7c[_0x4085('0x17')]=qs[_0x4085('0x17')](_0x34846e[_0x4085('0x2b')]['offset']);}return _0x76838a['getContacts'](_0x5edf7c);}})['then'](function(_0x5785ed){if(_0x5785ed){return _0x5785ed?{'count':_0x451c16,'rows':_0x5785ed}:null;}})['then'](respondWithResult(_0x4905e5,null))['catch'](handleError(_0x4905e5,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b55acbe..e3d7439 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 _0xf1ab=['./cmCompany.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5ee2db,_0x47ea25){var _0x2cab07=function(_0x4643f7){while(--_0x4643f7){_0x5ee2db['push'](_0x5ee2db['shift']());}};_0x2cab07(++_0x47ea25);}(_0xf1ab,0x1cf));var _0xbf1a=function(_0xc0b0dc,_0x575b4d){_0xc0b0dc=_0xc0b0dc-0x0;var _0x20e68e=_0xf1ab[_0xc0b0dc];return _0x20e68e;};'use strict';var _=require(_0xbf1a('0x0'));var util=require('util');var logger=require(_0xbf1a('0x1'))(_0xbf1a('0x2'));var moment=require(_0xbf1a('0x3'));var BPromise=require(_0xbf1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf1a('0x5'));var rimraf=require('rimraf');var config=require(_0xbf1a('0x6'));var attributes=require(_0xbf1a('0x7'));module[_0xbf1a('0x8')]=function(_0x58e991,_0x548486){return _0x58e991[_0xbf1a('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x174d=['request-promise','path','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','api','moment'];(function(_0xe83ac5,_0x279b67){var _0x3df16e=function(_0x5a1577){while(--_0x5a1577){_0xe83ac5['push'](_0xe83ac5['shift']());}};_0x3df16e(++_0x279b67);}(_0x174d,0x1ca));var _0xd174=function(_0x4b9e48,_0x3e80f9){_0x4b9e48=_0x4b9e48-0x0;var _0x26fdc4=_0x174d[_0x4b9e48];return _0x26fdc4;};'use strict';var _=require('lodash');var util=require(_0xd174('0x0'));var logger=require(_0xd174('0x1'))(_0xd174('0x2'));var moment=require(_0xd174('0x3'));var BPromise=require('bluebird');var rp=require(_0xd174('0x4'));var fs=require('fs');var path=require(_0xd174('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd174('0x6'));module[_0xd174('0x7')]=function(_0x39df8f,_0x724d48){return _0x39df8f[_0xd174('0x8')](_0xd174('0x9'),attributes,{'tableName':_0xd174('0xa'),'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 6bd01e3..3a655e7 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 _0x148b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','ioredis'];(function(_0x1a12c8,_0x2df4dc){var _0x305109=function(_0x438bfb){while(--_0x438bfb){_0x1a12c8['push'](_0x1a12c8['shift']());}};_0x305109(++_0x2df4dc);}(_0x148b,0x179));var _0xb148=function(_0x1bafe3,_0x2a22aa){_0x1bafe3=_0x1bafe3-0x0;var _0x15c0d3=_0x148b[_0x1bafe3];return _0x15c0d3;};'use strict';var _=require(_0xb148('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb148('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb148('0x2'));var db=require(_0xb148('0x3'))['db'];var utils=require(_0xb148('0x4'));var logger=require(_0xb148('0x5'))(_0xb148('0x6'));var config=require(_0xb148('0x7'));var jayson=require(_0xb148('0x8'));var client=jayson[_0xb148('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5abc46,_0x146e06,_0x16132f){return new BPromise(function(_0x26839b,_0x3aab04){return client['request'](_0x5abc46,_0x16132f)['then'](function(_0x358bfb){logger[_0xb148('0xa')](_0xb148('0xb'),_0x146e06,_0xb148('0xc'));logger[_0xb148('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x146e06,'request\x20sent',JSON['stringify'](_0x358bfb));if(_0x358bfb[_0xb148('0xe')]){if(_0x358bfb['error'][_0xb148('0xf')]===0x1f4){logger[_0xb148('0xe')](_0xb148('0xb'),_0x146e06,_0x358bfb[_0xb148('0xe')][_0xb148('0x10')]);return _0x3aab04(_0x358bfb[_0xb148('0xe')]['message']);}logger[_0xb148('0xe')]('CmCompany,\x20%s,\x20%s',_0x146e06,_0x358bfb['error'][_0xb148('0x10')]);return _0x26839b(_0x358bfb[_0xb148('0xe')][_0xb148('0x10')]);}else{logger[_0xb148('0xa')](_0xb148('0xb'),_0x146e06,_0xb148('0xc'));_0x26839b(_0x358bfb[_0xb148('0x11')][_0xb148('0x10')]);}})[_0xb148('0x12')](function(_0x2a39cd){logger[_0xb148('0xe')](_0xb148('0xb'),_0x146e06,_0x2a39cd);_0x3aab04(_0x2a39cd);});});}
\ No newline at end of file
+var _0x26b5=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26b5,0xf8));var _0x526b=function(_0x39396d,_0x17465a){_0x39396d=_0x39396d-0x0;var _0x15eb10=_0x26b5[_0x39396d];return _0x15eb10;};'use strict';var _=require(_0x526b('0x0'));var util=require(_0x526b('0x1'));var moment=require(_0x526b('0x2'));var BPromise=require(_0x526b('0x3'));var rs=require(_0x526b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x526b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x526b('0x6'))(_0x526b('0x7'));var config=require('../../config/environment');var jayson=require(_0x526b('0x8'));var client=jayson['client'][_0x526b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f8b07,_0x1225c3,_0x5d0c39){return new BPromise(function(_0x44d2cc,_0x459a44){return client[_0x526b('0xa')](_0x3f8b07,_0x5d0c39)[_0x526b('0xb')](function(_0x311413){logger[_0x526b('0xc')](_0x526b('0xd'),_0x1225c3,'request\x20sent');logger[_0x526b('0xe')](_0x526b('0xf'),_0x1225c3,_0x526b('0x10'),JSON[_0x526b('0x11')](_0x311413));if(_0x311413['error']){if(_0x311413[_0x526b('0x12')][_0x526b('0x13')]===0x1f4){logger[_0x526b('0x12')](_0x526b('0xd'),_0x1225c3,_0x311413[_0x526b('0x12')][_0x526b('0x14')]);return _0x459a44(_0x311413[_0x526b('0x12')][_0x526b('0x14')]);}logger[_0x526b('0x12')](_0x526b('0xd'),_0x1225c3,_0x311413[_0x526b('0x12')]['message']);return _0x44d2cc(_0x311413[_0x526b('0x12')]['message']);}else{logger['info'](_0x526b('0xd'),_0x1225c3,_0x526b('0x10'));_0x44d2cc(_0x311413[_0x526b('0x15')]['message']);}})[_0x526b('0x16')](function(_0x5c3611){logger[_0x526b('0x12')](_0x526b('0xd'),_0x1225c3,_0x5c3611);_0x459a44(_0x5c3611);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 99116a9..38231fe 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 _0x6a55=['express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','destroy','exports','multer'];(function(_0x42ffa2,_0x4b3b89){var _0x281f01=function(_0x101e47){while(--_0x101e47){_0x42ffa2['push'](_0x42ffa2['shift']());}};_0x281f01(++_0x4b3b89);}(_0x6a55,0xdb));var _0x56a5=function(_0x1a7e4b,_0x2fbd40){_0x1a7e4b=_0x1a7e4b-0x0;var _0x37a8fd=_0x6a55[_0x1a7e4b];return _0x37a8fd;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./cmCompany.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x4')]('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0x9')]);router[_0x56a5('0x4')](_0x56a5('0xa'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xb')]);router[_0x56a5('0xc')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0xd')]);router['post']('/:id/contacts',auth[_0x56a5('0x5')](),controller[_0x56a5('0xe')]);router[_0x56a5('0xf')](_0x56a5('0x10'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x11')]);router['delete']('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0x12')]);module[_0x56a5('0x13')]=router;
\ No newline at end of file
+var _0xc9d7=['create','/:id/contacts','addContacts','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x20702a,_0x424179){var _0x350cd7=function(_0x55679c){while(--_0x55679c){_0x20702a['push'](_0x20702a['shift']());}};_0x350cd7(++_0x424179);}(_0xc9d7,0x110));var _0x7c9d=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xc9d7[_0x382a62];return _0x490a25;};'use strict';var multer=require(_0x7c9d('0x0'));var util=require(_0x7c9d('0x1'));var path=require(_0x7c9d('0x2'));var timeout=require(_0x7c9d('0x3'));var express=require(_0x7c9d('0x4'));var router=express[_0x7c9d('0x5')]();var fs_extra=require(_0x7c9d('0x6'));var auth=require(_0x7c9d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7c9d('0x8'));var controller=require(_0x7c9d('0x9'));router[_0x7c9d('0xa')]('/',auth[_0x7c9d('0xb')](),controller[_0x7c9d('0xc')]);router['get'](_0x7c9d('0xd'),auth[_0x7c9d('0xb')](),controller['describe']);router[_0x7c9d('0xa')]('/:id',auth[_0x7c9d('0xb')](),controller[_0x7c9d('0xe')]);router[_0x7c9d('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x7c9d('0xf')]('/',auth[_0x7c9d('0xb')](),controller[_0x7c9d('0x10')]);router[_0x7c9d('0xf')](_0x7c9d('0x11'),auth['isAuthenticated'](),controller[_0x7c9d('0x12')]);router['put'](_0x7c9d('0x13'),auth[_0x7c9d('0xb')](),controller[_0x7c9d('0x14')]);router[_0x7c9d('0x15')](_0x7c9d('0x13'),auth[_0x7c9d('0xb')](),controller[_0x7c9d('0x16')]);module[_0x7c9d('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index a218c78..a3ff238 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 _0x72c4=['TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x72c4,0x162));var _0x472c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x72c4[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var Sequelize=require(_0x472c('0x0'));module[_0x472c('0x1')]={'firstName':{'type':Sequelize[_0x472c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x472c('0x2')]},'street':{'type':Sequelize[_0x472c('0x2')]},'postalCode':{'type':Sequelize[_0x472c('0x2')]},'city':{'type':Sequelize[_0x472c('0x2')]},'country':{'type':Sequelize[_0x472c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x472c('0x2')]},'description':{'type':Sequelize[_0x472c('0x3')]},'phone':{'type':Sequelize[_0x472c('0x2')]},'mobile':{'type':Sequelize[_0x472c('0x2')]},'fax':{'type':Sequelize[_0x472c('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x472c('0x2')]},'twitter':{'type':Sequelize[_0x472c('0x2')]},'skype':{'type':Sequelize[_0x472c('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x472c('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x472c('0x2')]},'telegram':{'type':Sequelize[_0x472c('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x472c('0x4')](0x2)[_0x472c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x472c('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xa9f9=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x28ac4f,_0x3e9885){var _0x501804=function(_0x45379e){while(--_0x45379e){_0x28ac4f['push'](_0x28ac4f['shift']());}};_0x501804(++_0x3e9885);}(_0xa9f9,0x1b1));var _0x9a9f=function(_0x518849,_0x1b8936){_0x518849=_0x518849-0x0;var _0xc1829e=_0xa9f9[_0x518849];return _0xc1829e;};'use strict';var _=require(_0x9a9f('0x0'));var Sequelize=require('sequelize');module[_0x9a9f('0x1')]={'firstName':{'type':Sequelize[_0x9a9f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9a9f('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9a9f('0x2')]},'city':{'type':Sequelize[_0x9a9f('0x2')]},'country':{'type':Sequelize[_0x9a9f('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9a9f('0x2')]},'description':{'type':Sequelize[_0x9a9f('0x3')]},'phone':{'type':Sequelize[_0x9a9f('0x2')]},'mobile':{'type':Sequelize[_0x9a9f('0x2')]},'fax':{'type':Sequelize[_0x9a9f('0x2')]},'email':{'type':Sequelize[_0x9a9f('0x2')]},'url':{'type':Sequelize[_0x9a9f('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9a9f('0x2')]},'skype':{'type':Sequelize[_0x9a9f('0x2')]},'teams':{'type':Sequelize[_0x9a9f('0x2')]},'viber':{'type':Sequelize[_0x9a9f('0x2')]},'line':{'type':Sequelize[_0x9a9f('0x2')]},'wechat':{'type':Sequelize[_0x9a9f('0x2')]},'telegram':{'type':Sequelize[_0x9a9f('0x2')]},'UserId':{'type':Sequelize[_0x9a9f('0x4')]},'priority':{'type':Sequelize[_0x9a9f('0x4')](0x2)[_0x9a9f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9a9f('0x6')],'defaultValue':Sequelize[_0x9a9f('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5a1f8e8..400038b 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 _0x1af2=['intersection','options','nolimit','setTags','ids','getHoppers','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','pid','upload','createReadStream','import','binding','socket_timestamp','stringify','message','start\x20child\x20process\x20correctly!','exit','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','source','destination','starttime','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','alias','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','fullname','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','describe','keys','length','startsWith','push','CmCustomField','findOne','cf_','all','fieldType','model','query','filters','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','dateOfBirth','datetime','castTo','DATE','buildExpression','text','filter','Contact','isEmpty','c.ListId\x20IN\x20?','concat','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','DESC','t.id\x20IN\x20?','resolve','user','role','agent','User','c.ListId\x20IS\x20NULL','ListId','sequelize','c.firstName','c.lastName','c.phone','c.mobile','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','CmContact','params','tags','displayName','custom','values','columnName','merge','body','get','mergeWith','join','info','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','spread','Tag','$and','omit','format','cf_%d','findAll','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes'];(function(_0x3d3467,_0x26bf05){var _0x38b4c5=function(_0x2b5ebb){while(--_0x2b5ebb){_0x3d3467['push'](_0x3d3467['shift']());}};_0x38b4c5(++_0x26bf05);}(_0x1af2,0x18b));var _0x21af=function(_0x3144b3,_0x45f961){_0x3144b3=_0x3144b3-0x0;var _0x2517a9=_0x1af2[_0x3144b3];return _0x2517a9;};'use strict';var emlformat=require(_0x21af('0x0'));var rimraf=require(_0x21af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21af('0x2'));var rp=require(_0x21af('0x3'));var moment=require(_0x21af('0x4'));var BPromise=require(_0x21af('0x5'));var Mustache=require(_0x21af('0x6'));var util=require(_0x21af('0x7'));var path=require(_0x21af('0x8'));var sox=require(_0x21af('0x9'));var csv=require('to-csv');var ejs=require(_0x21af('0xa'));var fs=require('fs');var fs_extra=require(_0x21af('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x21af('0xc'));var jsforce=require(_0x21af('0xd'));var deskjs=require(_0x21af('0xe'));var toCsv=require(_0x21af('0xf'));var querystring=require(_0x21af('0x10'));var Papa=require(_0x21af('0x11'));var Redis=require(_0x21af('0x12'));var authService=require(_0x21af('0x13'));var qs=require(_0x21af('0x14'));var as=require(_0x21af('0x15'));var hardwareService=require(_0x21af('0x16'));var logger=require('../../config/logger')(_0x21af('0x17'));var utils=require('../../config/utils');var config=require(_0x21af('0x18'));var licenseUtil=require(_0x21af('0x19'));var db=require(_0x21af('0x1a'))['db'];config['redis']=_[_0x21af('0x1b')](config[_0x21af('0x1c')],{'host':_0x21af('0x1d'),'port':0x18eb});var socket=require(_0x21af('0x1e'))(new Redis(config[_0x21af('0x1c')]));require(_0x21af('0x1f'))[_0x21af('0x20')](socket);function respondWithStatusCode(_0x1206c6,_0x14d59e){_0x14d59e=_0x14d59e||0xcc;return function(_0x444ff4){if(_0x444ff4){return _0x1206c6[_0x21af('0x21')](_0x14d59e);}return _0x1206c6[_0x21af('0x22')](_0x14d59e)[_0x21af('0x23')]();};}function respondWithResult(_0x2b5c3e,_0x527471){_0x527471=_0x527471||0xc8;return function(_0x292bb2){if(_0x292bb2){return _0x2b5c3e[_0x21af('0x22')](_0x527471)[_0x21af('0x24')](_0x292bb2);}};}function respondWithFilteredResult(_0x567e93,_0x33dd9f){return function(_0x534bf9){if(_0x534bf9){var _0x132aa6=typeof _0x33dd9f[_0x21af('0x25')]===_0x21af('0x26')&&typeof _0x33dd9f['limit']==='undefined';var _0x4ef7ac=_0x534bf9[_0x21af('0x27')];var _0x525ce4=_0x132aa6?0x0:_0x33dd9f[_0x21af('0x25')];var _0x2e8ce5=_0x132aa6?_0x534bf9[_0x21af('0x27')]:_0x33dd9f[_0x21af('0x25')]+_0x33dd9f['limit'];var _0x5caff6;if(_0x2e8ce5>=_0x4ef7ac){_0x2e8ce5=_0x4ef7ac;_0x5caff6=0xc8;}else{_0x5caff6=0xce;}_0x567e93[_0x21af('0x22')](_0x5caff6);return _0x567e93['set'](_0x21af('0x28'),_0x525ce4+'-'+_0x2e8ce5+'/'+_0x4ef7ac)[_0x21af('0x24')](_0x534bf9);}return null;};}function patchUpdates(_0x4010b7){return function(_0x1daf11){try{jsonpatch[_0x21af('0x29')](_0x1daf11,_0x4010b7,!![]);}catch(_0x25a751){return BPromise['reject'](_0x25a751);}return _0x1daf11[_0x21af('0x2a')]();};}function saveUpdates(_0x15076f,_0x4b1524){return function(_0x36221f){if(_0x36221f){return _0x36221f[_0x21af('0x2b')](_0x15076f)[_0x21af('0x2c')](function(_0x39dd5c){return _0x39dd5c;});}return null;};}function removeEntity(_0x2321f1,_0x379511){return function(_0x33f101){if(_0x33f101){return _0x33f101[_0x21af('0x2d')]()['then'](function(){_0x2321f1[_0x21af('0x22')](0xcc)[_0x21af('0x23')]();});}};}function handleEntityNotFound(_0x5b5d11,_0x9a16ce){return function(_0x57006f){if(!_0x57006f){_0x5b5d11[_0x21af('0x21')](0x194);}return _0x57006f;};}function handleError(_0x234cad,_0x1c3f5f){_0x1c3f5f=_0x1c3f5f||0x1f4;return function(_0x33ad8f){logger[_0x21af('0x2e')](_0x33ad8f[_0x21af('0x2f')]);if(_0x33ad8f[_0x21af('0x30')]){delete _0x33ad8f[_0x21af('0x30')];}_0x234cad['status'](_0x1c3f5f)[_0x21af('0x31')](_0x33ad8f);};}exports[_0x21af('0x32')]=function(_0x262919,_0x394991){var _0x333f3d={},_0x334121={},_0x58558d={'count':0x0,'rows':[]};return db['CmContact'][_0x21af('0x33')]()[_0x21af('0x2c')](function(_0xd916bf){var _0x42f0e7=[];for(var _0x176d07=0x0;_0x176d07
','Attachments','Data','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','join','isEmpty','html','test','replace','includes','0x1?_0x2ed4c6[_0xa57c('0x11')](0x0,-0x1)[_0xa57c('0x12')]('\x20'):_0x13dad8[_0xa57c('0xd')];}return'Anonymous';}function getLastName(_0x2644a1){var _0x546cde=_[_0xa57c('0x7')](_0x2644a1[_0xa57c('0x8')]);if(_0x546cde&&_0x546cde[_0xa57c('0xd')]){var _0x3821d2=_0x546cde[_0xa57c('0xd')][_0xa57c('0xf')](/\s+/);return _0x3821d2[_0xa57c('0x10')]>0x1?_0x3821d2['pop']():'';}return'';}function getMails(_0x26607a,_0xdf7ff6){var _0x261725='';for(var _0x5a6024=0x0;_0x5a6024<_0xdf7ff6[_0xa57c('0x8')]['length'];_0x5a6024+=0x1){if(_0xdf7ff6[_0xa57c('0x8')][_0x5a6024][_0xa57c('0x9')]!==_0x26607a){if(!_[_0xa57c('0x13')](_0x261725)){_0x261725+=',';}_0x261725+=_0xdf7ff6[_0xa57c('0x8')][_0x5a6024][_0xa57c('0xd')]||_0xdf7ff6[_0xa57c('0x8')][_0x5a6024][_0xa57c('0x9')]||'';_0x261725+='\x20<';_0x261725+=_0xdf7ff6[_0xa57c('0x8')][_0x5a6024]['address']?_0xdf7ff6[_0xa57c('0x8')][_0x5a6024]['address']:'anonymous'+random[_0xa57c('0xb')](0x6)+_0xa57c('0xc');_0x261725+='>';}}return _0x261725;}function parseEmail(_0x3eee75,_0x23bec0,_0x49242c){if(_0x23bec0[_0xa57c('0x14')]){var _0x25715f=/