From: Fabio Lodato
Date: Tue, 31 Mar 2020 14:22:21 +0000 (+0200)
Subject: Built motion from commit (unavailable).|2.4.12
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=a7f61cb48865b71e9e1bbb833acf66a886a7ac60;p=motion2.git
Built motion from commit (unavailable).|2.4.12
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9f85cf0..53f9570 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2020-03-31T10:56:51.522Z",
+ "time": "2020-03-31T14:04:37.425Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 96fb10d..0edc896 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2020-03-31T10:56:51.522Z",
+ "time": "2020-03-31T14:04:37.425Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index cededd8..e837fe8 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 _0xe892=['VIRTUAL','STRING','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]','TEXT','sequelize','exports'];(function(_0x5a43bf,_0x40f481){var _0x1aeea3=function(_0x2b9f62){while(--_0x2b9f62){_0x5a43bf['push'](_0x5a43bf['shift']());}};_0x1aeea3(++_0x40f481);}(_0xe892,0x1da));var _0x2e89=function(_0x405cc5,_0xf716d){_0x405cc5=_0x405cc5-0x0;var _0x2a1a69=_0xe892[_0x405cc5];return _0x2a1a69;};'use strict';var Sequelize=require(_0x2e89('0x0'));module[_0x2e89('0x1')]={'name':{'type':Sequelize[_0x2e89('0x2')],'get':function(_0x2544d2){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x2e89('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x2e89('0x4'),_0x2e89('0x5'),_0x2e89('0x6'),_0x2e89('0x7'),_0x2e89('0x8'),'bot',_0x2e89('0x9')]],'msg':_0x2e89('0xa')}},'comment':_0x2e89('0xa')},'data1':{'type':Sequelize[_0x2e89('0x3')](0x1000),'comment':_0x2e89('0xb')},'data2':{'type':Sequelize[_0x2e89('0x3')](0x1000),'comment':_0x2e89('0xc')},'data3':{'type':Sequelize[_0x2e89('0x3')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x2e89('0x3')](0x1000)},'data5':{'type':Sequelize[_0x2e89('0x3')](0x1000)},'data6':{'type':Sequelize[_0x2e89('0x3')]},'data7':{'type':Sequelize[_0x2e89('0xd')]}};
\ No newline at end of file
+var _0xd8c3=['jscripty','browser','bot','script','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','VIRTUAL','getDataValue','contactManager','motionbar'];(function(_0x4bec11,_0x8d7565){var _0x19b44f=function(_0xcdb5e5){while(--_0xcdb5e5){_0x4bec11['push'](_0x4bec11['shift']());}};_0x19b44f(++_0x8d7565);}(_0xd8c3,0x183));var _0x3d8c=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xd8c3[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x3d8c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d8c('0x1')],'get':function(_0x3d25af){return this[_0x3d8c('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3d8c('0x3'),'integration',_0x3d8c('0x4'),_0x3d8c('0x5'),'urlForward',_0x3d8c('0x6'),_0x3d8c('0x7'),_0x3d8c('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x3d8c('0x9')},'data1':{'type':Sequelize['STRING'](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[_0x3d8c('0xa')](0x1000),'comment':_0x3d8c('0xb')},'data3':{'type':Sequelize[_0x3d8c('0xa')](0x1000),'comment':_0x3d8c('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x3d8c('0xa')]},'data7':{'type':Sequelize[_0x3d8c('0xd')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 0ec0961..501a11e 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 _0xd8b0=['moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','Action','params','destroy','find','html-pdf','eml-format','request-promise'];(function(_0x497e3b,_0x610331){var _0x2a2e5e=function(_0x3d92dd){while(--_0x3d92dd){_0x497e3b['push'](_0x497e3b['shift']());}};_0x2a2e5e(++_0x610331);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x21')]=function(_0xa2af02,_0x4fe6f9){if(_0xa2af02['body']['id']){delete _0xa2af02[_0x0d8b('0x27')]['id'];}return db[_0x0d8b('0x28')]['find']({'where':{'id':_0xa2af02[_0x0d8b('0x29')]['id']}})['then'](handleEntityNotFound(_0x4fe6f9,null))[_0x0d8b('0x22')](saveUpdates(_0xa2af02['body'],null))[_0x0d8b('0x22')](respondWithResult(_0x4fe6f9,null))['catch'](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x2a')]=function(_0x546bf6,_0x3829c6){return db['Action'][_0x0d8b('0x2b')]({'where':{'id':_0x546bf6[_0x0d8b('0x29')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x3829c6,null))['then'](removeEntity(_0x3829c6,null))['catch'](handleError(_0x3829c6,null));};
\ No newline at end of file
+var _0x4522=['then','status','end','error','stack','send','body','Action','catch','find','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0xd2e5fe,_0x3adc4d){var _0x4ebb02=function(_0x1ac334){while(--_0x1ac334){_0xd2e5fe['push'](_0xd2e5fe['shift']());}};_0x4ebb02(++_0x3adc4d);}(_0x4522,0x1a0));var _0x2452=function(_0x361e8a,_0x458d1f){_0x361e8a=_0x361e8a-0x0;var _0x4f4f22=_0x4522[_0x361e8a];return _0x4f4f22;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2452('0x0'));var zipdir=require(_0x2452('0x1'));var jsonpatch=require(_0x2452('0x2'));var rp=require('request-promise');var moment=require(_0x2452('0x3'));var BPromise=require(_0x2452('0x4'));var Mustache=require(_0x2452('0x5'));var util=require(_0x2452('0x6'));var path=require(_0x2452('0x7'));var sox=require(_0x2452('0x8'));var csv=require(_0x2452('0x9'));var ejs=require(_0x2452('0xa'));var fs=require('fs');var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x9'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var db=require(_0x2452('0x17'))['db'];function respondWithStatusCode(_0x14f338,_0x2c1e0f){_0x2c1e0f=_0x2c1e0f||0xcc;return function(_0x2377b9){if(_0x2377b9){return _0x14f338['sendStatus'](_0x2c1e0f);}return _0x14f338['status'](_0x2c1e0f)['end']();};}function respondWithResult(_0x463960,_0x4fafa0){_0x4fafa0=_0x4fafa0||0xc8;return function(_0x33e592){if(_0x33e592){return _0x463960['status'](_0x4fafa0)[_0x2452('0x18')](_0x33e592);}};}function respondWithFilteredResult(_0x42efdf,_0x5d0438){return function(_0x1dbadf){if(_0x1dbadf){var _0x47930c=_0x1dbadf[_0x2452('0x19')],_0x3dd8cc=_0x5d0438['offset'],_0x734b88=_0x5d0438[_0x2452('0x1a')]+_0x5d0438[_0x2452('0x1b')],_0x461d2b;if(_0x734b88>=_0x47930c){_0x734b88=_0x47930c;_0x461d2b=0xc8;}else{_0x461d2b=0xce;}_0x42efdf['status'](_0x461d2b);return _0x42efdf['set'](_0x2452('0x1c'),_0x3dd8cc+'-'+_0x734b88+'/'+_0x47930c)[_0x2452('0x18')](_0x1dbadf);}return null;};}function patchUpdates(_0x377c12){return function(_0x57cb03){try{jsonpatch[_0x2452('0x1d')](_0x57cb03,_0x377c12,!![]);}catch(_0x467963){return BPromise[_0x2452('0x1e')](_0x467963);}return _0x57cb03[_0x2452('0x1f')]();};}function saveUpdates(_0x1931b0,_0x1c70cb){return function(_0x3f48c2){if(_0x3f48c2){return _0x3f48c2[_0x2452('0x20')](_0x1931b0)['then'](function(_0x48f356){return _0x48f356;});}return null;};}function removeEntity(_0x1f060d,_0x32dfe7){return function(_0x4bb3ff){if(_0x4bb3ff){return _0x4bb3ff[_0x2452('0x21')]()[_0x2452('0x22')](function(){_0x1f060d[_0x2452('0x23')](0xcc)[_0x2452('0x24')]();});}};}function handleEntityNotFound(_0x285281,_0x397f21){return function(_0x155caa){if(!_0x155caa){_0x285281['sendStatus'](0x194);}return _0x155caa;};}function handleError(_0x119bf6,_0x27d049){_0x27d049=_0x27d049||0x1f4;return function(_0x1561e5){logger[_0x2452('0x25')](_0x1561e5[_0x2452('0x26')]);if(_0x1561e5['name']){delete _0x1561e5['name'];}_0x119bf6[_0x2452('0x23')](_0x27d049)[_0x2452('0x27')](_0x1561e5);};}exports[_0x2452('0x20')]=function(_0x3a183c,_0x1aac19){if(_0x3a183c['body']['id']){delete _0x3a183c[_0x2452('0x28')]['id'];}return db[_0x2452('0x29')]['find']({'where':{'id':_0x3a183c['params']['id']}})[_0x2452('0x22')](handleEntityNotFound(_0x1aac19,null))[_0x2452('0x22')](saveUpdates(_0x3a183c[_0x2452('0x28')],null))[_0x2452('0x22')](respondWithResult(_0x1aac19,null))[_0x2452('0x2a')](handleError(_0x1aac19,null));};exports[_0x2452('0x21')]=function(_0x504162,_0x5da9aa){return db[_0x2452('0x29')][_0x2452('0x2b')]({'where':{'id':_0x504162[_0x2452('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5da9aa,null))[_0x2452('0x22')](removeEntity(_0x5da9aa,null))[_0x2452('0x2a')](handleError(_0x5da9aa,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 811cb7d..ad3cdc9 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 _0xb945=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x39c803,_0x32b00a){var _0xd21578=function(_0x59293b){while(--_0x59293b){_0x39c803['push'](_0x39c803['shift']());}};_0xd21578(++_0x32b00a);}(_0xb945,0x1bb));var _0x5b94=function(_0x3efc72,_0x405ab7){_0x3efc72=_0x3efc72-0x0;var _0x5a4457=_0xb945[_0x3efc72];return _0x5a4457;};'use strict';var _=require(_0x5b94('0x0'));var util=require(_0x5b94('0x1'));var logger=require(_0x5b94('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5b94('0x3'));var rp=require(_0x5b94('0x4'));var fs=require('fs');var path=require(_0x5b94('0x5'));var rimraf=require('rimraf');var config=require(_0x5b94('0x6'));var attributes=require(_0x5b94('0x7'));module[_0x5b94('0x8')]=function(_0x4150ae,_0x2e305b){return _0x4150ae[_0x5b94('0x9')](_0x5b94('0xa'),attributes,{'tableName':_0x5b94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3730=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3730,0x1d3));var _0x0373=function(_0x2618be,_0x4e7441){_0x2618be=_0x2618be-0x0;var _0x152f8d=_0x3730[_0x2618be];return _0x152f8d;};'use strict';var _=require('lodash');var util=require(_0x0373('0x0'));var logger=require('../../config/logger')(_0x0373('0x1'));var moment=require(_0x0373('0x2'));var BPromise=require(_0x0373('0x3'));var rp=require(_0x0373('0x4'));var fs=require('fs');var path=require(_0x0373('0x5'));var rimraf=require(_0x0373('0x6'));var config=require(_0x0373('0x7'));var attributes=require('./action.attributes');module[_0x0373('0x8')]=function(_0x4d4256,_0xa275a6){return _0x4d4256[_0x0373('0x9')](_0x0373('0xa'),attributes,{'tableName':_0x0373('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 50a7c88..6db512c 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 _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
+var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 73da1cb..696aa14 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 _0x1ffb=['/:id','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./action.controller'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1ffb,0x170));var _0xb1ff=function(_0x468c39,_0x13e529){_0x468c39=_0x468c39-0x0;var _0x291727=_0x1ffb[_0x468c39];return _0x291727;};'use strict';var multer=require('multer');var util=require(_0xb1ff('0x0'));var path=require(_0xb1ff('0x1'));var timeout=require(_0xb1ff('0x2'));var express=require('express');var router=express[_0xb1ff('0x3')]();var auth=require(_0xb1ff('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1ff('0x5'));router['put'](_0xb1ff('0x6'),auth[_0xb1ff('0x7')](),controller['update']);router[_0xb1ff('0x8')](_0xb1ff('0x6'),auth[_0xb1ff('0x7')](),controller[_0xb1ff('0x9')]);module[_0xb1ff('0xa')]=router;
\ No newline at end of file
+var _0x5c13=['delete','/:id','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated'];(function(_0x54ba9d,_0x3adcce){var _0x37c24e=function(_0x49f896){while(--_0x49f896){_0x54ba9d['push'](_0x54ba9d['shift']());}};_0x37c24e(++_0x3adcce);}(_0x5c13,0x177));var _0x35c1=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0x5c13[_0x8afdd0];return _0x3de7ac;};'use strict';var multer=require(_0x35c1('0x0'));var util=require(_0x35c1('0x1'));var path=require('path');var timeout=require(_0x35c1('0x2'));var express=require('express');var router=express[_0x35c1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x35c1('0x4'));var config=require(_0x35c1('0x5'));var controller=require(_0x35c1('0x6'));router[_0x35c1('0x7')]('/:id',auth[_0x35c1('0x8')](),controller['update']);router[_0x35c1('0x9')](_0x35c1('0xa'),auth[_0x35c1('0x8')](),controller[_0x35c1('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index a313336..78b6974 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 _0x8fea=['TEXT','sequelize','STRING'];(function(_0x5169da,_0x5db048){var _0x17caf0=function(_0x3726fc){while(--_0x3726fc){_0x5169da['push'](_0x5169da['shift']());}};_0x17caf0(++_0x5db048);}(_0x8fea,0x151));var _0xa8fe=function(_0x3be20a,_0x223336){_0x3be20a=_0x3be20a-0x0;var _0x7382f6=_0x8fea[_0x3be20a];return _0x7382f6;};'use strict';var Sequelize=require(_0xa8fe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xa8fe('0x1')]},'table':{'type':Sequelize[_0xa8fe('0x1')]},'conditions':{'type':Sequelize[_0xa8fe('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x07f1=['STRING','TEXT'];(function(_0x5ed8b4,_0x182907){var _0x46f16f=function(_0x52dab2){while(--_0x52dab2){_0x5ed8b4['push'](_0x5ed8b4['shift']());}};_0x46f16f(++_0x182907);}(_0x07f1,0x1ac));var _0x107f=function(_0x295966,_0x218dfe){_0x295966=_0x295966-0x0;var _0x102436=_0x07f1[_0x295966];return _0x102436;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x107f('0x0')]},'parent':{'type':Sequelize[_0x107f('0x0')]},'table':{'type':Sequelize[_0x107f('0x0')]},'conditions':{'type':Sequelize[_0x107f('0x1')]},'joins':{'type':Sequelize[_0x107f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index abc1e3e..ad2bc77 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 _0x27c2=['where','filters','pick','filter','merge','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','get','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','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','keyBy','%s.%s\x20=\x20%s.%s','No\x20available\x20data','output','web','fullPath','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','MAX(%s)','UNIX_TIMESTAMP(%s)','groupBy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','reject','update','then','CustomReports','destroy','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','limit'];(function(_0x3a3236,_0x264258){var _0x21273e=function(_0x4b7f72){while(--_0x4b7f72){_0x3a3236['push'](_0x3a3236['shift']());}};_0x21273e(++_0x264258);}(_0x27c2,0x71));var _0x227c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27c2[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x227c('0x0'));var emlformat=require(_0x227c('0x1'));var rimraf=require(_0x227c('0x2'));var zipdir=require(_0x227c('0x3'));var jsonpatch=require(_0x227c('0x4'));var rp=require(_0x227c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x227c('0x6'));var util=require(_0x227c('0x7'));var path=require('path');var sox=require(_0x227c('0x8'));var csv=require(_0x227c('0x9'));var ejs=require(_0x227c('0xa'));var fs=require('fs');var _=require(_0x227c('0xb'));var squel=require(_0x227c('0xc'));var crypto=require(_0x227c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x227c('0xe'));var Papa=require(_0x227c('0xf'));var Redis=require(_0x227c('0x10'));var authService=require(_0x227c('0x11'));var qs=require(_0x227c('0x12'));var as=require(_0x227c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x227c('0x14'))(_0x227c('0x15'));var utils=require(_0x227c('0x16'));var config=require(_0x227c('0x17'));var db=require(_0x227c('0x18'))['db'];function respondWithStatusCode(_0x2c9d34,_0x3b60a3){_0x3b60a3=_0x3b60a3||0xcc;return function(_0x154b3a){if(_0x154b3a){return _0x2c9d34[_0x227c('0x19')](_0x3b60a3);}return _0x2c9d34[_0x227c('0x1a')](_0x3b60a3)[_0x227c('0x1b')]();};}function respondWithResult(_0x3fa6aa,_0x45e63f){_0x45e63f=_0x45e63f||0xc8;return function(_0x4f1a62){if(_0x4f1a62){return _0x3fa6aa['status'](_0x45e63f)[_0x227c('0x1c')](_0x4f1a62);}};}function respondWithFilteredResult(_0x2521fd,_0x143e52){return function(_0x23cca6){if(_0x23cca6){var _0x2f5241=_0x23cca6['count'],_0x26b19b=_0x143e52[_0x227c('0x1d')],_0x8bffd3=_0x143e52[_0x227c('0x1d')]+_0x143e52['limit'],_0x31c089;if(_0x8bffd3>=_0x2f5241){_0x8bffd3=_0x2f5241;_0x31c089=0xc8;}else{_0x31c089=0xce;}_0x2521fd[_0x227c('0x1a')](_0x31c089);return _0x2521fd[_0x227c('0x1e')]('Content-Range',_0x26b19b+'-'+_0x8bffd3+'/'+_0x2f5241)[_0x227c('0x1c')](_0x23cca6);}return null;};}function patchUpdates(_0x15956d){return function(_0x310364){try{jsonpatch['apply'](_0x310364,_0x15956d,!![]);}catch(_0x3036d2){return BPromise[_0x227c('0x1f')](_0x3036d2);}return _0x310364['save']();};}function saveUpdates(_0x27032d,_0x5ea6f9){return function(_0x5c73ec){if(_0x5c73ec){return _0x5c73ec[_0x227c('0x20')](_0x27032d)[_0x227c('0x21')](function(_0x1eb883){return _0x1eb883;});}return null;};}function removeEntity(_0x373969,_0x461afc){return function(_0x168954){if(_0x168954){return _0x168954['destroy']()[_0x227c('0x21')](function(){var _0xed8957=_0x168954['get']({'plain':!![]});var _0x17de7f=_0x227c('0x22');return db['UserProfileResource'][_0x227c('0x23')]({'where':{'type':_0x17de7f,'resourceId':_0xed8957['id']}})[_0x227c('0x21')](function(){return _0x168954;});})[_0x227c('0x21')](function(){_0x373969[_0x227c('0x1a')](0xcc)[_0x227c('0x1b')]();});}};}function handleEntityNotFound(_0xc6016e,_0x17f95a){return function(_0x4d8b7b){if(!_0x4d8b7b){_0xc6016e['sendStatus'](0x194);}return _0x4d8b7b;};}function handleError(_0x48aac7,_0x479f6b){_0x479f6b=_0x479f6b||0x1f4;return function(_0xa75d69){logger['error'](_0xa75d69[_0x227c('0x24')]);if(_0xa75d69['name']){delete _0xa75d69[_0x227c('0x25')];}_0x48aac7[_0x227c('0x1a')](_0x479f6b)[_0x227c('0x26')](_0xa75d69);};}exports[_0x227c('0x27')]=function(_0x2f7b23,_0x407329){var _0x209b1d={},_0x28ce07={},_0x1facb3={'count':0x0,'rows':[]};var _0x591d4f=_[_0x227c('0x28')](db[_0x227c('0x29')][_0x227c('0x2a')],function(_0x2903e5){return{'name':_0x2903e5[_0x227c('0x2b')],'type':_0x2903e5['type'][_0x227c('0x2c')]};});_0x28ce07['model']=_[_0x227c('0x28')](_0x591d4f,_0x227c('0x25'));_0x28ce07[_0x227c('0x2d')]=_[_0x227c('0x2e')](_0x2f7b23[_0x227c('0x2d')]);_0x28ce07['filters']=_['intersection'](_0x28ce07[_0x227c('0x2f')],_0x28ce07[_0x227c('0x2d')]);_0x209b1d['attributes']=_[_0x227c('0x30')](_0x28ce07[_0x227c('0x2f')],qs[_0x227c('0x31')](_0x2f7b23[_0x227c('0x2d')][_0x227c('0x31')]));_0x209b1d[_0x227c('0x32')]=_0x209b1d['attributes']['length']?_0x209b1d['attributes']:_0x28ce07[_0x227c('0x2f')];if(!_0x2f7b23[_0x227c('0x2d')][_0x227c('0x33')](_0x227c('0x34'))){_0x209b1d[_0x227c('0x35')]=qs[_0x227c('0x35')](_0x2f7b23[_0x227c('0x2d')]['limit']);_0x209b1d[_0x227c('0x1d')]=qs[_0x227c('0x1d')](_0x2f7b23[_0x227c('0x2d')]['offset']);}_0x209b1d['order']=qs['sort'](_0x2f7b23[_0x227c('0x2d')]['sort']);_0x209b1d[_0x227c('0x36')]=qs[_0x227c('0x37')](_[_0x227c('0x38')](_0x2f7b23[_0x227c('0x2d')],_0x28ce07['filters']));if(_0x2f7b23['query'][_0x227c('0x39')]){_0x209b1d[_0x227c('0x36')]=_[_0x227c('0x3a')](_0x209b1d[_0x227c('0x36')],{'$or':_[_0x227c('0x28')](_0x591d4f,function(_0x38b65c){if(_0x38b65c[_0x227c('0x3b')]['key']!==_0x227c('0x3c')){var _0x571833={};_0x571833[_0x38b65c[_0x227c('0x3d')]]={'$like':'%'+_0x2f7b23[_0x227c('0x2d')][_0x227c('0x39')]+'%'};return _0x571833;}})});}_0x209b1d=_['merge']({},_0x209b1d,_0x2f7b23[_0x227c('0x3e')]);var _0x28e8a7={'where':_0x209b1d['where']};return db[_0x227c('0x29')]['count'](_0x28e8a7)[_0x227c('0x21')](function(_0x242b61){_0x1facb3[_0x227c('0x3f')]=_0x242b61;if(_0x2f7b23[_0x227c('0x2d')][_0x227c('0x40')]){_0x209b1d[_0x227c('0x41')]=[{'all':!![]}];}return db[_0x227c('0x29')][_0x227c('0x42')](_0x209b1d);})['then'](function(_0x46f8b3){_0x1facb3[_0x227c('0x43')]=_0x46f8b3;return _0x1facb3;})[_0x227c('0x21')](respondWithFilteredResult(_0x407329,_0x209b1d))[_0x227c('0x44')](handleError(_0x407329,null));};exports[_0x227c('0x45')]=function(_0x574dae,_0x5cbe15){var _0x46e149={'raw':![],'where':{'id':_0x574dae[_0x227c('0x46')]['id']}},_0xda0fd9={};_0xda0fd9[_0x227c('0x2f')]=_[_0x227c('0x2e')](db[_0x227c('0x29')][_0x227c('0x2a')]);_0xda0fd9[_0x227c('0x2d')]=_[_0x227c('0x2e')](_0x574dae[_0x227c('0x2d')]);_0xda0fd9['filters']=_[_0x227c('0x30')](_0xda0fd9['model'],_0xda0fd9[_0x227c('0x2d')]);_0x46e149[_0x227c('0x32')]=_['intersection'](_0xda0fd9[_0x227c('0x2f')],qs[_0x227c('0x31')](_0x574dae[_0x227c('0x2d')][_0x227c('0x31')]));_0x46e149['attributes']=_0x46e149[_0x227c('0x32')][_0x227c('0x47')]?_0x46e149[_0x227c('0x32')]:_0xda0fd9[_0x227c('0x2f')];if(_0x574dae[_0x227c('0x2d')][_0x227c('0x40')]){_0x46e149[_0x227c('0x41')]=[{'all':!![]}];}_0x46e149=_['merge']({},_0x46e149,_0x574dae[_0x227c('0x3e')]);return db[_0x227c('0x29')][_0x227c('0x48')](_0x46e149)[_0x227c('0x21')](handleEntityNotFound(_0x5cbe15,null))[_0x227c('0x21')](respondWithResult(_0x5cbe15,null))[_0x227c('0x44')](handleError(_0x5cbe15,null));};exports[_0x227c('0x49')]=function(_0x53b44b,_0xd53c8a){return db['AnalyticCustomReport']['create'](_0x53b44b[_0x227c('0x4a')],{})[_0x227c('0x21')](function(_0x904ccb){var _0x24ef22=_0x53b44b['user'][_0x227c('0x4b')]({'plain':!![]});if(!_0x24ef22)throw new Error(_0x227c('0x4c'));if(_0x24ef22[_0x227c('0x4d')]===_0x227c('0x4e')){var _0xebc600=_0x904ccb['get']({'plain':!![]});var _0x18e1a9=_0x227c('0x4f');return db['UserProfileSection'][_0x227c('0x48')]({'where':{'name':_0x18e1a9,'userProfileId':_0x24ef22[_0x227c('0x50')]},'raw':!![]})['then'](function(_0x143501){if(_0x143501&&_0x143501[_0x227c('0x51')]===0x0){return db[_0x227c('0x52')][_0x227c('0x49')]({'name':_0xebc600[_0x227c('0x25')],'resourceId':_0xebc600['id'],'type':_0x227c('0x22'),'sectionId':_0x143501['id']},{})[_0x227c('0x21')](function(){return _0x904ccb;});}else{return _0x904ccb;}})[_0x227c('0x44')](function(_0xd40e22){logger['error'](_0x227c('0x53'),_0xd40e22);throw _0xd40e22;});}return _0x904ccb;})['then'](respondWithResult(_0xd53c8a,0xc9))[_0x227c('0x44')](handleError(_0xd53c8a,null));};exports[_0x227c('0x20')]=function(_0x1c377d,_0xe60f3f){if(_0x1c377d[_0x227c('0x4a')]['id']){delete _0x1c377d[_0x227c('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x227c('0x48')]({'where':{'id':_0x1c377d[_0x227c('0x46')]['id']}})['then'](handleEntityNotFound(_0xe60f3f,null))[_0x227c('0x21')](saveUpdates(_0x1c377d[_0x227c('0x4a')],null))[_0x227c('0x21')](respondWithResult(_0xe60f3f,null))[_0x227c('0x44')](handleError(_0xe60f3f,null));};exports[_0x227c('0x23')]=function(_0xeb65cd,_0x42b2dd){return db[_0x227c('0x29')][_0x227c('0x48')]({'where':{'id':_0xeb65cd['params']['id']}})[_0x227c('0x21')](handleEntityNotFound(_0x42b2dd,null))[_0x227c('0x21')](removeEntity(_0x42b2dd,null))[_0x227c('0x44')](handleError(_0x42b2dd,null));};exports[_0x227c('0x54')]=function(_0x47d2cd,_0x5612f5){var _0x40e6ea=0xa;var _0x3ba00a=[_0x227c('0x55'),_0x227c('0x56'),_0x227c('0x57'),_0x227c('0x58')];var _0x467b1b={'SUM':_0x227c('0x59'),'COUNT':_0x227c('0x5a'),'COUNT DISTINCT':_0x227c('0x5b'),'MAX':'MAX(%s)','MIN':_0x227c('0x5c'),'AVG':_0x227c('0x5d'),'GROUP_CONCAT':_0x227c('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x227c('0x5f')};var _0xff23ed={'SEC_TO_TIME':_0x227c('0x60'),'DATE':_0x227c('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x227c('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x44b07d=function(_0x11cfea){return!_[_0x227c('0x63')]([_0x227c('0x64'),_0x227c('0x65'),_0x227c('0x66'),_0x227c('0x67')],_0x11cfea);};var _0x286f5e=function(_0x43a816){if(!_0x43a816||!_0x43a816['rules'][_0x227c('0x47')]){return'';}for(var _0x4d2ae0='(',_0x5554bb=0x0;_0x5554bb<_0x43a816['rules'][_0x227c('0x47')];_0x5554bb+=0x1){_0x5554bb>0x0&&(_0x4d2ae0+='\x20'+_0x43a816[_0x227c('0x68')]+'\x20');_0x4d2ae0+=_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6a')]?_0x286f5e(_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6a')]):_0x43a816[_0x227c('0x69')][_0x5554bb]['field']+'\x20'+_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6b')]+(_0x44b07d(_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6b')])?'\x20'+_0x43a816['rules'][_0x5554bb][_0x227c('0x6c')]:'');}return _0x4d2ae0+')';};var _0x584376={'where':{'id':_0x47d2cd[_0x227c('0x46')]['id']}},_0x1bfa93,_0x412c61,_0x31a74f,_0x51fa91,_0x4463e5;_0x584376=_[_0x227c('0x3a')]({},_0x584376,_0x47d2cd[_0x227c('0x3e')]);return db[_0x227c('0x29')][_0x227c('0x48')](_0x584376)[_0x227c('0x21')](function(_0xc0f8b6){if(_0xc0f8b6){_0x1bfa93=_0xc0f8b6;return _0xc0f8b6[_0x227c('0x6d')]();}return null;})[_0x227c('0x21')](function(_0x51e0af){if(_0x51e0af){if(!_0x51e0af[_0x227c('0x47')]){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x70'),0x193);}_0x412c61=_0x51e0af;return db[_0x227c('0x71')][_0x227c('0x42')]({'raw':!![]});}return null;})[_0x227c('0x21')](function(_0x369faf){if(_0x369faf){_0x31a74f=_['keyBy'](_0x369faf,'id');var _0x36add2;var _0x504f2c=squel[_0x227c('0x72')]();_0x504f2c[_0x227c('0x73')](_0x1bfa93['table']);for(var _0x4a0fe3=0x0;_0x4a0fe3<_0x412c61['length'];_0x4a0fe3+=0x1){_0x36add2=_0x412c61[_0x4a0fe3][_0x227c('0x74')]?_0x31a74f[_0x412c61[_0x4a0fe3][_0x227c('0x74')]][_0x227c('0x75')]:_0x412c61[_0x4a0fe3][_0x227c('0x3d')];_0x36add2=_0x412c61[_0x4a0fe3][_0x227c('0x76')]?_[_0x227c('0x77')](_0x467b1b[_0x412c61[_0x4a0fe3][_0x227c('0x76')]],'%s',_0x36add2):_0x36add2;_0x36add2=_0x412c61[_0x4a0fe3][_0x227c('0x78')]?_['replace'](_0xff23ed[_0x412c61[_0x4a0fe3][_0x227c('0x78')]],'%s',_0x36add2):_0x36add2;if(_0x412c61[_0x4a0fe3]['groupBy']){_0x504f2c[_0x227c('0x6a')](_0x36add2);}_0x412c61[_0x4a0fe3][_0x227c('0x79')]&&_0x504f2c[_0x227c('0x7a')](_0x36add2,_0x412c61[_0x4a0fe3]['orderBy']===_0x227c('0x7b')?![]:!![]);_0x504f2c[_0x227c('0x3d')](_0x36add2,_0x412c61[_0x4a0fe3][_0x227c('0x7c')]||_0x36add2);}if(_0x1bfa93[_0x227c('0x7d')]){_0x1bfa93['joins']=JSON[_0x227c('0x7e')](_0x1bfa93[_0x227c('0x7d')]);for(var _0x35941a=0x0;_0x35941a<_0x1bfa93[_0x227c('0x7d')][_0x227c('0x47')];_0x35941a+=0x1){if(_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x3b')]&&_[_0x227c('0x63')](_0x3ba00a,_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x3b')])&&_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x7f')]&&_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x80')]&&_0x1bfa93['joins'][_0x35941a][_0x227c('0x81')]){_0x504f2c[_0x1bfa93['joins'][_0x35941a][_0x227c('0x3b')]](_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x80')],null,util[_0x227c('0x78')]('%s.%s\x20=\x20%s.%s',_0x1bfa93[_0x227c('0x82')],_0x1bfa93['joins'][_0x35941a][_0x227c('0x7f')],_0x1bfa93[_0x227c('0x7d')][_0x35941a]['foreignTable'],_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x81')]));}}}if(_0x1bfa93[_0x227c('0x83')]){_0x1bfa93[_0x227c('0x83')]=JSON[_0x227c('0x7e')](_0x1bfa93[_0x227c('0x83')]);_0x504f2c[_0x227c('0x36')](_0x286f5e(_0x1bfa93['conditions']['group']));}_0x4463e5=_0x504f2c[_0x227c('0x84')]();_0x504f2c['limit'](_0x40e6ea);_0x504f2c['offset'](0x0);logger[_0x227c('0x85')](_0x227c('0x86'),_0x504f2c[_0x227c('0x87')]());return db[_0x227c('0x88')]['query'](_0x504f2c[_0x227c('0x87')](),{'type':db[_0x227c('0x88')][_0x227c('0x89')][_0x227c('0x8a')]});}})[_0x227c('0x21')](respondWithResult(_0x5612f5,null))['catch'](handleError(_0x5612f5,null));};function runReport(_0x5edde8,_0x2dc0da,_0x7a8609){var _0x2bc08c=_0x2dc0da['name'];var _0x597f91=0xa;var _0x5a5239=[_0x227c('0x55'),_0x227c('0x56'),_0x227c('0x57'),_0x227c('0x58')];var _0x126af4={'SUM':_0x227c('0x59'),'COUNT':_0x227c('0x5a'),'COUNT DISTINCT':_0x227c('0x5b'),'MAX':'MAX(%s)','MIN':_0x227c('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x227c('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41fd1c={'SEC_TO_TIME':_0x227c('0x60'),'DATE':_0x227c('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4c43fd=function(_0x4086e2){return!_[_0x227c('0x63')]([_0x227c('0x64'),_0x227c('0x65'),'IS\x20EMPTY',_0x227c('0x67')],_0x4086e2);};var _0x27c213=function(_0x5d12ce){if(!_0x5d12ce||!_0x5d12ce[_0x227c('0x69')][_0x227c('0x47')]){return'';}for(var _0x16e8a7='(',_0x52e3c2=0x0;_0x52e3c2<_0x5d12ce['rules']['length'];_0x52e3c2+=0x1){_0x52e3c2>0x0&&(_0x16e8a7+='\x20'+_0x5d12ce[_0x227c('0x68')]+'\x20');_0x16e8a7+=_0x5d12ce['rules'][_0x52e3c2][_0x227c('0x6a')]?_0x27c213(_0x5d12ce[_0x227c('0x69')][_0x52e3c2][_0x227c('0x6a')]):_0x5d12ce[_0x227c('0x69')][_0x52e3c2][_0x227c('0x3d')]+'\x20'+_0x5d12ce[_0x227c('0x69')][_0x52e3c2][_0x227c('0x6b')]+(_0x4c43fd(_0x5d12ce[_0x227c('0x69')][_0x52e3c2]['condition'])?'\x20'+_0x5d12ce[_0x227c('0x69')][_0x52e3c2]['value']:'');}return _0x16e8a7+')';};var _0x2ccb3f={'where':{'id':_0x5edde8['id']}},_0x59a19f,_0x4955e2,_0x10de0a,_0x1c4b20,_0x36e492;_0x2ccb3f=_['merge']({},_0x2ccb3f,_0x7a8609);return db[_0x227c('0x29')]['find'](_0x2ccb3f)['then'](function(_0x131ccf){if(_0x131ccf){_0x59a19f=_0x131ccf;return _0x131ccf[_0x227c('0x6d')]();}return null;})['then'](function(_0x24b8e6){if(_0x24b8e6){if(!_0x24b8e6['length']){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x70'),0x193);}_0x4955e2=_0x24b8e6;return db[_0x227c('0x71')][_0x227c('0x42')]({'raw':!![]});}return null;})[_0x227c('0x21')](function(_0x5de729){if(_0x5de729){_0x10de0a=_[_0x227c('0x8c')](_0x5de729,'id');var _0x141a04;var _0x349746=squel[_0x227c('0x72')]();_0x349746[_0x227c('0x73')](_0x59a19f[_0x227c('0x82')]);for(var _0x1ebbe4=0x0;_0x1ebbe4<_0x4955e2['length'];_0x1ebbe4+=0x1){_0x141a04=_0x4955e2[_0x1ebbe4][_0x227c('0x74')]?_0x10de0a[_0x4955e2[_0x1ebbe4][_0x227c('0x74')]]['metric']:_0x4955e2[_0x1ebbe4]['field'];_0x141a04=_0x4955e2[_0x1ebbe4][_0x227c('0x76')]?_[_0x227c('0x77')](_0x126af4[_0x4955e2[_0x1ebbe4][_0x227c('0x76')]],'%s',_0x141a04):_0x141a04;_0x141a04=_0x4955e2[_0x1ebbe4][_0x227c('0x78')]?_[_0x227c('0x77')](_0x41fd1c[_0x4955e2[_0x1ebbe4][_0x227c('0x78')]],'%s',_0x141a04):_0x141a04;if(_0x4955e2[_0x1ebbe4]['groupBy']){_0x349746[_0x227c('0x6a')](_0x141a04);}_0x4955e2[_0x1ebbe4]['orderBy']&&_0x349746[_0x227c('0x7a')](_0x141a04,_0x4955e2[_0x1ebbe4][_0x227c('0x79')]===_0x227c('0x7b')?![]:!![]);_0x349746[_0x227c('0x3d')](_0x141a04,_0x4955e2[_0x1ebbe4][_0x227c('0x7c')]||_0x141a04);}if(_0x59a19f['joins']){_0x59a19f[_0x227c('0x7d')]=JSON[_0x227c('0x7e')](_0x59a19f['joins']);for(var _0x9f9f6b=0x0;_0x9f9f6b<_0x59a19f[_0x227c('0x7d')][_0x227c('0x47')];_0x9f9f6b+=0x1){if(_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x3b')]&&_[_0x227c('0x63')](_0x5a5239,_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x3b')])&&_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x7f')]&&_0x59a19f['joins'][_0x9f9f6b][_0x227c('0x80')]&&_0x59a19f[_0x227c('0x7d')][_0x9f9f6b]['foreignKey']){_0x349746[_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x3b')]](_0x59a19f[_0x227c('0x7d')][_0x9f9f6b]['foreignTable'],null,util['format'](_0x227c('0x8d'),_0x59a19f['table'],_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x7f')],_0x59a19f[_0x227c('0x7d')][_0x9f9f6b]['foreignTable'],_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x81')]));}}}if(_0x59a19f['conditions']){_0x59a19f[_0x227c('0x83')]=JSON['parse'](_0x59a19f[_0x227c('0x83')]);_0x349746[_0x227c('0x36')](_0x27c213(_0x59a19f[_0x227c('0x83')][_0x227c('0x6a')]));}_0x36e492=_0x349746[_0x227c('0x84')]();_0x349746[_0x227c('0x35')](_0x597f91);_0x349746[_0x227c('0x1d')](0x0);logger['debug'](_0x227c('0x86'),_0x349746[_0x227c('0x87')]());return db['sequelize'][_0x227c('0x2d')](_0x349746[_0x227c('0x87')](),{'type':db['sequelize'][_0x227c('0x89')][_0x227c('0x8a')]});}})[_0x227c('0x21')](function(_0x16b298){if(!_0x16b298['length']){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x8e'),0xcc);}if(_0x2dc0da[_0x227c('0x8f')]===_0x227c('0x90')){return null;}var _0x48be8d=_[_0x227c('0x3a')](_0x2dc0da,{'name':_0x2dc0da[_0x227c('0x91')]||_0x2dc0da[_0x227c('0x25')]||_0x59a19f[_0x227c('0x25')],'basename':_0x2bc08c,'savename':util[_0x227c('0x78')]('%s-%s.%s',_0x2dc0da[_0x227c('0x25')]||_0x59a19f[_0x227c('0x25')],require(_0x227c('0x92'))['generate'](0x4),_0x2dc0da[_0x227c('0x8f')]||'csv'),'reportId':_0x59a19f['id'],'reportType':_0x227c('0x93')});return db[_0x227c('0x94')]['create'](_0x48be8d,{'raw':!![]});})[_0x227c('0x21')](function(_0x41fc7c){if(_0x59a19f[_0x227c('0x82')]===_0x227c('0x95')){_0x36e492[_0x227c('0x36')](_0x59a19f[_0x227c('0x82')]+_0x227c('0x96'),_0x2dc0da[_0x227c('0x97')],_0x2dc0da[_0x227c('0x98')]);}else{_0x36e492[_0x227c('0x36')](_0x59a19f[_0x227c('0x82')]+_0x227c('0x99'),_0x2dc0da[_0x227c('0x97')],_0x2dc0da['endDate']);}if(_0x41fc7c){logger[_0x227c('0x9a')](_0x227c('0x9b'),_0x36e492[_0x227c('0x87')]());require(_0x227c('0x9c'))[_0x227c('0x9d')](path[_0x227c('0x55')](__dirname,_0x227c('0x9e'),_0x41fc7c['output']),[_0x41fc7c['id'],_0x36e492['toString'](),path['join'](__dirname,_0x227c('0x9f'),_0x41fc7c['savename']),_0x2bc08c]);return _0x41fc7c;}else{var _0x5f4b2b=squel['select']();_0x5f4b2b[_0x227c('0x73')]('('+_0x36e492[_0x227c('0x87')]()+')',_0x227c('0xa0'));_0x5f4b2b[_0x227c('0x3d')](_0x227c('0xa1'),_0x227c('0x3f'));_0x36e492[_0x227c('0x35')](_0x2dc0da[_0x227c('0x35')]||_0x597f91);_0x36e492[_0x227c('0x1d')](_0x2dc0da['offset']||0x0);return db[_0x227c('0x88')][_0x227c('0x2d')](_0x5f4b2b[_0x227c('0x87')](),{'type':db[_0x227c('0x88')][_0x227c('0x89')][_0x227c('0x8a')]})['then'](function(_0x366ce7){if(!_0x366ce7[_0x227c('0x47')]){_0x1c4b20=0x0;}else{_0x1c4b20=_0x366ce7[0x0][_0x227c('0x3f')]||0x0;}return db[_0x227c('0x88')][_0x227c('0x2d')](_0x36e492[_0x227c('0x87')](),{'type':db['sequelize'][_0x227c('0x89')][_0x227c('0x8a')]});})['then'](function(_0x3e1fc1){return{'rows':_0x3e1fc1||[],'count':_0x1c4b20};});}});}exports[_0x227c('0xa2')]=function(_0x216fe3,_0x1dd797){return runReport(_0x216fe3[_0x227c('0x46')],_0x216fe3[_0x227c('0x2d')],_0x216fe3[_0x227c('0x3e')])[_0x227c('0x21')](respondWithResult(_0x1dd797,null))[_0x227c('0x44')](handleError(_0x1dd797,null));};exports[_0x227c('0xa3')]=runReport;exports[_0x227c('0x2d')]=function(_0x462cd7,_0x18d236){var _0x659fde=0xa;var _0x389b59=[_0x227c('0x55'),'left_join',_0x227c('0x57'),_0x227c('0x58')];var _0xd9c691={'SUM':_0x227c('0x59'),'COUNT':_0x227c('0x5a'),'COUNT DISTINCT':_0x227c('0x5b'),'MAX':_0x227c('0xa4'),'MIN':_0x227c('0x5c'),'AVG':_0x227c('0x5d'),'GROUP_CONCAT':_0x227c('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x227c('0x5f')};var _0x1c2793={'SEC_TO_TIME':_0x227c('0x60'),'DATE':_0x227c('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x227c('0xa5')};var _0x5947d6=function(_0x538760){return!_[_0x227c('0x63')]([_0x227c('0x64'),_0x227c('0x65'),_0x227c('0x66'),_0x227c('0x67')],_0x538760);};var _0x43cbf3=function(_0x30f139){if(!_0x30f139||!_0x30f139[_0x227c('0x69')][_0x227c('0x47')]){return'';}for(var _0x362f41='(',_0x47ccaf=0x0;_0x47ccaf<_0x30f139[_0x227c('0x69')][_0x227c('0x47')];_0x47ccaf+=0x1){_0x47ccaf>0x0&&(_0x362f41+='\x20'+_0x30f139['operator']+'\x20');_0x362f41+=_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x6a')]?_0x43cbf3(_0x30f139[_0x227c('0x69')][_0x47ccaf]['group']):_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x3d')]+'\x20'+_0x30f139['rules'][_0x47ccaf][_0x227c('0x6b')]+(_0x5947d6(_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x6b')])?'\x20'+_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x6c')]:'');}return _0x362f41+')';};var _0x321aa4={'where':{'id':_0x462cd7['params']['id']}},_0x27e8a5,_0x485b23,_0x57d66a,_0x1a5127,_0x55010b;_0x321aa4=_[_0x227c('0x3a')]({},_0x321aa4,_0x462cd7[_0x227c('0x3e')]);return db[_0x227c('0x29')][_0x227c('0x48')](_0x321aa4)[_0x227c('0x21')](function(_0x277041){if(_0x277041){_0x27e8a5=_0x277041;return _0x277041[_0x227c('0x6d')]();}return null;})[_0x227c('0x21')](function(_0x41c98e){if(_0x41c98e){if(!_0x41c98e['length']){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x70'),0x193);}_0x485b23=_0x41c98e;return db['AnalyticMetric'][_0x227c('0x42')]({'raw':!![]});}return null;})[_0x227c('0x21')](function(_0x4fd53c){if(_0x4fd53c){_0x57d66a=_['keyBy'](_0x4fd53c,'id');var _0x3886eb;var _0x461fa4=squel[_0x227c('0x72')]();_0x461fa4[_0x227c('0x73')](_0x27e8a5['table']);for(var _0x142573=0x0;_0x142573<_0x485b23[_0x227c('0x47')];_0x142573+=0x1){_0x3886eb=_0x485b23[_0x142573][_0x227c('0x74')]?_0x57d66a[_0x485b23[_0x142573][_0x227c('0x74')]]['metric']:_0x485b23[_0x142573][_0x227c('0x3d')];_0x3886eb=_0x485b23[_0x142573][_0x227c('0x76')]?_['replace'](_0xd9c691[_0x485b23[_0x142573][_0x227c('0x76')]],'%s',_0x3886eb):_0x3886eb;_0x3886eb=_0x485b23[_0x142573][_0x227c('0x78')]?_[_0x227c('0x77')](_0x1c2793[_0x485b23[_0x142573]['format']],'%s',_0x3886eb):_0x3886eb;if(_0x485b23[_0x142573][_0x227c('0xa6')]){_0x461fa4[_0x227c('0x6a')](_0x3886eb);}_0x485b23[_0x142573][_0x227c('0x79')]&&_0x461fa4[_0x227c('0x7a')](_0x3886eb,_0x485b23[_0x142573]['orderBy']===_0x227c('0x7b')?![]:!![]);_0x461fa4[_0x227c('0x3d')](_0x3886eb,_0x485b23[_0x142573][_0x227c('0x7c')]||_0x3886eb);}if(_0x27e8a5[_0x227c('0x7d')]){_0x27e8a5['joins']=JSON[_0x227c('0x7e')](_0x27e8a5[_0x227c('0x7d')]);for(var _0x4b075b=0x0;_0x4b075b<_0x27e8a5[_0x227c('0x7d')][_0x227c('0x47')];_0x4b075b+=0x1){if(_0x27e8a5[_0x227c('0x7d')][_0x4b075b]['type']&&_[_0x227c('0x63')](_0x389b59,_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x3b')])&&_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x7f')]&&_0x27e8a5[_0x227c('0x7d')][_0x4b075b]['foreignTable']&&_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x81')]){_0x461fa4[_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x3b')]](_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x80')],null,util[_0x227c('0x78')](_0x227c('0x8d'),_0x27e8a5['table'],_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x7f')],_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x80')],_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x81')]));}}}if(_0x27e8a5[_0x227c('0x83')]){_0x27e8a5[_0x227c('0x83')]=JSON['parse'](_0x27e8a5[_0x227c('0x83')]);_0x461fa4[_0x227c('0x36')](_0x43cbf3(_0x27e8a5['conditions'][_0x227c('0x6a')]));}_0x55010b=_0x461fa4[_0x227c('0x84')]();_0x461fa4[_0x227c('0x35')](_0x659fde);_0x461fa4[_0x227c('0x1d')](0x0);logger[_0x227c('0x85')](_0x227c('0x86'),_0x461fa4[_0x227c('0x87')]());return db['sequelize'][_0x227c('0x2d')](_0x461fa4[_0x227c('0x87')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x227c('0x21')](function(){return{'sql':_0x55010b[_0x227c('0x87')]()};})['then'](respondWithResult(_0x18d236,null))[_0x227c('0x44')](handleError(_0x18d236,null));};
\ No newline at end of file
+var _0x5d2b=['alias','%s.%s\x20=\x20%s.%s','Limited\x20Query:','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','runReport','right_join','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','AnalyticCustomReport','type','key','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','DESC','joins','parse','foreignTable','parentKey','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','orderBy'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0x5d2b,0xbb));var _0xb5d2=function(_0x44d3d0,_0xf79b5c){_0x44d3d0=_0x44d3d0-0x0;var _0x2ec80c=_0x5d2b[_0x44d3d0];return _0x2ec80c;};'use strict';var pdf=require(_0xb5d2('0x0'));var emlformat=require(_0xb5d2('0x1'));var rimraf=require(_0xb5d2('0x2'));var zipdir=require(_0xb5d2('0x3'));var jsonpatch=require(_0xb5d2('0x4'));var rp=require('request-promise');var moment=require(_0xb5d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb5d2('0x6'));var util=require(_0xb5d2('0x7'));var path=require(_0xb5d2('0x8'));var sox=require(_0xb5d2('0x9'));var csv=require(_0xb5d2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb5d2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5d2('0xc'));var deskjs=require(_0xb5d2('0xd'));var toCsv=require(_0xb5d2('0xa'));var querystring=require(_0xb5d2('0xe'));var Papa=require('papaparse');var Redis=require(_0xb5d2('0xf'));var authService=require(_0xb5d2('0x10'));var qs=require(_0xb5d2('0x11'));var as=require(_0xb5d2('0x12'));var hardwareService=require(_0xb5d2('0x13'));var logger=require('../../config/logger')(_0xb5d2('0x14'));var utils=require('../../config/utils');var config=require(_0xb5d2('0x15'));var db=require(_0xb5d2('0x16'))['db'];function respondWithStatusCode(_0x16fe43,_0x4abfc9){_0x4abfc9=_0x4abfc9||0xcc;return function(_0x499738){if(_0x499738){return _0x16fe43[_0xb5d2('0x17')](_0x4abfc9);}return _0x16fe43[_0xb5d2('0x18')](_0x4abfc9)[_0xb5d2('0x19')]();};}function respondWithResult(_0x2a9bdd,_0x12009e){_0x12009e=_0x12009e||0xc8;return function(_0x3d20d4){if(_0x3d20d4){return _0x2a9bdd[_0xb5d2('0x18')](_0x12009e)[_0xb5d2('0x1a')](_0x3d20d4);}};}function respondWithFilteredResult(_0x4616ff,_0x177f72){return function(_0x4d604c){if(_0x4d604c){var _0x23fc54=_0x4d604c['count'],_0x509c81=_0x177f72[_0xb5d2('0x1b')],_0x4c1c3c=_0x177f72[_0xb5d2('0x1b')]+_0x177f72[_0xb5d2('0x1c')],_0x350355;if(_0x4c1c3c>=_0x23fc54){_0x4c1c3c=_0x23fc54;_0x350355=0xc8;}else{_0x350355=0xce;}_0x4616ff['status'](_0x350355);return _0x4616ff[_0xb5d2('0x1d')](_0xb5d2('0x1e'),_0x509c81+'-'+_0x4c1c3c+'/'+_0x23fc54)[_0xb5d2('0x1a')](_0x4d604c);}return null;};}function patchUpdates(_0x419450){return function(_0x2ee9c0){try{jsonpatch['apply'](_0x2ee9c0,_0x419450,!![]);}catch(_0x3811ce){return BPromise[_0xb5d2('0x1f')](_0x3811ce);}return _0x2ee9c0[_0xb5d2('0x20')]();};}function saveUpdates(_0x10aa1f,_0x6f962e){return function(_0x540ea6){if(_0x540ea6){return _0x540ea6[_0xb5d2('0x21')](_0x10aa1f)[_0xb5d2('0x22')](function(_0x121125){return _0x121125;});}return null;};}function removeEntity(_0x172a48,_0x41489a){return function(_0x4d03c2){if(_0x4d03c2){return _0x4d03c2[_0xb5d2('0x23')]()[_0xb5d2('0x22')](function(){var _0x20fe86=_0x4d03c2[_0xb5d2('0x24')]({'plain':!![]});var _0xb2b36b='CustomReports';return db[_0xb5d2('0x25')]['destroy']({'where':{'type':_0xb2b36b,'resourceId':_0x20fe86['id']}})[_0xb5d2('0x22')](function(){return _0x4d03c2;});})[_0xb5d2('0x22')](function(){_0x172a48[_0xb5d2('0x18')](0xcc)[_0xb5d2('0x19')]();});}};}function handleEntityNotFound(_0x377463,_0x512bab){return function(_0x222428){if(!_0x222428){_0x377463[_0xb5d2('0x17')](0x194);}return _0x222428;};}function handleError(_0x2a6dce,_0x4d2b8a){_0x4d2b8a=_0x4d2b8a||0x1f4;return function(_0x5a7352){logger[_0xb5d2('0x26')](_0x5a7352[_0xb5d2('0x27')]);if(_0x5a7352[_0xb5d2('0x28')]){delete _0x5a7352['name'];}_0x2a6dce[_0xb5d2('0x18')](_0x4d2b8a)['send'](_0x5a7352);};}exports['index']=function(_0x1b0bcb,_0x118f03){var _0x45eb5b={},_0x2eb45b={},_0x227420={'count':0x0,'rows':[]};var _0x2a1ed4=_[_0xb5d2('0x29')](db[_0xb5d2('0x2a')]['rawAttributes'],function(_0x5225d8){return{'name':_0x5225d8['fieldName'],'type':_0x5225d8[_0xb5d2('0x2b')][_0xb5d2('0x2c')]};});_0x2eb45b['model']=_['map'](_0x2a1ed4,_0xb5d2('0x28'));_0x2eb45b['query']=_['keys'](_0x1b0bcb['query']);_0x2eb45b[_0xb5d2('0x2d')]=_[_0xb5d2('0x2e')](_0x2eb45b[_0xb5d2('0x2f')],_0x2eb45b[_0xb5d2('0x30')]);_0x45eb5b['attributes']=_[_0xb5d2('0x2e')](_0x2eb45b[_0xb5d2('0x2f')],qs['fields'](_0x1b0bcb[_0xb5d2('0x30')]['fields']));_0x45eb5b[_0xb5d2('0x31')]=_0x45eb5b[_0xb5d2('0x31')][_0xb5d2('0x32')]?_0x45eb5b[_0xb5d2('0x31')]:_0x2eb45b[_0xb5d2('0x2f')];if(!_0x1b0bcb['query'][_0xb5d2('0x33')](_0xb5d2('0x34'))){_0x45eb5b['limit']=qs[_0xb5d2('0x1c')](_0x1b0bcb[_0xb5d2('0x30')]['limit']);_0x45eb5b[_0xb5d2('0x1b')]=qs[_0xb5d2('0x1b')](_0x1b0bcb['query'][_0xb5d2('0x1b')]);}_0x45eb5b[_0xb5d2('0x35')]=qs[_0xb5d2('0x36')](_0x1b0bcb[_0xb5d2('0x30')][_0xb5d2('0x36')]);_0x45eb5b['where']=qs[_0xb5d2('0x2d')](_['pick'](_0x1b0bcb[_0xb5d2('0x30')],_0x2eb45b[_0xb5d2('0x2d')]));if(_0x1b0bcb[_0xb5d2('0x30')][_0xb5d2('0x37')]){_0x45eb5b[_0xb5d2('0x38')]=_[_0xb5d2('0x39')](_0x45eb5b[_0xb5d2('0x38')],{'$or':_[_0xb5d2('0x29')](_0x2a1ed4,function(_0x4e97f9){if(_0x4e97f9['type'][_0xb5d2('0x2c')]!==_0xb5d2('0x3a')){var _0x32d786={};_0x32d786[_0x4e97f9['field']]={'$like':'%'+_0x1b0bcb[_0xb5d2('0x30')][_0xb5d2('0x37')]+'%'};return _0x32d786;}})});}_0x45eb5b=_[_0xb5d2('0x39')]({},_0x45eb5b,_0x1b0bcb[_0xb5d2('0x3b')]);var _0x489f73={'where':_0x45eb5b[_0xb5d2('0x38')]};return db['AnalyticCustomReport'][_0xb5d2('0x3c')](_0x489f73)[_0xb5d2('0x22')](function(_0x2398ba){_0x227420[_0xb5d2('0x3c')]=_0x2398ba;if(_0x1b0bcb['query'][_0xb5d2('0x3d')]){_0x45eb5b[_0xb5d2('0x3e')]=[{'all':!![]}];}return db[_0xb5d2('0x2a')][_0xb5d2('0x3f')](_0x45eb5b);})['then'](function(_0x3def9d){_0x227420['rows']=_0x3def9d;return _0x227420;})[_0xb5d2('0x22')](respondWithFilteredResult(_0x118f03,_0x45eb5b))[_0xb5d2('0x40')](handleError(_0x118f03,null));};exports[_0xb5d2('0x41')]=function(_0x301c79,_0xa70adc){var _0x475edc={'raw':![],'where':{'id':_0x301c79[_0xb5d2('0x42')]['id']}},_0x192c00={};_0x192c00[_0xb5d2('0x2f')]=_[_0xb5d2('0x43')](db[_0xb5d2('0x2a')][_0xb5d2('0x44')]);_0x192c00[_0xb5d2('0x30')]=_[_0xb5d2('0x43')](_0x301c79[_0xb5d2('0x30')]);_0x192c00[_0xb5d2('0x2d')]=_[_0xb5d2('0x2e')](_0x192c00['model'],_0x192c00[_0xb5d2('0x30')]);_0x475edc[_0xb5d2('0x31')]=_[_0xb5d2('0x2e')](_0x192c00[_0xb5d2('0x2f')],qs[_0xb5d2('0x45')](_0x301c79[_0xb5d2('0x30')]['fields']));_0x475edc[_0xb5d2('0x31')]=_0x475edc[_0xb5d2('0x31')]['length']?_0x475edc['attributes']:_0x192c00[_0xb5d2('0x2f')];if(_0x301c79['query'][_0xb5d2('0x3d')]){_0x475edc[_0xb5d2('0x3e')]=[{'all':!![]}];}_0x475edc=_[_0xb5d2('0x39')]({},_0x475edc,_0x301c79[_0xb5d2('0x3b')]);return db[_0xb5d2('0x2a')]['find'](_0x475edc)[_0xb5d2('0x22')](handleEntityNotFound(_0xa70adc,null))[_0xb5d2('0x22')](respondWithResult(_0xa70adc,null))[_0xb5d2('0x40')](handleError(_0xa70adc,null));};exports[_0xb5d2('0x46')]=function(_0x52a65f,_0x228987){return db[_0xb5d2('0x2a')]['create'](_0x52a65f[_0xb5d2('0x47')],{})[_0xb5d2('0x22')](function(_0x54b87c){var _0x264d4d=_0x52a65f[_0xb5d2('0x48')]['get']({'plain':!![]});if(!_0x264d4d)throw new Error(_0xb5d2('0x49'));if(_0x264d4d[_0xb5d2('0x4a')]==='user'){var _0x31b1d3=_0x54b87c[_0xb5d2('0x24')]({'plain':!![]});var _0x4a0c90='Reports';return db[_0xb5d2('0x4b')]['find']({'where':{'name':_0x4a0c90,'userProfileId':_0x264d4d['userProfileId']},'raw':!![]})[_0xb5d2('0x22')](function(_0x5327f5){if(_0x5327f5&&_0x5327f5[_0xb5d2('0x4c')]===0x0){return db[_0xb5d2('0x25')]['create']({'name':_0x31b1d3[_0xb5d2('0x28')],'resourceId':_0x31b1d3['id'],'type':_0xb5d2('0x4d'),'sectionId':_0x5327f5['id']},{})[_0xb5d2('0x22')](function(){return _0x54b87c;});}else{return _0x54b87c;}})[_0xb5d2('0x40')](function(_0x15526c){logger[_0xb5d2('0x26')](_0xb5d2('0x4e'),_0x15526c);throw _0x15526c;});}return _0x54b87c;})['then'](respondWithResult(_0x228987,0xc9))[_0xb5d2('0x40')](handleError(_0x228987,null));};exports[_0xb5d2('0x21')]=function(_0x47539d,_0x451844){if(_0x47539d[_0xb5d2('0x47')]['id']){delete _0x47539d[_0xb5d2('0x47')]['id'];}return db[_0xb5d2('0x2a')][_0xb5d2('0x4f')]({'where':{'id':_0x47539d['params']['id']}})[_0xb5d2('0x22')](handleEntityNotFound(_0x451844,null))['then'](saveUpdates(_0x47539d['body'],null))[_0xb5d2('0x22')](respondWithResult(_0x451844,null))[_0xb5d2('0x40')](handleError(_0x451844,null));};exports[_0xb5d2('0x23')]=function(_0x1b0df9,_0x1e9402){return db['AnalyticCustomReport'][_0xb5d2('0x4f')]({'where':{'id':_0x1b0df9['params']['id']}})[_0xb5d2('0x22')](handleEntityNotFound(_0x1e9402,null))[_0xb5d2('0x22')](removeEntity(_0x1e9402,null))[_0xb5d2('0x40')](handleError(_0x1e9402,null));};exports[_0xb5d2('0x50')]=function(_0x17cfd7,_0x23dbae){var _0x16ec47=0xa;var _0x3a502a=[_0xb5d2('0x51'),_0xb5d2('0x52'),'right_join',_0xb5d2('0x53')];var _0xccf812={'SUM':_0xb5d2('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb5d2('0x55'),'MAX':'MAX(%s)','MIN':_0xb5d2('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5d2('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb5d2('0x58')};var _0x4fc496={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb5d2('0x59'),'ROUND':_0xb5d2('0x5a'),'UNIX_TIMESTAMP':_0xb5d2('0x5b')};var _0x3c25a1=function(_0x2d1ad2){return!_[_0xb5d2('0x5c')]([_0xb5d2('0x5d'),_0xb5d2('0x5e'),'IS\x20EMPTY',_0xb5d2('0x5f')],_0x2d1ad2);};var _0x1420b3=function(_0x526b39){if(!_0x526b39||!_0x526b39[_0xb5d2('0x60')]['length']){return'';}for(var _0x22f830='(',_0x214839=0x0;_0x214839<_0x526b39['rules']['length'];_0x214839+=0x1){_0x214839>0x0&&(_0x22f830+='\x20'+_0x526b39[_0xb5d2('0x61')]+'\x20');_0x22f830+=_0x526b39[_0xb5d2('0x60')][_0x214839][_0xb5d2('0x62')]?_0x1420b3(_0x526b39[_0xb5d2('0x60')][_0x214839][_0xb5d2('0x62')]):_0x526b39[_0xb5d2('0x60')][_0x214839][_0xb5d2('0x63')]+'\x20'+_0x526b39['rules'][_0x214839][_0xb5d2('0x64')]+(_0x3c25a1(_0x526b39['rules'][_0x214839][_0xb5d2('0x64')])?'\x20'+_0x526b39['rules'][_0x214839][_0xb5d2('0x65')]:'');}return _0x22f830+')';};var _0x66c01c={'where':{'id':_0x17cfd7[_0xb5d2('0x42')]['id']}},_0xbc2c1f,_0x9d984b,_0x2d38f2,_0x33dc98,_0x718d7;_0x66c01c=_['merge']({},_0x66c01c,_0x17cfd7[_0xb5d2('0x3b')]);return db[_0xb5d2('0x2a')]['find'](_0x66c01c)[_0xb5d2('0x22')](function(_0x33519e){if(_0x33519e){_0xbc2c1f=_0x33519e;return _0x33519e[_0xb5d2('0x66')]();}return null;})[_0xb5d2('0x22')](function(_0x29e677){if(_0x29e677){if(!_0x29e677[_0xb5d2('0x32')]){throw new db[(_0xb5d2('0x67'))][(_0xb5d2('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x9d984b=_0x29e677;return db[_0xb5d2('0x69')][_0xb5d2('0x3f')]({'raw':!![]});}return null;})[_0xb5d2('0x22')](function(_0x130d39){if(_0x130d39){_0x2d38f2=_[_0xb5d2('0x6a')](_0x130d39,'id');var _0x3d116b;var _0x472251=squel[_0xb5d2('0x6b')]();_0x472251[_0xb5d2('0x6c')](_0xbc2c1f[_0xb5d2('0x6d')]);for(var _0x3ce1e8=0x0;_0x3ce1e8<_0x9d984b[_0xb5d2('0x32')];_0x3ce1e8+=0x1){_0x3d116b=_0x9d984b[_0x3ce1e8][_0xb5d2('0x6e')]?_0x2d38f2[_0x9d984b[_0x3ce1e8][_0xb5d2('0x6e')]][_0xb5d2('0x6f')]:_0x9d984b[_0x3ce1e8][_0xb5d2('0x63')];_0x3d116b=_0x9d984b[_0x3ce1e8][_0xb5d2('0x70')]?_[_0xb5d2('0x71')](_0xccf812[_0x9d984b[_0x3ce1e8][_0xb5d2('0x70')]],'%s',_0x3d116b):_0x3d116b;_0x3d116b=_0x9d984b[_0x3ce1e8]['format']?_['replace'](_0x4fc496[_0x9d984b[_0x3ce1e8][_0xb5d2('0x72')]],'%s',_0x3d116b):_0x3d116b;if(_0x9d984b[_0x3ce1e8][_0xb5d2('0x73')]){_0x472251[_0xb5d2('0x62')](_0x3d116b);}_0x9d984b[_0x3ce1e8]['orderBy']&&_0x472251[_0xb5d2('0x35')](_0x3d116b,_0x9d984b[_0x3ce1e8]['orderBy']===_0xb5d2('0x74')?![]:!![]);_0x472251[_0xb5d2('0x63')](_0x3d116b,_0x9d984b[_0x3ce1e8]['alias']||_0x3d116b);}if(_0xbc2c1f[_0xb5d2('0x75')]){_0xbc2c1f[_0xb5d2('0x75')]=JSON[_0xb5d2('0x76')](_0xbc2c1f[_0xb5d2('0x75')]);for(var _0x4a5af8=0x0;_0x4a5af8<_0xbc2c1f[_0xb5d2('0x75')][_0xb5d2('0x32')];_0x4a5af8+=0x1){if(_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x2b')]&&_[_0xb5d2('0x5c')](_0x3a502a,_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x2b')])&&_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8]['parentKey']&&_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x77')]&&_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8]['foreignKey']){_0x472251[_0xbc2c1f['joins'][_0x4a5af8][_0xb5d2('0x2b')]](_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x77')],null,util[_0xb5d2('0x72')]('%s.%s\x20=\x20%s.%s',_0xbc2c1f[_0xb5d2('0x6d')],_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x78')],_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8]['foreignTable'],_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x79')]));}}}if(_0xbc2c1f['conditions']){_0xbc2c1f[_0xb5d2('0x7a')]=JSON[_0xb5d2('0x76')](_0xbc2c1f[_0xb5d2('0x7a')]);_0x472251[_0xb5d2('0x38')](_0x1420b3(_0xbc2c1f[_0xb5d2('0x7a')][_0xb5d2('0x62')]));}_0x718d7=_0x472251[_0xb5d2('0x7b')]();_0x472251[_0xb5d2('0x1c')](_0x16ec47);_0x472251[_0xb5d2('0x1b')](0x0);logger[_0xb5d2('0x7c')]('Limited\x20Query:',_0x472251[_0xb5d2('0x7d')]());return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x472251[_0xb5d2('0x7d')](),{'type':db['sequelize'][_0xb5d2('0x7f')][_0xb5d2('0x80')]});}})['then'](respondWithResult(_0x23dbae,null))[_0xb5d2('0x40')](handleError(_0x23dbae,null));};function runReport(_0x55a113,_0x17e5d8,_0x48a937){var _0x3cda0f=_0x17e5d8['name'];var _0x4fb430=0xa;var _0x4206ba=[_0xb5d2('0x51'),_0xb5d2('0x52'),'right_join','cross_join'];var _0x467502={'SUM':_0xb5d2('0x54'),'COUNT':_0xb5d2('0x81'),'COUNT DISTINCT':_0xb5d2('0x55'),'MAX':_0xb5d2('0x82'),'MIN':_0xb5d2('0x56'),'AVG':_0xb5d2('0x83'),'GROUP_CONCAT':_0xb5d2('0x57'),'GROUP_CONCAT ASC':_0xb5d2('0x84'),'GROUP_CONCAT DESC':_0xb5d2('0x58')};var _0x345b8f={'SEC_TO_TIME':_0xb5d2('0x85'),'DATE':'DATE(%s)','HOUR':_0xb5d2('0x59'),'ROUND':_0xb5d2('0x5a'),'UNIX_TIMESTAMP':_0xb5d2('0x5b')};var _0x3397aa=function(_0x347b0a){return!_[_0xb5d2('0x5c')]([_0xb5d2('0x5d'),_0xb5d2('0x5e'),_0xb5d2('0x86'),'IS\x20NOT\x20EMPTY'],_0x347b0a);};var _0xd793eb=function(_0x1c45e3){if(!_0x1c45e3||!_0x1c45e3[_0xb5d2('0x60')]['length']){return'';}for(var _0x2365d8='(',_0x44bbb6=0x0;_0x44bbb6<_0x1c45e3[_0xb5d2('0x60')][_0xb5d2('0x32')];_0x44bbb6+=0x1){_0x44bbb6>0x0&&(_0x2365d8+='\x20'+_0x1c45e3[_0xb5d2('0x61')]+'\x20');_0x2365d8+=_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x62')]?_0xd793eb(_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x62')]):_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6]['field']+'\x20'+_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x64')]+(_0x3397aa(_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x64')])?'\x20'+_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x65')]:'');}return _0x2365d8+')';};var _0x59c041={'where':{'id':_0x55a113['id']}},_0x46cb63,_0x5a0d34,_0x1f4e8d,_0x2c000e,_0x3797a4;_0x59c041=_[_0xb5d2('0x39')]({},_0x59c041,_0x48a937);return db[_0xb5d2('0x2a')]['find'](_0x59c041)[_0xb5d2('0x22')](function(_0x1aa3f6){if(_0x1aa3f6){_0x46cb63=_0x1aa3f6;return _0x1aa3f6[_0xb5d2('0x66')]();}return null;})[_0xb5d2('0x22')](function(_0x496c4d){if(_0x496c4d){if(!_0x496c4d[_0xb5d2('0x32')]){throw new db[(_0xb5d2('0x67'))]['ValidationErrorItem'](_0xb5d2('0x87'),0x193);}_0x5a0d34=_0x496c4d;return db[_0xb5d2('0x69')][_0xb5d2('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x17bde2){if(_0x17bde2){_0x1f4e8d=_[_0xb5d2('0x6a')](_0x17bde2,'id');var _0x2a469c;var _0x2e6577=squel[_0xb5d2('0x6b')]();_0x2e6577[_0xb5d2('0x6c')](_0x46cb63[_0xb5d2('0x6d')]);for(var _0x1deed6=0x0;_0x1deed6<_0x5a0d34[_0xb5d2('0x32')];_0x1deed6+=0x1){_0x2a469c=_0x5a0d34[_0x1deed6]['MetricId']?_0x1f4e8d[_0x5a0d34[_0x1deed6][_0xb5d2('0x6e')]][_0xb5d2('0x6f')]:_0x5a0d34[_0x1deed6][_0xb5d2('0x63')];_0x2a469c=_0x5a0d34[_0x1deed6]['function']?_['replace'](_0x467502[_0x5a0d34[_0x1deed6][_0xb5d2('0x70')]],'%s',_0x2a469c):_0x2a469c;_0x2a469c=_0x5a0d34[_0x1deed6][_0xb5d2('0x72')]?_[_0xb5d2('0x71')](_0x345b8f[_0x5a0d34[_0x1deed6][_0xb5d2('0x72')]],'%s',_0x2a469c):_0x2a469c;if(_0x5a0d34[_0x1deed6][_0xb5d2('0x73')]){_0x2e6577[_0xb5d2('0x62')](_0x2a469c);}_0x5a0d34[_0x1deed6][_0xb5d2('0x88')]&&_0x2e6577[_0xb5d2('0x35')](_0x2a469c,_0x5a0d34[_0x1deed6][_0xb5d2('0x88')]==='DESC'?![]:!![]);_0x2e6577['field'](_0x2a469c,_0x5a0d34[_0x1deed6][_0xb5d2('0x89')]||_0x2a469c);}if(_0x46cb63[_0xb5d2('0x75')]){_0x46cb63['joins']=JSON[_0xb5d2('0x76')](_0x46cb63[_0xb5d2('0x75')]);for(var _0x2a3fde=0x0;_0x2a3fde<_0x46cb63[_0xb5d2('0x75')][_0xb5d2('0x32')];_0x2a3fde+=0x1){if(_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x2b')]&&_[_0xb5d2('0x5c')](_0x4206ba,_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['type'])&&_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['parentKey']&&_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['foreignTable']&&_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x79')]){_0x2e6577[_0x46cb63['joins'][_0x2a3fde]['type']](_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x77')],null,util[_0xb5d2('0x72')](_0xb5d2('0x8a'),_0x46cb63[_0xb5d2('0x6d')],_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x78')],_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['foreignTable'],_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x79')]));}}}if(_0x46cb63[_0xb5d2('0x7a')]){_0x46cb63[_0xb5d2('0x7a')]=JSON[_0xb5d2('0x76')](_0x46cb63[_0xb5d2('0x7a')]);_0x2e6577[_0xb5d2('0x38')](_0xd793eb(_0x46cb63['conditions'][_0xb5d2('0x62')]));}_0x3797a4=_0x2e6577['clone']();_0x2e6577[_0xb5d2('0x1c')](_0x4fb430);_0x2e6577[_0xb5d2('0x1b')](0x0);logger[_0xb5d2('0x7c')](_0xb5d2('0x8b'),_0x2e6577[_0xb5d2('0x7d')]());return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x2e6577[_0xb5d2('0x7d')](),{'type':db[_0xb5d2('0x7e')]['QueryTypes'][_0xb5d2('0x80')]});}})['then'](function(_0x168c00){if(!_0x168c00['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xb5d2('0x8c'),0xcc);}if(_0x17e5d8[_0xb5d2('0x8d')]===_0xb5d2('0x8e')){return null;}var _0x5cee26=_[_0xb5d2('0x39')](_0x17e5d8,{'name':_0x17e5d8['fullPath']||_0x17e5d8['name']||_0x46cb63[_0xb5d2('0x28')],'basename':_0x3cda0f,'savename':util[_0xb5d2('0x72')](_0xb5d2('0x8f'),_0x17e5d8[_0xb5d2('0x28')]||_0x46cb63['name'],require(_0xb5d2('0x90'))[_0xb5d2('0x91')](0x4),_0x17e5d8[_0xb5d2('0x8d')]||_0xb5d2('0x92')),'reportId':_0x46cb63['id'],'reportType':_0xb5d2('0x93')});return db[_0xb5d2('0x94')][_0xb5d2('0x46')](_0x5cee26,{'raw':!![]});})['then'](function(_0x163ddf){if(_0x46cb63['table']===_0xb5d2('0x95')){_0x3797a4[_0xb5d2('0x38')](_0x46cb63[_0xb5d2('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17e5d8[_0xb5d2('0x96')],_0x17e5d8[_0xb5d2('0x97')]);}else{_0x3797a4[_0xb5d2('0x38')](_0x46cb63[_0xb5d2('0x6d')]+_0xb5d2('0x98'),_0x17e5d8[_0xb5d2('0x96')],_0x17e5d8[_0xb5d2('0x97')]);}if(_0x163ddf){logger[_0xb5d2('0x99')](_0xb5d2('0x9a'),_0x3797a4['toString']());require(_0xb5d2('0x9b'))[_0xb5d2('0x9c')](path[_0xb5d2('0x51')](__dirname,'../../components/export/',_0x163ddf[_0xb5d2('0x8d')]),[_0x163ddf['id'],_0x3797a4[_0xb5d2('0x7d')](),path[_0xb5d2('0x51')](__dirname,_0xb5d2('0x9d'),_0x163ddf[_0xb5d2('0x9e')]),_0x3cda0f]);return _0x163ddf;}else{var _0x869794=squel[_0xb5d2('0x6b')]();_0x869794['from']('('+_0x3797a4[_0xb5d2('0x7d')]()+')',_0xb5d2('0x9f'));_0x869794[_0xb5d2('0x63')]('COUNT(*)',_0xb5d2('0x3c'));_0x3797a4['limit'](_0x17e5d8['limit']||_0x4fb430);_0x3797a4[_0xb5d2('0x1b')](_0x17e5d8[_0xb5d2('0x1b')]||0x0);return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x869794[_0xb5d2('0x7d')](),{'type':db[_0xb5d2('0x7e')][_0xb5d2('0x7f')][_0xb5d2('0x80')]})[_0xb5d2('0x22')](function(_0x3bb07a){if(!_0x3bb07a[_0xb5d2('0x32')]){_0x2c000e=0x0;}else{_0x2c000e=_0x3bb07a[0x0][_0xb5d2('0x3c')]||0x0;}return db['sequelize'][_0xb5d2('0x30')](_0x3797a4[_0xb5d2('0x7d')](),{'type':db[_0xb5d2('0x7e')][_0xb5d2('0x7f')]['SELECT']});})[_0xb5d2('0x22')](function(_0x27e3c9){return{'rows':_0x27e3c9||[],'count':_0x2c000e};});}});}exports['run']=function(_0x43a5e9,_0x15864c){return runReport(_0x43a5e9[_0xb5d2('0x42')],_0x43a5e9['query'],_0x43a5e9['options'])[_0xb5d2('0x22')](respondWithResult(_0x15864c,null))[_0xb5d2('0x40')](handleError(_0x15864c,null));};exports[_0xb5d2('0xa0')]=runReport;exports[_0xb5d2('0x30')]=function(_0x51ca04,_0x2f63b2){var _0x29a710=0xa;var _0xc4db2e=[_0xb5d2('0x51'),_0xb5d2('0x52'),_0xb5d2('0xa1'),_0xb5d2('0x53')];var _0x4d789e={'SUM':_0xb5d2('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5d2('0x82'),'MIN':_0xb5d2('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5d2('0x57'),'GROUP_CONCAT ASC':_0xb5d2('0x84'),'GROUP_CONCAT DESC':_0xb5d2('0x58')};var _0x35c6f7={'SEC_TO_TIME':_0xb5d2('0x85'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb5d2('0x5a'),'UNIX_TIMESTAMP':_0xb5d2('0x5b')};var _0x35c3bd=function(_0x32071b){return!_['includes']([_0xb5d2('0x5d'),_0xb5d2('0x5e'),_0xb5d2('0x86'),_0xb5d2('0x5f')],_0x32071b);};var _0x535f36=function(_0x155895){if(!_0x155895||!_0x155895['rules']['length']){return'';}for(var _0x5f1bcf='(',_0x4b80a4=0x0;_0x4b80a4<_0x155895[_0xb5d2('0x60')][_0xb5d2('0x32')];_0x4b80a4+=0x1){_0x4b80a4>0x0&&(_0x5f1bcf+='\x20'+_0x155895[_0xb5d2('0x61')]+'\x20');_0x5f1bcf+=_0x155895[_0xb5d2('0x60')][_0x4b80a4]['group']?_0x535f36(_0x155895['rules'][_0x4b80a4][_0xb5d2('0x62')]):_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x63')]+'\x20'+_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x64')]+(_0x35c3bd(_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x64')])?'\x20'+_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x65')]:'');}return _0x5f1bcf+')';};var _0x31356c={'where':{'id':_0x51ca04[_0xb5d2('0x42')]['id']}},_0x213419,_0x53d6d9,_0x4e8ea8,_0x1b2949,_0x236678;_0x31356c=_[_0xb5d2('0x39')]({},_0x31356c,_0x51ca04[_0xb5d2('0x3b')]);return db['AnalyticCustomReport']['find'](_0x31356c)[_0xb5d2('0x22')](function(_0x10267b){if(_0x10267b){_0x213419=_0x10267b;return _0x10267b[_0xb5d2('0x66')]();}return null;})[_0xb5d2('0x22')](function(_0x51302f){if(_0x51302f){if(!_0x51302f[_0xb5d2('0x32')]){throw new db[(_0xb5d2('0x67'))][(_0xb5d2('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x53d6d9=_0x51302f;return db[_0xb5d2('0x69')][_0xb5d2('0x3f')]({'raw':!![]});}return null;})[_0xb5d2('0x22')](function(_0x2048bd){if(_0x2048bd){_0x4e8ea8=_['keyBy'](_0x2048bd,'id');var _0x4f4fd6;var _0x3e563f=squel[_0xb5d2('0x6b')]();_0x3e563f[_0xb5d2('0x6c')](_0x213419[_0xb5d2('0x6d')]);for(var _0x45329b=0x0;_0x45329b<_0x53d6d9['length'];_0x45329b+=0x1){_0x4f4fd6=_0x53d6d9[_0x45329b][_0xb5d2('0x6e')]?_0x4e8ea8[_0x53d6d9[_0x45329b][_0xb5d2('0x6e')]][_0xb5d2('0x6f')]:_0x53d6d9[_0x45329b][_0xb5d2('0x63')];_0x4f4fd6=_0x53d6d9[_0x45329b][_0xb5d2('0x70')]?_[_0xb5d2('0x71')](_0x4d789e[_0x53d6d9[_0x45329b][_0xb5d2('0x70')]],'%s',_0x4f4fd6):_0x4f4fd6;_0x4f4fd6=_0x53d6d9[_0x45329b]['format']?_[_0xb5d2('0x71')](_0x35c6f7[_0x53d6d9[_0x45329b]['format']],'%s',_0x4f4fd6):_0x4f4fd6;if(_0x53d6d9[_0x45329b][_0xb5d2('0x73')]){_0x3e563f[_0xb5d2('0x62')](_0x4f4fd6);}_0x53d6d9[_0x45329b]['orderBy']&&_0x3e563f[_0xb5d2('0x35')](_0x4f4fd6,_0x53d6d9[_0x45329b][_0xb5d2('0x88')]===_0xb5d2('0x74')?![]:!![]);_0x3e563f[_0xb5d2('0x63')](_0x4f4fd6,_0x53d6d9[_0x45329b][_0xb5d2('0x89')]||_0x4f4fd6);}if(_0x213419[_0xb5d2('0x75')]){_0x213419[_0xb5d2('0x75')]=JSON[_0xb5d2('0x76')](_0x213419[_0xb5d2('0x75')]);for(var _0x2463f6=0x0;_0x2463f6<_0x213419[_0xb5d2('0x75')][_0xb5d2('0x32')];_0x2463f6+=0x1){if(_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x2b')]&&_[_0xb5d2('0x5c')](_0xc4db2e,_0x213419['joins'][_0x2463f6][_0xb5d2('0x2b')])&&_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x78')]&&_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x77')]&&_0x213419['joins'][_0x2463f6][_0xb5d2('0x79')]){_0x3e563f[_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x2b')]](_0x213419['joins'][_0x2463f6][_0xb5d2('0x77')],null,util[_0xb5d2('0x72')]('%s.%s\x20=\x20%s.%s',_0x213419[_0xb5d2('0x6d')],_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x78')],_0x213419[_0xb5d2('0x75')][_0x2463f6]['foreignTable'],_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x79')]));}}}if(_0x213419[_0xb5d2('0x7a')]){_0x213419[_0xb5d2('0x7a')]=JSON[_0xb5d2('0x76')](_0x213419[_0xb5d2('0x7a')]);_0x3e563f[_0xb5d2('0x38')](_0x535f36(_0x213419['conditions'][_0xb5d2('0x62')]));}_0x236678=_0x3e563f['clone']();_0x3e563f['limit'](_0x29a710);_0x3e563f['offset'](0x0);logger[_0xb5d2('0x7c')](_0xb5d2('0x8b'),_0x3e563f['toString']());return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x3e563f[_0xb5d2('0x7d')](),{'type':db['sequelize'][_0xb5d2('0x7f')][_0xb5d2('0x80')]});}})['then'](function(){return{'sql':_0x236678[_0xb5d2('0x7d')]()};})[_0xb5d2('0x22')](respondWithResult(_0x2f63b2,null))[_0xb5d2('0x40')](handleError(_0x2f63b2,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index fa4cdd5..55b5c8d 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 _0x7938=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x571d9e,_0x1f3133){var _0x2f5a02=function(_0x3f6f3c){while(--_0x3f6f3c){_0x571d9e['push'](_0x571d9e['shift']());}};_0x2f5a02(++_0x1f3133);}(_0x7938,0x1cb));var _0x8793=function(_0x5e3cd8,_0x4722f4){_0x5e3cd8=_0x5e3cd8-0x0;var _0x33ef3d=_0x7938[_0x5e3cd8];return _0x33ef3d;};'use strict';var _=require(_0x8793('0x0'));var util=require(_0x8793('0x1'));var logger=require('../../config/logger')(_0x8793('0x2'));var moment=require('moment');var BPromise=require(_0x8793('0x3'));var rp=require(_0x8793('0x4'));var fs=require('fs');var path=require(_0x8793('0x5'));var rimraf=require('rimraf');var config=require(_0x8793('0x6'));var attributes=require(_0x8793('0x7'));module[_0x8793('0x8')]=function(_0x2df293,_0x2ec908){return _0x2df293[_0x8793('0x9')](_0x8793('0xa'),attributes,{'tableName':_0x8793('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80b4=['path','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x27f3af,_0x3cadbc){var _0x45d434=function(_0x5c13d6){while(--_0x5c13d6){_0x27f3af['push'](_0x27f3af['shift']());}};_0x45d434(++_0x3cadbc);}(_0x80b4,0x195));var _0x480b=function(_0xad1a12,_0x12b08e){_0xad1a12=_0xad1a12-0x0;var _0x2ace3f=_0x80b4[_0xad1a12];return _0x2ace3f;};'use strict';var _=require('lodash');var util=require(_0x480b('0x0'));var logger=require(_0x480b('0x1'))('api');var moment=require(_0x480b('0x2'));var BPromise=require(_0x480b('0x3'));var rp=require(_0x480b('0x4'));var fs=require('fs');var path=require(_0x480b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x480b('0x6'));module['exports']=function(_0x5560a5,_0x4e073b){return _0x5560a5[_0x480b('0x7')](_0x480b('0x8'),attributes,{'tableName':_0x480b('0x9'),'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 8bc5806..2ecf81c 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 _0x7b75=['code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7b75,0x110));var _0x57b7=function(_0x595318,_0x2de91d){_0x595318=_0x595318-0x0;var _0x30e136=_0x7b75[_0x595318];return _0x30e136;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57b7('0x0'));var BPromise=require('bluebird');var rs=require(_0x57b7('0x1'));var fs=require('fs');var Redis=require(_0x57b7('0x2'));var db=require(_0x57b7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x57b7('0x4'));var config=require(_0x57b7('0x5'));var jayson=require(_0x57b7('0x6'));var client=jayson[_0x57b7('0x7')][_0x57b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8d4506,_0x566716,_0x2df235){return new BPromise(function(_0x3f6ee7,_0x51e11c){return client['request'](_0x8d4506,_0x2df235)[_0x57b7('0x9')](function(_0x23167b){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x566716,_0x57b7('0xa'));logger[_0x57b7('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x566716,_0x57b7('0xa'),JSON['stringify'](_0x23167b));if(_0x23167b[_0x57b7('0xc')]){if(_0x23167b[_0x57b7('0xc')][_0x57b7('0xd')]===0x1f4){logger[_0x57b7('0xc')](_0x57b7('0xe'),_0x566716,_0x23167b[_0x57b7('0xc')][_0x57b7('0xf')]);return _0x51e11c(_0x23167b['error'][_0x57b7('0xf')]);}logger[_0x57b7('0xc')](_0x57b7('0xe'),_0x566716,_0x23167b[_0x57b7('0xc')][_0x57b7('0xf')]);return _0x3f6ee7(_0x23167b[_0x57b7('0xc')][_0x57b7('0xf')]);}else{logger[_0x57b7('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x566716,_0x57b7('0xa'));_0x3f6ee7(_0x23167b[_0x57b7('0x11')][_0x57b7('0xf')]);}})[_0x57b7('0x12')](function(_0x273b87){logger[_0x57b7('0xc')](_0x57b7('0xe'),_0x566716,_0x273b87);_0x51e11c(_0x273b87);});});}
\ No newline at end of file
+var _0x68bd=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x68bd,0x166));var _0xd68b=function(_0x4bc221,_0x51adfe){_0x4bc221=_0x4bc221-0x0;var _0x188462=_0x68bd[_0x4bc221];return _0x188462;};'use strict';var _=require(_0xd68b('0x0'));var util=require(_0xd68b('0x1'));var moment=require('moment');var BPromise=require(_0xd68b('0x2'));var rs=require(_0xd68b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd68b('0x4'))['db'];var utils=require(_0xd68b('0x5'));var logger=require('../../config/logger')(_0xd68b('0x6'));var config=require('../../config/environment');var jayson=require(_0xd68b('0x7'));var client=jayson['client'][_0xd68b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3948d9,_0x41ea06,_0x14d4d9){return new BPromise(function(_0x3e408e,_0x59b942){return client[_0xd68b('0x9')](_0x3948d9,_0x14d4d9)[_0xd68b('0xa')](function(_0x1820ca){logger[_0xd68b('0xb')](_0xd68b('0xc'),_0x41ea06,_0xd68b('0xd'));logger['debug'](_0xd68b('0xe'),_0x41ea06,'request\x20sent',JSON[_0xd68b('0xf')](_0x1820ca));if(_0x1820ca['error']){if(_0x1820ca[_0xd68b('0x10')][_0xd68b('0x11')]===0x1f4){logger[_0xd68b('0x10')](_0xd68b('0xc'),_0x41ea06,_0x1820ca['error'][_0xd68b('0x12')]);return _0x59b942(_0x1820ca['error'][_0xd68b('0x12')]);}logger[_0xd68b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x41ea06,_0x1820ca['error'][_0xd68b('0x12')]);return _0x3e408e(_0x1820ca[_0xd68b('0x10')]['message']);}else{logger[_0xd68b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x41ea06,_0xd68b('0xd'));_0x3e408e(_0x1820ca[_0xd68b('0x13')][_0xd68b('0x12')]);}})['catch'](function(_0x1fc625){logger['error'](_0xd68b('0xc'),_0x41ea06,_0x1fc625);_0x59b942(_0x1fc625);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index c4c0cb7..c1d8c41 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 _0xccaa=['/:id','update','delete','exports','multer','util','Router','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccaa,0x122));var _0xacca=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0xccaa[_0x770f7];return _0xe797c6;};'use strict';var multer=require(_0xacca('0x0'));var util=require(_0xacca('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xacca('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xacca('0x3'));var controller=require(_0xacca('0x4'));router[_0xacca('0x5')]('/',auth[_0xacca('0x6')](),controller[_0xacca('0x7')]);router[_0xacca('0x5')]('/:id',auth[_0xacca('0x6')](),controller[_0xacca('0x8')]);router[_0xacca('0x5')](_0xacca('0x9'),auth[_0xacca('0x6')](),controller[_0xacca('0xa')]);router[_0xacca('0x5')](_0xacca('0xb'),auth[_0xacca('0x6')](),controller[_0xacca('0xc')]);router[_0xacca('0x5')](_0xacca('0xd'),auth['isAuthenticated'](),controller[_0xacca('0xe')]);router[_0xacca('0xf')]('/',auth[_0xacca('0x6')](),controller[_0xacca('0x10')]);router[_0xacca('0x11')](_0xacca('0x12'),auth['isAuthenticated'](),controller[_0xacca('0x13')]);router[_0xacca('0x14')](_0xacca('0x12'),auth[_0xacca('0x6')](),controller['destroy']);module[_0xacca('0x15')]=router;
\ No newline at end of file
+var _0x5559=['/:id','show','/:id/preview','/:id/run','/:id/query','query','post','put','update','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x5559,0x1ae));var _0x9555=function(_0x354aae,_0x487119){_0x354aae=_0x354aae-0x0;var _0x1426a2=_0x5559[_0x354aae];return _0x1426a2;};'use strict';var multer=require(_0x9555('0x0'));var util=require(_0x9555('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9555('0x2'));var router=express[_0x9555('0x3')]();var auth=require(_0x9555('0x4'));var interaction=require(_0x9555('0x5'));var config=require(_0x9555('0x6'));var controller=require(_0x9555('0x7'));router['get']('/',auth[_0x9555('0x8')](),controller[_0x9555('0x9')]);router[_0x9555('0xa')](_0x9555('0xb'),auth['isAuthenticated'](),controller[_0x9555('0xc')]);router[_0x9555('0xa')](_0x9555('0xd'),auth[_0x9555('0x8')](),controller['preview']);router[_0x9555('0xa')](_0x9555('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x9555('0xa')](_0x9555('0xf'),auth['isAuthenticated'](),controller[_0x9555('0x10')]);router[_0x9555('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9555('0x12')](_0x9555('0xb'),auth['isAuthenticated'](),controller[_0x9555('0x13')]);router['delete']('/:id',auth[_0x9555('0x8')](),controller['destroy']);module[_0x9555('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 0c35578..90d0fb2 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 _0x3b3d=['STRING','TEXT','sequelize'];(function(_0x318179,_0x59b38e){var _0x1d2c30=function(_0x3f7ad4){while(--_0x3f7ad4){_0x318179['push'](_0x318179['shift']());}};_0x1d2c30(++_0x59b38e);}(_0x3b3d,0x122));var _0xd3b3=function(_0x4d7f7b,_0x4987e3){_0x4d7f7b=_0x4d7f7b-0x0;var _0x5effb0=_0x3b3d[_0x4d7f7b];return _0x5effb0;};'use strict';var Sequelize=require(_0xd3b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3b3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd3b3('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xd3b3('0x2')]},'joins':{'type':Sequelize[_0xd3b3('0x2')]}};
\ No newline at end of file
+var _0x7c97=['exports','STRING','TEXT','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7c97,0x67));var _0x77c9=function(_0x544136,_0x61d7ed){_0x544136=_0x544136-0x0;var _0x3bc455=_0x7c97[_0x544136];return _0x3bc455;};'use strict';var Sequelize=require(_0x77c9('0x0'));module[_0x77c9('0x1')]={'name':{'type':Sequelize[_0x77c9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x77c9('0x2')]},'parent':{'type':Sequelize[_0x77c9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x77c9('0x3')]},'joins':{'type':Sequelize[_0x77c9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4152cc5..2823d5a 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 _0x8fd3=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','send','index','AnalyticDefaultReport','fieldName','model','map','query','keys','filters','intersection','attributes','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','findAll','rows','catch','show','params','fields','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','length','operator','rules','group','value','options','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','toString','sequelize','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20NULL','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','metric','DESC','SELECT','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','child_process','fork','../../components/export/','../../files/reports','countTable','QueryTypes','run','runReport','AVG(%s)','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x8fd3,0x1d7));var _0x38fd=function(_0x135b3c,_0x559a66){_0x135b3c=_0x135b3c-0x0;var _0x325a29=_0x8fd3[_0x135b3c];return _0x325a29;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x38fd('0x0'));var rimraf=require(_0x38fd('0x1'));var zipdir=require(_0x38fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x38fd('0x3'));var Mustache=require(_0x38fd('0x4'));var util=require('util');var path=require('path');var sox=require(_0x38fd('0x5'));var csv=require(_0x38fd('0x6'));var ejs=require(_0x38fd('0x7'));var fs=require('fs');var _=require(_0x38fd('0x8'));var squel=require(_0x38fd('0x9'));var crypto=require(_0x38fd('0xa'));var jsforce=require(_0x38fd('0xb'));var deskjs=require(_0x38fd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x38fd('0xd'));var Papa=require(_0x38fd('0xe'));var Redis=require(_0x38fd('0xf'));var authService=require(_0x38fd('0x10'));var qs=require(_0x38fd('0x11'));var as=require(_0x38fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x38fd('0x13'));var utils=require(_0x38fd('0x14'));var config=require('../../config/environment');var db=require(_0x38fd('0x15'))['db'];function respondWithStatusCode(_0x42a418,_0xc5ff57){_0xc5ff57=_0xc5ff57||0xcc;return function(_0x534ca1){if(_0x534ca1){return _0x42a418['sendStatus'](_0xc5ff57);}return _0x42a418[_0x38fd('0x16')](_0xc5ff57)[_0x38fd('0x17')]();};}function respondWithResult(_0x25ad82,_0x33ab45){_0x33ab45=_0x33ab45||0xc8;return function(_0x1fefdb){if(_0x1fefdb){return _0x25ad82[_0x38fd('0x16')](_0x33ab45)[_0x38fd('0x18')](_0x1fefdb);}};}function respondWithFilteredResult(_0x51310c,_0x5f18f9){return function(_0x4c91b6){if(_0x4c91b6){var _0x3c01a5=_0x4c91b6[_0x38fd('0x19')],_0x2ab37a=_0x5f18f9[_0x38fd('0x1a')],_0x4fb163=_0x5f18f9[_0x38fd('0x1a')]+_0x5f18f9[_0x38fd('0x1b')],_0x25e5f6;if(_0x4fb163>=_0x3c01a5){_0x4fb163=_0x3c01a5;_0x25e5f6=0xc8;}else{_0x25e5f6=0xce;}_0x51310c[_0x38fd('0x16')](_0x25e5f6);return _0x51310c[_0x38fd('0x1c')]('Content-Range',_0x2ab37a+'-'+_0x4fb163+'/'+_0x3c01a5)[_0x38fd('0x18')](_0x4c91b6);}return null;};}function patchUpdates(_0x422888){return function(_0x42568a){try{jsonpatch[_0x38fd('0x1d')](_0x42568a,_0x422888,!![]);}catch(_0x57f140){return BPromise[_0x38fd('0x1e')](_0x57f140);}return _0x42568a[_0x38fd('0x1f')]();};}function saveUpdates(_0x304e30,_0x1dab96){return function(_0x568c1a){if(_0x568c1a){return _0x568c1a[_0x38fd('0x20')](_0x304e30)[_0x38fd('0x21')](function(_0x2194e5){return _0x2194e5;});}return null;};}function removeEntity(_0x3812cd,_0x2e68dc){return function(_0x15aa31){if(_0x15aa31){return _0x15aa31['destroy']()[_0x38fd('0x21')](function(){var _0x4d76aa=_0x15aa31[_0x38fd('0x22')]({'plain':!![]});var _0x3cb2ae='DefaultReports';return db[_0x38fd('0x23')][_0x38fd('0x24')]({'where':{'type':_0x3cb2ae,'resourceId':_0x4d76aa['id']}})[_0x38fd('0x21')](function(){return _0x15aa31;});})[_0x38fd('0x21')](function(){_0x3812cd[_0x38fd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251fc3,_0x26c2a4){return function(_0x5e5533){if(!_0x5e5533){_0x251fc3['sendStatus'](0x194);}return _0x5e5533;};}function handleError(_0x52945d,_0x3841db){_0x3841db=_0x3841db||0x1f4;return function(_0x4f9cd5){logger[_0x38fd('0x25')](_0x4f9cd5['stack']);if(_0x4f9cd5['name']){delete _0x4f9cd5[_0x38fd('0x26')];}_0x52945d[_0x38fd('0x16')](_0x3841db)[_0x38fd('0x27')](_0x4f9cd5);};}exports[_0x38fd('0x28')]=function(_0x1251fc,_0x33701e){var _0x10bea6={},_0x4c9f46={},_0x2bb9e8={'count':0x0,'rows':[]};var _0x5c52d5=_['map'](db[_0x38fd('0x29')]['rawAttributes'],function(_0x3f4f97){return{'name':_0x3f4f97[_0x38fd('0x2a')],'type':_0x3f4f97['type']['key']};});_0x4c9f46[_0x38fd('0x2b')]=_[_0x38fd('0x2c')](_0x5c52d5,_0x38fd('0x26'));_0x4c9f46[_0x38fd('0x2d')]=_[_0x38fd('0x2e')](_0x1251fc[_0x38fd('0x2d')]);_0x4c9f46[_0x38fd('0x2f')]=_['intersection'](_0x4c9f46[_0x38fd('0x2b')],_0x4c9f46[_0x38fd('0x2d')]);_0x10bea6['attributes']=_[_0x38fd('0x30')](_0x4c9f46[_0x38fd('0x2b')],qs['fields'](_0x1251fc[_0x38fd('0x2d')]['fields']));_0x10bea6[_0x38fd('0x31')]=_0x10bea6['attributes']['length']?_0x10bea6['attributes']:_0x4c9f46[_0x38fd('0x2b')];if(!_0x1251fc[_0x38fd('0x2d')]['hasOwnProperty']('nolimit')){_0x10bea6[_0x38fd('0x1b')]=qs[_0x38fd('0x1b')](_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x1b')]);_0x10bea6[_0x38fd('0x1a')]=qs['offset'](_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x1a')]);}_0x10bea6[_0x38fd('0x32')]=qs[_0x38fd('0x33')](_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x33')]);_0x10bea6[_0x38fd('0x34')]=qs[_0x38fd('0x2f')](_[_0x38fd('0x35')](_0x1251fc[_0x38fd('0x2d')],_0x4c9f46[_0x38fd('0x2f')]));if(_0x1251fc[_0x38fd('0x2d')]['filter']){_0x10bea6['where']=_[_0x38fd('0x36')](_0x10bea6[_0x38fd('0x34')],{'$or':_[_0x38fd('0x2c')](_0x5c52d5,function(_0x1816b8){if(_0x1816b8[_0x38fd('0x37')][_0x38fd('0x38')]!==_0x38fd('0x39')){var _0x4620a2={};_0x4620a2[_0x1816b8[_0x38fd('0x3a')]]={'$like':'%'+_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x3b')]+'%'};return _0x4620a2;}})});}_0x10bea6=_[_0x38fd('0x36')]({},_0x10bea6,_0x1251fc['options']);var _0x26a7a8={'where':_0x10bea6['where']};return db[_0x38fd('0x29')][_0x38fd('0x19')](_0x26a7a8)['then'](function(_0x1421ee){_0x2bb9e8['count']=_0x1421ee;if(_0x1251fc[_0x38fd('0x2d')]['includeAll']){_0x10bea6['include']=[{'all':!![]}];}return db[_0x38fd('0x29')][_0x38fd('0x3c')](_0x10bea6);})[_0x38fd('0x21')](function(_0x25798f){_0x2bb9e8[_0x38fd('0x3d')]=_0x25798f;return _0x2bb9e8;})[_0x38fd('0x21')](respondWithFilteredResult(_0x33701e,_0x10bea6))[_0x38fd('0x3e')](handleError(_0x33701e,null));};exports[_0x38fd('0x3f')]=function(_0x5f5d33,_0x18d3b2){var _0x32b72b={'raw':!![],'where':{'id':_0x5f5d33[_0x38fd('0x40')]['id']}},_0x230354={};_0x230354['model']=_[_0x38fd('0x2e')](db[_0x38fd('0x29')]['rawAttributes']);_0x230354[_0x38fd('0x2d')]=_[_0x38fd('0x2e')](_0x5f5d33[_0x38fd('0x2d')]);_0x230354['filters']=_['intersection'](_0x230354[_0x38fd('0x2b')],_0x230354['query']);_0x32b72b['attributes']=_['intersection'](_0x230354['model'],qs['fields'](_0x5f5d33[_0x38fd('0x2d')][_0x38fd('0x41')]));_0x32b72b['attributes']=_0x32b72b[_0x38fd('0x31')]['length']?_0x32b72b[_0x38fd('0x31')]:_0x230354[_0x38fd('0x2b')];if(_0x5f5d33[_0x38fd('0x2d')][_0x38fd('0x42')]){_0x32b72b[_0x38fd('0x43')]=[{'all':!![]}];}_0x32b72b=_['merge']({},_0x32b72b,_0x5f5d33['options']);return db[_0x38fd('0x29')][_0x38fd('0x44')](_0x32b72b)[_0x38fd('0x21')](handleEntityNotFound(_0x18d3b2,null))[_0x38fd('0x21')](respondWithResult(_0x18d3b2,null))[_0x38fd('0x3e')](handleError(_0x18d3b2,null));};exports[_0x38fd('0x45')]=function(_0x5bc29d,_0x5e5785){return db[_0x38fd('0x29')][_0x38fd('0x45')](_0x5bc29d['body'],{})[_0x38fd('0x21')](function(_0x73a077){var _0x1bb3ed=_0x5bc29d['user'][_0x38fd('0x22')]({'plain':!![]});if(!_0x1bb3ed)throw new Error(_0x38fd('0x46'));if(_0x1bb3ed[_0x38fd('0x47')]==='user'){var _0x2ce6f4=_0x73a077[_0x38fd('0x22')]({'plain':!![]});var _0x435677=_0x38fd('0x48');return db['UserProfileSection'][_0x38fd('0x44')]({'where':{'name':_0x435677,'userProfileId':_0x1bb3ed[_0x38fd('0x49')]},'raw':!![]})[_0x38fd('0x21')](function(_0x5683e3){if(_0x5683e3&&_0x5683e3[_0x38fd('0x4a')]===0x0){return db[_0x38fd('0x23')][_0x38fd('0x45')]({'name':_0x2ce6f4[_0x38fd('0x26')],'resourceId':_0x2ce6f4['id'],'type':_0x38fd('0x4b'),'sectionId':_0x5683e3['id']},{})[_0x38fd('0x21')](function(){return _0x73a077;});}else{return _0x73a077;}})[_0x38fd('0x3e')](function(_0x4496f5){logger[_0x38fd('0x25')](_0x38fd('0x4c'),_0x4496f5);throw _0x4496f5;});}return _0x73a077;})['then'](respondWithResult(_0x5e5785,0xc9))[_0x38fd('0x3e')](handleError(_0x5e5785,null));};exports['update']=function(_0x216e08,_0x4cb419){if(_0x216e08[_0x38fd('0x4d')]['id']){delete _0x216e08[_0x38fd('0x4d')]['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x216e08[_0x38fd('0x40')]['id']}})[_0x38fd('0x21')](handleEntityNotFound(_0x4cb419,null))[_0x38fd('0x21')](saveUpdates(_0x216e08['body'],null))[_0x38fd('0x21')](respondWithResult(_0x4cb419,null))[_0x38fd('0x3e')](handleError(_0x4cb419,null));};exports[_0x38fd('0x24')]=function(_0x36d079,_0x23b1c8){return db[_0x38fd('0x29')][_0x38fd('0x44')]({'where':{'id':_0x36d079['params']['id']}})['then'](handleEntityNotFound(_0x23b1c8,null))['then'](removeEntity(_0x23b1c8,null))[_0x38fd('0x3e')](handleError(_0x23b1c8,null));};exports[_0x38fd('0x4e')]=function(_0x5cee37,_0x189c62){var _0x457e1b=0xa;var _0x176a7e=[_0x38fd('0x4f'),_0x38fd('0x50'),'right_join',_0x38fd('0x51')];var _0x4d691b={'SUM':_0x38fd('0x52'),'COUNT':_0x38fd('0x53'),'COUNT DISTINCT':_0x38fd('0x54'),'MAX':_0x38fd('0x55'),'MIN':_0x38fd('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x38fd('0x57'),'GROUP_CONCAT ASC':_0x38fd('0x58'),'GROUP_CONCAT DESC':_0x38fd('0x59')};var _0x4523b8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x38fd('0x5a'),'HOUR':_0x38fd('0x5b'),'ROUND':_0x38fd('0x5c'),'UNIX_TIMESTAMP':_0x38fd('0x5d')};var _0x5646c2=function(_0x43f2d1){return!_[_0x38fd('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x38fd('0x5f'),_0x38fd('0x60')],_0x43f2d1);};var _0x1ed016=function(_0xe10b7c){if(!_0xe10b7c||!_0xe10b7c['rules'][_0x38fd('0x61')]){return'';}for(var _0x4b2181='(',_0x4844be=0x0;_0x4844be<_0xe10b7c['rules'][_0x38fd('0x61')];_0x4844be+=0x1){_0x4844be>0x0&&(_0x4b2181+='\x20'+_0xe10b7c[_0x38fd('0x62')]+'\x20');_0x4b2181+=_0xe10b7c[_0x38fd('0x63')][_0x4844be][_0x38fd('0x64')]?_0x1ed016(_0xe10b7c[_0x38fd('0x63')][_0x4844be][_0x38fd('0x64')]):_0xe10b7c['rules'][_0x4844be][_0x38fd('0x3a')]+'\x20'+_0xe10b7c[_0x38fd('0x63')][_0x4844be]['condition']+(_0x5646c2(_0xe10b7c[_0x38fd('0x63')][_0x4844be]['condition'])?'\x20'+_0xe10b7c[_0x38fd('0x63')][_0x4844be][_0x38fd('0x65')]:'');}return _0x4b2181+')';};var _0x25398a={'where':{'id':_0x5cee37['params']['id']}},_0x2bdd1e,_0x3500b4,_0x5ea4bb,_0x2e273e,_0x3b199d;_0x25398a=_[_0x38fd('0x36')]({},_0x25398a,_0x5cee37[_0x38fd('0x66')]);return db[_0x38fd('0x29')][_0x38fd('0x44')](_0x25398a)[_0x38fd('0x21')](function(_0x1a90b1){if(_0x1a90b1){_0x2bdd1e=_0x1a90b1;return _0x1a90b1['getFields']();}return null;})[_0x38fd('0x21')](function(_0x2226bc){if(_0x2226bc){if(!_0x2226bc[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))][(_0x38fd('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3500b4=_0x2226bc;return db['AnalyticMetric'][_0x38fd('0x3c')]({'raw':!![]});}return null;})[_0x38fd('0x21')](function(_0x5b2bb2){if(_0x5b2bb2){_0x5ea4bb=_[_0x38fd('0x69')](_0x5b2bb2,'id');var _0xf2581b;var _0xc22546=squel[_0x38fd('0x6a')]();_0xc22546[_0x38fd('0x6b')](_0x2bdd1e[_0x38fd('0x6c')]);for(var _0x2a57cf=0x0;_0x2a57cf<_0x3500b4[_0x38fd('0x61')];_0x2a57cf+=0x1){_0xf2581b=_0x3500b4[_0x2a57cf][_0x38fd('0x6d')]?_0x5ea4bb[_0x3500b4[_0x2a57cf][_0x38fd('0x6d')]]['metric']:_0x3500b4[_0x2a57cf][_0x38fd('0x3a')];_0xf2581b=_0x3500b4[_0x2a57cf][_0x38fd('0x6e')]?_[_0x38fd('0x6f')](_0x4d691b[_0x3500b4[_0x2a57cf][_0x38fd('0x6e')]],'%s',_0xf2581b):_0xf2581b;_0xf2581b=_0x3500b4[_0x2a57cf][_0x38fd('0x70')]?_[_0x38fd('0x6f')](_0x4523b8[_0x3500b4[_0x2a57cf][_0x38fd('0x70')]],'%s',_0xf2581b):_0xf2581b;if(_0x3500b4[_0x2a57cf][_0x38fd('0x71')]){_0xc22546[_0x38fd('0x64')](_0xf2581b);}_0x3500b4[_0x2a57cf][_0x38fd('0x72')]&&_0xc22546[_0x38fd('0x32')](_0xf2581b,_0x3500b4[_0x2a57cf]['orderBy']==='DESC'?![]:!![]);_0xc22546[_0x38fd('0x3a')](_0xf2581b,_0x3500b4[_0x2a57cf][_0x38fd('0x73')]||_0xf2581b);}if(_0x2bdd1e[_0x38fd('0x74')]){_0x2bdd1e['joins']=JSON['parse'](_0x2bdd1e[_0x38fd('0x74')]);for(var _0x12035e=0x0;_0x12035e<_0x2bdd1e[_0x38fd('0x74')][_0x38fd('0x61')];_0x12035e+=0x1){if(_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x37')]&&_[_0x38fd('0x5e')](_0x176a7e,_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x37')])&&_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x75')]&&_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x76')]&&_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x77')]){_0xc22546[_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x37')]](_0x2bdd1e['joins'][_0x12035e][_0x38fd('0x76')],null,util[_0x38fd('0x70')](_0x38fd('0x78'),_0x2bdd1e['table'],_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x75')],_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x76')],_0x2bdd1e['joins'][_0x12035e]['foreignKey']));}}}if(_0x2bdd1e[_0x38fd('0x79')]){_0x2bdd1e[_0x38fd('0x79')]=JSON[_0x38fd('0x7a')](_0x2bdd1e['conditions']);_0xc22546[_0x38fd('0x34')](_0x1ed016(_0x2bdd1e[_0x38fd('0x79')][_0x38fd('0x64')]));}_0x3b199d=_0xc22546[_0x38fd('0x7b')]();_0xc22546[_0x38fd('0x1b')](_0x457e1b);_0xc22546[_0x38fd('0x1a')](0x0);logger[_0x38fd('0x7c')]('Limited\x20Query:',_0xc22546[_0x38fd('0x7d')]());return db[_0x38fd('0x7e')]['query'](_0xc22546[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x189c62,null))['catch'](handleError(_0x189c62,null));};function runReport(_0x1dd4f7,_0x2630f1,_0x265f19){var _0x8bdc7f=_0x2630f1[_0x38fd('0x26')];var _0x25341e=0xa;var _0x196ac9=['join',_0x38fd('0x50'),_0x38fd('0x7f'),'cross_join'];var _0x4f7338={'SUM':_0x38fd('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x38fd('0x54'),'MAX':_0x38fd('0x55'),'MIN':_0x38fd('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x38fd('0x57'),'GROUP_CONCAT ASC':_0x38fd('0x58'),'GROUP_CONCAT DESC':_0x38fd('0x59')};var _0x1b47b9={'SEC_TO_TIME':_0x38fd('0x80'),'DATE':_0x38fd('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x38fd('0x5c'),'UNIX_TIMESTAMP':_0x38fd('0x5d')};var _0x821d27=function(_0x316a2d){return!_[_0x38fd('0x5e')]([_0x38fd('0x81'),_0x38fd('0x82'),_0x38fd('0x5f'),_0x38fd('0x60')],_0x316a2d);};var _0xa43b79=function(_0x7d24d3){if(!_0x7d24d3||!_0x7d24d3[_0x38fd('0x63')][_0x38fd('0x61')]){return'';}for(var _0x2aa712='(',_0x3202c6=0x0;_0x3202c6<_0x7d24d3[_0x38fd('0x63')][_0x38fd('0x61')];_0x3202c6+=0x1){_0x3202c6>0x0&&(_0x2aa712+='\x20'+_0x7d24d3['operator']+'\x20');_0x2aa712+=_0x7d24d3[_0x38fd('0x63')][_0x3202c6]['group']?_0xa43b79(_0x7d24d3[_0x38fd('0x63')][_0x3202c6][_0x38fd('0x64')]):_0x7d24d3[_0x38fd('0x63')][_0x3202c6]['field']+'\x20'+_0x7d24d3['rules'][_0x3202c6][_0x38fd('0x83')]+(_0x821d27(_0x7d24d3['rules'][_0x3202c6][_0x38fd('0x83')])?'\x20'+_0x7d24d3[_0x38fd('0x63')][_0x3202c6]['value']:'');}return _0x2aa712+')';};var _0x34fa78={'where':{'id':_0x1dd4f7['id']}},_0x25908d,_0x4269a3,_0x292679,_0x30524c,_0x2e62dc;_0x34fa78=_['merge']({},_0x34fa78,_0x265f19);return db['AnalyticDefaultReport'][_0x38fd('0x44')](_0x34fa78)[_0x38fd('0x21')](function(_0x2bffc6){if(_0x2bffc6){_0x25908d=_0x2bffc6;return _0x2bffc6[_0x38fd('0x84')]();}return null;})[_0x38fd('0x21')](function(_0xd92818){if(_0xd92818){if(!_0xd92818[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))][(_0x38fd('0x68'))](_0x38fd('0x85'),0x193);}_0x4269a3=_0xd92818;return db[_0x38fd('0x86')]['findAll']({'raw':!![]});}return null;})[_0x38fd('0x21')](function(_0x16c185){if(_0x16c185){_0x292679=_['keyBy'](_0x16c185,'id');var _0x10fa9c;var _0x264839=squel[_0x38fd('0x6a')]();_0x264839[_0x38fd('0x6b')](_0x25908d['table']);for(var _0x10028e=0x0;_0x10028e<_0x4269a3['length'];_0x10028e+=0x1){_0x10fa9c=_0x4269a3[_0x10028e][_0x38fd('0x6d')]?_0x292679[_0x4269a3[_0x10028e][_0x38fd('0x6d')]][_0x38fd('0x87')]:_0x4269a3[_0x10028e]['field'];_0x10fa9c=_0x4269a3[_0x10028e]['function']?_[_0x38fd('0x6f')](_0x4f7338[_0x4269a3[_0x10028e]['function']],'%s',_0x10fa9c):_0x10fa9c;_0x10fa9c=_0x4269a3[_0x10028e][_0x38fd('0x70')]?_[_0x38fd('0x6f')](_0x1b47b9[_0x4269a3[_0x10028e][_0x38fd('0x70')]],'%s',_0x10fa9c):_0x10fa9c;if(_0x4269a3[_0x10028e][_0x38fd('0x71')]){_0x264839[_0x38fd('0x64')](_0x10fa9c);}_0x4269a3[_0x10028e][_0x38fd('0x72')]&&_0x264839[_0x38fd('0x32')](_0x10fa9c,_0x4269a3[_0x10028e][_0x38fd('0x72')]===_0x38fd('0x88')?![]:!![]);_0x264839[_0x38fd('0x3a')](_0x10fa9c,_0x4269a3[_0x10028e]['alias']||_0x10fa9c);}if(_0x25908d[_0x38fd('0x74')]){_0x25908d[_0x38fd('0x74')]=JSON[_0x38fd('0x7a')](_0x25908d['joins']);for(var _0x5d0d92=0x0;_0x5d0d92<_0x25908d[_0x38fd('0x74')][_0x38fd('0x61')];_0x5d0d92+=0x1){if(_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x37')]&&_[_0x38fd('0x5e')](_0x196ac9,_0x25908d['joins'][_0x5d0d92][_0x38fd('0x37')])&&_0x25908d[_0x38fd('0x74')][_0x5d0d92]['parentKey']&&_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x76')]&&_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x77')]){_0x264839[_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x37')]](_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x76')],null,util[_0x38fd('0x70')]('%s.%s\x20=\x20%s.%s',_0x25908d[_0x38fd('0x6c')],_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x75')],_0x25908d[_0x38fd('0x74')][_0x5d0d92]['foreignTable'],_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x77')]));}}}if(_0x25908d['conditions']){_0x25908d[_0x38fd('0x79')]=JSON[_0x38fd('0x7a')](_0x25908d['conditions']);_0x264839[_0x38fd('0x34')](_0xa43b79(_0x25908d[_0x38fd('0x79')][_0x38fd('0x64')]));}_0x2e62dc=_0x264839[_0x38fd('0x7b')]();_0x264839[_0x38fd('0x1b')](_0x25341e);_0x264839['offset'](0x0);logger[_0x38fd('0x7c')]('Limited\x20Query:',_0x264839[_0x38fd('0x7d')]());return db[_0x38fd('0x7e')][_0x38fd('0x2d')](_0x264839[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')]['QueryTypes'][_0x38fd('0x89')]});}})[_0x38fd('0x21')](function(_0x1a30e5){if(!_0x1a30e5[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))]['ValidationErrorItem'](_0x38fd('0x8a'),0xcc);}if(_0x2630f1[_0x38fd('0x8b')]===_0x38fd('0x8c')){return null;}var _0x2df89c=_[_0x38fd('0x36')](_0x2630f1,{'name':_0x2630f1[_0x38fd('0x8d')]||_0x2630f1[_0x38fd('0x26')]||_0x25908d['name'],'basename':_0x8bdc7f,'savename':util['format']('%s-%s.%s',_0x2630f1['name']||_0x25908d['name'],require(_0x38fd('0x8e'))[_0x38fd('0x8f')](0x4),_0x2630f1[_0x38fd('0x8b')]||_0x38fd('0x90')),'reportId':_0x25908d['id'],'reportType':_0x38fd('0x91')});return db[_0x38fd('0x92')][_0x38fd('0x45')](_0x2df89c,{'raw':!![]});})['then'](function(_0x34f42c){if(_0x25908d[_0x38fd('0x6c')]===_0x38fd('0x93')){_0x2e62dc['where'](_0x25908d['table']+_0x38fd('0x94'),_0x2630f1['startDate'],_0x2630f1['endDate']);}else{_0x2e62dc[_0x38fd('0x34')](_0x25908d[_0x38fd('0x6c')]+_0x38fd('0x95'),_0x2630f1[_0x38fd('0x96')],_0x2630f1[_0x38fd('0x97')]);}if(_0x34f42c){logger['info']('Run\x20Query:',_0x2e62dc[_0x38fd('0x7d')]());require(_0x38fd('0x98'))[_0x38fd('0x99')](path[_0x38fd('0x4f')](__dirname,_0x38fd('0x9a'),_0x34f42c[_0x38fd('0x8b')]),[_0x34f42c['id'],_0x2e62dc[_0x38fd('0x7d')](),path[_0x38fd('0x4f')](__dirname,_0x38fd('0x9b'),_0x34f42c['savename']),_0x8bdc7f]);return _0x34f42c;}else{var _0x25e6f4=squel['select']();_0x25e6f4[_0x38fd('0x6b')]('('+_0x2e62dc[_0x38fd('0x7d')]()+')',_0x38fd('0x9c'));_0x25e6f4[_0x38fd('0x3a')]('COUNT(*)',_0x38fd('0x19'));_0x2e62dc[_0x38fd('0x1b')](_0x2630f1[_0x38fd('0x1b')]||_0x25341e);_0x2e62dc[_0x38fd('0x1a')](_0x2630f1[_0x38fd('0x1a')]||0x0);return db['sequelize']['query'](_0x25e6f4[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')][_0x38fd('0x9d')][_0x38fd('0x89')]})[_0x38fd('0x21')](function(_0x338e3f){if(!_0x338e3f[_0x38fd('0x61')]){_0x30524c=0x0;}else{_0x30524c=_0x338e3f[0x0]['count']||0x0;}return db[_0x38fd('0x7e')][_0x38fd('0x2d')](_0x2e62dc[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')][_0x38fd('0x9d')][_0x38fd('0x89')]});})[_0x38fd('0x21')](function(_0x1bc51f){return{'rows':_0x1bc51f||[],'count':_0x30524c};});}});}exports[_0x38fd('0x9e')]=function(_0x6c8cd5,_0x26c43f){return runReport(_0x6c8cd5['params'],_0x6c8cd5[_0x38fd('0x2d')],_0x6c8cd5[_0x38fd('0x66')])[_0x38fd('0x21')](respondWithResult(_0x26c43f,null))['catch'](handleError(_0x26c43f,null));};exports[_0x38fd('0x9f')]=runReport;exports[_0x38fd('0x2d')]=function(_0x1c0438,_0x3f0d99){var _0x40efa4=0xa;var _0x50192a=['join',_0x38fd('0x50'),_0x38fd('0x7f'),_0x38fd('0x51')];var _0x4bb383={'SUM':_0x38fd('0x52'),'COUNT':_0x38fd('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x38fd('0x55'),'MIN':'MIN(%s)','AVG':_0x38fd('0xa0'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x38fd('0x59')};var _0x3ce84d={'SEC_TO_TIME':_0x38fd('0x80'),'DATE':_0x38fd('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4500ae=function(_0x5dcae1){return!_['includes']([_0x38fd('0x81'),_0x38fd('0x82'),_0x38fd('0x5f'),_0x38fd('0x60')],_0x5dcae1);};var _0x40ef0b=function(_0x9b9eb3){if(!_0x9b9eb3||!_0x9b9eb3['rules']['length']){return'';}for(var _0x1444b9='(',_0x256080=0x0;_0x256080<_0x9b9eb3['rules'][_0x38fd('0x61')];_0x256080+=0x1){_0x256080>0x0&&(_0x1444b9+='\x20'+_0x9b9eb3[_0x38fd('0x62')]+'\x20');_0x1444b9+=_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x64')]?_0x40ef0b(_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x64')]):_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x3a')]+'\x20'+_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x83')]+(_0x4500ae(_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x83')])?'\x20'+_0x9b9eb3['rules'][_0x256080][_0x38fd('0x65')]:'');}return _0x1444b9+')';};var _0x2e5984={'where':{'id':_0x1c0438[_0x38fd('0x40')]['id']}},_0x3cc9f6,_0x3f2e83,_0x109744,_0x23dfd7,_0x4a8e7b;_0x2e5984=_[_0x38fd('0x36')]({},_0x2e5984,_0x1c0438['options']);return db['AnalyticDefaultReport'][_0x38fd('0x44')](_0x2e5984)[_0x38fd('0x21')](function(_0x2ff68f){if(_0x2ff68f){_0x3cc9f6=_0x2ff68f;return _0x2ff68f[_0x38fd('0x84')]();}return null;})['then'](function(_0x36e8e4){if(_0x36e8e4){if(!_0x36e8e4[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))][(_0x38fd('0x68'))](_0x38fd('0x85'),0x193);}_0x3f2e83=_0x36e8e4;return db[_0x38fd('0x86')][_0x38fd('0x3c')]({'raw':!![]});}return null;})[_0x38fd('0x21')](function(_0x1c822f){if(_0x1c822f){_0x109744=_[_0x38fd('0x69')](_0x1c822f,'id');var _0x594131;var _0x23f1d1=squel[_0x38fd('0x6a')]();_0x23f1d1[_0x38fd('0x6b')](_0x3cc9f6[_0x38fd('0x6c')]);for(var _0x52c5b5=0x0;_0x52c5b5<_0x3f2e83[_0x38fd('0x61')];_0x52c5b5+=0x1){_0x594131=_0x3f2e83[_0x52c5b5][_0x38fd('0x6d')]?_0x109744[_0x3f2e83[_0x52c5b5]['MetricId']][_0x38fd('0x87')]:_0x3f2e83[_0x52c5b5]['field'];_0x594131=_0x3f2e83[_0x52c5b5][_0x38fd('0x6e')]?_['replace'](_0x4bb383[_0x3f2e83[_0x52c5b5][_0x38fd('0x6e')]],'%s',_0x594131):_0x594131;_0x594131=_0x3f2e83[_0x52c5b5][_0x38fd('0x70')]?_[_0x38fd('0x6f')](_0x3ce84d[_0x3f2e83[_0x52c5b5][_0x38fd('0x70')]],'%s',_0x594131):_0x594131;if(_0x3f2e83[_0x52c5b5][_0x38fd('0x71')]){_0x23f1d1[_0x38fd('0x64')](_0x594131);}_0x3f2e83[_0x52c5b5][_0x38fd('0x72')]&&_0x23f1d1[_0x38fd('0x32')](_0x594131,_0x3f2e83[_0x52c5b5]['orderBy']==='DESC'?![]:!![]);_0x23f1d1[_0x38fd('0x3a')](_0x594131,_0x3f2e83[_0x52c5b5][_0x38fd('0x73')]||_0x594131);}if(_0x3cc9f6[_0x38fd('0x74')]){_0x3cc9f6[_0x38fd('0x74')]=JSON[_0x38fd('0x7a')](_0x3cc9f6[_0x38fd('0x74')]);for(var _0x55d78c=0x0;_0x55d78c<_0x3cc9f6['joins'][_0x38fd('0x61')];_0x55d78c+=0x1){if(_0x3cc9f6['joins'][_0x55d78c][_0x38fd('0x37')]&&_[_0x38fd('0x5e')](_0x50192a,_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x37')])&&_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x75')]&&_0x3cc9f6['joins'][_0x55d78c]['foreignTable']&&_0x3cc9f6['joins'][_0x55d78c][_0x38fd('0x77')]){_0x23f1d1[_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x37')]](_0x3cc9f6[_0x38fd('0x74')][_0x55d78c]['foreignTable'],null,util[_0x38fd('0x70')](_0x38fd('0x78'),_0x3cc9f6[_0x38fd('0x6c')],_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x75')],_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x76')],_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x77')]));}}}if(_0x3cc9f6[_0x38fd('0x79')]){_0x3cc9f6[_0x38fd('0x79')]=JSON[_0x38fd('0x7a')](_0x3cc9f6[_0x38fd('0x79')]);_0x23f1d1[_0x38fd('0x34')](_0x40ef0b(_0x3cc9f6[_0x38fd('0x79')][_0x38fd('0x64')]));}_0x4a8e7b=_0x23f1d1[_0x38fd('0x7b')]();_0x23f1d1[_0x38fd('0x1b')](_0x40efa4);_0x23f1d1[_0x38fd('0x1a')](0x0);logger[_0x38fd('0x7c')]('Limited\x20Query:',_0x23f1d1[_0x38fd('0x7d')]());return db[_0x38fd('0x7e')]['query'](_0x23f1d1[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')][_0x38fd('0x9d')][_0x38fd('0x89')]});}})[_0x38fd('0x21')](function(){return{'sql':_0x4a8e7b[_0x38fd('0x7d')]()};})[_0x38fd('0x21')](respondWithResult(_0x3f0d99,null))[_0x38fd('0x3e')](handleError(_0x3f0d99,null));};
\ No newline at end of file
+var _0xee80=['send','index','map','AnalyticDefaultReport','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','show','rawAttributes','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','catch','update','params','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','field','function','replace','format','groupBy','DESC','alias','joins','foreignTable','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','DATE(%s)','Sequelize','ValidationErrorItem','select','orderBy','parentKey','QueryTypes','No\x20available\x20data','output','%s-%s.%s','generate','default','AnalyticExtractedReport','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','child_process','../../components/export/','../../files/reports','savename','countTable','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','%s.%s\x20=\x20%s.%s','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','set','json','apply','reject','save','then','destroy','DefaultReports','UserProfileResource','error','name'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xee80,0x1b0));var _0x0ee8=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xee80[_0x2070da];return _0x4f9fe1;};'use strict';var pdf=require(_0x0ee8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0ee8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ee8('0x2'));var rp=require(_0x0ee8('0x3'));var moment=require('moment');var BPromise=require(_0x0ee8('0x4'));var Mustache=require('mustache');var util=require(_0x0ee8('0x5'));var path=require('path');var sox=require(_0x0ee8('0x6'));var csv=require(_0x0ee8('0x7'));var ejs=require(_0x0ee8('0x8'));var fs=require('fs');var _=require(_0x0ee8('0x9'));var squel=require(_0x0ee8('0xa'));var crypto=require(_0x0ee8('0xb'));var jsforce=require(_0x0ee8('0xc'));var deskjs=require(_0x0ee8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee8('0xe'));var Redis=require(_0x0ee8('0xf'));var authService=require(_0x0ee8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0ee8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee8('0x12'))(_0x0ee8('0x13'));var utils=require('../../config/utils');var config=require(_0x0ee8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a14c,_0x735b5c){_0x735b5c=_0x735b5c||0xcc;return function(_0x342e37){if(_0x342e37){return _0x42a14c[_0x0ee8('0x15')](_0x735b5c);}return _0x42a14c[_0x0ee8('0x16')](_0x735b5c)['end']();};}function respondWithResult(_0x40f7f4,_0x31a601){_0x31a601=_0x31a601||0xc8;return function(_0x516156){if(_0x516156){return _0x40f7f4[_0x0ee8('0x16')](_0x31a601)['json'](_0x516156);}};}function respondWithFilteredResult(_0x3c0ce9,_0x532097){return function(_0x28ac56){if(_0x28ac56){var _0x1e23bd=_0x28ac56[_0x0ee8('0x17')],_0x746b9f=_0x532097['offset'],_0x2fdd68=_0x532097[_0x0ee8('0x18')]+_0x532097['limit'],_0x22e1cd;if(_0x2fdd68>=_0x1e23bd){_0x2fdd68=_0x1e23bd;_0x22e1cd=0xc8;}else{_0x22e1cd=0xce;}_0x3c0ce9[_0x0ee8('0x16')](_0x22e1cd);return _0x3c0ce9[_0x0ee8('0x19')]('Content-Range',_0x746b9f+'-'+_0x2fdd68+'/'+_0x1e23bd)[_0x0ee8('0x1a')](_0x28ac56);}return null;};}function patchUpdates(_0x5ba711){return function(_0x41b125){try{jsonpatch[_0x0ee8('0x1b')](_0x41b125,_0x5ba711,!![]);}catch(_0x1fdb74){return BPromise[_0x0ee8('0x1c')](_0x1fdb74);}return _0x41b125[_0x0ee8('0x1d')]();};}function saveUpdates(_0x31d78f,_0x28ac31){return function(_0x444b2f){if(_0x444b2f){return _0x444b2f['update'](_0x31d78f)[_0x0ee8('0x1e')](function(_0x5923c1){return _0x5923c1;});}return null;};}function removeEntity(_0x1bc16d,_0x54a190){return function(_0x12e00f){if(_0x12e00f){return _0x12e00f[_0x0ee8('0x1f')]()['then'](function(){var _0xa3e7df=_0x12e00f['get']({'plain':!![]});var _0x42a1bc=_0x0ee8('0x20');return db[_0x0ee8('0x21')][_0x0ee8('0x1f')]({'where':{'type':_0x42a1bc,'resourceId':_0xa3e7df['id']}})[_0x0ee8('0x1e')](function(){return _0x12e00f;});})[_0x0ee8('0x1e')](function(){_0x1bc16d[_0x0ee8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443c56,_0x107809){return function(_0x2d0818){if(!_0x2d0818){_0x443c56[_0x0ee8('0x15')](0x194);}return _0x2d0818;};}function handleError(_0x4a3d0d,_0x4e8cb0){_0x4e8cb0=_0x4e8cb0||0x1f4;return function(_0x49c731){logger[_0x0ee8('0x22')](_0x49c731['stack']);if(_0x49c731[_0x0ee8('0x23')]){delete _0x49c731['name'];}_0x4a3d0d[_0x0ee8('0x16')](_0x4e8cb0)[_0x0ee8('0x24')](_0x49c731);};}exports[_0x0ee8('0x25')]=function(_0x43f0fe,_0xe2ad61){var _0x2f944b={},_0x462a0c={},_0x9e4ea2={'count':0x0,'rows':[]};var _0x129a52=_[_0x0ee8('0x26')](db[_0x0ee8('0x27')]['rawAttributes'],function(_0x4d229d){return{'name':_0x4d229d[_0x0ee8('0x28')],'type':_0x4d229d[_0x0ee8('0x29')][_0x0ee8('0x2a')]};});_0x462a0c['model']=_['map'](_0x129a52,_0x0ee8('0x23'));_0x462a0c['query']=_[_0x0ee8('0x2b')](_0x43f0fe['query']);_0x462a0c['filters']=_[_0x0ee8('0x2c')](_0x462a0c[_0x0ee8('0x2d')],_0x462a0c[_0x0ee8('0x2e')]);_0x2f944b[_0x0ee8('0x2f')]=_['intersection'](_0x462a0c[_0x0ee8('0x2d')],qs[_0x0ee8('0x30')](_0x43f0fe[_0x0ee8('0x2e')]['fields']));_0x2f944b[_0x0ee8('0x2f')]=_0x2f944b[_0x0ee8('0x2f')][_0x0ee8('0x31')]?_0x2f944b['attributes']:_0x462a0c['model'];if(!_0x43f0fe[_0x0ee8('0x2e')]['hasOwnProperty'](_0x0ee8('0x32'))){_0x2f944b[_0x0ee8('0x33')]=qs['limit'](_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x33')]);_0x2f944b[_0x0ee8('0x18')]=qs[_0x0ee8('0x18')](_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x18')]);}_0x2f944b[_0x0ee8('0x34')]=qs[_0x0ee8('0x35')](_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x35')]);_0x2f944b[_0x0ee8('0x36')]=qs['filters'](_[_0x0ee8('0x37')](_0x43f0fe[_0x0ee8('0x2e')],_0x462a0c[_0x0ee8('0x38')]));if(_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x39')]){_0x2f944b[_0x0ee8('0x36')]=_[_0x0ee8('0x3a')](_0x2f944b['where'],{'$or':_[_0x0ee8('0x26')](_0x129a52,function(_0x29b13a){if(_0x29b13a[_0x0ee8('0x29')][_0x0ee8('0x2a')]!==_0x0ee8('0x3b')){var _0xbf5faa={};_0xbf5faa[_0x29b13a['field']]={'$like':'%'+_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x39')]+'%'};return _0xbf5faa;}})});}_0x2f944b=_['merge']({},_0x2f944b,_0x43f0fe[_0x0ee8('0x3c')]);var _0x1f2f94={'where':_0x2f944b[_0x0ee8('0x36')]};return db[_0x0ee8('0x27')][_0x0ee8('0x17')](_0x1f2f94)[_0x0ee8('0x1e')](function(_0x26a04b){_0x9e4ea2[_0x0ee8('0x17')]=_0x26a04b;if(_0x43f0fe[_0x0ee8('0x2e')]['includeAll']){_0x2f944b[_0x0ee8('0x3d')]=[{'all':!![]}];}return db[_0x0ee8('0x27')][_0x0ee8('0x3e')](_0x2f944b);})[_0x0ee8('0x1e')](function(_0x1684f4){_0x9e4ea2['rows']=_0x1684f4;return _0x9e4ea2;})[_0x0ee8('0x1e')](respondWithFilteredResult(_0xe2ad61,_0x2f944b))['catch'](handleError(_0xe2ad61,null));};exports[_0x0ee8('0x3f')]=function(_0x1563cc,_0x1e38ae){var _0x8ef3ab={'raw':!![],'where':{'id':_0x1563cc['params']['id']}},_0x24b91b={};_0x24b91b[_0x0ee8('0x2d')]=_[_0x0ee8('0x2b')](db[_0x0ee8('0x27')][_0x0ee8('0x40')]);_0x24b91b[_0x0ee8('0x2e')]=_[_0x0ee8('0x2b')](_0x1563cc[_0x0ee8('0x2e')]);_0x24b91b[_0x0ee8('0x38')]=_[_0x0ee8('0x2c')](_0x24b91b[_0x0ee8('0x2d')],_0x24b91b['query']);_0x8ef3ab[_0x0ee8('0x2f')]=_[_0x0ee8('0x2c')](_0x24b91b[_0x0ee8('0x2d')],qs[_0x0ee8('0x30')](_0x1563cc[_0x0ee8('0x2e')]['fields']));_0x8ef3ab[_0x0ee8('0x2f')]=_0x8ef3ab[_0x0ee8('0x2f')][_0x0ee8('0x31')]?_0x8ef3ab[_0x0ee8('0x2f')]:_0x24b91b['model'];if(_0x1563cc['query'][_0x0ee8('0x41')]){_0x8ef3ab[_0x0ee8('0x3d')]=[{'all':!![]}];}_0x8ef3ab=_[_0x0ee8('0x3a')]({},_0x8ef3ab,_0x1563cc[_0x0ee8('0x3c')]);return db[_0x0ee8('0x27')]['find'](_0x8ef3ab)[_0x0ee8('0x1e')](handleEntityNotFound(_0x1e38ae,null))[_0x0ee8('0x1e')](respondWithResult(_0x1e38ae,null))['catch'](handleError(_0x1e38ae,null));};exports[_0x0ee8('0x42')]=function(_0x4899b7,_0x341493){return db[_0x0ee8('0x27')][_0x0ee8('0x42')](_0x4899b7['body'],{})[_0x0ee8('0x1e')](function(_0x5c1f23){var _0x36b6ec=_0x4899b7[_0x0ee8('0x43')][_0x0ee8('0x44')]({'plain':!![]});if(!_0x36b6ec)throw new Error(_0x0ee8('0x45'));if(_0x36b6ec[_0x0ee8('0x46')]===_0x0ee8('0x43')){var _0x41e7a2=_0x5c1f23['get']({'plain':!![]});var _0x3a6bea=_0x0ee8('0x47');return db['UserProfileSection'][_0x0ee8('0x48')]({'where':{'name':_0x3a6bea,'userProfileId':_0x36b6ec[_0x0ee8('0x49')]},'raw':!![]})['then'](function(_0x593b23){if(_0x593b23&&_0x593b23['autoAssociation']===0x0){return db[_0x0ee8('0x21')][_0x0ee8('0x42')]({'name':_0x41e7a2[_0x0ee8('0x23')],'resourceId':_0x41e7a2['id'],'type':_0x0ee8('0x20'),'sectionId':_0x593b23['id']},{})[_0x0ee8('0x1e')](function(){return _0x5c1f23;});}else{return _0x5c1f23;}})[_0x0ee8('0x4a')](function(_0x40dbfa){logger[_0x0ee8('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40dbfa);throw _0x40dbfa;});}return _0x5c1f23;})['then'](respondWithResult(_0x341493,0xc9))[_0x0ee8('0x4a')](handleError(_0x341493,null));};exports[_0x0ee8('0x4b')]=function(_0x3487e0,_0x1dd071){if(_0x3487e0['body']['id']){delete _0x3487e0['body']['id'];}return db[_0x0ee8('0x27')][_0x0ee8('0x48')]({'where':{'id':_0x3487e0[_0x0ee8('0x4c')]['id']}})[_0x0ee8('0x1e')](handleEntityNotFound(_0x1dd071,null))[_0x0ee8('0x1e')](saveUpdates(_0x3487e0[_0x0ee8('0x4d')],null))[_0x0ee8('0x1e')](respondWithResult(_0x1dd071,null))['catch'](handleError(_0x1dd071,null));};exports['destroy']=function(_0x352908,_0x3fe57){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x352908[_0x0ee8('0x4c')]['id']}})[_0x0ee8('0x1e')](handleEntityNotFound(_0x3fe57,null))['then'](removeEntity(_0x3fe57,null))[_0x0ee8('0x4a')](handleError(_0x3fe57,null));};exports[_0x0ee8('0x4e')]=function(_0x226283,_0x13facd){var _0x57eca8=0xa;var _0x265f4c=[_0x0ee8('0x4f'),_0x0ee8('0x50'),_0x0ee8('0x51'),_0x0ee8('0x52')];var _0x10cff5={'SUM':_0x0ee8('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0ee8('0x54'),'MAX':_0x0ee8('0x55'),'MIN':_0x0ee8('0x56'),'AVG':_0x0ee8('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0ee8('0x58')};var _0x205af3={'SEC_TO_TIME':_0x0ee8('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x0ee8('0x5a'),'UNIX_TIMESTAMP':_0x0ee8('0x5b')};var _0x39094f=function(_0x36f230){return!_[_0x0ee8('0x5c')]([_0x0ee8('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x0ee8('0x5e')],_0x36f230);};var _0x3808f4=function(_0x4dc3a1){if(!_0x4dc3a1||!_0x4dc3a1[_0x0ee8('0x5f')][_0x0ee8('0x31')]){return'';}for(var _0x123136='(',_0x32e870=0x0;_0x32e870<_0x4dc3a1['rules'][_0x0ee8('0x31')];_0x32e870+=0x1){_0x32e870>0x0&&(_0x123136+='\x20'+_0x4dc3a1[_0x0ee8('0x60')]+'\x20');_0x123136+=_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870][_0x0ee8('0x61')]?_0x3808f4(_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870]['group']):_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870]['field']+'\x20'+_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870]['condition']+(_0x39094f(_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870][_0x0ee8('0x62')])?'\x20'+_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870][_0x0ee8('0x63')]:'');}return _0x123136+')';};var _0x10fe80={'where':{'id':_0x226283['params']['id']}},_0xceeb33,_0x5a3f7a,_0x46f297,_0x49f914,_0x3e5ad1;_0x10fe80=_[_0x0ee8('0x3a')]({},_0x10fe80,_0x226283[_0x0ee8('0x3c')]);return db[_0x0ee8('0x27')][_0x0ee8('0x48')](_0x10fe80)['then'](function(_0x5743df){if(_0x5743df){_0xceeb33=_0x5743df;return _0x5743df[_0x0ee8('0x64')]();}return null;})[_0x0ee8('0x1e')](function(_0x5cb1c6){if(_0x5cb1c6){if(!_0x5cb1c6[_0x0ee8('0x31')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0ee8('0x65'),0x193);}_0x5a3f7a=_0x5cb1c6;return db[_0x0ee8('0x66')][_0x0ee8('0x3e')]({'raw':!![]});}return null;})[_0x0ee8('0x1e')](function(_0x3c281f){if(_0x3c281f){_0x46f297=_[_0x0ee8('0x67')](_0x3c281f,'id');var _0x1c8af6;var _0x30808c=squel['select']();_0x30808c[_0x0ee8('0x68')](_0xceeb33[_0x0ee8('0x69')]);for(var _0x2a2bb9=0x0;_0x2a2bb9<_0x5a3f7a[_0x0ee8('0x31')];_0x2a2bb9+=0x1){_0x1c8af6=_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6a')]?_0x46f297[_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6a')]][_0x0ee8('0x6b')]:_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6c')];_0x1c8af6=_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6d')]?_[_0x0ee8('0x6e')](_0x10cff5[_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6d')]],'%s',_0x1c8af6):_0x1c8af6;_0x1c8af6=_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6f')]?_[_0x0ee8('0x6e')](_0x205af3[_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6f')]],'%s',_0x1c8af6):_0x1c8af6;if(_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x70')]){_0x30808c[_0x0ee8('0x61')](_0x1c8af6);}_0x5a3f7a[_0x2a2bb9]['orderBy']&&_0x30808c[_0x0ee8('0x34')](_0x1c8af6,_0x5a3f7a[_0x2a2bb9]['orderBy']===_0x0ee8('0x71')?![]:!![]);_0x30808c[_0x0ee8('0x6c')](_0x1c8af6,_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x72')]||_0x1c8af6);}if(_0xceeb33[_0x0ee8('0x73')]){_0xceeb33['joins']=JSON['parse'](_0xceeb33[_0x0ee8('0x73')]);for(var _0x3f1796=0x0;_0x3f1796<_0xceeb33['joins'][_0x0ee8('0x31')];_0x3f1796+=0x1){if(_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x29')]&&_[_0x0ee8('0x5c')](_0x265f4c,_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x29')])&&_0xceeb33[_0x0ee8('0x73')][_0x3f1796]['parentKey']&&_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x74')]&&_0xceeb33['joins'][_0x3f1796][_0x0ee8('0x75')]){_0x30808c[_0xceeb33['joins'][_0x3f1796][_0x0ee8('0x29')]](_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x74')],null,util[_0x0ee8('0x6f')]('%s.%s\x20=\x20%s.%s',_0xceeb33[_0x0ee8('0x69')],_0xceeb33[_0x0ee8('0x73')][_0x3f1796]['parentKey'],_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x74')],_0xceeb33['joins'][_0x3f1796]['foreignKey']));}}}if(_0xceeb33['conditions']){_0xceeb33[_0x0ee8('0x76')]=JSON[_0x0ee8('0x77')](_0xceeb33[_0x0ee8('0x76')]);_0x30808c['where'](_0x3808f4(_0xceeb33[_0x0ee8('0x76')]['group']));}_0x3e5ad1=_0x30808c[_0x0ee8('0x78')]();_0x30808c['limit'](_0x57eca8);_0x30808c[_0x0ee8('0x18')](0x0);logger[_0x0ee8('0x79')](_0x0ee8('0x7a'),_0x30808c[_0x0ee8('0x7b')]());return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x30808c[_0x0ee8('0x7b')](),{'type':db[_0x0ee8('0x7c')]['QueryTypes'][_0x0ee8('0x7d')]});}})['then'](respondWithResult(_0x13facd,null))['catch'](handleError(_0x13facd,null));};function runReport(_0x22c20f,_0x2653f8,_0x53c1ab){var _0xfa7bea=_0x2653f8['name'];var _0x41b8da=0xa;var _0x19b4fd=['join',_0x0ee8('0x50'),_0x0ee8('0x51'),_0x0ee8('0x52')];var _0x26b18e={'SUM':_0x0ee8('0x53'),'COUNT':_0x0ee8('0x7e'),'COUNT DISTINCT':_0x0ee8('0x54'),'MAX':_0x0ee8('0x55'),'MIN':_0x0ee8('0x56'),'AVG':_0x0ee8('0x57'),'GROUP_CONCAT':_0x0ee8('0x7f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0ee8('0x58')};var _0x2bad6d={'SEC_TO_TIME':_0x0ee8('0x59'),'DATE':_0x0ee8('0x80'),'HOUR':'HOUR(%s)','ROUND':_0x0ee8('0x5a'),'UNIX_TIMESTAMP':_0x0ee8('0x5b')};var _0x37fe28=function(_0x26b811){return!_[_0x0ee8('0x5c')]([_0x0ee8('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x0ee8('0x5e')],_0x26b811);};var _0x1164be=function(_0xd9ab3c){if(!_0xd9ab3c||!_0xd9ab3c[_0x0ee8('0x5f')][_0x0ee8('0x31')]){return'';}for(var _0x504a70='(',_0x1c2298=0x0;_0x1c2298<_0xd9ab3c['rules'][_0x0ee8('0x31')];_0x1c2298+=0x1){_0x1c2298>0x0&&(_0x504a70+='\x20'+_0xd9ab3c[_0x0ee8('0x60')]+'\x20');_0x504a70+=_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x61')]?_0x1164be(_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x61')]):_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x6c')]+'\x20'+_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x62')]+(_0x37fe28(_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x62')])?'\x20'+_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298]['value']:'');}return _0x504a70+')';};var _0x41ee6a={'where':{'id':_0x22c20f['id']}},_0x5a0227,_0x55e138,_0x523461,_0x46e5ef,_0x4a387a;_0x41ee6a=_[_0x0ee8('0x3a')]({},_0x41ee6a,_0x53c1ab);return db[_0x0ee8('0x27')]['find'](_0x41ee6a)[_0x0ee8('0x1e')](function(_0xd8bb6e){if(_0xd8bb6e){_0x5a0227=_0xd8bb6e;return _0xd8bb6e[_0x0ee8('0x64')]();}return null;})[_0x0ee8('0x1e')](function(_0x4fa60b){if(_0x4fa60b){if(!_0x4fa60b[_0x0ee8('0x31')]){throw new db[(_0x0ee8('0x81'))][(_0x0ee8('0x82'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x55e138=_0x4fa60b;return db[_0x0ee8('0x66')]['findAll']({'raw':!![]});}return null;})[_0x0ee8('0x1e')](function(_0x583bea){if(_0x583bea){_0x523461=_[_0x0ee8('0x67')](_0x583bea,'id');var _0xd1b9a9;var _0x3003c8=squel[_0x0ee8('0x83')]();_0x3003c8[_0x0ee8('0x68')](_0x5a0227['table']);for(var _0xc85f79=0x0;_0xc85f79<_0x55e138[_0x0ee8('0x31')];_0xc85f79+=0x1){_0xd1b9a9=_0x55e138[_0xc85f79][_0x0ee8('0x6a')]?_0x523461[_0x55e138[_0xc85f79]['MetricId']][_0x0ee8('0x6b')]:_0x55e138[_0xc85f79][_0x0ee8('0x6c')];_0xd1b9a9=_0x55e138[_0xc85f79]['function']?_[_0x0ee8('0x6e')](_0x26b18e[_0x55e138[_0xc85f79]['function']],'%s',_0xd1b9a9):_0xd1b9a9;_0xd1b9a9=_0x55e138[_0xc85f79]['format']?_[_0x0ee8('0x6e')](_0x2bad6d[_0x55e138[_0xc85f79][_0x0ee8('0x6f')]],'%s',_0xd1b9a9):_0xd1b9a9;if(_0x55e138[_0xc85f79][_0x0ee8('0x70')]){_0x3003c8[_0x0ee8('0x61')](_0xd1b9a9);}_0x55e138[_0xc85f79][_0x0ee8('0x84')]&&_0x3003c8[_0x0ee8('0x34')](_0xd1b9a9,_0x55e138[_0xc85f79][_0x0ee8('0x84')]===_0x0ee8('0x71')?![]:!![]);_0x3003c8[_0x0ee8('0x6c')](_0xd1b9a9,_0x55e138[_0xc85f79][_0x0ee8('0x72')]||_0xd1b9a9);}if(_0x5a0227[_0x0ee8('0x73')]){_0x5a0227['joins']=JSON[_0x0ee8('0x77')](_0x5a0227[_0x0ee8('0x73')]);for(var _0x34ec1e=0x0;_0x34ec1e<_0x5a0227['joins']['length'];_0x34ec1e+=0x1){if(_0x5a0227['joins'][_0x34ec1e][_0x0ee8('0x29')]&&_[_0x0ee8('0x5c')](_0x19b4fd,_0x5a0227[_0x0ee8('0x73')][_0x34ec1e]['type'])&&_0x5a0227['joins'][_0x34ec1e][_0x0ee8('0x85')]&&_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x74')]&&_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x75')]){_0x3003c8[_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x29')]](_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x74')],null,util[_0x0ee8('0x6f')]('%s.%s\x20=\x20%s.%s',_0x5a0227[_0x0ee8('0x69')],_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x85')],_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x74')],_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x75')]));}}}if(_0x5a0227['conditions']){_0x5a0227['conditions']=JSON[_0x0ee8('0x77')](_0x5a0227[_0x0ee8('0x76')]);_0x3003c8[_0x0ee8('0x36')](_0x1164be(_0x5a0227[_0x0ee8('0x76')][_0x0ee8('0x61')]));}_0x4a387a=_0x3003c8[_0x0ee8('0x78')]();_0x3003c8['limit'](_0x41b8da);_0x3003c8[_0x0ee8('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x3003c8[_0x0ee8('0x7b')]());return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x3003c8[_0x0ee8('0x7b')](),{'type':db[_0x0ee8('0x7c')][_0x0ee8('0x86')][_0x0ee8('0x7d')]});}})[_0x0ee8('0x1e')](function(_0x29be83){if(!_0x29be83['length']){throw new db[(_0x0ee8('0x81'))][(_0x0ee8('0x82'))](_0x0ee8('0x87'),0xcc);}if(_0x2653f8[_0x0ee8('0x88')]==='web'){return null;}var _0x5856e2=_[_0x0ee8('0x3a')](_0x2653f8,{'name':_0x2653f8['fullPath']||_0x2653f8[_0x0ee8('0x23')]||_0x5a0227[_0x0ee8('0x23')],'basename':_0xfa7bea,'savename':util[_0x0ee8('0x6f')](_0x0ee8('0x89'),_0x2653f8[_0x0ee8('0x23')]||_0x5a0227[_0x0ee8('0x23')],require('randomstring')[_0x0ee8('0x8a')](0x4),_0x2653f8[_0x0ee8('0x88')]||'csv'),'reportId':_0x5a0227['id'],'reportType':_0x0ee8('0x8b')});return db[_0x0ee8('0x8c')][_0x0ee8('0x42')](_0x5856e2,{'raw':!![]});})[_0x0ee8('0x1e')](function(_0xc71bfb){if(_0x5a0227[_0x0ee8('0x69')]==='cdr'){_0x4a387a[_0x0ee8('0x36')](_0x5a0227['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2653f8[_0x0ee8('0x8d')],_0x2653f8['endDate']);}else{_0x4a387a[_0x0ee8('0x36')](_0x5a0227[_0x0ee8('0x69')]+_0x0ee8('0x8e'),_0x2653f8[_0x0ee8('0x8d')],_0x2653f8[_0x0ee8('0x8f')]);}if(_0xc71bfb){logger['info']('Run\x20Query:',_0x4a387a[_0x0ee8('0x7b')]());require(_0x0ee8('0x90'))['fork'](path['join'](__dirname,_0x0ee8('0x91'),_0xc71bfb['output']),[_0xc71bfb['id'],_0x4a387a[_0x0ee8('0x7b')](),path[_0x0ee8('0x4f')](__dirname,_0x0ee8('0x92'),_0xc71bfb[_0x0ee8('0x93')]),_0xfa7bea]);return _0xc71bfb;}else{var _0xcdb198=squel[_0x0ee8('0x83')]();_0xcdb198[_0x0ee8('0x68')]('('+_0x4a387a[_0x0ee8('0x7b')]()+')',_0x0ee8('0x94'));_0xcdb198[_0x0ee8('0x6c')]('COUNT(*)',_0x0ee8('0x17'));_0x4a387a[_0x0ee8('0x33')](_0x2653f8[_0x0ee8('0x33')]||_0x41b8da);_0x4a387a['offset'](_0x2653f8[_0x0ee8('0x18')]||0x0);return db[_0x0ee8('0x7c')]['query'](_0xcdb198[_0x0ee8('0x7b')](),{'type':db['sequelize'][_0x0ee8('0x86')][_0x0ee8('0x7d')]})[_0x0ee8('0x1e')](function(_0xc53cbe){if(!_0xc53cbe[_0x0ee8('0x31')]){_0x46e5ef=0x0;}else{_0x46e5ef=_0xc53cbe[0x0]['count']||0x0;}return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x4a387a[_0x0ee8('0x7b')](),{'type':db[_0x0ee8('0x7c')][_0x0ee8('0x86')][_0x0ee8('0x7d')]});})[_0x0ee8('0x1e')](function(_0x4fc76b){return{'rows':_0x4fc76b||[],'count':_0x46e5ef};});}});}exports[_0x0ee8('0x95')]=function(_0x44e007,_0x52d150){return runReport(_0x44e007[_0x0ee8('0x4c')],_0x44e007[_0x0ee8('0x2e')],_0x44e007[_0x0ee8('0x3c')])['then'](respondWithResult(_0x52d150,null))[_0x0ee8('0x4a')](handleError(_0x52d150,null));};exports[_0x0ee8('0x96')]=runReport;exports[_0x0ee8('0x2e')]=function(_0x3889e2,_0x2270fc){var _0x95b418=0xa;var _0x285a52=[_0x0ee8('0x4f'),'left_join',_0x0ee8('0x51'),_0x0ee8('0x52')];var _0xa89deb={'SUM':_0x0ee8('0x53'),'COUNT':_0x0ee8('0x7e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0ee8('0x55'),'MIN':'MIN(%s)','AVG':_0x0ee8('0x57'),'GROUP_CONCAT':_0x0ee8('0x7f'),'GROUP_CONCAT ASC':_0x0ee8('0x97'),'GROUP_CONCAT DESC':_0x0ee8('0x58')};var _0x2170b9={'SEC_TO_TIME':_0x0ee8('0x59'),'DATE':_0x0ee8('0x80'),'HOUR':_0x0ee8('0x98'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0ee8('0x5b')};var _0x560fe5=function(_0xce5997){return!_['includes'](['IS\x20NULL',_0x0ee8('0x99'),_0x0ee8('0x9a'),_0x0ee8('0x5e')],_0xce5997);};var _0x4d9963=function(_0x1d03e0){if(!_0x1d03e0||!_0x1d03e0[_0x0ee8('0x5f')][_0x0ee8('0x31')]){return'';}for(var _0x3ac44b='(',_0x1c9863=0x0;_0x1c9863<_0x1d03e0[_0x0ee8('0x5f')][_0x0ee8('0x31')];_0x1c9863+=0x1){_0x1c9863>0x0&&(_0x3ac44b+='\x20'+_0x1d03e0[_0x0ee8('0x60')]+'\x20');_0x3ac44b+=_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863]['group']?_0x4d9963(_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x61')]):_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x6c')]+'\x20'+_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x62')]+(_0x560fe5(_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x62')])?'\x20'+_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863]['value']:'');}return _0x3ac44b+')';};var _0x1b1874={'where':{'id':_0x3889e2['params']['id']}},_0x3c9c95,_0x3964ef,_0x14ffd4,_0x4f980f,_0x3037f0;_0x1b1874=_[_0x0ee8('0x3a')]({},_0x1b1874,_0x3889e2[_0x0ee8('0x3c')]);return db[_0x0ee8('0x27')]['find'](_0x1b1874)[_0x0ee8('0x1e')](function(_0x32bd97){if(_0x32bd97){_0x3c9c95=_0x32bd97;return _0x32bd97['getFields']();}return null;})[_0x0ee8('0x1e')](function(_0x2c4688){if(_0x2c4688){if(!_0x2c4688[_0x0ee8('0x31')]){throw new db[(_0x0ee8('0x81'))][(_0x0ee8('0x82'))](_0x0ee8('0x65'),0x193);}_0x3964ef=_0x2c4688;return db['AnalyticMetric'][_0x0ee8('0x3e')]({'raw':!![]});}return null;})[_0x0ee8('0x1e')](function(_0x4160ec){if(_0x4160ec){_0x14ffd4=_[_0x0ee8('0x67')](_0x4160ec,'id');var _0x60fbd9;var _0x4f5a4f=squel['select']();_0x4f5a4f['from'](_0x3c9c95[_0x0ee8('0x69')]);for(var _0xb5332c=0x0;_0xb5332c<_0x3964ef[_0x0ee8('0x31')];_0xb5332c+=0x1){_0x60fbd9=_0x3964ef[_0xb5332c][_0x0ee8('0x6a')]?_0x14ffd4[_0x3964ef[_0xb5332c][_0x0ee8('0x6a')]][_0x0ee8('0x6b')]:_0x3964ef[_0xb5332c][_0x0ee8('0x6c')];_0x60fbd9=_0x3964ef[_0xb5332c]['function']?_[_0x0ee8('0x6e')](_0xa89deb[_0x3964ef[_0xb5332c][_0x0ee8('0x6d')]],'%s',_0x60fbd9):_0x60fbd9;_0x60fbd9=_0x3964ef[_0xb5332c][_0x0ee8('0x6f')]?_[_0x0ee8('0x6e')](_0x2170b9[_0x3964ef[_0xb5332c][_0x0ee8('0x6f')]],'%s',_0x60fbd9):_0x60fbd9;if(_0x3964ef[_0xb5332c][_0x0ee8('0x70')]){_0x4f5a4f[_0x0ee8('0x61')](_0x60fbd9);}_0x3964ef[_0xb5332c][_0x0ee8('0x84')]&&_0x4f5a4f['order'](_0x60fbd9,_0x3964ef[_0xb5332c]['orderBy']===_0x0ee8('0x71')?![]:!![]);_0x4f5a4f[_0x0ee8('0x6c')](_0x60fbd9,_0x3964ef[_0xb5332c][_0x0ee8('0x72')]||_0x60fbd9);}if(_0x3c9c95['joins']){_0x3c9c95['joins']=JSON['parse'](_0x3c9c95[_0x0ee8('0x73')]);for(var _0x2711ba=0x0;_0x2711ba<_0x3c9c95[_0x0ee8('0x73')][_0x0ee8('0x31')];_0x2711ba+=0x1){if(_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x29')]&&_['includes'](_0x285a52,_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x29')])&&_0x3c9c95['joins'][_0x2711ba][_0x0ee8('0x85')]&&_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x74')]&&_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x75')]){_0x4f5a4f[_0x3c9c95[_0x0ee8('0x73')][_0x2711ba]['type']](_0x3c9c95['joins'][_0x2711ba][_0x0ee8('0x74')],null,util[_0x0ee8('0x6f')](_0x0ee8('0x9b'),_0x3c9c95[_0x0ee8('0x69')],_0x3c9c95[_0x0ee8('0x73')][_0x2711ba]['parentKey'],_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x74')],_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x75')]));}}}if(_0x3c9c95['conditions']){_0x3c9c95[_0x0ee8('0x76')]=JSON[_0x0ee8('0x77')](_0x3c9c95['conditions']);_0x4f5a4f[_0x0ee8('0x36')](_0x4d9963(_0x3c9c95[_0x0ee8('0x76')][_0x0ee8('0x61')]));}_0x3037f0=_0x4f5a4f[_0x0ee8('0x78')]();_0x4f5a4f[_0x0ee8('0x33')](_0x95b418);_0x4f5a4f[_0x0ee8('0x18')](0x0);logger[_0x0ee8('0x79')](_0x0ee8('0x7a'),_0x4f5a4f['toString']());return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x4f5a4f[_0x0ee8('0x7b')](),{'type':db['sequelize'][_0x0ee8('0x86')]['SELECT']});}})[_0x0ee8('0x1e')](function(){return{'sql':_0x3037f0[_0x0ee8('0x7b')]()};})[_0x0ee8('0x1e')](respondWithResult(_0x2270fc,null))['catch'](handleError(_0x2270fc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index d7d38a8..4cbd888 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 _0x4d1d=['analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0xd1971b,_0x3256f6){var _0x201753=function(_0x4bc424){while(--_0x4bc424){_0xd1971b['push'](_0xd1971b['shift']());}};_0x201753(++_0x3256f6);}(_0x4d1d,0x153));var _0xd4d1=function(_0x2d37d8,_0x10639d){_0x2d37d8=_0x2d37d8-0x0;var _0x35432a=_0x4d1d[_0x2d37d8];return _0x35432a;};'use strict';var _=require('lodash');var util=require(_0xd4d1('0x0'));var logger=require(_0xd4d1('0x1'))(_0xd4d1('0x2'));var moment=require(_0xd4d1('0x3'));var BPromise=require(_0xd4d1('0x4'));var rp=require(_0xd4d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4d1('0x6'));var config=require(_0xd4d1('0x7'));var attributes=require(_0xd4d1('0x8'));module[_0xd4d1('0x9')]=function(_0x108ab0,_0x238e11){return _0x108ab0[_0xd4d1('0xa')](_0xd4d1('0xb'),attributes,{'tableName':_0xd4d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfaa1=['moment','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api'];(function(_0x59026b,_0x12ace5){var _0x2c6152=function(_0x193dc2){while(--_0x193dc2){_0x59026b['push'](_0x59026b['shift']());}};_0x2c6152(++_0x12ace5);}(_0xfaa1,0x110));var _0x1faa=function(_0xf17b24,_0x3053fb){_0xf17b24=_0xf17b24-0x0;var _0x51485b=_0xfaa1[_0xf17b24];return _0x51485b;};'use strict';var _=require(_0x1faa('0x0'));var util=require(_0x1faa('0x1'));var logger=require('../../config/logger')(_0x1faa('0x2'));var moment=require(_0x1faa('0x3'));var BPromise=require('bluebird');var rp=require(_0x1faa('0x4'));var fs=require('fs');var path=require(_0x1faa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1faa('0x6'));module[_0x1faa('0x7')]=function(_0x4cf115,_0x1d4d4d){return _0x4cf115[_0x1faa('0x8')](_0x1faa('0x9'),attributes,{'tableName':_0x1faa('0xa'),'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 e3c28b9..c620136 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 _0x6be1=['code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31e9d7,_0x5bdda2){var _0x1e3b6e=function(_0x3413aa){while(--_0x3413aa){_0x31e9d7['push'](_0x31e9d7['shift']());}};_0x1e3b6e(++_0x5bdda2);}(_0x6be1,0x12f));var _0x16be=function(_0x31b7f5,_0x6a8c2a){_0x31b7f5=_0x31b7f5-0x0;var _0xac76=_0x6be1[_0x31b7f5];return _0xac76;};'use strict';var _=require(_0x16be('0x0'));var util=require(_0x16be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16be('0x2'))['db'];var utils=require(_0x16be('0x3'));var logger=require(_0x16be('0x4'))(_0x16be('0x5'));var config=require(_0x16be('0x6'));var jayson=require(_0x16be('0x7'));var client=jayson[_0x16be('0x8')][_0x16be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f6c26,_0x1c5e94,_0x4eaedb){return new BPromise(function(_0x36438c,_0x32ff9a){return client[_0x16be('0xa')](_0x2f6c26,_0x4eaedb)[_0x16be('0xb')](function(_0x1a820e){logger[_0x16be('0xc')](_0x16be('0xd'),_0x1c5e94,_0x16be('0xe'));logger[_0x16be('0xf')](_0x16be('0x10'),_0x1c5e94,_0x16be('0xe'),JSON[_0x16be('0x11')](_0x1a820e));if(_0x1a820e[_0x16be('0x12')]){if(_0x1a820e[_0x16be('0x12')][_0x16be('0x13')]===0x1f4){logger[_0x16be('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,_0x1a820e[_0x16be('0x12')][_0x16be('0x14')]);return _0x32ff9a(_0x1a820e[_0x16be('0x12')][_0x16be('0x14')]);}logger[_0x16be('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,_0x1a820e[_0x16be('0x12')][_0x16be('0x14')]);return _0x36438c(_0x1a820e['error'][_0x16be('0x14')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,'request\x20sent');_0x36438c(_0x1a820e[_0x16be('0x15')][_0x16be('0x14')]);}})[_0x16be('0x16')](function(_0x5e8eeb){logger[_0x16be('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,_0x5e8eeb);_0x32ff9a(_0x5e8eeb);});});}
\ No newline at end of file
+var _0x9434=['message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x410b07,_0x1e1547){var _0x4f75ac=function(_0x47359b){while(--_0x47359b){_0x410b07['push'](_0x410b07['shift']());}};_0x4f75ac(++_0x1e1547);}(_0x9434,0x168));var _0x4943=function(_0x29431f,_0x25b59e){_0x29431f=_0x29431f-0x0;var _0x30a693=_0x9434[_0x29431f];return _0x30a693;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var moment=require(_0x4943('0x2'));var BPromise=require(_0x4943('0x3'));var rs=require(_0x4943('0x4'));var fs=require('fs');var Redis=require(_0x4943('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4943('0x6'));var logger=require(_0x4943('0x7'))('rpc');var config=require(_0x4943('0x8'));var jayson=require(_0x4943('0x9'));var client=jayson['client'][_0x4943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a55a,_0x4da494,_0x3ae08d){return new BPromise(function(_0x2f4119,_0x1876eb){return client[_0x4943('0xb')](_0x56a55a,_0x3ae08d)[_0x4943('0xc')](function(_0x553991){logger['info'](_0x4943('0xd'),_0x4da494,_0x4943('0xe'));logger[_0x4943('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4da494,_0x4943('0xe'),JSON[_0x4943('0x10')](_0x553991));if(_0x553991['error']){if(_0x553991[_0x4943('0x11')]['code']===0x1f4){logger['error'](_0x4943('0xd'),_0x4da494,_0x553991[_0x4943('0x11')][_0x4943('0x12')]);return _0x1876eb(_0x553991[_0x4943('0x11')][_0x4943('0x12')]);}logger[_0x4943('0x11')](_0x4943('0xd'),_0x4da494,_0x553991['error'][_0x4943('0x12')]);return _0x2f4119(_0x553991[_0x4943('0x11')][_0x4943('0x12')]);}else{logger[_0x4943('0x13')](_0x4943('0xd'),_0x4da494,_0x4943('0xe'));_0x2f4119(_0x553991['result'][_0x4943('0x12')]);}})[_0x4943('0x14')](function(_0xb08628){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4da494,_0xb08628);_0x1876eb(_0xb08628);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 0a1d02d..d93cf36 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 _0x5cd1=['preview','/:id/run','/:id/query','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x435ff2,_0x1cdbe8){var _0x2f406e=function(_0x549af0){while(--_0x549af0){_0x435ff2['push'](_0x435ff2['shift']());}};_0x2f406e(++_0x1cdbe8);}(_0x5cd1,0x16c));var _0x15cd=function(_0x5745eb,_0x39ee02){_0x5745eb=_0x5745eb-0x0;var _0x3731a7=_0x5cd1[_0x5745eb];return _0x3731a7;};'use strict';var multer=require(_0x15cd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x15cd('0x1'));var express=require(_0x15cd('0x2'));var router=express['Router']();var auth=require(_0x15cd('0x3'));var interaction=require(_0x15cd('0x4'));var config=require(_0x15cd('0x5'));var controller=require(_0x15cd('0x6'));router[_0x15cd('0x7')]('/',auth[_0x15cd('0x8')](),controller[_0x15cd('0x9')]);router[_0x15cd('0x7')](_0x15cd('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/preview',auth[_0x15cd('0x8')](),controller[_0x15cd('0xb')]);router[_0x15cd('0x7')](_0x15cd('0xc'),auth[_0x15cd('0x8')](),controller['run']);router['get'](_0x15cd('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x15cd('0x8')](),controller['create']);router['put']('/:id',auth[_0x15cd('0x8')](),controller['update']);router['delete'](_0x15cd('0xa'),auth[_0x15cd('0x8')](),controller['destroy']);module[_0x15cd('0xe')]=router;
\ No newline at end of file
+var _0xcfe6=['preview','/:id/run','run','get','post','put','/:id','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','show','/:id/preview'];(function(_0x2dcc12,_0x1924e9){var _0xc0c5b5=function(_0x132559){while(--_0x132559){_0x2dcc12['push'](_0x2dcc12['shift']());}};_0xc0c5b5(++_0x1924e9);}(_0xcfe6,0x1d7));var _0x6cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6cfe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6cfe('0x1'));var express=require(_0x6cfe('0x2'));var router=express[_0x6cfe('0x3')]();var auth=require(_0x6cfe('0x4'));var interaction=require(_0x6cfe('0x5'));var config=require(_0x6cfe('0x6'));var controller=require(_0x6cfe('0x7'));router['get']('/',auth[_0x6cfe('0x8')](),controller[_0x6cfe('0x9')]);router['get']('/:id',auth[_0x6cfe('0x8')](),controller[_0x6cfe('0xa')]);router['get'](_0x6cfe('0xb'),auth[_0x6cfe('0x8')](),controller[_0x6cfe('0xc')]);router['get'](_0x6cfe('0xd'),auth[_0x6cfe('0x8')](),controller[_0x6cfe('0xe')]);router[_0x6cfe('0xf')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x6cfe('0x10')]('/',auth[_0x6cfe('0x8')](),controller['create']);router[_0x6cfe('0x11')](_0x6cfe('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6cfe('0x12'),auth[_0x6cfe('0x8')](),controller[_0x6cfe('0x13')]);module[_0x6cfe('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 0ae3d84..d1f2eae 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 _0x8ab8=['INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled'];(function(_0x15cf93,_0x5b1029){var _0x2afb0a=function(_0x5413ed){while(--_0x5413ed){_0x15cf93['push'](_0x15cf93['shift']());}};_0x2afb0a(++_0x5b1029);}(_0x8ab8,0x17b));var _0x88ab=function(_0x349109,_0x58f5ce){_0x349109=_0x349109-0x0;var _0x3db8d6=_0x8ab8[_0x349109];return _0x3db8d6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x88ab('0x0'));module[_0x88ab('0x1')]={'name':{'type':Sequelize[_0x88ab('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x88ab('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x88ab('0x3')](_0x88ab('0x4'),_0x88ab('0x5'),_0x88ab('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x88ab('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x88ab('0x7')]},'endDate':{'type':Sequelize[_0x88ab('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x88ab('0x8')},'type':{'type':Sequelize[_0x88ab('0x3')](_0x88ab('0x9'),_0x88ab('0xa')),'allowNull':![],'defaultValue':_0x88ab('0x9')},'reportId':{'type':Sequelize[_0x88ab('0xb')](0xb)[_0x88ab('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6258=['xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6258,0xde));var _0x8625=function(_0x35ace6,_0x56bde1){_0x35ace6=_0x35ace6-0x0;var _0x494243=_0x6258[_0x35ace6];return _0x494243;};'use strict';var Sequelize=require(_0x8625('0x0'));var moment=require('moment');module[_0x8625('0x1')]={'name':{'type':Sequelize[_0x8625('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8625('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8625('0x3')](_0x8625('0x4'),_0x8625('0x5'),_0x8625('0x6')),'allowNull':![],'defaultValue':_0x8625('0x4')},'savename':{'type':Sequelize[_0x8625('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8625('0x7')]},'endDate':{'type':Sequelize[_0x8625('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8625('0x8')},'type':{'type':Sequelize[_0x8625('0x3')](_0x8625('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x8625('0x9')},'reportId':{'type':Sequelize[_0x8625('0xa')](0xb)[_0x8625('0xb')]},'reportType':{'type':Sequelize[_0x8625('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 4e81045..d7781df 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 _0xdf88=['sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','find','catch','create','body','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','update','then','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','limit'];(function(_0x257558,_0x41dd88){var _0x3c3f80=function(_0x32ae45){while(--_0x32ae45){_0x257558['push'](_0x257558['shift']());}};_0x3c3f80(++_0x41dd88);}(_0xdf88,0x1a5));var _0x8df8=function(_0x58a982,_0x4a592a){_0x58a982=_0x58a982-0x0;var _0x1490ed=_0xdf88[_0x58a982];return _0x1490ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8df8('0x0'));var rimraf=require(_0x8df8('0x1'));var zipdir=require(_0x8df8('0x2'));var jsonpatch=require(_0x8df8('0x3'));var rp=require('request-promise');var moment=require(_0x8df8('0x4'));var BPromise=require(_0x8df8('0x5'));var Mustache=require(_0x8df8('0x6'));var util=require(_0x8df8('0x7'));var path=require(_0x8df8('0x8'));var sox=require(_0x8df8('0x9'));var csv=require(_0x8df8('0xa'));var ejs=require(_0x8df8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8df8('0xc'));var crypto=require(_0x8df8('0xd'));var jsforce=require(_0x8df8('0xe'));var deskjs=require(_0x8df8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8df8('0x10'));var Papa=require(_0x8df8('0x11'));var Redis=require('ioredis');var authService=require(_0x8df8('0x12'));var qs=require(_0x8df8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8df8('0x14'));var logger=require(_0x8df8('0x15'))(_0x8df8('0x16'));var utils=require(_0x8df8('0x17'));var config=require(_0x8df8('0x18'));var db=require(_0x8df8('0x19'))['db'];function respondWithStatusCode(_0x5bb9a2,_0x584159){_0x584159=_0x584159||0xcc;return function(_0x5c8d90){if(_0x5c8d90){return _0x5bb9a2['sendStatus'](_0x584159);}return _0x5bb9a2[_0x8df8('0x1a')](_0x584159)[_0x8df8('0x1b')]();};}function respondWithResult(_0x68f4ec,_0x22ebc3){_0x22ebc3=_0x22ebc3||0xc8;return function(_0x324233){if(_0x324233){return _0x68f4ec['status'](_0x22ebc3)[_0x8df8('0x1c')](_0x324233);}};}function respondWithFilteredResult(_0x4b85bd,_0x36096e){return function(_0x86903e){if(_0x86903e){var _0x174afc=_0x86903e[_0x8df8('0x1d')],_0x4aacdf=_0x36096e[_0x8df8('0x1e')],_0x30c91d=_0x36096e[_0x8df8('0x1e')]+_0x36096e['limit'],_0x2adacd;if(_0x30c91d>=_0x174afc){_0x30c91d=_0x174afc;_0x2adacd=0xc8;}else{_0x2adacd=0xce;}_0x4b85bd[_0x8df8('0x1a')](_0x2adacd);return _0x4b85bd[_0x8df8('0x1f')](_0x8df8('0x20'),_0x4aacdf+'-'+_0x30c91d+'/'+_0x174afc)[_0x8df8('0x1c')](_0x86903e);}return null;};}function patchUpdates(_0x575599){return function(_0x3bdaec){try{jsonpatch['apply'](_0x3bdaec,_0x575599,!![]);}catch(_0xecaa71){return BPromise[_0x8df8('0x21')](_0xecaa71);}return _0x3bdaec[_0x8df8('0x22')]();};}function saveUpdates(_0x536d27,_0x1d5428){return function(_0x48d38e){if(_0x48d38e){return _0x48d38e[_0x8df8('0x23')](_0x536d27)[_0x8df8('0x24')](function(_0x36be5a){return _0x36be5a;});}return null;};}function removeEntity(_0x18936e,_0xd9fb49){return function(_0x3f6f75){if(_0x3f6f75){return _0x3f6f75['destroy']()[_0x8df8('0x24')](function(){var _0x4476bf=_0x3f6f75[_0x8df8('0x25')]({'plain':!![]});var _0xe86133=_0x8df8('0x26');return db[_0x8df8('0x27')]['destroy']({'where':{'type':_0xe86133,'resourceId':_0x4476bf['id']}})[_0x8df8('0x24')](function(){return _0x3f6f75;});})[_0x8df8('0x24')](function(){_0x18936e['status'](0xcc)[_0x8df8('0x1b')]();});}};}function handleEntityNotFound(_0x570705,_0x4b9571){return function(_0x465d1d){if(!_0x465d1d){_0x570705['sendStatus'](0x194);}return _0x465d1d;};}function handleError(_0x5d5e67,_0x21ba9f){_0x21ba9f=_0x21ba9f||0x1f4;return function(_0x2b4d6a){logger['error'](_0x2b4d6a[_0x8df8('0x28')]);if(_0x2b4d6a[_0x8df8('0x29')]){delete _0x2b4d6a[_0x8df8('0x29')];}_0x5d5e67[_0x8df8('0x1a')](_0x21ba9f)[_0x8df8('0x2a')](_0x2b4d6a);};}exports[_0x8df8('0x2b')]=function(_0xfed06b,_0x349a6f){var _0x459657={},_0x4b8253={},_0x1aa888={'count':0x0,'rows':[]};var _0x169f10=_[_0x8df8('0x2c')](db[_0x8df8('0x2d')][_0x8df8('0x2e')],function(_0x561152){return{'name':_0x561152[_0x8df8('0x2f')],'type':_0x561152[_0x8df8('0x30')][_0x8df8('0x31')]};});_0x4b8253[_0x8df8('0x32')]=_[_0x8df8('0x2c')](_0x169f10,'name');_0x4b8253[_0x8df8('0x33')]=_[_0x8df8('0x34')](_0xfed06b[_0x8df8('0x33')]);_0x4b8253[_0x8df8('0x35')]=_['intersection'](_0x4b8253['model'],_0x4b8253['query']);_0x459657[_0x8df8('0x36')]=_[_0x8df8('0x37')](_0x4b8253[_0x8df8('0x32')],qs['fields'](_0xfed06b[_0x8df8('0x33')][_0x8df8('0x38')]));_0x459657[_0x8df8('0x36')]=_0x459657[_0x8df8('0x36')][_0x8df8('0x39')]?_0x459657[_0x8df8('0x36')]:_0x4b8253[_0x8df8('0x32')];if(!_0xfed06b['query']['hasOwnProperty']('nolimit')){_0x459657['limit']=qs['limit'](_0xfed06b['query'][_0x8df8('0x3a')]);_0x459657[_0x8df8('0x1e')]=qs[_0x8df8('0x1e')](_0xfed06b['query'][_0x8df8('0x1e')]);}_0x459657['order']=qs[_0x8df8('0x3b')](_0xfed06b[_0x8df8('0x33')]['sort']);_0x459657[_0x8df8('0x3c')]=qs[_0x8df8('0x35')](_[_0x8df8('0x3d')](_0xfed06b[_0x8df8('0x33')],_0x4b8253[_0x8df8('0x35')]));if(_0xfed06b['query'][_0x8df8('0x3e')]){_0x459657[_0x8df8('0x3c')]=_[_0x8df8('0x3f')](_0x459657[_0x8df8('0x3c')],{'$or':_['map'](_0x169f10,function(_0x2ccfcf){if(_0x2ccfcf[_0x8df8('0x30')][_0x8df8('0x31')]!==_0x8df8('0x40')){var _0x46e276={};_0x46e276[_0x2ccfcf[_0x8df8('0x41')]]={'$like':'%'+_0xfed06b[_0x8df8('0x33')][_0x8df8('0x3e')]+'%'};return _0x46e276;}})});}_0x459657=_['merge']({},_0x459657,_0xfed06b[_0x8df8('0x42')]);var _0x49fbc2={'where':_0x459657[_0x8df8('0x3c')]};return db[_0x8df8('0x2d')][_0x8df8('0x1d')](_0x49fbc2)[_0x8df8('0x24')](function(_0x3ef6ec){_0x1aa888[_0x8df8('0x1d')]=_0x3ef6ec;if(_0xfed06b[_0x8df8('0x33')][_0x8df8('0x43')]){_0x459657[_0x8df8('0x44')]=[{'all':!![]}];}return db[_0x8df8('0x2d')][_0x8df8('0x45')](_0x459657);})[_0x8df8('0x24')](function(_0x322cd3){_0x1aa888[_0x8df8('0x46')]=_0x322cd3;return _0x1aa888;})['then'](respondWithFilteredResult(_0x349a6f,_0x459657))['catch'](handleError(_0x349a6f,null));};exports['show']=function(_0x2dd559,_0x3a495e){var _0xd25209={'raw':!![],'where':{'id':_0x2dd559['params']['id']}},_0x5b9d1b={};_0x5b9d1b['model']=_[_0x8df8('0x34')](db['AnalyticExtractedReport']['rawAttributes']);_0x5b9d1b[_0x8df8('0x33')]=_[_0x8df8('0x34')](_0x2dd559[_0x8df8('0x33')]);_0x5b9d1b['filters']=_['intersection'](_0x5b9d1b[_0x8df8('0x32')],_0x5b9d1b[_0x8df8('0x33')]);_0xd25209['attributes']=_['intersection'](_0x5b9d1b[_0x8df8('0x32')],qs[_0x8df8('0x38')](_0x2dd559[_0x8df8('0x33')]['fields']));_0xd25209[_0x8df8('0x36')]=_0xd25209[_0x8df8('0x36')][_0x8df8('0x39')]?_0xd25209['attributes']:_0x5b9d1b[_0x8df8('0x32')];if(_0x2dd559['query'][_0x8df8('0x43')]){_0xd25209[_0x8df8('0x44')]=[{'all':!![]}];}_0xd25209=_['merge']({},_0xd25209,_0x2dd559[_0x8df8('0x42')]);return db[_0x8df8('0x2d')][_0x8df8('0x47')](_0xd25209)[_0x8df8('0x24')](handleEntityNotFound(_0x3a495e,null))[_0x8df8('0x24')](respondWithResult(_0x3a495e,null))[_0x8df8('0x48')](handleError(_0x3a495e,null));};exports[_0x8df8('0x49')]=function(_0xe9599,_0xb854da){return db['AnalyticExtractedReport'][_0x8df8('0x49')](_0xe9599[_0x8df8('0x4a')],{})[_0x8df8('0x24')](function(_0x124ad4){var _0x5cc525=_0xe9599[_0x8df8('0x4b')][_0x8df8('0x25')]({'plain':!![]});if(!_0x5cc525)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc525['role']===_0x8df8('0x4b')){var _0x3de338=_0x124ad4[_0x8df8('0x25')]({'plain':!![]});var _0x12457d=_0x8df8('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x12457d,'userProfileId':_0x5cc525[_0x8df8('0x4c')]},'raw':!![]})[_0x8df8('0x24')](function(_0x5617c3){if(_0x5617c3&&_0x5617c3['autoAssociation']===0x0){return db[_0x8df8('0x27')][_0x8df8('0x49')]({'name':_0x3de338['name'],'resourceId':_0x3de338['id'],'type':_0x5617c3['name'],'sectionId':_0x5617c3['id']},{})['then'](function(){return _0x124ad4;});}else{return _0x124ad4;}})[_0x8df8('0x48')](function(_0x2cde33){logger[_0x8df8('0x4d')](_0x8df8('0x4e'),_0x2cde33);throw _0x2cde33;});}return _0x124ad4;})[_0x8df8('0x24')](respondWithResult(_0xb854da,0xc9))['catch'](handleError(_0xb854da,null));};exports[_0x8df8('0x23')]=function(_0x2c285e,_0x4341b7){if(_0x2c285e[_0x8df8('0x4a')]['id']){delete _0x2c285e[_0x8df8('0x4a')]['id'];}return db[_0x8df8('0x2d')]['find']({'where':{'id':_0x2c285e[_0x8df8('0x4f')]['id']}})[_0x8df8('0x24')](handleEntityNotFound(_0x4341b7,null))[_0x8df8('0x24')](saveUpdates(_0x2c285e[_0x8df8('0x4a')],null))['then'](respondWithResult(_0x4341b7,null))[_0x8df8('0x48')](handleError(_0x4341b7,null));};exports[_0x8df8('0x50')]=function(_0x2eee56,_0x46cc2f){return db['AnalyticExtractedReport'][_0x8df8('0x47')]({'where':{'id':_0x2eee56['params']['id']}})[_0x8df8('0x24')](handleEntityNotFound(_0x46cc2f,null))[_0x8df8('0x24')](removeEntity(_0x46cc2f,null))[_0x8df8('0x48')](handleError(_0x46cc2f,null));};exports[_0x8df8('0x51')]=function(_0x16b891,_0xb7d3b6,_0x2073e5){return db[_0x8df8('0x2d')][_0x8df8('0x47')]({'where':{'id':_0x16b891[_0x8df8('0x4f')]['id']},'attributes':[_0x8df8('0x29'),_0x8df8('0x52'),'savename',_0x8df8('0x53')],'raw':!![]})[_0x8df8('0x24')](handleEntityNotFound(_0xb7d3b6,null))['then'](function(_0x553638){if(_0x553638){if(!fs[_0x8df8('0x54')](path[_0x8df8('0x55')](config[_0x8df8('0x56')],_0x8df8('0x57'),_0x553638[_0x8df8('0x58')]))){throw new db['Sequelize'][(_0x8df8('0x59'))](_0x8df8('0x5a'));}if(_0x16b891['query'][_0x8df8('0x5b')]){return _0xb7d3b6[_0x8df8('0x5c')](0xc8);}return _0xb7d3b6[_0x8df8('0x51')](path[_0x8df8('0x55')](config['root'],'server/files/reports',_0x553638[_0x8df8('0x58')]),util[_0x8df8('0x5d')](_0x8df8('0x5e'),_0x553638['basename']||_0x553638[_0x8df8('0x29')],_0x553638[_0x8df8('0x53')][_0x8df8('0x5f')]()));}})[_0x8df8('0x48')](handleError(_0xb7d3b6,null));};
\ No newline at end of file
+var _0x2626=['output','existsSync','join','root','Sequelize','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','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ExtractedReports','UserProfileResource','then','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename'];(function(_0x276d71,_0x2be8f9){var _0x35cc4a=function(_0xc045b1){while(--_0xc045b1){_0x276d71['push'](_0x276d71['shift']());}};_0x35cc4a(++_0x2be8f9);}(_0x2626,0x6e));var _0x6262=function(_0xf0b2e1,_0x4a0cc7){_0xf0b2e1=_0xf0b2e1-0x0;var _0xb53a20=_0x2626[_0xf0b2e1];return _0xb53a20;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6262('0x0'));var rimraf=require(_0x6262('0x1'));var zipdir=require(_0x6262('0x2'));var jsonpatch=require(_0x6262('0x3'));var rp=require(_0x6262('0x4'));var moment=require(_0x6262('0x5'));var BPromise=require(_0x6262('0x6'));var Mustache=require(_0x6262('0x7'));var util=require(_0x6262('0x8'));var path=require(_0x6262('0x9'));var sox=require(_0x6262('0xa'));var csv=require(_0x6262('0xb'));var ejs=require(_0x6262('0xc'));var fs=require('fs');var _=require(_0x6262('0xd'));var squel=require(_0x6262('0xe'));var crypto=require(_0x6262('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6262('0x10'));var toCsv=require(_0x6262('0xb'));var querystring=require(_0x6262('0x11'));var Papa=require(_0x6262('0x12'));var Redis=require(_0x6262('0x13'));var authService=require(_0x6262('0x14'));var qs=require(_0x6262('0x15'));var as=require(_0x6262('0x16'));var hardwareService=require(_0x6262('0x17'));var logger=require(_0x6262('0x18'))(_0x6262('0x19'));var utils=require(_0x6262('0x1a'));var config=require(_0x6262('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d45e8,_0x434955){_0x434955=_0x434955||0xcc;return function(_0x9d01ce){if(_0x9d01ce){return _0x5d45e8['sendStatus'](_0x434955);}return _0x5d45e8[_0x6262('0x1c')](_0x434955)['end']();};}function respondWithResult(_0x31139d,_0x3b0224){_0x3b0224=_0x3b0224||0xc8;return function(_0x10197d){if(_0x10197d){return _0x31139d['status'](_0x3b0224)['json'](_0x10197d);}};}function respondWithFilteredResult(_0x2dcf56,_0x53ba2a){return function(_0x4f90be){if(_0x4f90be){var _0x2256f4=_0x4f90be[_0x6262('0x1d')],_0x3faf56=_0x53ba2a['offset'],_0x30b90e=_0x53ba2a[_0x6262('0x1e')]+_0x53ba2a[_0x6262('0x1f')],_0x374282;if(_0x30b90e>=_0x2256f4){_0x30b90e=_0x2256f4;_0x374282=0xc8;}else{_0x374282=0xce;}_0x2dcf56['status'](_0x374282);return _0x2dcf56[_0x6262('0x20')](_0x6262('0x21'),_0x3faf56+'-'+_0x30b90e+'/'+_0x2256f4)['json'](_0x4f90be);}return null;};}function patchUpdates(_0x3b4e45){return function(_0x2d84e1){try{jsonpatch[_0x6262('0x22')](_0x2d84e1,_0x3b4e45,!![]);}catch(_0x567f94){return BPromise[_0x6262('0x23')](_0x567f94);}return _0x2d84e1[_0x6262('0x24')]();};}function saveUpdates(_0x1af0d0,_0x15ce5a){return function(_0x29fa92){if(_0x29fa92){return _0x29fa92[_0x6262('0x25')](_0x1af0d0)['then'](function(_0x213fc4){return _0x213fc4;});}return null;};}function removeEntity(_0xdf9de,_0x516579){return function(_0x451296){if(_0x451296){return _0x451296[_0x6262('0x26')]()['then'](function(){var _0x207856=_0x451296['get']({'plain':!![]});var _0x486068=_0x6262('0x27');return db[_0x6262('0x28')][_0x6262('0x26')]({'where':{'type':_0x486068,'resourceId':_0x207856['id']}})[_0x6262('0x29')](function(){return _0x451296;});})[_0x6262('0x29')](function(){_0xdf9de[_0x6262('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d04f9,_0x3cdfe5){return function(_0x3e1e75){if(!_0x3e1e75){_0x1d04f9['sendStatus'](0x194);}return _0x3e1e75;};}function handleError(_0x2d468e,_0x151714){_0x151714=_0x151714||0x1f4;return function(_0x5ccf1b){logger[_0x6262('0x2a')](_0x5ccf1b[_0x6262('0x2b')]);if(_0x5ccf1b[_0x6262('0x2c')]){delete _0x5ccf1b['name'];}_0x2d468e['status'](_0x151714)[_0x6262('0x2d')](_0x5ccf1b);};}exports['index']=function(_0x41e3e5,_0x14b50a){var _0x3aefb0={},_0xeb6186={},_0x21c675={'count':0x0,'rows':[]};var _0x21487f=_[_0x6262('0x2e')](db[_0x6262('0x2f')][_0x6262('0x30')],function(_0x49bad8){return{'name':_0x49bad8[_0x6262('0x31')],'type':_0x49bad8[_0x6262('0x32')][_0x6262('0x33')]};});_0xeb6186[_0x6262('0x34')]=_[_0x6262('0x2e')](_0x21487f,_0x6262('0x2c'));_0xeb6186[_0x6262('0x35')]=_[_0x6262('0x36')](_0x41e3e5[_0x6262('0x35')]);_0xeb6186[_0x6262('0x37')]=_[_0x6262('0x38')](_0xeb6186[_0x6262('0x34')],_0xeb6186[_0x6262('0x35')]);_0x3aefb0[_0x6262('0x39')]=_[_0x6262('0x38')](_0xeb6186[_0x6262('0x34')],qs[_0x6262('0x3a')](_0x41e3e5[_0x6262('0x35')][_0x6262('0x3a')]));_0x3aefb0[_0x6262('0x39')]=_0x3aefb0[_0x6262('0x39')][_0x6262('0x3b')]?_0x3aefb0[_0x6262('0x39')]:_0xeb6186['model'];if(!_0x41e3e5[_0x6262('0x35')]['hasOwnProperty'](_0x6262('0x3c'))){_0x3aefb0['limit']=qs[_0x6262('0x1f')](_0x41e3e5[_0x6262('0x35')][_0x6262('0x1f')]);_0x3aefb0[_0x6262('0x1e')]=qs[_0x6262('0x1e')](_0x41e3e5['query'][_0x6262('0x1e')]);}_0x3aefb0[_0x6262('0x3d')]=qs[_0x6262('0x3e')](_0x41e3e5[_0x6262('0x35')]['sort']);_0x3aefb0[_0x6262('0x3f')]=qs[_0x6262('0x37')](_['pick'](_0x41e3e5[_0x6262('0x35')],_0xeb6186[_0x6262('0x37')]));if(_0x41e3e5[_0x6262('0x35')]['filter']){_0x3aefb0[_0x6262('0x3f')]=_[_0x6262('0x40')](_0x3aefb0[_0x6262('0x3f')],{'$or':_[_0x6262('0x2e')](_0x21487f,function(_0x4da92f){if(_0x4da92f[_0x6262('0x32')][_0x6262('0x33')]!==_0x6262('0x41')){var _0x1e2e9a={};_0x1e2e9a[_0x4da92f['field']]={'$like':'%'+_0x41e3e5[_0x6262('0x35')][_0x6262('0x42')]+'%'};return _0x1e2e9a;}})});}_0x3aefb0=_[_0x6262('0x40')]({},_0x3aefb0,_0x41e3e5[_0x6262('0x43')]);var _0x1b073d={'where':_0x3aefb0[_0x6262('0x3f')]};return db[_0x6262('0x2f')][_0x6262('0x1d')](_0x1b073d)[_0x6262('0x29')](function(_0x3ad455){_0x21c675['count']=_0x3ad455;if(_0x41e3e5[_0x6262('0x35')][_0x6262('0x44')]){_0x3aefb0[_0x6262('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x3aefb0);})[_0x6262('0x29')](function(_0x4b1937){_0x21c675[_0x6262('0x46')]=_0x4b1937;return _0x21c675;})[_0x6262('0x29')](respondWithFilteredResult(_0x14b50a,_0x3aefb0))[_0x6262('0x47')](handleError(_0x14b50a,null));};exports['show']=function(_0x272492,_0x5cead0){var _0x17d59c={'raw':!![],'where':{'id':_0x272492[_0x6262('0x48')]['id']}},_0x524631={};_0x524631['model']=_[_0x6262('0x36')](db[_0x6262('0x2f')][_0x6262('0x30')]);_0x524631[_0x6262('0x35')]=_[_0x6262('0x36')](_0x272492[_0x6262('0x35')]);_0x524631[_0x6262('0x37')]=_[_0x6262('0x38')](_0x524631[_0x6262('0x34')],_0x524631['query']);_0x17d59c[_0x6262('0x39')]=_[_0x6262('0x38')](_0x524631[_0x6262('0x34')],qs[_0x6262('0x3a')](_0x272492[_0x6262('0x35')][_0x6262('0x3a')]));_0x17d59c[_0x6262('0x39')]=_0x17d59c[_0x6262('0x39')][_0x6262('0x3b')]?_0x17d59c[_0x6262('0x39')]:_0x524631[_0x6262('0x34')];if(_0x272492[_0x6262('0x35')][_0x6262('0x44')]){_0x17d59c[_0x6262('0x45')]=[{'all':!![]}];}_0x17d59c=_[_0x6262('0x40')]({},_0x17d59c,_0x272492[_0x6262('0x43')]);return db[_0x6262('0x2f')]['find'](_0x17d59c)[_0x6262('0x29')](handleEntityNotFound(_0x5cead0,null))[_0x6262('0x29')](respondWithResult(_0x5cead0,null))[_0x6262('0x47')](handleError(_0x5cead0,null));};exports[_0x6262('0x49')]=function(_0x590b6c,_0x2d0d11){return db[_0x6262('0x2f')][_0x6262('0x49')](_0x590b6c['body'],{})[_0x6262('0x29')](function(_0x2d4e9e){var _0x21861f=_0x590b6c['user'][_0x6262('0x4a')]({'plain':!![]});if(!_0x21861f)throw new Error(_0x6262('0x4b'));if(_0x21861f[_0x6262('0x4c')]==='user'){var _0x5b2c97=_0x2d4e9e[_0x6262('0x4a')]({'plain':!![]});var _0x2467f5='ExtractedReports';return db[_0x6262('0x4d')][_0x6262('0x4e')]({'where':{'name':_0x2467f5,'userProfileId':_0x21861f[_0x6262('0x4f')]},'raw':!![]})[_0x6262('0x29')](function(_0x4cb52c){if(_0x4cb52c&&_0x4cb52c[_0x6262('0x50')]===0x0){return db[_0x6262('0x28')][_0x6262('0x49')]({'name':_0x5b2c97['name'],'resourceId':_0x5b2c97['id'],'type':_0x4cb52c[_0x6262('0x2c')],'sectionId':_0x4cb52c['id']},{})[_0x6262('0x29')](function(){return _0x2d4e9e;});}else{return _0x2d4e9e;}})[_0x6262('0x47')](function(_0x8f87c7){logger[_0x6262('0x2a')](_0x6262('0x51'),_0x8f87c7);throw _0x8f87c7;});}return _0x2d4e9e;})[_0x6262('0x29')](respondWithResult(_0x2d0d11,0xc9))[_0x6262('0x47')](handleError(_0x2d0d11,null));};exports[_0x6262('0x25')]=function(_0x179e43,_0x5203eb){if(_0x179e43[_0x6262('0x52')]['id']){delete _0x179e43['body']['id'];}return db[_0x6262('0x2f')][_0x6262('0x4e')]({'where':{'id':_0x179e43[_0x6262('0x48')]['id']}})[_0x6262('0x29')](handleEntityNotFound(_0x5203eb,null))[_0x6262('0x29')](saveUpdates(_0x179e43[_0x6262('0x52')],null))[_0x6262('0x29')](respondWithResult(_0x5203eb,null))['catch'](handleError(_0x5203eb,null));};exports[_0x6262('0x26')]=function(_0x2d27a1,_0x5f49fb){return db['AnalyticExtractedReport'][_0x6262('0x4e')]({'where':{'id':_0x2d27a1[_0x6262('0x48')]['id']}})[_0x6262('0x29')](handleEntityNotFound(_0x5f49fb,null))[_0x6262('0x29')](removeEntity(_0x5f49fb,null))[_0x6262('0x47')](handleError(_0x5f49fb,null));};exports[_0x6262('0x53')]=function(_0x3ccdb5,_0x4c12d7,_0x38bbeb){return db['AnalyticExtractedReport'][_0x6262('0x4e')]({'where':{'id':_0x3ccdb5[_0x6262('0x48')]['id']},'attributes':['name',_0x6262('0x54'),_0x6262('0x55'),_0x6262('0x56')],'raw':!![]})[_0x6262('0x29')](handleEntityNotFound(_0x4c12d7,null))[_0x6262('0x29')](function(_0x1ea0c1){if(_0x1ea0c1){if(!fs[_0x6262('0x57')](path[_0x6262('0x58')](config[_0x6262('0x59')],'server/files/reports',_0x1ea0c1[_0x6262('0x55')]))){throw new db[(_0x6262('0x5a'))][(_0x6262('0x5b'))](_0x6262('0x5c'));}if(_0x3ccdb5[_0x6262('0x35')][_0x6262('0x5d')]){return _0x4c12d7['sendStatus'](0xc8);}return _0x4c12d7[_0x6262('0x53')](path['join'](config[_0x6262('0x59')],_0x6262('0x5e'),_0x1ea0c1['savename']),util[_0x6262('0x5f')](_0x6262('0x60'),_0x1ea0c1[_0x6262('0x54')]||_0x1ea0c1['name'],_0x1ea0c1[_0x6262('0x56')][_0x6262('0x61')]()));}})[_0x6262('0x47')](handleError(_0x4c12d7,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index bf4a247..9a15ebe 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 _0xf226=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3e3bbd,_0x37fb71){var _0x5db74b=function(_0x2bccbc){while(--_0x2bccbc){_0x3e3bbd['push'](_0x3e3bbd['shift']());}};_0x5db74b(++_0x37fb71);}(_0xf226,0xa1));var _0x6f22=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf226[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f22('0x0'));var util=require('util');var logger=require(_0x6f22('0x1'))(_0x6f22('0x2'));var moment=require(_0x6f22('0x3'));var BPromise=require(_0x6f22('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f22('0x5'));var rimraf=require(_0x6f22('0x6'));var config=require(_0x6f22('0x7'));var attributes=require(_0x6f22('0x8'));module[_0x6f22('0x9')]=function(_0x217e77,_0x351ddb){return _0x217e77[_0x6f22('0xa')](_0x6f22('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad9b=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xad9b,0x16f));var _0xbad9=function(_0xaf3d79,_0x13fb23){_0xaf3d79=_0xaf3d79-0x0;var _0x40e0b7=_0xad9b[_0xaf3d79];return _0x40e0b7;};'use strict';var _=require(_0xbad9('0x0'));var util=require(_0xbad9('0x1'));var logger=require(_0xbad9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbad9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbad9('0x4'));var rimraf=require('rimraf');var config=require(_0xbad9('0x5'));var attributes=require(_0xbad9('0x6'));module[_0xbad9('0x7')]=function(_0x918e0a,_0x3bdbf1){return _0x918e0a[_0xbad9('0x8')](_0xbad9('0x9'),attributes,{'tableName':_0xbad9('0xa'),'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 5688849..b9cafc4 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 _0x5acc=['../../config/utils','rpc','../../config/environment','http','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../mysqldb'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5acc,0x155));var _0xc5ac=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5acc[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xc5ac('0x0'));var moment=require(_0xc5ac('0x1'));var BPromise=require(_0xc5ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5ac('0x3'))['db'];var utils=require(_0xc5ac('0x4'));var logger=require('../../config/logger')(_0xc5ac('0x5'));var config=require(_0xc5ac('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc5ac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe4a4e3,_0x24e28e,_0x4e5bc3){return new BPromise(function(_0x1d8328,_0x37f6b5){return client['request'](_0xe4a4e3,_0x4e5bc3)['then'](function(_0x3ea85e){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x24e28e,_0xc5ac('0x8'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x24e28e,_0xc5ac('0x8'),JSON[_0xc5ac('0x9')](_0x3ea85e));if(_0x3ea85e[_0xc5ac('0xa')]){if(_0x3ea85e[_0xc5ac('0xa')][_0xc5ac('0xb')]===0x1f4){logger[_0xc5ac('0xa')](_0xc5ac('0xc'),_0x24e28e,_0x3ea85e['error'][_0xc5ac('0xd')]);return _0x37f6b5(_0x3ea85e[_0xc5ac('0xa')][_0xc5ac('0xd')]);}logger[_0xc5ac('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x24e28e,_0x3ea85e[_0xc5ac('0xa')][_0xc5ac('0xd')]);return _0x1d8328(_0x3ea85e[_0xc5ac('0xa')]['message']);}else{logger['info'](_0xc5ac('0xc'),_0x24e28e,_0xc5ac('0x8'));_0x1d8328(_0x3ea85e['result'][_0xc5ac('0xd')]);}})[_0xc5ac('0xe')](function(_0x211248){logger[_0xc5ac('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x24e28e,_0x211248);_0x37f6b5(_0x211248);});});}
\ No newline at end of file
+var _0x2b07=['moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util'];(function(_0x902c36,_0x1e694f){var _0x51c425=function(_0x2c9bb3){while(--_0x2c9bb3){_0x902c36['push'](_0x902c36['shift']());}};_0x51c425(++_0x1e694f);}(_0x2b07,0x1c6));var _0x72b0=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0x2b07[_0x256684];return _0x37a0c9;};'use strict';var _=require(_0x72b0('0x0'));var util=require(_0x72b0('0x1'));var moment=require(_0x72b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x72b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b0('0x4'))['db'];var utils=require(_0x72b0('0x5'));var logger=require('../../config/logger')(_0x72b0('0x6'));var config=require('../../config/environment');var jayson=require(_0x72b0('0x7'));var client=jayson['client'][_0x72b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53be78,_0x1837a2,_0x901317){return new BPromise(function(_0x354dc2,_0x593ccb){return client[_0x72b0('0x9')](_0x53be78,_0x901317)[_0x72b0('0xa')](function(_0x35d58b){logger[_0x72b0('0xb')](_0x72b0('0xc'),_0x1837a2,_0x72b0('0xd'));logger[_0x72b0('0xe')](_0x72b0('0xf'),_0x1837a2,_0x72b0('0xd'),JSON['stringify'](_0x35d58b));if(_0x35d58b['error']){if(_0x35d58b[_0x72b0('0x10')]['code']===0x1f4){logger[_0x72b0('0x10')](_0x72b0('0xc'),_0x1837a2,_0x35d58b[_0x72b0('0x10')][_0x72b0('0x11')]);return _0x593ccb(_0x35d58b[_0x72b0('0x10')][_0x72b0('0x11')]);}logger[_0x72b0('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1837a2,_0x35d58b['error'][_0x72b0('0x11')]);return _0x354dc2(_0x35d58b['error'][_0x72b0('0x11')]);}else{logger[_0x72b0('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1837a2,_0x72b0('0xd'));_0x354dc2(_0x35d58b[_0x72b0('0x12')][_0x72b0('0x11')]);}})['catch'](function(_0x3bcf2b){logger[_0x72b0('0x10')](_0x72b0('0xc'),_0x1837a2,_0x3bcf2b);_0x593ccb(_0x3bcf2b);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b6c895a..4d573b7 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 _0x40b6=['post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','download'];(function(_0x4f77ae,_0x26959a){var _0x32ec86=function(_0x43f189){while(--_0x43f189){_0x4f77ae['push'](_0x4f77ae['shift']());}};_0x32ec86(++_0x26959a);}(_0x40b6,0xf7));var _0x640b=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0x40b6[_0x29e3ec];return _0x25727e;};'use strict';var multer=require(_0x640b('0x0'));var util=require('util');var path=require(_0x640b('0x1'));var timeout=require(_0x640b('0x2'));var express=require(_0x640b('0x3'));var router=express[_0x640b('0x4')]();var auth=require(_0x640b('0x5'));var interaction=require(_0x640b('0x6'));var config=require(_0x640b('0x7'));var controller=require(_0x640b('0x8'));router[_0x640b('0x9')]('/',auth[_0x640b('0xa')](),controller['index']);router['get']('/:id',auth[_0x640b('0xa')](),controller[_0x640b('0xb')]);router[_0x640b('0x9')]('/:id/download',auth[_0x640b('0xa')](),controller[_0x640b('0xc')]);router[_0x640b('0xd')]('/',auth['isAuthenticated'](),controller[_0x640b('0xe')]);router[_0x640b('0xf')](_0x640b('0x10'),auth[_0x640b('0xa')](),controller['update']);router[_0x640b('0x11')](_0x640b('0x10'),auth[_0x640b('0xa')](),controller[_0x640b('0x12')]);module[_0x640b('0x13')]=router;
\ No newline at end of file
+var _0xfeff=['/:id/download','post','create','/:id','update','delete','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0xfeff,0xe5));var _0xffef=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xfeff[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var path=require(_0xffef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xffef('0x3'));var config=require(_0xffef('0x4'));var controller=require(_0xffef('0x5'));router[_0xffef('0x6')]('/',auth[_0xffef('0x7')](),controller[_0xffef('0x8')]);router[_0xffef('0x6')]('/:id',auth[_0xffef('0x7')](),controller['show']);router['get'](_0xffef('0x9'),auth[_0xffef('0x7')](),controller['download']);router[_0xffef('0xa')]('/',auth[_0xffef('0x7')](),controller[_0xffef('0xb')]);router['put'](_0xffef('0xc'),auth[_0xffef('0x7')](),controller[_0xffef('0xd')]);router[_0xffef('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xffef('0xf')]);module[_0xffef('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 93a3422..12545b1 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 _0xe14b=['sequelize','exports','STRING'];(function(_0x2803ed,_0x21805c){var _0x4bbc95=function(_0x19bdc1){while(--_0x19bdc1){_0x2803ed['push'](_0x2803ed['shift']());}};_0x4bbc95(++_0x21805c);}(_0xe14b,0x93));var _0xbe14=function(_0x5a8292,_0x5e50b0){_0x5a8292=_0x5a8292-0x0;var _0x519929=_0xe14b[_0x5a8292];return _0x519929;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1f7c09,_0xe3dc0d){var _0x5a3eee=function(_0x1c2309){while(--_0x1c2309){_0x1f7c09['push'](_0x1f7c09['shift']());}};_0x5a3eee(++_0xe3dc0d);}(_0x814b,0x1a2));var _0xb814=function(_0x55bd38,_0x48eacf){_0x55bd38=_0x55bd38-0x0;var _0x444323=_0x814b[_0x55bd38];return _0x444323;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4add861..4587e0a 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 _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','bulkCreate','bulkDestroy','addFields','sequelize','transaction','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x2468f0,_0x58a7b2){var _0xa9cdf3=function(_0x60e77c){while(--_0x60e77c){_0x2468f0['push'](_0x2468f0['shift']());}};_0xa9cdf3(++_0x58a7b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]));if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!==_0x0a9e('0x3a')){var _0x1ef87a={};_0x1ef87a[_0x5640eb['field']]={'$like':'%'+_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]+'%'};return _0x1ef87a;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3['options']);var _0x1dbf74={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x5bfb33[_0x0a9e('0x17')]=_0x11b61d;if(_0x526cf3['query'][_0x0a9e('0x3c')]){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})['then'](function(_0x5a594b){_0x5bfb33[_0x0a9e('0x3f')]=_0x5a594b;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':![],'where':{'id':_0x1dec2e[_0x0a9e('0x41')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x1dec2e[_0x0a9e('0x2c')]);_0x316c8f[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x316c8f[_0x0a9e('0x30')],_0x316c8f[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x32')]));_0x5b4f5e[_0x0a9e('0x31')]=_0x5b4f5e[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x5b4f5e[_0x0a9e('0x31')]:_0x316c8f[_0x0a9e('0x30')];if(_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x3c')]){_0x5b4f5e[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x3b')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x42')]);return db['AnalyticFieldReport'][_0x0a9e('0x43')](_0x5b4f5e)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x1f')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x44')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x45')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x27')]['create'](_0xbe9d19[_0x0a9e('0x46')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x44')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x27')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x46')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,0xc9))[_0x0a9e('0x44')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x1e')]=function(_0x45bf7f,_0x5bbcde){if(_0x45bf7f[_0x0a9e('0x46')]['id']){delete _0x45bf7f[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x45bf7f[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5bbcde,null))[_0x0a9e('0x1f')](saveUpdates(_0x45bf7f[_0x0a9e('0x46')],null))[_0x0a9e('0x1f')](respondWithResult(_0x5bbcde,null))['catch'](handleError(_0x5bbcde,null));};exports[_0x0a9e('0x20')]=function(_0x3fe430,_0x4f7240){return db['AnalyticFieldReport']['find']({'where':{'id':_0x3fe430[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x4f7240,null))[_0x0a9e('0x1f')](removeEntity(_0x4f7240,null))[_0x0a9e('0x44')](handleError(_0x4f7240,null));};exports[_0x0a9e('0x48')]=function(_0x30decb,_0x2e5165){return db[_0x0a9e('0x27')]['destroy']({'where':{'id':_0x30decb['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x2e5165,0xcc))[_0x0a9e('0x44')](handleError(_0x2e5165,null));};exports[_0x0a9e('0x49')]=function(_0x5bb3ed,_0x2b69d9,_0x161aa7){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x5bb3ed[_0x0a9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b69d9,null))[_0x0a9e('0x1f')](function(_0x4c3845){if(_0x4c3845){return db[_0x0a9e('0x4a')][_0x0a9e('0x4b')](function(_0x439340){return db['AnalyticFieldReport'][_0x0a9e('0x20')]({'where':{'CustomReportId':_0x5bb3ed[_0x0a9e('0x41')]['id']},'transaction':_0x439340})['then'](function(_0x50f687){var _0x128aa6=_[_0x0a9e('0x26')](_0x5bb3ed['body'],function(_0x145931){delete _0x145931['id'];_0x145931['CustomReportId']=_0x5bb3ed[_0x0a9e('0x41')]['id'];return _0x145931;});return db['AnalyticFieldReport'][_0x0a9e('0x47')](_0x128aa6,{'transaction':_0x439340});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x5bb3ed[_0x0a9e('0x41')]['id']}});});}})['then'](respondWithResult(_0x2b69d9,null))[_0x0a9e('0x44')](handleError(_0x2b69d9,null));};
\ No newline at end of file
+var _0xb10b=['end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','field','options','includeAll','include','findAll','rows','catch','AnalyticFieldReport','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status'];(function(_0x286731,_0x116916){var _0x50f5a5=function(_0x18ef71){while(--_0x18ef71){_0x286731['push'](_0x286731['shift']());}};_0x50f5a5(++_0x116916);}(_0xb10b,0x12a));var _0xbb10=function(_0x15adc6,_0xbc8322){_0x15adc6=_0x15adc6-0x0;var _0x3bb841=_0xb10b[_0x15adc6];return _0x3bb841;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['AnalyticFieldReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]['key']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x1e5bbd[_0xbb10('0x3b')]]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5cd55f;}})});}_0x6ed43b=_['merge']({},_0x6ed43b,_0x2fdde9[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x6ed43b[_0xbb10('0x39')]};return db['AnalyticFieldReport'][_0xbb10('0x1c')](_0x3e8538)[_0xbb10('0x23')](function(_0x1dcd38){_0x1acce9[_0xbb10('0x1c')]=_0x1dcd38;if(_0x2fdde9['query'][_0xbb10('0x3d')]){_0x6ed43b[_0xbb10('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xbb10('0x3f')](_0x6ed43b);})[_0xbb10('0x23')](function(_0x44d6ae){_0x1acce9[_0xbb10('0x40')]=_0x44d6ae;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x41')](handleError(_0x24d586,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db[_0xbb10('0x42')][_0xbb10('0x28')]);_0x3d3c41['query']=_[_0xbb10('0x2d')](_0x1e8f79[_0xbb10('0x30')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x2c')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x2f')](_0x3d3c41['model'],qs[_0xbb10('0x31')](_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x31')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x33')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x2c')];if(_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3a')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x42')][_0xbb10('0x43')](_0x3e7b4c)[_0xbb10('0x23')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x44')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x42')][_0xbb10('0x44')](_0x4a1248[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x46')]=function(_0x5be85e,_0x4a9793){return db[_0xbb10('0x42')][_0xbb10('0x46')](_0x5be85e[_0xbb10('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a9793,0xc9))['catch'](handleError(_0x4a9793,null));};exports[_0xbb10('0x47')]=function(_0x34cf4e,_0x1bd054){if(_0x34cf4e[_0xbb10('0x45')]['id']){delete _0x34cf4e[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x34cf4e[_0xbb10('0x48')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x1bd054,null))[_0xbb10('0x23')](saveUpdates(_0x34cf4e['body'],null))['then'](respondWithResult(_0x1bd054,null))[_0xbb10('0x41')](handleError(_0x1bd054,null));};exports[_0xbb10('0x24')]=function(_0x36ab7d,_0xb014b0){return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x36ab7d[_0xbb10('0x48')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xb014b0,null))[_0xbb10('0x23')](removeEntity(_0xb014b0,null))[_0xbb10('0x41')](handleError(_0xb014b0,null));};exports[_0xbb10('0x49')]=function(_0x20e18a,_0x61e689){return db[_0xbb10('0x42')][_0xbb10('0x24')]({'where':{'id':_0x20e18a['query'][_0xbb10('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x61e689,0xcc))[_0xbb10('0x41')](handleError(_0x61e689,null));};exports[_0xbb10('0x4b')]=function(_0x1ffe20,_0x3f27ce,_0x26e66e){return db[_0xbb10('0x4c')][_0xbb10('0x4d')]({'where':{'id':_0x1ffe20[_0xbb10('0x48')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3f27ce,null))[_0xbb10('0x23')](function(_0x44a056){if(_0x44a056){return db[_0xbb10('0x4e')][_0xbb10('0x4f')](function(_0x3d7e17){return db[_0xbb10('0x42')]['destroy']({'where':{'CustomReportId':_0x1ffe20[_0xbb10('0x48')]['id']},'transaction':_0x3d7e17})[_0xbb10('0x23')](function(_0x1b83a9){var _0x4ce8e7=_[_0xbb10('0x27')](_0x1ffe20[_0xbb10('0x45')],function(_0x4bedd0){delete _0x4bedd0['id'];_0x4bedd0[_0xbb10('0x50')]=_0x1ffe20[_0xbb10('0x48')]['id'];return _0x4bedd0;});return db[_0xbb10('0x42')][_0xbb10('0x46')](_0x4ce8e7,{'transaction':_0x3d7e17});});})[_0xbb10('0x23')](function(){return db[_0xbb10('0x42')][_0xbb10('0x3f')]({'where':{'CustomReportId':_0x1ffe20[_0xbb10('0x48')]['id']}});});}})[_0xbb10('0x23')](respondWithResult(_0x3f27ce,null))[_0xbb10('0x41')](handleError(_0x3f27ce,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 514b657..c3310bd 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 _0xc43c=['util','api','bluebird','request-promise','path','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xc43c,0xc6));var _0xcc43=function(_0x516f60,_0x5931e8){_0x516f60=_0x516f60-0x0;var _0x33e092=_0xc43c[_0x516f60];return _0x33e092;};'use strict';var _=require('lodash');var util=require(_0xcc43('0x0'));var logger=require('../../config/logger')(_0xcc43('0x1'));var moment=require('moment');var BPromise=require(_0xcc43('0x2'));var rp=require(_0xcc43('0x3'));var fs=require('fs');var path=require(_0xcc43('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc43('0x5'));module[_0xcc43('0x6')]=function(_0x19ce10,_0x3e6add){return _0x19ce10[_0xcc43('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xcc43('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86e3=['../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0x86e3,0x1d4));var _0x386e=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x86e3[_0x53758c];return _0x425eff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x386e('0x0'))(_0x386e('0x1'));var moment=require('moment');var BPromise=require(_0x386e('0x2'));var rp=require(_0x386e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x386e('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0x386e('0x5')]=function(_0xba75a6,_0x5cd921){return _0xba75a6[_0x386e('0x6')](_0x386e('0x7'),attributes,{'tableName':_0x386e('0x8'),'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 670ea37..7545209 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 _0x0853=['../../config/logger','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a47b6,_0x5de248){var _0x389fbe=function(_0x1db5e1){while(--_0x1db5e1){_0x1a47b6['push'](_0x1a47b6['shift']());}};_0x389fbe(++_0x5de248);}(_0x0853,0xc9));var _0x3085=function(_0x1810a6,_0xfe18aa){_0x1810a6=_0x1810a6-0x0;var _0xbe94a7=_0x0853[_0x1810a6];return _0xbe94a7;};'use strict';var _=require('lodash');var util=require(_0x3085('0x0'));var moment=require('moment');var BPromise=require(_0x3085('0x1'));var rs=require(_0x3085('0x2'));var fs=require('fs');var Redis=require(_0x3085('0x3'));var db=require(_0x3085('0x4'))['db'];var utils=require(_0x3085('0x5'));var logger=require(_0x3085('0x6'))(_0x3085('0x7'));var config=require(_0x3085('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3085('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3beae7,_0xdc8950,_0x3b380b){return new BPromise(function(_0x5bf54c,_0x5a2faf){return client[_0x3085('0xa')](_0x3beae7,_0x3b380b)[_0x3085('0xb')](function(_0xf795da){logger['info'](_0x3085('0xc'),_0xdc8950,_0x3085('0xd'));logger[_0x3085('0xe')](_0x3085('0xf'),_0xdc8950,_0x3085('0xd'),JSON[_0x3085('0x10')](_0xf795da));if(_0xf795da[_0x3085('0x11')]){if(_0xf795da[_0x3085('0x11')][_0x3085('0x12')]===0x1f4){logger[_0x3085('0x11')](_0x3085('0xc'),_0xdc8950,_0xf795da[_0x3085('0x11')][_0x3085('0x13')]);return _0x5a2faf(_0xf795da['error'][_0x3085('0x13')]);}logger[_0x3085('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0xdc8950,_0xf795da[_0x3085('0x11')]['message']);return _0x5bf54c(_0xf795da['error'][_0x3085('0x13')]);}else{logger[_0x3085('0x14')](_0x3085('0xc'),_0xdc8950,_0x3085('0xd'));_0x5bf54c(_0xf795da[_0x3085('0x15')][_0x3085('0x13')]);}})[_0x3085('0x16')](function(_0x4cd232){logger[_0x3085('0x11')](_0x3085('0xc'),_0xdc8950,_0x4cd232);_0x5a2faf(_0x4cd232);});});}
\ No newline at end of file
+var _0x893f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result'];(function(_0x575855,_0xd4326f){var _0x3657e7=function(_0x215f56){while(--_0x215f56){_0x575855['push'](_0x575855['shift']());}};_0x3657e7(++_0xd4326f);}(_0x893f,0x181));var _0xf893=function(_0x3d2a49,_0x2882c3){_0x3d2a49=_0x3d2a49-0x0;var _0x1ff9e1=_0x893f[_0x3d2a49];return _0x1ff9e1;};'use strict';var _=require(_0xf893('0x0'));var util=require(_0xf893('0x1'));var moment=require(_0xf893('0x2'));var BPromise=require(_0xf893('0x3'));var rs=require(_0xf893('0x4'));var fs=require('fs');var Redis=require(_0xf893('0x5'));var db=require(_0xf893('0x6'))['db'];var utils=require(_0xf893('0x7'));var logger=require(_0xf893('0x8'))(_0xf893('0x9'));var config=require('../../config/environment');var jayson=require(_0xf893('0xa'));var client=jayson[_0xf893('0xb')][_0xf893('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14c4b0,_0x4e872e,_0x4d8276){return new BPromise(function(_0x449c8e,_0x48c4fb){return client[_0xf893('0xd')](_0x14c4b0,_0x4d8276)[_0xf893('0xe')](function(_0x2470c4){logger[_0xf893('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4e872e,_0xf893('0x10'));logger['debug'](_0xf893('0x11'),_0x4e872e,_0xf893('0x10'),JSON['stringify'](_0x2470c4));if(_0x2470c4['error']){if(_0x2470c4[_0xf893('0x12')][_0xf893('0x13')]===0x1f4){logger[_0xf893('0x12')](_0xf893('0x14'),_0x4e872e,_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);return _0x48c4fb(_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);}logger[_0xf893('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4e872e,_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);return _0x449c8e(_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);}else{logger[_0xf893('0xf')](_0xf893('0x14'),_0x4e872e,_0xf893('0x10'));_0x449c8e(_0x2470c4[_0xf893('0x16')][_0xf893('0x15')]);}})[_0xf893('0x17')](function(_0x36f938){logger[_0xf893('0x12')](_0xf893('0x14'),_0x4e872e,_0x36f938);_0x48c4fb(_0x36f938);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index c8c6979..c2c625f 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 _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x36271b,_0x52ef81){var _0x315b6c=function(_0x121e94){while(--_0x121e94){_0x36271b['push'](_0x36271b['shift']());}};_0x315b6c(++_0x52ef81);}(_0xe14b,0x93));var _0xbe14=function(_0x43604e,_0x41e720){_0x43604e=_0x43604e-0x0;var _0x16a542=_0xe14b[_0x43604e];return _0x16a542;};'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 auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router;
\ No newline at end of file
+var _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0xccdde3,_0x4786bb){var _0x3e3a29=function(_0x4e9bc2){while(--_0x4e9bc2){_0xccdde3['push'](_0xccdde3['shift']());}};_0x3e3a29(++_0x4786bb);}(_0xe14b,0x93));var _0xbe14=function(_0x21d49b,_0x571e81){_0x21d49b=_0x21d49b-0x0;var _0x2b9bac=_0xe14b[_0x21d49b];return _0x2b9bac;};'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 auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index a050a14..2439f1f 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 _0xc0d6=['STRING','TEXT','exports','name'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x55d512,_0x1b85de){_0x55d512=_0x55d512-0x0;var _0x2c8c00=_0xc0d6[_0x55d512];return _0x2c8c00;};'use strict';var Sequelize=require('sequelize');module[_0x6c0d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6c0d('0x1')},'table':{'type':Sequelize[_0x6c0d('0x2')]},'metric':{'type':Sequelize[_0x6c0d('0x3')]},'description':{'type':Sequelize[_0x6c0d('0x2')]}};
\ No newline at end of file
+var _0x4e81=['sequelize','exports','STRING'];(function(_0x3bfbc7,_0x1aa44f){var _0x41df69=function(_0x42cecc){while(--_0x42cecc){_0x3bfbc7['push'](_0x3bfbc7['shift']());}};_0x41df69(++_0x1aa44f);}(_0x4e81,0x1bc));var _0x14e8=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x4e81[_0x29df9a];return _0x3a8e96;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'name':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x14e8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index e9c0876..751670b 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 _0xab06=['rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xab06,0x1ec));var _0x6ab0=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xab06[_0x20a558];return _0x53d3f7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6ab0('0x0'));var zipdir=require(_0x6ab0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab0('0x2'));var BPromise=require(_0x6ab0('0x3'));var Mustache=require(_0x6ab0('0x4'));var util=require('util');var path=require(_0x6ab0('0x5'));var sox=require(_0x6ab0('0x6'));var csv=require(_0x6ab0('0x7'));var ejs=require(_0x6ab0('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6ab0('0x9'));var jsforce=require(_0x6ab0('0xa'));var deskjs=require(_0x6ab0('0xb'));var toCsv=require(_0x6ab0('0x7'));var querystring=require(_0x6ab0('0xc'));var Papa=require('papaparse');var Redis=require(_0x6ab0('0xd'));var authService=require(_0x6ab0('0xe'));var qs=require(_0x6ab0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ab0('0x10'))(_0x6ab0('0x11'));var utils=require(_0x6ab0('0x12'));var config=require('../../config/environment');var db=require(_0x6ab0('0x13'))['db'];function respondWithStatusCode(_0x5c2543,_0x2f23be){_0x2f23be=_0x2f23be||0xcc;return function(_0x218fdc){if(_0x218fdc){return _0x5c2543[_0x6ab0('0x14')](_0x2f23be);}return _0x5c2543[_0x6ab0('0x15')](_0x2f23be)[_0x6ab0('0x16')]();};}function respondWithResult(_0x41e524,_0x5b1e53){_0x5b1e53=_0x5b1e53||0xc8;return function(_0x5d4ae5){if(_0x5d4ae5){return _0x41e524[_0x6ab0('0x15')](_0x5b1e53)['json'](_0x5d4ae5);}};}function respondWithFilteredResult(_0x2d052f,_0x446169){return function(_0x3ab760){if(_0x3ab760){var _0x154c4f=_0x3ab760[_0x6ab0('0x17')],_0x416c8c=_0x446169[_0x6ab0('0x18')],_0x38d099=_0x446169[_0x6ab0('0x18')]+_0x446169[_0x6ab0('0x19')],_0x317355;if(_0x38d099>=_0x154c4f){_0x38d099=_0x154c4f;_0x317355=0xc8;}else{_0x317355=0xce;}_0x2d052f[_0x6ab0('0x15')](_0x317355);return _0x2d052f[_0x6ab0('0x1a')]('Content-Range',_0x416c8c+'-'+_0x38d099+'/'+_0x154c4f)['json'](_0x3ab760);}return null;};}function patchUpdates(_0x414498){return function(_0x43e4fa){try{jsonpatch[_0x6ab0('0x1b')](_0x43e4fa,_0x414498,!![]);}catch(_0x3e92ee){return BPromise[_0x6ab0('0x1c')](_0x3e92ee);}return _0x43e4fa[_0x6ab0('0x1d')]();};}function saveUpdates(_0x235703,_0x30db42){return function(_0x4eb100){if(_0x4eb100){return _0x4eb100[_0x6ab0('0x1e')](_0x235703)[_0x6ab0('0x1f')](function(_0x53e23c){return _0x53e23c;});}return null;};}function removeEntity(_0x5a2e1e,_0x4c537a){return function(_0x5aae8a){if(_0x5aae8a){return _0x5aae8a[_0x6ab0('0x20')]()[_0x6ab0('0x1f')](function(){var _0x1e1ffd=_0x5aae8a[_0x6ab0('0x21')]({'plain':!![]});var _0x58b31f=_0x6ab0('0x22');return db[_0x6ab0('0x23')]['destroy']({'where':{'type':_0x58b31f,'resourceId':_0x1e1ffd['id']}})[_0x6ab0('0x1f')](function(){return _0x5aae8a;});})[_0x6ab0('0x1f')](function(){_0x5a2e1e['status'](0xcc)[_0x6ab0('0x16')]();});}};}function handleEntityNotFound(_0x340f1b,_0x152020){return function(_0x555b6e){if(!_0x555b6e){_0x340f1b['sendStatus'](0x194);}return _0x555b6e;};}function handleError(_0x5680e5,_0x47ea42){_0x47ea42=_0x47ea42||0x1f4;return function(_0x1287e4){logger[_0x6ab0('0x24')](_0x1287e4[_0x6ab0('0x25')]);if(_0x1287e4[_0x6ab0('0x26')]){delete _0x1287e4[_0x6ab0('0x26')];}_0x5680e5['status'](_0x47ea42)[_0x6ab0('0x27')](_0x1287e4);};}exports[_0x6ab0('0x28')]=function(_0x27770a,_0x5e9234){var _0x1e7e45={},_0x287137={},_0x5318c5={'count':0x0,'rows':[]};var _0xe930ff=_['map'](db[_0x6ab0('0x29')][_0x6ab0('0x2a')],function(_0x276463){return{'name':_0x276463[_0x6ab0('0x2b')],'type':_0x276463['type'][_0x6ab0('0x2c')]};});_0x287137[_0x6ab0('0x2d')]=_[_0x6ab0('0x2e')](_0xe930ff,_0x6ab0('0x26'));_0x287137[_0x6ab0('0x2f')]=_[_0x6ab0('0x30')](_0x27770a['query']);_0x287137[_0x6ab0('0x31')]=_[_0x6ab0('0x32')](_0x287137['model'],_0x287137['query']);_0x1e7e45['attributes']=_[_0x6ab0('0x32')](_0x287137[_0x6ab0('0x2d')],qs[_0x6ab0('0x33')](_0x27770a['query'][_0x6ab0('0x33')]));_0x1e7e45[_0x6ab0('0x34')]=_0x1e7e45[_0x6ab0('0x34')]['length']?_0x1e7e45[_0x6ab0('0x34')]:_0x287137[_0x6ab0('0x2d')];if(!_0x27770a['query'][_0x6ab0('0x35')](_0x6ab0('0x36'))){_0x1e7e45['limit']=qs[_0x6ab0('0x19')](_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x19')]);_0x1e7e45[_0x6ab0('0x18')]=qs[_0x6ab0('0x18')](_0x27770a['query'][_0x6ab0('0x18')]);}_0x1e7e45[_0x6ab0('0x37')]=qs[_0x6ab0('0x38')](_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x38')]);_0x1e7e45[_0x6ab0('0x39')]=qs[_0x6ab0('0x31')](_[_0x6ab0('0x3a')](_0x27770a[_0x6ab0('0x2f')],_0x287137[_0x6ab0('0x31')]));if(_0x27770a['query'][_0x6ab0('0x3b')]){_0x1e7e45[_0x6ab0('0x39')]=_[_0x6ab0('0x3c')](_0x1e7e45[_0x6ab0('0x39')],{'$or':_[_0x6ab0('0x2e')](_0xe930ff,function(_0x5b01cf){if(_0x5b01cf[_0x6ab0('0x3d')][_0x6ab0('0x2c')]!==_0x6ab0('0x3e')){var _0x17373e={};_0x17373e[_0x5b01cf[_0x6ab0('0x3f')]]={'$like':'%'+_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x3b')]+'%'};return _0x17373e;}})});}_0x1e7e45=_[_0x6ab0('0x3c')]({},_0x1e7e45,_0x27770a[_0x6ab0('0x40')]);var _0xa18585={'where':_0x1e7e45['where']};return db[_0x6ab0('0x29')][_0x6ab0('0x17')](_0xa18585)[_0x6ab0('0x1f')](function(_0x51b3f8){_0x5318c5[_0x6ab0('0x17')]=_0x51b3f8;if(_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x41')]){_0x1e7e45[_0x6ab0('0x42')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x6ab0('0x43')](_0x1e7e45);})[_0x6ab0('0x1f')](function(_0x5b31f6){_0x5318c5[_0x6ab0('0x44')]=_0x5b31f6;return _0x5318c5;})['then'](respondWithFilteredResult(_0x5e9234,_0x1e7e45))[_0x6ab0('0x45')](handleError(_0x5e9234,null));};exports['show']=function(_0x1fe98b,_0x39397f){var _0x34cd0d={'raw':!![],'where':{'id':_0x1fe98b[_0x6ab0('0x46')]['id']}},_0x20ad69={};_0x20ad69[_0x6ab0('0x2d')]=_['keys'](db[_0x6ab0('0x29')][_0x6ab0('0x2a')]);_0x20ad69[_0x6ab0('0x2f')]=_[_0x6ab0('0x30')](_0x1fe98b[_0x6ab0('0x2f')]);_0x20ad69['filters']=_[_0x6ab0('0x32')](_0x20ad69[_0x6ab0('0x2d')],_0x20ad69['query']);_0x34cd0d[_0x6ab0('0x34')]=_['intersection'](_0x20ad69[_0x6ab0('0x2d')],qs['fields'](_0x1fe98b[_0x6ab0('0x2f')]['fields']));_0x34cd0d[_0x6ab0('0x34')]=_0x34cd0d[_0x6ab0('0x34')][_0x6ab0('0x47')]?_0x34cd0d['attributes']:_0x20ad69['model'];if(_0x1fe98b[_0x6ab0('0x2f')][_0x6ab0('0x41')]){_0x34cd0d[_0x6ab0('0x42')]=[{'all':!![]}];}_0x34cd0d=_['merge']({},_0x34cd0d,_0x1fe98b[_0x6ab0('0x40')]);return db[_0x6ab0('0x29')][_0x6ab0('0x48')](_0x34cd0d)[_0x6ab0('0x1f')](handleEntityNotFound(_0x39397f,null))['then'](respondWithResult(_0x39397f,null))['catch'](handleError(_0x39397f,null));};exports[_0x6ab0('0x49')]=function(_0x3c8153,_0x76a2d5){return db['AnalyticMetric'][_0x6ab0('0x49')](_0x3c8153['body'],{})[_0x6ab0('0x1f')](function(_0x376eda){var _0x45fbb3=_0x3c8153[_0x6ab0('0x4a')]['get']({'plain':!![]});if(!_0x45fbb3)throw new Error(_0x6ab0('0x4b'));if(_0x45fbb3[_0x6ab0('0x4c')]===_0x6ab0('0x4a')){var _0x5b5902=_0x376eda['get']({'plain':!![]});var _0x51609f=_0x6ab0('0x22');return db[_0x6ab0('0x4d')][_0x6ab0('0x48')]({'where':{'name':_0x51609f,'userProfileId':_0x45fbb3[_0x6ab0('0x4e')]},'raw':!![]})[_0x6ab0('0x1f')](function(_0x1499dc){if(_0x1499dc&&_0x1499dc[_0x6ab0('0x4f')]===0x0){return db[_0x6ab0('0x23')][_0x6ab0('0x49')]({'name':_0x5b5902[_0x6ab0('0x26')],'resourceId':_0x5b5902['id'],'type':_0x1499dc[_0x6ab0('0x26')],'sectionId':_0x1499dc['id']},{})['then'](function(){return _0x376eda;});}else{return _0x376eda;}})[_0x6ab0('0x45')](function(_0x34a706){logger[_0x6ab0('0x24')](_0x6ab0('0x50'),_0x34a706);throw _0x34a706;});}return _0x376eda;})['then'](respondWithResult(_0x76a2d5,0xc9))['catch'](handleError(_0x76a2d5,null));};exports[_0x6ab0('0x1e')]=function(_0x212c01,_0x2c7f11){if(_0x212c01['body']['id']){delete _0x212c01[_0x6ab0('0x51')]['id'];}return db[_0x6ab0('0x29')]['find']({'where':{'id':_0x212c01[_0x6ab0('0x46')]['id']}})[_0x6ab0('0x1f')](handleEntityNotFound(_0x2c7f11,null))[_0x6ab0('0x1f')](saveUpdates(_0x212c01['body'],null))['then'](respondWithResult(_0x2c7f11,null))['catch'](handleError(_0x2c7f11,null));};exports[_0x6ab0('0x20')]=function(_0x413c2c,_0x4e2082){return db[_0x6ab0('0x29')]['find']({'where':{'id':_0x413c2c['params']['id']}})['then'](handleEntityNotFound(_0x4e2082,null))[_0x6ab0('0x1f')](removeEntity(_0x4e2082,null))[_0x6ab0('0x45')](handleError(_0x4e2082,null));};
\ No newline at end of file
+var _0x1e4c=['map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','autoAssociation','UserProfileResource','error','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','send'];(function(_0x43a872,_0x195afd){var _0x36b088=function(_0x5794ce){while(--_0x5794ce){_0x43a872['push'](_0x43a872['shift']());}};_0x36b088(++_0x195afd);}(_0x1e4c,0x118));var _0xc1e4=function(_0x300dec,_0x1c8893){_0x300dec=_0x300dec-0x0;var _0x5acf93=_0x1e4c[_0x300dec];return _0x5acf93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc1e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1e4('0x1'));var jsonpatch=require(_0xc1e4('0x2'));var rp=require('request-promise');var moment=require(_0xc1e4('0x3'));var BPromise=require(_0xc1e4('0x4'));var Mustache=require(_0xc1e4('0x5'));var util=require(_0xc1e4('0x6'));var path=require(_0xc1e4('0x7'));var sox=require(_0xc1e4('0x8'));var csv=require(_0xc1e4('0x9'));var ejs=require(_0xc1e4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc1e4('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1e4('0xc'));var deskjs=require(_0xc1e4('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc1e4('0xe'));var Redis=require(_0xc1e4('0xf'));var authService=require(_0xc1e4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1e4('0x11'));var logger=require('../../config/logger')(_0xc1e4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc1e4('0x13'))['db'];function respondWithStatusCode(_0xbcc2c1,_0x278262){_0x278262=_0x278262||0xcc;return function(_0x4aeeac){if(_0x4aeeac){return _0xbcc2c1['sendStatus'](_0x278262);}return _0xbcc2c1[_0xc1e4('0x14')](_0x278262)[_0xc1e4('0x15')]();};}function respondWithResult(_0x418989,_0x558bb6){_0x558bb6=_0x558bb6||0xc8;return function(_0x160d2b){if(_0x160d2b){return _0x418989[_0xc1e4('0x14')](_0x558bb6)[_0xc1e4('0x16')](_0x160d2b);}};}function respondWithFilteredResult(_0x558ac8,_0x39c969){return function(_0x5b1e02){if(_0x5b1e02){var _0x3d118b=_0x5b1e02[_0xc1e4('0x17')],_0x2734a3=_0x39c969[_0xc1e4('0x18')],_0x50e380=_0x39c969[_0xc1e4('0x18')]+_0x39c969[_0xc1e4('0x19')],_0x45eacb;if(_0x50e380>=_0x3d118b){_0x50e380=_0x3d118b;_0x45eacb=0xc8;}else{_0x45eacb=0xce;}_0x558ac8[_0xc1e4('0x14')](_0x45eacb);return _0x558ac8[_0xc1e4('0x1a')](_0xc1e4('0x1b'),_0x2734a3+'-'+_0x50e380+'/'+_0x3d118b)[_0xc1e4('0x16')](_0x5b1e02);}return null;};}function patchUpdates(_0x4386a4){return function(_0x3087c4){try{jsonpatch['apply'](_0x3087c4,_0x4386a4,!![]);}catch(_0x33f9af){return BPromise[_0xc1e4('0x1c')](_0x33f9af);}return _0x3087c4[_0xc1e4('0x1d')]();};}function saveUpdates(_0xe02c3d,_0x5ced27){return function(_0x399c4a){if(_0x399c4a){return _0x399c4a[_0xc1e4('0x1e')](_0xe02c3d)['then'](function(_0x52330d){return _0x52330d;});}return null;};}function removeEntity(_0x5574e9,_0x1dca61){return function(_0x34ac47){if(_0x34ac47){return _0x34ac47[_0xc1e4('0x1f')]()['then'](function(){var _0x4d0759=_0x34ac47['get']({'plain':!![]});var _0x24e7d7='Metrics';return db['UserProfileResource'][_0xc1e4('0x1f')]({'where':{'type':_0x24e7d7,'resourceId':_0x4d0759['id']}})['then'](function(){return _0x34ac47;});})[_0xc1e4('0x20')](function(){_0x5574e9[_0xc1e4('0x14')](0xcc)[_0xc1e4('0x15')]();});}};}function handleEntityNotFound(_0x245d49,_0x1f74ef){return function(_0x5b55b9){if(!_0x5b55b9){_0x245d49['sendStatus'](0x194);}return _0x5b55b9;};}function handleError(_0x22619b,_0x42c152){_0x42c152=_0x42c152||0x1f4;return function(_0x272952){logger['error'](_0x272952[_0xc1e4('0x21')]);if(_0x272952[_0xc1e4('0x22')]){delete _0x272952['name'];}_0x22619b[_0xc1e4('0x14')](_0x42c152)[_0xc1e4('0x23')](_0x272952);};}exports['index']=function(_0x4f0b10,_0x29ca12){var _0x575af6={},_0x563094={},_0xca83d8={'count':0x0,'rows':[]};var _0x2145e9=_[_0xc1e4('0x24')](db[_0xc1e4('0x25')][_0xc1e4('0x26')],function(_0x3d720f){return{'name':_0x3d720f[_0xc1e4('0x27')],'type':_0x3d720f[_0xc1e4('0x28')][_0xc1e4('0x29')]};});_0x563094[_0xc1e4('0x2a')]=_[_0xc1e4('0x24')](_0x2145e9,_0xc1e4('0x22'));_0x563094[_0xc1e4('0x2b')]=_[_0xc1e4('0x2c')](_0x4f0b10['query']);_0x563094[_0xc1e4('0x2d')]=_[_0xc1e4('0x2e')](_0x563094[_0xc1e4('0x2a')],_0x563094[_0xc1e4('0x2b')]);_0x575af6['attributes']=_[_0xc1e4('0x2e')](_0x563094['model'],qs['fields'](_0x4f0b10['query'][_0xc1e4('0x2f')]));_0x575af6[_0xc1e4('0x30')]=_0x575af6[_0xc1e4('0x30')][_0xc1e4('0x31')]?_0x575af6[_0xc1e4('0x30')]:_0x563094[_0xc1e4('0x2a')];if(!_0x4f0b10['query'][_0xc1e4('0x32')]('nolimit')){_0x575af6[_0xc1e4('0x19')]=qs['limit'](_0x4f0b10[_0xc1e4('0x2b')]['limit']);_0x575af6[_0xc1e4('0x18')]=qs['offset'](_0x4f0b10[_0xc1e4('0x2b')]['offset']);}_0x575af6[_0xc1e4('0x33')]=qs[_0xc1e4('0x34')](_0x4f0b10[_0xc1e4('0x2b')][_0xc1e4('0x34')]);_0x575af6['where']=qs[_0xc1e4('0x2d')](_[_0xc1e4('0x35')](_0x4f0b10[_0xc1e4('0x2b')],_0x563094[_0xc1e4('0x2d')]));if(_0x4f0b10[_0xc1e4('0x2b')][_0xc1e4('0x36')]){_0x575af6[_0xc1e4('0x37')]=_[_0xc1e4('0x38')](_0x575af6['where'],{'$or':_['map'](_0x2145e9,function(_0x23f0cc){if(_0x23f0cc[_0xc1e4('0x28')][_0xc1e4('0x29')]!==_0xc1e4('0x39')){var _0x5f5773={};_0x5f5773[_0x23f0cc[_0xc1e4('0x3a')]]={'$like':'%'+_0x4f0b10[_0xc1e4('0x2b')]['filter']+'%'};return _0x5f5773;}})});}_0x575af6=_[_0xc1e4('0x38')]({},_0x575af6,_0x4f0b10[_0xc1e4('0x3b')]);var _0x1b93ee={'where':_0x575af6['where']};return db[_0xc1e4('0x25')]['count'](_0x1b93ee)[_0xc1e4('0x20')](function(_0x1b6557){_0xca83d8[_0xc1e4('0x17')]=_0x1b6557;if(_0x4f0b10[_0xc1e4('0x2b')][_0xc1e4('0x3c')]){_0x575af6[_0xc1e4('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xc1e4('0x3e')](_0x575af6);})[_0xc1e4('0x20')](function(_0x1225a7){_0xca83d8[_0xc1e4('0x3f')]=_0x1225a7;return _0xca83d8;})[_0xc1e4('0x20')](respondWithFilteredResult(_0x29ca12,_0x575af6))['catch'](handleError(_0x29ca12,null));};exports[_0xc1e4('0x40')]=function(_0xd085a9,_0x2bb5f0){var _0xa5598c={'raw':!![],'where':{'id':_0xd085a9['params']['id']}},_0x1058a3={};_0x1058a3['model']=_[_0xc1e4('0x2c')](db['AnalyticMetric']['rawAttributes']);_0x1058a3[_0xc1e4('0x2b')]=_[_0xc1e4('0x2c')](_0xd085a9[_0xc1e4('0x2b')]);_0x1058a3[_0xc1e4('0x2d')]=_[_0xc1e4('0x2e')](_0x1058a3[_0xc1e4('0x2a')],_0x1058a3[_0xc1e4('0x2b')]);_0xa5598c[_0xc1e4('0x30')]=_['intersection'](_0x1058a3[_0xc1e4('0x2a')],qs['fields'](_0xd085a9[_0xc1e4('0x2b')][_0xc1e4('0x2f')]));_0xa5598c[_0xc1e4('0x30')]=_0xa5598c[_0xc1e4('0x30')][_0xc1e4('0x31')]?_0xa5598c[_0xc1e4('0x30')]:_0x1058a3[_0xc1e4('0x2a')];if(_0xd085a9['query'][_0xc1e4('0x3c')]){_0xa5598c[_0xc1e4('0x3d')]=[{'all':!![]}];}_0xa5598c=_[_0xc1e4('0x38')]({},_0xa5598c,_0xd085a9[_0xc1e4('0x3b')]);return db[_0xc1e4('0x25')][_0xc1e4('0x41')](_0xa5598c)[_0xc1e4('0x20')](handleEntityNotFound(_0x2bb5f0,null))[_0xc1e4('0x20')](respondWithResult(_0x2bb5f0,null))[_0xc1e4('0x42')](handleError(_0x2bb5f0,null));};exports[_0xc1e4('0x43')]=function(_0x26b66c,_0x515887){return db[_0xc1e4('0x25')][_0xc1e4('0x43')](_0x26b66c['body'],{})[_0xc1e4('0x20')](function(_0x42ad2f){var _0x4077f2=_0x26b66c[_0xc1e4('0x44')][_0xc1e4('0x45')]({'plain':!![]});if(!_0x4077f2)throw new Error(_0xc1e4('0x46'));if(_0x4077f2[_0xc1e4('0x47')]===_0xc1e4('0x44')){var _0x2d957f=_0x42ad2f[_0xc1e4('0x45')]({'plain':!![]});var _0x4b7a9d=_0xc1e4('0x48');return db[_0xc1e4('0x49')][_0xc1e4('0x41')]({'where':{'name':_0x4b7a9d,'userProfileId':_0x4077f2['userProfileId']},'raw':!![]})['then'](function(_0x2b4df8){if(_0x2b4df8&&_0x2b4df8[_0xc1e4('0x4a')]===0x0){return db[_0xc1e4('0x4b')][_0xc1e4('0x43')]({'name':_0x2d957f['name'],'resourceId':_0x2d957f['id'],'type':_0x2b4df8[_0xc1e4('0x22')],'sectionId':_0x2b4df8['id']},{})['then'](function(){return _0x42ad2f;});}else{return _0x42ad2f;}})[_0xc1e4('0x42')](function(_0x44bdeb){logger[_0xc1e4('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44bdeb);throw _0x44bdeb;});}return _0x42ad2f;})[_0xc1e4('0x20')](respondWithResult(_0x515887,0xc9))['catch'](handleError(_0x515887,null));};exports[_0xc1e4('0x1e')]=function(_0x18405a,_0xedb24e){if(_0x18405a[_0xc1e4('0x4d')]['id']){delete _0x18405a[_0xc1e4('0x4d')]['id'];}return db[_0xc1e4('0x25')][_0xc1e4('0x41')]({'where':{'id':_0x18405a[_0xc1e4('0x4e')]['id']}})[_0xc1e4('0x20')](handleEntityNotFound(_0xedb24e,null))[_0xc1e4('0x20')](saveUpdates(_0x18405a[_0xc1e4('0x4d')],null))[_0xc1e4('0x20')](respondWithResult(_0xedb24e,null))[_0xc1e4('0x42')](handleError(_0xedb24e,null));};exports[_0xc1e4('0x1f')]=function(_0x50ea2b,_0x4ce85f){return db[_0xc1e4('0x25')][_0xc1e4('0x41')]({'where':{'id':_0x50ea2b['params']['id']}})[_0xc1e4('0x20')](handleEntityNotFound(_0x4ce85f,null))[_0xc1e4('0x20')](removeEntity(_0x4ce85f,null))['catch'](handleError(_0x4ce85f,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 755ff24..6607fd8 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 _0x8cae=['rimraf','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8cae,0x1cd));var _0xe8ca=function(_0x337a70,_0x53b0cb){_0x337a70=_0x337a70-0x0;var _0x89443a=_0x8cae[_0x337a70];return _0x89443a;};'use strict';var _=require(_0xe8ca('0x0'));var util=require(_0xe8ca('0x1'));var logger=require(_0xe8ca('0x2'))(_0xe8ca('0x3'));var moment=require('moment');var BPromise=require(_0xe8ca('0x4'));var rp=require(_0xe8ca('0x5'));var fs=require('fs');var path=require(_0xe8ca('0x6'));var rimraf=require(_0xe8ca('0x7'));var config=require(_0xe8ca('0x8'));var attributes=require(_0xe8ca('0x9'));module['exports']=function(_0x5f3efe,_0x4546a3){return _0x5f3efe[_0xe8ca('0xa')]('AnalyticMetric',attributes,{'tableName':_0xe8ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98c4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x98c4,0x6f));var _0x498c=function(_0x28cc79,_0x10fbb3){_0x28cc79=_0x28cc79-0x0;var _0x43d753=_0x98c4[_0x28cc79];return _0x43d753;};'use strict';var _=require(_0x498c('0x0'));var util=require(_0x498c('0x1'));var logger=require(_0x498c('0x2'))(_0x498c('0x3'));var moment=require(_0x498c('0x4'));var BPromise=require(_0x498c('0x5'));var rp=require(_0x498c('0x6'));var fs=require('fs');var path=require(_0x498c('0x7'));var rimraf=require(_0x498c('0x8'));var config=require(_0x498c('0x9'));var attributes=require(_0x498c('0xa'));module[_0x498c('0xb')]=function(_0x3492b9,_0x2d8f55){return _0x3492b9[_0x498c('0xc')](_0x498c('0xd'),attributes,{'tableName':'analytics_metrics','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 05e2289..b4fe9de 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 _0xfd14=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0xfd14,0x118));var _0x4fd1=function(_0x5a2d7a,_0x2fccc1){_0x5a2d7a=_0x5a2d7a-0x0;var _0x6b7e60=_0xfd14[_0x5a2d7a];return _0x6b7e60;};'use strict';var _=require('lodash');var util=require(_0x4fd1('0x0'));var moment=require(_0x4fd1('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fd1('0x2'));var fs=require('fs');var Redis=require(_0x4fd1('0x3'));var db=require(_0x4fd1('0x4'))['db'];var utils=require(_0x4fd1('0x5'));var logger=require(_0x4fd1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4fd1('0x7'));var client=jayson[_0x4fd1('0x8')][_0x4fd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59f37f,_0x5a5701,_0x158df2){return new BPromise(function(_0x4bea01,_0x1cd096){return client[_0x4fd1('0xa')](_0x59f37f,_0x158df2)[_0x4fd1('0xb')](function(_0x502aca){logger[_0x4fd1('0xc')](_0x4fd1('0xd'),_0x5a5701,_0x4fd1('0xe'));logger[_0x4fd1('0xf')](_0x4fd1('0x10'),_0x5a5701,'request\x20sent',JSON['stringify'](_0x502aca));if(_0x502aca[_0x4fd1('0x11')]){if(_0x502aca[_0x4fd1('0x11')]['code']===0x1f4){logger['error'](_0x4fd1('0xd'),_0x5a5701,_0x502aca[_0x4fd1('0x11')][_0x4fd1('0x12')]);return _0x1cd096(_0x502aca[_0x4fd1('0x11')][_0x4fd1('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5a5701,_0x502aca[_0x4fd1('0x11')]['message']);return _0x4bea01(_0x502aca['error'][_0x4fd1('0x12')]);}else{logger['info'](_0x4fd1('0xd'),_0x5a5701,_0x4fd1('0xe'));_0x4bea01(_0x502aca['result'][_0x4fd1('0x12')]);}})[_0x4fd1('0x13')](function(_0x371c50){logger['error'](_0x4fd1('0xd'),_0x5a5701,_0x371c50);_0x1cd096(_0x371c50);});});}
\ No newline at end of file
+var _0xab34=['request\x20sent','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x14e664,_0x41aa92){var _0x46acb3=function(_0x54b53f){while(--_0x54b53f){_0x14e664['push'](_0x14e664['shift']());}};_0x46acb3(++_0x41aa92);}(_0xab34,0x1bc));var _0x4ab3=function(_0x4bfabb,_0x213885){_0x4bfabb=_0x4bfabb-0x0;var _0x56cf62=_0xab34[_0x4bfabb];return _0x56cf62;};'use strict';var _=require('lodash');var util=require(_0x4ab3('0x0'));var moment=require(_0x4ab3('0x1'));var BPromise=require(_0x4ab3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ab3('0x3'))['db'];var utils=require(_0x4ab3('0x4'));var logger=require(_0x4ab3('0x5'))(_0x4ab3('0x6'));var config=require(_0x4ab3('0x7'));var jayson=require(_0x4ab3('0x8'));var client=jayson[_0x4ab3('0x9')][_0x4ab3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cdf4b,_0x58e8aa,_0xedd37){return new BPromise(function(_0x2cab97,_0x509a96){return client[_0x4ab3('0xb')](_0x5cdf4b,_0xedd37)[_0x4ab3('0xc')](function(_0x36008e){logger[_0x4ab3('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x58e8aa,'request\x20sent');logger[_0x4ab3('0xe')](_0x4ab3('0xf'),_0x58e8aa,_0x4ab3('0x10'),JSON['stringify'](_0x36008e));if(_0x36008e[_0x4ab3('0x11')]){if(_0x36008e[_0x4ab3('0x11')][_0x4ab3('0x12')]===0x1f4){logger[_0x4ab3('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x58e8aa,_0x36008e[_0x4ab3('0x11')]['message']);return _0x509a96(_0x36008e[_0x4ab3('0x11')][_0x4ab3('0x13')]);}logger[_0x4ab3('0x11')](_0x4ab3('0x14'),_0x58e8aa,_0x36008e[_0x4ab3('0x11')][_0x4ab3('0x13')]);return _0x2cab97(_0x36008e[_0x4ab3('0x11')]['message']);}else{logger[_0x4ab3('0xd')](_0x4ab3('0x14'),_0x58e8aa,_0x4ab3('0x10'));_0x2cab97(_0x36008e[_0x4ab3('0x15')][_0x4ab3('0x13')]);}})[_0x4ab3('0x16')](function(_0x1bead4){logger['error'](_0x4ab3('0x14'),_0x58e8aa,_0x1bead4);_0x509a96(_0x1bead4);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 95155b5..e6cb90d 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 _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x276718,_0x37aaa9){var _0x3aa544=function(_0x2147fc){while(--_0x2147fc){_0x276718['push'](_0x276718['shift']());}};_0x3aa544(++_0x37aaa9);}(_0x6d38,0x1ef));var _0x86d3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6d38[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router;
\ No newline at end of file
+var _0x2ef3=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x20f65d,_0x50ce6f){var _0x43d016=function(_0x277a19){while(--_0x277a19){_0x20f65d['push'](_0x20f65d['shift']());}};_0x43d016(++_0x50ce6f);}(_0x2ef3,0xba));var _0x32ef=function(_0x143e6c,_0x294789){_0x143e6c=_0x143e6c-0x0;var _0x269909=_0x2ef3[_0x143e6c];return _0x269909;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./analyticMetric.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0xc')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['delete']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 1e7b294..2bfc235 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 _0xbfde=['TEXT','sequelize','exports'];(function(_0x5b4d06,_0x3edc8d){var _0xad4053=function(_0x1e2748){while(--_0x1e2748){_0x5b4d06['push'](_0x5b4d06['shift']());}};_0xad4053(++_0x3edc8d);}(_0xbfde,0x1c0));var _0xebfd=function(_0x5765eb,_0x5bd41b){_0x5765eb=_0x5765eb-0x0;var _0x15d2f5=_0xbfde[_0x5765eb];return _0x15d2f5;};'use strict';var Sequelize=require(_0xebfd('0x0'));module[_0xebfd('0x1')]={'tree':{'type':Sequelize[_0xebfd('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9bc7=['sequelize','exports'];(function(_0x11c4b6,_0x572fdb){var _0x2cb405=function(_0xf12cc4){while(--_0xf12cc4){_0x11c4b6['push'](_0x11c4b6['shift']());}};_0x2cb405(++_0x572fdb);}(_0x9bc7,0x13a));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x79bc('0x0'));module[_0x79bc('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 9b547bf..b20335b 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 _0x9b40=['include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','map','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','VIRTUAL','field','merge','options','AnalyticTreeReport','findAll','rows','catch','show','params','includeAll'];(function(_0x4f1d8f,_0x2c2d01){var _0x101bcb=function(_0xf440e0){while(--_0xf440e0){_0x4f1d8f['push'](_0x4f1d8f['shift']());}};_0x101bcb(++_0x2c2d01);}(_0x9b40,0x99));var _0x09b4=function(_0x32864c,_0x1c9c83){_0x32864c=_0x32864c-0x0;var _0x4474e1=_0x9b40[_0x32864c];return _0x4474e1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x09b4('0x0'));var zipdir=require(_0x09b4('0x1'));var jsonpatch=require(_0x09b4('0x2'));var rp=require(_0x09b4('0x3'));var moment=require(_0x09b4('0x4'));var BPromise=require(_0x09b4('0x5'));var Mustache=require('mustache');var util=require(_0x09b4('0x6'));var path=require(_0x09b4('0x7'));var sox=require(_0x09b4('0x8'));var csv=require('to-csv');var ejs=require(_0x09b4('0x9'));var fs=require('fs');var _=require(_0x09b4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x09b4('0xb'));var toCsv=require(_0x09b4('0xc'));var querystring=require(_0x09b4('0xd'));var Papa=require(_0x09b4('0xe'));var Redis=require(_0x09b4('0xf'));var authService=require(_0x09b4('0x10'));var qs=require(_0x09b4('0x11'));var as=require(_0x09b4('0x12'));var hardwareService=require(_0x09b4('0x13'));var logger=require(_0x09b4('0x14'))('api');var utils=require(_0x09b4('0x15'));var config=require(_0x09b4('0x16'));var db=require(_0x09b4('0x17'))['db'];function respondWithStatusCode(_0x264e65,_0x187cef){_0x187cef=_0x187cef||0xcc;return function(_0x432d7a){if(_0x432d7a){return _0x264e65[_0x09b4('0x18')](_0x187cef);}return _0x264e65['status'](_0x187cef)[_0x09b4('0x19')]();};}function respondWithResult(_0x1221e6,_0x44c5b0){_0x44c5b0=_0x44c5b0||0xc8;return function(_0x357b44){if(_0x357b44){return _0x1221e6[_0x09b4('0x1a')](_0x44c5b0)[_0x09b4('0x1b')](_0x357b44);}};}function respondWithFilteredResult(_0x3aadb9,_0x15317f){return function(_0x1cde50){if(_0x1cde50){var _0x579825=_0x1cde50[_0x09b4('0x1c')],_0x3920e3=_0x15317f['offset'],_0x8c1e84=_0x15317f[_0x09b4('0x1d')]+_0x15317f[_0x09b4('0x1e')],_0x5b0669;if(_0x8c1e84>=_0x579825){_0x8c1e84=_0x579825;_0x5b0669=0xc8;}else{_0x5b0669=0xce;}_0x3aadb9[_0x09b4('0x1a')](_0x5b0669);return _0x3aadb9['set'](_0x09b4('0x1f'),_0x3920e3+'-'+_0x8c1e84+'/'+_0x579825)[_0x09b4('0x1b')](_0x1cde50);}return null;};}function patchUpdates(_0x1edf7a){return function(_0x10d3a0){try{jsonpatch[_0x09b4('0x20')](_0x10d3a0,_0x1edf7a,!![]);}catch(_0x2adea2){return BPromise[_0x09b4('0x21')](_0x2adea2);}return _0x10d3a0[_0x09b4('0x22')]();};}function saveUpdates(_0x2e3aff,_0x4f7ebb){return function(_0x5b0e2e){if(_0x5b0e2e){return _0x5b0e2e[_0x09b4('0x23')](_0x2e3aff)[_0x09b4('0x24')](function(_0x3391d3){return _0x3391d3;});}return null;};}function removeEntity(_0x680a6c,_0x44f6e2){return function(_0x341d3a){if(_0x341d3a){return _0x341d3a['destroy']()[_0x09b4('0x24')](function(){_0x680a6c[_0x09b4('0x1a')](0xcc)[_0x09b4('0x19')]();});}};}function handleEntityNotFound(_0x66f99d,_0x4eb374){return function(_0x4b81cc){if(!_0x4b81cc){_0x66f99d[_0x09b4('0x18')](0x194);}return _0x4b81cc;};}function handleError(_0x30fc6a,_0x55fce1){_0x55fce1=_0x55fce1||0x1f4;return function(_0xc28df1){logger['error'](_0xc28df1[_0x09b4('0x25')]);if(_0xc28df1['name']){delete _0xc28df1[_0x09b4('0x26')];}_0x30fc6a[_0x09b4('0x1a')](_0x55fce1)[_0x09b4('0x27')](_0xc28df1);};}exports['index']=function(_0x479541,_0x2ac7da){var _0x2d20b3={},_0x509ed9={},_0x5b417f={'count':0x0,'rows':[]};var _0x3fe3ba=_[_0x09b4('0x28')](db['AnalyticTreeReport'][_0x09b4('0x29')],function(_0x49c074){return{'name':_0x49c074[_0x09b4('0x2a')],'type':_0x49c074['type']['key']};});_0x509ed9['model']=_[_0x09b4('0x28')](_0x3fe3ba,'name');_0x509ed9[_0x09b4('0x2b')]=_[_0x09b4('0x2c')](_0x479541[_0x09b4('0x2b')]);_0x509ed9['filters']=_[_0x09b4('0x2d')](_0x509ed9[_0x09b4('0x2e')],_0x509ed9[_0x09b4('0x2b')]);_0x2d20b3['attributes']=_[_0x09b4('0x2d')](_0x509ed9['model'],qs['fields'](_0x479541[_0x09b4('0x2b')][_0x09b4('0x2f')]));_0x2d20b3['attributes']=_0x2d20b3[_0x09b4('0x30')][_0x09b4('0x31')]?_0x2d20b3[_0x09b4('0x30')]:_0x509ed9[_0x09b4('0x2e')];if(!_0x479541[_0x09b4('0x2b')][_0x09b4('0x32')](_0x09b4('0x33'))){_0x2d20b3[_0x09b4('0x1e')]=qs[_0x09b4('0x1e')](_0x479541[_0x09b4('0x2b')][_0x09b4('0x1e')]);_0x2d20b3[_0x09b4('0x1d')]=qs[_0x09b4('0x1d')](_0x479541[_0x09b4('0x2b')][_0x09b4('0x1d')]);}_0x2d20b3[_0x09b4('0x34')]=qs['sort'](_0x479541[_0x09b4('0x2b')]['sort']);_0x2d20b3[_0x09b4('0x35')]=qs[_0x09b4('0x36')](_[_0x09b4('0x37')](_0x479541[_0x09b4('0x2b')],_0x509ed9[_0x09b4('0x36')]));if(_0x479541[_0x09b4('0x2b')][_0x09b4('0x38')]){_0x2d20b3[_0x09b4('0x35')]=_['merge'](_0x2d20b3[_0x09b4('0x35')],{'$or':_[_0x09b4('0x28')](_0x3fe3ba,function(_0x2bd612){if(_0x2bd612[_0x09b4('0x39')]['key']!==_0x09b4('0x3a')){var _0x528705={};_0x528705[_0x2bd612[_0x09b4('0x3b')]]={'$like':'%'+_0x479541[_0x09b4('0x2b')][_0x09b4('0x38')]+'%'};return _0x528705;}})});}_0x2d20b3=_[_0x09b4('0x3c')]({},_0x2d20b3,_0x479541[_0x09b4('0x3d')]);var _0x11c46e={'where':_0x2d20b3[_0x09b4('0x35')]};return db[_0x09b4('0x3e')]['count'](_0x11c46e)['then'](function(_0x406aff){_0x5b417f[_0x09b4('0x1c')]=_0x406aff;if(_0x479541[_0x09b4('0x2b')]['includeAll']){_0x2d20b3['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x09b4('0x3f')](_0x2d20b3);})[_0x09b4('0x24')](function(_0x502d7d){_0x5b417f[_0x09b4('0x40')]=_0x502d7d;return _0x5b417f;})['then'](respondWithFilteredResult(_0x2ac7da,_0x2d20b3))[_0x09b4('0x41')](handleError(_0x2ac7da,null));};exports[_0x09b4('0x42')]=function(_0x36e2a0,_0x39920d){var _0x316def={'raw':!![],'where':{'id':_0x36e2a0[_0x09b4('0x43')]['id']}},_0x1941be={};_0x1941be[_0x09b4('0x2e')]=_[_0x09b4('0x2c')](db['AnalyticTreeReport'][_0x09b4('0x29')]);_0x1941be[_0x09b4('0x2b')]=_[_0x09b4('0x2c')](_0x36e2a0['query']);_0x1941be[_0x09b4('0x36')]=_[_0x09b4('0x2d')](_0x1941be['model'],_0x1941be[_0x09b4('0x2b')]);_0x316def[_0x09b4('0x30')]=_[_0x09b4('0x2d')](_0x1941be[_0x09b4('0x2e')],qs[_0x09b4('0x2f')](_0x36e2a0[_0x09b4('0x2b')][_0x09b4('0x2f')]));_0x316def['attributes']=_0x316def[_0x09b4('0x30')]['length']?_0x316def['attributes']:_0x1941be[_0x09b4('0x2e')];if(_0x36e2a0[_0x09b4('0x2b')][_0x09b4('0x44')]){_0x316def[_0x09b4('0x45')]=[{'all':!![]}];}_0x316def=_['merge']({},_0x316def,_0x36e2a0[_0x09b4('0x3d')]);return db[_0x09b4('0x3e')][_0x09b4('0x46')](_0x316def)[_0x09b4('0x24')](handleEntityNotFound(_0x39920d,null))[_0x09b4('0x24')](respondWithResult(_0x39920d,null))[_0x09b4('0x41')](handleError(_0x39920d,null));};exports['create']=function(_0x57ac71,_0x186063){return db[_0x09b4('0x3e')][_0x09b4('0x47')](_0x57ac71[_0x09b4('0x48')],{})[_0x09b4('0x24')](respondWithResult(_0x186063,0xc9))[_0x09b4('0x41')](handleError(_0x186063,null));};exports[_0x09b4('0x23')]=function(_0x3194a7,_0x4e2d63){if(_0x3194a7[_0x09b4('0x48')]['id']){delete _0x3194a7['body']['id'];}return db[_0x09b4('0x3e')][_0x09b4('0x46')]({'where':{'id':_0x3194a7[_0x09b4('0x43')]['id']}})[_0x09b4('0x24')](handleEntityNotFound(_0x4e2d63,null))['then'](saveUpdates(_0x3194a7['body'],null))[_0x09b4('0x24')](respondWithResult(_0x4e2d63,null))[_0x09b4('0x41')](handleError(_0x4e2d63,null));};exports[_0x09b4('0x49')]=function(_0x289ebc,_0x4f1f3d){return db['AnalyticTreeReport']['find']({'where':{'id':_0x289ebc[_0x09b4('0x43')]['id']}})[_0x09b4('0x24')](handleEntityNotFound(_0x4f1f3d,null))[_0x09b4('0x24')](removeEntity(_0x4f1f3d,null))[_0x09b4('0x41')](handleError(_0x4f1f3d,null));};
\ No newline at end of file
+var _0x6302=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','set','json','apply','save','then','destroy','error','stack','name','status','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys'];(function(_0x4adb31,_0x26d680){var _0x5a1626=function(_0xfcd7ed){while(--_0xfcd7ed){_0x4adb31['push'](_0x4adb31['shift']());}};_0x5a1626(++_0x26d680);}(_0x6302,0x1dd));var _0x2630=function(_0x4b1765,_0x32c633){_0x4b1765=_0x4b1765-0x0;var _0x59e11b=_0x6302[_0x4b1765];return _0x59e11b;};'use strict';var pdf=require(_0x2630('0x0'));var emlformat=require(_0x2630('0x1'));var rimraf=require(_0x2630('0x2'));var zipdir=require(_0x2630('0x3'));var jsonpatch=require(_0x2630('0x4'));var rp=require(_0x2630('0x5'));var moment=require(_0x2630('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2630('0x7'));var path=require(_0x2630('0x8'));var sox=require(_0x2630('0x9'));var csv=require(_0x2630('0xa'));var ejs=require(_0x2630('0xb'));var fs=require('fs');var _=require(_0x2630('0xc'));var squel=require('squel');var crypto=require(_0x2630('0xd'));var jsforce=require(_0x2630('0xe'));var deskjs=require(_0x2630('0xf'));var toCsv=require(_0x2630('0xa'));var querystring=require('querystring');var Papa=require(_0x2630('0x10'));var Redis=require(_0x2630('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2630('0x12'));var as=require(_0x2630('0x13'));var hardwareService=require(_0x2630('0x14'));var logger=require(_0x2630('0x15'))('api');var utils=require(_0x2630('0x16'));var config=require(_0x2630('0x17'));var db=require(_0x2630('0x18'))['db'];function respondWithStatusCode(_0x345962,_0x154f78){_0x154f78=_0x154f78||0xcc;return function(_0x47e700){if(_0x47e700){return _0x345962[_0x2630('0x19')](_0x154f78);}return _0x345962['status'](_0x154f78)[_0x2630('0x1a')]();};}function respondWithResult(_0x2b0d93,_0x2616fd){_0x2616fd=_0x2616fd||0xc8;return function(_0xc1af33){if(_0xc1af33){return _0x2b0d93['status'](_0x2616fd)['json'](_0xc1af33);}};}function respondWithFilteredResult(_0x16c7cd,_0x44fd67){return function(_0x4f1d85){if(_0x4f1d85){var _0x5d63ff=_0x4f1d85[_0x2630('0x1b')],_0x588ed7=_0x44fd67['offset'],_0x5c92c4=_0x44fd67['offset']+_0x44fd67['limit'],_0x954eb5;if(_0x5c92c4>=_0x5d63ff){_0x5c92c4=_0x5d63ff;_0x954eb5=0xc8;}else{_0x954eb5=0xce;}_0x16c7cd['status'](_0x954eb5);return _0x16c7cd[_0x2630('0x1c')]('Content-Range',_0x588ed7+'-'+_0x5c92c4+'/'+_0x5d63ff)[_0x2630('0x1d')](_0x4f1d85);}return null;};}function patchUpdates(_0x44081f){return function(_0x36e03a){try{jsonpatch[_0x2630('0x1e')](_0x36e03a,_0x44081f,!![]);}catch(_0x1e312a){return BPromise['reject'](_0x1e312a);}return _0x36e03a[_0x2630('0x1f')]();};}function saveUpdates(_0x40eefe,_0x2f5095){return function(_0x28ca01){if(_0x28ca01){return _0x28ca01['update'](_0x40eefe)[_0x2630('0x20')](function(_0xd3ee1d){return _0xd3ee1d;});}return null;};}function removeEntity(_0x36cae3,_0x9c2a75){return function(_0x5967b7){if(_0x5967b7){return _0x5967b7[_0x2630('0x21')]()['then'](function(){_0x36cae3['status'](0xcc)[_0x2630('0x1a')]();});}};}function handleEntityNotFound(_0x160fbe,_0x19491a){return function(_0x477e6a){if(!_0x477e6a){_0x160fbe[_0x2630('0x19')](0x194);}return _0x477e6a;};}function handleError(_0x3f77b7,_0x2abf32){_0x2abf32=_0x2abf32||0x1f4;return function(_0x4e3a3e){logger[_0x2630('0x22')](_0x4e3a3e[_0x2630('0x23')]);if(_0x4e3a3e[_0x2630('0x24')]){delete _0x4e3a3e[_0x2630('0x24')];}_0x3f77b7[_0x2630('0x25')](_0x2abf32)[_0x2630('0x26')](_0x4e3a3e);};}exports[_0x2630('0x27')]=function(_0x1007a1,_0xc4a8b1){var _0x5862d6={},_0xf57393={},_0x30a6a6={'count':0x0,'rows':[]};var _0x55aabb=_[_0x2630('0x28')](db[_0x2630('0x29')][_0x2630('0x2a')],function(_0x572608){return{'name':_0x572608[_0x2630('0x2b')],'type':_0x572608[_0x2630('0x2c')][_0x2630('0x2d')]};});_0xf57393['model']=_['map'](_0x55aabb,_0x2630('0x24'));_0xf57393[_0x2630('0x2e')]=_[_0x2630('0x2f')](_0x1007a1['query']);_0xf57393[_0x2630('0x30')]=_[_0x2630('0x31')](_0xf57393[_0x2630('0x32')],_0xf57393['query']);_0x5862d6[_0x2630('0x33')]=_[_0x2630('0x31')](_0xf57393[_0x2630('0x32')],qs[_0x2630('0x34')](_0x1007a1[_0x2630('0x2e')][_0x2630('0x34')]));_0x5862d6[_0x2630('0x33')]=_0x5862d6[_0x2630('0x33')]['length']?_0x5862d6['attributes']:_0xf57393[_0x2630('0x32')];if(!_0x1007a1[_0x2630('0x2e')][_0x2630('0x35')](_0x2630('0x36'))){_0x5862d6[_0x2630('0x37')]=qs[_0x2630('0x37')](_0x1007a1[_0x2630('0x2e')][_0x2630('0x37')]);_0x5862d6[_0x2630('0x38')]=qs[_0x2630('0x38')](_0x1007a1[_0x2630('0x2e')][_0x2630('0x38')]);}_0x5862d6[_0x2630('0x39')]=qs['sort'](_0x1007a1[_0x2630('0x2e')][_0x2630('0x3a')]);_0x5862d6[_0x2630('0x3b')]=qs['filters'](_[_0x2630('0x3c')](_0x1007a1[_0x2630('0x2e')],_0xf57393[_0x2630('0x30')]));if(_0x1007a1[_0x2630('0x2e')]['filter']){_0x5862d6['where']=_[_0x2630('0x3d')](_0x5862d6[_0x2630('0x3b')],{'$or':_['map'](_0x55aabb,function(_0x95fed0){if(_0x95fed0['type'][_0x2630('0x2d')]!=='VIRTUAL'){var _0x27146c={};_0x27146c[_0x95fed0['field']]={'$like':'%'+_0x1007a1[_0x2630('0x2e')]['filter']+'%'};return _0x27146c;}})});}_0x5862d6=_[_0x2630('0x3d')]({},_0x5862d6,_0x1007a1[_0x2630('0x3e')]);var _0x52c5d9={'where':_0x5862d6[_0x2630('0x3b')]};return db['AnalyticTreeReport'][_0x2630('0x1b')](_0x52c5d9)['then'](function(_0x5ed9dc){_0x30a6a6['count']=_0x5ed9dc;if(_0x1007a1['query'][_0x2630('0x3f')]){_0x5862d6[_0x2630('0x40')]=[{'all':!![]}];}return db[_0x2630('0x29')][_0x2630('0x41')](_0x5862d6);})[_0x2630('0x20')](function(_0x4bb469){_0x30a6a6[_0x2630('0x42')]=_0x4bb469;return _0x30a6a6;})[_0x2630('0x20')](respondWithFilteredResult(_0xc4a8b1,_0x5862d6))[_0x2630('0x43')](handleError(_0xc4a8b1,null));};exports[_0x2630('0x44')]=function(_0x5a6b1e,_0x5157f5){var _0x4aa7ec={'raw':!![],'where':{'id':_0x5a6b1e[_0x2630('0x45')]['id']}},_0x3beadc={};_0x3beadc[_0x2630('0x32')]=_[_0x2630('0x2f')](db[_0x2630('0x29')][_0x2630('0x2a')]);_0x3beadc['query']=_[_0x2630('0x2f')](_0x5a6b1e[_0x2630('0x2e')]);_0x3beadc['filters']=_[_0x2630('0x31')](_0x3beadc['model'],_0x3beadc[_0x2630('0x2e')]);_0x4aa7ec[_0x2630('0x33')]=_[_0x2630('0x31')](_0x3beadc[_0x2630('0x32')],qs[_0x2630('0x34')](_0x5a6b1e[_0x2630('0x2e')][_0x2630('0x34')]));_0x4aa7ec[_0x2630('0x33')]=_0x4aa7ec[_0x2630('0x33')][_0x2630('0x46')]?_0x4aa7ec[_0x2630('0x33')]:_0x3beadc['model'];if(_0x5a6b1e[_0x2630('0x2e')][_0x2630('0x3f')]){_0x4aa7ec[_0x2630('0x40')]=[{'all':!![]}];}_0x4aa7ec=_[_0x2630('0x3d')]({},_0x4aa7ec,_0x5a6b1e[_0x2630('0x3e')]);return db[_0x2630('0x29')][_0x2630('0x47')](_0x4aa7ec)[_0x2630('0x20')](handleEntityNotFound(_0x5157f5,null))[_0x2630('0x20')](respondWithResult(_0x5157f5,null))[_0x2630('0x43')](handleError(_0x5157f5,null));};exports[_0x2630('0x48')]=function(_0xae8b4b,_0x9f2f3a){return db[_0x2630('0x29')]['create'](_0xae8b4b[_0x2630('0x49')],{})[_0x2630('0x20')](respondWithResult(_0x9f2f3a,0xc9))[_0x2630('0x43')](handleError(_0x9f2f3a,null));};exports[_0x2630('0x4a')]=function(_0x2569c2,_0x4e9be6){if(_0x2569c2[_0x2630('0x49')]['id']){delete _0x2569c2['body']['id'];}return db['AnalyticTreeReport'][_0x2630('0x47')]({'where':{'id':_0x2569c2[_0x2630('0x45')]['id']}})[_0x2630('0x20')](handleEntityNotFound(_0x4e9be6,null))['then'](saveUpdates(_0x2569c2[_0x2630('0x49')],null))[_0x2630('0x20')](respondWithResult(_0x4e9be6,null))['catch'](handleError(_0x4e9be6,null));};exports[_0x2630('0x21')]=function(_0x59df6f,_0x2d9a70){return db[_0x2630('0x29')]['find']({'where':{'id':_0x59df6f[_0x2630('0x45')]['id']}})[_0x2630('0x20')](handleEntityNotFound(_0x2d9a70,null))[_0x2630('0x20')](removeEntity(_0x2d9a70,null))['catch'](handleError(_0x2d9a70,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 7669d96..df92cfe 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 _0x8a9a=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x208442,_0x11d2ba){var _0xd24f10=function(_0x27a184){while(--_0x27a184){_0x208442['push'](_0x208442['shift']());}};_0xd24f10(++_0x11d2ba);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8a9a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var logger=require(_0xa8a9('0x1'))(_0xa8a9('0x2'));var moment=require(_0xa8a9('0x3'));var BPromise=require(_0xa8a9('0x4'));var rp=require(_0xa8a9('0x5'));var fs=require('fs');var path=require(_0xa8a9('0x6'));var rimraf=require(_0xa8a9('0x7'));var config=require(_0xa8a9('0x8'));var attributes=require(_0xa8a9('0x9'));module[_0xa8a9('0xa')]=function(_0x1de1c6,_0x4ac303){return _0x1de1c6[_0xa8a9('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xa8a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac6a=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x517bb2,_0x601ecb){var _0x479ff8=function(_0x216995){while(--_0x216995){_0x517bb2['push'](_0x517bb2['shift']());}};_0x479ff8(++_0x601ecb);}(_0xac6a,0xc2));var _0xaac6=function(_0x178a22,_0x2b6e80){_0x178a22=_0x178a22-0x0;var _0xc6e11e=_0xac6a[_0x178a22];return _0xc6e11e;};'use strict';var _=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var logger=require(_0xaac6('0x2'))(_0xaac6('0x3'));var moment=require(_0xaac6('0x4'));var BPromise=require('bluebird');var rp=require(_0xaac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaac6('0x6'));var config=require(_0xaac6('0x7'));var attributes=require(_0xaac6('0x8'));module[_0xaac6('0x9')]=function(_0xd8f178,_0x1cec82){return _0xd8f178[_0xaac6('0xa')](_0xaac6('0xb'),attributes,{'tableName':_0xaac6('0xc'),'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 348e682..7fbead1 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 _0x5030=['client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x153699,_0xa793f0){var _0x495a32=function(_0x5f04c6){while(--_0x5f04c6){_0x153699['push'](_0x153699['shift']());}};_0x495a32(++_0xa793f0);}(_0x5030,0x156));var _0x0503=function(_0x9ad1e1,_0x375db7){_0x9ad1e1=_0x9ad1e1-0x0;var _0x5da13d=_0x5030[_0x9ad1e1];return _0x5da13d;};'use strict';var _=require(_0x0503('0x0'));var util=require(_0x0503('0x1'));var moment=require(_0x0503('0x2'));var BPromise=require(_0x0503('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0503('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0503('0x5'));var logger=require(_0x0503('0x6'))(_0x0503('0x7'));var config=require(_0x0503('0x8'));var jayson=require(_0x0503('0x9'));var client=jayson[_0x0503('0xa')][_0x0503('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46243d,_0x5b91c7,_0x2423ac){return new BPromise(function(_0x1fa3c1,_0x25696d){return client[_0x0503('0xc')](_0x46243d,_0x2423ac)['then'](function(_0xd99dd4){logger[_0x0503('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5b91c7,'request\x20sent');logger['debug'](_0x0503('0xe'),_0x5b91c7,_0x0503('0xf'),JSON[_0x0503('0x10')](_0xd99dd4));if(_0xd99dd4['error']){if(_0xd99dd4[_0x0503('0x11')][_0x0503('0x12')]===0x1f4){logger['error'](_0x0503('0x13'),_0x5b91c7,_0xd99dd4[_0x0503('0x11')][_0x0503('0x14')]);return _0x25696d(_0xd99dd4[_0x0503('0x11')][_0x0503('0x14')]);}logger[_0x0503('0x11')](_0x0503('0x13'),_0x5b91c7,_0xd99dd4[_0x0503('0x11')][_0x0503('0x14')]);return _0x1fa3c1(_0xd99dd4[_0x0503('0x11')]['message']);}else{logger[_0x0503('0xd')](_0x0503('0x13'),_0x5b91c7,_0x0503('0xf'));_0x1fa3c1(_0xd99dd4[_0x0503('0x15')]['message']);}})['catch'](function(_0xe5af82){logger[_0x0503('0x11')](_0x0503('0x13'),_0x5b91c7,_0xe5af82);_0x25696d(_0xe5af82);});});}
\ No newline at end of file
+var _0xd9e4=['../../config/utils','rpc','jayson/promise','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9e4,0x174));var _0x4d9e=function(_0x495054,_0x304104){_0x495054=_0x495054-0x0;var _0x146d2e=_0xd9e4[_0x495054];return _0x146d2e;};'use strict';var _=require(_0x4d9e('0x0'));var util=require('util');var moment=require(_0x4d9e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d9e('0x2'));var logger=require('../../config/logger')(_0x4d9e('0x3'));var config=require('../../config/environment');var jayson=require(_0x4d9e('0x4'));var client=jayson['client'][_0x4d9e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x46c4e7,_0x2bf4ef,_0x5c0d8f){return new BPromise(function(_0x36bb68,_0x7e3794){return client[_0x4d9e('0x6')](_0x46c4e7,_0x5c0d8f)[_0x4d9e('0x7')](function(_0x555cbc){logger[_0x4d9e('0x8')](_0x4d9e('0x9'),_0x2bf4ef,'request\x20sent');logger[_0x4d9e('0xa')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x2bf4ef,_0x4d9e('0xb'),JSON[_0x4d9e('0xc')](_0x555cbc));if(_0x555cbc[_0x4d9e('0xd')]){if(_0x555cbc[_0x4d9e('0xd')]['code']===0x1f4){logger[_0x4d9e('0xd')](_0x4d9e('0x9'),_0x2bf4ef,_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);return _0x7e3794(_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);}logger['error'](_0x4d9e('0x9'),_0x2bf4ef,_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);return _0x36bb68(_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);}else{logger[_0x4d9e('0x8')](_0x4d9e('0x9'),_0x2bf4ef,_0x4d9e('0xb'));_0x36bb68(_0x555cbc[_0x4d9e('0xf')][_0x4d9e('0xe')]);}})[_0x4d9e('0x10')](function(_0xc03324){logger[_0x4d9e('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2bf4ef,_0xc03324);_0x7e3794(_0xc03324);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index bd05ad7..de5fec2 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 _0xc3e3=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xc3e3,0xea));var _0x3c3e=function(_0x1a0dcb,_0x36a473){_0x1a0dcb=_0x1a0dcb-0x0;var _0x1f8cec=_0xc3e3[_0x1a0dcb];return _0x1f8cec;};'use strict';var multer=require(_0x3c3e('0x0'));var util=require(_0x3c3e('0x1'));var path=require(_0x3c3e('0x2'));var timeout=require(_0x3c3e('0x3'));var express=require(_0x3c3e('0x4'));var router=express[_0x3c3e('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c3e('0x6'));var controller=require(_0x3c3e('0x7'));router[_0x3c3e('0x8')]('/',auth[_0x3c3e('0x9')](),controller[_0x3c3e('0xa')]);router[_0x3c3e('0x8')](_0x3c3e('0xb'),auth[_0x3c3e('0x9')](),controller['show']);router['post']('/',auth[_0x3c3e('0x9')](),controller[_0x3c3e('0xc')]);router['put'](_0x3c3e('0xb'),auth[_0x3c3e('0x9')](),controller[_0x3c3e('0xd')]);router[_0x3c3e('0xe')](_0x3c3e('0xb'),auth['isAuthenticated'](),controller[_0x3c3e('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xc2fc=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated'];(function(_0x311d76,_0x1b12e9){var _0x2dbddf=function(_0x5969a5){while(--_0x5969a5){_0x311d76['push'](_0x311d76['shift']());}};_0x2dbddf(++_0x1b12e9);}(_0xc2fc,0x1ed));var _0xcc2f=function(_0x3c4818,_0x4e3df6){_0x3c4818=_0x3c4818-0x0;var _0x23ef09=_0xc2fc[_0x3c4818];return _0x23ef09;};'use strict';var multer=require('multer');var util=require(_0xcc2f('0x0'));var path=require(_0xcc2f('0x1'));var timeout=require(_0xcc2f('0x2'));var express=require(_0xcc2f('0x3'));var router=express[_0xcc2f('0x4')]();var auth=require(_0xcc2f('0x5'));var interaction=require(_0xcc2f('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xcc2f('0x7')]('/',auth['isAuthenticated'](),controller[_0xcc2f('0x8')]);router[_0xcc2f('0x7')](_0xcc2f('0x9'),auth[_0xcc2f('0xa')](),controller['show']);router[_0xcc2f('0xb')]('/',auth['isAuthenticated'](),controller[_0xcc2f('0xc')]);router[_0xcc2f('0xd')](_0xcc2f('0x9'),auth[_0xcc2f('0xa')](),controller[_0xcc2f('0xe')]);router[_0xcc2f('0xf')](_0xcc2f('0x9'),auth['isAuthenticated'](),controller[_0xcc2f('0x10')]);module[_0xcc2f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index cbe18ac..b9c67e0 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 _0x020c=['exports','STRING'];(function(_0x4611bb,_0x16f2a7){var _0x4ab34a=function(_0x2f28c6){while(--_0x2f28c6){_0x4611bb['push'](_0x4611bb['shift']());}};_0x4ab34a(++_0x16f2a7);}(_0x020c,0x92));var _0xc020=function(_0x1f4742,_0x339395){_0x1f4742=_0x1f4742-0x0;var _0x123cb6=_0x020c[_0x1f4742];return _0x123cb6;};'use strict';var Sequelize=require('sequelize');module[_0xc020('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc020('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6a70=['STRING','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x6a70,0x77));var _0x06a7=function(_0x18b195,_0x5d1e77){_0x18b195=_0x18b195-0x0;var _0x424153=_0x6a70[_0x18b195];return _0x424153;};'use strict';var Sequelize=require('sequelize');module[_0x06a7('0x0')]={'name':{'type':Sequelize[_0x06a7('0x1')]},'basename':{'type':Sequelize[_0x06a7('0x1')]},'type':{'type':Sequelize[_0x06a7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9a2ebb6..4ceaa22 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 _0x7868=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','field','merge','options','count','includeAll','findAll','catch','rawAttributes','include','body','find','create','file','basename','filename','findOne','params','download','join','root','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','end','offset','limit','status','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','Attachment'];(function(_0x319855,_0x55a20d){var _0xfb7f50=function(_0x391c7f){while(--_0x391c7f){_0x319855['push'](_0x319855['shift']());}};_0xfb7f50(++_0x55a20d);}(_0x7868,0x73));var _0x8786=function(_0x5949e5,_0x374ec8){_0x5949e5=_0x5949e5-0x0;var _0x3b0773=_0x7868[_0x5949e5];return _0x3b0773;};'use strict';var pdf=require(_0x8786('0x0'));var emlformat=require(_0x8786('0x1'));var rimraf=require(_0x8786('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8786('0x3'));var rp=require(_0x8786('0x4'));var moment=require(_0x8786('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8786('0x6'));var util=require(_0x8786('0x7'));var path=require(_0x8786('0x8'));var sox=require(_0x8786('0x9'));var csv=require('to-csv');var ejs=require(_0x8786('0xa'));var fs=require('fs');var _=require(_0x8786('0xb'));var squel=require('squel');var crypto=require(_0x8786('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8786('0xd'));var querystring=require(_0x8786('0xe'));var Papa=require(_0x8786('0xf'));var Redis=require(_0x8786('0x10'));var authService=require(_0x8786('0x11'));var qs=require(_0x8786('0x12'));var as=require(_0x8786('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8786('0x14'))(_0x8786('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8786('0x16'))['db'];function respondWithStatusCode(_0x207e46,_0x2653a2){_0x2653a2=_0x2653a2||0xcc;return function(_0x52c2ac){if(_0x52c2ac){return _0x207e46['sendStatus'](_0x2653a2);}return _0x207e46['status'](_0x2653a2)[_0x8786('0x17')]();};}function respondWithResult(_0xe3ab90,_0x19bdda){_0x19bdda=_0x19bdda||0xc8;return function(_0x27a721){if(_0x27a721){return _0xe3ab90['status'](_0x19bdda)['json'](_0x27a721);}};}function respondWithFilteredResult(_0x557564,_0x1034cb){return function(_0x531b82){if(_0x531b82){var _0x36512d=_0x531b82['count'],_0x200d65=_0x1034cb[_0x8786('0x18')],_0x17a7e1=_0x1034cb[_0x8786('0x18')]+_0x1034cb[_0x8786('0x19')],_0x4e918d;if(_0x17a7e1>=_0x36512d){_0x17a7e1=_0x36512d;_0x4e918d=0xc8;}else{_0x4e918d=0xce;}_0x557564[_0x8786('0x1a')](_0x4e918d);return _0x557564['set']('Content-Range',_0x200d65+'-'+_0x17a7e1+'/'+_0x36512d)['json'](_0x531b82);}return null;};}function patchUpdates(_0x10f586){return function(_0x7a9b98){try{jsonpatch[_0x8786('0x1b')](_0x7a9b98,_0x10f586,!![]);}catch(_0x1a0527){return BPromise[_0x8786('0x1c')](_0x1a0527);}return _0x7a9b98[_0x8786('0x1d')]();};}function saveUpdates(_0x16c669,_0x452082){return function(_0x2217ff){if(_0x2217ff){return _0x2217ff[_0x8786('0x1e')](_0x16c669)[_0x8786('0x1f')](function(_0x5038b8){return _0x5038b8;});}return null;};}function removeEntity(_0x460621,_0x5abf5e){return function(_0xe98484){if(_0xe98484){return _0xe98484[_0x8786('0x20')]()[_0x8786('0x1f')](function(){_0x460621['status'](0xcc)[_0x8786('0x17')]();});}};}function handleEntityNotFound(_0x11af8a,_0x4ddc4f){return function(_0x57d25a){if(!_0x57d25a){_0x11af8a[_0x8786('0x21')](0x194);}return _0x57d25a;};}function handleError(_0x43bdf8,_0x34b5f1){_0x34b5f1=_0x34b5f1||0x1f4;return function(_0x16c8c2){logger[_0x8786('0x22')](_0x16c8c2['stack']);if(_0x16c8c2[_0x8786('0x23')]){delete _0x16c8c2[_0x8786('0x23')];}_0x43bdf8['status'](_0x34b5f1)['send'](_0x16c8c2);};}exports[_0x8786('0x24')]=function(_0x7c9da3,_0x11e273){var _0x3ad8fd={},_0x441af9={},_0x4ce909={'count':0x0,'rows':[]};var _0x455229=_[_0x8786('0x25')](db[_0x8786('0x26')]['rawAttributes'],function(_0x34432c){return{'name':_0x34432c['fieldName'],'type':_0x34432c[_0x8786('0x27')][_0x8786('0x28')]};});_0x441af9[_0x8786('0x29')]=_[_0x8786('0x25')](_0x455229,_0x8786('0x23'));_0x441af9[_0x8786('0x2a')]=_[_0x8786('0x2b')](_0x7c9da3[_0x8786('0x2a')]);_0x441af9[_0x8786('0x2c')]=_[_0x8786('0x2d')](_0x441af9['model'],_0x441af9[_0x8786('0x2a')]);_0x3ad8fd[_0x8786('0x2e')]=_['intersection'](_0x441af9[_0x8786('0x29')],qs[_0x8786('0x2f')](_0x7c9da3[_0x8786('0x2a')][_0x8786('0x2f')]));_0x3ad8fd[_0x8786('0x2e')]=_0x3ad8fd[_0x8786('0x2e')][_0x8786('0x30')]?_0x3ad8fd[_0x8786('0x2e')]:_0x441af9[_0x8786('0x29')];if(!_0x7c9da3[_0x8786('0x2a')][_0x8786('0x31')](_0x8786('0x32'))){_0x3ad8fd[_0x8786('0x19')]=qs[_0x8786('0x19')](_0x7c9da3[_0x8786('0x2a')][_0x8786('0x19')]);_0x3ad8fd[_0x8786('0x18')]=qs['offset'](_0x7c9da3[_0x8786('0x2a')][_0x8786('0x18')]);}_0x3ad8fd[_0x8786('0x33')]=qs[_0x8786('0x34')](_0x7c9da3['query']['sort']);_0x3ad8fd[_0x8786('0x35')]=qs[_0x8786('0x2c')](_[_0x8786('0x36')](_0x7c9da3[_0x8786('0x2a')],_0x441af9[_0x8786('0x2c')]));if(_0x7c9da3[_0x8786('0x2a')][_0x8786('0x37')]){_0x3ad8fd[_0x8786('0x35')]=_['merge'](_0x3ad8fd[_0x8786('0x35')],{'$or':_[_0x8786('0x25')](_0x455229,function(_0x461a84){if(_0x461a84[_0x8786('0x27')][_0x8786('0x28')]!==_0x8786('0x38')){var _0x394285={};_0x394285[_0x461a84[_0x8786('0x39')]]={'$like':'%'+_0x7c9da3[_0x8786('0x2a')]['filter']+'%'};return _0x394285;}})});}_0x3ad8fd=_[_0x8786('0x3a')]({},_0x3ad8fd,_0x7c9da3[_0x8786('0x3b')]);var _0x523938={'where':_0x3ad8fd[_0x8786('0x35')]};return db[_0x8786('0x26')][_0x8786('0x3c')](_0x523938)[_0x8786('0x1f')](function(_0x1fad9e){_0x4ce909['count']=_0x1fad9e;if(_0x7c9da3[_0x8786('0x2a')][_0x8786('0x3d')]){_0x3ad8fd['include']=[{'all':!![]}];}return db[_0x8786('0x26')][_0x8786('0x3e')](_0x3ad8fd);})[_0x8786('0x1f')](function(_0x26fd67){_0x4ce909['rows']=_0x26fd67;return _0x4ce909;})[_0x8786('0x1f')](respondWithFilteredResult(_0x11e273,_0x3ad8fd))[_0x8786('0x3f')](handleError(_0x11e273,null));};exports['show']=function(_0x4c1f6a,_0x4f06f7){var _0x30af91={'raw':!![],'where':{'id':_0x4c1f6a['params']['id']}},_0xe0647c={};_0xe0647c[_0x8786('0x29')]=_[_0x8786('0x2b')](db[_0x8786('0x26')][_0x8786('0x40')]);_0xe0647c['query']=_[_0x8786('0x2b')](_0x4c1f6a[_0x8786('0x2a')]);_0xe0647c['filters']=_[_0x8786('0x2d')](_0xe0647c[_0x8786('0x29')],_0xe0647c[_0x8786('0x2a')]);_0x30af91[_0x8786('0x2e')]=_[_0x8786('0x2d')](_0xe0647c['model'],qs[_0x8786('0x2f')](_0x4c1f6a[_0x8786('0x2a')]['fields']));_0x30af91['attributes']=_0x30af91[_0x8786('0x2e')][_0x8786('0x30')]?_0x30af91['attributes']:_0xe0647c[_0x8786('0x29')];if(_0x4c1f6a[_0x8786('0x2a')][_0x8786('0x3d')]){_0x30af91[_0x8786('0x41')]=[{'all':!![]}];}_0x30af91=_[_0x8786('0x3a')]({},_0x30af91,_0x4c1f6a[_0x8786('0x3b')]);return db[_0x8786('0x26')]['find'](_0x30af91)[_0x8786('0x1f')](handleEntityNotFound(_0x4f06f7,null))[_0x8786('0x1f')](respondWithResult(_0x4f06f7,null))[_0x8786('0x3f')](handleError(_0x4f06f7,null));};exports['update']=function(_0x32c2cc,_0x58f4a7){if(_0x32c2cc[_0x8786('0x42')]['id']){delete _0x32c2cc[_0x8786('0x42')]['id'];}return db[_0x8786('0x26')][_0x8786('0x43')]({'where':{'id':_0x32c2cc['params']['id']}})[_0x8786('0x1f')](handleEntityNotFound(_0x58f4a7,null))[_0x8786('0x1f')](saveUpdates(_0x32c2cc['body'],null))['then'](respondWithResult(_0x58f4a7,null))[_0x8786('0x3f')](handleError(_0x58f4a7,null));};exports['destroy']=function(_0x547217,_0x27e83f){return db[_0x8786('0x26')]['find']({'where':{'id':_0x547217['params']['id']}})[_0x8786('0x1f')](handleEntityNotFound(_0x27e83f,null))[_0x8786('0x1f')](removeEntity(_0x27e83f,null))[_0x8786('0x3f')](handleError(_0x27e83f,null));};exports[_0x8786('0x44')]=function(_0x2fa7ff,_0xdd2fa7,_0x32d8f8){_0x2fa7ff[_0x8786('0x42')][_0x8786('0x23')]=_0x2fa7ff[_0x8786('0x45')]['originalname'];_0x2fa7ff[_0x8786('0x42')][_0x8786('0x46')]=_0x2fa7ff[_0x8786('0x45')][_0x8786('0x47')];_0x2fa7ff['body']['type']=_0x2fa7ff['file']['mimetype'];return db['Attachment'][_0x8786('0x44')](_0x2fa7ff[_0x8786('0x42')])[_0x8786('0x1f')](respondWithResult(_0xdd2fa7,0xc9))[_0x8786('0x3f')](handleError(_0xdd2fa7,null));};exports['download']=function(_0x107fc8,_0x5ae58b,_0x3caa17){return db[_0x8786('0x26')][_0x8786('0x48')]({'where':{'id':_0x107fc8[_0x8786('0x49')]['id']},'raw':!![]})[_0x8786('0x1f')](handleEntityNotFound(_0x5ae58b,null))[_0x8786('0x1f')](function(_0x1fcbca){if(_0x1fcbca){return _0x5ae58b[_0x8786('0x4a')](path[_0x8786('0x4b')](config[_0x8786('0x4c')],'server/files/attachments/',_0x1fcbca[_0x8786('0x46')]));}})[_0x8786('0x3f')](handleError(_0x5ae58b,null));};
\ No newline at end of file
+var _0xbb38=['update','body','params','create','file','originalname','basename','filename','mimetype','findOne','download','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','map','Attachment','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch'];(function(_0x1264b2,_0x266843){var _0x41cfef=function(_0x2f53b8){while(--_0x2f53b8){_0x1264b2['push'](_0x1264b2['shift']());}};_0x41cfef(++_0x266843);}(_0xbb38,0x1f4));var _0x8bb3=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xbb38[_0x28578d];return _0x524826;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8bb3('0x0'));var rimraf=require(_0x8bb3('0x1'));var zipdir=require(_0x8bb3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bb3('0x3'));var moment=require('moment');var BPromise=require(_0x8bb3('0x4'));var Mustache=require(_0x8bb3('0x5'));var util=require(_0x8bb3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8bb3('0x7'));var ejs=require(_0x8bb3('0x8'));var fs=require('fs');var _=require(_0x8bb3('0x9'));var squel=require('squel');var crypto=require(_0x8bb3('0xa'));var jsforce=require(_0x8bb3('0xb'));var deskjs=require(_0x8bb3('0xc'));var toCsv=require(_0x8bb3('0x7'));var querystring=require(_0x8bb3('0xd'));var Papa=require(_0x8bb3('0xe'));var Redis=require('ioredis');var authService=require(_0x8bb3('0xf'));var qs=require(_0x8bb3('0x10'));var as=require(_0x8bb3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bb3('0x12'))(_0x8bb3('0x13'));var utils=require('../../config/utils');var config=require(_0x8bb3('0x14'));var db=require(_0x8bb3('0x15'))['db'];function respondWithStatusCode(_0x3ea049,_0x3d138a){_0x3d138a=_0x3d138a||0xcc;return function(_0x46be4f){if(_0x46be4f){return _0x3ea049['sendStatus'](_0x3d138a);}return _0x3ea049[_0x8bb3('0x16')](_0x3d138a)[_0x8bb3('0x17')]();};}function respondWithResult(_0x221cec,_0xd09b84){_0xd09b84=_0xd09b84||0xc8;return function(_0x31da9f){if(_0x31da9f){return _0x221cec[_0x8bb3('0x16')](_0xd09b84)[_0x8bb3('0x18')](_0x31da9f);}};}function respondWithFilteredResult(_0x12184e,_0x2167e4){return function(_0xfa8bf6){if(_0xfa8bf6){var _0x166927=_0xfa8bf6[_0x8bb3('0x19')],_0x258905=_0x2167e4[_0x8bb3('0x1a')],_0x159dbb=_0x2167e4['offset']+_0x2167e4[_0x8bb3('0x1b')],_0x7e0168;if(_0x159dbb>=_0x166927){_0x159dbb=_0x166927;_0x7e0168=0xc8;}else{_0x7e0168=0xce;}_0x12184e[_0x8bb3('0x16')](_0x7e0168);return _0x12184e[_0x8bb3('0x1c')](_0x8bb3('0x1d'),_0x258905+'-'+_0x159dbb+'/'+_0x166927)['json'](_0xfa8bf6);}return null;};}function patchUpdates(_0x446ea2){return function(_0x45179a){try{jsonpatch[_0x8bb3('0x1e')](_0x45179a,_0x446ea2,!![]);}catch(_0x48e49b){return BPromise['reject'](_0x48e49b);}return _0x45179a[_0x8bb3('0x1f')]();};}function saveUpdates(_0xf27c06,_0x2acc72){return function(_0x590dce){if(_0x590dce){return _0x590dce['update'](_0xf27c06)[_0x8bb3('0x20')](function(_0x272934){return _0x272934;});}return null;};}function removeEntity(_0x77c804,_0x1e396a){return function(_0x13c2f8){if(_0x13c2f8){return _0x13c2f8[_0x8bb3('0x21')]()['then'](function(){_0x77c804['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4422,_0x124349){return function(_0x23b0f8){if(!_0x23b0f8){_0x1a4422[_0x8bb3('0x22')](0x194);}return _0x23b0f8;};}function handleError(_0x578ef8,_0x5832b4){_0x5832b4=_0x5832b4||0x1f4;return function(_0x25385c){logger['error'](_0x25385c[_0x8bb3('0x23')]);if(_0x25385c[_0x8bb3('0x24')]){delete _0x25385c[_0x8bb3('0x24')];}_0x578ef8['status'](_0x5832b4)['send'](_0x25385c);};}exports['index']=function(_0x1f435b,_0x1b927d){var _0xbc346c={},_0x1c34ac={},_0x5a94cb={'count':0x0,'rows':[]};var _0x1144e8=_[_0x8bb3('0x25')](db[_0x8bb3('0x26')]['rawAttributes'],function(_0x40628d){return{'name':_0x40628d['fieldName'],'type':_0x40628d[_0x8bb3('0x27')][_0x8bb3('0x28')]};});_0x1c34ac[_0x8bb3('0x29')]=_[_0x8bb3('0x25')](_0x1144e8,_0x8bb3('0x24'));_0x1c34ac[_0x8bb3('0x2a')]=_[_0x8bb3('0x2b')](_0x1f435b[_0x8bb3('0x2a')]);_0x1c34ac[_0x8bb3('0x2c')]=_[_0x8bb3('0x2d')](_0x1c34ac[_0x8bb3('0x29')],_0x1c34ac[_0x8bb3('0x2a')]);_0xbc346c[_0x8bb3('0x2e')]=_['intersection'](_0x1c34ac[_0x8bb3('0x29')],qs[_0x8bb3('0x2f')](_0x1f435b[_0x8bb3('0x2a')]['fields']));_0xbc346c[_0x8bb3('0x2e')]=_0xbc346c[_0x8bb3('0x2e')][_0x8bb3('0x30')]?_0xbc346c[_0x8bb3('0x2e')]:_0x1c34ac[_0x8bb3('0x29')];if(!_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x31')](_0x8bb3('0x32'))){_0xbc346c['limit']=qs['limit'](_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x1b')]);_0xbc346c['offset']=qs[_0x8bb3('0x1a')](_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x1a')]);}_0xbc346c[_0x8bb3('0x33')]=qs[_0x8bb3('0x34')](_0x1f435b['query'][_0x8bb3('0x34')]);_0xbc346c[_0x8bb3('0x35')]=qs['filters'](_['pick'](_0x1f435b[_0x8bb3('0x2a')],_0x1c34ac['filters']));if(_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x36')]){_0xbc346c[_0x8bb3('0x35')]=_[_0x8bb3('0x37')](_0xbc346c[_0x8bb3('0x35')],{'$or':_['map'](_0x1144e8,function(_0x2fbfcd){if(_0x2fbfcd[_0x8bb3('0x27')]['key']!==_0x8bb3('0x38')){var _0x3d4b8f={};_0x3d4b8f[_0x2fbfcd[_0x8bb3('0x39')]]={'$like':'%'+_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x36')]+'%'};return _0x3d4b8f;}})});}_0xbc346c=_[_0x8bb3('0x37')]({},_0xbc346c,_0x1f435b[_0x8bb3('0x3a')]);var _0x18427c={'where':_0xbc346c[_0x8bb3('0x35')]};return db[_0x8bb3('0x26')][_0x8bb3('0x19')](_0x18427c)[_0x8bb3('0x20')](function(_0x334fef){_0x5a94cb[_0x8bb3('0x19')]=_0x334fef;if(_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x3b')]){_0xbc346c['include']=[{'all':!![]}];}return db[_0x8bb3('0x26')][_0x8bb3('0x3c')](_0xbc346c);})[_0x8bb3('0x20')](function(_0x55e029){_0x5a94cb[_0x8bb3('0x3d')]=_0x55e029;return _0x5a94cb;})[_0x8bb3('0x20')](respondWithFilteredResult(_0x1b927d,_0xbc346c))['catch'](handleError(_0x1b927d,null));};exports[_0x8bb3('0x3e')]=function(_0x211d7f,_0x4c9862){var _0x40320e={'raw':!![],'where':{'id':_0x211d7f['params']['id']}},_0x4db7e1={};_0x4db7e1[_0x8bb3('0x29')]=_['keys'](db['Attachment'][_0x8bb3('0x3f')]);_0x4db7e1['query']=_[_0x8bb3('0x2b')](_0x211d7f[_0x8bb3('0x2a')]);_0x4db7e1[_0x8bb3('0x2c')]=_[_0x8bb3('0x2d')](_0x4db7e1['model'],_0x4db7e1[_0x8bb3('0x2a')]);_0x40320e['attributes']=_[_0x8bb3('0x2d')](_0x4db7e1[_0x8bb3('0x29')],qs['fields'](_0x211d7f['query'][_0x8bb3('0x2f')]));_0x40320e[_0x8bb3('0x2e')]=_0x40320e['attributes'][_0x8bb3('0x30')]?_0x40320e['attributes']:_0x4db7e1['model'];if(_0x211d7f[_0x8bb3('0x2a')][_0x8bb3('0x3b')]){_0x40320e[_0x8bb3('0x40')]=[{'all':!![]}];}_0x40320e=_[_0x8bb3('0x37')]({},_0x40320e,_0x211d7f['options']);return db[_0x8bb3('0x26')][_0x8bb3('0x41')](_0x40320e)['then'](handleEntityNotFound(_0x4c9862,null))[_0x8bb3('0x20')](respondWithResult(_0x4c9862,null))[_0x8bb3('0x42')](handleError(_0x4c9862,null));};exports[_0x8bb3('0x43')]=function(_0x3b4480,_0x4dd191){if(_0x3b4480[_0x8bb3('0x44')]['id']){delete _0x3b4480[_0x8bb3('0x44')]['id'];}return db['Attachment'][_0x8bb3('0x41')]({'where':{'id':_0x3b4480['params']['id']}})['then'](handleEntityNotFound(_0x4dd191,null))['then'](saveUpdates(_0x3b4480['body'],null))[_0x8bb3('0x20')](respondWithResult(_0x4dd191,null))[_0x8bb3('0x42')](handleError(_0x4dd191,null));};exports[_0x8bb3('0x21')]=function(_0x26e608,_0x3c6736){return db[_0x8bb3('0x26')][_0x8bb3('0x41')]({'where':{'id':_0x26e608[_0x8bb3('0x45')]['id']}})[_0x8bb3('0x20')](handleEntityNotFound(_0x3c6736,null))[_0x8bb3('0x20')](removeEntity(_0x3c6736,null))[_0x8bb3('0x42')](handleError(_0x3c6736,null));};exports[_0x8bb3('0x46')]=function(_0x47fba7,_0x7260ee,_0x2a4aae){_0x47fba7[_0x8bb3('0x44')][_0x8bb3('0x24')]=_0x47fba7[_0x8bb3('0x47')][_0x8bb3('0x48')];_0x47fba7[_0x8bb3('0x44')][_0x8bb3('0x49')]=_0x47fba7[_0x8bb3('0x47')][_0x8bb3('0x4a')];_0x47fba7[_0x8bb3('0x44')]['type']=_0x47fba7['file'][_0x8bb3('0x4b')];return db[_0x8bb3('0x26')][_0x8bb3('0x46')](_0x47fba7['body'])[_0x8bb3('0x20')](respondWithResult(_0x7260ee,0xc9))[_0x8bb3('0x42')](handleError(_0x7260ee,null));};exports['download']=function(_0x53d477,_0x3177a8,_0x39f550){return db['Attachment'][_0x8bb3('0x4c')]({'where':{'id':_0x53d477[_0x8bb3('0x45')]['id']},'raw':!![]})[_0x8bb3('0x20')](handleEntityNotFound(_0x3177a8,null))['then'](function(_0x9ed24c){if(_0x9ed24c){return _0x3177a8[_0x8bb3('0x4d')](path[_0x8bb3('0x4e')](config[_0x8bb3('0x4f')],_0x8bb3('0x50'),_0x9ed24c[_0x8bb3('0x49')]));}})['catch'](handleError(_0x3177a8,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 983547b..e95b497 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 _0x5942=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x3e1f9c,_0x10c56a){var _0x1e43fa=function(_0x24277b){while(--_0x24277b){_0x3e1f9c['push'](_0x3e1f9c['shift']());}};_0x1e43fa(++_0x10c56a);}(_0x5942,0x16a));var _0x2594=function(_0x2d48dd,_0x556d46){_0x2d48dd=_0x2d48dd-0x0;var _0x78e247=_0x5942[_0x2d48dd];return _0x78e247;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var logger=require(_0x2594('0x2'))(_0x2594('0x3'));var moment=require(_0x2594('0x4'));var BPromise=require(_0x2594('0x5'));var rp=require(_0x2594('0x6'));var fs=require('fs');var path=require(_0x2594('0x7'));var rimraf=require(_0x2594('0x8'));var config=require(_0x2594('0x9'));var attributes=require(_0x2594('0xa'));module[_0x2594('0xb')]=function(_0x495540,_0x59f01a){return _0x495540[_0x2594('0xc')](_0x2594('0xd'),attributes,{'tableName':_0x2594('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0490=['exports','define','attachments','util','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x3f5925,_0x19c37c){var _0x4dd3c4=function(_0x251720){while(--_0x251720){_0x3f5925['push'](_0x3f5925['shift']());}};_0x4dd3c4(++_0x19c37c);}(_0x0490,0x147));var _0x0049=function(_0x3c4e42,_0x4df3e8){_0x3c4e42=_0x3c4e42-0x0;var _0x7378e0=_0x0490[_0x3c4e42];return _0x7378e0;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0049('0x1'));var fs=require('fs');var path=require(_0x0049('0x2'));var rimraf=require(_0x0049('0x3'));var config=require(_0x0049('0x4'));var attributes=require(_0x0049('0x5'));module[_0x0049('0x6')]=function(_0x2957b6,_0x4dde1){return _0x2957b6[_0x0049('0x7')]('Attachment',attributes,{'tableName':_0x0049('0x8'),'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 fc8cc58..2c99943 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 _0x4325=['CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x184604,_0x5ed3c0){var _0x5d7735=function(_0x103f03){while(--_0x103f03){_0x184604['push'](_0x184604['shift']());}};_0x5d7735(++_0x5ed3c0);}(_0x4325,0xb9));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require(_0x5432('0x2'));var BPromise=require(_0x5432('0x3'));var rs=require(_0x5432('0x4'));var fs=require('fs');var Redis=require(_0x5432('0x5'));var db=require(_0x5432('0x6'))['db'];var utils=require(_0x5432('0x7'));var logger=require(_0x5432('0x8'))('rpc');var config=require(_0x5432('0x9'));var jayson=require(_0x5432('0xa'));var client=jayson[_0x5432('0xb')][_0x5432('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc33013,_0x1dfa92,_0x177b6d){return new BPromise(function(_0xc30f9,_0x2ceb5c){return client[_0x5432('0xd')](_0xc33013,_0x177b6d)[_0x5432('0xe')](function(_0x3a18d4){logger[_0x5432('0xf')](_0x5432('0x10'),_0x1dfa92,_0x5432('0x11'));logger[_0x5432('0x12')](_0x5432('0x13'),_0x1dfa92,_0x5432('0x11'),JSON[_0x5432('0x14')](_0x3a18d4));if(_0x3a18d4[_0x5432('0x15')]){if(_0x3a18d4[_0x5432('0x15')]['code']===0x1f4){logger[_0x5432('0x15')](_0x5432('0x10'),_0x1dfa92,_0x3a18d4[_0x5432('0x15')]['message']);return _0x2ceb5c(_0x3a18d4[_0x5432('0x15')]['message']);}logger[_0x5432('0x15')](_0x5432('0x10'),_0x1dfa92,_0x3a18d4[_0x5432('0x15')][_0x5432('0x16')]);return _0xc30f9(_0x3a18d4[_0x5432('0x15')][_0x5432('0x16')]);}else{logger[_0x5432('0xf')]('Attachment,\x20%s,\x20%s',_0x1dfa92,_0x5432('0x11'));_0xc30f9(_0x3a18d4[_0x5432('0x17')][_0x5432('0x16')]);}})[_0x5432('0x18')](function(_0xb5b9d){logger[_0x5432('0x15')](_0x5432('0x10'),_0x1dfa92,_0xb5b9d);_0x2ceb5c(_0xb5b9d);});});}exports[_0x5432('0x19')]=function(_0x2e83c4){var _0x5208ef=this;return new Promise(function(_0xf9f178,_0x12c31e){return db[_0x5432('0x1a')][_0x5432('0x1b')](_0x2e83c4['body'],{'raw':_0x2e83c4[_0x5432('0x1c')]?_0x2e83c4[_0x5432('0x1c')][_0x5432('0x1d')]===undefined?!![]:![]:!![]})[_0x5432('0xe')](function(_0x48bf24){logger[_0x5432('0xf')](_0x5432('0x19'),_0x2e83c4);logger[_0x5432('0x12')](_0x5432('0x19'),_0x2e83c4,JSON[_0x5432('0x14')](_0x48bf24));_0xf9f178(_0x48bf24);})['catch'](function(_0x3b44d3){logger[_0x5432('0x15')](_0x5432('0x19'),_0x3b44d3['message'],_0x2e83c4);_0x12c31e(_0x5208ef[_0x5432('0x15')](0x1f4,_0x3b44d3[_0x5432('0x16')]));});});};
\ No newline at end of file
+var _0xc047=['moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','Attachment,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateAttachment','Attachment','create','body','options','raw','then','debug','stringify'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xc047,0x8a));var _0x7c04=function(_0x590782,_0x555134){_0x590782=_0x590782-0x0;var _0x4dfa84=_0xc047[_0x590782];return _0x4dfa84;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c04('0x0'));var BPromise=require(_0x7c04('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c04('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c04('0x3'));var logger=require('../../config/logger')(_0x7c04('0x4'));var config=require('../../config/environment');var jayson=require(_0x7c04('0x5'));var client=jayson['client'][_0x7c04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x380999,_0x4d2157,_0x2605a5){return new BPromise(function(_0x2e3a41,_0x3f57b8){return client[_0x7c04('0x7')](_0x380999,_0x2605a5)['then'](function(_0x6330bc){logger['info'](_0x7c04('0x8'),_0x4d2157,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x4d2157,_0x7c04('0x9'),JSON['stringify'](_0x6330bc));if(_0x6330bc[_0x7c04('0xa')]){if(_0x6330bc[_0x7c04('0xa')]['code']===0x1f4){logger['error'](_0x7c04('0x8'),_0x4d2157,_0x6330bc[_0x7c04('0xa')]['message']);return _0x3f57b8(_0x6330bc[_0x7c04('0xa')][_0x7c04('0xb')]);}logger[_0x7c04('0xa')](_0x7c04('0x8'),_0x4d2157,_0x6330bc[_0x7c04('0xa')][_0x7c04('0xb')]);return _0x2e3a41(_0x6330bc[_0x7c04('0xa')][_0x7c04('0xb')]);}else{logger[_0x7c04('0xc')](_0x7c04('0x8'),_0x4d2157,_0x7c04('0x9'));_0x2e3a41(_0x6330bc['result']['message']);}})[_0x7c04('0xd')](function(_0x50af04){logger['error'](_0x7c04('0x8'),_0x4d2157,_0x50af04);_0x3f57b8(_0x50af04);});});}exports[_0x7c04('0xe')]=function(_0x4e238c){var _0x40dfda=this;return new Promise(function(_0x5d6da9,_0x38525f){return db[_0x7c04('0xf')][_0x7c04('0x10')](_0x4e238c[_0x7c04('0x11')],{'raw':_0x4e238c[_0x7c04('0x12')]?_0x4e238c['options'][_0x7c04('0x13')]===undefined?!![]:![]:!![]})[_0x7c04('0x14')](function(_0x2ba11b){logger[_0x7c04('0xc')]('CreateAttachment',_0x4e238c);logger[_0x7c04('0x15')](_0x7c04('0xe'),_0x4e238c,JSON[_0x7c04('0x16')](_0x2ba11b));_0x5d6da9(_0x2ba11b);})[_0x7c04('0xd')](function(_0x4fca21){logger['error'](_0x7c04('0xe'),_0x4fca21[_0x7c04('0xb')],_0x4e238c);_0x38525f(_0x40dfda[_0x7c04('0xa')](0x1f4,_0x4fca21[_0x7c04('0xb')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index d788f1c..8df6f8e 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 _0x20b3=['download','join','%s-%s','originalname','replace','post','single','file','create','put','update','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','/:id/download'];(function(_0x24bace,_0x58da0f){var _0x3134cd=function(_0x1957eb){while(--_0x1957eb){_0x24bace['push'](_0x24bace['shift']());}};_0x3134cd(++_0x58da0f);}(_0x20b3,0x85));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x320b('0x0'));var timeout=require(_0x320b('0x1'));var express=require(_0x320b('0x2'));var router=express['Router']();var auth=require(_0x320b('0x3'));var interaction=require(_0x320b('0x4'));var config=require(_0x320b('0x5'));var controller=require('./attachment.controller');router['get']('/',auth[_0x320b('0x6')](),controller[_0x320b('0x7')]);router['get'](_0x320b('0x8'),auth[_0x320b('0x6')](),controller['show']);router[_0x320b('0x9')](_0x320b('0xa'),auth[_0x320b('0x6')](),controller[_0x320b('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19f445,_0x26c528,_0x28820c){_0x28820c(null,path[_0x320b('0xc')](config['root'],'server/files/attachments/'));},'filename':function(_0x2645be,_0x5acd2e,_0x3e2ff1){_0x3e2ff1(null,util['format'](_0x320b('0xd'),Date['now'](),_0x5acd2e[_0x320b('0xe')][_0x320b('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x320b('0x10')]('/',upload[_0x320b('0x11')](_0x320b('0x12')),controller[_0x320b('0x13')]);router[_0x320b('0x14')](_0x320b('0x8'),auth[_0x320b('0x6')](),controller[_0x320b('0x15')]);router[_0x320b('0x16')](_0x320b('0x8'),auth[_0x320b('0x6')](),controller['destroy']);module[_0x320b('0x17')]=router;
\ No newline at end of file
+var _0x52df=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','put','update','destroy'];(function(_0xf84b4b,_0x12bbb7){var _0x10851f=function(_0x562da7){while(--_0x562da7){_0xf84b4b['push'](_0xf84b4b['shift']());}};_0x10851f(++_0x12bbb7);}(_0x52df,0x121));var _0xf52d=function(_0x224061,_0x226866){_0x224061=_0x224061-0x0;var _0x30f77e=_0x52df[_0x224061];return _0x30f77e;};'use strict';var multer=require(_0xf52d('0x0'));var util=require(_0xf52d('0x1'));var path=require(_0xf52d('0x2'));var timeout=require('connect-timeout');var express=require(_0xf52d('0x3'));var router=express[_0xf52d('0x4')]();var auth=require(_0xf52d('0x5'));var interaction=require(_0xf52d('0x6'));var config=require(_0xf52d('0x7'));var controller=require(_0xf52d('0x8'));router[_0xf52d('0x9')]('/',auth[_0xf52d('0xa')](),controller[_0xf52d('0xb')]);router[_0xf52d('0x9')](_0xf52d('0xc'),auth[_0xf52d('0xa')](),controller[_0xf52d('0xd')]);router['get'](_0xf52d('0xe'),auth[_0xf52d('0xa')](),controller[_0xf52d('0xf')]);var upload=multer({'storage':multer[_0xf52d('0x10')]({'destination':function(_0x22756f,_0x3a043d,_0x48b203){_0x48b203(null,path[_0xf52d('0x11')](config[_0xf52d('0x12')],_0xf52d('0x13')));},'filename':function(_0x4d047b,_0x14eda7,_0x15724d){_0x15724d(null,util[_0xf52d('0x14')](_0xf52d('0x15'),Date[_0xf52d('0x16')](),_0x14eda7[_0xf52d('0x17')][_0xf52d('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf52d('0x19')]('/',upload[_0xf52d('0x1a')](_0xf52d('0x1b')),controller['create']);router[_0xf52d('0x1c')](_0xf52d('0xc'),auth[_0xf52d('0xa')](),controller[_0xf52d('0x1d')]);router['delete'](_0xf52d('0xc'),auth['isAuthenticated'](),controller[_0xf52d('0x1e')]);module[_0xf52d('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index a9c8bb0..65f60ba 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 _0x68c4=['../../components/auth/service','login','authenticate','google','/login','profile','callback','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','emails','value','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','lodash','moment','../../mysqldb','../../config/environment'];(function(_0x4c4c33,_0x8e827c){var _0x2dfeb0=function(_0x1b732f){while(--_0x1b732f){_0x4c4c33['push'](_0x4c4c33['shift']());}};_0x2dfeb0(++_0x8e827c);}(_0x68c4,0xe3));var _0x468c=function(_0x4ebf6a,_0xfd0a40){_0x4ebf6a=_0x4ebf6a-0x0;var _0x1e7a72=_0x68c4[_0x4ebf6a];return _0x1e7a72;};'use strict';var _=require(_0x468c('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x468c('0x1'));var db=require(_0x468c('0x2'))['db'];var config=require(_0x468c('0x3'));var signToken=require(_0x468c('0x4'))['signToken'];var utils=require('../../config/utils');exports[_0x468c('0x5')]=passport[_0x468c('0x6')](_0x468c('0x7'),{'failureRedirect':_0x468c('0x8'),'scope':[_0x468c('0x9'),'email'],'session':![]});exports[_0x468c('0xa')]=passport[_0x468c('0x6')](_0x468c('0x7'),{'failureRedirect':_0x468c('0x8'),'session':![]});passport[_0x468c('0xb')](new GoogleStrategy({'clientID':config['google']?config[_0x468c('0x7')]['clientID']:'id','clientSecret':config[_0x468c('0x7')]?config[_0x468c('0x7')][_0x468c('0xc')]:_0x468c('0xd'),'callbackURL':config[_0x468c('0x7')]?config[_0x468c('0x7')][_0x468c('0xe')]:''},function(_0x4c5b9f,_0x587fc7,_0x55f2e7,_0x187fdd){var _0x37c05e,_0x76913d;return db[_0x468c('0xf')][_0x468c('0x10')]({'where':{'id':0x1},'attributes':[_0x468c('0x11'),_0x468c('0x12')],'raw':!![]})['then'](function(_0x5171ab){_0x37c05e=_0x5171ab;return db[_0x468c('0x13')][_0x468c('0x14')]({'where':{'email':_['map'](_0x55f2e7[_0x468c('0x15')],_0x468c('0x16')),'role':{'$or':[_0x468c('0x17'),_0x468c('0x18'),_0x468c('0x19')]}}});})[_0x468c('0x1a')](function(_0x1baa5c){_0x76913d=_0x1baa5c;if(_0x76913d){if(_0x76913d['disabled']){return _0x187fdd(_0x468c('0x1b'));}else if(_0x37c05e[_0x468c('0x12')]>0x0){if(_0x76913d[_0x468c('0x1c')]){if(moment(_0x76913d[_0x468c('0x1d')])[_0x468c('0x1e')](_0x37c05e[_0x468c('0x12')],_0x468c('0x1f'))>moment()){return _0x187fdd(_0x468c('0x1b'));}else{return utils['clearBlockUser'](_0x76913d,0x0,![],null)[_0x468c('0x1a')](function(){return utils[_0x468c('0x20')](_0x76913d);})[_0x468c('0x1a')](function(){return _0x187fdd(null,_0x76913d);});}}else{return utils['getLicense'](_0x76913d)['then'](function(){return _0x187fdd(null,_0x76913d);});}}else{return utils[_0x468c('0x20')](_0x76913d)['then'](function(){return _0x187fdd(null,_0x76913d);});}}return _0x187fdd(_0x468c('0x1b'));})['catch'](function(_0x42bfab){_0x187fdd(_0x42bfab);});}));
\ No newline at end of file
+var _0x0068=['then','User','find','map','emails','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0x0068,0xa0));var _0x8006=function(_0x56ac40,_0x3eb56c){_0x56ac40=_0x56ac40-0x0;var _0x5e32c3=_0x0068[_0x56ac40];return _0x5e32c3;};'use strict';var _=require(_0x8006('0x0'));var passport=require(_0x8006('0x1'));var GoogleStrategy=require(_0x8006('0x2'))[_0x8006('0x3')];var moment=require(_0x8006('0x4'));var db=require(_0x8006('0x5'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x8006('0x6'));exports[_0x8006('0x7')]=passport[_0x8006('0x8')](_0x8006('0x9'),{'failureRedirect':_0x8006('0xa'),'scope':[_0x8006('0xb'),_0x8006('0xc')],'session':![]});exports[_0x8006('0xd')]=passport[_0x8006('0x8')](_0x8006('0x9'),{'failureRedirect':_0x8006('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x8006('0x9')][_0x8006('0xe')]:'id','clientSecret':config[_0x8006('0x9')]?config['google']['clientSecret']:_0x8006('0xf'),'callbackURL':config[_0x8006('0x9')]?config[_0x8006('0x9')]['callbackURL']:''},function(_0x580db0,_0x50ab01,_0x29b83b,_0x1c6fda){var _0x2030ce,_0x468146;return db[_0x8006('0x10')][_0x8006('0x11')]({'where':{'id':0x1},'attributes':[_0x8006('0x12'),_0x8006('0x13')],'raw':!![]})[_0x8006('0x14')](function(_0xb09980){_0x2030ce=_0xb09980;return db[_0x8006('0x15')][_0x8006('0x16')]({'where':{'email':_[_0x8006('0x17')](_0x29b83b[_0x8006('0x18')],_0x8006('0x19')),'role':{'$or':[_0x8006('0x1a'),_0x8006('0x1b'),'agent']}}});})['then'](function(_0x4763db){_0x468146=_0x4763db;if(_0x468146){if(_0x468146[_0x8006('0x1c')]){return _0x1c6fda(_0x8006('0x1d'));}else if(_0x2030ce[_0x8006('0x13')]>0x0){if(_0x468146[_0x8006('0x1e')]){if(moment(_0x468146[_0x8006('0x1f')])['add'](_0x2030ce['blockDuration'],_0x8006('0x20'))>moment()){return _0x1c6fda(_0x8006('0x1d'));}else{return utils[_0x8006('0x21')](_0x468146,0x0,![],null)['then'](function(){return utils[_0x8006('0x22')](_0x468146);})[_0x8006('0x14')](function(){return _0x1c6fda(null,_0x468146);});}}else{return utils['getLicense'](_0x468146)[_0x8006('0x14')](function(){return _0x1c6fda(null,_0x468146);});}}else{return utils[_0x8006('0x22')](_0x468146)[_0x8006('0x14')](function(){return _0x1c6fda(null,_0x468146);});}}return _0x1c6fda(_0x8006('0x1d'));})[_0x8006('0x23')](function(_0x2f5227){_0x1c6fda(_0x2f5227);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index ea2cece..5eac8db 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 _0x0eec=['setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0xc0ee('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xc0ee('0x1'));var userController=require(_0xc0ee('0x2'));var authService=require(_0xc0ee('0x3'));router[_0xc0ee('0x4')]('/',controller[_0xc0ee('0x5')]);router[_0xc0ee('0x4')](_0xc0ee('0x6'),controller['callback'],authService[_0xc0ee('0x7')],userController['login'],authService[_0xc0ee('0x8')]);module[_0xc0ee('0x9')]=router;
\ No newline at end of file
+var _0x22a4=['callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x440a23,_0x283bf0){var _0x5f16ce=function(_0x5d7550){while(--_0x5d7550){_0x440a23['push'](_0x440a23['shift']());}};_0x5f16ce(++_0x283bf0);}(_0x22a4,0x1cb));var _0x422a=function(_0x1e7a07,_0x355dd1){_0x1e7a07=_0x1e7a07-0x0;var _0x4b60be=_0x22a4[_0x1e7a07];return _0x4b60be;};'use strict';var express=require(_0x422a('0x0'));var passport=require(_0x422a('0x1'));var router=express[_0x422a('0x2')]();var controller=require(_0x422a('0x3'));var userController=require(_0x422a('0x4'));var authService=require(_0x422a('0x5'));router[_0x422a('0x6')]('/',controller[_0x422a('0x7')]);router['get'](_0x422a('0x8'),controller[_0x422a('0x9')],authService[_0x422a('0xa')],userController[_0x422a('0x7')],authService[_0x422a('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index ce5320b..6f288c8 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 _0x5fc3=['Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','disabled','blocked','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','user','pass','merge','format','request','SendMail','error','stringify','message','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','catch','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x5fc3[_0x3a3c17];return _0xd07f21;};'use strict';var util=require(_0x35fc('0x0'));var passport=require(_0x35fc('0x1'));var LocalStrategy=require('passport-local')[_0x35fc('0x2')];var jayson=require(_0x35fc('0x3'));var _=require(_0x35fc('0x4'));var rs=require(_0x35fc('0x5'));var moment=require(_0x35fc('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x35fc('0x7'));var utils=require(_0x35fc('0x8'));var client=jayson[_0x35fc('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x5754be,_0x19a0d1,_0x508b32,_0x16e153){var _0x27524f,_0xc72d93;return db[_0x35fc('0xa')][_0x35fc('0xb')]({'where':{'id':0x1},'attributes':[_0x35fc('0xc'),_0x35fc('0xd')],'raw':!![]})['then'](function(_0x1083a9){_0x27524f=_0x1083a9;return _0x5754be[_0x35fc('0xb')]({'attributes':['id','name',_0x35fc('0xe'),_0x35fc('0xf'),'role',_0x35fc('0x10'),_0x35fc('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0x19a0d1,'role':{'$or':[_0x35fc('0x12'),'user',_0x35fc('0x13')]}}});})[_0x35fc('0x14')](function(_0x2a6ad2){if(!_0x2a6ad2||_0x2a6ad2&&_0x2a6ad2[_0x35fc('0x15')]!==_0x19a0d1){throw new Error(_0x35fc('0x16'));}else{_0xc72d93=_0x2a6ad2;return _0xc72d93;}})['then'](function(){_0xc72d93['authenticate'](_0x508b32,function(_0x5eac0f,_0x558364){var _0x398b67=_0xc72d93[_0x35fc('0x17')]+0x1;if(_0x5eac0f){return _0x16e153(_0x5eac0f);}else if(!_0x558364){if(_0xc72d93[_0x35fc('0x10')]){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else if(_0x27524f[_0x35fc('0xc')]>0x0){if(_0xc72d93[_0x35fc('0x11')]){if(_0x27524f['blockDuration']>0x0){if(moment(_0xc72d93[_0x35fc('0x18')])[_0x35fc('0x19')](_0x27524f['blockDuration'],_0x35fc('0x1a'))>moment()){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else{return utils[_0x35fc('0x1b')](_0xc72d93,_0x398b67,![],null)['then'](function(){return _0x16e153(null,![],{'message':_0x35fc('0x16')});});}}else{return _0x16e153(null,![],{'message':_0x35fc('0x16')});}}else{if(_0x398b67>=_0x27524f[_0x35fc('0xc')]){return utils['clearBlockUser'](_0xc72d93,0x0,!![],moment())[_0x35fc('0x14')](function(){return _0x16e153(null,![],{'message':_0x35fc('0x16')});});}else{return utils[_0x35fc('0x1b')](_0xc72d93,_0x398b67,![],null)[_0x35fc('0x14')](function(){return _0x16e153(null,![],{'message':_0x35fc('0x16')});});}}}else{return _0x16e153(null,![],{'message':_0x35fc('0x16')});}}else{if(_0xc72d93[_0x35fc('0x10')]){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else if(_0x27524f[_0x35fc('0xc')]>0x0){if(_0xc72d93[_0x35fc('0x11')]){if(_0x27524f['blockDuration']>0x0){if(moment(_0xc72d93[_0x35fc('0x18')])[_0x35fc('0x19')](_0x27524f[_0x35fc('0xd')],_0x35fc('0x1a'))>moment()){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else{return utils['clearBlockUser'](_0xc72d93,0x0,![],null)[_0x35fc('0x14')](function(){return utils[_0x35fc('0x1c')](_0xc72d93);})['then'](function(){return _0x16e153(null,_0xc72d93);});}}else{return _0x16e153(null,![],{'message':_0x35fc('0x16')});}}else{return utils[_0x35fc('0x1b')](_0xc72d93,0x0,![],null)[_0x35fc('0x14')](function(){return utils['getLicense'](_0xc72d93);})[_0x35fc('0x14')](function(){return _0x16e153(null,_0xc72d93);})['catch'](function(_0x1bf180){return _0x16e153(null,![],_0x1bf180);});}}else{if(_0xc72d93[_0x35fc('0x11')]){return _0x16e153(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0xc72d93)[_0x35fc('0x14')](function(){return _0x16e153(null,_0xc72d93);});}}}});})['catch'](function(_0x274208){return _0x16e153(null,![],_0x274208);});}function sendServiceMail(_0x1a5d92){return db['MailAccount'][_0x35fc('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x35fc('0x15'),_0x35fc('0x1e')],'include':[{'model':db[_0x35fc('0x1f')],'as':_0x35fc('0x20')}]})[_0x35fc('0x14')](function(_0x11ccdb){if(!_0x11ccdb){throw new Error(_0x35fc('0x21'));}var _0x54aedc={'tls':{'rejectUnauthorized':![]}};if(_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x22')]){_0x54aedc[_0x35fc('0x22')]=_0x11ccdb['Smtp'][_0x35fc('0x22')];}else{_0x54aedc[_0x35fc('0x23')]=_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x23')];_0x54aedc[_0x35fc('0x24')]=_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x24')];_0x54aedc[_0x35fc('0x25')]=_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x25')];}if(_0x11ccdb['Smtp']['authentication']){_0x54aedc[_0x35fc('0x26')]={'user':_0x11ccdb['Smtp'][_0x35fc('0x27')],'pass':_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x28')]};}var _0x227471={'account':_0x54aedc,'message':_[_0x35fc('0x29')]({'from':util[_0x35fc('0x2a')]('\x22%s\x22\x20<%s>',_0x11ccdb[_0x35fc('0x15')],_0x11ccdb[_0x35fc('0x1e')]||_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x27')])},_0x1a5d92)};return client[_0x35fc('0x2b')](_0x35fc('0x2c'),_0x227471);})['then'](function(_0x2483be){if(_0x2483be[_0x35fc('0x2d')]){throw new Error(util[_0x35fc('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2483be[_0x35fc('0x2d')]['message']||JSON[_0x35fc('0x2e')](_0x2483be[_0x35fc('0x2d')])));}return!![];});}function handleError(_0x266a11,_0x2e00e3,_0x4de4b7){return _0x266a11['status'](_0x2e00e3||0x1f4)['send']({'message':_0x4de4b7?_0x4de4b7[_0x35fc('0x2f')]||_0x4de4b7:''});}function checkPasswordPattern(_0x56c06c,_0x20f8bb,_0x4b4d4a){if(_0x4b4d4a){var _0x9c6b65=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9c6b65[_0x35fc('0x30')](_0x20f8bb)){return _0x56c06c;}else{throw new Error(_0x35fc('0x31'));}}else{return _0x56c06c;}}exports[_0x35fc('0x32')]=function(_0x1c10e0,_0x3313fa,_0x9fe7d6){passport['authenticate'](_0x35fc('0x33'),function(_0x16087d,_0x4e0ce3,_0x1feda5){var _0x1ccc41=_0x16087d||_0x1feda5;if(_0x1ccc41){return handleError(_0x3313fa,0x191,_0x1ccc41);}if(!_0x4e0ce3){return handleError(_0x3313fa,0x194,{'message':_0x35fc('0x34')});}else{var _0x1d2ffe={'payload':{'id':_0x4e0ce3['id'],'role':_0x4e0ce3[_0x35fc('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0x35fc('0x36')](_0x1d2ffe)['then'](function(_0x3f6480){_0x3313fa[_0x35fc('0x37')]({'id':_0x4e0ce3['id'],'token':_0x3f6480,'statusCall':'','isAlreadyLogged':_0x4e0ce3[_0x35fc('0x38')]});});}})(_0x1c10e0,_0x3313fa,_0x9fe7d6);};exports['forgot']=function(_0x17821e,_0x350a96,_0x596919){if(!_0x17821e[_0x35fc('0x39')][_0x35fc('0x1e')]){return handleError(_0x350a96,0x1f4,{'message':_0x35fc('0x3a')});}var _0x41e199=rs[_0x35fc('0x3b')]();_0x17821e[_0x35fc('0x39')][_0x35fc('0x1e')]=_0x17821e[_0x35fc('0x39')]['email']['trim']()[_0x35fc('0x3c')]();var _0x36fcf9;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x35fc('0xd')],'raw':!![]})[_0x35fc('0x14')](function(_0x4e56ed){_0x36fcf9=_0x4e56ed;return db[_0x35fc('0x3d')][_0x35fc('0x1d')]({'where':{'email':_0x17821e[_0x35fc('0x39')][_0x35fc('0x1e')]}});})['then'](function(_0x57105c){if(!_0x57105c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x57105c['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x57105c[_0x35fc('0x11')]){if(moment(_0x57105c[_0x35fc('0x18')])['add'](_0x36fcf9[_0x35fc('0xd')],'minutes')>moment()){throw new Error(_0x35fc('0x3e'));}else{_0x57105c[_0x35fc('0x11')]=![];_0x57105c[_0x35fc('0x18')]=null;}}_0x57105c[_0x35fc('0x3f')]=_0x41e199;_0x57105c[_0x35fc('0x40')]=Date['now']()+0x36ee80;return _0x57105c[_0x35fc('0x41')]();})[_0x35fc('0x14')](function(){return sendServiceMail({'to':_0x17821e['body'][_0x35fc('0x1e')],'subject':_0x35fc('0x42'),'text':_0x35fc('0x43')+_0x35fc('0x44')+'http://'+_0x17821e[_0x35fc('0x45')]['host']+'/reset/'+_0x41e199+'\x0a\x0a'+_0x35fc('0x46')});})[_0x35fc('0x14')](function(){_0x350a96[_0x35fc('0x47')](0xc8)[_0x35fc('0x48')]({'message':_0x35fc('0x49')});})[_0x35fc('0x4a')](function(_0x405320){return handleError(_0x350a96,0x1f4,_0x405320);});};exports[_0x35fc('0x4b')]=function(_0x4f555f,_0x3e2961,_0x91d7c0){var _0xeca02e;return db[_0x35fc('0x3d')][_0x35fc('0x1d')]({'where':{'resetPasswordToken':_0x4f555f[_0x35fc('0x4c')][_0x35fc('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x35fc('0x4e')]()}}})[_0x35fc('0x14')](function(_0xe6eb6a){_0xeca02e=_0xe6eb6a;if(!_0xeca02e){throw new Error(_0x35fc('0x4f'));}return db[_0x35fc('0xa')][_0x35fc('0xb')]({'attributes':['id',_0x35fc('0x50')]});})['then'](function(_0x553ed6){return checkPasswordPattern(_0x553ed6,_0x4f555f[_0x35fc('0x39')][_0x35fc('0xe')],_0x553ed6[_0x35fc('0x50')]);})[_0x35fc('0x14')](function(){_0xeca02e[_0x35fc('0xe')]=_0x4f555f[_0x35fc('0x39')]['password'];_0xeca02e['resetPasswordToken']=null;_0xeca02e[_0x35fc('0x40')]=null;return _0xeca02e[_0x35fc('0x41')]();})[_0x35fc('0x14')](function(){_0x3e2961[_0x35fc('0x47')](0xc8)['send']({'message':_0x35fc('0x51')});})[_0x35fc('0x4a')](function(_0x4965d2){return handleError(_0x3e2961,0x1f4,_0x4965d2);});};passport[_0x35fc('0x52')](new LocalStrategy({'usernameField':_0x35fc('0x15'),'passwordField':'password'},function(_0x3e12e4,_0x1ab472,_0x26118e){return localAuthenticate(db[_0x35fc('0x3d')],_0x3e12e4,_0x1ab472,_0x26118e);}));
\ No newline at end of file
+var _0x53ec=['blockDuration','then','salt','blocked','blockedAt','loginAttempts','admin','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','disabled','getLicense','catch','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','password','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x53ec,0x192));var _0xc53e=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x53ec[_0x10dbf6];return _0x452147;};'use strict';var util=require(_0xc53e('0x0'));var passport=require(_0xc53e('0x1'));var LocalStrategy=require(_0xc53e('0x2'))[_0xc53e('0x3')];var jayson=require(_0xc53e('0x4'));var _=require(_0xc53e('0x5'));var rs=require('randomstring');var moment=require(_0xc53e('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xc53e('0x7'));var utils=require(_0xc53e('0x8'));var client=jayson['client'][_0xc53e('0x9')]({'port':0x232b});function localAuthenticate(_0x4f989b,_0x41a9e8,_0x2de88b,_0x5d3b28){var _0x1616ac,_0x1ac6c0;return db[_0xc53e('0xa')][_0xc53e('0xb')]({'where':{'id':0x1},'attributes':[_0xc53e('0xc'),_0xc53e('0xd')],'raw':!![]})[_0xc53e('0xe')](function(_0x361e9d){_0x1616ac=_0x361e9d;return _0x4f989b[_0xc53e('0xb')]({'attributes':['id','name','password',_0xc53e('0xf'),'role','disabled',_0xc53e('0x10'),_0xc53e('0x11'),_0xc53e('0x12')],'where':{'name':_0x41a9e8,'role':{'$or':[_0xc53e('0x13'),'user','agent']}}});})[_0xc53e('0xe')](function(_0x19a772){if(!_0x19a772||_0x19a772&&_0x19a772[_0xc53e('0x14')]!==_0x41a9e8){throw new Error(_0xc53e('0x15'));}else{_0x1ac6c0=_0x19a772;return _0x1ac6c0;}})[_0xc53e('0xe')](function(){_0x1ac6c0[_0xc53e('0x16')](_0x2de88b,function(_0x3dc2fa,_0x19c0d1){var _0x455e4d=_0x1ac6c0[_0xc53e('0x12')]+0x1;if(_0x3dc2fa){return _0x5d3b28(_0x3dc2fa);}else if(!_0x19c0d1){if(_0x1ac6c0['disabled']){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else if(_0x1616ac[_0xc53e('0xc')]>0x0){if(_0x1ac6c0[_0xc53e('0x10')]){if(_0x1616ac[_0xc53e('0xd')]>0x0){if(moment(_0x1ac6c0[_0xc53e('0x11')])[_0xc53e('0x17')](_0x1616ac[_0xc53e('0xd')],_0xc53e('0x18'))>moment()){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else{return utils['clearBlockUser'](_0x1ac6c0,_0x455e4d,![],null)['then'](function(){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});});}}else{return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}}else{if(_0x455e4d>=_0x1616ac[_0xc53e('0xc')]){return utils[_0xc53e('0x19')](_0x1ac6c0,0x0,!![],moment())[_0xc53e('0xe')](function(){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});});}else{return utils[_0xc53e('0x19')](_0x1ac6c0,_0x455e4d,![],null)[_0xc53e('0xe')](function(){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});});}}}else{return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}}else{if(_0x1ac6c0[_0xc53e('0x1a')]){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else if(_0x1616ac[_0xc53e('0xc')]>0x0){if(_0x1ac6c0['blocked']){if(_0x1616ac['blockDuration']>0x0){if(moment(_0x1ac6c0['blockedAt'])[_0xc53e('0x17')](_0x1616ac[_0xc53e('0xd')],_0xc53e('0x18'))>moment()){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else{return utils[_0xc53e('0x19')](_0x1ac6c0,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1ac6c0);})[_0xc53e('0xe')](function(){return _0x5d3b28(null,_0x1ac6c0);});}}else{return _0x5d3b28(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc53e('0x19')](_0x1ac6c0,0x0,![],null)[_0xc53e('0xe')](function(){return utils[_0xc53e('0x1b')](_0x1ac6c0);})[_0xc53e('0xe')](function(){return _0x5d3b28(null,_0x1ac6c0);})[_0xc53e('0x1c')](function(_0x4df8cf){return _0x5d3b28(null,![],_0x4df8cf);});}}else{if(_0x1ac6c0[_0xc53e('0x10')]){return _0x5d3b28(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x1ac6c0)['then'](function(){return _0x5d3b28(null,_0x1ac6c0);});}}}});})[_0xc53e('0x1c')](function(_0x57a1f5){return _0x5d3b28(null,![],_0x57a1f5);});}function sendServiceMail(_0x28240a){return db['MailAccount'][_0xc53e('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xc53e('0x1e')],'as':_0xc53e('0x1f')}]})[_0xc53e('0xe')](function(_0x2fa20b){if(!_0x2fa20b){throw new Error(_0xc53e('0x20'));}var _0xf97d78={'tls':{'rejectUnauthorized':![]}};if(_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x21')]){_0xf97d78['service']=_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x21')];}else{_0xf97d78[_0xc53e('0x22')]=_0x2fa20b['Smtp'][_0xc53e('0x22')];_0xf97d78['port']=_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x23')];_0xf97d78['secure']=_0x2fa20b['Smtp'][_0xc53e('0x24')];}if(_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x25')]){_0xf97d78[_0xc53e('0x26')]={'user':_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x27')],'pass':_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x28')]};}var _0x4ffddc={'account':_0xf97d78,'message':_[_0xc53e('0x29')]({'from':util[_0xc53e('0x2a')](_0xc53e('0x2b'),_0x2fa20b[_0xc53e('0x14')],_0x2fa20b[_0xc53e('0x2c')]||_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x27')])},_0x28240a)};return client[_0xc53e('0x2d')](_0xc53e('0x2e'),_0x4ffddc);})['then'](function(_0x3e395c){if(_0x3e395c['error']){throw new Error(util[_0xc53e('0x2a')](_0xc53e('0x2f'),_0x3e395c['error'][_0xc53e('0x30')]||JSON[_0xc53e('0x31')](_0x3e395c[_0xc53e('0x32')])));}return!![];});}function handleError(_0x5ed90b,_0x4b82bb,_0x17ec92){return _0x5ed90b[_0xc53e('0x33')](_0x4b82bb||0x1f4)[_0xc53e('0x34')]({'message':_0x17ec92?_0x17ec92[_0xc53e('0x30')]||_0x17ec92:''});}function checkPasswordPattern(_0x143101,_0x312c1b,_0x482085){if(_0x482085){var _0x2a85d1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a85d1[_0xc53e('0x35')](_0x312c1b)){return _0x143101;}else{throw new Error(_0xc53e('0x36'));}}else{return _0x143101;}}exports['login']=function(_0x70b6c3,_0x5e8ab7,_0xaa00cd){passport[_0xc53e('0x16')](_0xc53e('0x37'),function(_0xad1232,_0x3036e7,_0x5507d0){var _0x3dda55=_0xad1232||_0x5507d0;if(_0x3dda55){return handleError(_0x5e8ab7,0x191,_0x3dda55);}if(!_0x3036e7){return handleError(_0x5e8ab7,0x194,{'message':_0xc53e('0x38')});}else{var _0x4a5529={'payload':{'id':_0x3036e7['id'],'role':_0x3036e7['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a5529)['then'](function(_0x1e2ea3){_0x5e8ab7[_0xc53e('0x39')]({'id':_0x3036e7['id'],'token':_0x1e2ea3,'statusCall':'','isAlreadyLogged':_0x3036e7['online']});});}})(_0x70b6c3,_0x5e8ab7,_0xaa00cd);};exports[_0xc53e('0x3a')]=function(_0x574983,_0x55d07d,_0x53447e){if(!_0x574983[_0xc53e('0x3b')]['email']){return handleError(_0x55d07d,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x433a44=rs['generate']();_0x574983[_0xc53e('0x3b')][_0xc53e('0x2c')]=_0x574983['body'][_0xc53e('0x2c')][_0xc53e('0x3c')]()['toLowerCase']();var _0x2ebce7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xc53e('0xe')](function(_0x17b586){_0x2ebce7=_0x17b586;return db[_0xc53e('0x3d')]['find']({'where':{'email':_0x574983[_0xc53e('0x3b')][_0xc53e('0x2c')]}});})['then'](function(_0x58ede2){if(!_0x58ede2){throw new Error(_0xc53e('0x3e'));}if(_0x58ede2[_0xc53e('0x1a')]){throw new Error(_0xc53e('0x3f'));}if(_0x58ede2['blocked']){if(moment(_0x58ede2[_0xc53e('0x11')])[_0xc53e('0x17')](_0x2ebce7[_0xc53e('0xd')],_0xc53e('0x18'))>moment()){throw new Error(_0xc53e('0x40'));}else{_0x58ede2[_0xc53e('0x10')]=![];_0x58ede2[_0xc53e('0x11')]=null;}}_0x58ede2['resetPasswordToken']=_0x433a44;_0x58ede2[_0xc53e('0x41')]=Date[_0xc53e('0x42')]()+0x36ee80;return _0x58ede2[_0xc53e('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x574983[_0xc53e('0x3b')][_0xc53e('0x2c')],'subject':_0xc53e('0x44'),'text':_0xc53e('0x45')+_0xc53e('0x46')+_0xc53e('0x47')+_0x574983['headers'][_0xc53e('0x22')]+_0xc53e('0x48')+_0x433a44+'\x0a\x0a'+_0xc53e('0x49')});})['then'](function(){_0x55d07d[_0xc53e('0x33')](0xc8)[_0xc53e('0x34')]({'message':_0xc53e('0x4a')});})[_0xc53e('0x1c')](function(_0x293f36){return handleError(_0x55d07d,0x1f4,_0x293f36);});};exports[_0xc53e('0x4b')]=function(_0x1a5a8f,_0x2ba2b4,_0x34de2d){var _0x430512;return db['User'][_0xc53e('0x1d')]({'where':{'resetPasswordToken':_0x1a5a8f[_0xc53e('0x4c')][_0xc53e('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xc53e('0x42')]()}}})[_0xc53e('0xe')](function(_0x52dac7){_0x430512=_0x52dac7;if(!_0x430512){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc53e('0xa')]['findOne']({'attributes':['id',_0xc53e('0x4e')]});})['then'](function(_0x3a49a4){return checkPasswordPattern(_0x3a49a4,_0x1a5a8f[_0xc53e('0x3b')][_0xc53e('0x4f')],_0x3a49a4['securePassword']);})[_0xc53e('0xe')](function(){_0x430512[_0xc53e('0x4f')]=_0x1a5a8f[_0xc53e('0x3b')]['password'];_0x430512[_0xc53e('0x50')]=null;_0x430512['resetPasswordExpires']=null;return _0x430512[_0xc53e('0x43')]();})[_0xc53e('0xe')](function(){_0x2ba2b4['status'](0xc8)[_0xc53e('0x34')]({'message':_0xc53e('0x51')});})['catch'](function(_0x44f7cc){return handleError(_0x2ba2b4,0x1f4,_0x44f7cc);});};passport[_0xc53e('0x52')](new LocalStrategy({'usernameField':_0xc53e('0x14'),'passwordField':_0xc53e('0x4f')},function(_0x31f6e8,_0x3aeb8c,_0x27b6d4){return localAuthenticate(db[_0xc53e('0x3d')],_0x31f6e8,_0x3aeb8c,_0x27b6d4);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a05d0a0..9298e97 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 _0xb3ff=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3ff,0x180));var _0xfb3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3ff[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfb3f('0x0'));var router=express['Router']();var controller=require(_0xfb3f('0x1'));router[_0xfb3f('0x2')]('/',controller[_0xfb3f('0x3')]);router[_0xfb3f('0x2')](_0xfb3f('0x4'),controller[_0xfb3f('0x5')]);router[_0xfb3f('0x2')](_0xfb3f('0x6'),controller['reset']);module[_0xfb3f('0x7')]=router;
\ No newline at end of file
+var _0x4003=['forgot','/reset/:token','exports','express','Router','post','/forgot'];(function(_0x144b03,_0x2b9335){var _0x46c33d=function(_0xb8001){while(--_0xb8001){_0x144b03['push'](_0x144b03['shift']());}};_0x46c33d(++_0x2b9335);}(_0x4003,0x184));var _0x3400=function(_0x12692f,_0x2fae5b){_0x12692f=_0x12692f-0x0;var _0x2412ab=_0x4003[_0x12692f];return _0x2412ab;};'use strict';var express=require(_0x3400('0x0'));var router=express[_0x3400('0x1')]();var controller=require('./authLocal.controller');router[_0x3400('0x2')]('/',controller['login']);router['post'](_0x3400('0x3'),controller[_0x3400('0x4')]);router[_0x3400('0x2')](_0x3400('0x5'),controller['reset']);module[_0x3400('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index c7be567..d0c790b 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 _0x8249=['STRING','BOOLEAN','sequelize'];(function(_0x57020d,_0x5aa5bd){var _0x1f3c11=function(_0xa208ba){while(--_0xa208ba){_0x57020d['push'](_0x57020d['shift']());}};_0x1f3c11(++_0x5aa5bd);}(_0x8249,0x155));var _0x9824=function(_0x3267ff,_0x177378){_0x3267ff=_0x3267ff-0x0;var _0xa98fd8=_0x8249[_0x3267ff];return _0xa98fd8;};'use strict';var Sequelize=require(_0x9824('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9824('0x1')]},'status':{'type':Sequelize[_0x9824('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5574=['sequelize','STRING','BOOLEAN'];(function(_0x2c0df1,_0x475f8b){var _0x34e91b=function(_0x3ffa63){while(--_0x3ffa63){_0x2c0df1['push'](_0x2c0df1['shift']());}};_0x34e91b(++_0x475f8b);}(_0x5574,0x17a));var _0x4557=function(_0x5832dd,_0x1e6b00){_0x5832dd=_0x5832dd-0x0;var _0x338e03=_0x5574[_0x5832dd];return _0x338e03;};'use strict';var Sequelize=require(_0x4557('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x4557('0x1')]},'description':{'type':Sequelize[_0x4557('0x1')]},'status':{'type':Sequelize[_0x4557('0x2')],'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 e0e1782..33ec7a3 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 _0x686c=['request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','field','filter','options','Automation','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x10fe90,_0xfc40eb){var _0x4e0c81=function(_0x1aec9c){while(--_0x1aec9c){_0x10fe90['push'](_0x10fe90['shift']());}};_0x4e0c81(++_0xfc40eb);}(_0x686c,0xfe));var _0xc686=function(_0x5670bd,_0x4efe37){_0x5670bd=_0x5670bd-0x0;var _0x39ede0=_0x686c[_0x5670bd];return _0x39ede0;};'use strict';var pdf=require(_0xc686('0x0'));var emlformat=require(_0xc686('0x1'));var rimraf=require(_0xc686('0x2'));var zipdir=require(_0xc686('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc686('0x4'));var moment=require(_0xc686('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc686('0x6'));var path=require(_0xc686('0x7'));var sox=require(_0xc686('0x8'));var csv=require(_0xc686('0x9'));var ejs=require(_0xc686('0xa'));var fs=require('fs');var _=require(_0xc686('0xb'));var squel=require(_0xc686('0xc'));var crypto=require(_0xc686('0xd'));var jsforce=require(_0xc686('0xe'));var deskjs=require(_0xc686('0xf'));var toCsv=require(_0xc686('0x9'));var querystring=require(_0xc686('0x10'));var Papa=require(_0xc686('0x11'));var Redis=require(_0xc686('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc686('0x13'));var as=require(_0xc686('0x14'));var hardwareService=require(_0xc686('0x15'));var logger=require(_0xc686('0x16'))('api');var utils=require(_0xc686('0x17'));var config=require(_0xc686('0x18'));var db=require(_0xc686('0x19'))['db'];function respondWithStatusCode(_0x2fed5a,_0x455cd2){_0x455cd2=_0x455cd2||0xcc;return function(_0xd2939e){if(_0xd2939e){return _0x2fed5a['sendStatus'](_0x455cd2);}return _0x2fed5a[_0xc686('0x1a')](_0x455cd2)[_0xc686('0x1b')]();};}function respondWithResult(_0x1b72eb,_0x14ff08){_0x14ff08=_0x14ff08||0xc8;return function(_0x383a3d){if(_0x383a3d){return _0x1b72eb[_0xc686('0x1a')](_0x14ff08)['json'](_0x383a3d);}};}function respondWithFilteredResult(_0x4a9546,_0x2c8ee8){return function(_0x193f3f){if(_0x193f3f){var _0x2293fd=_0x193f3f['count'],_0x140801=_0x2c8ee8[_0xc686('0x1c')],_0x15e1bd=_0x2c8ee8['offset']+_0x2c8ee8[_0xc686('0x1d')],_0x3015a2;if(_0x15e1bd>=_0x2293fd){_0x15e1bd=_0x2293fd;_0x3015a2=0xc8;}else{_0x3015a2=0xce;}_0x4a9546[_0xc686('0x1a')](_0x3015a2);return _0x4a9546['set'](_0xc686('0x1e'),_0x140801+'-'+_0x15e1bd+'/'+_0x2293fd)[_0xc686('0x1f')](_0x193f3f);}return null;};}function patchUpdates(_0x1bebd2){return function(_0x20b0c9){try{jsonpatch[_0xc686('0x20')](_0x20b0c9,_0x1bebd2,!![]);}catch(_0x1e91c7){return BPromise[_0xc686('0x21')](_0x1e91c7);}return _0x20b0c9[_0xc686('0x22')]();};}function saveUpdates(_0x467647,_0x447ea4){return function(_0x46f055){if(_0x46f055){return _0x46f055[_0xc686('0x23')](_0x467647)[_0xc686('0x24')](function(_0x51b833){return _0x51b833;});}return null;};}function removeEntity(_0x173cbd,_0x2eaa31){return function(_0x140cd7){if(_0x140cd7){return _0x140cd7['destroy']()[_0xc686('0x24')](function(){_0x173cbd[_0xc686('0x1a')](0xcc)[_0xc686('0x1b')]();});}};}function handleEntityNotFound(_0x19d5bd,_0x21be60){return function(_0x28f23f){if(!_0x28f23f){_0x19d5bd[_0xc686('0x25')](0x194);}return _0x28f23f;};}function handleError(_0x2bc020,_0x22790b){_0x22790b=_0x22790b||0x1f4;return function(_0x13f20b){logger[_0xc686('0x26')](_0x13f20b[_0xc686('0x27')]);if(_0x13f20b['name']){delete _0x13f20b[_0xc686('0x28')];}_0x2bc020['status'](_0x22790b)[_0xc686('0x29')](_0x13f20b);};}exports['index']=function(_0x5ae64e,_0x493fc2){var _0x54589a={},_0x44958e={},_0x5e934e={'count':0x0,'rows':[]};var _0x214bd8=_[_0xc686('0x2a')](db['Automation'][_0xc686('0x2b')],function(_0x3de9df){return{'name':_0x3de9df[_0xc686('0x2c')],'type':_0x3de9df[_0xc686('0x2d')][_0xc686('0x2e')]};});_0x44958e['model']=_[_0xc686('0x2a')](_0x214bd8,'name');_0x44958e[_0xc686('0x2f')]=_['keys'](_0x5ae64e[_0xc686('0x2f')]);_0x44958e[_0xc686('0x30')]=_[_0xc686('0x31')](_0x44958e[_0xc686('0x32')],_0x44958e['query']);_0x54589a['attributes']=_[_0xc686('0x31')](_0x44958e[_0xc686('0x32')],qs[_0xc686('0x33')](_0x5ae64e['query'][_0xc686('0x33')]));_0x54589a['attributes']=_0x54589a[_0xc686('0x34')][_0xc686('0x35')]?_0x54589a[_0xc686('0x34')]:_0x44958e[_0xc686('0x32')];if(!_0x5ae64e[_0xc686('0x2f')]['hasOwnProperty'](_0xc686('0x36'))){_0x54589a['limit']=qs[_0xc686('0x1d')](_0x5ae64e[_0xc686('0x2f')][_0xc686('0x1d')]);_0x54589a[_0xc686('0x1c')]=qs['offset'](_0x5ae64e[_0xc686('0x2f')][_0xc686('0x1c')]);}_0x54589a[_0xc686('0x37')]=qs[_0xc686('0x38')](_0x5ae64e[_0xc686('0x2f')][_0xc686('0x38')]);_0x54589a[_0xc686('0x39')]=qs[_0xc686('0x30')](_[_0xc686('0x3a')](_0x5ae64e[_0xc686('0x2f')],_0x44958e[_0xc686('0x30')]));if(_0x5ae64e[_0xc686('0x2f')]['filter']){_0x54589a['where']=_[_0xc686('0x3b')](_0x54589a[_0xc686('0x39')],{'$or':_['map'](_0x214bd8,function(_0x266f40){if(_0x266f40['type'][_0xc686('0x2e')]!=='VIRTUAL'){var _0x3e723f={};_0x3e723f[_0x266f40[_0xc686('0x3c')]]={'$like':'%'+_0x5ae64e[_0xc686('0x2f')][_0xc686('0x3d')]+'%'};return _0x3e723f;}})});}_0x54589a=_[_0xc686('0x3b')]({},_0x54589a,_0x5ae64e[_0xc686('0x3e')]);var _0x7b7bcb={'where':_0x54589a[_0xc686('0x39')]};return db[_0xc686('0x3f')][_0xc686('0x40')](_0x7b7bcb)[_0xc686('0x24')](function(_0x429d2a){_0x5e934e[_0xc686('0x40')]=_0x429d2a;if(_0x5ae64e[_0xc686('0x2f')][_0xc686('0x41')]){_0x54589a[_0xc686('0x42')]=[{'all':!![]}];}return db[_0xc686('0x3f')][_0xc686('0x43')](_0x54589a);})['then'](function(_0x2c108c){_0x5e934e[_0xc686('0x44')]=_0x2c108c;return _0x5e934e;})[_0xc686('0x24')](respondWithFilteredResult(_0x493fc2,_0x54589a))[_0xc686('0x45')](handleError(_0x493fc2,null));};exports[_0xc686('0x46')]=function(_0x1051a8,_0x5b9838){var _0x55011={'raw':![],'where':{'id':_0x1051a8[_0xc686('0x47')]['id']}},_0x26fc9b={};_0x26fc9b[_0xc686('0x32')]=_[_0xc686('0x48')](db['Automation'][_0xc686('0x2b')]);_0x26fc9b[_0xc686('0x2f')]=_['keys'](_0x1051a8[_0xc686('0x2f')]);_0x26fc9b['filters']=_[_0xc686('0x31')](_0x26fc9b[_0xc686('0x32')],_0x26fc9b['query']);_0x55011[_0xc686('0x34')]=_[_0xc686('0x31')](_0x26fc9b[_0xc686('0x32')],qs['fields'](_0x1051a8[_0xc686('0x2f')][_0xc686('0x33')]));_0x55011['attributes']=_0x55011['attributes'][_0xc686('0x35')]?_0x55011['attributes']:_0x26fc9b['model'];if(_0x1051a8['query'][_0xc686('0x41')]){_0x55011[_0xc686('0x42')]=[{'all':!![]}];}_0x55011=_[_0xc686('0x3b')]({},_0x55011,_0x1051a8[_0xc686('0x3e')]);return db[_0xc686('0x3f')][_0xc686('0x49')](_0x55011)[_0xc686('0x24')](handleEntityNotFound(_0x5b9838,null))[_0xc686('0x24')](respondWithResult(_0x5b9838,null))[_0xc686('0x45')](handleError(_0x5b9838,null));};exports[_0xc686('0x4a')]=function(_0xccd45d,_0x25d179){return db['Automation'][_0xc686('0x4a')](_0xccd45d['body'],{})['then'](respondWithResult(_0x25d179,0xc9))[_0xc686('0x45')](handleError(_0x25d179,null));};exports[_0xc686('0x23')]=function(_0x3e544f,_0x569eb8){if(_0x3e544f['body']['id']){delete _0x3e544f[_0xc686('0x4b')]['id'];}return db['Automation'][_0xc686('0x49')]({'where':{'id':_0x3e544f['params']['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x569eb8,null))['then'](saveUpdates(_0x3e544f['body'],null))['then'](respondWithResult(_0x569eb8,null))['catch'](handleError(_0x569eb8,null));};exports['destroy']=function(_0x8eb0ca,_0x25e02b){return db[_0xc686('0x3f')][_0xc686('0x49')]({'where':{'id':_0x8eb0ca[_0xc686('0x47')]['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x25e02b,null))[_0xc686('0x24')](removeEntity(_0x25e02b,null))[_0xc686('0x45')](handleError(_0x25e02b,null));};exports[_0xc686('0x4c')]=function(_0x20ceb0,_0x575c58,_0x4f9ade){return db[_0xc686('0x4d')][_0xc686('0x49')]({'where':{'id':_0x20ceb0['params']['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x575c58,null))[_0xc686('0x24')](function(_0x900568){if(_0x900568){return _0x900568[_0xc686('0x4c')](_0x20ceb0[_0xc686('0x4b')]['ids'],_[_0xc686('0x4e')](_0x20ceb0['body'],[_0xc686('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x575c58,null))[_0xc686('0x45')](handleError(_0x575c58,null));};exports[_0xc686('0x50')]=function(_0x5d984b,_0x5ef65a,_0x5a28ad){var _0x4ffe8c={};var _0x439bc6={};var _0x4bea93;var _0x1c79bf;return db[_0xc686('0x3f')][_0xc686('0x51')]({'where':{'id':_0x5d984b[_0xc686('0x47')]['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x5ef65a,null))[_0xc686('0x24')](function(_0x330078){if(_0x330078){_0x4bea93=_0x330078;_0x439bc6[_0xc686('0x32')]=_[_0xc686('0x48')](db[_0xc686('0x4d')]['rawAttributes']);_0x439bc6[_0xc686('0x2f')]=_[_0xc686('0x48')](_0x5d984b[_0xc686('0x2f')]);_0x439bc6['filters']=_[_0xc686('0x31')](_0x439bc6['model'],_0x439bc6[_0xc686('0x2f')]);_0x4ffe8c[_0xc686('0x34')]=_[_0xc686('0x31')](_0x439bc6[_0xc686('0x32')],qs['fields'](_0x5d984b['query'][_0xc686('0x33')]));_0x4ffe8c[_0xc686('0x34')]=_0x4ffe8c['attributes'][_0xc686('0x35')]?_0x4ffe8c[_0xc686('0x34')]:_0x439bc6[_0xc686('0x32')];_0x4ffe8c[_0xc686('0x37')]=qs[_0xc686('0x38')](_0x5d984b['query']['sort']);_0x4ffe8c[_0xc686('0x39')]=qs[_0xc686('0x30')](_['pick'](_0x5d984b[_0xc686('0x2f')],_0x439bc6['filters']));if(_0x5d984b[_0xc686('0x2f')][_0xc686('0x3d')]){_0x4ffe8c[_0xc686('0x39')]=_['merge'](_0x4ffe8c[_0xc686('0x39')],{'$or':_[_0xc686('0x2a')](_0x4ffe8c[_0xc686('0x34')],function(_0x50391a){var _0x22c6aa={};_0x22c6aa[_0x50391a]={'$like':'%'+_0x5d984b[_0xc686('0x2f')][_0xc686('0x3d')]+'%'};return _0x22c6aa;})});}_0x4ffe8c=_[_0xc686('0x3b')]({},_0x4ffe8c,_0x5d984b[_0xc686('0x3e')]);return _0x4bea93[_0xc686('0x50')](_0x4ffe8c);}})[_0xc686('0x24')](function(_0x4085c2){if(_0x4085c2){_0x1c79bf=_0x4085c2['length'];if(!_0x5d984b[_0xc686('0x2f')][_0xc686('0x52')](_0xc686('0x36'))){_0x4ffe8c[_0xc686('0x1d')]=qs[_0xc686('0x1d')](_0x5d984b[_0xc686('0x2f')][_0xc686('0x1d')]);_0x4ffe8c['offset']=qs['offset'](_0x5d984b[_0xc686('0x2f')][_0xc686('0x1c')]);}return _0x4bea93[_0xc686('0x50')](_0x4ffe8c);}})[_0xc686('0x24')](function(_0x330437){if(_0x330437){return _0x330437?{'count':_0x1c79bf,'rows':_0x330437}:null;}})[_0xc686('0x24')](respondWithResult(_0x5ef65a,null))['catch'](handleError(_0x5ef65a,null));};exports[_0xc686('0x53')]=function(_0x1abb27,_0xb6db9e,_0x493cec){return db['Action'][_0xc686('0x49')]({'where':{'id':_0x1abb27[_0xc686('0x47')]['id']}})[_0xc686('0x24')](handleEntityNotFound(_0xb6db9e,null))['then'](function(_0x1939b1){if(_0x1939b1){return _0x1939b1['addActions'](_0x1abb27[_0xc686('0x4b')][_0xc686('0x4f')],_['omit'](_0x1abb27[_0xc686('0x4b')],['ids','id'])||{});}})[_0xc686('0x24')](respondWithResult(_0xb6db9e,null))[_0xc686('0x45')](handleError(_0xb6db9e,null));};exports['getActions']=function(_0x30149a,_0x5122c1,_0x48bf45){var _0x52cd2d={};var _0x391ffb={};var _0x3ce673;var _0x3b0c17;return db[_0xc686('0x3f')][_0xc686('0x51')]({'where':{'id':_0x30149a['params']['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x5122c1,null))[_0xc686('0x24')](function(_0x4eb44b){if(_0x4eb44b){_0x3ce673=_0x4eb44b;_0x391ffb[_0xc686('0x32')]=_[_0xc686('0x48')](db[_0xc686('0x54')][_0xc686('0x2b')]);_0x391ffb[_0xc686('0x2f')]=_[_0xc686('0x48')](_0x30149a['query']);_0x391ffb['filters']=_['intersection'](_0x391ffb[_0xc686('0x32')],_0x391ffb[_0xc686('0x2f')]);_0x52cd2d[_0xc686('0x34')]=_[_0xc686('0x31')](_0x391ffb[_0xc686('0x32')],qs[_0xc686('0x33')](_0x30149a[_0xc686('0x2f')]['fields']));_0x52cd2d[_0xc686('0x34')]=_0x52cd2d[_0xc686('0x34')][_0xc686('0x35')]?_0x52cd2d['attributes']:_0x391ffb[_0xc686('0x32')];_0x52cd2d[_0xc686('0x37')]=qs['sort'](_0x30149a[_0xc686('0x2f')]['sort']);_0x52cd2d[_0xc686('0x39')]=qs[_0xc686('0x30')](_['pick'](_0x30149a[_0xc686('0x2f')],_0x391ffb[_0xc686('0x30')]));if(_0x30149a[_0xc686('0x2f')]['filter']){_0x52cd2d[_0xc686('0x39')]=_[_0xc686('0x3b')](_0x52cd2d[_0xc686('0x39')],{'$or':_[_0xc686('0x2a')](_0x52cd2d[_0xc686('0x34')],function(_0x3d86a8){var _0x5dc7bb={};_0x5dc7bb[_0x3d86a8]={'$like':'%'+_0x30149a[_0xc686('0x2f')][_0xc686('0x3d')]+'%'};return _0x5dc7bb;})});}_0x52cd2d=_[_0xc686('0x3b')]({},_0x52cd2d,_0x30149a[_0xc686('0x3e')]);return _0x3ce673['getActions'](_0x52cd2d);}})['then'](function(_0x43c205){if(_0x43c205){_0x3b0c17=_0x43c205[_0xc686('0x35')];if(!_0x30149a[_0xc686('0x2f')][_0xc686('0x52')](_0xc686('0x36'))){_0x52cd2d[_0xc686('0x1d')]=qs[_0xc686('0x1d')](_0x30149a['query']['limit']);_0x52cd2d[_0xc686('0x1c')]=qs['offset'](_0x30149a[_0xc686('0x2f')][_0xc686('0x1c')]);}return _0x3ce673[_0xc686('0x55')](_0x52cd2d);}})[_0xc686('0x24')](function(_0x54d900){if(_0x54d900){return _0x54d900?{'count':_0x3b0c17,'rows':_0x54d900}:null;}})['then'](respondWithResult(_0x5122c1,null))[_0xc686('0x45')](handleError(_0x5122c1,null));};
\ No newline at end of file
+var _0x7347=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','field','filter','options','Automation','count','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','addConditions','Condition','ids','omit','addActions','findOne','order','getActions','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2c6af3,_0x3ce442){var _0x4895bf=function(_0x5566cf){while(--_0x5566cf){_0x2c6af3['push'](_0x2c6af3['shift']());}};_0x4895bf(++_0x3ce442);}(_0x7347,0xea));var _0x7734=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7347[_0x4ae6ef];return _0x3cbb4e;};'use strict';var pdf=require(_0x7734('0x0'));var emlformat=require(_0x7734('0x1'));var rimraf=require(_0x7734('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7734('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7734('0x4'));var util=require(_0x7734('0x5'));var path=require(_0x7734('0x6'));var sox=require(_0x7734('0x7'));var csv=require(_0x7734('0x8'));var ejs=require(_0x7734('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7734('0xa'));var jsforce=require(_0x7734('0xb'));var deskjs=require(_0x7734('0xc'));var toCsv=require(_0x7734('0x8'));var querystring=require(_0x7734('0xd'));var Papa=require(_0x7734('0xe'));var Redis=require(_0x7734('0xf'));var authService=require(_0x7734('0x10'));var qs=require(_0x7734('0x11'));var as=require(_0x7734('0x12'));var hardwareService=require(_0x7734('0x13'));var logger=require(_0x7734('0x14'))(_0x7734('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7734('0x16'))['db'];function respondWithStatusCode(_0x5c5b18,_0xcfb008){_0xcfb008=_0xcfb008||0xcc;return function(_0x163974){if(_0x163974){return _0x5c5b18['sendStatus'](_0xcfb008);}return _0x5c5b18[_0x7734('0x17')](_0xcfb008)[_0x7734('0x18')]();};}function respondWithResult(_0xe3ae3f,_0x23ddf0){_0x23ddf0=_0x23ddf0||0xc8;return function(_0x1262e1){if(_0x1262e1){return _0xe3ae3f['status'](_0x23ddf0)[_0x7734('0x19')](_0x1262e1);}};}function respondWithFilteredResult(_0x4b6f29,_0x481ac4){return function(_0x417daa){if(_0x417daa){var _0x5b356c=_0x417daa['count'],_0x5e2faf=_0x481ac4[_0x7734('0x1a')],_0x41797c=_0x481ac4[_0x7734('0x1a')]+_0x481ac4[_0x7734('0x1b')],_0x519a18;if(_0x41797c>=_0x5b356c){_0x41797c=_0x5b356c;_0x519a18=0xc8;}else{_0x519a18=0xce;}_0x4b6f29[_0x7734('0x17')](_0x519a18);return _0x4b6f29[_0x7734('0x1c')](_0x7734('0x1d'),_0x5e2faf+'-'+_0x41797c+'/'+_0x5b356c)[_0x7734('0x19')](_0x417daa);}return null;};}function patchUpdates(_0x2e7019){return function(_0x494a07){try{jsonpatch['apply'](_0x494a07,_0x2e7019,!![]);}catch(_0x289de5){return BPromise[_0x7734('0x1e')](_0x289de5);}return _0x494a07[_0x7734('0x1f')]();};}function saveUpdates(_0x3688d7,_0xa268dd){return function(_0x462e89){if(_0x462e89){return _0x462e89['update'](_0x3688d7)['then'](function(_0x3a2061){return _0x3a2061;});}return null;};}function removeEntity(_0x13e95a,_0x5ca023){return function(_0x232026){if(_0x232026){return _0x232026[_0x7734('0x20')]()[_0x7734('0x21')](function(){_0x13e95a[_0x7734('0x17')](0xcc)[_0x7734('0x18')]();});}};}function handleEntityNotFound(_0x5dde9f,_0x334abb){return function(_0x4c9a34){if(!_0x4c9a34){_0x5dde9f[_0x7734('0x22')](0x194);}return _0x4c9a34;};}function handleError(_0x2ae0af,_0x3e0fc3){_0x3e0fc3=_0x3e0fc3||0x1f4;return function(_0x4f0733){logger[_0x7734('0x23')](_0x4f0733[_0x7734('0x24')]);if(_0x4f0733[_0x7734('0x25')]){delete _0x4f0733['name'];}_0x2ae0af[_0x7734('0x17')](_0x3e0fc3)[_0x7734('0x26')](_0x4f0733);};}exports[_0x7734('0x27')]=function(_0x5ecc5,_0x5ce59c){var _0x404cdc={},_0x39a212={},_0x56dfd8={'count':0x0,'rows':[]};var _0x316f30=_['map'](db['Automation'][_0x7734('0x28')],function(_0x2ecbdb){return{'name':_0x2ecbdb['fieldName'],'type':_0x2ecbdb['type'][_0x7734('0x29')]};});_0x39a212[_0x7734('0x2a')]=_[_0x7734('0x2b')](_0x316f30,_0x7734('0x25'));_0x39a212[_0x7734('0x2c')]=_[_0x7734('0x2d')](_0x5ecc5[_0x7734('0x2c')]);_0x39a212[_0x7734('0x2e')]=_[_0x7734('0x2f')](_0x39a212[_0x7734('0x2a')],_0x39a212['query']);_0x404cdc[_0x7734('0x30')]=_[_0x7734('0x2f')](_0x39a212['model'],qs[_0x7734('0x31')](_0x5ecc5[_0x7734('0x2c')][_0x7734('0x31')]));_0x404cdc[_0x7734('0x30')]=_0x404cdc[_0x7734('0x30')][_0x7734('0x32')]?_0x404cdc[_0x7734('0x30')]:_0x39a212[_0x7734('0x2a')];if(!_0x5ecc5[_0x7734('0x2c')][_0x7734('0x33')](_0x7734('0x34'))){_0x404cdc[_0x7734('0x1b')]=qs[_0x7734('0x1b')](_0x5ecc5[_0x7734('0x2c')][_0x7734('0x1b')]);_0x404cdc[_0x7734('0x1a')]=qs['offset'](_0x5ecc5[_0x7734('0x2c')][_0x7734('0x1a')]);}_0x404cdc['order']=qs[_0x7734('0x35')](_0x5ecc5['query'][_0x7734('0x35')]);_0x404cdc[_0x7734('0x36')]=qs['filters'](_[_0x7734('0x37')](_0x5ecc5['query'],_0x39a212[_0x7734('0x2e')]));if(_0x5ecc5[_0x7734('0x2c')]['filter']){_0x404cdc[_0x7734('0x36')]=_[_0x7734('0x38')](_0x404cdc[_0x7734('0x36')],{'$or':_['map'](_0x316f30,function(_0x3b6e4b){if(_0x3b6e4b[_0x7734('0x39')][_0x7734('0x29')]!==_0x7734('0x3a')){var _0x6ed475={};_0x6ed475[_0x3b6e4b[_0x7734('0x3b')]]={'$like':'%'+_0x5ecc5['query'][_0x7734('0x3c')]+'%'};return _0x6ed475;}})});}_0x404cdc=_['merge']({},_0x404cdc,_0x5ecc5[_0x7734('0x3d')]);var _0x3aaa5f={'where':_0x404cdc[_0x7734('0x36')]};return db[_0x7734('0x3e')][_0x7734('0x3f')](_0x3aaa5f)[_0x7734('0x21')](function(_0x11e9b2){_0x56dfd8[_0x7734('0x3f')]=_0x11e9b2;if(_0x5ecc5[_0x7734('0x2c')][_0x7734('0x40')]){_0x404cdc[_0x7734('0x41')]=[{'all':!![]}];}return db[_0x7734('0x3e')][_0x7734('0x42')](_0x404cdc);})[_0x7734('0x21')](function(_0x1ec582){_0x56dfd8[_0x7734('0x43')]=_0x1ec582;return _0x56dfd8;})[_0x7734('0x21')](respondWithFilteredResult(_0x5ce59c,_0x404cdc))[_0x7734('0x44')](handleError(_0x5ce59c,null));};exports[_0x7734('0x45')]=function(_0x515729,_0xf191b1){var _0x241d72={'raw':![],'where':{'id':_0x515729['params']['id']}},_0x1c9dec={};_0x1c9dec['model']=_[_0x7734('0x2d')](db[_0x7734('0x3e')][_0x7734('0x28')]);_0x1c9dec['query']=_[_0x7734('0x2d')](_0x515729[_0x7734('0x2c')]);_0x1c9dec[_0x7734('0x2e')]=_['intersection'](_0x1c9dec['model'],_0x1c9dec[_0x7734('0x2c')]);_0x241d72[_0x7734('0x30')]=_[_0x7734('0x2f')](_0x1c9dec[_0x7734('0x2a')],qs[_0x7734('0x31')](_0x515729['query'][_0x7734('0x31')]));_0x241d72[_0x7734('0x30')]=_0x241d72['attributes'][_0x7734('0x32')]?_0x241d72[_0x7734('0x30')]:_0x1c9dec['model'];if(_0x515729[_0x7734('0x2c')][_0x7734('0x40')]){_0x241d72[_0x7734('0x41')]=[{'all':!![]}];}_0x241d72=_['merge']({},_0x241d72,_0x515729[_0x7734('0x3d')]);return db[_0x7734('0x3e')][_0x7734('0x46')](_0x241d72)[_0x7734('0x21')](handleEntityNotFound(_0xf191b1,null))['then'](respondWithResult(_0xf191b1,null))['catch'](handleError(_0xf191b1,null));};exports[_0x7734('0x47')]=function(_0x1a424a,_0x18b816){return db[_0x7734('0x3e')][_0x7734('0x47')](_0x1a424a[_0x7734('0x48')],{})['then'](respondWithResult(_0x18b816,0xc9))[_0x7734('0x44')](handleError(_0x18b816,null));};exports[_0x7734('0x49')]=function(_0x31fa53,_0x264545){if(_0x31fa53[_0x7734('0x48')]['id']){delete _0x31fa53[_0x7734('0x48')]['id'];}return db['Automation'][_0x7734('0x46')]({'where':{'id':_0x31fa53[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x264545,null))[_0x7734('0x21')](saveUpdates(_0x31fa53[_0x7734('0x48')],null))['then'](respondWithResult(_0x264545,null))['catch'](handleError(_0x264545,null));};exports[_0x7734('0x20')]=function(_0xf62465,_0x28badb){return db['Automation'][_0x7734('0x46')]({'where':{'id':_0xf62465[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x28badb,null))['then'](removeEntity(_0x28badb,null))['catch'](handleError(_0x28badb,null));};exports[_0x7734('0x4b')]=function(_0x370a6d,_0x25dea5,_0x1e4c32){return db[_0x7734('0x4c')][_0x7734('0x46')]({'where':{'id':_0x370a6d[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x25dea5,null))['then'](function(_0x7495f2){if(_0x7495f2){return _0x7495f2[_0x7734('0x4b')](_0x370a6d[_0x7734('0x48')][_0x7734('0x4d')],_[_0x7734('0x4e')](_0x370a6d['body'],[_0x7734('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x25dea5,null))[_0x7734('0x44')](handleError(_0x25dea5,null));};exports['getConditions']=function(_0xe27bb2,_0x433afd,_0x22e973){var _0x3bf264={};var _0x5f4c17={};var _0x34797f;var _0x4c5afd;return db['Automation']['findOne']({'where':{'id':_0xe27bb2[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x433afd,null))['then'](function(_0x3e9cf7){if(_0x3e9cf7){_0x34797f=_0x3e9cf7;_0x5f4c17['model']=_[_0x7734('0x2d')](db[_0x7734('0x4c')][_0x7734('0x28')]);_0x5f4c17[_0x7734('0x2c')]=_['keys'](_0xe27bb2[_0x7734('0x2c')]);_0x5f4c17['filters']=_[_0x7734('0x2f')](_0x5f4c17[_0x7734('0x2a')],_0x5f4c17['query']);_0x3bf264['attributes']=_[_0x7734('0x2f')](_0x5f4c17[_0x7734('0x2a')],qs[_0x7734('0x31')](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x31')]));_0x3bf264[_0x7734('0x30')]=_0x3bf264['attributes']['length']?_0x3bf264[_0x7734('0x30')]:_0x5f4c17['model'];_0x3bf264['order']=qs['sort'](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x35')]);_0x3bf264[_0x7734('0x36')]=qs[_0x7734('0x2e')](_[_0x7734('0x37')](_0xe27bb2['query'],_0x5f4c17[_0x7734('0x2e')]));if(_0xe27bb2[_0x7734('0x2c')][_0x7734('0x3c')]){_0x3bf264[_0x7734('0x36')]=_[_0x7734('0x38')](_0x3bf264[_0x7734('0x36')],{'$or':_[_0x7734('0x2b')](_0x3bf264[_0x7734('0x30')],function(_0x1f817){var _0x4b6399={};_0x4b6399[_0x1f817]={'$like':'%'+_0xe27bb2[_0x7734('0x2c')][_0x7734('0x3c')]+'%'};return _0x4b6399;})});}_0x3bf264=_['merge']({},_0x3bf264,_0xe27bb2[_0x7734('0x3d')]);return _0x34797f['getConditions'](_0x3bf264);}})['then'](function(_0x20632f){if(_0x20632f){_0x4c5afd=_0x20632f[_0x7734('0x32')];if(!_0xe27bb2['query'][_0x7734('0x33')](_0x7734('0x34'))){_0x3bf264[_0x7734('0x1b')]=qs[_0x7734('0x1b')](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x1b')]);_0x3bf264[_0x7734('0x1a')]=qs[_0x7734('0x1a')](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x1a')]);}return _0x34797f['getConditions'](_0x3bf264);}})['then'](function(_0x5dd14e){if(_0x5dd14e){return _0x5dd14e?{'count':_0x4c5afd,'rows':_0x5dd14e}:null;}})[_0x7734('0x21')](respondWithResult(_0x433afd,null))[_0x7734('0x44')](handleError(_0x433afd,null));};exports[_0x7734('0x4f')]=function(_0x224f93,_0x194361,_0xf3dc93){return db['Action']['find']({'where':{'id':_0x224f93[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x194361,null))[_0x7734('0x21')](function(_0x2041f6){if(_0x2041f6){return _0x2041f6[_0x7734('0x4f')](_0x224f93[_0x7734('0x48')][_0x7734('0x4d')],_[_0x7734('0x4e')](_0x224f93[_0x7734('0x48')],[_0x7734('0x4d'),'id'])||{});}})[_0x7734('0x21')](respondWithResult(_0x194361,null))[_0x7734('0x44')](handleError(_0x194361,null));};exports['getActions']=function(_0x65dc19,_0x5a1474,_0x63fa0f){var _0x2bbef5={};var _0x55dc0b={};var _0xda57b5;var _0x5f3028;return db['Automation'][_0x7734('0x50')]({'where':{'id':_0x65dc19[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x5a1474,null))[_0x7734('0x21')](function(_0x20afd1){if(_0x20afd1){_0xda57b5=_0x20afd1;_0x55dc0b[_0x7734('0x2a')]=_[_0x7734('0x2d')](db['Action'][_0x7734('0x28')]);_0x55dc0b[_0x7734('0x2c')]=_[_0x7734('0x2d')](_0x65dc19[_0x7734('0x2c')]);_0x55dc0b[_0x7734('0x2e')]=_[_0x7734('0x2f')](_0x55dc0b['model'],_0x55dc0b['query']);_0x2bbef5[_0x7734('0x30')]=_[_0x7734('0x2f')](_0x55dc0b['model'],qs[_0x7734('0x31')](_0x65dc19[_0x7734('0x2c')][_0x7734('0x31')]));_0x2bbef5[_0x7734('0x30')]=_0x2bbef5[_0x7734('0x30')]['length']?_0x2bbef5[_0x7734('0x30')]:_0x55dc0b[_0x7734('0x2a')];_0x2bbef5[_0x7734('0x51')]=qs[_0x7734('0x35')](_0x65dc19[_0x7734('0x2c')][_0x7734('0x35')]);_0x2bbef5[_0x7734('0x36')]=qs[_0x7734('0x2e')](_[_0x7734('0x37')](_0x65dc19[_0x7734('0x2c')],_0x55dc0b['filters']));if(_0x65dc19[_0x7734('0x2c')][_0x7734('0x3c')]){_0x2bbef5[_0x7734('0x36')]=_['merge'](_0x2bbef5['where'],{'$or':_['map'](_0x2bbef5[_0x7734('0x30')],function(_0x2e1602){var _0x3a0730={};_0x3a0730[_0x2e1602]={'$like':'%'+_0x65dc19['query'][_0x7734('0x3c')]+'%'};return _0x3a0730;})});}_0x2bbef5=_[_0x7734('0x38')]({},_0x2bbef5,_0x65dc19['options']);return _0xda57b5[_0x7734('0x52')](_0x2bbef5);}})['then'](function(_0x15d7d4){if(_0x15d7d4){_0x5f3028=_0x15d7d4['length'];if(!_0x65dc19[_0x7734('0x2c')][_0x7734('0x33')](_0x7734('0x34'))){_0x2bbef5[_0x7734('0x1b')]=qs['limit'](_0x65dc19[_0x7734('0x2c')][_0x7734('0x1b')]);_0x2bbef5[_0x7734('0x1a')]=qs['offset'](_0x65dc19['query'][_0x7734('0x1a')]);}return _0xda57b5[_0x7734('0x52')](_0x2bbef5);}})[_0x7734('0x21')](function(_0x55bfcf){if(_0x55bfcf){return _0x55bfcf?{'count':_0x5f3028,'rows':_0x55bfcf}:null;}})['then'](respondWithResult(_0x5a1474,null))[_0x7734('0x44')](handleError(_0x5a1474,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ed05876..3302eac 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 _0x4a29=['rimraf','../../config/environment','exports','Automation','tools_automations','lodash','util','api','bluebird','request-promise'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x4a29,0x18b));var _0x94a2=function(_0x1987f2,_0x3a8d16){_0x1987f2=_0x1987f2-0x0;var _0x3ff49c=_0x4a29[_0x1987f2];return _0x3ff49c;};'use strict';var _=require(_0x94a2('0x0'));var util=require(_0x94a2('0x1'));var logger=require('../../config/logger')(_0x94a2('0x2'));var moment=require('moment');var BPromise=require(_0x94a2('0x3'));var rp=require(_0x94a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94a2('0x5'));var config=require(_0x94a2('0x6'));var attributes=require('./automation.attributes');module[_0x94a2('0x7')]=function(_0x22085e,_0x8c1a90){return _0x22085e['define'](_0x94a2('0x8'),attributes,{'tableName':_0x94a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64ad=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash'];(function(_0x1aece6,_0x5e82f3){var _0x53a506=function(_0x11d84e){while(--_0x11d84e){_0x1aece6['push'](_0x1aece6['shift']());}};_0x53a506(++_0x5e82f3);}(_0x64ad,0x1e0));var _0xd64a=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x64ad[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0xd64a('0x0'));var util=require(_0xd64a('0x1'));var logger=require(_0xd64a('0x2'))(_0xd64a('0x3'));var moment=require(_0xd64a('0x4'));var BPromise=require(_0xd64a('0x5'));var rp=require(_0xd64a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd64a('0x7'));var config=require(_0xd64a('0x8'));var attributes=require(_0xd64a('0x9'));module[_0xd64a('0xa')]=function(_0x417160,_0x15c326){return _0x417160[_0xd64a('0xb')](_0xd64a('0xc'),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 d06611e..81f1b7b 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 _0xa1bb=['request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x453a15,_0xcab71f){var _0x2e7f2d=function(_0x141a0b){while(--_0x141a0b){_0x453a15['push'](_0x453a15['shift']());}};_0x2e7f2d(++_0xcab71f);}(_0xa1bb,0x69));var _0xba1b=function(_0xb6a4f,_0x1c0ca2){_0xb6a4f=_0xb6a4f-0x0;var _0x4d7ff6=_0xa1bb[_0xb6a4f];return _0x4d7ff6;};'use strict';var _=require('lodash');var util=require(_0xba1b('0x0'));var moment=require(_0xba1b('0x1'));var BPromise=require(_0xba1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1b('0x3'));var db=require(_0xba1b('0x4'))['db'];var utils=require(_0xba1b('0x5'));var logger=require(_0xba1b('0x6'))(_0xba1b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xba1b('0x8')][_0xba1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8e45,_0x3264e1,_0xa6e3d6){return new BPromise(function(_0x12141d,_0x567457){return client[_0xba1b('0xa')](_0x5c8e45,_0xa6e3d6)[_0xba1b('0xb')](function(_0xeb5a7c){logger['info']('Automation,\x20%s,\x20%s',_0x3264e1,'request\x20sent');logger[_0xba1b('0xc')](_0xba1b('0xd'),_0x3264e1,_0xba1b('0xe'),JSON[_0xba1b('0xf')](_0xeb5a7c));if(_0xeb5a7c[_0xba1b('0x10')]){if(_0xeb5a7c['error'][_0xba1b('0x11')]===0x1f4){logger[_0xba1b('0x10')](_0xba1b('0x12'),_0x3264e1,_0xeb5a7c[_0xba1b('0x10')]['message']);return _0x567457(_0xeb5a7c[_0xba1b('0x10')][_0xba1b('0x13')]);}logger[_0xba1b('0x10')](_0xba1b('0x12'),_0x3264e1,_0xeb5a7c[_0xba1b('0x10')][_0xba1b('0x13')]);return _0x12141d(_0xeb5a7c[_0xba1b('0x10')][_0xba1b('0x13')]);}else{logger[_0xba1b('0x14')]('Automation,\x20%s,\x20%s',_0x3264e1,'request\x20sent');_0x12141d(_0xeb5a7c[_0xba1b('0x15')][_0xba1b('0x13')]);}})[_0xba1b('0x16')](function(_0x4dba50){logger[_0xba1b('0x10')](_0xba1b('0x12'),_0x3264e1,_0x4dba50);_0x567457(_0x4dba50);});});}
\ No newline at end of file
+var _0xc3c7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','error','code','Automation,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xc3c7,0x159));var _0x7c3c=function(_0x34f307,_0x4f1d8e){_0x34f307=_0x34f307-0x0;var _0x47e400=_0xc3c7[_0x34f307];return _0x47e400;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c3c('0x0'));var BPromise=require(_0x7c3c('0x1'));var rs=require(_0x7c3c('0x2'));var fs=require('fs');var Redis=require(_0x7c3c('0x3'));var db=require(_0x7c3c('0x4'))['db'];var utils=require(_0x7c3c('0x5'));var logger=require(_0x7c3c('0x6'))(_0x7c3c('0x7'));var config=require(_0x7c3c('0x8'));var jayson=require(_0x7c3c('0x9'));var client=jayson[_0x7c3c('0xa')][_0x7c3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18e606,_0x504947,_0x349df3){return new BPromise(function(_0x4e20fc,_0x1e6966){return client[_0x7c3c('0xc')](_0x18e606,_0x349df3)[_0x7c3c('0xd')](function(_0x106ad1){logger[_0x7c3c('0xe')]('Automation,\x20%s,\x20%s',_0x504947,'request\x20sent');logger[_0x7c3c('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x504947,'request\x20sent',JSON['stringify'](_0x106ad1));if(_0x106ad1[_0x7c3c('0x10')]){if(_0x106ad1[_0x7c3c('0x10')][_0x7c3c('0x11')]===0x1f4){logger[_0x7c3c('0x10')](_0x7c3c('0x12'),_0x504947,_0x106ad1[_0x7c3c('0x10')][_0x7c3c('0x13')]);return _0x1e6966(_0x106ad1['error'][_0x7c3c('0x13')]);}logger['error'](_0x7c3c('0x12'),_0x504947,_0x106ad1[_0x7c3c('0x10')][_0x7c3c('0x13')]);return _0x4e20fc(_0x106ad1['error']['message']);}else{logger[_0x7c3c('0xe')](_0x7c3c('0x12'),_0x504947,_0x7c3c('0x14'));_0x4e20fc(_0x106ad1[_0x7c3c('0x15')]['message']);}})[_0x7c3c('0x16')](function(_0xc5300f){logger[_0x7c3c('0x10')](_0x7c3c('0x12'),_0x504947,_0xc5300f);_0x1e6966(_0xc5300f);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index a475b02..58af645 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 _0x61a8=['util','connect-timeout','express','Router','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions','addActions','/:id','update','destroy','exports'];(function(_0x3f0928,_0x1746cb){var _0x58640f=function(_0x1f4f43){while(--_0x1f4f43){_0x3f0928['push'](_0x3f0928['shift']());}};_0x58640f(++_0x1746cb);}(_0x61a8,0x1ce));var _0x861a=function(_0x47470f,_0x411315){_0x47470f=_0x47470f-0x0;var _0x5b16a4=_0x61a8[_0x47470f];return _0x5b16a4;};'use strict';var multer=require('multer');var util=require(_0x861a('0x0'));var path=require('path');var timeout=require(_0x861a('0x1'));var express=require(_0x861a('0x2'));var router=express[_0x861a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x861a('0x4'));var config=require('../../config/environment');var controller=require(_0x861a('0x5'));router[_0x861a('0x6')]('/',auth[_0x861a('0x7')](),controller[_0x861a('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x861a('0x9')]);router[_0x861a('0x6')](_0x861a('0xa'),auth[_0x861a('0x7')](),controller['getConditions']);router[_0x861a('0x6')]('/:id/actions',auth[_0x861a('0x7')](),controller[_0x861a('0xb')]);router[_0x861a('0xc')]('/',auth[_0x861a('0x7')](),controller[_0x861a('0xd')]);router['post'](_0x861a('0xa'),auth[_0x861a('0x7')](),controller[_0x861a('0xe')]);router['post'](_0x861a('0xf'),auth[_0x861a('0x7')](),controller[_0x861a('0x10')]);router['put'](_0x861a('0x11'),auth[_0x861a('0x7')](),controller[_0x861a('0x12')]);router['delete']('/:id',auth[_0x861a('0x7')](),controller[_0x861a('0x13')]);module[_0x861a('0x14')]=router;
\ No newline at end of file
+var _0x98e5=['/:id/actions','getActions','post','addConditions','put','update','delete','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','/:id/conditions','get'];(function(_0x13f0d2,_0x27b14c){var _0x81b5fc=function(_0x1ee03b){while(--_0x1ee03b){_0x13f0d2['push'](_0x13f0d2['shift']());}};_0x81b5fc(++_0x27b14c);}(_0x98e5,0x1d4));var _0x598e=function(_0x59cf8a,_0x163bb9){_0x59cf8a=_0x59cf8a-0x0;var _0x22dde8=_0x98e5[_0x59cf8a];return _0x22dde8;};'use strict';var multer=require(_0x598e('0x0'));var util=require(_0x598e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x598e('0x2')]();var auth=require(_0x598e('0x3'));var interaction=require(_0x598e('0x4'));var config=require(_0x598e('0x5'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x598e('0x6')]);router['get'](_0x598e('0x7'),auth[_0x598e('0x8')](),controller[_0x598e('0x9')]);router['get'](_0x598e('0xa'),auth[_0x598e('0x8')](),controller['getConditions']);router[_0x598e('0xb')](_0x598e('0xc'),auth[_0x598e('0x8')](),controller[_0x598e('0xd')]);router[_0x598e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x598e('0xe')](_0x598e('0xa'),auth[_0x598e('0x8')](),controller[_0x598e('0xf')]);router[_0x598e('0xe')](_0x598e('0xc'),auth[_0x598e('0x8')](),controller['addActions']);router[_0x598e('0x10')]('/:id',auth[_0x598e('0x8')](),controller[_0x598e('0x11')]);router[_0x598e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x598e('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 8658349..4d6ff7e 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 _0x1a8c=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never'];(function(_0x34ed99,_0x3e346d){var _0x35d584=function(_0x2dd906){while(--_0x2dd906){_0x34ed99['push'](_0x34ed99['shift']());}};_0x35d584(++_0x3e346d);}(_0x1a8c,0x12d));var _0xc1a8=function(_0x46f13e,_0x5b049c){_0x46f13e=_0x46f13e-0x0;var _0x5856e2=_0x1a8c[_0x46f13e];return _0x5856e2;};'use strict';var Sequelize=require('sequelize');module[_0xc1a8('0x0')]={'name':{'type':Sequelize[_0xc1a8('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc1a8('0x2')](_0xc1a8('0x3')),'allowNull':![],'defaultValue':_0xc1a8('0x3')},'description':{'type':Sequelize[_0xc1a8('0x1')]},'active':{'type':Sequelize[_0xc1a8('0x4')],'defaultValue':0x0,'comment':_0xc1a8('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc1a8('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc1a8('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc1a8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc1a8('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1a8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1a8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1a8('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1a8('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'defaultValue':0x3,'comment':_0xc1a8('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc1a8('0x8')](0x5)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1a8('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc1a8('0xf')},'dialTimezone':{'type':Sequelize[_0xc1a8('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc1a8('0x2')](_0xc1a8('0x10'),_0xc1a8('0x11'),_0xc1a8('0x12')),'defaultValue':_0xc1a8('0x10')},'dialAMDActive':{'type':Sequelize[_0xc1a8('0x4')],'defaultValue':0x0,'comment':_0xc1a8('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1a8('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc1a8('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1a8('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc1a8('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc1a8('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc1a8('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1a8('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc1a8('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc1a8('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc1a8('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc1a8('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc1a8('0x2')](_0xc1a8('0x1a'),'ASC'),'defaultValue':_0xc1a8('0x1a')},'dialPrefix':{'type':Sequelize[_0xc1a8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc1a8('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc1a8('0x1b')},'dialCutDigit':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc1a8('0x1c')}};
\ No newline at end of file
+var _0x73ac=['sequelize','exports','STRING','ENUM','ivr','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)','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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x73ac,0x168));var _0xc73a=function(_0x25029e,_0x3afff3){_0x25029e=_0x25029e-0x0;var _0x382154=_0x73ac[_0x25029e];return _0x382154;};'use strict';var Sequelize=require(_0xc73a('0x0'));module[_0xc73a('0x1')]={'name':{'type':Sequelize[_0xc73a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc73a('0x3')](_0xc73a('0x4')),'allowNull':![],'defaultValue':_0xc73a('0x4')},'description':{'type':Sequelize[_0xc73a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc73a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc73a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc73a('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc73a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc73a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc73a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc73a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc73a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc73a('0x6')](0x5)[_0xc73a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc73a('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc73a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc73a('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc73a('0x6')](0x5)[_0xc73a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc73a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc73a('0xe')},'dialTimezone':{'type':Sequelize[_0xc73a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc73a('0x2')],'defaultValue':_0xc73a('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc73a('0x3')]('always',_0xc73a('0x10'),_0xc73a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc73a('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc73a('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc73a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc73a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc73a('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc73a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc73a('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc73a('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc73a('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc73a('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc73a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc73a('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc73a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc73a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc73a('0x1b'),_0xc73a('0x1c')),'defaultValue':_0xc73a('0x1b')},'dialPrefix':{'type':Sequelize[_0xc73a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc73a('0x1d')},'dialCutDigit':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5140cad..3d22db5 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 _0x2960=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','update','then','destroy','IvrCampaigns','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','updatedAt','body','omit','createdAt','getHoppers','CmHopper','hasOwnProperty','rows','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','from','CampaignId\x20=\x20?','onlyIfOpen','push','sequelize','all','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3f1c23,_0x14e25e){var _0x5c901d=function(_0xc19b77){while(--_0xc19b77){_0x3f1c23['push'](_0x3f1c23['shift']());}};_0x5c901d(++_0x14e25e);}(_0x2960,0x71));var _0x0296=function(_0x13ed6f,_0x515c3c){_0x13ed6f=_0x13ed6f-0x0;var _0x3b42dd=_0x2960[_0x13ed6f];return _0x3b42dd;};'use strict';var pdf=require(_0x0296('0x0'));var emlformat=require(_0x0296('0x1'));var rimraf=require(_0x0296('0x2'));var zipdir=require(_0x0296('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0296('0x4'));var moment=require(_0x0296('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0296('0x6'));var util=require(_0x0296('0x7'));var path=require(_0x0296('0x8'));var sox=require('sox');var csv=require(_0x0296('0x9'));var ejs=require(_0x0296('0xa'));var fs=require('fs');var _=require(_0x0296('0xb'));var squel=require(_0x0296('0xc'));var crypto=require(_0x0296('0xd'));var jsforce=require(_0x0296('0xe'));var deskjs=require(_0x0296('0xf'));var toCsv=require(_0x0296('0x9'));var querystring=require(_0x0296('0x10'));var Papa=require(_0x0296('0x11'));var Redis=require(_0x0296('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0296('0x13'));var as=require(_0x0296('0x14'));var hardwareService=require(_0x0296('0x15'));var logger=require(_0x0296('0x16'))('api');var utils=require(_0x0296('0x17'));var config=require(_0x0296('0x18'));var db=require(_0x0296('0x19'))['db'];function respondWithStatusCode(_0x15de09,_0x2fb9ea){_0x2fb9ea=_0x2fb9ea||0xcc;return function(_0x4c532b){if(_0x4c532b){return _0x15de09[_0x0296('0x1a')](_0x2fb9ea);}return _0x15de09['status'](_0x2fb9ea)[_0x0296('0x1b')]();};}function respondWithResult(_0x1072bc,_0xde7543){_0xde7543=_0xde7543||0xc8;return function(_0x2ba2f3){if(_0x2ba2f3){return _0x1072bc[_0x0296('0x1c')](_0xde7543)[_0x0296('0x1d')](_0x2ba2f3);}};}function respondWithFilteredResult(_0x5230a7,_0x2607ee){return function(_0x3551f9){if(_0x3551f9){var _0x3c00f3=_0x3551f9[_0x0296('0x1e')],_0x318891=_0x2607ee[_0x0296('0x1f')],_0x16b263=_0x2607ee['offset']+_0x2607ee[_0x0296('0x20')],_0x29ef6f;if(_0x16b263>=_0x3c00f3){_0x16b263=_0x3c00f3;_0x29ef6f=0xc8;}else{_0x29ef6f=0xce;}_0x5230a7[_0x0296('0x1c')](_0x29ef6f);return _0x5230a7['set']('Content-Range',_0x318891+'-'+_0x16b263+'/'+_0x3c00f3)[_0x0296('0x1d')](_0x3551f9);}return null;};}function patchUpdates(_0x19eede){return function(_0x38bc62){try{jsonpatch[_0x0296('0x21')](_0x38bc62,_0x19eede,!![]);}catch(_0x3781c8){return BPromise[_0x0296('0x22')](_0x3781c8);}return _0x38bc62['save']();};}function saveUpdates(_0x50b727,_0x7279bf){return function(_0x4e8e3e){if(_0x4e8e3e){return _0x4e8e3e[_0x0296('0x23')](_0x50b727)[_0x0296('0x24')](function(_0x4dd947){return _0x4dd947;});}return null;};}function removeEntity(_0x55afdc,_0x51c71f){return function(_0x1dc147){if(_0x1dc147){return _0x1dc147[_0x0296('0x25')]()['then'](function(){var _0x561d61=_0x1dc147['get']({'plain':!![]});var _0x58d8cb=_0x0296('0x26');return db['UserProfileResource'][_0x0296('0x25')]({'where':{'type':_0x58d8cb,'resourceId':_0x561d61['id']}})[_0x0296('0x24')](function(){return _0x1dc147;});})[_0x0296('0x24')](function(){_0x55afdc[_0x0296('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b8c1,_0x17b4b9){return function(_0x2d3eab){if(!_0x2d3eab){_0x47b8c1[_0x0296('0x1a')](0x194);}return _0x2d3eab;};}function handleError(_0x2e7f5f,_0xe71328){_0xe71328=_0xe71328||0x1f4;return function(_0x1832d8){logger[_0x0296('0x27')](_0x1832d8[_0x0296('0x28')]);if(_0x1832d8[_0x0296('0x29')]){delete _0x1832d8[_0x0296('0x29')];}_0x2e7f5f[_0x0296('0x1c')](_0xe71328)[_0x0296('0x2a')](_0x1832d8);};}exports[_0x0296('0x2b')]=function(_0x3ecb68,_0x100d3a){var _0x5ae0a8={},_0x495d2d={},_0xa94653={'count':0x0,'rows':[]};var _0x48b9db=_[_0x0296('0x2c')](db[_0x0296('0x2d')]['rawAttributes'],function(_0x57d6b5){return{'name':_0x57d6b5[_0x0296('0x2e')],'type':_0x57d6b5[_0x0296('0x2f')]['key']};});_0x495d2d[_0x0296('0x30')]=_[_0x0296('0x2c')](_0x48b9db,'name');_0x495d2d[_0x0296('0x31')]=_[_0x0296('0x32')](_0x3ecb68[_0x0296('0x31')]);_0x495d2d[_0x0296('0x33')]=_[_0x0296('0x34')](_0x495d2d[_0x0296('0x30')],_0x495d2d[_0x0296('0x31')]);_0x5ae0a8[_0x0296('0x35')]=_[_0x0296('0x34')](_0x495d2d[_0x0296('0x30')],qs['fields'](_0x3ecb68[_0x0296('0x31')][_0x0296('0x36')]));_0x5ae0a8['attributes']=_0x5ae0a8['attributes']['length']?_0x5ae0a8[_0x0296('0x35')]:_0x495d2d[_0x0296('0x30')];if(!_0x3ecb68[_0x0296('0x31')]['hasOwnProperty'](_0x0296('0x37'))){_0x5ae0a8[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x3ecb68[_0x0296('0x31')][_0x0296('0x20')]);_0x5ae0a8[_0x0296('0x1f')]=qs['offset'](_0x3ecb68['query'][_0x0296('0x1f')]);}_0x5ae0a8[_0x0296('0x38')]=qs['sort'](_0x3ecb68[_0x0296('0x31')][_0x0296('0x39')]);_0x5ae0a8[_0x0296('0x3a')]=qs['filters'](_[_0x0296('0x3b')](_0x3ecb68[_0x0296('0x31')],_0x495d2d[_0x0296('0x33')]));if(_0x3ecb68[_0x0296('0x31')]['filter']){_0x5ae0a8[_0x0296('0x3a')]=_[_0x0296('0x3c')](_0x5ae0a8[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x48b9db,function(_0x56367d){if(_0x56367d['type'][_0x0296('0x3d')]!==_0x0296('0x3e')){var _0x4b4642={};_0x4b4642[_0x56367d[_0x0296('0x3f')]]={'$like':'%'+_0x3ecb68[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0x4b4642;}})});}_0x5ae0a8=_[_0x0296('0x3c')]({},_0x5ae0a8,_0x3ecb68[_0x0296('0x41')]);var _0x60b583={'where':_0x5ae0a8[_0x0296('0x3a')]};return db[_0x0296('0x2d')][_0x0296('0x1e')](_0x60b583)[_0x0296('0x24')](function(_0x16e20a){_0xa94653[_0x0296('0x1e')]=_0x16e20a;if(_0x3ecb68[_0x0296('0x31')]['includeAll']){_0x5ae0a8[_0x0296('0x42')]=[{'all':!![]}];}return db[_0x0296('0x2d')][_0x0296('0x43')](_0x5ae0a8);})[_0x0296('0x24')](function(_0x2acfd2){_0xa94653['rows']=_0x2acfd2;return _0xa94653;})['then'](respondWithFilteredResult(_0x100d3a,_0x5ae0a8))[_0x0296('0x44')](handleError(_0x100d3a,null));};exports[_0x0296('0x45')]=function(_0x46c626,_0x410249){var _0x5bfb92={'raw':![],'where':{'id':_0x46c626[_0x0296('0x46')]['id']}},_0xe10633={};_0xe10633['model']=_[_0x0296('0x32')](db['Campaign'][_0x0296('0x47')]);_0xe10633[_0x0296('0x31')]=_[_0x0296('0x32')](_0x46c626['query']);_0xe10633[_0x0296('0x33')]=_['intersection'](_0xe10633['model'],_0xe10633[_0x0296('0x31')]);_0x5bfb92[_0x0296('0x35')]=_[_0x0296('0x34')](_0xe10633[_0x0296('0x30')],qs['fields'](_0x46c626[_0x0296('0x31')][_0x0296('0x36')]));_0x5bfb92['attributes']=_0x5bfb92[_0x0296('0x35')]['length']?_0x5bfb92[_0x0296('0x35')]:_0xe10633[_0x0296('0x30')];if(_0x46c626[_0x0296('0x31')][_0x0296('0x48')]){_0x5bfb92[_0x0296('0x42')]=[{'all':!![]}];}_0x5bfb92=_[_0x0296('0x3c')]({},_0x5bfb92,_0x46c626['options']);return db['Campaign']['find'](_0x5bfb92)[_0x0296('0x24')](handleEntityNotFound(_0x410249,null))[_0x0296('0x24')](respondWithResult(_0x410249,null))[_0x0296('0x44')](handleError(_0x410249,null));};exports['create']=function(_0x131708,_0x3f76a8){return db[_0x0296('0x2d')][_0x0296('0x49')](_0x131708['body'],{})['then'](function(_0x2273c4){var _0x224098=_0x131708['user'][_0x0296('0x4a')]({'plain':!![]});if(!_0x224098)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x224098[_0x0296('0x4b')]===_0x0296('0x4c')){var _0x5b4f1f=_0x2273c4[_0x0296('0x4a')]({'plain':!![]});var _0x1ccd00='IvrCampaigns';return db[_0x0296('0x4d')][_0x0296('0x4e')]({'where':{'name':_0x1ccd00,'userProfileId':_0x224098[_0x0296('0x4f')]},'raw':!![]})[_0x0296('0x24')](function(_0x2201f1){if(_0x2201f1&&_0x2201f1[_0x0296('0x50')]===0x0){return db[_0x0296('0x51')][_0x0296('0x49')]({'name':_0x5b4f1f[_0x0296('0x29')],'resourceId':_0x5b4f1f['id'],'type':_0x2201f1[_0x0296('0x29')],'sectionId':_0x2201f1['id']},{})['then'](function(){return _0x2273c4;});}else{return _0x2273c4;}})[_0x0296('0x44')](function(_0x317184){logger[_0x0296('0x27')](_0x0296('0x52'),_0x317184);throw _0x317184;});}return _0x2273c4;})[_0x0296('0x24')](respondWithResult(_0x3f76a8,0xc9))[_0x0296('0x44')](handleError(_0x3f76a8,null));};exports['clone']=function(_0x2863c6,_0x5b753f){var _0x1e5068={'raw':![],'where':{'id':_0x2863c6[_0x0296('0x46')]['id']}},_0xdc2f1c={};_0xdc2f1c[_0x0296('0x30')]=_[_0x0296('0x32')](db['Campaign'][_0x0296('0x47')]);_0x1e5068[_0x0296('0x35')]=_['intersection'](_0xdc2f1c[_0x0296('0x30')],qs[_0x0296('0x36')](_0x2863c6[_0x0296('0x31')][_0x0296('0x36')]));_0x1e5068[_0x0296('0x35')]=_0x1e5068[_0x0296('0x35')][_0x0296('0x53')]?_0x1e5068[_0x0296('0x35')]:_0xdc2f1c[_0x0296('0x30')];if(_0x2863c6[_0x0296('0x31')]['includeAll']){_0x1e5068[_0x0296('0x42')]=[{'all':!![]}];}_0x1e5068=_[_0x0296('0x3c')]({},_0x1e5068,_0x2863c6['options']);return db[_0x0296('0x2d')][_0x0296('0x4e')](_0x1e5068)[_0x0296('0x24')](handleEntityNotFound(_0x5b753f,null))[_0x0296('0x24')](function(_0x1f1d46){if(_0x1f1d46){var _0x52ac6f=_0x1f1d46['get']({'plain':!![]});_0x52ac6f=qs['omit'](_0x52ac6f,['id','createdAt',_0x0296('0x54')]);_0x2863c6[_0x0296('0x55')]=_[_0x0296('0x56')](_0x2863c6[_0x0296('0x55')],['id',_0x0296('0x57'),'updatedAt']);return db[_0x0296('0x2d')][_0x0296('0x49')](_['merge'](_0x52ac6f,_0x2863c6[_0x0296('0x55')]),{'include':_0x2863c6[_0x0296('0x31')][_0x0296('0x48')]?[{'all':!![]}]:undefined})[_0x0296('0x24')](function(_0x37529c){var _0x485362=_0x2863c6[_0x0296('0x4c')][_0x0296('0x4a')]({'plain':!![]});if(!_0x485362)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x485362[_0x0296('0x4b')]==='user'){var _0x1b2679=_0x37529c['get']({'plain':!![]});var _0x52230d=_0x0296('0x26');return db[_0x0296('0x4d')][_0x0296('0x4e')]({'where':{'name':_0x52230d,'userProfileId':_0x485362[_0x0296('0x4f')]},'raw':!![]})[_0x0296('0x24')](function(_0x306975){if(_0x306975&&_0x306975[_0x0296('0x50')]===0x0){return db[_0x0296('0x51')]['create']({'name':_0x1b2679['name'],'resourceId':_0x1b2679['id'],'type':_0x306975[_0x0296('0x29')],'sectionId':_0x306975['id']},{})['then'](function(){return _0x37529c;});}else{return _0x37529c;}})[_0x0296('0x44')](function(_0x4e1cd3){logger[_0x0296('0x27')](_0x0296('0x52'),_0x4e1cd3);throw _0x4e1cd3;});}return _0x37529c;});}})[_0x0296('0x24')](respondWithResult(_0x5b753f,0xc9))['catch'](handleError(_0x5b753f,null));};exports[_0x0296('0x23')]=function(_0x1076c3,_0x38dbdb){if(_0x1076c3[_0x0296('0x55')]['id']){delete _0x1076c3[_0x0296('0x55')]['id'];}return db[_0x0296('0x2d')]['find']({'where':{'id':_0x1076c3['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x38dbdb,null))[_0x0296('0x24')](saveUpdates(_0x1076c3['body'],null))['then'](respondWithResult(_0x38dbdb,null))[_0x0296('0x44')](handleError(_0x38dbdb,null));};exports[_0x0296('0x25')]=function(_0x31941d,_0x3138cd){return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x31941d['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x3138cd,null))['then'](removeEntity(_0x3138cd,null))[_0x0296('0x44')](handleError(_0x3138cd,null));};exports[_0x0296('0x58')]=function(_0x39c539,_0x2dae03,_0x98a2e){var _0x4b47db={'raw':!![],'where':{}};var _0x2c1b76={};var _0x17e6ba={'count':0x0,'rows':[]};return db[_0x0296('0x2d')]['findOne']({'where':{'id':_0x39c539[_0x0296('0x46')]['id']}})['then'](handleEntityNotFound(_0x2dae03,null))[_0x0296('0x24')](function(_0x2b6c6f){if(_0x2b6c6f){_0x2c1b76[_0x0296('0x30')]=_[_0x0296('0x32')](db[_0x0296('0x59')][_0x0296('0x47')]);_0x2c1b76[_0x0296('0x31')]=_[_0x0296('0x32')](_0x39c539[_0x0296('0x31')]);_0x2c1b76[_0x0296('0x33')]=_['intersection'](_0x2c1b76[_0x0296('0x30')],_0x2c1b76[_0x0296('0x31')]);_0x4b47db[_0x0296('0x35')]=_[_0x0296('0x34')](_0x2c1b76[_0x0296('0x30')],qs[_0x0296('0x36')](_0x39c539[_0x0296('0x31')]['fields']));_0x4b47db[_0x0296('0x35')]=_0x4b47db[_0x0296('0x35')]['length']?_0x4b47db[_0x0296('0x35')]:_0x2c1b76[_0x0296('0x30')];if(!_0x39c539[_0x0296('0x31')][_0x0296('0x5a')](_0x0296('0x37'))){_0x4b47db['limit']=qs['limit'](_0x39c539[_0x0296('0x31')][_0x0296('0x20')]);_0x4b47db[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0x39c539['query'][_0x0296('0x1f')]);}_0x4b47db['order']=qs['sort'](_0x39c539[_0x0296('0x31')]['sort']);_0x4b47db['where']=qs[_0x0296('0x33')](_[_0x0296('0x3b')](_0x39c539['query'],_0x2c1b76[_0x0296('0x33')]));_0x4b47db[_0x0296('0x3a')]['CampaignId']=_0x2b6c6f['id'];if(_0x39c539[_0x0296('0x31')][_0x0296('0x40')]){_0x4b47db['where']=_[_0x0296('0x3c')](_0x4b47db[_0x0296('0x3a')],{'$or':_['map'](_0x4b47db[_0x0296('0x35')],function(_0x1dc83b){var _0x37b097={};_0x37b097[_0x1dc83b]={'$like':'%'+_0x39c539[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0x37b097;})});}_0x4b47db=_[_0x0296('0x3c')]({},_0x4b47db,_0x39c539['options']);return db['CmHopper'][_0x0296('0x1e')]({'where':_0x4b47db['where']})[_0x0296('0x24')](function(_0x434421){_0x17e6ba[_0x0296('0x1e')]=_0x434421;if(_0x39c539[_0x0296('0x31')]['includeAll']){_0x4b47db[_0x0296('0x42')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x4b47db);})[_0x0296('0x24')](function(_0x4d627d){_0x17e6ba[_0x0296('0x5b')]=_0x4d627d;return _0x17e6ba;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x2dae03,_0x4b47db))['catch'](handleError(_0x2dae03,null));};exports[_0x0296('0x5c')]=function(_0xcae76,_0x3a1a04,_0x10f2b8){var _0x5e0b12={'raw':!![],'where':{}};var _0x5e5fb9={};var _0xe41234={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0xcae76[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x3a1a04,null))[_0x0296('0x24')](function(_0x31b576){if(_0x31b576){_0x5e5fb9[_0x0296('0x30')]=_['keys'](db[_0x0296('0x5e')][_0x0296('0x47')]);_0x5e5fb9[_0x0296('0x31')]=_[_0x0296('0x32')](_0xcae76[_0x0296('0x31')]);_0x5e5fb9[_0x0296('0x33')]=_['intersection'](_0x5e5fb9[_0x0296('0x30')],_0x5e5fb9[_0x0296('0x31')]);_0x5e0b12[_0x0296('0x35')]=_[_0x0296('0x34')](_0x5e5fb9['model'],qs[_0x0296('0x36')](_0xcae76[_0x0296('0x31')]['fields']));_0x5e0b12[_0x0296('0x35')]=_0x5e0b12[_0x0296('0x35')]['length']?_0x5e0b12['attributes']:_0x5e5fb9['model'];if(!_0xcae76['query'][_0x0296('0x5a')]('nolimit')){_0x5e0b12[_0x0296('0x20')]=qs[_0x0296('0x20')](_0xcae76[_0x0296('0x31')][_0x0296('0x20')]);_0x5e0b12[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0xcae76['query'][_0x0296('0x1f')]);}_0x5e0b12['order']=qs[_0x0296('0x39')](_0xcae76['query']['sort']);_0x5e0b12[_0x0296('0x3a')]=qs['filters'](_[_0x0296('0x3b')](_0xcae76[_0x0296('0x31')],_0x5e5fb9[_0x0296('0x33')]));_0x5e0b12[_0x0296('0x3a')][_0x0296('0x5f')]=_0x31b576['id'];if(_0xcae76[_0x0296('0x31')][_0x0296('0x40')]){_0x5e0b12[_0x0296('0x3a')]=_['merge'](_0x5e0b12['where'],{'$or':_[_0x0296('0x2c')](_0x5e0b12['attributes'],function(_0x15c40a){var _0x2e012b={};_0x2e012b[_0x15c40a]={'$like':'%'+_0xcae76[_0x0296('0x31')]['filter']+'%'};return _0x2e012b;})});}_0x5e0b12=_[_0x0296('0x3c')]({},_0x5e0b12,_0xcae76[_0x0296('0x41')]);return db[_0x0296('0x5e')][_0x0296('0x1e')]({'where':_0x5e0b12[_0x0296('0x3a')]})['then'](function(_0x50dea5){_0xe41234[_0x0296('0x1e')]=_0x50dea5;if(_0xcae76[_0x0296('0x31')][_0x0296('0x48')]){_0x5e0b12[_0x0296('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0296('0x43')](_0x5e0b12);})[_0x0296('0x24')](function(_0x321c8a){_0xe41234[_0x0296('0x5b')]=_0x321c8a;return _0xe41234;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x3a1a04,_0x5e0b12))['catch'](handleError(_0x3a1a04,null));};exports[_0x0296('0x60')]=function(_0x4b36b0,_0x301e56,_0xfb770e){var _0x40307c={'raw':!![],'where':{}};var _0x521c80={};var _0x557a60={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0x4b36b0[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x301e56,null))[_0x0296('0x24')](function(_0x32cd17){if(_0x32cd17){_0x521c80[_0x0296('0x30')]=_['keys'](db['CmHopperFinal'][_0x0296('0x47')]);_0x521c80['query']=_[_0x0296('0x32')](_0x4b36b0[_0x0296('0x31')]);_0x521c80[_0x0296('0x33')]=_[_0x0296('0x34')](_0x521c80[_0x0296('0x30')],_0x521c80['query']);_0x40307c[_0x0296('0x35')]=_[_0x0296('0x34')](_0x521c80['model'],qs[_0x0296('0x36')](_0x4b36b0[_0x0296('0x31')]['fields']));_0x40307c[_0x0296('0x35')]=_0x40307c[_0x0296('0x35')]['length']?_0x40307c[_0x0296('0x35')]:_0x521c80[_0x0296('0x30')];if(!_0x4b36b0[_0x0296('0x31')]['hasOwnProperty'](_0x0296('0x37'))){_0x40307c[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x4b36b0['query']['limit']);_0x40307c['offset']=qs[_0x0296('0x1f')](_0x4b36b0[_0x0296('0x31')][_0x0296('0x1f')]);}_0x40307c['order']=qs[_0x0296('0x39')](_0x4b36b0[_0x0296('0x31')][_0x0296('0x39')]);_0x40307c[_0x0296('0x3a')]=qs['filters'](_[_0x0296('0x3b')](_0x4b36b0[_0x0296('0x31')],_0x521c80[_0x0296('0x33')]));_0x40307c[_0x0296('0x3a')]['CampaignId']=_0x32cd17['id'];if(_0x4b36b0[_0x0296('0x31')][_0x0296('0x40')]){_0x40307c['where']=_[_0x0296('0x3c')](_0x40307c[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x40307c[_0x0296('0x35')],function(_0x1e5b08){var _0x52d33e={};_0x52d33e[_0x1e5b08]={'$like':'%'+_0x4b36b0[_0x0296('0x31')]['filter']+'%'};return _0x52d33e;})});}_0x40307c=_[_0x0296('0x3c')]({},_0x40307c,_0x4b36b0['options']);return db[_0x0296('0x61')][_0x0296('0x1e')]({'where':_0x40307c[_0x0296('0x3a')]})['then'](function(_0x21abf1){_0x557a60['count']=_0x21abf1;if(_0x4b36b0['query'][_0x0296('0x48')]){_0x40307c['include']=[{'all':!![]}];}return db[_0x0296('0x61')][_0x0296('0x43')](_0x40307c);})['then'](function(_0x2009fe){_0x557a60[_0x0296('0x5b')]=_0x2009fe;return _0x557a60;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x301e56,_0x40307c))['catch'](handleError(_0x301e56,null));};exports[_0x0296('0x62')]=function(_0x4ec47e,_0x83d10a,_0x422271){var _0x474bbf={'raw':!![],'where':{}};var _0x3af989={};var _0xe0903a={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0x4ec47e['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x83d10a,null))[_0x0296('0x24')](function(_0x136d5c){if(_0x136d5c){_0x3af989[_0x0296('0x30')]=_[_0x0296('0x32')](db[_0x0296('0x63')][_0x0296('0x47')]);_0x3af989[_0x0296('0x31')]=_[_0x0296('0x32')](_0x4ec47e[_0x0296('0x31')]);_0x3af989[_0x0296('0x33')]=_[_0x0296('0x34')](_0x3af989[_0x0296('0x30')],_0x3af989[_0x0296('0x31')]);_0x474bbf[_0x0296('0x35')]=_[_0x0296('0x34')](_0x3af989[_0x0296('0x30')],qs['fields'](_0x4ec47e['query']['fields']));_0x474bbf['attributes']=_0x474bbf[_0x0296('0x35')][_0x0296('0x53')]?_0x474bbf[_0x0296('0x35')]:_0x3af989[_0x0296('0x30')];if(!_0x4ec47e['query'][_0x0296('0x5a')](_0x0296('0x37'))){_0x474bbf[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x4ec47e[_0x0296('0x31')][_0x0296('0x20')]);_0x474bbf[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0x4ec47e[_0x0296('0x31')]['offset']);}_0x474bbf['order']=qs[_0x0296('0x39')](_0x4ec47e['query'][_0x0296('0x39')]);_0x474bbf[_0x0296('0x3a')]=qs[_0x0296('0x33')](_[_0x0296('0x3b')](_0x4ec47e[_0x0296('0x31')],_0x3af989[_0x0296('0x33')]));_0x474bbf[_0x0296('0x3a')][_0x0296('0x5f')]=_0x136d5c['id'];if(_0x4ec47e[_0x0296('0x31')][_0x0296('0x40')]){_0x474bbf[_0x0296('0x3a')]=_[_0x0296('0x3c')](_0x474bbf[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x474bbf[_0x0296('0x35')],function(_0x24878f){var _0xb4dcb5={};_0xb4dcb5[_0x24878f]={'$like':'%'+_0x4ec47e[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0xb4dcb5;})});}_0x474bbf=_[_0x0296('0x3c')]({},_0x474bbf,_0x4ec47e[_0x0296('0x41')]);return db[_0x0296('0x63')]['count']({'where':_0x474bbf[_0x0296('0x3a')]})[_0x0296('0x24')](function(_0x33f3e3){_0xe0903a['count']=_0x33f3e3;if(_0x4ec47e['query']['includeAll']){_0x474bbf['include']=[{'all':!![]}];}return db[_0x0296('0x63')][_0x0296('0x43')](_0x474bbf);})[_0x0296('0x24')](function(_0x5684d9){_0xe0903a[_0x0296('0x5b')]=_0x5684d9;return _0xe0903a;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x83d10a,_0x474bbf))[_0x0296('0x44')](handleError(_0x83d10a,null));};exports[_0x0296('0x64')]=function(_0x177d5d,_0x17eb5d,_0x173ea3){var _0x1a58bb={};var _0x550691={};var _0x48492d;var _0x22e60c;return db['Campaign'][_0x0296('0x5d')]({'where':{'id':_0x177d5d['params']['id']}})['then'](handleEntityNotFound(_0x17eb5d,null))[_0x0296('0x24')](function(_0x18abb0){if(_0x18abb0){_0x48492d=_0x18abb0;_0x550691['model']=_[_0x0296('0x32')](db[_0x0296('0x65')][_0x0296('0x47')]);_0x550691[_0x0296('0x31')]=_[_0x0296('0x32')](_0x177d5d[_0x0296('0x31')]);_0x550691[_0x0296('0x33')]=_[_0x0296('0x34')](_0x550691[_0x0296('0x30')],_0x550691[_0x0296('0x31')]);_0x1a58bb[_0x0296('0x35')]=_[_0x0296('0x34')](_0x550691['model'],qs[_0x0296('0x36')](_0x177d5d[_0x0296('0x31')]['fields']));_0x1a58bb[_0x0296('0x35')]=_0x1a58bb['attributes'][_0x0296('0x53')]?_0x1a58bb[_0x0296('0x35')]:_0x550691[_0x0296('0x30')];_0x1a58bb[_0x0296('0x38')]=qs['sort'](_0x177d5d[_0x0296('0x31')][_0x0296('0x39')]);_0x1a58bb[_0x0296('0x3a')]=qs[_0x0296('0x33')](_['pick'](_0x177d5d[_0x0296('0x31')],_0x550691[_0x0296('0x33')]));if(_0x177d5d[_0x0296('0x31')][_0x0296('0x40')]){_0x1a58bb['where']=_[_0x0296('0x3c')](_0x1a58bb[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x1a58bb[_0x0296('0x35')],function(_0x1f0e1c){var _0x101fac={};_0x101fac[_0x1f0e1c]={'$like':'%'+_0x177d5d[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0x101fac;})});}_0x1a58bb=_[_0x0296('0x3c')]({},_0x1a58bb,_0x177d5d[_0x0296('0x41')]);return _0x48492d['getLists'](_0x1a58bb);}})[_0x0296('0x24')](function(_0x50240a){if(_0x50240a){_0x22e60c=_0x50240a['length'];if(!_0x177d5d['query']['hasOwnProperty'](_0x0296('0x37'))){_0x1a58bb[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x177d5d[_0x0296('0x31')][_0x0296('0x20')]);_0x1a58bb[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0x177d5d['query'][_0x0296('0x1f')]);}return _0x48492d[_0x0296('0x64')](_0x1a58bb);}})[_0x0296('0x24')](function(_0x1956da){if(_0x1956da){return _0x1956da?{'count':_0x22e60c,'rows':_0x1956da}:null;}})[_0x0296('0x24')](respondWithResult(_0x17eb5d,null))[_0x0296('0x44')](handleError(_0x17eb5d,null));};exports['addLists']=function(_0x486922,_0x3acc0a,_0x40690c){var _0x2f5c6a,_0x25f6f8;return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x486922[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x3acc0a,null))['then'](function(_0x2cf9bf){if(_0x2cf9bf){_0x25f6f8=_0x2cf9bf;return _0x2cf9bf[_0x0296('0x66')](_0x486922['body'][_0x0296('0x67')],_['omit'](_0x486922[_0x0296('0x55')],[_0x0296('0x67'),'id'])||{});}return null;})[_0x0296('0x68')](function(_0x46de94){var _0x458610;_0x2f5c6a=_0x46de94||[];var _0x14f559=[];if(_0x46de94){for(var _0x12dca7=0x0;_0x12dca7<_0x46de94[_0x0296('0x53')];_0x12dca7+=0x1){var _0x308131=_0x46de94[_0x12dca7][_0x0296('0x4a')]({'plain':!![]});_0x25f6f8[_0x0296('0x69')]=_0x486922[_0x0296('0x55')][_0x0296('0x69')]?_0x486922['body'][_0x0296('0x69')]:_0x25f6f8[_0x0296('0x69')];switch(_0x25f6f8[_0x0296('0x69')]){case _0x0296('0x6a'):_0x458610=squel[_0x0296('0x6b')]()[_0x0296('0x6c')](_0x0296('0x6d'))[_0x0296('0x6e')](['phone',_0x0296('0x6f'),_0x0296('0x70'),_0x0296('0x71'),_0x0296('0x5f'),_0x0296('0x57'),'updatedAt'],squel['select']()[_0x0296('0x3f')](_0x0296('0x72'),_0x0296('0x72'))[_0x0296('0x3f')](_0x0296('0x73'),'scheduledAt')['field']('id','ContactId')[_0x0296('0x3f')](_0x308131[_0x0296('0x74')][_0x0296('0x75')](),_0x0296('0x71'))[_0x0296('0x3f')](_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')](),_0x0296('0x5f'))['field']('NOW()','createdAt')[_0x0296('0x3f')](_0x0296('0x73'),_0x0296('0x54'))['from'](_0x0296('0x76'))[_0x0296('0x3a')](_0x0296('0x77'))[_0x0296('0x3a')](_0x0296('0x78'),_0x308131[_0x0296('0x74')][_0x0296('0x75')]())['where'](_0x0296('0x79'))[_0x0296('0x3a')](_0x0296('0x7a'),squel[_0x0296('0x7b')]()[_0x0296('0x3f')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x0296('0x3a')]('CampaignId\x20=\x20?',_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')]()))['where'](_0x0296('0x7a'),squel[_0x0296('0x7b')]()['field'](_0x0296('0x7c'))[_0x0296('0x7d')](_0x0296('0x6d'))['where'](_0x0296('0x7e'),_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')]())))[_0x0296('0x75')]();break;case _0x0296('0x7f'):_0x458610=squel[_0x0296('0x6b')]()['into']('cm_hopper')[_0x0296('0x6e')](['phone','scheduledAt',_0x0296('0x70'),_0x0296('0x71'),_0x0296('0x5f'),_0x0296('0x57'),_0x0296('0x54')],squel['select']()[_0x0296('0x3f')]('phone',_0x0296('0x72'))[_0x0296('0x3f')]('NOW()','scheduledAt')[_0x0296('0x3f')]('id',_0x0296('0x70'))[_0x0296('0x3f')](_0x308131[_0x0296('0x74')][_0x0296('0x75')](),_0x0296('0x71'))['field'](_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')](),_0x0296('0x5f'))['field']('NOW()',_0x0296('0x57'))['field']('NOW()','updatedAt')[_0x0296('0x7d')](_0x0296('0x76'))[_0x0296('0x3a')](_0x0296('0x77'))['where']('ListId\x20=\x20?',_0x308131[_0x0296('0x74')]['toString']())[_0x0296('0x3a')](_0x0296('0x79'))[_0x0296('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0296('0x7b')]()[_0x0296('0x3f')]('COALESCE(phone,\x27\x27)')['from'](_0x0296('0x6d'))[_0x0296('0x3a')](_0x0296('0x7e'),_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')]())))[_0x0296('0x75')]();break;default:_0x458610=squel[_0x0296('0x6b')]()[_0x0296('0x6c')](_0x0296('0x6d'))[_0x0296('0x6e')]([_0x0296('0x72'),_0x0296('0x6f'),_0x0296('0x70'),'ListId',_0x0296('0x5f'),'createdAt',_0x0296('0x54')],squel[_0x0296('0x7b')]()[_0x0296('0x3f')](_0x0296('0x72'),_0x0296('0x72'))[_0x0296('0x3f')](_0x0296('0x73'),_0x0296('0x6f'))[_0x0296('0x3f')]('id','ContactId')[_0x0296('0x3f')](_0x308131[_0x0296('0x74')]['toString'](),_0x0296('0x71'))[_0x0296('0x3f')](_0x486922['params']['id']['toString'](),_0x0296('0x5f'))[_0x0296('0x3f')](_0x0296('0x73'),'createdAt')[_0x0296('0x3f')]('NOW()','updatedAt')['from'](_0x0296('0x76'))[_0x0296('0x3a')]('deletedAt\x20IS\x20NULL')[_0x0296('0x3a')]('ListId\x20=\x20?',_0x308131['CmListId'][_0x0296('0x75')]())[_0x0296('0x3a')](_0x0296('0x79')))['toString']();}_0x14f559[_0x0296('0x80')](db[_0x0296('0x81')]['query'](_0x458610));}return BPromise[_0x0296('0x82')](_0x14f559);}})[_0x0296('0x24')](function(){return _0x2f5c6a;})['then'](respondWithResult(_0x3acc0a,null))[_0x0296('0x44')](handleError(_0x3acc0a,null));};exports['removeLists']=function(_0x2a9a97,_0x5dac78,_0x2088c1){return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x2a9a97[_0x0296('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dac78,null))[_0x0296('0x24')](function(_0x2c9aa0){if(_0x2c9aa0){return _0x2c9aa0['removeLists'](_0x2a9a97[_0x0296('0x31')][_0x0296('0x67')]);}})[_0x0296('0x24')](function(_0x3c44fc){if(_0x3c44fc){return db[_0x0296('0x59')][_0x0296('0x25')]({'where':{'ListId':_0x2a9a97[_0x0296('0x31')][_0x0296('0x67')],'CampaignId':_0x2a9a97[_0x0296('0x46')]['id']}})[_0x0296('0x24')](function(){return _0x3c44fc;});}})[_0x0296('0x24')](respondWithStatusCode(_0x5dac78,null))['catch'](handleError(_0x5dac78,null));};exports['getBlackLists']=function(_0x5c1450,_0x1ce765,_0x481c38){var _0x487b96={'raw':!![],'where':{}};var _0x5c6cb8={};var _0xde99bd={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0x5c1450['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x1ce765,null))[_0x0296('0x24')](function(_0x9b909b){if(_0x9b909b){_0x5c6cb8[_0x0296('0x30')]=_[_0x0296('0x32')](db['CmList'][_0x0296('0x47')]);_0x5c6cb8[_0x0296('0x31')]=_['keys'](_0x5c1450['query']);_0x5c6cb8['filters']=_[_0x0296('0x34')](_0x5c6cb8[_0x0296('0x30')],_0x5c6cb8[_0x0296('0x31')]);_0x487b96['attributes']=_[_0x0296('0x34')](_0x5c6cb8['model'],qs[_0x0296('0x36')](_0x5c1450[_0x0296('0x31')][_0x0296('0x36')]));_0x487b96[_0x0296('0x35')]=_0x487b96[_0x0296('0x35')][_0x0296('0x53')]?_0x487b96['attributes']:_0x5c6cb8[_0x0296('0x30')];if(!_0x5c1450['query'][_0x0296('0x5a')](_0x0296('0x37'))){_0x487b96[_0x0296('0x20')]=qs['limit'](_0x5c1450[_0x0296('0x31')][_0x0296('0x20')]);_0x487b96['offset']=qs[_0x0296('0x1f')](_0x5c1450['query'][_0x0296('0x1f')]);}_0x487b96[_0x0296('0x38')]=qs[_0x0296('0x39')](_0x5c1450[_0x0296('0x31')][_0x0296('0x39')]);_0x487b96[_0x0296('0x3a')]=qs[_0x0296('0x33')](_[_0x0296('0x3b')](_0x5c1450[_0x0296('0x31')],_0x5c6cb8[_0x0296('0x33')]));_0x487b96[_0x0296('0x3a')][_0x0296('0x5f')]=_0x9b909b['id'];if(_0x5c1450[_0x0296('0x31')][_0x0296('0x40')]){_0x487b96[_0x0296('0x3a')]=_[_0x0296('0x3c')](_0x487b96[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x487b96['attributes'],function(_0x1a4b2c){var _0x4e2cb8={};_0x4e2cb8[_0x1a4b2c]={'$like':'%'+_0x5c1450['query'][_0x0296('0x40')]+'%'};return _0x4e2cb8;})});}_0x487b96=_[_0x0296('0x3c')]({},_0x487b96,_0x5c1450[_0x0296('0x41')]);return db[_0x0296('0x65')][_0x0296('0x1e')]({'where':_0x487b96['where']})[_0x0296('0x24')](function(_0x15d612){_0xde99bd['count']=_0x15d612;if(_0x5c1450[_0x0296('0x31')][_0x0296('0x48')]){_0x487b96[_0x0296('0x42')]=[{'all':!![]}];}return db[_0x0296('0x65')][_0x0296('0x43')](_0x487b96);})[_0x0296('0x24')](function(_0x459a77){_0xde99bd[_0x0296('0x5b')]=_0x459a77;return _0xde99bd;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x1ce765,_0x487b96))[_0x0296('0x44')](handleError(_0x1ce765,null));};exports[_0x0296('0x83')]=function(_0x3e4407,_0x3629d3,_0x104454){var _0x558f96,_0x2e2ef8;return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x3e4407[_0x0296('0x46')]['id']}})['then'](handleEntityNotFound(_0x3629d3,null))[_0x0296('0x24')](function(_0x45ed3f){if(_0x45ed3f){_0x2e2ef8=_0x45ed3f;return _0x45ed3f['addBlackLists'](_0x3e4407[_0x0296('0x55')][_0x0296('0x67')],_[_0x0296('0x56')](_0x3e4407['body'],['ids','id'])||{});}return null;})[_0x0296('0x68')](function(_0x462aa6){var _0x3bd23c;_0x558f96=_0x462aa6||[];var _0x346e88=[];if(_0x462aa6){for(var _0x54a3e6=0x0;_0x54a3e6<_0x462aa6[_0x0296('0x53')];_0x54a3e6+=0x1){var _0x1c7253=_0x462aa6[_0x54a3e6]['get']({'plain':!![]});_0x3bd23c=squel[_0x0296('0x6b')]()[_0x0296('0x6c')](_0x0296('0x84'))[_0x0296('0x6e')]([_0x0296('0x72'),_0x0296('0x70'),_0x0296('0x71'),'CampaignId',_0x0296('0x57'),'updatedAt'],squel['select']()[_0x0296('0x3f')]('phone',_0x0296('0x72'))[_0x0296('0x3f')]('id','ContactId')[_0x0296('0x3f')](_0x1c7253[_0x0296('0x74')][_0x0296('0x75')](),_0x0296('0x71'))[_0x0296('0x3f')](_0x3e4407['params']['id'][_0x0296('0x75')](),_0x0296('0x5f'))[_0x0296('0x3f')]('NOW()','createdAt')['field'](_0x0296('0x73'),_0x0296('0x54'))[_0x0296('0x7d')](_0x0296('0x76'))[_0x0296('0x3a')](_0x0296('0x77'))['where']('ListId\x20=\x20?',_0x1c7253[_0x0296('0x74')][_0x0296('0x75')]())[_0x0296('0x3a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x346e88[_0x0296('0x80')](db['sequelize'][_0x0296('0x31')](_0x3bd23c));}return BPromise[_0x0296('0x82')](_0x346e88);}})[_0x0296('0x24')](function(){return _0x558f96;})[_0x0296('0x24')](respondWithResult(_0x3629d3,null))[_0x0296('0x44')](handleError(_0x3629d3,null));};exports[_0x0296('0x85')]=function(_0x4ef97b,_0x52759f,_0x2a220e){return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x4ef97b[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x52759f,null))[_0x0296('0x24')](function(_0x400da1){if(_0x400da1){return _0x400da1[_0x0296('0x85')](_0x4ef97b[_0x0296('0x31')][_0x0296('0x67')]);}})[_0x0296('0x24')](function(_0x1ed59d){if(_0x1ed59d){return db[_0x0296('0x63')][_0x0296('0x25')]({'where':{'ListId':_0x4ef97b[_0x0296('0x31')]['ids'],'CampaignId':_0x4ef97b[_0x0296('0x46')]['id']}})[_0x0296('0x24')](function(){return _0x1ed59d;});}})[_0x0296('0x24')](respondWithStatusCode(_0x52759f,null))[_0x0296('0x44')](handleError(_0x52759f,null));};
\ No newline at end of file
+var _0xd8e5=['offset','limit','set','Content-Range','apply','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','fields','length','omit','createdAt','updatedAt','body','getHoppers','CmHopper','CampaignId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','phone','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x2f4b73,_0x18c42b){var _0x5bb898=function(_0xeb5a0d){while(--_0xeb5a0d){_0x2f4b73['push'](_0x2f4b73['shift']());}};_0x5bb898(++_0x18c42b);}(_0xd8e5,0x6b));var _0x5d8e=function(_0x25a1b9,_0x1679ff){_0x25a1b9=_0x25a1b9-0x0;var _0x2fdf88=_0xd8e5[_0x25a1b9];return _0x2fdf88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5d8e('0x0'));var rimraf=require(_0x5d8e('0x1'));var zipdir=require(_0x5d8e('0x2'));var jsonpatch=require(_0x5d8e('0x3'));var rp=require(_0x5d8e('0x4'));var moment=require(_0x5d8e('0x5'));var BPromise=require(_0x5d8e('0x6'));var Mustache=require('mustache');var util=require(_0x5d8e('0x7'));var path=require(_0x5d8e('0x8'));var sox=require(_0x5d8e('0x9'));var csv=require(_0x5d8e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5d8e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5d8e('0xc'));var toCsv=require(_0x5d8e('0xa'));var querystring=require(_0x5d8e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5d8e('0xe'));var qs=require(_0x5d8e('0xf'));var as=require(_0x5d8e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5d8e('0x11'));var config=require('../../config/environment');var db=require(_0x5d8e('0x12'))['db'];function respondWithStatusCode(_0x391183,_0x3fdb2f){_0x3fdb2f=_0x3fdb2f||0xcc;return function(_0x3b8a8a){if(_0x3b8a8a){return _0x391183[_0x5d8e('0x13')](_0x3fdb2f);}return _0x391183[_0x5d8e('0x14')](_0x3fdb2f)[_0x5d8e('0x15')]();};}function respondWithResult(_0x48f211,_0x36a9f5){_0x36a9f5=_0x36a9f5||0xc8;return function(_0x40f49a){if(_0x40f49a){return _0x48f211[_0x5d8e('0x14')](_0x36a9f5)[_0x5d8e('0x16')](_0x40f49a);}};}function respondWithFilteredResult(_0x35c84b,_0x5ed831){return function(_0x17ee7b){if(_0x17ee7b){var _0x3e8bac=_0x17ee7b['count'],_0x398b66=_0x5ed831[_0x5d8e('0x17')],_0x43c201=_0x5ed831[_0x5d8e('0x17')]+_0x5ed831[_0x5d8e('0x18')],_0x2bc1b6;if(_0x43c201>=_0x3e8bac){_0x43c201=_0x3e8bac;_0x2bc1b6=0xc8;}else{_0x2bc1b6=0xce;}_0x35c84b['status'](_0x2bc1b6);return _0x35c84b[_0x5d8e('0x19')](_0x5d8e('0x1a'),_0x398b66+'-'+_0x43c201+'/'+_0x3e8bac)[_0x5d8e('0x16')](_0x17ee7b);}return null;};}function patchUpdates(_0x119b95){return function(_0x5ad420){try{jsonpatch[_0x5d8e('0x1b')](_0x5ad420,_0x119b95,!![]);}catch(_0x599444){return BPromise['reject'](_0x599444);}return _0x5ad420[_0x5d8e('0x1c')]();};}function saveUpdates(_0x27d216,_0x2938ad){return function(_0x5f6d4){if(_0x5f6d4){return _0x5f6d4[_0x5d8e('0x1d')](_0x27d216)[_0x5d8e('0x1e')](function(_0x41d839){return _0x41d839;});}return null;};}function removeEntity(_0x5e0213,_0x41dd71){return function(_0x19ca32){if(_0x19ca32){return _0x19ca32['destroy']()[_0x5d8e('0x1e')](function(){var _0x406428=_0x19ca32[_0x5d8e('0x1f')]({'plain':!![]});var _0x263b8f=_0x5d8e('0x20');return db[_0x5d8e('0x21')][_0x5d8e('0x22')]({'where':{'type':_0x263b8f,'resourceId':_0x406428['id']}})[_0x5d8e('0x1e')](function(){return _0x19ca32;});})[_0x5d8e('0x1e')](function(){_0x5e0213[_0x5d8e('0x14')](0xcc)[_0x5d8e('0x15')]();});}};}function handleEntityNotFound(_0x17e252,_0x56acd8){return function(_0x33d151){if(!_0x33d151){_0x17e252[_0x5d8e('0x13')](0x194);}return _0x33d151;};}function handleError(_0xd85dac,_0xde21f2){_0xde21f2=_0xde21f2||0x1f4;return function(_0x400321){logger[_0x5d8e('0x23')](_0x400321[_0x5d8e('0x24')]);if(_0x400321[_0x5d8e('0x25')]){delete _0x400321[_0x5d8e('0x25')];}_0xd85dac[_0x5d8e('0x14')](_0xde21f2)[_0x5d8e('0x26')](_0x400321);};}exports[_0x5d8e('0x27')]=function(_0xe4cea9,_0x1edc1f){var _0x1f759e={},_0x3ed672={},_0x72dfc3={'count':0x0,'rows':[]};var _0x5e1267=_[_0x5d8e('0x28')](db[_0x5d8e('0x29')][_0x5d8e('0x2a')],function(_0x53853f){return{'name':_0x53853f['fieldName'],'type':_0x53853f[_0x5d8e('0x2b')][_0x5d8e('0x2c')]};});_0x3ed672[_0x5d8e('0x2d')]=_[_0x5d8e('0x28')](_0x5e1267,'name');_0x3ed672[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0xe4cea9[_0x5d8e('0x2e')]);_0x3ed672[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x3ed672[_0x5d8e('0x2d')],_0x3ed672['query']);_0x1f759e[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x3ed672[_0x5d8e('0x2d')],qs['fields'](_0xe4cea9['query']['fields']));_0x1f759e[_0x5d8e('0x32')]=_0x1f759e[_0x5d8e('0x32')]['length']?_0x1f759e['attributes']:_0x3ed672[_0x5d8e('0x2d')];if(!_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0x1f759e['limit']=qs[_0x5d8e('0x18')](_0xe4cea9['query'][_0x5d8e('0x18')]);_0x1f759e[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0xe4cea9['query']['offset']);}_0x1f759e[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0x1f759e[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0xe4cea9[_0x5d8e('0x2e')],_0x3ed672['filters']));if(_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x39')]){_0x1f759e['where']=_['merge'](_0x1f759e[_0x5d8e('0x37')],{'$or':_['map'](_0x5e1267,function(_0x1a0867){if(_0x1a0867[_0x5d8e('0x2b')][_0x5d8e('0x2c')]!=='VIRTUAL'){var _0x1a909b={};_0x1a909b[_0x1a0867['field']]={'$like':'%'+_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x1a909b;}})});}_0x1f759e=_[_0x5d8e('0x3a')]({},_0x1f759e,_0xe4cea9[_0x5d8e('0x3b')]);var _0x5ae111={'where':_0x1f759e[_0x5d8e('0x37')]};return db[_0x5d8e('0x29')][_0x5d8e('0x3c')](_0x5ae111)[_0x5d8e('0x1e')](function(_0x5e5f99){_0x72dfc3[_0x5d8e('0x3c')]=_0x5e5f99;if(_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x1f759e[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x29')]['findAll'](_0x1f759e);})[_0x5d8e('0x1e')](function(_0x1b3759){_0x72dfc3['rows']=_0x1b3759;return _0x72dfc3;})['then'](respondWithFilteredResult(_0x1edc1f,_0x1f759e))[_0x5d8e('0x3f')](handleError(_0x1edc1f,null));};exports[_0x5d8e('0x40')]=function(_0x1f9de8,_0xa018f7){var _0x439309={'raw':![],'where':{'id':_0x1f9de8['params']['id']}},_0x1e0360={};_0x1e0360[_0x5d8e('0x2d')]=_['keys'](db['Campaign'][_0x5d8e('0x2a')]);_0x1e0360['query']=_[_0x5d8e('0x2f')](_0x1f9de8['query']);_0x1e0360[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x1e0360[_0x5d8e('0x2d')],_0x1e0360['query']);_0x439309[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x1e0360[_0x5d8e('0x2d')],qs['fields'](_0x1f9de8[_0x5d8e('0x2e')]['fields']));_0x439309[_0x5d8e('0x32')]=_0x439309['attributes']['length']?_0x439309[_0x5d8e('0x32')]:_0x1e0360[_0x5d8e('0x2d')];if(_0x1f9de8[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x439309[_0x5d8e('0x3e')]=[{'all':!![]}];}_0x439309=_[_0x5d8e('0x3a')]({},_0x439309,_0x1f9de8[_0x5d8e('0x3b')]);return db[_0x5d8e('0x29')][_0x5d8e('0x41')](_0x439309)[_0x5d8e('0x1e')](handleEntityNotFound(_0xa018f7,null))[_0x5d8e('0x1e')](respondWithResult(_0xa018f7,null))[_0x5d8e('0x3f')](handleError(_0xa018f7,null));};exports[_0x5d8e('0x42')]=function(_0x45f197,_0x2624c5){return db[_0x5d8e('0x29')][_0x5d8e('0x42')](_0x45f197['body'],{})['then'](function(_0x3e0d43){var _0x54c20e=_0x45f197[_0x5d8e('0x43')]['get']({'plain':!![]});if(!_0x54c20e)throw new Error(_0x5d8e('0x44'));if(_0x54c20e[_0x5d8e('0x45')]===_0x5d8e('0x43')){var _0x51769a=_0x3e0d43['get']({'plain':!![]});var _0x10ba99=_0x5d8e('0x20');return db['UserProfileSection'][_0x5d8e('0x41')]({'where':{'name':_0x10ba99,'userProfileId':_0x54c20e[_0x5d8e('0x46')]},'raw':!![]})['then'](function(_0x1fef98){if(_0x1fef98&&_0x1fef98[_0x5d8e('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x51769a[_0x5d8e('0x25')],'resourceId':_0x51769a['id'],'type':_0x1fef98[_0x5d8e('0x25')],'sectionId':_0x1fef98['id']},{})[_0x5d8e('0x1e')](function(){return _0x3e0d43;});}else{return _0x3e0d43;}})[_0x5d8e('0x3f')](function(_0x20bf75){logger[_0x5d8e('0x23')](_0x5d8e('0x48'),_0x20bf75);throw _0x20bf75;});}return _0x3e0d43;})['then'](respondWithResult(_0x2624c5,0xc9))[_0x5d8e('0x3f')](handleError(_0x2624c5,null));};exports[_0x5d8e('0x49')]=function(_0x58347b,_0x1331cf){var _0x279bbf={'raw':![],'where':{'id':_0x58347b[_0x5d8e('0x4a')]['id']}},_0x5f550b={};_0x5f550b[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x29')][_0x5d8e('0x2a')]);_0x279bbf['attributes']=_[_0x5d8e('0x31')](_0x5f550b['model'],qs[_0x5d8e('0x4b')](_0x58347b[_0x5d8e('0x2e')][_0x5d8e('0x4b')]));_0x279bbf[_0x5d8e('0x32')]=_0x279bbf[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x279bbf[_0x5d8e('0x32')]:_0x5f550b[_0x5d8e('0x2d')];if(_0x58347b[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x279bbf[_0x5d8e('0x3e')]=[{'all':!![]}];}_0x279bbf=_['merge']({},_0x279bbf,_0x58347b[_0x5d8e('0x3b')]);return db[_0x5d8e('0x29')][_0x5d8e('0x41')](_0x279bbf)['then'](handleEntityNotFound(_0x1331cf,null))[_0x5d8e('0x1e')](function(_0x325f34){if(_0x325f34){var _0x523359=_0x325f34['get']({'plain':!![]});_0x523359=qs[_0x5d8e('0x4d')](_0x523359,['id',_0x5d8e('0x4e'),_0x5d8e('0x4f')]);_0x58347b['body']=_['omit'](_0x58347b[_0x5d8e('0x50')],['id','createdAt',_0x5d8e('0x4f')]);return db[_0x5d8e('0x29')][_0x5d8e('0x42')](_['merge'](_0x523359,_0x58347b[_0x5d8e('0x50')]),{'include':_0x58347b[_0x5d8e('0x2e')][_0x5d8e('0x3d')]?[{'all':!![]}]:undefined})[_0x5d8e('0x1e')](function(_0x1e20cc){var _0x20de9f=_0x58347b[_0x5d8e('0x43')][_0x5d8e('0x1f')]({'plain':!![]});if(!_0x20de9f)throw new Error(_0x5d8e('0x44'));if(_0x20de9f[_0x5d8e('0x45')]===_0x5d8e('0x43')){var _0x1c1d64=_0x1e20cc[_0x5d8e('0x1f')]({'plain':!![]});var _0x244a67=_0x5d8e('0x20');return db['UserProfileSection'][_0x5d8e('0x41')]({'where':{'name':_0x244a67,'userProfileId':_0x20de9f[_0x5d8e('0x46')]},'raw':!![]})['then'](function(_0x9b2320){if(_0x9b2320&&_0x9b2320[_0x5d8e('0x47')]===0x0){return db[_0x5d8e('0x21')][_0x5d8e('0x42')]({'name':_0x1c1d64[_0x5d8e('0x25')],'resourceId':_0x1c1d64['id'],'type':_0x9b2320['name'],'sectionId':_0x9b2320['id']},{})[_0x5d8e('0x1e')](function(){return _0x1e20cc;});}else{return _0x1e20cc;}})['catch'](function(_0x4eec4f){logger[_0x5d8e('0x23')](_0x5d8e('0x48'),_0x4eec4f);throw _0x4eec4f;});}return _0x1e20cc;});}})[_0x5d8e('0x1e')](respondWithResult(_0x1331cf,0xc9))['catch'](handleError(_0x1331cf,null));};exports[_0x5d8e('0x1d')]=function(_0x16b931,_0x561fe6){if(_0x16b931[_0x5d8e('0x50')]['id']){delete _0x16b931[_0x5d8e('0x50')]['id'];}return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x16b931['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x561fe6,null))[_0x5d8e('0x1e')](saveUpdates(_0x16b931[_0x5d8e('0x50')],null))['then'](respondWithResult(_0x561fe6,null))['catch'](handleError(_0x561fe6,null));};exports[_0x5d8e('0x22')]=function(_0x446564,_0x3f6415){return db[_0x5d8e('0x29')]['find']({'where':{'id':_0x446564[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x3f6415,null))['then'](removeEntity(_0x3f6415,null))[_0x5d8e('0x3f')](handleError(_0x3f6415,null));};exports[_0x5d8e('0x51')]=function(_0x3a1bc8,_0x682553,_0x126988){var _0x44e6ec={'raw':!![],'where':{}};var _0x208dd5={};var _0x55ba06={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3a1bc8[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x682553,null))[_0x5d8e('0x1e')](function(_0x500596){if(_0x500596){_0x208dd5[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x52')]['rawAttributes']);_0x208dd5[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0x3a1bc8[_0x5d8e('0x2e')]);_0x208dd5[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x208dd5['model'],_0x208dd5[_0x5d8e('0x2e')]);_0x44e6ec[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x208dd5[_0x5d8e('0x2d')],qs[_0x5d8e('0x4b')](_0x3a1bc8['query'][_0x5d8e('0x4b')]));_0x44e6ec[_0x5d8e('0x32')]=_0x44e6ec[_0x5d8e('0x32')]['length']?_0x44e6ec['attributes']:_0x208dd5[_0x5d8e('0x2d')];if(!_0x3a1bc8['query'][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0x44e6ec[_0x5d8e('0x18')]=qs[_0x5d8e('0x18')](_0x3a1bc8[_0x5d8e('0x2e')]['limit']);_0x44e6ec[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0x3a1bc8['query'][_0x5d8e('0x17')]);}_0x44e6ec[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x3a1bc8[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0x44e6ec[_0x5d8e('0x37')]=qs['filters'](_['pick'](_0x3a1bc8[_0x5d8e('0x2e')],_0x208dd5[_0x5d8e('0x30')]));_0x44e6ec[_0x5d8e('0x37')][_0x5d8e('0x53')]=_0x500596['id'];if(_0x3a1bc8[_0x5d8e('0x2e')][_0x5d8e('0x39')]){_0x44e6ec['where']=_[_0x5d8e('0x3a')](_0x44e6ec['where'],{'$or':_['map'](_0x44e6ec[_0x5d8e('0x32')],function(_0x2cabce){var _0x3db33e={};_0x3db33e[_0x2cabce]={'$like':'%'+_0x3a1bc8[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x3db33e;})});}_0x44e6ec=_['merge']({},_0x44e6ec,_0x3a1bc8[_0x5d8e('0x3b')]);return db[_0x5d8e('0x52')][_0x5d8e('0x3c')]({'where':_0x44e6ec[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x68d5c1){_0x55ba06['count']=_0x68d5c1;if(_0x3a1bc8['query'][_0x5d8e('0x3d')]){_0x44e6ec[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x52')][_0x5d8e('0x54')](_0x44e6ec);})[_0x5d8e('0x1e')](function(_0x5dcb80){_0x55ba06[_0x5d8e('0x55')]=_0x5dcb80;return _0x55ba06;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x682553,_0x44e6ec))[_0x5d8e('0x3f')](handleError(_0x682553,null));};exports[_0x5d8e('0x56')]=function(_0x16729a,_0x449049,_0x42d067){var _0x630b6a={'raw':!![],'where':{}};var _0x307731={};var _0x4ce075={'count':0x0,'rows':[]};return db[_0x5d8e('0x29')][_0x5d8e('0x57')]({'where':{'id':_0x16729a['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x449049,null))[_0x5d8e('0x1e')](function(_0x541c7d){if(_0x541c7d){_0x307731[_0x5d8e('0x2d')]=_['keys'](db[_0x5d8e('0x58')][_0x5d8e('0x2a')]);_0x307731[_0x5d8e('0x2e')]=_['keys'](_0x16729a[_0x5d8e('0x2e')]);_0x307731[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x307731[_0x5d8e('0x2d')],_0x307731[_0x5d8e('0x2e')]);_0x630b6a[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x307731[_0x5d8e('0x2d')],qs['fields'](_0x16729a['query'][_0x5d8e('0x4b')]));_0x630b6a['attributes']=_0x630b6a[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x630b6a['attributes']:_0x307731[_0x5d8e('0x2d')];if(!_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0x630b6a[_0x5d8e('0x18')]=qs['limit'](_0x16729a[_0x5d8e('0x2e')]['limit']);_0x630b6a['offset']=qs[_0x5d8e('0x17')](_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}_0x630b6a[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x16729a['query'][_0x5d8e('0x36')]);_0x630b6a[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x16729a['query'],_0x307731['filters']));_0x630b6a[_0x5d8e('0x37')]['CampaignId']=_0x541c7d['id'];if(_0x16729a['query'][_0x5d8e('0x39')]){_0x630b6a[_0x5d8e('0x37')]=_['merge'](_0x630b6a[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0x630b6a[_0x5d8e('0x32')],function(_0x52c242){var _0x3a1de2={};_0x3a1de2[_0x52c242]={'$like':'%'+_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x3a1de2;})});}_0x630b6a=_[_0x5d8e('0x3a')]({},_0x630b6a,_0x16729a['options']);return db[_0x5d8e('0x58')][_0x5d8e('0x3c')]({'where':_0x630b6a[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x5f30f2){_0x4ce075['count']=_0x5f30f2;if(_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x630b6a[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x58')][_0x5d8e('0x54')](_0x630b6a);})[_0x5d8e('0x1e')](function(_0x5bf3dd){_0x4ce075[_0x5d8e('0x55')]=_0x5bf3dd;return _0x4ce075;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x449049,_0x630b6a))[_0x5d8e('0x3f')](handleError(_0x449049,null));};exports[_0x5d8e('0x59')]=function(_0x5965bc,_0x404c42,_0x4f2f9e){var _0x39e24a={'raw':!![],'where':{}};var _0x5e1129={};var _0x36f4d9={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5965bc['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x404c42,null))[_0x5d8e('0x1e')](function(_0x15156e){if(_0x15156e){_0x5e1129[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5a')][_0x5d8e('0x2a')]);_0x5e1129['query']=_[_0x5d8e('0x2f')](_0x5965bc[_0x5d8e('0x2e')]);_0x5e1129[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x5e1129[_0x5d8e('0x2d')],_0x5e1129[_0x5d8e('0x2e')]);_0x39e24a[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x5e1129['model'],qs[_0x5d8e('0x4b')](_0x5965bc[_0x5d8e('0x2e')]['fields']));_0x39e24a[_0x5d8e('0x32')]=_0x39e24a[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x39e24a[_0x5d8e('0x32')]:_0x5e1129[_0x5d8e('0x2d')];if(!_0x5965bc[_0x5d8e('0x2e')]['hasOwnProperty'](_0x5d8e('0x34'))){_0x39e24a[_0x5d8e('0x18')]=qs[_0x5d8e('0x18')](_0x5965bc['query'][_0x5d8e('0x18')]);_0x39e24a[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0x5965bc[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}_0x39e24a[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x5965bc['query']['sort']);_0x39e24a['where']=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x5965bc[_0x5d8e('0x2e')],_0x5e1129['filters']));_0x39e24a['where'][_0x5d8e('0x53')]=_0x15156e['id'];if(_0x5965bc['query'][_0x5d8e('0x39')]){_0x39e24a['where']=_[_0x5d8e('0x3a')](_0x39e24a[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0x39e24a['attributes'],function(_0x1e6624){var _0x3f089c={};_0x3f089c[_0x1e6624]={'$like':'%'+_0x5965bc[_0x5d8e('0x2e')]['filter']+'%'};return _0x3f089c;})});}_0x39e24a=_[_0x5d8e('0x3a')]({},_0x39e24a,_0x5965bc[_0x5d8e('0x3b')]);return db['CmHopperFinal'][_0x5d8e('0x3c')]({'where':_0x39e24a[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x4f5dcd){_0x36f4d9[_0x5d8e('0x3c')]=_0x4f5dcd;if(_0x5965bc[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x39e24a['include']=[{'all':!![]}];}return db[_0x5d8e('0x5a')][_0x5d8e('0x54')](_0x39e24a);})[_0x5d8e('0x1e')](function(_0x1d9701){_0x36f4d9[_0x5d8e('0x55')]=_0x1d9701;return _0x36f4d9;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x404c42,_0x39e24a))[_0x5d8e('0x3f')](handleError(_0x404c42,null));};exports['getHopperBlacks']=function(_0x4ea7b3,_0x172ecb,_0x499bf0){var _0xbf0f82={'raw':!![],'where':{}};var _0x14a574={};var _0xdd62a8={'count':0x0,'rows':[]};return db[_0x5d8e('0x29')]['findOne']({'where':{'id':_0x4ea7b3[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x172ecb,null))[_0x5d8e('0x1e')](function(_0x359450){if(_0x359450){_0x14a574['model']=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5b')]['rawAttributes']);_0x14a574[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0x4ea7b3[_0x5d8e('0x2e')]);_0x14a574[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x14a574[_0x5d8e('0x2d')],_0x14a574['query']);_0xbf0f82[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x14a574[_0x5d8e('0x2d')],qs[_0x5d8e('0x4b')](_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x4b')]));_0xbf0f82[_0x5d8e('0x32')]=_0xbf0f82[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0xbf0f82['attributes']:_0x14a574['model'];if(!_0x4ea7b3['query'][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0xbf0f82[_0x5d8e('0x18')]=qs['limit'](_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x18')]);_0xbf0f82[_0x5d8e('0x17')]=qs['offset'](_0x4ea7b3['query']['offset']);}_0xbf0f82['order']=qs[_0x5d8e('0x36')](_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0xbf0f82[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_['pick'](_0x4ea7b3[_0x5d8e('0x2e')],_0x14a574['filters']));_0xbf0f82[_0x5d8e('0x37')][_0x5d8e('0x53')]=_0x359450['id'];if(_0x4ea7b3['query']['filter']){_0xbf0f82[_0x5d8e('0x37')]=_['merge'](_0xbf0f82[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0xbf0f82[_0x5d8e('0x32')],function(_0x2fd897){var _0x15e811={};_0x15e811[_0x2fd897]={'$like':'%'+_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x15e811;})});}_0xbf0f82=_[_0x5d8e('0x3a')]({},_0xbf0f82,_0x4ea7b3[_0x5d8e('0x3b')]);return db[_0x5d8e('0x5b')][_0x5d8e('0x3c')]({'where':_0xbf0f82[_0x5d8e('0x37')]})['then'](function(_0x9b5aa6){_0xdd62a8[_0x5d8e('0x3c')]=_0x9b5aa6;if(_0x4ea7b3['query'][_0x5d8e('0x3d')]){_0xbf0f82[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x5b')]['findAll'](_0xbf0f82);})['then'](function(_0x1051a0){_0xdd62a8['rows']=_0x1051a0;return _0xdd62a8;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x172ecb,_0xbf0f82))[_0x5d8e('0x3f')](handleError(_0x172ecb,null));};exports[_0x5d8e('0x5c')]=function(_0x33c3df,_0x27040a,_0xc6e333){var _0x5ca664={};var _0x50c875={};var _0x2425a3;var _0x3f672d;return db[_0x5d8e('0x29')]['findOne']({'where':{'id':_0x33c3df[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x27040a,null))[_0x5d8e('0x1e')](function(_0x1622bd){if(_0x1622bd){_0x2425a3=_0x1622bd;_0x50c875['model']=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5d')]['rawAttributes']);_0x50c875[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0x33c3df[_0x5d8e('0x2e')]);_0x50c875[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x50c875[_0x5d8e('0x2d')],_0x50c875[_0x5d8e('0x2e')]);_0x5ca664['attributes']=_[_0x5d8e('0x31')](_0x50c875[_0x5d8e('0x2d')],qs[_0x5d8e('0x4b')](_0x33c3df[_0x5d8e('0x2e')]['fields']));_0x5ca664[_0x5d8e('0x32')]=_0x5ca664[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x5ca664[_0x5d8e('0x32')]:_0x50c875[_0x5d8e('0x2d')];_0x5ca664[_0x5d8e('0x35')]=qs['sort'](_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0x5ca664[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x33c3df[_0x5d8e('0x2e')],_0x50c875[_0x5d8e('0x30')]));if(_0x33c3df['query']['filter']){_0x5ca664[_0x5d8e('0x37')]=_[_0x5d8e('0x3a')](_0x5ca664[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0x5ca664[_0x5d8e('0x32')],function(_0x1d86bf){var _0x38065a={};_0x38065a[_0x1d86bf]={'$like':'%'+_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x38065a;})});}_0x5ca664=_['merge']({},_0x5ca664,_0x33c3df[_0x5d8e('0x3b')]);return _0x2425a3[_0x5d8e('0x5c')](_0x5ca664);}})[_0x5d8e('0x1e')](function(_0x4f4f67){if(_0x4f4f67){_0x3f672d=_0x4f4f67['length'];if(!_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x33')]('nolimit')){_0x5ca664[_0x5d8e('0x18')]=qs['limit'](_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x18')]);_0x5ca664[_0x5d8e('0x17')]=qs['offset'](_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}return _0x2425a3['getLists'](_0x5ca664);}})[_0x5d8e('0x1e')](function(_0x4ac604){if(_0x4ac604){return _0x4ac604?{'count':_0x3f672d,'rows':_0x4ac604}:null;}})['then'](respondWithResult(_0x27040a,null))['catch'](handleError(_0x27040a,null));};exports['addLists']=function(_0x4c11a3,_0x542f96,_0x39df36){var _0x38c802,_0x148287;return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x4c11a3['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x542f96,null))['then'](function(_0xbf705f){if(_0xbf705f){_0x148287=_0xbf705f;return _0xbf705f[_0x5d8e('0x5e')](_0x4c11a3[_0x5d8e('0x50')][_0x5d8e('0x5f')],_[_0x5d8e('0x4d')](_0x4c11a3[_0x5d8e('0x50')],[_0x5d8e('0x5f'),'id'])||{});}return null;})[_0x5d8e('0x60')](function(_0x1cf108){var _0x344924;_0x38c802=_0x1cf108||[];var _0xd1a918=[];if(_0x1cf108){for(var _0x9a2afe=0x0;_0x9a2afe<_0x1cf108[_0x5d8e('0x4c')];_0x9a2afe+=0x1){var _0x357684=_0x1cf108[_0x9a2afe][_0x5d8e('0x1f')]({'plain':!![]});_0x148287[_0x5d8e('0x61')]=_0x4c11a3[_0x5d8e('0x50')][_0x5d8e('0x61')]?_0x4c11a3[_0x5d8e('0x50')][_0x5d8e('0x61')]:_0x148287[_0x5d8e('0x61')];switch(_0x148287[_0x5d8e('0x61')]){case _0x5d8e('0x62'):_0x344924=squel[_0x5d8e('0x63')]()[_0x5d8e('0x64')](_0x5d8e('0x65'))[_0x5d8e('0x66')](['phone',_0x5d8e('0x67'),_0x5d8e('0x68'),_0x5d8e('0x69'),_0x5d8e('0x53'),_0x5d8e('0x4e'),'updatedAt'],squel[_0x5d8e('0x6a')]()[_0x5d8e('0x6b')]('phone','phone')['field'](_0x5d8e('0x6c'),_0x5d8e('0x67'))[_0x5d8e('0x6b')]('id',_0x5d8e('0x68'))[_0x5d8e('0x6b')](_0x357684[_0x5d8e('0x6d')][_0x5d8e('0x6e')](),_0x5d8e('0x69'))[_0x5d8e('0x6b')](_0x4c11a3[_0x5d8e('0x4a')]['id'][_0x5d8e('0x6e')](),_0x5d8e('0x53'))[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'createdAt')[_0x5d8e('0x6b')](_0x5d8e('0x6c'),_0x5d8e('0x4f'))[_0x5d8e('0x6f')](_0x5d8e('0x70'))[_0x5d8e('0x37')](_0x5d8e('0x71'))[_0x5d8e('0x37')](_0x5d8e('0x72'),_0x357684[_0x5d8e('0x6d')][_0x5d8e('0x6e')]())[_0x5d8e('0x37')](_0x5d8e('0x73'))[_0x5d8e('0x37')](_0x5d8e('0x74'),squel['select']()['field'](_0x5d8e('0x75'))[_0x5d8e('0x6f')](_0x5d8e('0x76'))[_0x5d8e('0x37')](_0x5d8e('0x77'),_0x4c11a3['params']['id'][_0x5d8e('0x6e')]()))[_0x5d8e('0x37')](_0x5d8e('0x74'),squel[_0x5d8e('0x6a')]()[_0x5d8e('0x6b')](_0x5d8e('0x78'))[_0x5d8e('0x6f')](_0x5d8e('0x65'))['where'](_0x5d8e('0x77'),_0x4c11a3['params']['id'][_0x5d8e('0x6e')]())))[_0x5d8e('0x6e')]();break;case'onlyIfOpen':_0x344924=squel['insert']()[_0x5d8e('0x64')](_0x5d8e('0x65'))[_0x5d8e('0x66')]([_0x5d8e('0x79'),_0x5d8e('0x67'),'ContactId','ListId','CampaignId','createdAt','updatedAt'],squel[_0x5d8e('0x6a')]()['field']('phone',_0x5d8e('0x79'))[_0x5d8e('0x6b')]('NOW()','scheduledAt')['field']('id','ContactId')['field'](_0x357684['CmListId']['toString'](),_0x5d8e('0x69'))[_0x5d8e('0x6b')](_0x4c11a3[_0x5d8e('0x4a')]['id']['toString'](),'CampaignId')['field'](_0x5d8e('0x6c'),_0x5d8e('0x4e'))[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'updatedAt')[_0x5d8e('0x6f')](_0x5d8e('0x70'))[_0x5d8e('0x37')](_0x5d8e('0x71'))['where'](_0x5d8e('0x72'),_0x357684[_0x5d8e('0x6d')]['toString']())[_0x5d8e('0x37')](_0x5d8e('0x73'))['where'](_0x5d8e('0x74'),squel[_0x5d8e('0x6a')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x5d8e('0x65'))[_0x5d8e('0x37')](_0x5d8e('0x77'),_0x4c11a3[_0x5d8e('0x4a')]['id'][_0x5d8e('0x6e')]())))[_0x5d8e('0x6e')]();break;default:_0x344924=squel[_0x5d8e('0x63')]()[_0x5d8e('0x64')](_0x5d8e('0x65'))['fromQuery']([_0x5d8e('0x79'),_0x5d8e('0x67'),_0x5d8e('0x68'),_0x5d8e('0x69'),_0x5d8e('0x53'),'createdAt','updatedAt'],squel['select']()['field'](_0x5d8e('0x79'),_0x5d8e('0x79'))['field'](_0x5d8e('0x6c'),'scheduledAt')[_0x5d8e('0x6b')]('id','ContactId')[_0x5d8e('0x6b')](_0x357684['CmListId']['toString'](),'ListId')['field'](_0x4c11a3['params']['id'][_0x5d8e('0x6e')](),_0x5d8e('0x53'))['field'](_0x5d8e('0x6c'),_0x5d8e('0x4e'))[_0x5d8e('0x6b')](_0x5d8e('0x6c'),_0x5d8e('0x4f'))['from']('cm_contacts')[_0x5d8e('0x37')](_0x5d8e('0x71'))[_0x5d8e('0x37')](_0x5d8e('0x72'),_0x357684[_0x5d8e('0x6d')][_0x5d8e('0x6e')]())[_0x5d8e('0x37')](_0x5d8e('0x73')))['toString']();}_0xd1a918['push'](db['sequelize'][_0x5d8e('0x2e')](_0x344924));}return BPromise[_0x5d8e('0x7a')](_0xd1a918);}})[_0x5d8e('0x1e')](function(){return _0x38c802;})['then'](respondWithResult(_0x542f96,null))[_0x5d8e('0x3f')](handleError(_0x542f96,null));};exports[_0x5d8e('0x7b')]=function(_0xbb0f24,_0x3f3e74,_0x300239){return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0xbb0f24[_0x5d8e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f3e74,null))['then'](function(_0x26edeb){if(_0x26edeb){return _0x26edeb['removeLists'](_0xbb0f24[_0x5d8e('0x2e')][_0x5d8e('0x5f')]);}})['then'](function(_0x11eae1){if(_0x11eae1){return db[_0x5d8e('0x52')][_0x5d8e('0x22')]({'where':{'ListId':_0xbb0f24[_0x5d8e('0x2e')][_0x5d8e('0x5f')],'CampaignId':_0xbb0f24[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](function(){return _0x11eae1;});}})[_0x5d8e('0x1e')](respondWithStatusCode(_0x3f3e74,null))[_0x5d8e('0x3f')](handleError(_0x3f3e74,null));};exports[_0x5d8e('0x7c')]=function(_0x4ed6f4,_0x1797db,_0x20a2f8){var _0x224771={'raw':!![],'where':{}};var _0x4806c1={};var _0x7452a2={'count':0x0,'rows':[]};return db[_0x5d8e('0x29')][_0x5d8e('0x57')]({'where':{'id':_0x4ed6f4['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x1797db,null))[_0x5d8e('0x1e')](function(_0x481967){if(_0x481967){_0x4806c1[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5d')]['rawAttributes']);_0x4806c1[_0x5d8e('0x2e')]=_['keys'](_0x4ed6f4[_0x5d8e('0x2e')]);_0x4806c1['filters']=_[_0x5d8e('0x31')](_0x4806c1[_0x5d8e('0x2d')],_0x4806c1[_0x5d8e('0x2e')]);_0x224771[_0x5d8e('0x32')]=_['intersection'](_0x4806c1[_0x5d8e('0x2d')],qs['fields'](_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x4b')]));_0x224771[_0x5d8e('0x32')]=_0x224771[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x224771[_0x5d8e('0x32')]:_0x4806c1['model'];if(!_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x33')]('nolimit')){_0x224771[_0x5d8e('0x18')]=qs[_0x5d8e('0x18')](_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x18')]);_0x224771[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}_0x224771[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x4ed6f4[_0x5d8e('0x2e')]['sort']);_0x224771[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x4ed6f4['query'],_0x4806c1['filters']));_0x224771['where'][_0x5d8e('0x53')]=_0x481967['id'];if(_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x39')]){_0x224771[_0x5d8e('0x37')]=_['merge'](_0x224771[_0x5d8e('0x37')],{'$or':_['map'](_0x224771['attributes'],function(_0xa1c35d){var _0x559994={};_0x559994[_0xa1c35d]={'$like':'%'+_0x4ed6f4[_0x5d8e('0x2e')]['filter']+'%'};return _0x559994;})});}_0x224771=_[_0x5d8e('0x3a')]({},_0x224771,_0x4ed6f4[_0x5d8e('0x3b')]);return db[_0x5d8e('0x5d')]['count']({'where':_0x224771[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x41fc1a){_0x7452a2['count']=_0x41fc1a;if(_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x224771[_0x5d8e('0x3e')]=[{'all':!![]}];}return db['CmList'][_0x5d8e('0x54')](_0x224771);})[_0x5d8e('0x1e')](function(_0x4e56d7){_0x7452a2[_0x5d8e('0x55')]=_0x4e56d7;return _0x7452a2;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x1797db,_0x224771))[_0x5d8e('0x3f')](handleError(_0x1797db,null));};exports[_0x5d8e('0x7d')]=function(_0x4f283a,_0x237c6f,_0x11a30b){var _0x566685,_0x29454c;return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x4f283a['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x237c6f,null))[_0x5d8e('0x1e')](function(_0x2c2207){if(_0x2c2207){_0x29454c=_0x2c2207;return _0x2c2207['addBlackLists'](_0x4f283a[_0x5d8e('0x50')]['ids'],_['omit'](_0x4f283a['body'],['ids','id'])||{});}return null;})['spread'](function(_0x4e6606){var _0x11fe27;_0x566685=_0x4e6606||[];var _0x5b9193=[];if(_0x4e6606){for(var _0x1e01e3=0x0;_0x1e01e3<_0x4e6606[_0x5d8e('0x4c')];_0x1e01e3+=0x1){var _0x32d122=_0x4e6606[_0x1e01e3][_0x5d8e('0x1f')]({'plain':!![]});_0x11fe27=squel[_0x5d8e('0x63')]()[_0x5d8e('0x64')](_0x5d8e('0x7e'))[_0x5d8e('0x66')]([_0x5d8e('0x79'),'ContactId',_0x5d8e('0x69'),_0x5d8e('0x53'),_0x5d8e('0x4e'),_0x5d8e('0x4f')],squel[_0x5d8e('0x6a')]()['field']('phone',_0x5d8e('0x79'))['field']('id',_0x5d8e('0x68'))[_0x5d8e('0x6b')](_0x32d122[_0x5d8e('0x6d')][_0x5d8e('0x6e')](),'ListId')['field'](_0x4f283a[_0x5d8e('0x4a')]['id'][_0x5d8e('0x6e')](),'CampaignId')[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'createdAt')[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'updatedAt')[_0x5d8e('0x6f')](_0x5d8e('0x70'))[_0x5d8e('0x37')](_0x5d8e('0x71'))['where'](_0x5d8e('0x72'),_0x32d122[_0x5d8e('0x6d')]['toString']())[_0x5d8e('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0x5d8e('0x6e')]();_0x5b9193[_0x5d8e('0x7f')](db[_0x5d8e('0x80')][_0x5d8e('0x2e')](_0x11fe27));}return BPromise[_0x5d8e('0x7a')](_0x5b9193);}})['then'](function(){return _0x566685;})[_0x5d8e('0x1e')](respondWithResult(_0x237c6f,null))['catch'](handleError(_0x237c6f,null));};exports['removeBlackLists']=function(_0x36c656,_0x4ec4ee,_0x360bf5){return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x36c656[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x4ec4ee,null))['then'](function(_0x4fba0d){if(_0x4fba0d){return _0x4fba0d[_0x5d8e('0x81')](_0x36c656['query']['ids']);}})[_0x5d8e('0x1e')](function(_0x2a3ea3){if(_0x2a3ea3){return db[_0x5d8e('0x5b')]['destroy']({'where':{'ListId':_0x36c656[_0x5d8e('0x2e')]['ids'],'CampaignId':_0x36c656[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](function(){return _0x2a3ea3;});}})[_0x5d8e('0x1e')](respondWithStatusCode(_0x4ec4ee,null))[_0x5d8e('0x3f')](handleError(_0x4ec4ee,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 2dec69e..2ff6ff6 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 _0xda9a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','campaigns','lodash'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xda9a,0xd7));var _0xada9=function(_0xf4237a,_0x1ac1e2){_0xf4237a=_0xf4237a-0x0;var _0x7b4c17=_0xda9a[_0xf4237a];return _0x7b4c17;};'use strict';var _=require(_0xada9('0x0'));var util=require(_0xada9('0x1'));var logger=require(_0xada9('0x2'))(_0xada9('0x3'));var moment=require(_0xada9('0x4'));var BPromise=require('bluebird');var rp=require(_0xada9('0x5'));var fs=require('fs');var path=require(_0xada9('0x6'));var rimraf=require(_0xada9('0x7'));var config=require(_0xada9('0x8'));var attributes=require(_0xada9('0x9'));module[_0xada9('0xa')]=function(_0x440a51,_0x4cadaa){return _0x440a51['define']('Campaign',attributes,{'tableName':_0xada9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9ec=['Campaign','campaigns','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x3e6b70,_0x37bc45){var _0x1283a2=function(_0x1f0ec4){while(--_0x1f0ec4){_0x3e6b70['push'](_0x3e6b70['shift']());}};_0x1283a2(++_0x37bc45);}(_0xb9ec,0xf2));var _0xcb9e=function(_0x51b5a,_0x234bc3){_0x51b5a=_0x51b5a-0x0;var _0x10eb61=_0xb9ec[_0x51b5a];return _0x10eb61;};'use strict';var _=require(_0xcb9e('0x0'));var util=require(_0xcb9e('0x1'));var logger=require(_0xcb9e('0x2'))(_0xcb9e('0x3'));var moment=require(_0xcb9e('0x4'));var BPromise=require(_0xcb9e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb9e('0x6'));var config=require(_0xcb9e('0x7'));var attributes=require('./campaign.attributes');module[_0xcb9e('0x8')]=function(_0x4f21de,_0x53e947){return _0x4f21de[_0xcb9e('0x9')](_0xcb9e('0xa'),attributes,{'tableName':_0xcb9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 13d2430..5816ff2 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4edca0,_0xc747da){var _0x38114a=function(_0xc9d063){while(--_0xc9d063){_0x4edca0['push'](_0x4edca0['shift']());}};_0x38114a(++_0xc747da);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x193209,_0x5e53d9){var _0x3b0971=function(_0x5596b4){while(--_0x5596b4){_0x193209['push'](_0x193209['shift']());}};_0x3b0971(++_0x5e53d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c9096d9..42b31a6 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 _0x93e9=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x14b18e,_0x1ab1b4){var _0x2f7072=function(_0x538b3f){while(--_0x538b3f){_0x14b18e['push'](_0x14b18e['shift']());}};_0x2f7072(++_0x1ab1b4);}(_0x93e9,0xcc));var _0x993e=function(_0x3c0fda,_0x3f0af4){_0x3c0fda=_0x3c0fda-0x0;var _0x49a582=_0x93e9[_0x3c0fda];return _0x49a582;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var auth=require(_0x993e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x993e('0x7'));router[_0x993e('0x8')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0xa')]);router[_0x993e('0x8')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xc')]);router['get'](_0x993e('0xd'),auth[_0x993e('0x9')](),controller[_0x993e('0xe')]);router[_0x993e('0x8')](_0x993e('0xf'),auth[_0x993e('0x9')](),controller[_0x993e('0x10')]);router['get'](_0x993e('0x11'),auth[_0x993e('0x9')](),controller['getHopperFinals']);router['get'](_0x993e('0x12'),auth['isAuthenticated'](),controller[_0x993e('0x13')]);router['get']('/:id/lists',auth[_0x993e('0x9')](),controller[_0x993e('0x14')]);router[_0x993e('0x8')](_0x993e('0x15'),auth[_0x993e('0x9')](),controller[_0x993e('0x16')]);router[_0x993e('0x17')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0x18')]);router[_0x993e('0x17')](_0x993e('0x19'),auth[_0x993e('0x9')](),controller[_0x993e('0x1a')]);router[_0x993e('0x17')](_0x993e('0x1b'),auth[_0x993e('0x9')](),controller[_0x993e('0x1c')]);router['post'](_0x993e('0x15'),auth[_0x993e('0x9')](),controller[_0x993e('0x1d')]);router[_0x993e('0x1e')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller['update']);router[_0x993e('0x1f')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0x20')]);router[_0x993e('0x1f')](_0x993e('0x1b'),auth[_0x993e('0x9')](),controller[_0x993e('0x21')]);router['delete'](_0x993e('0x15'),auth['isAuthenticated'](),controller[_0x993e('0x22')]);module[_0x993e('0x23')]=router;
\ No newline at end of file
+var _0x1cbc=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','addBlackLists','put','/:id','update','delete','destroy','removeLists','/:id/blacklists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index'];(function(_0x38818e,_0x126692){var _0x96c876=function(_0x293c12){while(--_0x293c12){_0x38818e['push'](_0x38818e['shift']());}};_0x96c876(++_0x126692);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x337d93,_0x7908a5){_0x337d93=_0x337d93-0x0;var _0x52a98b=_0x1cbc[_0x337d93];return _0x52a98b;};'use strict';var multer=require(_0xc1cb('0x0'));var util=require('util');var path=require(_0xc1cb('0x1'));var timeout=require(_0xc1cb('0x2'));var express=require(_0xc1cb('0x3'));var router=express[_0xc1cb('0x4')]();var auth=require(_0xc1cb('0x5'));var interaction=require(_0xc1cb('0x6'));var config=require(_0xc1cb('0x7'));var controller=require(_0xc1cb('0x8'));router[_0xc1cb('0x9')]('/',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0xb')]);router[_0xc1cb('0x9')]('/:id',auth[_0xc1cb('0xa')](),controller['show']);router[_0xc1cb('0x9')](_0xc1cb('0xc'),auth['isAuthenticated'](),controller[_0xc1cb('0xd')]);router[_0xc1cb('0x9')](_0xc1cb('0xe'),auth[_0xc1cb('0xa')](),controller[_0xc1cb('0xf')]);router[_0xc1cb('0x9')](_0xc1cb('0x10'),auth[_0xc1cb('0xa')](),controller['getHopperFinals']);router[_0xc1cb('0x9')]('/:id/hopper_black',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x11')]);router[_0xc1cb('0x9')](_0xc1cb('0x12'),auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x13')]);router[_0xc1cb('0x9')]('/:id/blacklists',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x14')]);router[_0xc1cb('0x15')]('/',auth[_0xc1cb('0xa')](),controller['create']);router[_0xc1cb('0x15')](_0xc1cb('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0xc1cb('0x15')](_0xc1cb('0x12'),auth[_0xc1cb('0xa')](),controller['addLists']);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xc1cb('0x17')]);router[_0xc1cb('0x18')](_0xc1cb('0x19'),auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x1a')]);router[_0xc1cb('0x1b')]('/:id',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x1c')]);router[_0xc1cb('0x1b')](_0xc1cb('0x12'),auth['isAuthenticated'](),controller[_0xc1cb('0x1d')]);router[_0xc1cb('0x1b')](_0xc1cb('0x1e'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xc1cb('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6ec9b85..82f1142 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 _0x5a24=['TEXT','VIRTUAL','key','sequelize','STRING'];(function(_0x38c563,_0x4f4168){var _0x16acac=function(_0x28773e){while(--_0x28773e){_0x38c563['push'](_0x38c563['shift']());}};_0x16acac(++_0x4f4168);}(_0x5a24,0x1e3));var _0x45a2=function(_0x4f74e7,_0x3bc69b){_0x4f74e7=_0x4f74e7-0x0;var _0xf87cf0=_0x5a24[_0x4f74e7];return _0xf87cf0;};'use strict';var Sequelize=require(_0x45a2('0x0'));module['exports']={'key':{'type':Sequelize[_0x45a2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x45a2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x45a2('0x1')]},'name':{'type':Sequelize[_0x45a2('0x3')],'get':function(){return this['getDataValue'](_0x45a2('0x4'));}}};
\ No newline at end of file
+var _0x5917=['STRING','VIRTUAL','key','exports','TEXT'];(function(_0x1a2a88,_0x2c3cc7){var _0x577d74=function(_0x467bc6){while(--_0x467bc6){_0x1a2a88['push'](_0x1a2a88['shift']());}};_0x577d74(++_0x2c3cc7);}(_0x5917,0xa3));var _0x7591=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5917[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x7591('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7591('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7591('0x2')]},'name':{'type':Sequelize[_0x7591('0x3')],'get':function(){return this['getDataValue'](_0x7591('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1bc09f3..41d738f 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 _0x4290=['count','offset','limit','set','Content-Range','save','update','destroy','CannedAnswers','UserProfileResource','then','error','name','send','index','map','CannedAnswer','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','field','includeAll','include','findAll','rows','catch','show','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json'];(function(_0xc700b5,_0x14d937){var _0x35ac84=function(_0x4f40b1){while(--_0x4f40b1){_0xc700b5['push'](_0xc700b5['shift']());}};_0x35ac84(++_0x14d937);}(_0x4290,0x180));var _0x0429=function(_0x468119,_0x422d72){_0x468119=_0x468119-0x0;var _0x54ac28=_0x4290[_0x468119];return _0x54ac28;};'use strict';var pdf=require(_0x0429('0x0'));var emlformat=require(_0x0429('0x1'));var rimraf=require(_0x0429('0x2'));var zipdir=require(_0x0429('0x3'));var jsonpatch=require(_0x0429('0x4'));var rp=require(_0x0429('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0429('0x6'));var util=require(_0x0429('0x7'));var path=require(_0x0429('0x8'));var sox=require(_0x0429('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0429('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0429('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0429('0xc'));var Redis=require('ioredis');var authService=require(_0x0429('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0429('0xe'));var hardwareService=require(_0x0429('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0429('0x10'));var db=require(_0x0429('0x11'))['db'];function respondWithStatusCode(_0x21ecdc,_0x419e6e){_0x419e6e=_0x419e6e||0xcc;return function(_0x2ead94){if(_0x2ead94){return _0x21ecdc['sendStatus'](_0x419e6e);}return _0x21ecdc[_0x0429('0x12')](_0x419e6e)[_0x0429('0x13')]();};}function respondWithResult(_0x2d7278,_0x3fd50d){_0x3fd50d=_0x3fd50d||0xc8;return function(_0x2913af){if(_0x2913af){return _0x2d7278[_0x0429('0x12')](_0x3fd50d)[_0x0429('0x14')](_0x2913af);}};}function respondWithFilteredResult(_0x1558ac,_0x1d97f4){return function(_0x4e8f7e){if(_0x4e8f7e){var _0x41dee6=_0x4e8f7e[_0x0429('0x15')],_0x4afb02=_0x1d97f4['offset'],_0x3ea88f=_0x1d97f4[_0x0429('0x16')]+_0x1d97f4[_0x0429('0x17')],_0x5179f8;if(_0x3ea88f>=_0x41dee6){_0x3ea88f=_0x41dee6;_0x5179f8=0xc8;}else{_0x5179f8=0xce;}_0x1558ac[_0x0429('0x12')](_0x5179f8);return _0x1558ac[_0x0429('0x18')](_0x0429('0x19'),_0x4afb02+'-'+_0x3ea88f+'/'+_0x41dee6)[_0x0429('0x14')](_0x4e8f7e);}return null;};}function patchUpdates(_0x4000fb){return function(_0x289536){try{jsonpatch['apply'](_0x289536,_0x4000fb,!![]);}catch(_0x5abba9){return BPromise['reject'](_0x5abba9);}return _0x289536[_0x0429('0x1a')]();};}function saveUpdates(_0x31d7e4,_0x9ad52){return function(_0x5e474e){if(_0x5e474e){return _0x5e474e[_0x0429('0x1b')](_0x31d7e4)['then'](function(_0x221566){return _0x221566;});}return null;};}function removeEntity(_0x542db3,_0x33c884){return function(_0x3459a4){if(_0x3459a4){return _0x3459a4[_0x0429('0x1c')]()['then'](function(){var _0x4c7b26=_0x3459a4['get']({'plain':!![]});var _0x3b3378=_0x0429('0x1d');return db[_0x0429('0x1e')][_0x0429('0x1c')]({'where':{'type':_0x3b3378,'resourceId':_0x4c7b26['id']}})[_0x0429('0x1f')](function(){return _0x3459a4;});})[_0x0429('0x1f')](function(){_0x542db3['status'](0xcc)[_0x0429('0x13')]();});}};}function handleEntityNotFound(_0x3c6ccd,_0x20632d){return function(_0xf112a2){if(!_0xf112a2){_0x3c6ccd['sendStatus'](0x194);}return _0xf112a2;};}function handleError(_0x2babd4,_0x21bf17){_0x21bf17=_0x21bf17||0x1f4;return function(_0x274a29){logger[_0x0429('0x20')](_0x274a29['stack']);if(_0x274a29[_0x0429('0x21')]){delete _0x274a29['name'];}_0x2babd4[_0x0429('0x12')](_0x21bf17)[_0x0429('0x22')](_0x274a29);};}exports[_0x0429('0x23')]=function(_0x1f7079,_0x1293e8){var _0x31bc4a={},_0x5e5d6e={},_0x4c7c6b={'count':0x0,'rows':[]};var _0x1a685f=_[_0x0429('0x24')](db[_0x0429('0x25')]['rawAttributes'],function(_0x385f93){return{'name':_0x385f93[_0x0429('0x26')],'type':_0x385f93['type'][_0x0429('0x27')]};});_0x5e5d6e[_0x0429('0x28')]=_[_0x0429('0x24')](_0x1a685f,_0x0429('0x21'));_0x5e5d6e[_0x0429('0x29')]=_[_0x0429('0x2a')](_0x1f7079[_0x0429('0x29')]);_0x5e5d6e[_0x0429('0x2b')]=_[_0x0429('0x2c')](_0x5e5d6e['model'],_0x5e5d6e[_0x0429('0x29')]);_0x31bc4a['attributes']=_[_0x0429('0x2c')](_0x5e5d6e[_0x0429('0x28')],qs[_0x0429('0x2d')](_0x1f7079['query'][_0x0429('0x2d')]));_0x31bc4a[_0x0429('0x2e')]=_0x31bc4a[_0x0429('0x2e')][_0x0429('0x2f')]?_0x31bc4a[_0x0429('0x2e')]:_0x5e5d6e[_0x0429('0x28')];if(!_0x1f7079[_0x0429('0x29')][_0x0429('0x30')](_0x0429('0x31'))){_0x31bc4a[_0x0429('0x17')]=qs[_0x0429('0x17')](_0x1f7079[_0x0429('0x29')][_0x0429('0x17')]);_0x31bc4a[_0x0429('0x16')]=qs[_0x0429('0x16')](_0x1f7079['query'][_0x0429('0x16')]);}_0x31bc4a['order']=qs[_0x0429('0x32')](_0x1f7079[_0x0429('0x29')]['sort']);_0x31bc4a['where']=qs[_0x0429('0x2b')](_[_0x0429('0x33')](_0x1f7079[_0x0429('0x29')],_0x5e5d6e[_0x0429('0x2b')]));if(_0x1f7079[_0x0429('0x29')][_0x0429('0x34')]){_0x31bc4a[_0x0429('0x35')]=_[_0x0429('0x36')](_0x31bc4a[_0x0429('0x35')],{'$or':_[_0x0429('0x24')](_0x1a685f,function(_0x1cb253){if(_0x1cb253['type']['key']!=='VIRTUAL'){var _0x167404={};_0x167404[_0x1cb253[_0x0429('0x37')]]={'$like':'%'+_0x1f7079[_0x0429('0x29')]['filter']+'%'};return _0x167404;}})});}_0x31bc4a=_[_0x0429('0x36')]({},_0x31bc4a,_0x1f7079['options']);var _0x22fcd6={'where':_0x31bc4a[_0x0429('0x35')]};return db[_0x0429('0x25')][_0x0429('0x15')](_0x22fcd6)[_0x0429('0x1f')](function(_0xaf9db1){_0x4c7c6b['count']=_0xaf9db1;if(_0x1f7079[_0x0429('0x29')][_0x0429('0x38')]){_0x31bc4a[_0x0429('0x39')]=[{'all':!![]}];}return db[_0x0429('0x25')][_0x0429('0x3a')](_0x31bc4a);})[_0x0429('0x1f')](function(_0x201e4f){_0x4c7c6b[_0x0429('0x3b')]=_0x201e4f;return _0x4c7c6b;})[_0x0429('0x1f')](respondWithFilteredResult(_0x1293e8,_0x31bc4a))[_0x0429('0x3c')](handleError(_0x1293e8,null));};exports[_0x0429('0x3d')]=function(_0x19e357,_0x36fd77){var _0x292778={'raw':!![],'where':{'id':_0x19e357['params']['id']}},_0x38a4e8={};_0x38a4e8[_0x0429('0x28')]=_[_0x0429('0x2a')](db['CannedAnswer']['rawAttributes']);_0x38a4e8[_0x0429('0x29')]=_[_0x0429('0x2a')](_0x19e357[_0x0429('0x29')]);_0x38a4e8[_0x0429('0x2b')]=_[_0x0429('0x2c')](_0x38a4e8['model'],_0x38a4e8[_0x0429('0x29')]);_0x292778[_0x0429('0x2e')]=_[_0x0429('0x2c')](_0x38a4e8[_0x0429('0x28')],qs[_0x0429('0x2d')](_0x19e357[_0x0429('0x29')][_0x0429('0x2d')]));_0x292778[_0x0429('0x2e')]=_0x292778['attributes'][_0x0429('0x2f')]?_0x292778[_0x0429('0x2e')]:_0x38a4e8[_0x0429('0x28')];if(_0x19e357[_0x0429('0x29')][_0x0429('0x38')]){_0x292778[_0x0429('0x39')]=[{'all':!![]}];}_0x292778=_['merge']({},_0x292778,_0x19e357[_0x0429('0x3e')]);return db[_0x0429('0x25')][_0x0429('0x3f')](_0x292778)['then'](handleEntityNotFound(_0x36fd77,null))[_0x0429('0x1f')](respondWithResult(_0x36fd77,null))[_0x0429('0x3c')](handleError(_0x36fd77,null));};exports[_0x0429('0x1b')]=function(_0x46ef52,_0x424836){if(_0x46ef52[_0x0429('0x40')]['id']){delete _0x46ef52[_0x0429('0x40')]['id'];}return db['CannedAnswer'][_0x0429('0x3f')]({'where':{'id':_0x46ef52[_0x0429('0x41')]['id']}})['then'](handleEntityNotFound(_0x424836,null))[_0x0429('0x1f')](saveUpdates(_0x46ef52[_0x0429('0x40')],null))[_0x0429('0x1f')](respondWithResult(_0x424836,null))[_0x0429('0x3c')](handleError(_0x424836,null));};exports[_0x0429('0x1c')]=function(_0x4b3e99,_0x112a8b){return db[_0x0429('0x25')][_0x0429('0x3f')]({'where':{'id':_0x4b3e99[_0x0429('0x41')]['id']}})[_0x0429('0x1f')](handleEntityNotFound(_0x112a8b,null))[_0x0429('0x1f')](removeEntity(_0x112a8b,null))['catch'](handleError(_0x112a8b,null));};exports[_0x0429('0x42')]=function(_0x4bf7dd,_0x31efb6){var _0x2dbbea={'key':_0x4bf7dd[_0x0429('0x40')][_0x0429('0x27')]};if(_0x4bf7dd[_0x0429('0x40')]['MailAccountId']){_0x2dbbea[_0x0429('0x43')]=_0x4bf7dd[_0x0429('0x40')]['MailAccountId'];}else if(_0x4bf7dd[_0x0429('0x40')][_0x0429('0x44')]){_0x2dbbea[_0x0429('0x44')]=_0x4bf7dd['body'][_0x0429('0x44')];}else if(_0x4bf7dd[_0x0429('0x40')][_0x0429('0x45')]){_0x2dbbea[_0x0429('0x45')]=_0x4bf7dd[_0x0429('0x40')][_0x0429('0x45')];}else if(_0x4bf7dd[_0x0429('0x40')][_0x0429('0x46')]){_0x2dbbea[_0x0429('0x46')]=_0x4bf7dd['body'][_0x0429('0x46')];}return db[_0x0429('0x25')]['find']({'where':_0x2dbbea})[_0x0429('0x1f')](function(_0x45f84c){if(_0x45f84c){throw new db[(_0x0429('0x47'))][(_0x0429('0x48'))](_0x0429('0x49'));}return db[_0x0429('0x25')]['create'](_0x4bf7dd[_0x0429('0x40')]);})[_0x0429('0x1f')](function(_0x5c23e6){var _0x1daf9d=_0x4bf7dd[_0x0429('0x4a')][_0x0429('0x4b')]({'plain':!![]});if(!_0x1daf9d)throw new Error(_0x0429('0x4c'));if(_0x1daf9d[_0x0429('0x4d')]===_0x0429('0x4a')){var _0x52f53d=_0x5c23e6[_0x0429('0x4b')]({'plain':!![]});return db[_0x0429('0x4e')][_0x0429('0x3f')]({'where':{'name':'CannedAnswers','userProfileId':_0x1daf9d[_0x0429('0x4f')]},'raw':!![]})[_0x0429('0x1f')](function(_0x28ee45){if(_0x28ee45&&_0x28ee45['autoAssociation']===0x0){return db[_0x0429('0x1e')][_0x0429('0x42')]({'name':_0x52f53d['name'],'resourceId':_0x52f53d['id'],'type':_0x28ee45['name'],'sectionId':_0x28ee45['id']},{})['then'](function(){return _0x5c23e6;});}else{return _0x5c23e6;}})[_0x0429('0x3c')](function(_0x23def4){logger[_0x0429('0x20')](_0x0429('0x50'),_0x23def4);throw _0x23def4;});}return _0x5c23e6;})[_0x0429('0x1f')](respondWithResult(_0x31efb6,0xc9))[_0x0429('0x3c')](handleError(_0x31efb6,null));};
\ No newline at end of file
+var _0x41f5=['The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x395432,_0x1349cb){var _0x4d3c6e=function(_0x4bf76c){while(--_0x4bf76c){_0x395432['push'](_0x395432['shift']());}};_0x4d3c6e(++_0x1349cb);}(_0x41f5,0x117));var _0x541f=function(_0x4f7e37,_0x291c9f){_0x4f7e37=_0x4f7e37-0x0;var _0x442ea8=_0x41f5[_0x4f7e37];return _0x442ea8;};'use strict';var pdf=require(_0x541f('0x0'));var emlformat=require(_0x541f('0x1'));var rimraf=require(_0x541f('0x2'));var zipdir=require(_0x541f('0x3'));var jsonpatch=require(_0x541f('0x4'));var rp=require(_0x541f('0x5'));var moment=require(_0x541f('0x6'));var BPromise=require(_0x541f('0x7'));var Mustache=require(_0x541f('0x8'));var util=require(_0x541f('0x9'));var path=require(_0x541f('0xa'));var sox=require(_0x541f('0xb'));var csv=require('to-csv');var ejs=require(_0x541f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x541f('0xd'));var crypto=require(_0x541f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x541f('0xf'));var querystring=require(_0x541f('0x10'));var Papa=require(_0x541f('0x11'));var Redis=require(_0x541f('0x12'));var authService=require(_0x541f('0x13'));var qs=require(_0x541f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x541f('0x15'))('api');var utils=require(_0x541f('0x16'));var config=require(_0x541f('0x17'));var db=require(_0x541f('0x18'))['db'];function respondWithStatusCode(_0xbc6a82,_0xa617da){_0xa617da=_0xa617da||0xcc;return function(_0x50d831){if(_0x50d831){return _0xbc6a82['sendStatus'](_0xa617da);}return _0xbc6a82['status'](_0xa617da)[_0x541f('0x19')]();};}function respondWithResult(_0x20fe4b,_0x3328ad){_0x3328ad=_0x3328ad||0xc8;return function(_0x450ed9){if(_0x450ed9){return _0x20fe4b[_0x541f('0x1a')](_0x3328ad)[_0x541f('0x1b')](_0x450ed9);}};}function respondWithFilteredResult(_0x343284,_0x3b5ec9){return function(_0x112a01){if(_0x112a01){var _0x4b95b0=_0x112a01[_0x541f('0x1c')],_0x4f510b=_0x3b5ec9['offset'],_0x11f3d2=_0x3b5ec9[_0x541f('0x1d')]+_0x3b5ec9[_0x541f('0x1e')],_0x11836e;if(_0x11f3d2>=_0x4b95b0){_0x11f3d2=_0x4b95b0;_0x11836e=0xc8;}else{_0x11836e=0xce;}_0x343284['status'](_0x11836e);return _0x343284[_0x541f('0x1f')](_0x541f('0x20'),_0x4f510b+'-'+_0x11f3d2+'/'+_0x4b95b0)[_0x541f('0x1b')](_0x112a01);}return null;};}function patchUpdates(_0x2603a8){return function(_0x4b3666){try{jsonpatch[_0x541f('0x21')](_0x4b3666,_0x2603a8,!![]);}catch(_0x107b8c){return BPromise[_0x541f('0x22')](_0x107b8c);}return _0x4b3666['save']();};}function saveUpdates(_0x5f45b3,_0x25e94f){return function(_0x594de5){if(_0x594de5){return _0x594de5[_0x541f('0x23')](_0x5f45b3)[_0x541f('0x24')](function(_0x27a565){return _0x27a565;});}return null;};}function removeEntity(_0x544616,_0x4cf4f5){return function(_0x357032){if(_0x357032){return _0x357032[_0x541f('0x25')]()[_0x541f('0x24')](function(){var _0x5688fa=_0x357032[_0x541f('0x26')]({'plain':!![]});var _0x5b95c6=_0x541f('0x27');return db[_0x541f('0x28')][_0x541f('0x25')]({'where':{'type':_0x5b95c6,'resourceId':_0x5688fa['id']}})[_0x541f('0x24')](function(){return _0x357032;});})[_0x541f('0x24')](function(){_0x544616['status'](0xcc)[_0x541f('0x19')]();});}};}function handleEntityNotFound(_0x214118,_0x43670f){return function(_0x2496cc){if(!_0x2496cc){_0x214118[_0x541f('0x29')](0x194);}return _0x2496cc;};}function handleError(_0x2ea67e,_0x2edd5a){_0x2edd5a=_0x2edd5a||0x1f4;return function(_0x181215){logger[_0x541f('0x2a')](_0x181215['stack']);if(_0x181215[_0x541f('0x2b')]){delete _0x181215['name'];}_0x2ea67e[_0x541f('0x1a')](_0x2edd5a)[_0x541f('0x2c')](_0x181215);};}exports[_0x541f('0x2d')]=function(_0x17e7e4,_0x1b2042){var _0x24582a={},_0x3233be={},_0x5923ce={'count':0x0,'rows':[]};var _0x2df4fe=_[_0x541f('0x2e')](db[_0x541f('0x2f')][_0x541f('0x30')],function(_0x4bc17e){return{'name':_0x4bc17e[_0x541f('0x31')],'type':_0x4bc17e[_0x541f('0x32')][_0x541f('0x33')]};});_0x3233be[_0x541f('0x34')]=_[_0x541f('0x2e')](_0x2df4fe,_0x541f('0x2b'));_0x3233be['query']=_[_0x541f('0x35')](_0x17e7e4[_0x541f('0x36')]);_0x3233be[_0x541f('0x37')]=_[_0x541f('0x38')](_0x3233be[_0x541f('0x34')],_0x3233be[_0x541f('0x36')]);_0x24582a[_0x541f('0x39')]=_[_0x541f('0x38')](_0x3233be[_0x541f('0x34')],qs['fields'](_0x17e7e4['query'][_0x541f('0x3a')]));_0x24582a[_0x541f('0x39')]=_0x24582a[_0x541f('0x39')][_0x541f('0x3b')]?_0x24582a[_0x541f('0x39')]:_0x3233be[_0x541f('0x34')];if(!_0x17e7e4[_0x541f('0x36')][_0x541f('0x3c')](_0x541f('0x3d'))){_0x24582a[_0x541f('0x1e')]=qs['limit'](_0x17e7e4['query'][_0x541f('0x1e')]);_0x24582a[_0x541f('0x1d')]=qs['offset'](_0x17e7e4[_0x541f('0x36')][_0x541f('0x1d')]);}_0x24582a[_0x541f('0x3e')]=qs[_0x541f('0x3f')](_0x17e7e4['query'][_0x541f('0x3f')]);_0x24582a['where']=qs[_0x541f('0x37')](_[_0x541f('0x40')](_0x17e7e4['query'],_0x3233be[_0x541f('0x37')]));if(_0x17e7e4[_0x541f('0x36')][_0x541f('0x41')]){_0x24582a[_0x541f('0x42')]=_[_0x541f('0x43')](_0x24582a[_0x541f('0x42')],{'$or':_['map'](_0x2df4fe,function(_0x39d424){if(_0x39d424[_0x541f('0x32')][_0x541f('0x33')]!==_0x541f('0x44')){var _0xb356e4={};_0xb356e4[_0x39d424[_0x541f('0x45')]]={'$like':'%'+_0x17e7e4[_0x541f('0x36')][_0x541f('0x41')]+'%'};return _0xb356e4;}})});}_0x24582a=_[_0x541f('0x43')]({},_0x24582a,_0x17e7e4[_0x541f('0x46')]);var _0x2d2bdc={'where':_0x24582a['where']};return db['CannedAnswer']['count'](_0x2d2bdc)['then'](function(_0x19ecac){_0x5923ce[_0x541f('0x1c')]=_0x19ecac;if(_0x17e7e4[_0x541f('0x36')][_0x541f('0x47')]){_0x24582a[_0x541f('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0x541f('0x49')](_0x24582a);})[_0x541f('0x24')](function(_0x5210e6){_0x5923ce[_0x541f('0x4a')]=_0x5210e6;return _0x5923ce;})[_0x541f('0x24')](respondWithFilteredResult(_0x1b2042,_0x24582a))['catch'](handleError(_0x1b2042,null));};exports[_0x541f('0x4b')]=function(_0x5e01ac,_0x1dc0ed){var _0x1a2847={'raw':!![],'where':{'id':_0x5e01ac[_0x541f('0x4c')]['id']}},_0x1c2107={};_0x1c2107[_0x541f('0x34')]=_[_0x541f('0x35')](db[_0x541f('0x2f')]['rawAttributes']);_0x1c2107[_0x541f('0x36')]=_[_0x541f('0x35')](_0x5e01ac[_0x541f('0x36')]);_0x1c2107[_0x541f('0x37')]=_[_0x541f('0x38')](_0x1c2107[_0x541f('0x34')],_0x1c2107[_0x541f('0x36')]);_0x1a2847['attributes']=_['intersection'](_0x1c2107[_0x541f('0x34')],qs[_0x541f('0x3a')](_0x5e01ac['query'][_0x541f('0x3a')]));_0x1a2847[_0x541f('0x39')]=_0x1a2847[_0x541f('0x39')][_0x541f('0x3b')]?_0x1a2847[_0x541f('0x39')]:_0x1c2107[_0x541f('0x34')];if(_0x5e01ac[_0x541f('0x36')][_0x541f('0x47')]){_0x1a2847[_0x541f('0x48')]=[{'all':!![]}];}_0x1a2847=_[_0x541f('0x43')]({},_0x1a2847,_0x5e01ac[_0x541f('0x46')]);return db['CannedAnswer'][_0x541f('0x4d')](_0x1a2847)[_0x541f('0x24')](handleEntityNotFound(_0x1dc0ed,null))[_0x541f('0x24')](respondWithResult(_0x1dc0ed,null))[_0x541f('0x4e')](handleError(_0x1dc0ed,null));};exports['update']=function(_0x57c75c,_0x275559){if(_0x57c75c['body']['id']){delete _0x57c75c[_0x541f('0x4f')]['id'];}return db[_0x541f('0x2f')][_0x541f('0x4d')]({'where':{'id':_0x57c75c[_0x541f('0x4c')]['id']}})[_0x541f('0x24')](handleEntityNotFound(_0x275559,null))[_0x541f('0x24')](saveUpdates(_0x57c75c[_0x541f('0x4f')],null))[_0x541f('0x24')](respondWithResult(_0x275559,null))[_0x541f('0x4e')](handleError(_0x275559,null));};exports[_0x541f('0x25')]=function(_0x5df412,_0x49e7e8){return db[_0x541f('0x2f')][_0x541f('0x4d')]({'where':{'id':_0x5df412[_0x541f('0x4c')]['id']}})[_0x541f('0x24')](handleEntityNotFound(_0x49e7e8,null))[_0x541f('0x24')](removeEntity(_0x49e7e8,null))[_0x541f('0x4e')](handleError(_0x49e7e8,null));};exports['create']=function(_0x4dcddb,_0x10d2f7){var _0x3245c3={'key':_0x4dcddb[_0x541f('0x4f')][_0x541f('0x33')]};if(_0x4dcddb[_0x541f('0x4f')]['MailAccountId']){_0x3245c3[_0x541f('0x50')]=_0x4dcddb[_0x541f('0x4f')][_0x541f('0x50')];}else if(_0x4dcddb[_0x541f('0x4f')][_0x541f('0x51')]){_0x3245c3[_0x541f('0x51')]=_0x4dcddb['body']['SmsAccountId'];}else if(_0x4dcddb[_0x541f('0x4f')][_0x541f('0x52')]){_0x3245c3[_0x541f('0x52')]=_0x4dcddb[_0x541f('0x4f')][_0x541f('0x52')];}else if(_0x4dcddb[_0x541f('0x4f')][_0x541f('0x53')]){_0x3245c3[_0x541f('0x53')]=_0x4dcddb[_0x541f('0x4f')][_0x541f('0x53')];}return db[_0x541f('0x2f')]['find']({'where':_0x3245c3})[_0x541f('0x24')](function(_0xae46c7){if(_0xae46c7){throw new db[(_0x541f('0x54'))]['ValidationError'](_0x541f('0x55'));}return db[_0x541f('0x2f')][_0x541f('0x56')](_0x4dcddb[_0x541f('0x4f')]);})[_0x541f('0x24')](function(_0x4a396d){var _0x499d8f=_0x4dcddb['user'][_0x541f('0x26')]({'plain':!![]});if(!_0x499d8f)throw new Error(_0x541f('0x57'));if(_0x499d8f['role']===_0x541f('0x58')){var _0x47b46a=_0x4a396d[_0x541f('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x541f('0x4d')]({'where':{'name':_0x541f('0x27'),'userProfileId':_0x499d8f[_0x541f('0x59')]},'raw':!![]})['then'](function(_0x3687d9){if(_0x3687d9&&_0x3687d9[_0x541f('0x5a')]===0x0){return db[_0x541f('0x28')]['create']({'name':_0x47b46a[_0x541f('0x2b')],'resourceId':_0x47b46a['id'],'type':_0x3687d9[_0x541f('0x2b')],'sectionId':_0x3687d9['id']},{})[_0x541f('0x24')](function(){return _0x4a396d;});}else{return _0x4a396d;}})[_0x541f('0x4e')](function(_0x549c9a){logger[_0x541f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x549c9a);throw _0x549c9a;});}return _0x4a396d;})[_0x541f('0x24')](respondWithResult(_0x10d2f7,0xc9))[_0x541f('0x4e')](handleError(_0x10d2f7,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 998fb1c..f44fafb 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 _0x28e1=['path','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','../../config/logger','api','moment','request-promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x28e1,0x1d4));var _0x128e=function(_0x5b622f,_0x4ac5cd){_0x5b622f=_0x5b622f-0x0;var _0x50f1f5=_0x28e1[_0x5b622f];return _0x50f1f5;};'use strict';var _=require(_0x128e('0x0'));var util=require('util');var logger=require(_0x128e('0x1'))(_0x128e('0x2'));var moment=require(_0x128e('0x3'));var BPromise=require('bluebird');var rp=require(_0x128e('0x4'));var fs=require('fs');var path=require(_0x128e('0x5'));var rimraf=require('rimraf');var config=require(_0x128e('0x6'));var attributes=require(_0x128e('0x7'));module[_0x128e('0x8')]=function(_0x2a7687,_0x5277e9){return _0x2a7687[_0x128e('0x9')]('CannedAnswer',attributes,{'tableName':_0x128e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb43e=['path','rimraf','../../config/environment','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0xb43e,0x183));var _0xeb43=function(_0x3dbe1d,_0x14e971){_0x3dbe1d=_0x3dbe1d-0x0;var _0x88ca95=_0xb43e[_0x3dbe1d];return _0x88ca95;};'use strict';var _=require(_0xeb43('0x0'));var util=require('util');var logger=require(_0xeb43('0x1'))('api');var moment=require(_0xeb43('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb43('0x3'));var rimraf=require(_0xeb43('0x4'));var config=require(_0xeb43('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0xeb43('0x6')]=function(_0x450cc4,_0x224311){return _0x450cc4[_0xeb43('0x7')](_0xeb43('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeb43('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 7d7c821..35c5115 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 _0x3270=['request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x30fa1e,_0x1761e8){var _0x357956=function(_0x29d379){while(--_0x29d379){_0x30fa1e['push'](_0x30fa1e['shift']());}};_0x357956(++_0x1761e8);}(_0x3270,0x120));var _0x0327=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3270[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x0327('0x0'));var util=require(_0x0327('0x1'));var moment=require(_0x0327('0x2'));var BPromise=require(_0x0327('0x3'));var rs=require(_0x0327('0x4'));var fs=require('fs');var Redis=require(_0x0327('0x5'));var db=require(_0x0327('0x6'))['db'];var utils=require(_0x0327('0x7'));var logger=require('../../config/logger')(_0x0327('0x8'));var config=require(_0x0327('0x9'));var jayson=require(_0x0327('0xa'));var client=jayson[_0x0327('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17d640,_0x183e86,_0xd6c91){return new BPromise(function(_0x47a254,_0x59186e){return client[_0x0327('0xc')](_0x17d640,_0xd6c91)[_0x0327('0xd')](function(_0x55ee7b){logger[_0x0327('0xe')](_0x0327('0xf'),_0x183e86,_0x0327('0x10'));logger[_0x0327('0x11')](_0x0327('0x12'),_0x183e86,_0x0327('0x10'),JSON[_0x0327('0x13')](_0x55ee7b));if(_0x55ee7b[_0x0327('0x14')]){if(_0x55ee7b['error'][_0x0327('0x15')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x183e86,_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);return _0x59186e(_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);}logger[_0x0327('0x14')](_0x0327('0xf'),_0x183e86,_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);return _0x47a254(_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);}else{logger[_0x0327('0xe')](_0x0327('0xf'),_0x183e86,_0x0327('0x10'));_0x47a254(_0x55ee7b[_0x0327('0x17')]['message']);}})[_0x0327('0x18')](function(_0x325244){logger['error'](_0x0327('0xf'),_0x183e86,_0x325244);_0x59186e(_0x325244);});});}
\ No newline at end of file
+var _0x221a=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x221a,0x13e));var _0xa221=function(_0x311bdd,_0x66de32){_0x311bdd=_0x311bdd-0x0;var _0x1c32ed=_0x221a[_0x311bdd];return _0x1c32ed;};'use strict';var _=require(_0xa221('0x0'));var util=require(_0xa221('0x1'));var moment=require(_0xa221('0x2'));var BPromise=require(_0xa221('0x3'));var rs=require(_0xa221('0x4'));var fs=require('fs');var Redis=require(_0xa221('0x5'));var db=require(_0xa221('0x6'))['db'];var utils=require(_0xa221('0x7'));var logger=require(_0xa221('0x8'))(_0xa221('0x9'));var config=require('../../config/environment');var jayson=require(_0xa221('0xa'));var client=jayson[_0xa221('0xb')][_0xa221('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ea0dd,_0x4bd325,_0x1bdbcf){return new BPromise(function(_0xf77d24,_0x34190c){return client[_0xa221('0xd')](_0x2ea0dd,_0x1bdbcf)[_0xa221('0xe')](function(_0x2de92f){logger[_0xa221('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x4bd325,_0xa221('0x10'));logger[_0xa221('0x11')](_0xa221('0x12'),_0x4bd325,_0xa221('0x10'),JSON[_0xa221('0x13')](_0x2de92f));if(_0x2de92f[_0xa221('0x14')]){if(_0x2de92f[_0xa221('0x14')][_0xa221('0x15')]===0x1f4){logger[_0xa221('0x14')](_0xa221('0x16'),_0x4bd325,_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);return _0x34190c(_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);}logger[_0xa221('0x14')]('CannedAnswer,\x20%s,\x20%s',_0x4bd325,_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);return _0xf77d24(_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);}else{logger['info'](_0xa221('0x16'),_0x4bd325,_0xa221('0x10'));_0xf77d24(_0x2de92f['result'][_0xa221('0x17')]);}})['catch'](function(_0x494b7a){logger[_0xa221('0x14')](_0xa221('0x16'),_0x4bd325,_0x494b7a);_0x34190c(_0x494b7a);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index fbd2b40..b65a1c3 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 _0x758f=['/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index'];(function(_0x2cf54d,_0x471789){var _0x259fb4=function(_0x3db826){while(--_0x3db826){_0x2cf54d['push'](_0x2cf54d['shift']());}};_0x259fb4(++_0x471789);}(_0x758f,0x183));var _0xf758=function(_0x5d7b48,_0x1c8eaa){_0x5d7b48=_0x5d7b48-0x0;var _0x31bd82=_0x758f[_0x5d7b48];return _0x31bd82;};'use strict';var multer=require(_0xf758('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf758('0x1'));var express=require(_0xf758('0x2'));var router=express[_0xf758('0x3')]();var auth=require(_0xf758('0x4'));var interaction=require(_0xf758('0x5'));var config=require(_0xf758('0x6'));var controller=require(_0xf758('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf758('0x8')]);router['get'](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0xb')]);router[_0xf758('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf758('0xd')](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0xe')]);router[_0xf758('0xf')](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0x10')]);module[_0xf758('0x11')]=router;
\ No newline at end of file
+var _0x6ea4=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','post','update'];(function(_0x109fe4,_0x286340){var _0x50cc95=function(_0x27842c){while(--_0x27842c){_0x109fe4['push'](_0x109fe4['shift']());}};_0x50cc95(++_0x286340);}(_0x6ea4,0xd3));var _0x46ea=function(_0x4fae19,_0x257a9f){_0x4fae19=_0x4fae19-0x0;var _0xc76eeb=_0x6ea4[_0x4fae19];return _0xc76eeb;};'use strict';var multer=require(_0x46ea('0x0'));var util=require(_0x46ea('0x1'));var path=require(_0x46ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x46ea('0x3')]();var auth=require(_0x46ea('0x4'));var interaction=require(_0x46ea('0x5'));var config=require(_0x46ea('0x6'));var controller=require(_0x46ea('0x7'));router[_0x46ea('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x46ea('0x8')](_0x46ea('0x9'),auth[_0x46ea('0xa')](),controller['show']);router[_0x46ea('0xb')]('/',auth[_0x46ea('0xa')](),controller['create']);router['put'](_0x46ea('0x9'),auth[_0x46ea('0xa')](),controller[_0x46ea('0xc')]);router[_0x46ea('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x46ea('0xe')]);module[_0x46ea('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 78a3fe6..56ea06d 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 _0x35d8=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x59981b,_0xa439cf){var _0x239b53=function(_0x5c70cd){while(--_0x5c70cd){_0x59981b['push'](_0x59981b['shift']());}};_0x239b53(++_0xa439cf);}(_0x35d8,0xf7));var _0x835d=function(_0x9d505f,_0x5e5b90){_0x9d505f=_0x9d505f-0x0;var _0x3c0ec9=_0x35d8[_0x9d505f];return _0x3c0ec9;};'use strict';var Sequelize=require(_0x835d('0x0'));module[_0x835d('0x1')]={'calldate':{'type':Sequelize[_0x835d('0x2')],'allowNull':![],'defaultValue':_0x835d('0x3')},'clid':{'type':Sequelize[_0x835d('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x835d('0x4')]},'dcontext':{'type':Sequelize[_0x835d('0x4')]},'channel':{'type':Sequelize[_0x835d('0x4')]},'dstchannel':{'type':Sequelize[_0x835d('0x4')]},'lastapp':{'type':Sequelize[_0x835d('0x4')]},'lastdata':{'type':Sequelize[_0x835d('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x835d('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x835d('0x4')]},'linkedid':{'type':Sequelize[_0x835d('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x36c4=['INTEGER','sequelize','exports','STRING'];(function(_0x293178,_0x4a8028){var _0x3b0f63=function(_0x1494c1){while(--_0x1494c1){_0x293178['push'](_0x293178['shift']());}};_0x3b0f63(++_0x4a8028);}(_0x36c4,0x95));var _0x436c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x436c('0x0'));module[_0x436c('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x436c('0x2')]},'src':{'type':Sequelize[_0x436c('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x436c('0x2')]},'channel':{'type':Sequelize[_0x436c('0x2')]},'dstchannel':{'type':Sequelize[_0x436c('0x2')]},'lastapp':{'type':Sequelize[_0x436c('0x2')]},'lastdata':{'type':Sequelize[_0x436c('0x2')]},'duration':{'type':Sequelize[_0x436c('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x436c('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x436c('0x2')]},'amaflags':{'type':Sequelize[_0x436c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x436c('0x2')]},'linkedid':{'type':Sequelize[_0x436c('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x436c('0x2')]},'tag':{'type':Sequelize[_0x436c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index db78960..9e6e06e 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 _0x1cd3=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','end','count','offset','limit','apply','reject','save','then','status','sendStatus','error','stack','name','index','map','Cdr','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel'];(function(_0x307eba,_0x5e447e){var _0x34b1eb=function(_0x1e3add){while(--_0x1e3add){_0x307eba['push'](_0x307eba['shift']());}};_0x34b1eb(++_0x5e447e);}(_0x1cd3,0x1b6));var _0x31cd=function(_0x160d5d,_0x2c8209){_0x160d5d=_0x160d5d-0x0;var _0x67d7b9=_0x1cd3[_0x160d5d];return _0x67d7b9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x31cd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31cd('0x1'));var moment=require(_0x31cd('0x2'));var BPromise=require(_0x31cd('0x3'));var Mustache=require(_0x31cd('0x4'));var util=require(_0x31cd('0x5'));var path=require(_0x31cd('0x6'));var sox=require(_0x31cd('0x7'));var csv=require('to-csv');var ejs=require(_0x31cd('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x31cd('0x9'));var crypto=require(_0x31cd('0xa'));var jsforce=require(_0x31cd('0xb'));var deskjs=require(_0x31cd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x31cd('0xd'));var Redis=require(_0x31cd('0xe'));var authService=require(_0x31cd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x31cd('0x10'));var hardwareService=require(_0x31cd('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x31cd('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34c44a,_0x565775){_0x565775=_0x565775||0xcc;return function(_0x479ae2){if(_0x479ae2){return _0x34c44a['sendStatus'](_0x565775);}return _0x34c44a['status'](_0x565775)[_0x31cd('0x13')]();};}function respondWithResult(_0x2c07f3,_0x2171c9){_0x2171c9=_0x2171c9||0xc8;return function(_0x1e2971){if(_0x1e2971){return _0x2c07f3['status'](_0x2171c9)['json'](_0x1e2971);}};}function respondWithFilteredResult(_0x224c3b,_0xb98e71){return function(_0x524ae7){if(_0x524ae7){var _0x48498a=_0x524ae7[_0x31cd('0x14')],_0x578269=_0xb98e71[_0x31cd('0x15')],_0x105337=_0xb98e71[_0x31cd('0x15')]+_0xb98e71[_0x31cd('0x16')],_0x409364;if(_0x105337>=_0x48498a){_0x105337=_0x48498a;_0x409364=0xc8;}else{_0x409364=0xce;}_0x224c3b['status'](_0x409364);return _0x224c3b['set']('Content-Range',_0x578269+'-'+_0x105337+'/'+_0x48498a)['json'](_0x524ae7);}return null;};}function patchUpdates(_0x5cc76f){return function(_0xfe6adb){try{jsonpatch[_0x31cd('0x17')](_0xfe6adb,_0x5cc76f,!![]);}catch(_0x225df0){return BPromise[_0x31cd('0x18')](_0x225df0);}return _0xfe6adb[_0x31cd('0x19')]();};}function saveUpdates(_0x5b95e8,_0x52e115){return function(_0x28b9e3){if(_0x28b9e3){return _0x28b9e3['update'](_0x5b95e8)['then'](function(_0x31e41f){return _0x31e41f;});}return null;};}function removeEntity(_0x286db8,_0x1ef0a6){return function(_0x5b8fe7){if(_0x5b8fe7){return _0x5b8fe7['destroy']()[_0x31cd('0x1a')](function(){_0x286db8[_0x31cd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22c565,_0x449afd){return function(_0x31f555){if(!_0x31f555){_0x22c565[_0x31cd('0x1c')](0x194);}return _0x31f555;};}function handleError(_0x56e420,_0x4c30ba){_0x4c30ba=_0x4c30ba||0x1f4;return function(_0x4cb465){logger[_0x31cd('0x1d')](_0x4cb465[_0x31cd('0x1e')]);if(_0x4cb465[_0x31cd('0x1f')]){delete _0x4cb465[_0x31cd('0x1f')];}_0x56e420[_0x31cd('0x1b')](_0x4c30ba)['send'](_0x4cb465);};}exports[_0x31cd('0x20')]=function(_0xbed66e,_0x5ec8b5){var _0x3a3d2b={},_0x50696a={},_0x2abe54={'count':0x0,'rows':[]};var _0x482362=_[_0x31cd('0x21')](db[_0x31cd('0x22')][_0x31cd('0x23')],function(_0x5340f3){return{'name':_0x5340f3['fieldName'],'type':_0x5340f3['type'][_0x31cd('0x24')]};});_0x50696a[_0x31cd('0x25')]=_['map'](_0x482362,_0x31cd('0x1f'));_0x50696a['query']=_[_0x31cd('0x26')](_0xbed66e[_0x31cd('0x27')]);_0x50696a[_0x31cd('0x28')]=_[_0x31cd('0x29')](_0x50696a[_0x31cd('0x25')],_0x50696a['query']);_0x3a3d2b[_0x31cd('0x2a')]=_['intersection'](_0x50696a[_0x31cd('0x25')],qs[_0x31cd('0x2b')](_0xbed66e['query'][_0x31cd('0x2b')]));_0x3a3d2b['attributes']=_0x3a3d2b['attributes']['length']?_0x3a3d2b[_0x31cd('0x2a')]:_0x50696a[_0x31cd('0x25')];if(!_0xbed66e['query']['hasOwnProperty'](_0x31cd('0x2c'))){_0x3a3d2b[_0x31cd('0x16')]=qs[_0x31cd('0x16')](_0xbed66e['query'][_0x31cd('0x16')]);_0x3a3d2b[_0x31cd('0x15')]=qs[_0x31cd('0x15')](_0xbed66e[_0x31cd('0x27')][_0x31cd('0x15')]);}_0x3a3d2b['order']=qs[_0x31cd('0x2d')](_0xbed66e[_0x31cd('0x27')]['sort']);_0x3a3d2b[_0x31cd('0x2e')]=qs['filters'](_[_0x31cd('0x2f')](_0xbed66e[_0x31cd('0x27')],_0x50696a['filters']));if(_0xbed66e[_0x31cd('0x27')][_0x31cd('0x30')]){_0x3a3d2b[_0x31cd('0x2e')]=_[_0x31cd('0x31')](_0x3a3d2b[_0x31cd('0x2e')],{'$or':_[_0x31cd('0x21')](_0x482362,function(_0x152612){if(_0x152612['type'][_0x31cd('0x24')]!==_0x31cd('0x32')){var _0x5be91d={};_0x5be91d[_0x152612['field']]={'$like':'%'+_0xbed66e[_0x31cd('0x27')]['filter']+'%'};return _0x5be91d;}})});}_0x3a3d2b=_[_0x31cd('0x31')]({},_0x3a3d2b,_0xbed66e[_0x31cd('0x33')]);var _0x55fe8b={'where':_0x3a3d2b[_0x31cd('0x2e')]};return db[_0x31cd('0x22')][_0x31cd('0x14')](_0x55fe8b)['then'](function(_0x22e0cf){_0x2abe54['count']=_0x22e0cf;if(_0xbed66e[_0x31cd('0x27')][_0x31cd('0x34')]){_0x3a3d2b[_0x31cd('0x35')]=[{'all':!![]}];}return db[_0x31cd('0x22')][_0x31cd('0x36')](_0x3a3d2b);})['then'](function(_0x4f7ddd){_0x2abe54[_0x31cd('0x37')]=_0x4f7ddd;return _0x2abe54;})[_0x31cd('0x1a')](respondWithFilteredResult(_0x5ec8b5,_0x3a3d2b))[_0x31cd('0x38')](handleError(_0x5ec8b5,null));};exports['show']=function(_0x8fa54,_0x39c64a){var _0x3d978e={'raw':!![],'where':{'id':_0x8fa54[_0x31cd('0x39')]['id']}},_0x1747d6={};_0x1747d6[_0x31cd('0x25')]=_[_0x31cd('0x26')](db[_0x31cd('0x22')]['rawAttributes']);_0x1747d6[_0x31cd('0x27')]=_[_0x31cd('0x26')](_0x8fa54['query']);_0x1747d6['filters']=_[_0x31cd('0x29')](_0x1747d6[_0x31cd('0x25')],_0x1747d6[_0x31cd('0x27')]);_0x3d978e['attributes']=_[_0x31cd('0x29')](_0x1747d6[_0x31cd('0x25')],qs['fields'](_0x8fa54['query'][_0x31cd('0x2b')]));_0x3d978e[_0x31cd('0x2a')]=_0x3d978e[_0x31cd('0x2a')]['length']?_0x3d978e[_0x31cd('0x2a')]:_0x1747d6[_0x31cd('0x25')];if(_0x8fa54[_0x31cd('0x27')][_0x31cd('0x34')]){_0x3d978e[_0x31cd('0x35')]=[{'all':!![]}];}_0x3d978e=_[_0x31cd('0x31')]({},_0x3d978e,_0x8fa54[_0x31cd('0x33')]);return db['Cdr'][_0x31cd('0x3a')](_0x3d978e)['then'](handleEntityNotFound(_0x39c64a,null))[_0x31cd('0x1a')](respondWithResult(_0x39c64a,null))[_0x31cd('0x38')](handleError(_0x39c64a,null));};exports[_0x31cd('0x3b')]=function(_0x5987fa,_0x47f115){return db['Cdr'][_0x31cd('0x3b')](_0x5987fa[_0x31cd('0x3c')],{})['then'](respondWithResult(_0x47f115,0xc9))['catch'](handleError(_0x47f115,null));};exports[_0x31cd('0x3d')]=function(_0x214aa3,_0x3fea50){if(_0x214aa3[_0x31cd('0x3c')]['id']){delete _0x214aa3[_0x31cd('0x3c')]['id'];}return db['Cdr'][_0x31cd('0x3a')]({'where':{'id':_0x214aa3['params']['id']}})['then'](handleEntityNotFound(_0x3fea50,null))['then'](saveUpdates(_0x214aa3['body'],null))[_0x31cd('0x1a')](respondWithResult(_0x3fea50,null))[_0x31cd('0x38')](handleError(_0x3fea50,null));};exports[_0x31cd('0x3e')]=function(_0x58f89c,_0x3aba39){return db[_0x31cd('0x22')][_0x31cd('0x3a')]({'where':{'id':_0x58f89c['params']['id']}})[_0x31cd('0x1a')](handleEntityNotFound(_0x3aba39,null))[_0x31cd('0x1a')](removeEntity(_0x3aba39,null))[_0x31cd('0x38')](handleError(_0x3aba39,null));};exports[_0x31cd('0x3f')]=function(_0x7e9a62,_0x12a3ed){return db[_0x31cd('0x22')]['describe']()[_0x31cd('0x1a')](respondWithResult(_0x12a3ed,null))[_0x31cd('0x38')](handleError(_0x12a3ed,null));};
\ No newline at end of file
+var _0x4524=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','then','destroy','error','name','send','map','Cdr','key','model','query','keys','filters','intersection'];(function(_0x259780,_0x4fa802){var _0x10b003=function(_0x54e9fa){while(--_0x54e9fa){_0x259780['push'](_0x259780['shift']());}};_0x10b003(++_0x4fa802);}(_0x4524,0x1e2));var _0x4452=function(_0x648aa2,_0x3d26da){_0x648aa2=_0x648aa2-0x0;var _0x15e973=_0x4524[_0x648aa2];return _0x15e973;};'use strict';var pdf=require(_0x4452('0x0'));var emlformat=require(_0x4452('0x1'));var rimraf=require(_0x4452('0x2'));var zipdir=require(_0x4452('0x3'));var jsonpatch=require(_0x4452('0x4'));var rp=require(_0x4452('0x5'));var moment=require('moment');var BPromise=require(_0x4452('0x6'));var Mustache=require(_0x4452('0x7'));var util=require(_0x4452('0x8'));var path=require(_0x4452('0x9'));var sox=require('sox');var csv=require(_0x4452('0xa'));var ejs=require(_0x4452('0xb'));var fs=require('fs');var _=require(_0x4452('0xc'));var squel=require(_0x4452('0xd'));var crypto=require('crypto');var jsforce=require(_0x4452('0xe'));var deskjs=require(_0x4452('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4452('0x10'));var Papa=require(_0x4452('0x11'));var Redis=require(_0x4452('0x12'));var authService=require(_0x4452('0x13'));var qs=require(_0x4452('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4452('0x15'));var logger=require(_0x4452('0x16'))(_0x4452('0x17'));var utils=require(_0x4452('0x18'));var config=require(_0x4452('0x19'));var db=require(_0x4452('0x1a'))['db'];function respondWithStatusCode(_0x25562f,_0x5be11e){_0x5be11e=_0x5be11e||0xcc;return function(_0x24ebd4){if(_0x24ebd4){return _0x25562f[_0x4452('0x1b')](_0x5be11e);}return _0x25562f[_0x4452('0x1c')](_0x5be11e)[_0x4452('0x1d')]();};}function respondWithResult(_0x33bc36,_0x516580){_0x516580=_0x516580||0xc8;return function(_0x29600e){if(_0x29600e){return _0x33bc36[_0x4452('0x1c')](_0x516580)[_0x4452('0x1e')](_0x29600e);}};}function respondWithFilteredResult(_0xb925d7,_0x4534cb){return function(_0x58ba37){if(_0x58ba37){var _0x2e99d0=_0x58ba37[_0x4452('0x1f')],_0x427367=_0x4534cb[_0x4452('0x20')],_0xbb6667=_0x4534cb[_0x4452('0x20')]+_0x4534cb[_0x4452('0x21')],_0x152ad7;if(_0xbb6667>=_0x2e99d0){_0xbb6667=_0x2e99d0;_0x152ad7=0xc8;}else{_0x152ad7=0xce;}_0xb925d7['status'](_0x152ad7);return _0xb925d7[_0x4452('0x22')]('Content-Range',_0x427367+'-'+_0xbb6667+'/'+_0x2e99d0)[_0x4452('0x1e')](_0x58ba37);}return null;};}function patchUpdates(_0x1a7c5e){return function(_0x13ea03){try{jsonpatch['apply'](_0x13ea03,_0x1a7c5e,!![]);}catch(_0x4c9fbc){return BPromise[_0x4452('0x23')](_0x4c9fbc);}return _0x13ea03[_0x4452('0x24')]();};}function saveUpdates(_0x3598b6,_0x4460c8){return function(_0x5b96ef){if(_0x5b96ef){return _0x5b96ef['update'](_0x3598b6)[_0x4452('0x25')](function(_0x232cbf){return _0x232cbf;});}return null;};}function removeEntity(_0x180d6d,_0x157540){return function(_0x11d900){if(_0x11d900){return _0x11d900[_0x4452('0x26')]()[_0x4452('0x25')](function(){_0x180d6d[_0x4452('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf5e25d,_0x17febd){return function(_0x55be7d){if(!_0x55be7d){_0xf5e25d['sendStatus'](0x194);}return _0x55be7d;};}function handleError(_0x4bc8e5,_0x5cfb66){_0x5cfb66=_0x5cfb66||0x1f4;return function(_0x3a0353){logger[_0x4452('0x27')](_0x3a0353['stack']);if(_0x3a0353[_0x4452('0x28')]){delete _0x3a0353[_0x4452('0x28')];}_0x4bc8e5['status'](_0x5cfb66)[_0x4452('0x29')](_0x3a0353);};}exports['index']=function(_0x2345f0,_0x5f1529){var _0x4d7ee1={},_0x6200e6={},_0x3c91e3={'count':0x0,'rows':[]};var _0x52c58c=_[_0x4452('0x2a')](db[_0x4452('0x2b')]['rawAttributes'],function(_0x2e944e){return{'name':_0x2e944e['fieldName'],'type':_0x2e944e['type'][_0x4452('0x2c')]};});_0x6200e6[_0x4452('0x2d')]=_[_0x4452('0x2a')](_0x52c58c,_0x4452('0x28'));_0x6200e6[_0x4452('0x2e')]=_[_0x4452('0x2f')](_0x2345f0['query']);_0x6200e6[_0x4452('0x30')]=_[_0x4452('0x31')](_0x6200e6[_0x4452('0x2d')],_0x6200e6['query']);_0x4d7ee1[_0x4452('0x32')]=_['intersection'](_0x6200e6[_0x4452('0x2d')],qs[_0x4452('0x33')](_0x2345f0[_0x4452('0x2e')]['fields']));_0x4d7ee1['attributes']=_0x4d7ee1[_0x4452('0x32')][_0x4452('0x34')]?_0x4d7ee1[_0x4452('0x32')]:_0x6200e6[_0x4452('0x2d')];if(!_0x2345f0[_0x4452('0x2e')][_0x4452('0x35')](_0x4452('0x36'))){_0x4d7ee1[_0x4452('0x21')]=qs[_0x4452('0x21')](_0x2345f0[_0x4452('0x2e')][_0x4452('0x21')]);_0x4d7ee1[_0x4452('0x20')]=qs['offset'](_0x2345f0['query'][_0x4452('0x20')]);}_0x4d7ee1[_0x4452('0x37')]=qs[_0x4452('0x38')](_0x2345f0[_0x4452('0x2e')][_0x4452('0x38')]);_0x4d7ee1['where']=qs[_0x4452('0x30')](_['pick'](_0x2345f0['query'],_0x6200e6[_0x4452('0x30')]));if(_0x2345f0['query'][_0x4452('0x39')]){_0x4d7ee1[_0x4452('0x3a')]=_[_0x4452('0x3b')](_0x4d7ee1[_0x4452('0x3a')],{'$or':_[_0x4452('0x2a')](_0x52c58c,function(_0xfd369c){if(_0xfd369c[_0x4452('0x3c')][_0x4452('0x2c')]!==_0x4452('0x3d')){var _0x2d5ce6={};_0x2d5ce6[_0xfd369c['field']]={'$like':'%'+_0x2345f0[_0x4452('0x2e')][_0x4452('0x39')]+'%'};return _0x2d5ce6;}})});}_0x4d7ee1=_[_0x4452('0x3b')]({},_0x4d7ee1,_0x2345f0[_0x4452('0x3e')]);var _0x1917f0={'where':_0x4d7ee1[_0x4452('0x3a')]};return db[_0x4452('0x2b')][_0x4452('0x1f')](_0x1917f0)[_0x4452('0x25')](function(_0x25cdff){_0x3c91e3[_0x4452('0x1f')]=_0x25cdff;if(_0x2345f0[_0x4452('0x2e')][_0x4452('0x3f')]){_0x4d7ee1[_0x4452('0x40')]=[{'all':!![]}];}return db[_0x4452('0x2b')][_0x4452('0x41')](_0x4d7ee1);})[_0x4452('0x25')](function(_0x1501c1){_0x3c91e3[_0x4452('0x42')]=_0x1501c1;return _0x3c91e3;})['then'](respondWithFilteredResult(_0x5f1529,_0x4d7ee1))[_0x4452('0x43')](handleError(_0x5f1529,null));};exports[_0x4452('0x44')]=function(_0x4a836d,_0x192832){var _0x595599={'raw':!![],'where':{'id':_0x4a836d[_0x4452('0x45')]['id']}},_0x19370a={};_0x19370a[_0x4452('0x2d')]=_[_0x4452('0x2f')](db[_0x4452('0x2b')][_0x4452('0x46')]);_0x19370a[_0x4452('0x2e')]=_[_0x4452('0x2f')](_0x4a836d[_0x4452('0x2e')]);_0x19370a[_0x4452('0x30')]=_[_0x4452('0x31')](_0x19370a[_0x4452('0x2d')],_0x19370a[_0x4452('0x2e')]);_0x595599[_0x4452('0x32')]=_[_0x4452('0x31')](_0x19370a[_0x4452('0x2d')],qs[_0x4452('0x33')](_0x4a836d[_0x4452('0x2e')][_0x4452('0x33')]));_0x595599[_0x4452('0x32')]=_0x595599[_0x4452('0x32')][_0x4452('0x34')]?_0x595599[_0x4452('0x32')]:_0x19370a[_0x4452('0x2d')];if(_0x4a836d['query'][_0x4452('0x3f')]){_0x595599[_0x4452('0x40')]=[{'all':!![]}];}_0x595599=_[_0x4452('0x3b')]({},_0x595599,_0x4a836d[_0x4452('0x3e')]);return db[_0x4452('0x2b')][_0x4452('0x47')](_0x595599)[_0x4452('0x25')](handleEntityNotFound(_0x192832,null))[_0x4452('0x25')](respondWithResult(_0x192832,null))[_0x4452('0x43')](handleError(_0x192832,null));};exports[_0x4452('0x48')]=function(_0x5564d1,_0x1b2309){return db[_0x4452('0x2b')][_0x4452('0x48')](_0x5564d1['body'],{})[_0x4452('0x25')](respondWithResult(_0x1b2309,0xc9))['catch'](handleError(_0x1b2309,null));};exports[_0x4452('0x49')]=function(_0x418ea1,_0x55ea6e){if(_0x418ea1[_0x4452('0x4a')]['id']){delete _0x418ea1[_0x4452('0x4a')]['id'];}return db['Cdr'][_0x4452('0x47')]({'where':{'id':_0x418ea1[_0x4452('0x45')]['id']}})[_0x4452('0x25')](handleEntityNotFound(_0x55ea6e,null))[_0x4452('0x25')](saveUpdates(_0x418ea1[_0x4452('0x4a')],null))[_0x4452('0x25')](respondWithResult(_0x55ea6e,null))[_0x4452('0x43')](handleError(_0x55ea6e,null));};exports[_0x4452('0x26')]=function(_0x3d1dfd,_0x49eeb8){return db[_0x4452('0x2b')][_0x4452('0x47')]({'where':{'id':_0x3d1dfd[_0x4452('0x45')]['id']}})[_0x4452('0x25')](handleEntityNotFound(_0x49eeb8,null))[_0x4452('0x25')](removeEntity(_0x49eeb8,null))['catch'](handleError(_0x49eeb8,null));};exports[_0x4452('0x4b')]=function(_0x161584,_0xfad0a6){return db[_0x4452('0x2b')]['describe']()[_0x4452('0x25')](respondWithResult(_0xfad0a6,null))['catch'](handleError(_0xfad0a6,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3f5db8a..fa28cf8 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 _0xda19=['accountcode','disposition','dst','src','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x427a32,_0x384a9f){var _0x50bf43=function(_0x2a2d69){while(--_0x2a2d69){_0x427a32['push'](_0x427a32['shift']());}};_0x50bf43(++_0x384a9f);}(_0xda19,0xd5));var _0x9da1=function(_0xefd992,_0x3aa307){_0xefd992=_0xefd992-0x0;var _0x3b11d6=_0xda19[_0xefd992];return _0x3b11d6;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['accountcode']},{'name':'calldate','fields':['calldate']},{'name':_0x9da1('0xc'),'fields':['disposition']},{'name':_0x9da1('0xd'),'fields':[_0x9da1('0xd')]},{'name':_0x9da1('0xe'),'fields':[_0x9da1('0xe')]},{'name':_0x9da1('0xf'),'fields':[_0x9da1('0xf')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfcf0=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x36cc3d,_0x5f13e5){var _0x980443=function(_0x11fc17){while(--_0x11fc17){_0x36cc3d['push'](_0x36cc3d['shift']());}};_0x980443(++_0x5f13e5);}(_0xfcf0,0x138));var _0x0fcf=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0xfcf0[_0x54381d];return _0x5308a7;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['calldate']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]},{'name':_0x0fcf('0xf'),'fields':['dst']},{'name':_0x0fcf('0x10'),'fields':['src']},{'name':_0x0fcf('0x11'),'fields':[_0x0fcf('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 cae6477..f4d394b 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 _0xf81d=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x274f77,_0x238af1){var _0xa44a7f=function(_0x450158){while(--_0x450158){_0x274f77['push'](_0x274f77['shift']());}};_0xa44a7f(++_0x238af1);}(_0xf81d,0x191));var _0xdf81=function(_0x1df3fa,_0x4c21e9){_0x1df3fa=_0x1df3fa-0x0;var _0x3da317=_0xf81d[_0x1df3fa];return _0x3da317;};'use strict';var _=require(_0xdf81('0x0'));var util=require(_0xdf81('0x1'));var moment=require(_0xdf81('0x2'));var BPromise=require(_0xdf81('0x3'));var rs=require(_0xdf81('0x4'));var fs=require('fs');var Redis=require(_0xdf81('0x5'));var db=require(_0xdf81('0x6'))['db'];var utils=require(_0xdf81('0x7'));var logger=require(_0xdf81('0x8'))('rpc');var config=require(_0xdf81('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43545b,_0x432f30,_0x2c594d){return new BPromise(function(_0x131722,_0x56e74a){return client[_0xdf81('0xa')](_0x43545b,_0x2c594d)[_0xdf81('0xb')](function(_0x243dba){logger[_0xdf81('0xc')](_0xdf81('0xd'),_0x432f30,_0xdf81('0xe'));logger[_0xdf81('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x432f30,_0xdf81('0xe'),JSON['stringify'](_0x243dba));if(_0x243dba[_0xdf81('0x10')]){if(_0x243dba[_0xdf81('0x10')][_0xdf81('0x11')]===0x1f4){logger[_0xdf81('0x10')](_0xdf81('0xd'),_0x432f30,_0x243dba[_0xdf81('0x10')][_0xdf81('0x12')]);return _0x56e74a(_0x243dba['error'][_0xdf81('0x12')]);}logger[_0xdf81('0x10')]('Cdr,\x20%s,\x20%s',_0x432f30,_0x243dba[_0xdf81('0x10')][_0xdf81('0x12')]);return _0x131722(_0x243dba[_0xdf81('0x10')]['message']);}else{logger['info'](_0xdf81('0xd'),_0x432f30,'request\x20sent');_0x131722(_0x243dba[_0xdf81('0x13')][_0xdf81('0x12')]);}})['catch'](function(_0x45b6bf){logger[_0xdf81('0x10')](_0xdf81('0xd'),_0x432f30,_0x45b6bf);_0x56e74a(_0x45b6bf);});});}
\ No newline at end of file
+var _0x4b15=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xf027fe,_0x589f41){var _0x47f852=function(_0x333b7b){while(--_0x333b7b){_0xf027fe['push'](_0xf027fe['shift']());}};_0x47f852(++_0x589f41);}(_0x4b15,0x17f));var _0x54b1=function(_0x598dc3,_0x367544){_0x598dc3=_0x598dc3-0x0;var _0x2d7d3b=_0x4b15[_0x598dc3];return _0x2d7d3b;};'use strict';var _=require(_0x54b1('0x0'));var util=require(_0x54b1('0x1'));var moment=require(_0x54b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x54b1('0x3'));var fs=require('fs');var Redis=require(_0x54b1('0x4'));var db=require(_0x54b1('0x5'))['db'];var utils=require(_0x54b1('0x6'));var logger=require(_0x54b1('0x7'))(_0x54b1('0x8'));var config=require(_0x54b1('0x9'));var jayson=require(_0x54b1('0xa'));var client=jayson[_0x54b1('0xb')][_0x54b1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dde67,_0x8cc366,_0x44de6f){return new BPromise(function(_0x1a9ff9,_0x1a1273){return client[_0x54b1('0xd')](_0x2dde67,_0x44de6f)[_0x54b1('0xe')](function(_0xc4a013){logger[_0x54b1('0xf')]('Cdr,\x20%s,\x20%s',_0x8cc366,_0x54b1('0x10'));logger[_0x54b1('0x11')](_0x54b1('0x12'),_0x8cc366,'request\x20sent',JSON[_0x54b1('0x13')](_0xc4a013));if(_0xc4a013[_0x54b1('0x14')]){if(_0xc4a013[_0x54b1('0x14')][_0x54b1('0x15')]===0x1f4){logger[_0x54b1('0x14')](_0x54b1('0x16'),_0x8cc366,_0xc4a013['error'][_0x54b1('0x17')]);return _0x1a1273(_0xc4a013[_0x54b1('0x14')][_0x54b1('0x17')]);}logger[_0x54b1('0x14')]('Cdr,\x20%s,\x20%s',_0x8cc366,_0xc4a013[_0x54b1('0x14')][_0x54b1('0x17')]);return _0x1a9ff9(_0xc4a013['error']['message']);}else{logger[_0x54b1('0xf')]('Cdr,\x20%s,\x20%s',_0x8cc366,_0x54b1('0x10'));_0x1a9ff9(_0xc4a013[_0x54b1('0x18')]['message']);}})['catch'](function(_0x4031b0){logger[_0x54b1('0x14')](_0x54b1('0x16'),_0x8cc366,_0x4031b0);_0x1a1273(_0x4031b0);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8c6d6df..a4b1f35 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 _0xab62=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','post','put','/:id','update','delete'];(function(_0x1cf591,_0x5e2b40){var _0x680570=function(_0x374097){while(--_0x374097){_0x1cf591['push'](_0x1cf591['shift']());}};_0x680570(++_0x5e2b40);}(_0xab62,0x9b));var _0x2ab6=function(_0x55a677,_0x7652d){_0x55a677=_0x55a677-0x0;var _0x3a1c18=_0xab62[_0x55a677];return _0x3a1c18;};'use strict';var multer=require(_0x2ab6('0x0'));var util=require(_0x2ab6('0x1'));var path=require('path');var timeout=require(_0x2ab6('0x2'));var express=require('express');var router=express[_0x2ab6('0x3')]();var auth=require(_0x2ab6('0x4'));var interaction=require(_0x2ab6('0x5'));var config=require(_0x2ab6('0x6'));var controller=require('./cdr.controller');router[_0x2ab6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2ab6('0x7')](_0x2ab6('0x8'),auth[_0x2ab6('0x9')](),controller['describe']);router['get']('/:id',auth[_0x2ab6('0x9')](),controller['show']);router[_0x2ab6('0xa')]('/',auth[_0x2ab6('0x9')](),controller['create']);router[_0x2ab6('0xb')](_0x2ab6('0xc'),auth[_0x2ab6('0x9')](),controller[_0x2ab6('0xd')]);router[_0x2ab6('0xe')]('/:id',auth[_0x2ab6('0x9')](),controller[_0x2ab6('0xf')]);module[_0x2ab6('0x10')]=router;
\ No newline at end of file
+var _0x4338=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy'];(function(_0x12c492,_0xc73770){var _0x1cf9ad=function(_0x4a44b9){while(--_0x4a44b9){_0x12c492['push'](_0x12c492['shift']());}};_0x1cf9ad(++_0xc73770);}(_0x4338,0x1a5));var _0x8433=function(_0x1c1539,_0x45bc75){_0x1c1539=_0x1c1539-0x0;var _0x3411e0=_0x4338[_0x1c1539];return _0x3411e0;};'use strict';var multer=require(_0x8433('0x0'));var util=require(_0x8433('0x1'));var path=require(_0x8433('0x2'));var timeout=require('connect-timeout');var express=require(_0x8433('0x3'));var router=express[_0x8433('0x4')]();var auth=require(_0x8433('0x5'));var interaction=require(_0x8433('0x6'));var config=require(_0x8433('0x7'));var controller=require('./cdr.controller');router[_0x8433('0x8')]('/',auth[_0x8433('0x9')](),controller[_0x8433('0xa')]);router[_0x8433('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8433('0xb')]);router['get']('/:id',auth[_0x8433('0x9')](),controller[_0x8433('0xc')]);router['post']('/',auth[_0x8433('0x9')](),controller[_0x8433('0xd')]);router[_0x8433('0xe')](_0x8433('0xf'),auth[_0x8433('0x9')](),controller[_0x8433('0x10')]);router[_0x8433('0x11')]('/:id',auth[_0x8433('0x9')](),controller[_0x8433('0x12')]);module[_0x8433('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index e49d0de..ae08d77 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 _0xa55b=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0xa55b,0x164));var _0xba55=function(_0x48ed78,_0xd3c11b){_0x48ed78=_0x48ed78-0x0;var _0x27d320=_0xa55b[_0x48ed78];return _0x27d320;};'use strict';var Sequelize=require(_0xba55('0x0'));module['exports']={'priority':{'type':Sequelize[_0xba55('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xba55('0x2')],'allowNull':![],'defaultValue':_0xba55('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xba55('0x2')]},'interval':{'type':Sequelize[_0xba55('0x2')],'defaultValue':_0xba55('0x4')}};
\ No newline at end of file
+var _0xfe19=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x3737a5,_0x1b6b09){var _0x2a5157=function(_0x35773e){while(--_0x35773e){_0x3737a5['push'](_0x3737a5['shift']());}};_0x2a5157(++_0x1b6b09);}(_0xfe19,0x1b8));var _0x9fe1=function(_0x1f4f01,_0x2bd42c){_0x1f4f01=_0x1f4f01-0x0;var _0x4c2240=_0xfe19[_0x1f4f01];return _0x4c2240;};'use strict';var Sequelize=require(_0x9fe1('0x0'));module[_0x9fe1('0x1')]={'priority':{'type':Sequelize[_0x9fe1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9fe1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9fe1('0x3')]},'interval':{'type':Sequelize[_0x9fe1('0x3')],'defaultValue':_0x9fe1('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 93f2618..553a8dc 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 _0x17cc=['end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','keys','rawAttributes','query','attributes','intersection','model','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','params','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb'];(function(_0x998aec,_0x28f664){var _0x354de2=function(_0x1964e4){while(--_0x1964e4){_0x998aec['push'](_0x998aec['shift']());}};_0x354de2(++_0x28f664);}(_0x17cc,0x179));var _0xc17c=function(_0x57f152,_0x34be17){_0x57f152=_0x57f152-0x0;var _0x283d82=_0x17cc[_0x57f152];return _0x283d82;};'use strict';var pdf=require(_0xc17c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc17c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc17c('0x2'));var moment=require(_0xc17c('0x3'));var BPromise=require(_0xc17c('0x4'));var Mustache=require(_0xc17c('0x5'));var util=require(_0xc17c('0x6'));var path=require(_0xc17c('0x7'));var sox=require(_0xc17c('0x8'));var csv=require(_0xc17c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc17c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc17c('0xb'));var deskjs=require(_0xc17c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc17c('0xd'));var Papa=require('papaparse');var Redis=require(_0xc17c('0xe'));var authService=require(_0xc17c('0xf'));var qs=require(_0xc17c('0x10'));var as=require(_0xc17c('0x11'));var hardwareService=require(_0xc17c('0x12'));var logger=require(_0xc17c('0x13'))(_0xc17c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc17c('0x15'))['db'];function respondWithStatusCode(_0x2c405b,_0x5ab380){_0x5ab380=_0x5ab380||0xcc;return function(_0x28b980){if(_0x28b980){return _0x2c405b['sendStatus'](_0x5ab380);}return _0x2c405b['status'](_0x5ab380)[_0xc17c('0x16')]();};}function respondWithResult(_0x4acbbe,_0x1509de){_0x1509de=_0x1509de||0xc8;return function(_0x3c352e){if(_0x3c352e){return _0x4acbbe[_0xc17c('0x17')](_0x1509de)['json'](_0x3c352e);}};}function respondWithFilteredResult(_0x4b536a,_0x18c39f){return function(_0x580ffa){if(_0x580ffa){var _0x5ab2d2=_0x580ffa[_0xc17c('0x18')],_0x3cfb0a=_0x18c39f[_0xc17c('0x19')],_0x2b3dc5=_0x18c39f[_0xc17c('0x19')]+_0x18c39f[_0xc17c('0x1a')],_0x10fa97;if(_0x2b3dc5>=_0x5ab2d2){_0x2b3dc5=_0x5ab2d2;_0x10fa97=0xc8;}else{_0x10fa97=0xce;}_0x4b536a[_0xc17c('0x17')](_0x10fa97);return _0x4b536a[_0xc17c('0x1b')](_0xc17c('0x1c'),_0x3cfb0a+'-'+_0x2b3dc5+'/'+_0x5ab2d2)[_0xc17c('0x1d')](_0x580ffa);}return null;};}function patchUpdates(_0x534c00){return function(_0x241580){try{jsonpatch['apply'](_0x241580,_0x534c00,!![]);}catch(_0x581e4e){return BPromise[_0xc17c('0x1e')](_0x581e4e);}return _0x241580[_0xc17c('0x1f')]();};}function saveUpdates(_0x575c29,_0x53cd01){return function(_0xac110e){if(_0xac110e){return _0xac110e[_0xc17c('0x20')](_0x575c29)[_0xc17c('0x21')](function(_0x12a249){return _0x12a249;});}return null;};}function removeEntity(_0x33e5f7,_0xa86e6a){return function(_0x310746){if(_0x310746){return _0x310746[_0xc17c('0x22')]()[_0xc17c('0x21')](function(){_0x33e5f7[_0xc17c('0x17')](0xcc)[_0xc17c('0x16')]();});}};}function handleEntityNotFound(_0x54f579,_0x48dc84){return function(_0x43243d){if(!_0x43243d){_0x54f579[_0xc17c('0x23')](0x194);}return _0x43243d;};}function handleError(_0x5ee94d,_0x450e83){_0x450e83=_0x450e83||0x1f4;return function(_0x46a45a){logger[_0xc17c('0x24')](_0x46a45a[_0xc17c('0x25')]);if(_0x46a45a[_0xc17c('0x26')]){delete _0x46a45a[_0xc17c('0x26')];}_0x5ee94d['status'](_0x450e83)[_0xc17c('0x27')](_0x46a45a);};}exports['show']=function(_0x34e31c,_0x19ce55){var _0x33001d={'raw':!![],'where':{'id':_0x34e31c['params']['id']}},_0x1f06c9={};_0x1f06c9['model']=_[_0xc17c('0x28')](db['ChatApplication'][_0xc17c('0x29')]);_0x1f06c9[_0xc17c('0x2a')]=_[_0xc17c('0x28')](_0x34e31c[_0xc17c('0x2a')]);_0x1f06c9['filters']=_['intersection'](_0x1f06c9['model'],_0x1f06c9[_0xc17c('0x2a')]);_0x33001d[_0xc17c('0x2b')]=_[_0xc17c('0x2c')](_0x1f06c9[_0xc17c('0x2d')],qs[_0xc17c('0x2e')](_0x34e31c['query'][_0xc17c('0x2e')]));_0x33001d[_0xc17c('0x2b')]=_0x33001d[_0xc17c('0x2b')][_0xc17c('0x2f')]?_0x33001d[_0xc17c('0x2b')]:_0x1f06c9['model'];if(_0x34e31c[_0xc17c('0x2a')][_0xc17c('0x30')]){_0x33001d[_0xc17c('0x31')]=[{'all':!![]}];}_0x33001d=_[_0xc17c('0x32')]({},_0x33001d,_0x34e31c[_0xc17c('0x33')]);return db[_0xc17c('0x34')][_0xc17c('0x35')](_0x33001d)[_0xc17c('0x21')](handleEntityNotFound(_0x19ce55,null))['then'](respondWithResult(_0x19ce55,null))[_0xc17c('0x36')](handleError(_0x19ce55,null));};exports[_0xc17c('0x20')]=function(_0x51c148,_0x2ff313){if(_0x51c148[_0xc17c('0x37')]['id']){delete _0x51c148[_0xc17c('0x37')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x51c148[_0xc17c('0x38')]['id']}})['then'](handleEntityNotFound(_0x2ff313,null))['then'](saveUpdates(_0x51c148[_0xc17c('0x37')],null))[_0xc17c('0x21')](respondWithResult(_0x2ff313,null))[_0xc17c('0x36')](handleError(_0x2ff313,null));};exports[_0xc17c('0x22')]=function(_0x33f95f,_0x4f9bee){return db[_0xc17c('0x34')][_0xc17c('0x35')]({'where':{'id':_0x33f95f[_0xc17c('0x38')]['id']}})['then'](handleEntityNotFound(_0x4f9bee,null))[_0xc17c('0x21')](removeEntity(_0x4f9bee,null))['catch'](handleError(_0x4f9bee,null));};
\ No newline at end of file
+var _0x9523=['../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','show','params','model','ChatApplication','keys','query','intersection','fields','attributes','includeAll','include','merge','options','find','body','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x9523,0x1c0));var _0x3952=function(_0x46afbb,_0x3b1327){_0x46afbb=_0x46afbb-0x0;var _0x3a4716=_0x9523[_0x46afbb];return _0x3a4716;};'use strict';var pdf=require(_0x3952('0x0'));var emlformat=require(_0x3952('0x1'));var rimraf=require(_0x3952('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3952('0x3'));var rp=require(_0x3952('0x4'));var moment=require(_0x3952('0x5'));var BPromise=require(_0x3952('0x6'));var Mustache=require(_0x3952('0x7'));var util=require(_0x3952('0x8'));var path=require(_0x3952('0x9'));var sox=require(_0x3952('0xa'));var csv=require(_0x3952('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3952('0xc'));var squel=require(_0x3952('0xd'));var crypto=require(_0x3952('0xe'));var jsforce=require(_0x3952('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3952('0x10'));var Papa=require(_0x3952('0x11'));var Redis=require(_0x3952('0x12'));var authService=require(_0x3952('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3952('0x14'));var hardwareService=require(_0x3952('0x15'));var logger=require(_0x3952('0x16'))(_0x3952('0x17'));var utils=require(_0x3952('0x18'));var config=require(_0x3952('0x19'));var db=require(_0x3952('0x1a'))['db'];function respondWithStatusCode(_0x1e4823,_0x215c66){_0x215c66=_0x215c66||0xcc;return function(_0x56df7b){if(_0x56df7b){return _0x1e4823['sendStatus'](_0x215c66);}return _0x1e4823['status'](_0x215c66)[_0x3952('0x1b')]();};}function respondWithResult(_0x59be61,_0x26fda4){_0x26fda4=_0x26fda4||0xc8;return function(_0x5263b3){if(_0x5263b3){return _0x59be61[_0x3952('0x1c')](_0x26fda4)[_0x3952('0x1d')](_0x5263b3);}};}function respondWithFilteredResult(_0x52a322,_0x154a2d){return function(_0x268645){if(_0x268645){var _0x2d96a=_0x268645[_0x3952('0x1e')],_0x252f97=_0x154a2d[_0x3952('0x1f')],_0x3dd1ae=_0x154a2d[_0x3952('0x1f')]+_0x154a2d['limit'],_0x5ad9f4;if(_0x3dd1ae>=_0x2d96a){_0x3dd1ae=_0x2d96a;_0x5ad9f4=0xc8;}else{_0x5ad9f4=0xce;}_0x52a322[_0x3952('0x1c')](_0x5ad9f4);return _0x52a322[_0x3952('0x20')](_0x3952('0x21'),_0x252f97+'-'+_0x3dd1ae+'/'+_0x2d96a)[_0x3952('0x1d')](_0x268645);}return null;};}function patchUpdates(_0x3553e1){return function(_0x3b3528){try{jsonpatch[_0x3952('0x22')](_0x3b3528,_0x3553e1,!![]);}catch(_0x490a62){return BPromise['reject'](_0x490a62);}return _0x3b3528[_0x3952('0x23')]();};}function saveUpdates(_0x1fd03d,_0x26a9b2){return function(_0x298ae9){if(_0x298ae9){return _0x298ae9[_0x3952('0x24')](_0x1fd03d)[_0x3952('0x25')](function(_0x12bdce){return _0x12bdce;});}return null;};}function removeEntity(_0x438b3c,_0x3cf68e){return function(_0xefd1b9){if(_0xefd1b9){return _0xefd1b9[_0x3952('0x26')]()['then'](function(){_0x438b3c[_0x3952('0x1c')](0xcc)[_0x3952('0x1b')]();});}};}function handleEntityNotFound(_0x270784,_0x410571){return function(_0xb85a12){if(!_0xb85a12){_0x270784[_0x3952('0x27')](0x194);}return _0xb85a12;};}function handleError(_0x32d884,_0x13131f){_0x13131f=_0x13131f||0x1f4;return function(_0x441ee0){logger[_0x3952('0x28')](_0x441ee0[_0x3952('0x29')]);if(_0x441ee0[_0x3952('0x2a')]){delete _0x441ee0[_0x3952('0x2a')];}_0x32d884[_0x3952('0x1c')](_0x13131f)['send'](_0x441ee0);};}exports[_0x3952('0x2b')]=function(_0x2a24fd,_0x24c8f4){var _0x4fca64={'raw':!![],'where':{'id':_0x2a24fd[_0x3952('0x2c')]['id']}},_0x539700={};_0x539700[_0x3952('0x2d')]=_['keys'](db[_0x3952('0x2e')]['rawAttributes']);_0x539700['query']=_[_0x3952('0x2f')](_0x2a24fd[_0x3952('0x30')]);_0x539700['filters']=_[_0x3952('0x31')](_0x539700[_0x3952('0x2d')],_0x539700[_0x3952('0x30')]);_0x4fca64['attributes']=_['intersection'](_0x539700['model'],qs[_0x3952('0x32')](_0x2a24fd['query'][_0x3952('0x32')]));_0x4fca64[_0x3952('0x33')]=_0x4fca64[_0x3952('0x33')]['length']?_0x4fca64[_0x3952('0x33')]:_0x539700[_0x3952('0x2d')];if(_0x2a24fd[_0x3952('0x30')][_0x3952('0x34')]){_0x4fca64[_0x3952('0x35')]=[{'all':!![]}];}_0x4fca64=_[_0x3952('0x36')]({},_0x4fca64,_0x2a24fd[_0x3952('0x37')]);return db[_0x3952('0x2e')][_0x3952('0x38')](_0x4fca64)['then'](handleEntityNotFound(_0x24c8f4,null))[_0x3952('0x25')](respondWithResult(_0x24c8f4,null))['catch'](handleError(_0x24c8f4,null));};exports[_0x3952('0x24')]=function(_0x4f89cc,_0x35cd1c){if(_0x4f89cc[_0x3952('0x39')]['id']){delete _0x4f89cc[_0x3952('0x39')]['id'];}return db[_0x3952('0x2e')][_0x3952('0x38')]({'where':{'id':_0x4f89cc[_0x3952('0x2c')]['id']}})[_0x3952('0x25')](handleEntityNotFound(_0x35cd1c,null))[_0x3952('0x25')](saveUpdates(_0x4f89cc['body'],null))[_0x3952('0x25')](respondWithResult(_0x35cd1c,null))[_0x3952('0x3a')](handleError(_0x35cd1c,null));};exports[_0x3952('0x26')]=function(_0x24bac9,_0x15aa0e){return db[_0x3952('0x2e')][_0x3952('0x38')]({'where':{'id':_0x24bac9[_0x3952('0x2c')]['id']}})[_0x3952('0x25')](handleEntityNotFound(_0x15aa0e,null))[_0x3952('0x25')](removeEntity(_0x15aa0e,null))[_0x3952('0x3a')](handleError(_0x15aa0e,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 50d7fe2..d87f68a 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 3a5f79c..2a3228d 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 _0xeb95=['ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x43a31b,_0x279ca4){var _0x37a340=function(_0x266681){while(--_0x266681){_0x43a31b['push'](_0x43a31b['shift']());}};_0x37a340(++_0x279ca4);}(_0xeb95,0x1d2));var _0x5eb9=function(_0xaba7a2,_0x4d7254){_0xaba7a2=_0xaba7a2-0x0;var _0x1cc0a9=_0xeb95[_0xaba7a2];return _0x1cc0a9;};'use strict';var _=require(_0x5eb9('0x0'));var util=require(_0x5eb9('0x1'));var moment=require('moment');var BPromise=require(_0x5eb9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5eb9('0x3'))['db'];var utils=require(_0x5eb9('0x4'));var logger=require(_0x5eb9('0x5'))(_0x5eb9('0x6'));var config=require(_0x5eb9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5eb9('0x8')][_0x5eb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16180d,_0x5f0526,_0x346bc9){return new BPromise(function(_0x11f869,_0x2217d5){return client[_0x5eb9('0xa')](_0x16180d,_0x346bc9)['then'](function(_0x20158c){logger['info']('ChatApplication,\x20%s,\x20%s',_0x5f0526,_0x5eb9('0xb'));logger[_0x5eb9('0xc')](_0x5eb9('0xd'),_0x5f0526,_0x5eb9('0xb'),JSON[_0x5eb9('0xe')](_0x20158c));if(_0x20158c[_0x5eb9('0xf')]){if(_0x20158c['error'][_0x5eb9('0x10')]===0x1f4){logger['error'](_0x5eb9('0x11'),_0x5f0526,_0x20158c['error'][_0x5eb9('0x12')]);return _0x2217d5(_0x20158c['error'][_0x5eb9('0x12')]);}logger[_0x5eb9('0xf')]('ChatApplication,\x20%s,\x20%s',_0x5f0526,_0x20158c[_0x5eb9('0xf')][_0x5eb9('0x12')]);return _0x11f869(_0x20158c[_0x5eb9('0xf')][_0x5eb9('0x12')]);}else{logger['info'](_0x5eb9('0x11'),_0x5f0526,_0x5eb9('0xb'));_0x11f869(_0x20158c[_0x5eb9('0x13')][_0x5eb9('0x12')]);}})[_0x5eb9('0x14')](function(_0x5e598a){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5f0526,_0x5e598a);_0x2217d5(_0x5e598a);});});}
\ No newline at end of file
+var _0x736a=['info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x1642e2,_0x4fdf89){var _0x2215da=function(_0x3c1bef){while(--_0x3c1bef){_0x1642e2['push'](_0x1642e2['shift']());}};_0x2215da(++_0x4fdf89);}(_0x736a,0x11b));var _0xa736=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x736a[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xa736('0x0'));var util=require(_0xa736('0x1'));var moment=require(_0xa736('0x2'));var BPromise=require(_0xa736('0x3'));var rs=require(_0xa736('0x4'));var fs=require('fs');var Redis=require(_0xa736('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa736('0x6'))(_0xa736('0x7'));var config=require(_0xa736('0x8'));var jayson=require(_0xa736('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d08a7,_0x487743,_0x308ad6){return new BPromise(function(_0xc6548a,_0x5c6c46){return client[_0xa736('0xa')](_0x5d08a7,_0x308ad6)['then'](function(_0x1efcd3){logger[_0xa736('0xb')](_0xa736('0xc'),_0x487743,'request\x20sent');logger[_0xa736('0xd')](_0xa736('0xe'),_0x487743,_0xa736('0xf'),JSON[_0xa736('0x10')](_0x1efcd3));if(_0x1efcd3[_0xa736('0x11')]){if(_0x1efcd3['error'][_0xa736('0x12')]===0x1f4){logger[_0xa736('0x11')]('ChatApplication,\x20%s,\x20%s',_0x487743,_0x1efcd3['error'][_0xa736('0x13')]);return _0x5c6c46(_0x1efcd3[_0xa736('0x11')][_0xa736('0x13')]);}logger[_0xa736('0x11')](_0xa736('0xc'),_0x487743,_0x1efcd3['error'][_0xa736('0x13')]);return _0xc6548a(_0x1efcd3[_0xa736('0x11')][_0xa736('0x13')]);}else{logger[_0xa736('0xb')](_0xa736('0xc'),_0x487743,'request\x20sent');_0xc6548a(_0x1efcd3['result']['message']);}})[_0xa736('0x14')](function(_0x6bf93f){logger[_0xa736('0x11')](_0xa736('0xc'),_0x487743,_0x6bf93f);_0x5c6c46(_0x6bf93f);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 25b679f..c0589a9 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 _0x0520=['exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0520,0xc5));var _0x0052=function(_0x51e58e,_0xd60b91){_0x51e58e=_0x51e58e-0x0;var _0x5279cb=_0x0520[_0x51e58e];return _0x5279cb;};'use strict';var multer=require(_0x0052('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0052('0x1'));var express=require('express');var router=express[_0x0052('0x2')]();var auth=require(_0x0052('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0052('0x4'));var controller=require(_0x0052('0x5'));router[_0x0052('0x6')](_0x0052('0x7'),auth[_0x0052('0x8')](),controller[_0x0052('0x9')]);router['put'](_0x0052('0x7'),auth[_0x0052('0x8')](),controller[_0x0052('0xa')]);router[_0x0052('0xb')](_0x0052('0x7'),auth['isAuthenticated'](),controller[_0x0052('0xc')]);module[_0x0052('0xd')]=router;
\ No newline at end of file
+var _0xb556=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x427c1a,_0x59061b){var _0xfb5c2e=function(_0x1fdcc0){while(--_0x1fdcc0){_0x427c1a['push'](_0x427c1a['shift']());}};_0xfb5c2e(++_0x59061b);}(_0xb556,0x16e));var _0x6b55=function(_0x47c171,_0x52fcd5){_0x47c171=_0x47c171-0x0;var _0x25a75e=_0xb556[_0x47c171];return _0x25a75e;};'use strict';var multer=require(_0x6b55('0x0'));var util=require(_0x6b55('0x1'));var path=require(_0x6b55('0x2'));var timeout=require(_0x6b55('0x3'));var express=require('express');var router=express[_0x6b55('0x4')]();var auth=require(_0x6b55('0x5'));var interaction=require(_0x6b55('0x6'));var config=require(_0x6b55('0x7'));var controller=require(_0x6b55('0x8'));router[_0x6b55('0x9')](_0x6b55('0xa'),auth[_0x6b55('0xb')](),controller[_0x6b55('0xc')]);router[_0x6b55('0xd')](_0x6b55('0xa'),auth[_0x6b55('0xb')](),controller[_0x6b55('0xe')]);router['delete'](_0x6b55('0xa'),auth[_0x6b55('0xb')](),controller[_0x6b55('0xf')]);module[_0x6b55('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 0d4e6e5..462ceaf 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 _0x8a4e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x94d23d,_0x35bc12){var _0x43db1c=function(_0x2742d7){while(--_0x2742d7){_0x94d23d['push'](_0x94d23d['shift']());}};_0x43db1c(++_0x35bc12);}(_0x8a4e,0x179));var _0xe8a4=function(_0x25806f,_0x16dbdd){_0x25806f=_0x25806f-0x0;var _0x163f12=_0x8a4e[_0x25806f];return _0x163f12;};'use strict';var Sequelize=require(_0xe8a4('0x0'));module[_0xe8a4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe8a4('0x2')]},'write':{'type':Sequelize[_0xe8a4('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa170=['BOOLEAN','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa170,0x1b5));var _0x0a17=function(_0x599b4c,_0x276240){_0x599b4c=_0x599b4c-0x0;var _0x28a0a7=_0xa170[_0x599b4c];return _0x28a0a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0a17('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x0a17('0x0')]},'write':{'type':Sequelize[_0x0a17('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 9dd63d6..1e9f4ec 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 _0x0738=['test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','filter','options','count','includeAll','include','rows','show','params','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','User','merge','removeMembers','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','defaults','redis','socket.io-emitter','register','jayson/promise','client','http'];(function(_0x4abe46,_0x1ad7df){var _0x12823a=function(_0x4a4941){while(--_0x4a4941){_0x4abe46['push'](_0x4abe46['shift']());}};_0x12823a(++_0x1ad7df);}(_0x0738,0xb9));var _0x8073=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x0738[_0x5a2d95];return _0x2c3986;};'use strict';var pdf=require(_0x8073('0x0'));var emlformat=require(_0x8073('0x1'));var rimraf=require(_0x8073('0x2'));var zipdir=require(_0x8073('0x3'));var jsonpatch=require(_0x8073('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8073('0x5'));var Mustache=require(_0x8073('0x6'));var util=require(_0x8073('0x7'));var path=require(_0x8073('0x8'));var sox=require(_0x8073('0x9'));var csv=require(_0x8073('0xa'));var ejs=require(_0x8073('0xb'));var fs=require('fs');var _=require(_0x8073('0xc'));var squel=require(_0x8073('0xd'));var crypto=require(_0x8073('0xe'));var jsforce=require(_0x8073('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8073('0x10'));var Papa=require(_0x8073('0x11'));var Redis=require('ioredis');var authService=require(_0x8073('0x12'));var qs=require(_0x8073('0x13'));var as=require(_0x8073('0x14'));var hardwareService=require(_0x8073('0x15'));var logger=require('../../config/logger')(_0x8073('0x16'));var utils=require('../../config/utils');var config=require(_0x8073('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8073('0x18')](config[_0x8073('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8073('0x1a'))(new Redis(config[_0x8073('0x19')]));require('./chatGroup.socket')[_0x8073('0x1b')](socket);var jayson=require(_0x8073('0x1c'));var client=jayson[_0x8073('0x1d')][_0x8073('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x56d77e,_0x4441ff,_0x3f54fc){if(_0x3f54fc){var _0x1507df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1507df[_0x8073('0x1f')](_0x4441ff)){return _0x56d77e;}else{throw new Error(_0x8073('0x20'));}}else{return _0x56d77e;}}function respondWithRpcPromise(_0x25fdb2,_0x567155,_0x1d7d66,_0x5088ff){return new BPromise(function(_0x2231e0,_0x181961){var _0x58ad61=_0x5088ff||client;return _0x58ad61[_0x8073('0x21')](_0x25fdb2,_0x1d7d66)[_0x8073('0x22')](function(_0xdb5ddf){logger[_0x8073('0x23')](_0x8073('0x24'),_0x567155,_0x8073('0x25'));logger[_0x8073('0x26')](_0x8073('0x27'),_0x567155,_0x8073('0x25'),JSON[_0x8073('0x28')](_0xdb5ddf));if(_0xdb5ddf[_0x8073('0x29')]){if(_0xdb5ddf[_0x8073('0x29')][_0x8073('0x2a')]===0x1f4){logger[_0x8073('0x29')]('ChatGroup,\x20%s,\x20%s',_0x567155,_0xdb5ddf[_0x8073('0x29')]['message']);return _0x181961(_0xdb5ddf[_0x8073('0x29')]['message']);}logger['error'](_0x8073('0x24'),_0x567155,_0xdb5ddf[_0x8073('0x29')][_0x8073('0x2b')]);return _0x2231e0(_0xdb5ddf[_0x8073('0x29')][_0x8073('0x2b')]);}else{logger[_0x8073('0x23')](_0x8073('0x24'),_0x567155,'request\x20sent');_0x2231e0(_0xdb5ddf['result'][_0x8073('0x2b')]);}})[_0x8073('0x2c')](function(_0x69e652){logger['error'](_0x8073('0x24'),_0x567155,_0x69e652);_0x181961(_0x69e652);});});}function respondWithStatusCode(_0x589d18,_0x38b407){_0x38b407=_0x38b407||0xcc;return function(_0x43f999){if(_0x43f999){return _0x589d18[_0x8073('0x2d')](_0x38b407);}return _0x589d18[_0x8073('0x2e')](_0x38b407)[_0x8073('0x2f')]();};}function respondWithResult(_0x5ab811,_0x225027){_0x225027=_0x225027||0xc8;return function(_0x4b85e6){if(_0x4b85e6){return _0x5ab811['status'](_0x225027)[_0x8073('0x30')](_0x4b85e6);}};}function respondWithFilteredResult(_0x49c1f2,_0x664ff4){return function(_0x5dd81d){if(_0x5dd81d){var _0x5802d7=_0x5dd81d['count'],_0x421f12=_0x664ff4[_0x8073('0x31')],_0x5081cd=_0x664ff4['offset']+_0x664ff4[_0x8073('0x32')],_0x2735d9;if(_0x5081cd>=_0x5802d7){_0x5081cd=_0x5802d7;_0x2735d9=0xc8;}else{_0x2735d9=0xce;}_0x49c1f2[_0x8073('0x2e')](_0x2735d9);return _0x49c1f2[_0x8073('0x33')](_0x8073('0x34'),_0x421f12+'-'+_0x5081cd+'/'+_0x5802d7)[_0x8073('0x30')](_0x5dd81d);}return null;};}function patchUpdates(_0x40abee){return function(_0x449da3){try{jsonpatch[_0x8073('0x35')](_0x449da3,_0x40abee,!![]);}catch(_0x4d6f6a){return BPromise['reject'](_0x4d6f6a);}return _0x449da3[_0x8073('0x36')]();};}function saveUpdates(_0xc0a416,_0x37da8a){return function(_0x9addfb){if(_0x9addfb){return _0x9addfb[_0x8073('0x37')](_0xc0a416)[_0x8073('0x22')](function(_0x181c59){return _0x181c59;});}return null;};}function removeEntity(_0x11e6b9,_0x56515d){return function(_0x351b93){if(_0x351b93){return _0x351b93['destroy']()[_0x8073('0x22')](function(){_0x11e6b9[_0x8073('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f39bb,_0x3e4ff6){return function(_0x50c3ea){if(!_0x50c3ea){_0x2f39bb[_0x8073('0x2d')](0x194);}return _0x50c3ea;};}function handleError(_0x2135c3,_0x27010f){_0x27010f=_0x27010f||0x1f4;return function(_0x5e34ed){logger[_0x8073('0x29')](_0x5e34ed[_0x8073('0x38')]);if(_0x5e34ed['name']){delete _0x5e34ed[_0x8073('0x39')];}_0x2135c3['status'](_0x27010f)[_0x8073('0x3a')](_0x5e34ed);};}exports[_0x8073('0x3b')]=function(_0x43194d,_0x2c4ba9){var _0x354197={},_0x3eacda={},_0x13fc2d={'count':0x0,'rows':[]};var _0x2dbb80=_[_0x8073('0x3c')](db[_0x8073('0x3d')][_0x8073('0x3e')],function(_0x3d9b88){return{'name':_0x3d9b88['fieldName'],'type':_0x3d9b88[_0x8073('0x3f')][_0x8073('0x40')]};});_0x3eacda[_0x8073('0x41')]=_[_0x8073('0x3c')](_0x2dbb80,'name');_0x3eacda[_0x8073('0x42')]=_[_0x8073('0x43')](_0x43194d['query']);_0x3eacda[_0x8073('0x44')]=_[_0x8073('0x45')](_0x3eacda[_0x8073('0x41')],_0x3eacda[_0x8073('0x42')]);_0x354197[_0x8073('0x46')]=_[_0x8073('0x45')](_0x3eacda[_0x8073('0x41')],qs[_0x8073('0x47')](_0x43194d[_0x8073('0x42')]['fields']));_0x354197['attributes']=_0x354197[_0x8073('0x46')][_0x8073('0x48')]?_0x354197[_0x8073('0x46')]:_0x3eacda[_0x8073('0x41')];if(!_0x43194d['query'][_0x8073('0x49')](_0x8073('0x4a'))){_0x354197[_0x8073('0x32')]=qs[_0x8073('0x32')](_0x43194d['query'][_0x8073('0x32')]);_0x354197['offset']=qs[_0x8073('0x31')](_0x43194d[_0x8073('0x42')][_0x8073('0x31')]);}_0x354197[_0x8073('0x4b')]=qs['sort'](_0x43194d[_0x8073('0x42')][_0x8073('0x4c')]);_0x354197[_0x8073('0x4d')]=qs[_0x8073('0x44')](_[_0x8073('0x4e')](_0x43194d['query'],_0x3eacda[_0x8073('0x44')]));if(_0x43194d['query']['filter']){_0x354197[_0x8073('0x4d')]=_['merge'](_0x354197['where'],{'$or':_[_0x8073('0x3c')](_0x2dbb80,function(_0x299c5d){if(_0x299c5d[_0x8073('0x3f')][_0x8073('0x40')]!=='VIRTUAL'){var _0x34ce33={};_0x34ce33[_0x299c5d[_0x8073('0x4f')]]={'$like':'%'+_0x43194d[_0x8073('0x42')][_0x8073('0x50')]+'%'};return _0x34ce33;}})});}_0x354197=_['merge']({},_0x354197,_0x43194d[_0x8073('0x51')]);var _0x5dc619={'where':_0x354197['where']};return db[_0x8073('0x3d')][_0x8073('0x52')](_0x5dc619)[_0x8073('0x22')](function(_0x2167b3){_0x13fc2d[_0x8073('0x52')]=_0x2167b3;if(_0x43194d[_0x8073('0x42')][_0x8073('0x53')]){_0x354197[_0x8073('0x54')]=[{'all':!![]}];}return db[_0x8073('0x3d')]['findAll'](_0x354197);})['then'](function(_0x472d31){_0x13fc2d[_0x8073('0x55')]=_0x472d31;return _0x13fc2d;})['then'](respondWithFilteredResult(_0x2c4ba9,_0x354197))[_0x8073('0x2c')](handleError(_0x2c4ba9,null));};exports[_0x8073('0x56')]=function(_0x465b2c,_0x1d06ee){var _0x369e62={'raw':!![],'where':{'id':_0x465b2c[_0x8073('0x57')]['id']}},_0x2dea8e={};_0x2dea8e[_0x8073('0x41')]=_[_0x8073('0x43')](db[_0x8073('0x3d')][_0x8073('0x3e')]);_0x2dea8e[_0x8073('0x42')]=_[_0x8073('0x43')](_0x465b2c[_0x8073('0x42')]);_0x2dea8e[_0x8073('0x44')]=_['intersection'](_0x2dea8e[_0x8073('0x41')],_0x2dea8e[_0x8073('0x42')]);_0x369e62[_0x8073('0x46')]=_[_0x8073('0x45')](_0x2dea8e[_0x8073('0x41')],qs['fields'](_0x465b2c[_0x8073('0x42')][_0x8073('0x47')]));_0x369e62[_0x8073('0x46')]=_0x369e62['attributes'][_0x8073('0x48')]?_0x369e62[_0x8073('0x46')]:_0x2dea8e[_0x8073('0x41')];if(_0x465b2c['query']['includeAll']){_0x369e62[_0x8073('0x54')]=[{'all':!![]}];}_0x369e62=_['merge']({},_0x369e62,_0x465b2c['options']);return db[_0x8073('0x3d')][_0x8073('0x58')](_0x369e62)[_0x8073('0x22')](handleEntityNotFound(_0x1d06ee,null))['then'](respondWithResult(_0x1d06ee,null))[_0x8073('0x2c')](handleError(_0x1d06ee,null));};exports['create']=function(_0x41e9e3,_0x1ee1b7){return db['ChatGroup'][_0x8073('0x59')](_0x41e9e3[_0x8073('0x5a')],{})['then'](respondWithResult(_0x1ee1b7,0xc9))[_0x8073('0x2c')](handleError(_0x1ee1b7,null));};exports[_0x8073('0x37')]=function(_0x1d7320,_0x331994){if(_0x1d7320[_0x8073('0x5a')]['id']){delete _0x1d7320[_0x8073('0x5a')]['id'];}return db[_0x8073('0x3d')]['find']({'where':{'id':_0x1d7320[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x331994,null))[_0x8073('0x22')](saveUpdates(_0x1d7320[_0x8073('0x5a')],null))[_0x8073('0x22')](respondWithResult(_0x331994,null))['catch'](handleError(_0x331994,null));};exports['destroy']=function(_0x391da5,_0x3b0652){return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x391da5[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x3b0652,null))[_0x8073('0x22')](removeEntity(_0x3b0652,null))['catch'](handleError(_0x3b0652,null));};exports['describe']=function(_0x376824,_0x564fde){return db[_0x8073('0x3d')][_0x8073('0x5b')]()[_0x8073('0x22')](respondWithResult(_0x564fde,null))['catch'](handleError(_0x564fde,null));};exports[_0x8073('0x5c')]=function(_0x4bd5d3,_0x129245,_0x53487a){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x4bd5d3[_0x8073('0x57')]['id'],'ToId':_0x4bd5d3[_0x8073('0x5d')]['id'],'read':![]}})[_0x8073('0x22')](function(_0xa144da){return{'id':_[_0x8073('0x5e')](_0x4bd5d3['params']['id']),'count':_0xa144da};})[_0x8073('0x22')](respondWithResult(_0x129245,null))[_0x8073('0x2c')](handleError(_0x129245,null));};exports['addMembers']=function(_0x50be93,_0x21de77,_0xbaf168){return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x50be93[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x21de77,null))[_0x8073('0x22')](function(_0x4b7f59){if(_0x4b7f59){return _0x4b7f59[_0x8073('0x5f')](_0x50be93[_0x8073('0x5a')][_0x8073('0x60')],_[_0x8073('0x61')](_0x50be93[_0x8073('0x5a')],[_0x8073('0x60'),'id'])||{});}})[_0x8073('0x22')](respondWithResult(_0x21de77,null))[_0x8073('0x2c')](handleError(_0x21de77,null));};exports[_0x8073('0x62')]=function(_0x2ead4e,_0x2b4a42,_0x220625){var _0x2b618c={};var _0x96c513={};var _0x3ae163;var _0x456965;return db[_0x8073('0x3d')]['findOne']({'where':{'id':_0x2ead4e[_0x8073('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b4a42,null))['then'](function(_0x28579d){if(_0x28579d){_0x3ae163=_0x28579d;_0x96c513[_0x8073('0x41')]=_['keys'](db[_0x8073('0x63')][_0x8073('0x3e')]);_0x96c513['query']=_[_0x8073('0x43')](_0x2ead4e['query']);_0x96c513[_0x8073('0x44')]=_[_0x8073('0x45')](_0x96c513[_0x8073('0x41')],_0x96c513[_0x8073('0x42')]);_0x2b618c['attributes']=_['intersection'](_0x96c513[_0x8073('0x41')],qs[_0x8073('0x47')](_0x2ead4e[_0x8073('0x42')]['fields']));_0x2b618c[_0x8073('0x46')]=_0x2b618c['attributes']['length']?_0x2b618c[_0x8073('0x46')]:_0x96c513['model'];_0x2b618c['order']=qs[_0x8073('0x4c')](_0x2ead4e[_0x8073('0x42')][_0x8073('0x4c')]);_0x2b618c['where']=qs[_0x8073('0x44')](_[_0x8073('0x4e')](_0x2ead4e[_0x8073('0x42')],_0x96c513[_0x8073('0x44')]));if(_0x2ead4e[_0x8073('0x42')][_0x8073('0x50')]){_0x2b618c[_0x8073('0x4d')]=_[_0x8073('0x64')](_0x2b618c[_0x8073('0x4d')],{'$or':_[_0x8073('0x3c')](_0x2b618c[_0x8073('0x46')],function(_0x1fb4f7){var _0x28d761={};_0x28d761[_0x1fb4f7]={'$like':'%'+_0x2ead4e[_0x8073('0x42')][_0x8073('0x50')]+'%'};return _0x28d761;})});}_0x2b618c=_[_0x8073('0x64')]({},_0x2b618c,_0x2ead4e[_0x8073('0x51')]);return _0x3ae163[_0x8073('0x62')](_0x2b618c);}})[_0x8073('0x22')](function(_0x13a86e){if(_0x13a86e){_0x456965=_0x13a86e[_0x8073('0x48')];if(!_0x2ead4e[_0x8073('0x42')][_0x8073('0x49')](_0x8073('0x4a'))){_0x2b618c['limit']=qs[_0x8073('0x32')](_0x2ead4e[_0x8073('0x42')][_0x8073('0x32')]);_0x2b618c[_0x8073('0x31')]=qs[_0x8073('0x31')](_0x2ead4e['query'][_0x8073('0x31')]);}return _0x3ae163[_0x8073('0x62')](_0x2b618c);}})['then'](function(_0x45ea21){if(_0x45ea21){return _0x45ea21?{'count':_0x456965,'rows':_0x45ea21}:null;}})['then'](respondWithResult(_0x2b4a42,null))[_0x8073('0x2c')](handleError(_0x2b4a42,null));};exports[_0x8073('0x65')]=function(_0x2defdc,_0x1c9f39,_0x4d8166){return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x2defdc[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x1c9f39,null))[_0x8073('0x22')](function(_0x3c1080){if(_0x3c1080){return _0x3c1080[_0x8073('0x65')](_0x2defdc['query']['ids']);}})[_0x8073('0x22')](respondWithStatusCode(_0x1c9f39,null))[_0x8073('0x2c')](handleError(_0x1c9f39,null));};exports['addMessage']=function(_0x13f946,_0x338cea,_0x34d61d){if(_0x13f946['body']['id']){delete _0x13f946['body']['id'];}return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x13f946[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x338cea,null))[_0x8073('0x22')](function(_0x49b05c){if(_0x49b05c){_0x13f946[_0x8073('0x5a')]['ChatGroupId']=_0x49b05c['id'];return db['ChatInternalMessage'][_0x8073('0x59')](_0x13f946[_0x8073('0x5a')]);}})['then'](respondWithResult(_0x338cea,null))[_0x8073('0x2c')](handleError(_0x338cea,null));};exports[_0x8073('0x66')]=function(_0xaffa8c,_0x52038b,_0xb563f2){var _0x52c20b={};var _0x4a8238={};var _0x3be40a;var _0x46e926;return db[_0x8073('0x3d')]['findOne']({'where':{'id':_0xaffa8c[_0x8073('0x57')]['id']}})['then'](handleEntityNotFound(_0x52038b,null))[_0x8073('0x22')](function(_0x43c958){if(_0x43c958){_0x3be40a=_0x43c958;_0x4a8238[_0x8073('0x41')]=_['keys'](db[_0x8073('0x67')][_0x8073('0x3e')]);_0x4a8238[_0x8073('0x42')]=_[_0x8073('0x43')](_0xaffa8c[_0x8073('0x42')]);_0x4a8238[_0x8073('0x44')]=_['intersection'](_0x4a8238[_0x8073('0x41')],_0x4a8238[_0x8073('0x42')]);_0x52c20b[_0x8073('0x46')]=_['intersection'](_0x4a8238[_0x8073('0x41')],qs['fields'](_0xaffa8c[_0x8073('0x42')][_0x8073('0x47')]));_0x52c20b[_0x8073('0x46')]=_0x52c20b[_0x8073('0x46')][_0x8073('0x48')]?_0x52c20b[_0x8073('0x46')]:_0x4a8238['model'];_0x52c20b['order']=qs[_0x8073('0x4c')](_0xaffa8c['query']['sort']);_0x52c20b[_0x8073('0x4d')]=qs[_0x8073('0x44')](_[_0x8073('0x4e')](_0xaffa8c['query'],_0x4a8238['filters']));if(_0xaffa8c['query'][_0x8073('0x50')]){_0x52c20b[_0x8073('0x4d')]=_[_0x8073('0x64')](_0x52c20b[_0x8073('0x4d')],{'$or':_[_0x8073('0x3c')](_0x52c20b[_0x8073('0x46')],function(_0x38cfe4){var _0x12284d={};_0x12284d[_0x38cfe4]={'$like':'%'+_0xaffa8c['query'][_0x8073('0x50')]+'%'};return _0x12284d;})});}if(_0xaffa8c[_0x8073('0x42')][_0x8073('0x68')]){var _0x15bfb9=_0xaffa8c[_0x8073('0x42')][_0x8073('0x68')][_0x8073('0x69')](',');var _0x4a7c30={};_0x4a7c30[_0x15bfb9[0x0]]={'$gte':moment(_0x15bfb9[0x1])[_0x8073('0x6a')](_0x8073('0x6b'))};_0x52c20b[_0x8073('0x4d')]=_[_0x8073('0x64')](_0x52c20b['where'],_0x4a7c30);}_0x52c20b=_['merge']({},_0x52c20b,_0xaffa8c['options']);return _0x3be40a[_0x8073('0x66')](_0x52c20b);}})['then'](function(_0x92f2b8){if(_0x92f2b8){_0x46e926=_0x92f2b8[_0x8073('0x48')];if(!_0xaffa8c[_0x8073('0x42')][_0x8073('0x49')](_0x8073('0x4a'))){_0x52c20b[_0x8073('0x32')]=qs[_0x8073('0x32')](_0xaffa8c['query'][_0x8073('0x32')]);_0x52c20b['offset']=qs[_0x8073('0x31')](_0xaffa8c[_0x8073('0x42')][_0x8073('0x31')]);}return _0x3be40a['getMessages'](_0x52c20b);}})[_0x8073('0x22')](function(_0x461aa0){if(_0x461aa0){return _0x461aa0?{'count':_0x46e926,'rows':_0x461aa0}:null;}})[_0x8073('0x22')](respondWithResult(_0x52038b,null))[_0x8073('0x2c')](handleError(_0x52038b,null));};
\ No newline at end of file
+var _0x0683=['addMessage','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','stack','send','ChatGroup','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','includeAll','include','findAll','show','length','options','create','update','body','find','params','destroy','describe','getUnread','user','addMembers','ids','getMembers','findOne','User','removeMembers'];(function(_0x3ceea7,_0x130c5c){var _0x56a321=function(_0x2a168a){while(--_0x2a168a){_0x3ceea7['push'](_0x3ceea7['shift']());}};_0x56a321(++_0x130c5c);}(_0x0683,0xe1));var _0x3068=function(_0x47677f,_0x4ec253){_0x47677f=_0x47677f-0x0;var _0x14ded1=_0x0683[_0x47677f];return _0x14ded1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3068('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3068('0x1'));var jsonpatch=require(_0x3068('0x2'));var rp=require('request-promise');var moment=require(_0x3068('0x3'));var BPromise=require(_0x3068('0x4'));var Mustache=require(_0x3068('0x5'));var util=require(_0x3068('0x6'));var path=require(_0x3068('0x7'));var sox=require(_0x3068('0x8'));var csv=require('to-csv');var ejs=require(_0x3068('0x9'));var fs=require('fs');var _=require(_0x3068('0xa'));var squel=require('squel');var crypto=require(_0x3068('0xb'));var jsforce=require(_0x3068('0xc'));var deskjs=require(_0x3068('0xd'));var toCsv=require(_0x3068('0xe'));var querystring=require(_0x3068('0xf'));var Papa=require(_0x3068('0x10'));var Redis=require(_0x3068('0x11'));var authService=require(_0x3068('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3068('0x13'));var hardwareService=require(_0x3068('0x14'));var logger=require(_0x3068('0x15'))(_0x3068('0x16'));var utils=require(_0x3068('0x17'));var config=require(_0x3068('0x18'));var db=require(_0x3068('0x19'))['db'];config['redis']=_[_0x3068('0x1a')](config[_0x3068('0x1b')],{'host':_0x3068('0x1c'),'port':0x18eb});var socket=require(_0x3068('0x1d'))(new Redis(config[_0x3068('0x1b')]));require('./chatGroup.socket')[_0x3068('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3068('0x1f')][_0x3068('0x20')]({'port':0x232a});function checkPasswordPattern(_0x475f77,_0x4c7817,_0x1d4ad8){if(_0x1d4ad8){var _0x2ef90b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ef90b['test'](_0x4c7817)){return _0x475f77;}else{throw new Error(_0x3068('0x21'));}}else{return _0x475f77;}}function respondWithRpcPromise(_0x1af9c9,_0x512d78,_0x7822cb,_0x203c59){return new BPromise(function(_0x179201,_0xed6eae){var _0x55b018=_0x203c59||client;return _0x55b018['request'](_0x1af9c9,_0x7822cb)[_0x3068('0x22')](function(_0x2e8638){logger['info'](_0x3068('0x23'),_0x512d78,_0x3068('0x24'));logger[_0x3068('0x25')](_0x3068('0x26'),_0x512d78,_0x3068('0x24'),JSON['stringify'](_0x2e8638));if(_0x2e8638[_0x3068('0x27')]){if(_0x2e8638[_0x3068('0x27')][_0x3068('0x28')]===0x1f4){logger[_0x3068('0x27')](_0x3068('0x23'),_0x512d78,_0x2e8638['error']['message']);return _0xed6eae(_0x2e8638['error'][_0x3068('0x29')]);}logger[_0x3068('0x27')](_0x3068('0x23'),_0x512d78,_0x2e8638['error'][_0x3068('0x29')]);return _0x179201(_0x2e8638[_0x3068('0x27')][_0x3068('0x29')]);}else{logger[_0x3068('0x2a')](_0x3068('0x23'),_0x512d78,_0x3068('0x24'));_0x179201(_0x2e8638[_0x3068('0x2b')]['message']);}})[_0x3068('0x2c')](function(_0x4ac84a){logger[_0x3068('0x27')](_0x3068('0x23'),_0x512d78,_0x4ac84a);_0xed6eae(_0x4ac84a);});});}function respondWithStatusCode(_0x546771,_0x5bd7d9){_0x5bd7d9=_0x5bd7d9||0xcc;return function(_0x16cb38){if(_0x16cb38){return _0x546771[_0x3068('0x2d')](_0x5bd7d9);}return _0x546771[_0x3068('0x2e')](_0x5bd7d9)[_0x3068('0x2f')]();};}function respondWithResult(_0x2709b9,_0x209c18){_0x209c18=_0x209c18||0xc8;return function(_0x197bbc){if(_0x197bbc){return _0x2709b9[_0x3068('0x2e')](_0x209c18)['json'](_0x197bbc);}};}function respondWithFilteredResult(_0x479d1d,_0x4cd2ec){return function(_0x41bd55){if(_0x41bd55){var _0x3c9dfa=_0x41bd55[_0x3068('0x30')],_0x346d15=_0x4cd2ec[_0x3068('0x31')],_0xcde2cc=_0x4cd2ec[_0x3068('0x31')]+_0x4cd2ec['limit'],_0x45d1d2;if(_0xcde2cc>=_0x3c9dfa){_0xcde2cc=_0x3c9dfa;_0x45d1d2=0xc8;}else{_0x45d1d2=0xce;}_0x479d1d['status'](_0x45d1d2);return _0x479d1d[_0x3068('0x32')](_0x3068('0x33'),_0x346d15+'-'+_0xcde2cc+'/'+_0x3c9dfa)[_0x3068('0x34')](_0x41bd55);}return null;};}function patchUpdates(_0x170ee8){return function(_0x436697){try{jsonpatch['apply'](_0x436697,_0x170ee8,!![]);}catch(_0x39e94b){return BPromise[_0x3068('0x35')](_0x39e94b);}return _0x436697['save']();};}function saveUpdates(_0x1c05dd,_0x28005e){return function(_0x4f4872){if(_0x4f4872){return _0x4f4872['update'](_0x1c05dd)['then'](function(_0x317aa8){return _0x317aa8;});}return null;};}function removeEntity(_0xfe6094,_0x141993){return function(_0x4e1099){if(_0x4e1099){return _0x4e1099['destroy']()[_0x3068('0x22')](function(){_0xfe6094[_0x3068('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec59a,_0x1bfb3c){return function(_0x282cdc){if(!_0x282cdc){_0x2ec59a[_0x3068('0x2d')](0x194);}return _0x282cdc;};}function handleError(_0x48fe79,_0x3a3c1c){_0x3a3c1c=_0x3a3c1c||0x1f4;return function(_0x106613){logger['error'](_0x106613[_0x3068('0x36')]);if(_0x106613['name']){delete _0x106613['name'];}_0x48fe79[_0x3068('0x2e')](_0x3a3c1c)[_0x3068('0x37')](_0x106613);};}exports['index']=function(_0x1d9507,_0x48b509){var _0x1428eb={},_0xeaca39={},_0x36fab8={'count':0x0,'rows':[]};var _0x35fb83=_['map'](db[_0x3068('0x38')][_0x3068('0x39')],function(_0x450339){return{'name':_0x450339[_0x3068('0x3a')],'type':_0x450339[_0x3068('0x3b')][_0x3068('0x3c')]};});_0xeaca39[_0x3068('0x3d')]=_['map'](_0x35fb83,_0x3068('0x3e'));_0xeaca39['query']=_[_0x3068('0x3f')](_0x1d9507[_0x3068('0x40')]);_0xeaca39[_0x3068('0x41')]=_[_0x3068('0x42')](_0xeaca39[_0x3068('0x3d')],_0xeaca39[_0x3068('0x40')]);_0x1428eb[_0x3068('0x43')]=_[_0x3068('0x42')](_0xeaca39[_0x3068('0x3d')],qs[_0x3068('0x44')](_0x1d9507['query'][_0x3068('0x44')]));_0x1428eb[_0x3068('0x43')]=_0x1428eb['attributes']['length']?_0x1428eb[_0x3068('0x43')]:_0xeaca39[_0x3068('0x3d')];if(!_0x1d9507[_0x3068('0x40')][_0x3068('0x45')](_0x3068('0x46'))){_0x1428eb[_0x3068('0x47')]=qs[_0x3068('0x47')](_0x1d9507[_0x3068('0x40')][_0x3068('0x47')]);_0x1428eb[_0x3068('0x31')]=qs[_0x3068('0x31')](_0x1d9507['query'][_0x3068('0x31')]);}_0x1428eb[_0x3068('0x48')]=qs[_0x3068('0x49')](_0x1d9507['query'][_0x3068('0x49')]);_0x1428eb[_0x3068('0x4a')]=qs[_0x3068('0x41')](_[_0x3068('0x4b')](_0x1d9507[_0x3068('0x40')],_0xeaca39[_0x3068('0x41')]));if(_0x1d9507[_0x3068('0x40')][_0x3068('0x4c')]){_0x1428eb[_0x3068('0x4a')]=_[_0x3068('0x4d')](_0x1428eb[_0x3068('0x4a')],{'$or':_[_0x3068('0x4e')](_0x35fb83,function(_0x4800e8){if(_0x4800e8[_0x3068('0x3b')][_0x3068('0x3c')]!==_0x3068('0x4f')){var _0xcc6746={};_0xcc6746[_0x4800e8[_0x3068('0x50')]]={'$like':'%'+_0x1d9507[_0x3068('0x40')][_0x3068('0x4c')]+'%'};return _0xcc6746;}})});}_0x1428eb=_['merge']({},_0x1428eb,_0x1d9507['options']);var _0x21ccad={'where':_0x1428eb[_0x3068('0x4a')]};return db[_0x3068('0x38')]['count'](_0x21ccad)[_0x3068('0x22')](function(_0xc375f3){_0x36fab8['count']=_0xc375f3;if(_0x1d9507[_0x3068('0x40')][_0x3068('0x51')]){_0x1428eb[_0x3068('0x52')]=[{'all':!![]}];}return db['ChatGroup'][_0x3068('0x53')](_0x1428eb);})['then'](function(_0xa76534){_0x36fab8['rows']=_0xa76534;return _0x36fab8;})['then'](respondWithFilteredResult(_0x48b509,_0x1428eb))[_0x3068('0x2c')](handleError(_0x48b509,null));};exports[_0x3068('0x54')]=function(_0xf06d6,_0x6612ea){var _0x4bb826={'raw':!![],'where':{'id':_0xf06d6['params']['id']}},_0x4368ba={};_0x4368ba[_0x3068('0x3d')]=_[_0x3068('0x3f')](db['ChatGroup'][_0x3068('0x39')]);_0x4368ba[_0x3068('0x40')]=_['keys'](_0xf06d6['query']);_0x4368ba[_0x3068('0x41')]=_['intersection'](_0x4368ba['model'],_0x4368ba['query']);_0x4bb826[_0x3068('0x43')]=_[_0x3068('0x42')](_0x4368ba[_0x3068('0x3d')],qs[_0x3068('0x44')](_0xf06d6[_0x3068('0x40')][_0x3068('0x44')]));_0x4bb826[_0x3068('0x43')]=_0x4bb826[_0x3068('0x43')][_0x3068('0x55')]?_0x4bb826['attributes']:_0x4368ba['model'];if(_0xf06d6[_0x3068('0x40')][_0x3068('0x51')]){_0x4bb826[_0x3068('0x52')]=[{'all':!![]}];}_0x4bb826=_[_0x3068('0x4d')]({},_0x4bb826,_0xf06d6[_0x3068('0x56')]);return db['ChatGroup']['find'](_0x4bb826)[_0x3068('0x22')](handleEntityNotFound(_0x6612ea,null))[_0x3068('0x22')](respondWithResult(_0x6612ea,null))[_0x3068('0x2c')](handleError(_0x6612ea,null));};exports[_0x3068('0x57')]=function(_0x2fa987,_0x3fc28b){return db['ChatGroup']['create'](_0x2fa987['body'],{})[_0x3068('0x22')](respondWithResult(_0x3fc28b,0xc9))[_0x3068('0x2c')](handleError(_0x3fc28b,null));};exports[_0x3068('0x58')]=function(_0x3e210a,_0x2acdd9){if(_0x3e210a['body']['id']){delete _0x3e210a[_0x3068('0x59')]['id'];}return db[_0x3068('0x38')][_0x3068('0x5a')]({'where':{'id':_0x3e210a[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x2acdd9,null))['then'](saveUpdates(_0x3e210a[_0x3068('0x59')],null))[_0x3068('0x22')](respondWithResult(_0x2acdd9,null))[_0x3068('0x2c')](handleError(_0x2acdd9,null));};exports[_0x3068('0x5c')]=function(_0xca8fa3,_0x533ac6){return db['ChatGroup'][_0x3068('0x5a')]({'where':{'id':_0xca8fa3[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x533ac6,null))[_0x3068('0x22')](removeEntity(_0x533ac6,null))[_0x3068('0x2c')](handleError(_0x533ac6,null));};exports[_0x3068('0x5d')]=function(_0x530646,_0x11ca45){return db[_0x3068('0x38')]['describe']()[_0x3068('0x22')](respondWithResult(_0x11ca45,null))[_0x3068('0x2c')](handleError(_0x11ca45,null));};exports[_0x3068('0x5e')]=function(_0x521450,_0x544f06,_0x46fd31){return db['ChatInternalMessage'][_0x3068('0x30')]({'where':{'ChatGroupId':_0x521450[_0x3068('0x5b')]['id'],'ToId':_0x521450[_0x3068('0x5f')]['id'],'read':![]}})[_0x3068('0x22')](function(_0x407093){return{'id':_['toInteger'](_0x521450[_0x3068('0x5b')]['id']),'count':_0x407093};})[_0x3068('0x22')](respondWithResult(_0x544f06,null))['catch'](handleError(_0x544f06,null));};exports[_0x3068('0x60')]=function(_0x26a0d6,_0xaa5e23,_0x4df7f7){return db[_0x3068('0x38')]['find']({'where':{'id':_0x26a0d6[_0x3068('0x5b')]['id']}})['then'](handleEntityNotFound(_0xaa5e23,null))[_0x3068('0x22')](function(_0x1eca76){if(_0x1eca76){return _0x1eca76[_0x3068('0x60')](_0x26a0d6[_0x3068('0x59')][_0x3068('0x61')],_['omit'](_0x26a0d6['body'],[_0x3068('0x61'),'id'])||{});}})[_0x3068('0x22')](respondWithResult(_0xaa5e23,null))['catch'](handleError(_0xaa5e23,null));};exports[_0x3068('0x62')]=function(_0x2d22af,_0x53ae7f,_0x4dc570){var _0x4938ed={};var _0x599ce1={};var _0x4cd769;var _0x43eba5;return db[_0x3068('0x38')][_0x3068('0x63')]({'where':{'id':_0x2d22af[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x53ae7f,null))['then'](function(_0xcc0884){if(_0xcc0884){_0x4cd769=_0xcc0884;_0x599ce1[_0x3068('0x3d')]=_[_0x3068('0x3f')](db[_0x3068('0x64')]['rawAttributes']);_0x599ce1[_0x3068('0x40')]=_[_0x3068('0x3f')](_0x2d22af['query']);_0x599ce1[_0x3068('0x41')]=_[_0x3068('0x42')](_0x599ce1[_0x3068('0x3d')],_0x599ce1[_0x3068('0x40')]);_0x4938ed[_0x3068('0x43')]=_[_0x3068('0x42')](_0x599ce1[_0x3068('0x3d')],qs[_0x3068('0x44')](_0x2d22af[_0x3068('0x40')][_0x3068('0x44')]));_0x4938ed['attributes']=_0x4938ed[_0x3068('0x43')][_0x3068('0x55')]?_0x4938ed['attributes']:_0x599ce1[_0x3068('0x3d')];_0x4938ed[_0x3068('0x48')]=qs[_0x3068('0x49')](_0x2d22af[_0x3068('0x40')][_0x3068('0x49')]);_0x4938ed[_0x3068('0x4a')]=qs[_0x3068('0x41')](_['pick'](_0x2d22af[_0x3068('0x40')],_0x599ce1[_0x3068('0x41')]));if(_0x2d22af['query'][_0x3068('0x4c')]){_0x4938ed[_0x3068('0x4a')]=_[_0x3068('0x4d')](_0x4938ed[_0x3068('0x4a')],{'$or':_['map'](_0x4938ed[_0x3068('0x43')],function(_0x22a057){var _0x23c0fb={};_0x23c0fb[_0x22a057]={'$like':'%'+_0x2d22af['query'][_0x3068('0x4c')]+'%'};return _0x23c0fb;})});}_0x4938ed=_[_0x3068('0x4d')]({},_0x4938ed,_0x2d22af[_0x3068('0x56')]);return _0x4cd769[_0x3068('0x62')](_0x4938ed);}})[_0x3068('0x22')](function(_0x1aa565){if(_0x1aa565){_0x43eba5=_0x1aa565[_0x3068('0x55')];if(!_0x2d22af[_0x3068('0x40')][_0x3068('0x45')](_0x3068('0x46'))){_0x4938ed['limit']=qs[_0x3068('0x47')](_0x2d22af[_0x3068('0x40')][_0x3068('0x47')]);_0x4938ed[_0x3068('0x31')]=qs[_0x3068('0x31')](_0x2d22af['query'][_0x3068('0x31')]);}return _0x4cd769['getMembers'](_0x4938ed);}})[_0x3068('0x22')](function(_0x6cf3cd){if(_0x6cf3cd){return _0x6cf3cd?{'count':_0x43eba5,'rows':_0x6cf3cd}:null;}})[_0x3068('0x22')](respondWithResult(_0x53ae7f,null))[_0x3068('0x2c')](handleError(_0x53ae7f,null));};exports[_0x3068('0x65')]=function(_0x2baf90,_0x4ad1b9,_0x524755){return db[_0x3068('0x38')]['find']({'where':{'id':_0x2baf90['params']['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x4ad1b9,null))['then'](function(_0x4c6a98){if(_0x4c6a98){return _0x4c6a98[_0x3068('0x65')](_0x2baf90['query'][_0x3068('0x61')]);}})[_0x3068('0x22')](respondWithStatusCode(_0x4ad1b9,null))['catch'](handleError(_0x4ad1b9,null));};exports[_0x3068('0x66')]=function(_0x3f5a7b,_0x5a33ff,_0x18345a){if(_0x3f5a7b['body']['id']){delete _0x3f5a7b[_0x3068('0x59')]['id'];}return db['ChatGroup'][_0x3068('0x5a')]({'where':{'id':_0x3f5a7b[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x5a33ff,null))['then'](function(_0x1bcf22){if(_0x1bcf22){_0x3f5a7b['body'][_0x3068('0x67')]=_0x1bcf22['id'];return db['ChatInternalMessage']['create'](_0x3f5a7b[_0x3068('0x59')]);}})['then'](respondWithResult(_0x5a33ff,null))['catch'](handleError(_0x5a33ff,null));};exports[_0x3068('0x68')]=function(_0x40450b,_0x1b057a,_0x3952fc){var _0x491cf6={};var _0x473a03={};var _0x1260ba;var _0x4ad40d;return db[_0x3068('0x38')][_0x3068('0x63')]({'where':{'id':_0x40450b[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x1b057a,null))['then'](function(_0x37ceaf){if(_0x37ceaf){_0x1260ba=_0x37ceaf;_0x473a03[_0x3068('0x3d')]=_[_0x3068('0x3f')](db[_0x3068('0x69')][_0x3068('0x39')]);_0x473a03[_0x3068('0x40')]=_[_0x3068('0x3f')](_0x40450b[_0x3068('0x40')]);_0x473a03[_0x3068('0x41')]=_[_0x3068('0x42')](_0x473a03['model'],_0x473a03[_0x3068('0x40')]);_0x491cf6[_0x3068('0x43')]=_['intersection'](_0x473a03[_0x3068('0x3d')],qs[_0x3068('0x44')](_0x40450b['query'][_0x3068('0x44')]));_0x491cf6['attributes']=_0x491cf6[_0x3068('0x43')][_0x3068('0x55')]?_0x491cf6[_0x3068('0x43')]:_0x473a03[_0x3068('0x3d')];_0x491cf6[_0x3068('0x48')]=qs[_0x3068('0x49')](_0x40450b[_0x3068('0x40')][_0x3068('0x49')]);_0x491cf6[_0x3068('0x4a')]=qs[_0x3068('0x41')](_[_0x3068('0x4b')](_0x40450b[_0x3068('0x40')],_0x473a03[_0x3068('0x41')]));if(_0x40450b[_0x3068('0x40')][_0x3068('0x4c')]){_0x491cf6['where']=_[_0x3068('0x4d')](_0x491cf6[_0x3068('0x4a')],{'$or':_[_0x3068('0x4e')](_0x491cf6['attributes'],function(_0xcd0dd1){var _0x5b6492={};_0x5b6492[_0xcd0dd1]={'$like':'%'+_0x40450b[_0x3068('0x40')][_0x3068('0x4c')]+'%'};return _0x5b6492;})});}if(_0x40450b[_0x3068('0x40')][_0x3068('0x6a')]){var _0x38b2b5=_0x40450b[_0x3068('0x40')][_0x3068('0x6a')][_0x3068('0x6b')](',');var _0x116241={};_0x116241[_0x38b2b5[0x0]]={'$gte':moment(_0x38b2b5[0x1])[_0x3068('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x491cf6['where']=_['merge'](_0x491cf6['where'],_0x116241);}_0x491cf6=_[_0x3068('0x4d')]({},_0x491cf6,_0x40450b[_0x3068('0x56')]);return _0x1260ba['getMessages'](_0x491cf6);}})[_0x3068('0x22')](function(_0x236be1){if(_0x236be1){_0x4ad40d=_0x236be1[_0x3068('0x55')];if(!_0x40450b[_0x3068('0x40')][_0x3068('0x45')](_0x3068('0x46'))){_0x491cf6[_0x3068('0x47')]=qs['limit'](_0x40450b[_0x3068('0x40')][_0x3068('0x47')]);_0x491cf6[_0x3068('0x31')]=qs[_0x3068('0x31')](_0x40450b[_0x3068('0x40')][_0x3068('0x31')]);}return _0x1260ba[_0x3068('0x68')](_0x491cf6);}})[_0x3068('0x22')](function(_0x41555c){if(_0x41555c){return _0x41555c?{'count':_0x4ad40d,'rows':_0x41555c}:null;}})[_0x3068('0x22')](respondWithResult(_0x1b057a,null))[_0x3068('0x2c')](handleError(_0x1b057a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 34b7967..79312ef 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 _0xe493=['hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4d0d77,_0x5723de){var _0x56a9f4=function(_0x3dd5ab){while(--_0x3dd5ab){_0x4d0d77['push'](_0x4d0d77['shift']());}};_0x56a9f4(++_0x5723de);}(_0xe493,0x192));var _0x3e49=function(_0x3c3535,_0x7789ff){_0x3c3535=_0x3c3535-0x0;var _0x22d376=_0xe493[_0x3c3535];return _0x22d376;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x3e49('0x0'))['db'][_0x3e49('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3e49('0x2')](0x0);var events={'afterCreate':_0x3e49('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x295df8){return function(_0x1826f6,_0x558b78,_0x39934f){ChatGroupEvents[_0x3e49('0x4')](_0x295df8+':'+_0x1826f6['id'],_0x1826f6);ChatGroupEvents[_0x3e49('0x4')](_0x295df8,_0x1826f6);_0x39934f(null);};}for(var e in events){if(events[_0x3e49('0x5')](e)){var event=events[e];ChatGroup[_0x3e49('0x6')](e,emitEvent(event));}}module[_0x3e49('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf7e4=['hook','events','../../mysqldb','ChatGroup','setMaxListeners','emit'];(function(_0x45ce08,_0x59dcc7){var _0x23dff2=function(_0x1ad0e5){while(--_0x1ad0e5){_0x45ce08['push'](_0x45ce08['shift']());}};_0x23dff2(++_0x59dcc7);}(_0xf7e4,0x1bd));var _0x4f7e=function(_0x8cef2d,_0x3a5c6c){_0x8cef2d=_0x8cef2d-0x0;var _0x1cb597=_0xf7e4[_0x8cef2d];return _0x1cb597;};'use strict';var EventEmitter=require(_0x4f7e('0x0'));var ChatGroup=require(_0x4f7e('0x1'))['db'][_0x4f7e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4f7e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32f4ce){return function(_0x53ac4b,_0x41e26a,_0x1d4edd){ChatGroupEvents[_0x4f7e('0x4')](_0x32f4ce+':'+_0x53ac4b['id'],_0x53ac4b);ChatGroupEvents['emit'](_0x32f4ce,_0x53ac4b);_0x1d4edd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4f7e('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 8dee79d..4ef11e1 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 _0x5e11=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup'];(function(_0x496926,_0x2130a1){var _0x337701=function(_0xce62a1){while(--_0xce62a1){_0x496926['push'](_0x496926['shift']());}};_0x337701(++_0x2130a1);}(_0x5e11,0x1c3));var _0x15e1=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x5e11[_0x20cf8a];return _0x54e165;};'use strict';var _=require(_0x15e1('0x0'));var util=require('util');var logger=require(_0x15e1('0x1'))(_0x15e1('0x2'));var moment=require(_0x15e1('0x3'));var BPromise=require(_0x15e1('0x4'));var rp=require(_0x15e1('0x5'));var fs=require('fs');var path=require(_0x15e1('0x6'));var rimraf=require('rimraf');var config=require(_0x15e1('0x7'));var attributes=require('./chatGroup.attributes');module[_0x15e1('0x8')]=function(_0x41b56c,_0xa0d783){return _0x41b56c[_0x15e1('0x9')](_0x15e1('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6726=['../../config/logger','moment','bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util'];(function(_0x53a72c,_0xc9f802){var _0x56b41b=function(_0x354562){while(--_0x354562){_0x53a72c['push'](_0x53a72c['shift']());}};_0x56b41b(++_0xc9f802);}(_0x6726,0xdb));var _0x6672=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x6726[_0x3acee8];return _0x5046cc;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var logger=require(_0x6672('0x1'))('api');var moment=require(_0x6672('0x2'));var BPromise=require(_0x6672('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6672('0x4'));var rimraf=require('rimraf');var config=require(_0x6672('0x5'));var attributes=require(_0x6672('0x6'));module[_0x6672('0x7')]=function(_0x40ba7e,_0x5701b9){return _0x40ba7e[_0x6672('0x8')](_0x6672('0x9'),attributes,{'tableName':_0x6672('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 13f6cf0..1d0ea85 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 _0x435d=['info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x2de91a,_0x542708){var _0x49d0b8=function(_0x2e4bcf){while(--_0x2e4bcf){_0x2de91a['push'](_0x2de91a['shift']());}};_0x49d0b8(++_0x542708);}(_0x435d,0x1e4));var _0xd435=function(_0x386a5c,_0x41fdad){_0x386a5c=_0x386a5c-0x0;var _0x2bec7f=_0x435d[_0x386a5c];return _0x2bec7f;};'use strict';var _=require(_0xd435('0x0'));var util=require('util');var moment=require(_0xd435('0x1'));var BPromise=require(_0xd435('0x2'));var rs=require(_0xd435('0x3'));var fs=require('fs');var Redis=require(_0xd435('0x4'));var db=require(_0xd435('0x5'))['db'];var utils=require(_0xd435('0x6'));var logger=require(_0xd435('0x7'))(_0xd435('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd435('0x9')][_0xd435('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd435('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd435('0xc'))(new Redis(config[_0xd435('0xb')]));require(_0xd435('0xd'))[_0xd435('0xe')](socket);function respondWithRpcPromise(_0x5d91b8,_0x1ba164,_0x4ed600){return new BPromise(function(_0x44c442,_0x2b96bb){return client[_0xd435('0xf')](_0x5d91b8,_0x4ed600)['then'](function(_0x2d34da){logger[_0xd435('0x10')](_0xd435('0x11'),_0x1ba164,'request\x20sent');logger[_0xd435('0x12')](_0xd435('0x13'),_0x1ba164,'request\x20sent',JSON[_0xd435('0x14')](_0x2d34da));if(_0x2d34da[_0xd435('0x15')]){if(_0x2d34da[_0xd435('0x15')]['code']===0x1f4){logger[_0xd435('0x15')](_0xd435('0x11'),_0x1ba164,_0x2d34da['error']['message']);return _0x2b96bb(_0x2d34da[_0xd435('0x15')][_0xd435('0x16')]);}logger[_0xd435('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1ba164,_0x2d34da[_0xd435('0x15')]['message']);return _0x44c442(_0x2d34da[_0xd435('0x15')]['message']);}else{logger['info'](_0xd435('0x11'),_0x1ba164,_0xd435('0x17'));_0x44c442(_0x2d34da['result'][_0xd435('0x16')]);}})[_0xd435('0x18')](function(_0x4eaaad){logger[_0xd435('0x15')](_0xd435('0x11'),_0x1ba164,_0x4eaaad);_0x2b96bb(_0x4eaaad);});});}
\ No newline at end of file
+var _0x6596=['ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x34c034,_0x1fd53d){var _0x34b080=function(_0x42e647){while(--_0x42e647){_0x34c034['push'](_0x34c034['shift']());}};_0x34b080(++_0x1fd53d);}(_0x6596,0x86));var _0x6659=function(_0x50e01e,_0x4eb6b0){_0x50e01e=_0x50e01e-0x0;var _0x123147=_0x6596[_0x50e01e];return _0x123147;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var moment=require('moment');var BPromise=require(_0x6659('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6659('0x3'));var db=require(_0x6659('0x4'))['db'];var utils=require(_0x6659('0x5'));var logger=require(_0x6659('0x6'))(_0x6659('0x7'));var config=require(_0x6659('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6659('0x9')][_0x6659('0xa')]({'port':0x232a});config[_0x6659('0xb')]=_[_0x6659('0xc')](config[_0x6659('0xb')],{'host':_0x6659('0xd'),'port':0x18eb});var socket=require(_0x6659('0xe'))(new Redis(config[_0x6659('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x4d7fd2,_0x2ac572,_0x3fe585){return new BPromise(function(_0x2b5b9a,_0x4d9c8c){return client[_0x6659('0xf')](_0x4d7fd2,_0x3fe585)[_0x6659('0x10')](function(_0x2bc732){logger[_0x6659('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2ac572,'request\x20sent');logger[_0x6659('0x12')](_0x6659('0x13'),_0x2ac572,_0x6659('0x14'),JSON['stringify'](_0x2bc732));if(_0x2bc732[_0x6659('0x15')]){if(_0x2bc732[_0x6659('0x15')]['code']===0x1f4){logger['error'](_0x6659('0x16'),_0x2ac572,_0x2bc732['error'][_0x6659('0x17')]);return _0x4d9c8c(_0x2bc732['error'][_0x6659('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x2ac572,_0x2bc732[_0x6659('0x15')][_0x6659('0x17')]);return _0x2b5b9a(_0x2bc732[_0x6659('0x15')]['message']);}else{logger[_0x6659('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2ac572,_0x6659('0x14'));_0x2b5b9a(_0x2bc732[_0x6659('0x18')][_0x6659('0x17')]);}})[_0x6659('0x19')](function(_0xd1a453){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2ac572,_0xd1a453);_0x4d9c8c(_0xd1a453);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index dd1ebf9..797a4c9 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 _0xc852=['./chatGroup.events','save','emit','removeListener'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc852,0xc8));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};'use strict';var ChatGroupEvents=require(_0x2c85('0x0'));var events=[_0x2c85('0x1'),'remove','update'];function createListener(_0x37514f,_0x334845){return function(_0x2ab237){_0x334845[_0x2c85('0x2')](_0x37514f,_0x2ab237);};}function removeListener(_0x58f9a0,_0x3b0748){return function(){ChatGroupEvents[_0x2c85('0x3')](_0x58f9a0,_0x3b0748);};}exports['register']=function(_0x51fae4){for(var _0x3a478b=0x0,_0x274246=events['length'];_0x3a478b<_0x274246;_0x3a478b++){var _0x2f3034=events[_0x3a478b];var _0x145c72=createListener('chatGroup:'+_0x2f3034,_0x51fae4);ChatGroupEvents['on'](_0x2f3034,_0x145c72);}};
\ No newline at end of file
+var _0x2805=['length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x1a397a,_0x27201a){var _0x1eab9e=function(_0x1cbd61){while(--_0x1cbd61){_0x1a397a['push'](_0x1a397a['shift']());}};_0x1eab9e(++_0x27201a);}(_0x2805,0x86));var _0x5280=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x2805[_0x49d41c];return _0xb64c5f;};'use strict';var ChatGroupEvents=require(_0x5280('0x0'));var events=['save',_0x5280('0x1'),_0x5280('0x2')];function createListener(_0x35ccd7,_0x14aa09){return function(_0x124060){_0x14aa09[_0x5280('0x3')](_0x35ccd7,_0x124060);};}function removeListener(_0x53af93,_0x48df52){return function(){ChatGroupEvents['removeListener'](_0x53af93,_0x48df52);};}exports['register']=function(_0x3f9013){for(var _0x7ebc50=0x0,_0x1f7fc5=events[_0x5280('0x4')];_0x7ebc50<_0x1f7fc5;_0x7ebc50++){var _0x3b82ad=events[_0x7ebc50];var _0x2b4f8b=createListener(_0x5280('0x5')+_0x3b82ad,_0x3f9013);ChatGroupEvents['on'](_0x3b82ad,_0x2b4f8b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 86b8fcc..e73977b 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 _0xd565=['update','delete','/:id','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id/unread','/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xd565,0xa6));var _0x5d56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd565[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x5d56('0x0'));var util=require(_0x5d56('0x1'));var path=require(_0x5d56('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d56('0x3'));var router=express[_0x5d56('0x4')]();var auth=require(_0x5d56('0x5'));var interaction=require(_0x5d56('0x6'));var config=require(_0x5d56('0x7'));var controller=require(_0x5d56('0x8'));router[_0x5d56('0x9')]('/',auth[_0x5d56('0xa')](),controller[_0x5d56('0xb')]);router[_0x5d56('0x9')](_0x5d56('0xc'),auth[_0x5d56('0xa')](),controller[_0x5d56('0xd')]);router[_0x5d56('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x5d56('0xe'),auth['isAuthenticated'](),controller['getUnread']);router[_0x5d56('0x9')](_0x5d56('0xf'),auth[_0x5d56('0xa')](),controller[_0x5d56('0x10')]);router['get']('/:id/messages',auth[_0x5d56('0xa')](),controller[_0x5d56('0x11')]);router[_0x5d56('0x12')]('/',auth[_0x5d56('0xa')](),controller[_0x5d56('0x13')]);router[_0x5d56('0x12')](_0x5d56('0xf'),auth[_0x5d56('0xa')](),controller['addMembers']);router['post'](_0x5d56('0x14'),auth[_0x5d56('0xa')](),controller[_0x5d56('0x15')]);router[_0x5d56('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5d56('0x17')]);router[_0x5d56('0x18')](_0x5d56('0x19'),auth[_0x5d56('0xa')](),controller['destroy']);router[_0x5d56('0x18')](_0x5d56('0xf'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x5d56('0x1a')]=router;
\ No newline at end of file
+var _0x46d2=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','multer'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x46d2,0xef));var _0x246d=function(_0x57e0c6,_0x30a1b3){_0x57e0c6=_0x57e0c6-0x0;var _0x376683=_0x46d2[_0x57e0c6];return _0x376683;};'use strict';var multer=require(_0x246d('0x0'));var util=require('util');var path=require(_0x246d('0x1'));var timeout=require(_0x246d('0x2'));var express=require(_0x246d('0x3'));var router=express[_0x246d('0x4')]();var auth=require(_0x246d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x246d('0x6'));var controller=require(_0x246d('0x7'));router[_0x246d('0x8')]('/',auth[_0x246d('0x9')](),controller['index']);router[_0x246d('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x246d('0xa'),auth[_0x246d('0x9')](),controller[_0x246d('0xb')]);router[_0x246d('0x8')](_0x246d('0xc'),auth[_0x246d('0x9')](),controller[_0x246d('0xd')]);router[_0x246d('0x8')](_0x246d('0xe'),auth[_0x246d('0x9')](),controller['getMembers']);router[_0x246d('0x8')](_0x246d('0xf'),auth[_0x246d('0x9')](),controller[_0x246d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x246d('0x11')]);router[_0x246d('0x12')]('/:id/members',auth[_0x246d('0x9')](),controller[_0x246d('0x13')]);router[_0x246d('0x12')]('/:id/messages',auth[_0x246d('0x9')](),controller[_0x246d('0x14')]);router[_0x246d('0x15')](_0x246d('0xa'),auth[_0x246d('0x9')](),controller[_0x246d('0x16')]);router[_0x246d('0x17')](_0x246d('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x246d('0x17')](_0x246d('0xe'),auth[_0x246d('0x9')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 9c64056..fe93c1e 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 _0x3fc6=['STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x54417c,_0x155f01){var _0x1462c0=function(_0x5d8c0f){while(--_0x5d8c0f){_0x54417c['push'](_0x54417c['shift']());}};_0x1462c0(++_0x155f01);}(_0x3fc6,0x159));var _0x63fc=function(_0x3fe9c3,_0x3d7996){_0x3fe9c3=_0x3fe9c3-0x0;var _0x4a5d2f=_0x3fc6[_0x3fe9c3];return _0x4a5d2f;};'use strict';var Sequelize=require(_0x63fc('0x0'));module[_0x63fc('0x1')]={'closed':{'type':Sequelize[_0x63fc('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x63fc('0x3')](_0x63fc('0x4'),_0x63fc('0x5')),'defaultValue':_0x63fc('0x4')},'ratingMessage':{'type':Sequelize[_0x63fc('0x6')]},'pathTranscript':{'type':Sequelize[_0x63fc('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x63fc('0x7')]},'note':{'type':Sequelize[_0x63fc('0x7')]},'browserName':{'type':Sequelize[_0x63fc('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x63fc('0x7')]},'osVersion':{'type':Sequelize[_0x63fc('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x63fc('0x7')]},'deviceType':{'type':Sequelize[_0x63fc('0x7')]},'referer':{'type':Sequelize[_0x63fc('0x6')]},'customerIp':{'type':Sequelize[_0x63fc('0x7')]},'formData':{'type':Sequelize[_0x63fc('0x6')](_0x63fc('0x8'))},'read1stAt':{'type':Sequelize[_0x63fc('0x9')]},'lastMsgAt':{'type':Sequelize[_0x63fc('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x63fc('0x3')]('in',_0x63fc('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x63fc('0x7')]}};
\ No newline at end of file
+var _0x96e0=['star','thumb','TEXT','STRING','DATE','ENUM','sequelize','BOOLEAN'];(function(_0x12aa02,_0x116599){var _0x3deddd=function(_0x589861){while(--_0x589861){_0x12aa02['push'](_0x12aa02['shift']());}};_0x3deddd(++_0x116599);}(_0x96e0,0x7e));var _0x096e=function(_0x305b74,_0x4ac6b7){_0x305b74=_0x305b74-0x0;var _0x57f623=_0x96e0[_0x305b74];return _0x57f623;};'use strict';var Sequelize=require(_0x096e('0x0'));module['exports']={'closed':{'type':Sequelize[_0x096e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x096e('0x2'),_0x096e('0x3')),'defaultValue':_0x096e('0x2')},'ratingMessage':{'type':Sequelize[_0x096e('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x096e('0x5')]},'note':{'type':Sequelize[_0x096e('0x5')]},'browserName':{'type':Sequelize[_0x096e('0x5')]},'browserVersion':{'type':Sequelize[_0x096e('0x5')]},'osName':{'type':Sequelize[_0x096e('0x5')]},'osVersion':{'type':Sequelize[_0x096e('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x096e('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x096e('0x4')]},'customerIp':{'type':Sequelize[_0x096e('0x5')]},'formData':{'type':Sequelize[_0x096e('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x096e('0x6')]},'lastMsgAt':{'type':Sequelize[_0x096e('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x096e('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x096e('0x5')]},'customerPort':{'type':Sequelize[_0x096e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 07312f0..ab26c7a 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 _0x2f8e=['includeAgent','addTags','spread','Tag','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','Contact','lastName','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','30px','
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Chat','mkdirSync','Account','N.A.','closedAt','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','server','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','offset','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','Users','map','Tags','TagIds','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','filter','isNil','isEmpty','ChatWebsiteId','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','t.id\x20IN\x20?','sequelize','count','keyBy','merge','Account.mandatoryDisposition','i.*','c.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','basename','file','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','server/files/attachments/','close','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','ChatWebsite','CmContact','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','fullname','%s%d','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','service','port','secure','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages'];(function(_0x524b2a,_0x13e281){var _0x176cc5=function(_0x5c9851){while(--_0x5c9851){_0x524b2a['push'](_0x524b2a['shift']());}};_0x176cc5(++_0x13e281);}(_0x2f8e,0x14d));var _0xe2f8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f8e[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0xe2f8('0x0'));var emlformat=require(_0xe2f8('0x1'));var rimraf=require(_0xe2f8('0x2'));var zipdir=require(_0xe2f8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2f8('0x4'));var moment=require(_0xe2f8('0x5'));var BPromise=require(_0xe2f8('0x6'));var Mustache=require(_0xe2f8('0x7'));var util=require('util');var path=require(_0xe2f8('0x8'));var sox=require(_0xe2f8('0x9'));var csv=require('to-csv');var ejs=require(_0xe2f8('0xa'));var fs=require('fs');var _=require(_0xe2f8('0xb'));var squel=require(_0xe2f8('0xc'));var crypto=require(_0xe2f8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe2f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe2f8('0xf'));var Papa=require('papaparse');var Redis=require(_0xe2f8('0x10'));var authService=require(_0xe2f8('0x11'));var qs=require(_0xe2f8('0x12'));var as=require(_0xe2f8('0x13'));var hardwareService=require(_0xe2f8('0x14'));var logger=require('../../config/logger')(_0xe2f8('0x15'));var utils=require('../../config/utils');var config=require(_0xe2f8('0x16'));var db=require(_0xe2f8('0x17'))['db'];config[_0xe2f8('0x18')]=_[_0xe2f8('0x19')](config['redis'],{'host':_0xe2f8('0x1a'),'port':0x18eb});var socket=require(_0xe2f8('0x1b'))(new Redis(config[_0xe2f8('0x18')]));require('./chatInteraction.socket')[_0xe2f8('0x1c')](socket);var jayson=require(_0xe2f8('0x1d'));var client=jayson[_0xe2f8('0x1e')][_0xe2f8('0x1f')]({'port':0x232b});var client9004=jayson[_0xe2f8('0x1e')][_0xe2f8('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x3ef99a,_0xca33c4,_0x3cc6d8){if(_0x3cc6d8){var _0x25f1a7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25f1a7['test'](_0xca33c4)){return _0x3ef99a;}else{throw new Error(_0xe2f8('0x20'));}}else{return _0x3ef99a;}}function respondWithRpcPromise(_0x5de415,_0x567a2e,_0x6693e2,_0x3f9493){return new BPromise(function(_0x3155ae,_0x27e153){var _0x18106b=_0x3f9493||client;return _0x18106b['request'](_0x5de415,_0x6693e2)[_0xe2f8('0x21')](function(_0x383050){logger[_0xe2f8('0x22')](_0xe2f8('0x23'),_0x567a2e,_0xe2f8('0x24'));logger[_0xe2f8('0x25')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x567a2e,_0xe2f8('0x24'),JSON[_0xe2f8('0x26')](_0x383050));if(_0x383050[_0xe2f8('0x27')]){if(_0x383050[_0xe2f8('0x27')][_0xe2f8('0x28')]===0x1f4){logger['error'](_0xe2f8('0x23'),_0x567a2e,_0x383050[_0xe2f8('0x27')][_0xe2f8('0x29')]);return _0x27e153(_0x383050['error'][_0xe2f8('0x29')]);}logger[_0xe2f8('0x27')](_0xe2f8('0x23'),_0x567a2e,_0x383050['error'][_0xe2f8('0x29')]);return _0x3155ae(_0x383050[_0xe2f8('0x27')]['message']);}else{logger['info'](_0xe2f8('0x23'),_0x567a2e,'request\x20sent');_0x3155ae(_0x383050['result']['message']);}})[_0xe2f8('0x2a')](function(_0xe3388e){logger[_0xe2f8('0x27')](_0xe2f8('0x23'),_0x567a2e,_0xe3388e);_0x27e153(_0xe3388e);});});}function respondWithStatusCode(_0x222d24,_0x7a78ba){_0x7a78ba=_0x7a78ba||0xcc;return function(_0x2966db){if(_0x2966db){return _0x222d24['sendStatus'](_0x7a78ba);}return _0x222d24[_0xe2f8('0x2b')](_0x7a78ba)[_0xe2f8('0x2c')]();};}function respondWithResult(_0x1b2fb7,_0x5de0df){_0x5de0df=_0x5de0df||0xc8;return function(_0x4114cb){if(_0x4114cb){return _0x1b2fb7[_0xe2f8('0x2b')](_0x5de0df)['json'](_0x4114cb);}};}function respondWithFilteredResult(_0x5eb611,_0x25cf83){return function(_0x40f9ef){if(_0x40f9ef){var _0x86c6c1=_0x40f9ef['count'],_0x3d44ec=_0x25cf83[_0xe2f8('0x2d')],_0x13f832=_0x25cf83[_0xe2f8('0x2d')]+_0x25cf83['limit'],_0x26ec72;if(_0x13f832>=_0x86c6c1){_0x13f832=_0x86c6c1;_0x26ec72=0xc8;}else{_0x26ec72=0xce;}_0x5eb611[_0xe2f8('0x2b')](_0x26ec72);return _0x5eb611[_0xe2f8('0x2e')](_0xe2f8('0x2f'),_0x3d44ec+'-'+_0x13f832+'/'+_0x86c6c1)[_0xe2f8('0x30')](_0x40f9ef);}return null;};}function patchUpdates(_0x1f0f15){return function(_0x58d281){try{jsonpatch['apply'](_0x58d281,_0x1f0f15,!![]);}catch(_0x28f4ad){return BPromise[_0xe2f8('0x31')](_0x28f4ad);}return _0x58d281[_0xe2f8('0x32')]();};}function saveUpdates(_0x3012c4,_0xdb7bd8){return function(_0x428e6b){if(_0x428e6b){return _0x428e6b[_0xe2f8('0x33')](_0x3012c4)[_0xe2f8('0x21')](function(_0x5c1d4a){return _0x5c1d4a;});}return null;};}function removeEntity(_0x513f5c,_0x4fd620){return function(_0x5defdf){if(_0x5defdf){return _0x5defdf[_0xe2f8('0x34')]()[_0xe2f8('0x21')](function(){_0x513f5c[_0xe2f8('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x426c3f,_0x14a8d7){return function(_0x279eab){if(!_0x279eab){_0x426c3f[_0xe2f8('0x35')](0x194);}return _0x279eab;};}function handleError(_0x583cd3,_0x18cf73){_0x18cf73=_0x18cf73||0x1f4;return function(_0x298ec1){logger[_0xe2f8('0x27')](_0x298ec1[_0xe2f8('0x36')]);if(_0x298ec1[_0xe2f8('0x37')]){delete _0x298ec1['name'];}_0x583cd3['status'](_0x18cf73)['send'](_0x298ec1);};}function getInteractionUsers(_0x41f1f3,_0x4b0d56){return new BPromise(function(_0x38f703,_0x10c75e){try{if(_0x4b0d56[_0x41f1f3['id']]){_0x41f1f3[_0xe2f8('0x38')]=_[_0xe2f8('0x39')](_0x4b0d56[_0x41f1f3['id']],function(_0x363c48){return{'id':_0x363c48['id']};});}}catch(_0x4a72b3){_0x10c75e(_0x4a72b3);}_0x38f703(_0x41f1f3);});}function getInteractionTags(_0x397a79,_0x35f0b9){return new BPromise(function(_0x5634ce,_0x15e899){try{if(_0x397a79['TagIds']){_0x397a79[_0xe2f8('0x3a')]=[];_0x397a79[_0xe2f8('0x3b')][_0xe2f8('0x3c')](',')[_0xe2f8('0x3d')](function(_0x4ae6ec){_0x397a79[_0xe2f8('0x3a')][_0xe2f8('0x3e')](_0x35f0b9[_0x4ae6ec]);});}delete _0x397a79[_0xe2f8('0x3b')];}catch(_0x1350db){_0x15e899(_0x1350db);}_0x5634ce(_0x397a79);});}function updateChatInteraction(_0x347e44,_0xef8916,_0x3b3d6d){return new BPromise(function(_0x4f7e0e,_0x572eb2){return getInteractionUsers(_0x347e44,_0x3b3d6d)['then'](function(_0x3fa879){return getInteractionTags(_0x3fa879,_0xef8916);})[_0xe2f8('0x21')](function(_0x25a619){_0x4f7e0e(_0x25a619);})[_0xe2f8('0x2a')](function(_0x676fbb){_0x572eb2(_0x676fbb);});});}exports[_0xe2f8('0x3f')]=function(_0x2c5765,_0x121078){var _0x1ddb67={},_0x954a0={},_0x260397={'count':0x0,'rows':[]};var _0x3f6416=_['map'](db[_0xe2f8('0x40')][_0xe2f8('0x41')],function(_0xacdbec){return{'name':_0xacdbec[_0xe2f8('0x42')],'type':_0xacdbec[_0xe2f8('0x43')][_0xe2f8('0x44')]};});_0x954a0['model']=_[_0xe2f8('0x39')](_0x3f6416,'name');_0x954a0[_0xe2f8('0x45')]=_['keys'](_0x2c5765['query']);_0x954a0[_0xe2f8('0x46')]=_[_0xe2f8('0x47')](_0x954a0['model'],_0x954a0[_0xe2f8('0x45')]);_0x1ddb67[_0xe2f8('0x48')]=_[_0xe2f8('0x47')](_0x954a0[_0xe2f8('0x49')],qs[_0xe2f8('0x4a')](_0x2c5765['query'][_0xe2f8('0x4a')]));_0x1ddb67[_0xe2f8('0x48')]=_0x1ddb67[_0xe2f8('0x48')][_0xe2f8('0x4b')]?_0x1ddb67['attributes']:_0x954a0[_0xe2f8('0x49')];if(!_0x2c5765['query'][_0xe2f8('0x4c')](_0xe2f8('0x4d'))){_0x1ddb67['limit']=qs['limit'](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x4e')]);_0x1ddb67['offset']=qs[_0xe2f8('0x2d')](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x2d')]);}_0x1ddb67[_0xe2f8('0x4f')]=qs[_0xe2f8('0x50')](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x50')]);_0x1ddb67[_0xe2f8('0x51')]=qs['filters'](_['pick'](_0x2c5765[_0xe2f8('0x45')],_0x954a0[_0xe2f8('0x46')]));var _0x4446b7=[];var _0x4da377=squel[_0xe2f8('0x52')]()[_0xe2f8('0x53')]('id')[_0xe2f8('0x53')](_0xe2f8('0x37'))['field'](_0xe2f8('0x54'))[_0xe2f8('0x55')](_0xe2f8('0x56'));var _0x14fcff=squel[_0xe2f8('0x52')]()[_0xe2f8('0x53')]('u.id')['field'](_0xe2f8('0x57'))[_0xe2f8('0x55')](_0xe2f8('0x58'),'ui')[_0xe2f8('0x59')](_0xe2f8('0x5a'),'u',_0xe2f8('0x5b'));var _0xcc69e0=squel[_0xe2f8('0x52')]()[_0xe2f8('0x55')]('chat_interactions','i')['left_join'](_0xe2f8('0x5c'),'c',_0xe2f8('0x5d'))[_0xe2f8('0x59')]('users','o',_0xe2f8('0x5e'))[_0xe2f8('0x59')]('chat_websites','a',_0xe2f8('0x5f'))[_0xe2f8('0x59')](_0xe2f8('0x60'),'me',_0xe2f8('0x61'))[_0xe2f8('0x59')](_0xe2f8('0x62'),'it',_0xe2f8('0x63'))[_0xe2f8('0x59')](_0xe2f8('0x56'),'t',_0xe2f8('0x64'));var _0x2d6176=squel[_0xe2f8('0x65')]();var _0x59d472=[];var _0x19e610=squel[_0xe2f8('0x65')]();if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x66')]){var _0x519417=as[_0xe2f8('0x67')](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x66')]);var _0x2d8eb3=_0x519417[_0xe2f8('0x68')];for(var _0x1860cf=0x0;_0x1860cf<_0x519417['conditions'][_0xe2f8('0x4b')];_0x1860cf++){var _0x1c066c=_0x519417[_0xe2f8('0x69')][_0x1860cf];var _0x524eff='i';var _0x38d8c7=_[_0xe2f8('0x6a')](_0x3f6416,['name',_0x1c066c[_0xe2f8('0x53')]]);if(!_0x38d8c7){switch(_0x1c066c[_0xe2f8('0x53')]){case _0xe2f8('0x6b'):if(_0x1c066c[_0xe2f8('0x6c')]==0x1){_0xcc69e0['having']('`'+_0x1c066c[_0xe2f8('0x53')]+_0xe2f8('0x6d'));}else{_0xcc69e0[_0xe2f8('0x6e')]('`'+_0x1c066c[_0xe2f8('0x53')]+_0xe2f8('0x6f'));}break;case'Contact':if(_0x1c066c[_0xe2f8('0x70')]===_0xe2f8('0x71')){_0x2d6176[_0x2d8eb3](_0xe2f8('0x72'),_0x1c066c[_0xe2f8('0x6c')],null);}else{_0x38d8c7=_[_0xe2f8('0x6a')](_0x3f6416,[_0xe2f8('0x37'),_0xe2f8('0x73')]);_0x1c066c[_0xe2f8('0x53')]=_0xe2f8('0x73');_0x4cadd1=as[_0xe2f8('0x74')](_0x524eff,_0x38d8c7['type'],_0x1c066c);_0x2d6176[_0x2d8eb3](_0x4cadd1[_0xe2f8('0x75')],_0x4cadd1[_0xe2f8('0x6c')][_0xe2f8('0x76')],_0x4cadd1[_0xe2f8('0x6c')][_0xe2f8('0x2c')]);}break;case'Tag':var _0x110b6d=_0x1c066c[_0xe2f8('0x6c')]['split'](',')[_0xe2f8('0x39')](function(_0x75dd8a){return Number(_0x75dd8a);});_0x110b6d[_0xe2f8('0x3d')](function(_0x153581){_0x19e610['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x153581+',%');});_0x59d472=_[_0xe2f8('0x77')](_0x59d472,_0x110b6d);break;case _0xe2f8('0x78'):if(_0x1c066c[_0xe2f8('0x70')]===_0xe2f8('0x71')){_0x2d6176[_0x2d8eb3](_0xe2f8('0x79'),'%'+_0x1c066c[_0xe2f8('0x6c')]+'%',null);}else{_0x38d8c7=_[_0xe2f8('0x6a')](_0x3f6416,[_0xe2f8('0x37'),_0xe2f8('0x7a')]);_0x1c066c['field']='UserId';_0x4cadd1=as[_0xe2f8('0x74')](_0x524eff,_0x38d8c7['type'],_0x1c066c);_0x2d6176[_0x2d8eb3](_0x4cadd1[_0xe2f8('0x75')],_0x4cadd1[_0xe2f8('0x6c')][_0xe2f8('0x76')],_0x4cadd1[_0xe2f8('0x6c')]['end']);}break;}}else{var _0x4cadd1=as[_0xe2f8('0x74')](_0x524eff,_0x38d8c7['type'],_0x1c066c);_0x2d6176[_0x2d8eb3](_0x4cadd1['text'],_0x4cadd1['value'][_0xe2f8('0x76')],_0x4cadd1['value']['end']);}}}else{var _0x2031bf=_(Object[_0xe2f8('0x7b')](_0x2c5765[_0xe2f8('0x45')]))[_0xe2f8('0x39')](function(_0x1ccdd8){return _0x3f6416['hasOwnProperty'](_0x1ccdd8)?_0x1ccdd8:undefined;})[_0xe2f8('0x7c')](function(_0x4695cd){return!_[_0xe2f8('0x7d')](_0x4695cd);})[_0xe2f8('0x6c')]();if(!_[_0xe2f8('0x7e')](_0x2031bf)){_0x2031bf[_0xe2f8('0x3d')](function(_0x1b54b0){if(_0x1b54b0===_0xe2f8('0x7f')){_0xcc69e0[_0xe2f8('0x51')]('i.ChatWebsiteId\x20IN\x20?',[][_0xe2f8('0x80')](_0x2c5765[_0xe2f8('0x45')][_0x1b54b0]));}else if(_0x1b54b0===_0xe2f8('0x81')){var _0x323423=JSON[_0xe2f8('0x82')](_0x2c5765[_0xe2f8('0x45')][_0x1b54b0])['$gte'];var _0x1a27c5=JSON[_0xe2f8('0x82')](_0x2c5765['query'][_0x1b54b0])[_0xe2f8('0x83')];_0xcc69e0[_0xe2f8('0x51')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x323423,_0x1a27c5);}else{if(_0x2c5765[_0xe2f8('0x45')][_0x1b54b0]===_0xe2f8('0x84')){_0xcc69e0[_0xe2f8('0x51')]('i.'+_0x1b54b0+_0xe2f8('0x85'));}else{_0xcc69e0[_0xe2f8('0x51')]('i.'+_0x1b54b0+_0xe2f8('0x86'),_0x2c5765[_0xe2f8('0x45')][_0x1b54b0]);}}});}if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x87')]){if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x87')]==0x1){_0xcc69e0[_0xe2f8('0x6e')]('`unreadMessages`\x20=\x200');}else{_0xcc69e0['having'](_0xe2f8('0x88'));}}if(_0x2c5765[_0xe2f8('0x45')]['tag']){_0x59d472=_[_0xe2f8('0x89')](_0x2c5765['query'][_0xe2f8('0x8a')])?_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x8a')]:new Array(_0x2c5765['query'][_0xe2f8('0x8a')]);_0x59d472[_0xe2f8('0x3d')](function(_0x1c89d9){_0x19e610['or'](_0xe2f8('0x8b'),'%,'+_0x1c89d9+',%');});}if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x7c')]){var _0xb2bdec=_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x7c')]['replace']('\x5c','\x5c\x5c')[_0xe2f8('0x8c')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xe2f8('0x8d')](_0xb2bdec)){_0x2d6176['or'](_0xe2f8('0x8e'),_0xb2bdec+'%');}else{var _0x2c354b=[];_0xb2bdec[_0xe2f8('0x3c')]('\x20')[_0xe2f8('0x3d')](function(_0x291661){_0x2c354b[_0xe2f8('0x3e')]('+'+_0x291661[_0xe2f8('0x8f')]());});var _0x2d8ff1=_0x2c354b[_0xe2f8('0x90')]('\x20');_0x2d6176['or'](_0xe2f8('0x91'),_0x2d8ff1)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xb2bdec+'%');}}}_0xcc69e0[_0xe2f8('0x51')](_0x2d6176);_0xcc69e0['group']('i.id');var _0x531b0e={'type':db[_0xe2f8('0x92')][_0xe2f8('0x93')][_0xe2f8('0x94')],'raw':!![]};var _0x216af0=_0xcc69e0[_0xe2f8('0x95')]();_0x216af0[_0xe2f8('0x53')](_0xe2f8('0x96'));_0x216af0[_0xe2f8('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1ddb67[_0xe2f8('0x4f')]){_0x1ddb67[_0xe2f8('0x4f')][_0xe2f8('0x3d')](function(_0x5942bc){_0xcc69e0[_0xe2f8('0x4f')]('i.'+_0x5942bc[0x0],_0x5942bc[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe2f8('0x7e')](_0x59d472)){_0xcc69e0[_0xe2f8('0x6e')](_0x19e610);_0x216af0['where'](_0xe2f8('0x97'),_0x59d472);}db[_0xe2f8('0x98')][_0xe2f8('0x45')](_0x216af0[_0xe2f8('0x8f')](),_0x531b0e)[_0xe2f8('0x21')](function(_0xdc5835){_0x260397[_0xe2f8('0x99')]=_0xdc5835[_0xe2f8('0x4b')];if(_0x260397[_0xe2f8('0x99')]===0x0)return[];return db[_0xe2f8('0x98')][_0xe2f8('0x45')](_0x4da377[_0xe2f8('0x8f')](),_0x531b0e)[_0xe2f8('0x21')](function(_0xcdaa82){_0x4446b7=_[_0xe2f8('0x9a')](_0xcdaa82,'id');_0x531b0e=_[_0xe2f8('0x9b')](_0x531b0e,{'model':db[_0xe2f8('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xcc69e0[_0xe2f8('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2f8('0x6b'));_0xcc69e0['field']('a.key','Account.key');_0xcc69e0[_0xe2f8('0x53')]('a.mandatoryDisposition',_0xe2f8('0x9c'));_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0x9d'));_0xcc69e0['field']('c.firstName','Contact.firstName');_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0x9e'),'Contact.lastName');_0xcc69e0[_0xe2f8('0x53')]('c.email',_0xe2f8('0x9f'));_0xcc69e0['field']('c.phone',_0xe2f8('0xa0'));_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0xa1'),_0xe2f8('0xa2'));_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0xa3'),_0xe2f8('0xa4'));_0xcc69e0['field'](_0xe2f8('0xa5'),_0xe2f8('0x3b'));_0xcc69e0[_0xe2f8('0x4e')](_0x1ddb67[_0xe2f8('0x4e')]);_0xcc69e0['offset'](_0x1ddb67[_0xe2f8('0x2d')]);return db[_0xe2f8('0x98')]['query'](_0xcc69e0[_0xe2f8('0x8f')](),_0x531b0e);})['then'](function(_0x4ab72d){_0x14fcff[_0xe2f8('0x51')](_0xe2f8('0xa6'),_[_0xe2f8('0x39')](_0x4ab72d,'id'));return db[_0xe2f8('0x98')][_0xe2f8('0x45')](_0x14fcff[_0xe2f8('0x8f')](),_0x531b0e)[_0xe2f8('0x21')](function(_0x5ad0e3){var _0x4ddb8e=_[_0xe2f8('0xa7')](_0x5ad0e3,_0xe2f8('0xa8'));var _0x18c25e=[];_0x4ab72d[_0xe2f8('0x3d')](function(_0x3b0ccc){_0x18c25e[_0xe2f8('0x3e')](updateChatInteraction(_0x3b0ccc,_0x4446b7,_0x4ddb8e));});return BPromise[_0xe2f8('0xa9')](_0x18c25e);});});})['then'](function(_0x61b76e){_0x260397[_0xe2f8('0xaa')]=_0x61b76e;return _0x260397;})[_0xe2f8('0x21')](respondWithFilteredResult(_0x121078,_0x1ddb67))[_0xe2f8('0x2a')](handleError(_0x121078,null));};exports[_0xe2f8('0xab')]=function(_0x3e6a91,_0x2ce9e9){var _0x92cc9d={'raw':![],'where':{'id':_0x3e6a91[_0xe2f8('0xac')]['id']}},_0x28d84d={};_0x28d84d[_0xe2f8('0x49')]=_['keys'](db[_0xe2f8('0x40')][_0xe2f8('0x41')]);_0x28d84d['query']=_[_0xe2f8('0x7b')](_0x3e6a91[_0xe2f8('0x45')]);_0x28d84d['filters']=_['intersection'](_0x28d84d[_0xe2f8('0x49')],_0x28d84d[_0xe2f8('0x45')]);_0x92cc9d['attributes']=_[_0xe2f8('0x47')](_0x28d84d[_0xe2f8('0x49')],qs[_0xe2f8('0x4a')](_0x3e6a91[_0xe2f8('0x45')][_0xe2f8('0x4a')]));_0x92cc9d['attributes']=_0x92cc9d[_0xe2f8('0x48')][_0xe2f8('0x4b')]?_0x92cc9d['attributes']:_0x28d84d[_0xe2f8('0x49')];if(_0x3e6a91[_0xe2f8('0x45')][_0xe2f8('0xad')]){_0x92cc9d[_0xe2f8('0xae')]=[{'all':!![]}];}_0x92cc9d=_['merge']({},_0x92cc9d,_0x3e6a91[_0xe2f8('0xaf')]);return db[_0xe2f8('0x40')][_0xe2f8('0x6a')](_0x92cc9d)[_0xe2f8('0x21')](handleEntityNotFound(_0x2ce9e9,null))[_0xe2f8('0x21')](respondWithResult(_0x2ce9e9,null))[_0xe2f8('0x2a')](handleError(_0x2ce9e9,null));};exports['create']=function(_0x23d71b,_0x56b7e0){return db['ChatInteraction'][_0xe2f8('0xb0')](_0x23d71b[_0xe2f8('0xb1')],{})[_0xe2f8('0x21')](respondWithResult(_0x56b7e0,0xc9))['catch'](handleError(_0x56b7e0,null));};exports[_0xe2f8('0x33')]=function(_0x4fe60a,_0x3b7d34){if(_0x4fe60a[_0xe2f8('0xb1')]['id']){delete _0x4fe60a[_0xe2f8('0xb1')]['id'];}return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x4fe60a['params']['id']}})['then'](handleEntityNotFound(_0x3b7d34,null))[_0xe2f8('0x21')](saveUpdates(_0x4fe60a[_0xe2f8('0xb1')],null))[_0xe2f8('0x21')](respondWithResult(_0x3b7d34,null))[_0xe2f8('0x2a')](handleError(_0x3b7d34,null));};exports[_0xe2f8('0x34')]=function(_0x658e6e,_0x28da6d){return db['ChatInteraction'][_0xe2f8('0x6a')]({'where':{'id':_0x658e6e[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x28da6d,null))[_0xe2f8('0x21')](removeEntity(_0x28da6d,null))[_0xe2f8('0x2a')](handleError(_0x28da6d,null));};exports['describe']=function(_0x21edc8,_0x42d0f){return db[_0xe2f8('0x40')][_0xe2f8('0xb2')]()[_0xe2f8('0x21')](respondWithResult(_0x42d0f,null))[_0xe2f8('0x2a')](handleError(_0x42d0f,null));};exports['customUpdate']=function(_0x15681a,_0x16394b){if(_0x15681a[_0xe2f8('0xb1')]['id']){delete _0x15681a[_0xe2f8('0xb1')]['id'];}return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x15681a[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x16394b,null))['then'](saveUpdates(_0x15681a[_0xe2f8('0xb1')],null))[_0xe2f8('0x21')](respondWithResult(_0x16394b,null))['catch'](handleError(_0x16394b,null));};exports['abandon']=function(_0x579b65,_0x141a4c,_0x5e91f9){if(_0x579b65[_0xe2f8('0xb1')]['id']){delete _0x579b65['body']['id'];}return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x579b65['params']['id']}})[_0xe2f8('0x21')](function(_0x2481dd){if(!_0x2481dd){logger[_0xe2f8('0x27')](_0xe2f8('0xb3'),_0xe2f8('0xb4'),0x194,'entity\x20not\x20found');_0x141a4c[_0xe2f8('0x35')](0x194);}else{if(_0x2481dd[_0xe2f8('0x7a')]){throw new db['Sequelize'][(_0xe2f8('0xb5'))](_0xe2f8('0xb6'));}}return _0x2481dd;})[_0xe2f8('0x21')](function(_0x5549d0){if(_0x5549d0){return _0x5549d0[_0xe2f8('0x33')]({'closed':_0x579b65[_0xe2f8('0xb1')][_0xe2f8('0xb7')],'disposition':_0x579b65['body'][_0xe2f8('0xb8')]})[_0xe2f8('0x21')](function(_0x1925a9){return _0x1925a9;});}})[_0xe2f8('0x21')](function(_0x5f3d34){return respondWithRpcPromise(_0xe2f8('0xb9'),_0xe2f8('0xb4'),_0x579b65[_0xe2f8('0xb1')],client9004);})[_0xe2f8('0x21')](respondWithResult(_0x141a4c,null))[_0xe2f8('0x2a')](handleError(_0x141a4c,null));};exports[_0xe2f8('0xba')]=function(_0x491e3b,_0x13a5fd,_0x361a29){_0x491e3b['body'][_0xe2f8('0x37')]=_0x491e3b['file']['originalname'];_0x491e3b[_0xe2f8('0xb1')][_0xe2f8('0xbb')]=_0x491e3b[_0xe2f8('0xbc')][_0xe2f8('0xbd')];_0x491e3b[_0xe2f8('0xb1')][_0xe2f8('0x43')]=_0x491e3b['file'][_0xe2f8('0xbe')];return db[_0xe2f8('0xbf')][_0xe2f8('0xb0')](_0x491e3b[_0xe2f8('0xb1')])['then'](respondWithResult(_0x13a5fd,0xc9))[_0xe2f8('0x2a')](handleError(_0x13a5fd,null));};exports[_0xe2f8('0xc0')]=function(_0x56ecb7,_0x4973cf,_0x168e81){return db[_0xe2f8('0x40')][_0xe2f8('0xc1')]({'where':{'id':_0x56ecb7[_0xe2f8('0xac')]['id']},'raw':!![]})[_0xe2f8('0x21')](handleEntityNotFound(_0x4973cf,null))[_0xe2f8('0x21')](function(_0x1e970c){if(_0x1e970c){if(_0x1e970c['closed']){return _0x4973cf[_0xe2f8('0x2b')](0x193)[_0xe2f8('0x30')]({'status':0x193,'message':_0xe2f8('0xc2')});}return db[_0xe2f8('0xbf')][_0xe2f8('0xc1')]({'where':{'id':_0x56ecb7[_0xe2f8('0x45')][_0xe2f8('0xc3')]},'raw':!![]})[_0xe2f8('0x21')](handleEntityNotFound(_0x4973cf,null));}})[_0xe2f8('0x21')](function(_0xe3917c){if(_0xe3917c){return _0x4973cf[_0xe2f8('0xc4')](path[_0xe2f8('0x90')](config[_0xe2f8('0xc5')],_0xe2f8('0xc6'),_0xe3917c['basename']));}})[_0xe2f8('0x2a')](handleError(_0x4973cf,null));};exports[_0xe2f8('0xc7')]=function(_0x18e56c,_0x3788d8){var _0x57a095=null;var _0x502cdf=null;var _0x5e7793=null;var _0x492437=null;if(_0x18e56c['body']['id']){delete _0x18e56c[_0xe2f8('0xb1')]['id'];}if(_0x18e56c['body']['mailTranscript']){_0x492437=path[_0xe2f8('0x90')](config['root'],_0xe2f8('0xc8'),util[_0xe2f8('0xc9')]('transcript-%s.txt',Date[_0xe2f8('0xca')]()));_0x18e56c['body'][_0xe2f8('0xcb')]=_0x492437;}return db['ChatInteraction'][_0xe2f8('0x6a')]({'where':{'id':_0x18e56c[_0xe2f8('0xac')]['id']},'include':[{'model':db[_0xe2f8('0xcc')],'as':_0xe2f8('0xcd'),'include':[{'model':db[_0xe2f8('0x78')],'as':_0xe2f8('0x78')}]}]})[_0xe2f8('0x21')](handleEntityNotFound(_0x3788d8,null))[_0xe2f8('0x21')](saveUpdates(_0x18e56c[_0xe2f8('0xb1')],null))['then'](function(_0x3172d2){if(_0x3172d2){_0x57a095=_0x3172d2;return db[_0xe2f8('0xce')][_0xe2f8('0x6a')]({'where':{'id':_0x57a095['ChatWebsiteId']}});}})[_0xe2f8('0x21')](function(_0x5154c2){if(_0x5154c2){_0x5e7793=_0x5154c2;return db[_0xe2f8('0xcf')][_0xe2f8('0x6a')]({'where':{'id':_0x57a095[_0xe2f8('0x73')]}});}})[_0xe2f8('0x21')](function(_0x44039){if(_0x44039){_0x502cdf=_0x44039;if(_0x492437){var _0x1f8658=null;for(var _0x214738=0x1;_0x214738<_0x57a095['Messages'][_0xe2f8('0x4b')];++_0x214738){_0x1f8658=_0x57a095[_0xe2f8('0xcd')][_0x214738];var _0x1ee7ca=_0x1f8658['UserId']?util[_0xe2f8('0xc9')]('%s%d',_0x5e7793['agentAlias'],_0x1f8658[_0xe2f8('0x7a')]):_0xe2f8('0xd0');var _0x3827fd=_0x18e56c[_0xe2f8('0xb1')][_0xe2f8('0xd1')]||util[_0xe2f8('0xc9')]('%s%d',_0xe2f8('0xd2'),_0x1f8658[_0xe2f8('0x73')]);switch(_0x5e7793[_0xe2f8('0xd3')]){case _0xe2f8('0xd4'):_0x1ee7ca=_0x1f8658[_0xe2f8('0x7a')]?util[_0xe2f8('0xc9')]('%s%d',_0x5e7793[_0xe2f8('0xd5')],_0x1f8658[_0xe2f8('0x7a')]):_0xe2f8('0xd0');break;case _0xe2f8('0xd6'):_0x1ee7ca=_0x1f8658[_0xe2f8('0x7a')]?_0x1f8658[_0xe2f8('0x78')][_0xe2f8('0xd7')]||_0x1f8658[_0xe2f8('0x78')][_0xe2f8('0xd8')]:'System';break;case'agent_fullname':_0x1ee7ca=_0x1f8658['UserId']?_0x1f8658['User'][_0xe2f8('0xd8')]:_0xe2f8('0xd0');break;default:_0x1ee7ca=_0x1f8658['UserId']?util[_0xe2f8('0xc9')](_0xe2f8('0xd9'),_0x5e7793['agentAlias'],_0x1f8658[_0xe2f8('0x7a')]):_0xe2f8('0xd0');}var _0xf104df=util['format'](_0xe2f8('0xda'),moment(_0x1f8658['createdAt'])[_0xe2f8('0xc9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1f8658[_0xe2f8('0xdb')]==='in'?_0x3827fd:_0x1ee7ca,_0x1f8658[_0xe2f8('0xb1')]);if(!_0x1f8658[_0xe2f8('0xdc')]){fs[_0xe2f8('0xdd')](_0x492437,_0xf104df);}}return db[_0xe2f8('0xde')][_0xe2f8('0xc1')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe2f8('0xdf'),'raw':!![]}]});}}})[_0xe2f8('0x21')](function(_0x5aee5e){if(_0x5aee5e&&_0x5aee5e[_0xe2f8('0xdf')]&&_0x18e56c[_0xe2f8('0xb1')]){var _0x2a4525={'tls':{'rejectUnauthorized':![]}};if(_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe0')]){_0x2a4525[_0xe2f8('0xe0')]=_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe0')];}else{_0x2a4525['host']=_0x5aee5e[_0xe2f8('0xdf')]['host'];_0x2a4525[_0xe2f8('0xe1')]=_0x5aee5e[_0xe2f8('0xdf')]['port'];_0x2a4525[_0xe2f8('0xe2')]=_0x5aee5e[_0xe2f8('0xdf')]['secure'];}if(_0x5aee5e[_0xe2f8('0xdf')]['authentication']){_0x2a4525[_0xe2f8('0xe3')]={'user':_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe4')],'pass':_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe5')]};}return respondWithRpcPromise(_0xe2f8('0xe6'),_0xe2f8('0xe7'),{'account':_0x2a4525,'message':{'from':util[_0xe2f8('0xc9')](_0xe2f8('0xe8'),_0x5aee5e['name'],_0x5aee5e[_0xe2f8('0xe9')]||_0x5aee5e['Smtp'][_0xe2f8('0xe4')]),'to':_0x18e56c['body'][_0xe2f8('0xea')],'subject':_0xe2f8('0xeb'),'text':util[_0xe2f8('0xc9')](_0xe2f8('0xec'),_0x18e56c[_0xe2f8('0xb1')][_0xe2f8('0xea')]),'attachments':[{'path':_0x492437}]}})['then'](function(){return _0x57a095;})[_0xe2f8('0x2a')](function(_0x231388){console[_0xe2f8('0x27')](_0x231388);});}else{return _0x57a095;}})['then'](respondWithStatusCode(_0x3788d8,0xc8))[_0xe2f8('0x2a')](handleError(_0x3788d8,null));};exports[_0xe2f8('0xed')]=function(_0x109f84,_0x2654e5,_0x5dbde8){return db['ChatMessage'][_0xe2f8('0x6a')]({'where':{'id':_0x109f84[_0xe2f8('0xac')]['id']}})['then'](handleEntityNotFound(_0x2654e5,null))[_0xe2f8('0x21')](function(_0x401c06){if(_0x401c06){return _0x401c06[_0xe2f8('0xed')](_0x109f84['body'][_0xe2f8('0xee')],_[_0xe2f8('0xef')](_0x109f84['body'],[_0xe2f8('0xee'),'id'])||{});}})['then'](respondWithResult(_0x2654e5,null))[_0xe2f8('0x2a')](handleError(_0x2654e5,null));};exports['getMessages']=function(_0x3b3d43,_0x5e0a18,_0x91f4d7){var _0x1634a9={'raw':![],'where':{}};var _0x52ca74={};var _0x478aa1={'count':0x0,'rows':[]};return db[_0xe2f8('0x40')][_0xe2f8('0xc1')]({'where':{'id':_0x3b3d43['params']['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x5e0a18,null))[_0xe2f8('0x21')](function(_0x215cd9){if(_0x215cd9){_0x52ca74[_0xe2f8('0x49')]=_[_0xe2f8('0x7b')](db[_0xe2f8('0xcc')][_0xe2f8('0x41')]);_0x52ca74[_0xe2f8('0x45')]=_['keys'](_0x3b3d43[_0xe2f8('0x45')]);_0x52ca74['filters']=_[_0xe2f8('0x47')](_0x52ca74[_0xe2f8('0x49')],_0x52ca74[_0xe2f8('0x45')]);_0x1634a9[_0xe2f8('0x48')]=_[_0xe2f8('0x47')](_0x52ca74[_0xe2f8('0x49')],qs['fields'](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x4a')]));_0x1634a9['attributes']=_0x1634a9[_0xe2f8('0x48')]['length']?_0x1634a9[_0xe2f8('0x48')]:_0x52ca74[_0xe2f8('0x49')];if(!_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x4c')](_0xe2f8('0x4d'))){_0x1634a9[_0xe2f8('0x4e')]=qs['limit'](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x4e')]);_0x1634a9[_0xe2f8('0x2d')]=qs[_0xe2f8('0x2d')](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x2d')]);}_0x1634a9[_0xe2f8('0x4f')]=qs[_0xe2f8('0x50')](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x50')]);_0x1634a9[_0xe2f8('0x51')]=qs[_0xe2f8('0x46')](_[_0xe2f8('0xf0')](_0x3b3d43[_0xe2f8('0x45')],_0x52ca74[_0xe2f8('0x46')]));_0x1634a9[_0xe2f8('0x51')]['ChatInteractionId']=_0x215cd9['id'];if(_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x7c')]){_0x1634a9[_0xe2f8('0x51')]=_[_0xe2f8('0x9b')](_0x1634a9[_0xe2f8('0x51')],{'$or':_[_0xe2f8('0x39')](_0x1634a9['attributes'],function(_0x49edbd){var _0x13bf7f={};_0x13bf7f[_0x49edbd]={'$like':'%'+_0x3b3d43['query'][_0xe2f8('0x7c')]+'%'};return _0x13bf7f;})});}if(_0x3b3d43['query'][_0xe2f8('0xf1')]){var _0x53fe03=_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0xf1')][_0xe2f8('0x3c')](',');var _0x29c866={};_0x29c866[_0x53fe03[0x0]]={'$gte':moment(_0x53fe03[0x1])[_0xe2f8('0xc9')](_0xe2f8('0xf2'))};_0x1634a9[_0xe2f8('0x51')]=_['merge'](_0x1634a9[_0xe2f8('0x51')],_0x29c866);}_0x1634a9=_[_0xe2f8('0x9b')]({},_0x1634a9,_0x3b3d43['options']);return db[_0xe2f8('0xcc')][_0xe2f8('0x99')]({'where':_0x1634a9['where']})[_0xe2f8('0x21')](function(_0x3650ae){_0x478aa1[_0xe2f8('0x99')]=_0x3650ae;if(_0x3b3d43['query'][_0xe2f8('0xad')]){_0x1634a9[_0xe2f8('0xae')]=[{'all':!![]}];}return db[_0xe2f8('0xcc')][_0xe2f8('0xf3')](_0x1634a9);})['then'](function(_0x5ad7b5){_0x478aa1[_0xe2f8('0xaa')]=_0x5ad7b5;return _0x478aa1;});}})[_0xe2f8('0x21')](respondWithFilteredResult(_0x5e0a18,_0x1634a9))[_0xe2f8('0x2a')](handleError(_0x5e0a18,null));};exports[_0xe2f8('0xf4')]=function(_0x46ae9a,_0xaf333f,_0x4cb0e3){var _0x48413b={'where':{}},_0xd1bfe={},_0x2d358c={'count':0x0,'rows':[]};return db[_0xe2f8('0x40')][_0xe2f8('0xc1')]({'where':{'id':_0x46ae9a['params']['id']}})['then'](handleEntityNotFound(_0xaf333f,null))[_0xe2f8('0x21')](function(_0x6a03fb){if(_0x6a03fb){_0xd1bfe['model']=_[_0xe2f8('0x7b')](db['ChatMessage'][_0xe2f8('0x41')]);_0xd1bfe['query']=_['keys'](_0x46ae9a[_0xe2f8('0x45')]);_0xd1bfe['filters']=_[_0xe2f8('0x47')](_0xd1bfe[_0xe2f8('0x49')],_0xd1bfe[_0xe2f8('0x45')]);_0x48413b[_0xe2f8('0x48')]=_[_0xe2f8('0x47')](_0xd1bfe[_0xe2f8('0x49')],qs['fields'](_0x46ae9a[_0xe2f8('0x45')]['fields']));_0x48413b[_0xe2f8('0x48')]=_0x48413b[_0xe2f8('0x48')]['length']?_0x48413b[_0xe2f8('0x48')]:_0xd1bfe['model'];if(!_0x46ae9a[_0xe2f8('0x45')]['hasOwnProperty'](_0xe2f8('0x4d'))){_0x48413b[_0xe2f8('0x4e')]=qs[_0xe2f8('0x4e')](_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x4e')]);_0x48413b['offset']=qs[_0xe2f8('0x2d')](_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x2d')]);}_0x48413b[_0xe2f8('0x4f')]=qs['sort'](_0x46ae9a['query'][_0xe2f8('0x50')]);_0x48413b[_0xe2f8('0x51')]=qs[_0xe2f8('0x46')](_['pick'](_0x46ae9a[_0xe2f8('0x45')],_0xd1bfe[_0xe2f8('0x46')]));_0x48413b[_0xe2f8('0x51')][_0xe2f8('0xa8')]=_0x6a03fb['id'];if(_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x7c')]){_0x48413b[_0xe2f8('0x51')]=_[_0xe2f8('0x9b')](_0x48413b[_0xe2f8('0x51')],{'$or':_[_0xe2f8('0x39')](_0x48413b[_0xe2f8('0x48')],function(_0x2cea1d){var _0x2ee275={};_0x2ee275[_0x2cea1d]={'$like':'%'+_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x7c')]+'%'};return _0x2ee275;})});}_0x48413b[_0xe2f8('0x51')][_0xe2f8('0xdc')]=![];if(_0x46ae9a[_0xe2f8('0x45')]['id']){_0x48413b[_0xe2f8('0x51')]['id']={'$gt':_0x46ae9a[_0xe2f8('0x45')]['id']};}_0x48413b=_[_0xe2f8('0x9b')]({},_0x48413b,_0x46ae9a[_0xe2f8('0xaf')]);return db['ChatMessage'][_0xe2f8('0x99')]({'where':_0x48413b[_0xe2f8('0x51')]})[_0xe2f8('0x21')](function(_0x1e56d0){_0x2d358c[_0xe2f8('0x99')]=_0x1e56d0;_0x48413b[_0xe2f8('0xae')]=[];if(_0x46ae9a['query'][_0xe2f8('0xf5')]){_0x48413b[_0xe2f8('0xae')]['push']({'model':db['User'],'as':_0xe2f8('0x78'),'attributes':['id',_0xe2f8('0xd8'),_0xe2f8('0xd7')]});}if(_0x46ae9a['query'][_0xe2f8('0xad')]){_0x48413b[_0xe2f8('0xae')]=[{'all':!![]}];}return db[_0xe2f8('0xcc')][_0xe2f8('0xf3')](_0x48413b);})[_0xe2f8('0x21')](function(_0x17a425){_0x2d358c[_0xe2f8('0xaa')]=_0x17a425;return _0x2d358c;});}})[_0xe2f8('0x21')](respondWithFilteredResult(_0xaf333f,_0x48413b))['catch'](handleError(_0xaf333f,null));};exports[_0xe2f8('0xf6')]=function(_0x4926f6,_0x2897a2,_0x58041a){return db['ChatInteraction']['find']({'where':{'id':_0x4926f6[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x2897a2,null))['then'](function(_0x425f53){if(_0x425f53){return _0x425f53['setTags'](_0x4926f6[_0xe2f8('0xb1')][_0xe2f8('0xee')],_[_0xe2f8('0xef')](_0x4926f6[_0xe2f8('0xb1')],[_0xe2f8('0xee'),'id'])||{})[_0xe2f8('0xf7')](function(){return db[_0xe2f8('0xf8')][_0xe2f8('0xf3')]({'attributes':['id',_0xe2f8('0x37'),_0xe2f8('0x54')],'where':{'id':_0x4926f6['body']['ids']}});})['then'](function(_0x200ccf){socket['emit'](_0xe2f8('0xf9'),{'id':Number(_0x4926f6[_0xe2f8('0xac')]['id']),'tags':_0x200ccf||[]});return{'id':Number(_0x4926f6[_0xe2f8('0xac')]['id']),'tags':_0x200ccf||[]};});}})[_0xe2f8('0x21')](respondWithResult(_0x2897a2,null))['catch'](handleError(_0x2897a2,null));};exports[_0xe2f8('0xfa')]=function(_0x518e88,_0x2ca384,_0x23e860){return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x518e88[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x2ca384,null))['then'](function(_0x218ef0){if(_0x218ef0){return _0x218ef0[_0xe2f8('0xfa')](_0x518e88[_0xe2f8('0x45')][_0xe2f8('0xee')]);}})['then'](respondWithStatusCode(_0x2ca384,null))[_0xe2f8('0x2a')](handleError(_0x2ca384,null));};exports[_0xe2f8('0xc4')]=function(_0x14efaf,_0x4c33cc){var _0x9d45f6=moment()[_0xe2f8('0xfb')]()['toString']();var _0xd81376=path[_0xe2f8('0x90')](config['root'],'server',_0xe2f8('0xfc'),_0xe2f8('0xfd'));var _0x1a4ba8=path[_0xe2f8('0x90')](config[_0xe2f8('0xc5')],'server',_0xe2f8('0xfc'),_0xe2f8('0xfe'));var _0x202618=path[_0xe2f8('0x90')](_0xd81376,_0x9d45f6);var _0x1c3505=util[_0xe2f8('0xc9')](_0xe2f8('0xff'),_0x14efaf[_0xe2f8('0xac')]['id'],_0x9d45f6);var _0x42c457=path['join'](_0xd81376,_0x1c3505);var _0x191b02=![];return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x14efaf[_0xe2f8('0xac')]['id']},'include':[{'model':db[_0xe2f8('0xcc')],'as':'Messages','attributes':['id',_0xe2f8('0xb1'),_0xe2f8('0x81'),_0xe2f8('0xdb'),_0xe2f8('0xdc'),_0xe2f8('0x87')],'include':[{'model':db[_0xe2f8('0x78')],'as':_0xe2f8('0x78'),'attributes':['id',_0xe2f8('0xd8')],'raw':!![]},{'model':db[_0xe2f8('0xcf')],'as':_0xe2f8('0x100'),'attributes':['id','firstName',_0xe2f8('0x101')],'raw':!![]},{'model':db[_0xe2f8('0xbf')],'as':'Attachment','raw':!![]}]},{'model':db[_0xe2f8('0xce')],'as':'Account','attributes':['id',_0xe2f8('0x37')]},{'model':db[_0xe2f8('0x78')],'as':_0xe2f8('0x102'),'attributes':['id',_0xe2f8('0xd8')]}]})[_0xe2f8('0x21')](handleEntityNotFound(_0x4c33cc,null))[_0xe2f8('0x21')](function(_0x4a600a){if(_0x4a600a){var _0x219a04=_0x4a600a[_0xe2f8('0x103')]({'plain':!![]});_0x191b02=!![];var _0x2932a4={'format':'A4','border':_0xe2f8('0x104'),'header':{'height':_0xe2f8('0x105'),'contents':{'first':_0xe2f8('0x106')}},'footer':{'height':_0xe2f8('0x107'),'contents':{'default':util[_0xe2f8('0xc9')](_0xe2f8('0x108'),util[_0xe2f8('0xc9')](_0xe2f8('0x109'),_0xe2f8('0x10a'),_0x219a04['id']),moment()[_0xe2f8('0xc9')]('YYYY-MM-DD')['toString']())}}};fs[_0xe2f8('0x10b')](_0x202618);var _0x30bf96={'channel':_0xe2f8('0x10a'),'account':_0x219a04[_0xe2f8('0x10c')][_0xe2f8('0x37')],'agent':_0x219a04[_0xe2f8('0x102')]?_0x219a04[_0xe2f8('0x102')][_0xe2f8('0xd8')]:_0xe2f8('0x10d'),'createdAt':moment(_0x219a04['createdAt'])[_0xe2f8('0xc9')](_0xe2f8('0xf2'))[_0xe2f8('0x8f')](),'closedAt':_0x219a04[_0xe2f8('0xb7')]?moment(_0x219a04[_0xe2f8('0x10e')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x219a04['disposition'],'chatInfo':{'browser':_0x219a04['browserName'],'os':_0x219a04[_0xe2f8('0x10f')],'referer':_0x219a04['referer'],'customerIp':_0x219a04[_0xe2f8('0x110')],'customerPort':_0x219a04[_0xe2f8('0x111')]?_0x219a04[_0xe2f8('0x111')]:_0xe2f8('0x10d')},'messages':_(_0x219a04[_0xe2f8('0xcd')])['tail']()[_0xe2f8('0x7c')]({'secret':![]})[_0xe2f8('0x39')](function(_0x29742d){if(_0x29742d['Attachment']){var _0x28e46f=path[_0xe2f8('0x90')](_0x1a4ba8,_0x29742d[_0xe2f8('0xbf')][_0xe2f8('0xbb')]);if(fs[_0xe2f8('0x112')](_0x28e46f)){fs[_0xe2f8('0x113')](_0x28e46f)[_0xe2f8('0x114')](fs[_0xe2f8('0x115')](path[_0xe2f8('0x90')](_0x202618,_0x29742d[_0xe2f8('0xbf')][_0xe2f8('0xbb')])));}}return{'date':moment(_0x29742d[_0xe2f8('0x81')])[_0xe2f8('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe2f8('0x8f')](),'sender':_0x29742d[_0xe2f8('0xdb')]===_0xe2f8('0x116')?_0x29742d[_0xe2f8('0x78')]?_0x29742d[_0xe2f8('0x78')][_0xe2f8('0xd8')]:_0xe2f8('0xd0'):_0x29742d[_0xe2f8('0x100')][_0xe2f8('0x117')]+(_0x29742d[_0xe2f8('0x100')][_0xe2f8('0x101')]?'\x20'+_0x29742d[_0xe2f8('0x100')][_0xe2f8('0x101')]:''),'body':_0x29742d[_0xe2f8('0xbf')]?_0x29742d[_0xe2f8('0xbf')][_0xe2f8('0xbb')]:_0x29742d[_0xe2f8('0xb1')],'direction':_0x29742d['direction']===_0xe2f8('0x116')?'A':'C','secret':_0x29742d[_0xe2f8('0xdc')],'read':_0x29742d['read'],'attachment':_0x29742d[_0xe2f8('0xbf')]};})[_0xe2f8('0x6c')]()};return ejs[_0xe2f8('0x118')](path[_0xe2f8('0x90')](config[_0xe2f8('0xc5')],_0xe2f8('0x119'),_0xe2f8('0x11a'),_0xe2f8('0x11b')),{'interaction':_0x30bf96})[_0xe2f8('0x21')](function(_0x43f706){return new BPromise(function(_0x34da1e,_0x2c1211){pdf[_0xe2f8('0xb0')](_0x43f706,_0x2932a4)[_0xe2f8('0x11c')](path[_0xe2f8('0x90')](_0x202618,_0xe2f8('0x11d')+_0x219a04['id']+'-'+_0x9d45f6+_0xe2f8('0x11e')),function(_0x25a1a2,_0x1f0553){if(_0x25a1a2)return _0x2c1211(_0x25a1a2);_0x34da1e(_0x1f0553);});});});}})[_0xe2f8('0x21')](function(){if(_0x191b02){return new BPromise(function(_0x2a1167,_0x19c53f){zipdir(_0x202618,{'saveTo':_0x42c457},function(_0x2b6349,_0x64d3c6){if(_0x2b6349)return _0x19c53f(_0x2b6349);return _0x2a1167(_0x64d3c6);});})[_0xe2f8('0x21')](function(){return new BPromise(function(_0x57d0f0,_0xb90561){rimraf(_0x202618,function(_0x317263){if(_0x317263)_0xb90561(_0x317263);return _0x57d0f0();});});})[_0xe2f8('0x21')](function(){return _0x4c33cc[_0xe2f8('0xc4')](_0x42c457,_0x1c3505,function(_0x540175){if(_0x540175){console['log'](_0xe2f8('0x11f'),_0x540175);}else{fs[_0xe2f8('0x120')](_0x42c457);}});});}else{return _0x4c33cc[_0xe2f8('0x35')](0xc8);}})['catch'](handleError(_0x4c33cc,null));};
\ No newline at end of file
+var _0x8cb0=['MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','addMessage','ChatMessage','ids','getMessages','hasOwnProperty','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','setTags','omit','spread','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Chat','YYYY-MM-DD','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','firstName','renderFile','views','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','request\x20sent','result','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','name','send','Users','map','TagIds','Tags','forEach','push','catch','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','sort','where','pick','select','field','color','tools_tags','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','union','User','UserId','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','split','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','sequelize','length','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','intersection','includeAll','include','options','create','body','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','ValidationError','closed','disposition','AbandonInteraction','file','originalname','basename','filename','findOne','Unauthorized','Attachment','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync'];(function(_0x1b6697,_0x41a088){var _0x1c39cc=function(_0x409a7a){while(--_0x409a7a){_0x1b6697['push'](_0x1b6697['shift']());}};_0x1c39cc(++_0x41a088);}(_0x8cb0,0x15e));var _0x08cb=function(_0x37442f,_0x3eed9a){_0x37442f=_0x37442f-0x0;var _0x1d4482=_0x8cb0[_0x37442f];return _0x1d4482;};'use strict';var pdf=require(_0x08cb('0x0'));var emlformat=require(_0x08cb('0x1'));var rimraf=require(_0x08cb('0x2'));var zipdir=require(_0x08cb('0x3'));var jsonpatch=require(_0x08cb('0x4'));var rp=require(_0x08cb('0x5'));var moment=require(_0x08cb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x08cb('0x7'));var util=require(_0x08cb('0x8'));var path=require('path');var sox=require(_0x08cb('0x9'));var csv=require(_0x08cb('0xa'));var ejs=require(_0x08cb('0xb'));var fs=require('fs');var _=require(_0x08cb('0xc'));var squel=require('squel');var crypto=require(_0x08cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x08cb('0xe'));var toCsv=require(_0x08cb('0xa'));var querystring=require('querystring');var Papa=require(_0x08cb('0xf'));var Redis=require(_0x08cb('0x10'));var authService=require(_0x08cb('0x11'));var qs=require(_0x08cb('0x12'));var as=require(_0x08cb('0x13'));var hardwareService=require(_0x08cb('0x14'));var logger=require(_0x08cb('0x15'))('api');var utils=require(_0x08cb('0x16'));var config=require(_0x08cb('0x17'));var db=require(_0x08cb('0x18'))['db'];config['redis']=_[_0x08cb('0x19')](config['redis'],{'host':_0x08cb('0x1a'),'port':0x18eb});var socket=require(_0x08cb('0x1b'))(new Redis(config[_0x08cb('0x1c')]));require('./chatInteraction.socket')[_0x08cb('0x1d')](socket);var jayson=require(_0x08cb('0x1e'));var client=jayson[_0x08cb('0x1f')][_0x08cb('0x20')]({'port':0x232b});var client9004=jayson[_0x08cb('0x1f')][_0x08cb('0x20')]({'port':0x232c});function checkPasswordPattern(_0x1e1514,_0x563460,_0x5065d4){if(_0x5065d4){var _0x4d2358=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d2358[_0x08cb('0x21')](_0x563460)){return _0x1e1514;}else{throw new Error(_0x08cb('0x22'));}}else{return _0x1e1514;}}function respondWithRpcPromise(_0x32fee3,_0x4d4466,_0x2f5c3d,_0x473576){return new BPromise(function(_0x4f77ac,_0x10c055){var _0x178268=_0x473576||client;return _0x178268[_0x08cb('0x23')](_0x32fee3,_0x2f5c3d)[_0x08cb('0x24')](function(_0x2351a4){logger[_0x08cb('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4d4466,'request\x20sent');logger[_0x08cb('0x26')](_0x08cb('0x27'),_0x4d4466,'request\x20sent',JSON[_0x08cb('0x28')](_0x2351a4));if(_0x2351a4[_0x08cb('0x29')]){if(_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2a')]===0x1f4){logger[_0x08cb('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x4d4466,_0x2351a4['error'][_0x08cb('0x2b')]);return _0x10c055(_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2b')]);}logger[_0x08cb('0x29')](_0x08cb('0x2c'),_0x4d4466,_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2b')]);return _0x4f77ac(_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2b')]);}else{logger[_0x08cb('0x25')](_0x08cb('0x2c'),_0x4d4466,_0x08cb('0x2d'));_0x4f77ac(_0x2351a4[_0x08cb('0x2e')][_0x08cb('0x2b')]);}})['catch'](function(_0x169aa9){logger[_0x08cb('0x29')](_0x08cb('0x2c'),_0x4d4466,_0x169aa9);_0x10c055(_0x169aa9);});});}function respondWithStatusCode(_0xfe2490,_0x2e25f5){_0x2e25f5=_0x2e25f5||0xcc;return function(_0x36503b){if(_0x36503b){return _0xfe2490[_0x08cb('0x2f')](_0x2e25f5);}return _0xfe2490[_0x08cb('0x30')](_0x2e25f5)['end']();};}function respondWithResult(_0x512a08,_0x252f42){_0x252f42=_0x252f42||0xc8;return function(_0x5124f7){if(_0x5124f7){return _0x512a08[_0x08cb('0x30')](_0x252f42)[_0x08cb('0x31')](_0x5124f7);}};}function respondWithFilteredResult(_0x300963,_0x32e158){return function(_0x33c2c8){if(_0x33c2c8){var _0x4a02a3=_0x33c2c8[_0x08cb('0x32')],_0x141b78=_0x32e158[_0x08cb('0x33')],_0x370edf=_0x32e158['offset']+_0x32e158[_0x08cb('0x34')],_0x5126e6;if(_0x370edf>=_0x4a02a3){_0x370edf=_0x4a02a3;_0x5126e6=0xc8;}else{_0x5126e6=0xce;}_0x300963[_0x08cb('0x30')](_0x5126e6);return _0x300963[_0x08cb('0x35')](_0x08cb('0x36'),_0x141b78+'-'+_0x370edf+'/'+_0x4a02a3)[_0x08cb('0x31')](_0x33c2c8);}return null;};}function patchUpdates(_0x56a291){return function(_0x2c1e3e){try{jsonpatch['apply'](_0x2c1e3e,_0x56a291,!![]);}catch(_0x102261){return BPromise[_0x08cb('0x37')](_0x102261);}return _0x2c1e3e[_0x08cb('0x38')]();};}function saveUpdates(_0x480385,_0x3ac2bd){return function(_0x2312a6){if(_0x2312a6){return _0x2312a6[_0x08cb('0x39')](_0x480385)['then'](function(_0xcff1ee){return _0xcff1ee;});}return null;};}function removeEntity(_0x3a75e9,_0x5939d2){return function(_0x55e724){if(_0x55e724){return _0x55e724[_0x08cb('0x3a')]()[_0x08cb('0x24')](function(){_0x3a75e9['status'](0xcc)[_0x08cb('0x3b')]();});}};}function handleEntityNotFound(_0x2f04d6,_0x799955){return function(_0x364d95){if(!_0x364d95){_0x2f04d6['sendStatus'](0x194);}return _0x364d95;};}function handleError(_0x264199,_0x48ef7c){_0x48ef7c=_0x48ef7c||0x1f4;return function(_0xc2ecce){logger[_0x08cb('0x29')](_0xc2ecce['stack']);if(_0xc2ecce['name']){delete _0xc2ecce[_0x08cb('0x3c')];}_0x264199[_0x08cb('0x30')](_0x48ef7c)[_0x08cb('0x3d')](_0xc2ecce);};}function getInteractionUsers(_0x28dcef,_0x2df750){return new BPromise(function(_0xe47a7d,_0x5ea9a6){try{if(_0x2df750[_0x28dcef['id']]){_0x28dcef[_0x08cb('0x3e')]=_[_0x08cb('0x3f')](_0x2df750[_0x28dcef['id']],function(_0x2cd501){return{'id':_0x2cd501['id']};});}}catch(_0x431347){_0x5ea9a6(_0x431347);}_0xe47a7d(_0x28dcef);});}function getInteractionTags(_0x11568f,_0x5206f7){return new BPromise(function(_0x2a24f0,_0x1a6889){try{if(_0x11568f[_0x08cb('0x40')]){_0x11568f[_0x08cb('0x41')]=[];_0x11568f[_0x08cb('0x40')]['split'](',')[_0x08cb('0x42')](function(_0xf43d1e){_0x11568f[_0x08cb('0x41')][_0x08cb('0x43')](_0x5206f7[_0xf43d1e]);});}delete _0x11568f[_0x08cb('0x40')];}catch(_0x29fc51){_0x1a6889(_0x29fc51);}_0x2a24f0(_0x11568f);});}function updateChatInteraction(_0x1026ee,_0x1ee5e7,_0x58996b){return new BPromise(function(_0xd24abc,_0x2be143){return getInteractionUsers(_0x1026ee,_0x58996b)[_0x08cb('0x24')](function(_0x728bce){return getInteractionTags(_0x728bce,_0x1ee5e7);})[_0x08cb('0x24')](function(_0x56f7c2){_0xd24abc(_0x56f7c2);})[_0x08cb('0x44')](function(_0x296add){_0x2be143(_0x296add);});});}exports[_0x08cb('0x45')]=function(_0x47924e,_0x346c4c){var _0x561a5a={},_0x438481={},_0x1e979e={'count':0x0,'rows':[]};var _0x384f72=_[_0x08cb('0x3f')](db[_0x08cb('0x46')][_0x08cb('0x47')],function(_0x18c4aa){return{'name':_0x18c4aa[_0x08cb('0x48')],'type':_0x18c4aa['type'][_0x08cb('0x49')]};});_0x438481[_0x08cb('0x4a')]=_[_0x08cb('0x3f')](_0x384f72,'name');_0x438481[_0x08cb('0x4b')]=_[_0x08cb('0x4c')](_0x47924e[_0x08cb('0x4b')]);_0x438481[_0x08cb('0x4d')]=_['intersection'](_0x438481[_0x08cb('0x4a')],_0x438481[_0x08cb('0x4b')]);_0x561a5a[_0x08cb('0x4e')]=_['intersection'](_0x438481[_0x08cb('0x4a')],qs[_0x08cb('0x4f')](_0x47924e['query']['fields']));_0x561a5a[_0x08cb('0x4e')]=_0x561a5a[_0x08cb('0x4e')]['length']?_0x561a5a[_0x08cb('0x4e')]:_0x438481['model'];if(!_0x47924e['query']['hasOwnProperty']('nolimit')){_0x561a5a[_0x08cb('0x34')]=qs[_0x08cb('0x34')](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x34')]);_0x561a5a[_0x08cb('0x33')]=qs['offset'](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x33')]);}_0x561a5a['order']=qs[_0x08cb('0x50')](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x50')]);_0x561a5a[_0x08cb('0x51')]=qs[_0x08cb('0x4d')](_[_0x08cb('0x52')](_0x47924e[_0x08cb('0x4b')],_0x438481['filters']));var _0xc03e96=[];var _0x236499=squel[_0x08cb('0x53')]()[_0x08cb('0x54')]('id')[_0x08cb('0x54')](_0x08cb('0x3c'))[_0x08cb('0x54')](_0x08cb('0x55'))['from'](_0x08cb('0x56'));var _0xc17df9=squel['select']()['field']('u.id')[_0x08cb('0x54')](_0x08cb('0x57'))[_0x08cb('0x58')](_0x08cb('0x59'),'ui')[_0x08cb('0x5a')]('users','u','u.id\x20=\x20ui.UserId');var _0x4e9fdb=squel[_0x08cb('0x53')]()[_0x08cb('0x58')](_0x08cb('0x5b'),'i')['left_join'](_0x08cb('0x5c'),'c',_0x08cb('0x5d'))[_0x08cb('0x5a')](_0x08cb('0x5e'),'o','o.id\x20=\x20i.UserId')[_0x08cb('0x5a')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x08cb('0x5a')](_0x08cb('0x5f'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x08cb('0x5a')](_0x08cb('0x60'),'it',_0x08cb('0x61'))[_0x08cb('0x5a')](_0x08cb('0x56'),'t','t.id\x20=\x20it.TagId');var _0x5462ba=squel[_0x08cb('0x62')]();var _0x274680=[];var _0x490d5d=squel[_0x08cb('0x62')]();if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x63')]){var _0x2baf36=as[_0x08cb('0x64')](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x63')]);var _0x4b62c8=_0x2baf36[_0x08cb('0x65')];for(var _0x573f0c=0x0;_0x573f0c<_0x2baf36['conditions']['length'];_0x573f0c++){var _0x271818=_0x2baf36[_0x08cb('0x66')][_0x573f0c];var _0x2b817c='i';var _0x40e2e7=_[_0x08cb('0x67')](_0x384f72,[_0x08cb('0x3c'),_0x271818[_0x08cb('0x54')]]);if(!_0x40e2e7){switch(_0x271818[_0x08cb('0x54')]){case'unreadMessages':if(_0x271818[_0x08cb('0x68')]==0x1){_0x4e9fdb['having']('`'+_0x271818[_0x08cb('0x54')]+'`\x20=\x200');}else{_0x4e9fdb['having']('`'+_0x271818[_0x08cb('0x54')]+_0x08cb('0x69'));}break;case _0x08cb('0x6a'):if(_0x271818[_0x08cb('0x6b')]===_0x08cb('0x6c')){_0x5462ba[_0x4b62c8](_0x08cb('0x6d'),_0x271818[_0x08cb('0x68')],null);}else{_0x40e2e7=_[_0x08cb('0x67')](_0x384f72,[_0x08cb('0x3c'),_0x08cb('0x6e')]);_0x271818[_0x08cb('0x54')]=_0x08cb('0x6e');_0x316c49=as[_0x08cb('0x6f')](_0x2b817c,_0x40e2e7[_0x08cb('0x70')],_0x271818);_0x5462ba[_0x4b62c8](_0x316c49[_0x08cb('0x71')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x72')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x3b')]);}break;case _0x08cb('0x73'):var _0x1fda07=_0x271818[_0x08cb('0x68')]['split'](',')['map'](function(_0x5576ab){return Number(_0x5576ab);});_0x1fda07['forEach'](function(_0x4ea16a){_0x490d5d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4ea16a+',%');});_0x274680=_[_0x08cb('0x74')](_0x274680,_0x1fda07);break;case _0x08cb('0x75'):if(_0x271818[_0x08cb('0x6b')]===_0x08cb('0x6c')){_0x5462ba[_0x4b62c8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x271818[_0x08cb('0x68')]+'%',null);}else{_0x40e2e7=_[_0x08cb('0x67')](_0x384f72,[_0x08cb('0x3c'),_0x08cb('0x76')]);_0x271818[_0x08cb('0x54')]=_0x08cb('0x76');_0x316c49=as[_0x08cb('0x6f')](_0x2b817c,_0x40e2e7[_0x08cb('0x70')],_0x271818);_0x5462ba[_0x4b62c8](_0x316c49[_0x08cb('0x71')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x72')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x3b')]);}break;}}else{var _0x316c49=as['buildExpression'](_0x2b817c,_0x40e2e7['type'],_0x271818);_0x5462ba[_0x4b62c8](_0x316c49[_0x08cb('0x71')],_0x316c49['value'][_0x08cb('0x72')],_0x316c49['value'][_0x08cb('0x3b')]);}}}else{var _0x38dda4=_(_0x47924e['query'])[_0x08cb('0x4c')]()['map'](function(_0x553ed6){return _[_0x08cb('0x77')](_0x384f72,[_0x08cb('0x3c'),_0x553ed6])?_0x553ed6:undefined;})[_0x08cb('0x78')]()[_0x08cb('0x68')]();if(!_[_0x08cb('0x79')](_0x38dda4)){_0x38dda4[_0x08cb('0x42')](function(_0xdd5c5f){if(_0xdd5c5f==='ChatWebsiteId'){_0x4e9fdb[_0x08cb('0x51')](_0x08cb('0x7a'),[][_0x08cb('0x7b')](_0x47924e[_0x08cb('0x4b')][_0xdd5c5f]));}else if(_0xdd5c5f===_0x08cb('0x7c')){var _0x40120e=JSON['parse'](_0x47924e[_0x08cb('0x4b')][_0xdd5c5f])[_0x08cb('0x7d')];var _0x546206=JSON['parse'](_0x47924e[_0x08cb('0x4b')][_0xdd5c5f])[_0x08cb('0x7e')];_0x4e9fdb['where'](_0x08cb('0x7f'),_0x40120e,_0x546206);}else{if(_0x47924e['query'][_0xdd5c5f]===_0x08cb('0x80')){_0x4e9fdb[_0x08cb('0x51')]('i.'+_0xdd5c5f+_0x08cb('0x81'));}else{_0x4e9fdb[_0x08cb('0x51')]('i.'+_0xdd5c5f+_0x08cb('0x82'),_0x47924e[_0x08cb('0x4b')][_0xdd5c5f]);}}});}if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x83')]){if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x83')]==0x1){_0x4e9fdb[_0x08cb('0x84')]('`unreadMessages`\x20=\x200');}else{_0x4e9fdb[_0x08cb('0x84')](_0x08cb('0x85'));}}if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x86')]){_0x274680=_['isArray'](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x86')])?_0x47924e['query'][_0x08cb('0x86')]:new Array(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x86')]);_0x274680[_0x08cb('0x42')](function(_0x3dac11){_0x490d5d['or'](_0x08cb('0x87'),'%,'+_0x3dac11+',%');});}if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x88')]){var _0xcec256=_0x47924e[_0x08cb('0x4b')]['filter'][_0x08cb('0x89')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x08cb('0x8a')](_0xcec256)){_0x5462ba['or'](_0x08cb('0x8b'),_0xcec256+'%');}else{var _0x4c9d87=[];_0xcec256[_0x08cb('0x8c')]('\x20')[_0x08cb('0x42')](function(_0x5241bb){_0x4c9d87[_0x08cb('0x43')]('+'+_0x5241bb['toString']());});var _0x33c768=_0x4c9d87[_0x08cb('0x8d')]('\x20');_0x5462ba['or'](_0x08cb('0x8e'),_0x33c768)['or'](_0x08cb('0x8f'),_0xcec256+'%');}}}_0x4e9fdb['where'](_0x5462ba);_0x4e9fdb[_0x08cb('0x90')]('i.id');var _0x4d39a3={'type':db[_0x08cb('0x91')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4bae70=_0x4e9fdb['clone']();_0x4bae70[_0x08cb('0x54')](_0x08cb('0x92'));_0x4bae70[_0x08cb('0x54')](_0x08cb('0x93'),'unreadMessages');if(_0x561a5a[_0x08cb('0x94')]){_0x561a5a[_0x08cb('0x94')][_0x08cb('0x42')](function(_0x3128fe){_0x4e9fdb[_0x08cb('0x94')]('i.'+_0x3128fe[0x0],_0x3128fe[0x1]==='DESC'?![]:!![]);});}if(!_[_0x08cb('0x79')](_0x274680)){_0x4e9fdb['having'](_0x490d5d);_0x4bae70[_0x08cb('0x51')](_0x08cb('0x95'),_0x274680);}db[_0x08cb('0x96')][_0x08cb('0x4b')](_0x4bae70['toString'](),_0x4d39a3)[_0x08cb('0x24')](function(_0x3b09ee){_0x1e979e['count']=_0x3b09ee[_0x08cb('0x97')];if(_0x1e979e['count']===0x0)return[];return db['sequelize']['query'](_0x236499[_0x08cb('0x98')](),_0x4d39a3)[_0x08cb('0x24')](function(_0x40aa1d){_0xc03e96=_['keyBy'](_0x40aa1d,'id');_0x4d39a3=_[_0x08cb('0x99')](_0x4d39a3,{'model':db[_0x08cb('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x93'),'unreadMessages');_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x9a'),_0x08cb('0x9b'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x9c'),_0x08cb('0x9d'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x9e'));_0x4e9fdb[_0x08cb('0x54')]('c.firstName',_0x08cb('0x9f'));_0x4e9fdb['field']('c.lastName',_0x08cb('0xa0'));_0x4e9fdb[_0x08cb('0x54')]('c.email',_0x08cb('0xa1'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0xa2'),_0x08cb('0xa3'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0xa4'),_0x08cb('0xa5'));_0x4e9fdb['field']('c.fax',_0x08cb('0xa6'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0xa7'),_0x08cb('0x40'));_0x4e9fdb[_0x08cb('0x34')](_0x561a5a[_0x08cb('0x34')]);_0x4e9fdb[_0x08cb('0x33')](_0x561a5a[_0x08cb('0x33')]);return db[_0x08cb('0x96')]['query'](_0x4e9fdb['toString'](),_0x4d39a3);})['then'](function(_0x4c486a){_0xc17df9['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x08cb('0x3f')](_0x4c486a,'id'));return db[_0x08cb('0x96')][_0x08cb('0x4b')](_0xc17df9[_0x08cb('0x98')](),_0x4d39a3)[_0x08cb('0x24')](function(_0x55cfe2){var _0x5f414b=_[_0x08cb('0xa8')](_0x55cfe2,_0x08cb('0xa9'));var _0xa417e8=[];_0x4c486a[_0x08cb('0x42')](function(_0xa8240f){_0xa417e8[_0x08cb('0x43')](updateChatInteraction(_0xa8240f,_0xc03e96,_0x5f414b));});return BPromise[_0x08cb('0xaa')](_0xa417e8);});});})['then'](function(_0x1cae0a){_0x1e979e['rows']=_0x1cae0a;return _0x1e979e;})[_0x08cb('0x24')](respondWithFilteredResult(_0x346c4c,_0x561a5a))[_0x08cb('0x44')](handleError(_0x346c4c,null));};exports[_0x08cb('0xab')]=function(_0x8c8d3d,_0x46378f){var _0x2d84b4={'raw':![],'where':{'id':_0x8c8d3d['params']['id']}},_0x11f928={};_0x11f928[_0x08cb('0x4a')]=_['keys'](db[_0x08cb('0x46')][_0x08cb('0x47')]);_0x11f928[_0x08cb('0x4b')]=_[_0x08cb('0x4c')](_0x8c8d3d['query']);_0x11f928['filters']=_[_0x08cb('0xac')](_0x11f928[_0x08cb('0x4a')],_0x11f928[_0x08cb('0x4b')]);_0x2d84b4['attributes']=_[_0x08cb('0xac')](_0x11f928[_0x08cb('0x4a')],qs[_0x08cb('0x4f')](_0x8c8d3d[_0x08cb('0x4b')][_0x08cb('0x4f')]));_0x2d84b4[_0x08cb('0x4e')]=_0x2d84b4['attributes']['length']?_0x2d84b4[_0x08cb('0x4e')]:_0x11f928[_0x08cb('0x4a')];if(_0x8c8d3d['query'][_0x08cb('0xad')]){_0x2d84b4[_0x08cb('0xae')]=[{'all':!![]}];}_0x2d84b4=_[_0x08cb('0x99')]({},_0x2d84b4,_0x8c8d3d[_0x08cb('0xaf')]);return db['ChatInteraction'][_0x08cb('0x67')](_0x2d84b4)[_0x08cb('0x24')](handleEntityNotFound(_0x46378f,null))['then'](respondWithResult(_0x46378f,null))[_0x08cb('0x44')](handleError(_0x46378f,null));};exports['create']=function(_0x1d53bd,_0x5f23bc){return db[_0x08cb('0x46')][_0x08cb('0xb0')](_0x1d53bd[_0x08cb('0xb1')],{})[_0x08cb('0x24')](respondWithResult(_0x5f23bc,0xc9))[_0x08cb('0x44')](handleError(_0x5f23bc,null));};exports[_0x08cb('0x39')]=function(_0x10dd15,_0x1f4cfb){if(_0x10dd15[_0x08cb('0xb1')]['id']){delete _0x10dd15[_0x08cb('0xb1')]['id'];}return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x10dd15[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x1f4cfb,null))[_0x08cb('0x24')](saveUpdates(_0x10dd15[_0x08cb('0xb1')],null))['then'](respondWithResult(_0x1f4cfb,null))[_0x08cb('0x44')](handleError(_0x1f4cfb,null));};exports[_0x08cb('0x3a')]=function(_0x2b597e,_0x5a9043){return db[_0x08cb('0x46')]['find']({'where':{'id':_0x2b597e['params']['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x5a9043,null))[_0x08cb('0x24')](removeEntity(_0x5a9043,null))[_0x08cb('0x44')](handleError(_0x5a9043,null));};exports[_0x08cb('0xb3')]=function(_0x43149c,_0xcee084){return db[_0x08cb('0x46')][_0x08cb('0xb3')]()[_0x08cb('0x24')](respondWithResult(_0xcee084,null))[_0x08cb('0x44')](handleError(_0xcee084,null));};exports[_0x08cb('0xb4')]=function(_0x13af46,_0x356419){if(_0x13af46[_0x08cb('0xb1')]['id']){delete _0x13af46['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x13af46['params']['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x356419,null))[_0x08cb('0x24')](saveUpdates(_0x13af46[_0x08cb('0xb1')],null))[_0x08cb('0x24')](respondWithResult(_0x356419,null))[_0x08cb('0x44')](handleError(_0x356419,null));};exports[_0x08cb('0xb5')]=function(_0x5eadbe,_0xe93bc5,_0x39efe8){if(_0x5eadbe[_0x08cb('0xb1')]['id']){delete _0x5eadbe['body']['id'];}return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x5eadbe['params']['id']}})[_0x08cb('0x24')](function(_0x148c2f){if(!_0x148c2f){logger[_0x08cb('0x29')](_0x08cb('0xb6'),_0x08cb('0xb5'),0x194,'entity\x20not\x20found');_0xe93bc5[_0x08cb('0x2f')](0x194);}else{if(_0x148c2f['UserId']){throw new db[(_0x08cb('0x91'))][(_0x08cb('0xb7'))]('Interaction\x20already\x20assigned');}}return _0x148c2f;})[_0x08cb('0x24')](function(_0x30682c){if(_0x30682c){return _0x30682c[_0x08cb('0x39')]({'closed':_0x5eadbe[_0x08cb('0xb1')][_0x08cb('0xb8')],'disposition':_0x5eadbe[_0x08cb('0xb1')][_0x08cb('0xb9')]})['then'](function(_0x5f242b){return _0x5f242b;});}})['then'](function(_0x360390){return respondWithRpcPromise(_0x08cb('0xba'),_0x08cb('0xb5'),_0x5eadbe[_0x08cb('0xb1')],client9004);})['then'](respondWithResult(_0xe93bc5,null))[_0x08cb('0x44')](handleError(_0xe93bc5,null));};exports['attachmentUpload']=function(_0x4c75a1,_0x4d5543,_0x4be968){_0x4c75a1[_0x08cb('0xb1')]['name']=_0x4c75a1[_0x08cb('0xbb')][_0x08cb('0xbc')];_0x4c75a1[_0x08cb('0xb1')][_0x08cb('0xbd')]=_0x4c75a1[_0x08cb('0xbb')][_0x08cb('0xbe')];_0x4c75a1[_0x08cb('0xb1')][_0x08cb('0x70')]=_0x4c75a1['file']['mimetype'];return db['Attachment'][_0x08cb('0xb0')](_0x4c75a1[_0x08cb('0xb1')])[_0x08cb('0x24')](respondWithResult(_0x4d5543,0xc9))[_0x08cb('0x44')](handleError(_0x4d5543,null));};exports['attachmentDownload']=function(_0x3347f6,_0x2f7fd3,_0x26a1e0){return db[_0x08cb('0x46')][_0x08cb('0xbf')]({'where':{'id':_0x3347f6[_0x08cb('0xb2')]['id']},'raw':!![]})[_0x08cb('0x24')](handleEntityNotFound(_0x2f7fd3,null))[_0x08cb('0x24')](function(_0x4ec5dd){if(_0x4ec5dd){if(_0x4ec5dd[_0x08cb('0xb8')]){return _0x2f7fd3['status'](0x193)['json']({'status':0x193,'message':_0x08cb('0xc0')});}return db[_0x08cb('0xc1')][_0x08cb('0xbf')]({'where':{'id':_0x3347f6['query']['attachId']},'raw':!![]})[_0x08cb('0x24')](handleEntityNotFound(_0x2f7fd3,null));}})[_0x08cb('0x24')](function(_0x41adc5){if(_0x41adc5){return _0x2f7fd3[_0x08cb('0xc2')](path[_0x08cb('0x8d')](config[_0x08cb('0xc3')],_0x08cb('0xc4'),_0x41adc5[_0x08cb('0xbd')]));}})[_0x08cb('0x44')](handleError(_0x2f7fd3,null));};exports[_0x08cb('0xc5')]=function(_0x5de139,_0x42a32e){var _0x5eafc2=null;var _0x347772=null;var _0x4561f4=null;var _0x58811d=null;if(_0x5de139[_0x08cb('0xb1')]['id']){delete _0x5de139[_0x08cb('0xb1')]['id'];}if(_0x5de139[_0x08cb('0xb1')][_0x08cb('0xc6')]){_0x58811d=path[_0x08cb('0x8d')](config[_0x08cb('0xc3')],_0x08cb('0xc7'),util[_0x08cb('0xc8')]('transcript-%s.txt',Date[_0x08cb('0xc9')]()));_0x5de139[_0x08cb('0xb1')][_0x08cb('0xca')]=_0x58811d;}return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x5de139['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x08cb('0xcb'),'include':[{'model':db[_0x08cb('0x75')],'as':_0x08cb('0x75')}]}]})['then'](handleEntityNotFound(_0x42a32e,null))['then'](saveUpdates(_0x5de139['body'],null))[_0x08cb('0x24')](function(_0x314e62){if(_0x314e62){_0x5eafc2=_0x314e62;return db['ChatWebsite'][_0x08cb('0x67')]({'where':{'id':_0x5eafc2['ChatWebsiteId']}});}})[_0x08cb('0x24')](function(_0xa6ad9c){if(_0xa6ad9c){_0x4561f4=_0xa6ad9c;return db[_0x08cb('0xcc')][_0x08cb('0x67')]({'where':{'id':_0x5eafc2[_0x08cb('0x6e')]}});}})[_0x08cb('0x24')](function(_0x3661d2){if(_0x3661d2){_0x347772=_0x3661d2;if(_0x58811d){var _0x25d3ec=null;for(var _0x4c07e2=0x1;_0x4c07e2<_0x5eafc2[_0x08cb('0xcb')][_0x08cb('0x97')];++_0x4c07e2){_0x25d3ec=_0x5eafc2[_0x08cb('0xcb')][_0x4c07e2];var _0x3c34bc=_0x25d3ec['UserId']?util[_0x08cb('0xc8')](_0x08cb('0xcd'),_0x4561f4[_0x08cb('0xce')],_0x25d3ec['UserId']):'System';var _0x1e244f=_0x5de139[_0x08cb('0xb1')][_0x08cb('0xcf')]||util['format']('%s%d',_0x08cb('0xd0'),_0x25d3ec[_0x08cb('0x6e')]);switch(_0x4561f4['agentIdentifier']){case _0x08cb('0xd1'):_0x3c34bc=_0x25d3ec[_0x08cb('0x76')]?util[_0x08cb('0xc8')](_0x08cb('0xcd'),_0x4561f4[_0x08cb('0xce')],_0x25d3ec[_0x08cb('0x76')]):_0x08cb('0xd2');break;case _0x08cb('0xd3'):_0x3c34bc=_0x25d3ec[_0x08cb('0x76')]?_0x25d3ec[_0x08cb('0x75')][_0x08cb('0xd4')]||_0x25d3ec[_0x08cb('0x75')][_0x08cb('0xd5')]:'System';break;case _0x08cb('0xd6'):_0x3c34bc=_0x25d3ec['UserId']?_0x25d3ec[_0x08cb('0x75')]['fullname']:_0x08cb('0xd2');break;default:_0x3c34bc=_0x25d3ec['UserId']?util[_0x08cb('0xc8')](_0x08cb('0xcd'),_0x4561f4[_0x08cb('0xce')],_0x25d3ec[_0x08cb('0x76')]):_0x08cb('0xd2');}var _0x476eff=util[_0x08cb('0xc8')](_0x08cb('0xd7'),moment(_0x25d3ec['createdAt'])['format'](_0x08cb('0xd8')),_0x25d3ec[_0x08cb('0xd9')]==='in'?_0x1e244f:_0x3c34bc,_0x25d3ec[_0x08cb('0xb1')]);if(!_0x25d3ec[_0x08cb('0xda')]){fs[_0x08cb('0xdb')](_0x58811d,_0x476eff);}}return db[_0x08cb('0xdc')][_0x08cb('0xbf')]({'where':{'service':!![]},'include':[{'model':db[_0x08cb('0xdd')],'as':'Smtp','raw':!![]}]});}}})[_0x08cb('0x24')](function(_0x5cfe55){if(_0x5cfe55&&_0x5cfe55[_0x08cb('0xde')]&&_0x5de139['body']){var _0x10e7df={'tls':{'rejectUnauthorized':![]}};if(_0x5cfe55[_0x08cb('0xde')]['service']){_0x10e7df[_0x08cb('0xdf')]=_0x5cfe55['Smtp']['service'];}else{_0x10e7df[_0x08cb('0xe0')]=_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe0')];_0x10e7df[_0x08cb('0xe1')]=_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe1')];_0x10e7df[_0x08cb('0xe2')]=_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe2')];}if(_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe3')]){_0x10e7df[_0x08cb('0xe4')]={'user':_0x5cfe55[_0x08cb('0xde')]['user'],'pass':_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe5')]};}return respondWithRpcPromise(_0x08cb('0xe6'),'sendMail',{'account':_0x10e7df,'message':{'from':util[_0x08cb('0xc8')](_0x08cb('0xe7'),_0x5cfe55[_0x08cb('0x3c')],_0x5cfe55[_0x08cb('0xe8')]||_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe9')]),'to':_0x5de139[_0x08cb('0xb1')][_0x08cb('0xc6')],'subject':_0x08cb('0xea'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5de139[_0x08cb('0xb1')][_0x08cb('0xc6')]),'attachments':[{'path':_0x58811d}]}})[_0x08cb('0x24')](function(){return _0x5eafc2;})[_0x08cb('0x44')](function(_0x545d0b){console[_0x08cb('0x29')](_0x545d0b);});}else{return _0x5eafc2;}})[_0x08cb('0x24')](respondWithStatusCode(_0x42a32e,0xc8))[_0x08cb('0x44')](handleError(_0x42a32e,null));};exports[_0x08cb('0xeb')]=function(_0x6fab7,_0x38b811,_0x5e678d){return db[_0x08cb('0xec')][_0x08cb('0x67')]({'where':{'id':_0x6fab7[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x38b811,null))['then'](function(_0x533048){if(_0x533048){return _0x533048[_0x08cb('0xeb')](_0x6fab7[_0x08cb('0xb1')][_0x08cb('0xed')],_['omit'](_0x6fab7[_0x08cb('0xb1')],[_0x08cb('0xed'),'id'])||{});}})[_0x08cb('0x24')](respondWithResult(_0x38b811,null))[_0x08cb('0x44')](handleError(_0x38b811,null));};exports[_0x08cb('0xee')]=function(_0x5c4329,_0xd0e730,_0xeaa01e){var _0x29543c={'raw':![],'where':{}};var _0x210d95={};var _0xaa157e={'count':0x0,'rows':[]};return db[_0x08cb('0x46')][_0x08cb('0xbf')]({'where':{'id':_0x5c4329['params']['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0xd0e730,null))[_0x08cb('0x24')](function(_0x432cb8){if(_0x432cb8){_0x210d95[_0x08cb('0x4a')]=_[_0x08cb('0x4c')](db[_0x08cb('0xec')][_0x08cb('0x47')]);_0x210d95[_0x08cb('0x4b')]=_['keys'](_0x5c4329[_0x08cb('0x4b')]);_0x210d95['filters']=_[_0x08cb('0xac')](_0x210d95['model'],_0x210d95[_0x08cb('0x4b')]);_0x29543c[_0x08cb('0x4e')]=_[_0x08cb('0xac')](_0x210d95[_0x08cb('0x4a')],qs[_0x08cb('0x4f')](_0x5c4329['query']['fields']));_0x29543c['attributes']=_0x29543c[_0x08cb('0x4e')][_0x08cb('0x97')]?_0x29543c['attributes']:_0x210d95['model'];if(!_0x5c4329['query'][_0x08cb('0xef')](_0x08cb('0xf0'))){_0x29543c['limit']=qs[_0x08cb('0x34')](_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x34')]);_0x29543c[_0x08cb('0x33')]=qs[_0x08cb('0x33')](_0x5c4329['query'][_0x08cb('0x33')]);}_0x29543c['order']=qs['sort'](_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x50')]);_0x29543c[_0x08cb('0x51')]=qs['filters'](_[_0x08cb('0x52')](_0x5c4329[_0x08cb('0x4b')],_0x210d95[_0x08cb('0x4d')]));_0x29543c['where'][_0x08cb('0xa9')]=_0x432cb8['id'];if(_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x88')]){_0x29543c['where']=_[_0x08cb('0x99')](_0x29543c[_0x08cb('0x51')],{'$or':_['map'](_0x29543c[_0x08cb('0x4e')],function(_0x1336cd){var _0xeeb98a={};_0xeeb98a[_0x1336cd]={'$like':'%'+_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x88')]+'%'};return _0xeeb98a;})});}if(_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x7d')]){var _0x33097e=_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x7d')][_0x08cb('0x8c')](',');var _0x17513e={};_0x17513e[_0x33097e[0x0]]={'$gte':moment(_0x33097e[0x1])[_0x08cb('0xc8')](_0x08cb('0xf1'))};_0x29543c[_0x08cb('0x51')]=_[_0x08cb('0x99')](_0x29543c[_0x08cb('0x51')],_0x17513e);}_0x29543c=_[_0x08cb('0x99')]({},_0x29543c,_0x5c4329['options']);return db[_0x08cb('0xec')][_0x08cb('0x32')]({'where':_0x29543c['where']})[_0x08cb('0x24')](function(_0x2aceb8){_0xaa157e[_0x08cb('0x32')]=_0x2aceb8;if(_0x5c4329[_0x08cb('0x4b')][_0x08cb('0xad')]){_0x29543c[_0x08cb('0xae')]=[{'all':!![]}];}return db[_0x08cb('0xec')][_0x08cb('0xf2')](_0x29543c);})[_0x08cb('0x24')](function(_0x40f4aa){_0xaa157e[_0x08cb('0xf3')]=_0x40f4aa;return _0xaa157e;});}})[_0x08cb('0x24')](respondWithFilteredResult(_0xd0e730,_0x29543c))[_0x08cb('0x44')](handleError(_0xd0e730,null));};exports[_0x08cb('0xf4')]=function(_0x402dc0,_0x39b4fd,_0x53d533){var _0x553aa5={'where':{}},_0x1de7f5={},_0x5f51e3={'count':0x0,'rows':[]};return db[_0x08cb('0x46')][_0x08cb('0xbf')]({'where':{'id':_0x402dc0['params']['id']}})['then'](handleEntityNotFound(_0x39b4fd,null))[_0x08cb('0x24')](function(_0x1ad918){if(_0x1ad918){_0x1de7f5[_0x08cb('0x4a')]=_[_0x08cb('0x4c')](db[_0x08cb('0xec')][_0x08cb('0x47')]);_0x1de7f5[_0x08cb('0x4b')]=_[_0x08cb('0x4c')](_0x402dc0['query']);_0x1de7f5[_0x08cb('0x4d')]=_[_0x08cb('0xac')](_0x1de7f5[_0x08cb('0x4a')],_0x1de7f5[_0x08cb('0x4b')]);_0x553aa5['attributes']=_['intersection'](_0x1de7f5[_0x08cb('0x4a')],qs['fields'](_0x402dc0['query'][_0x08cb('0x4f')]));_0x553aa5[_0x08cb('0x4e')]=_0x553aa5[_0x08cb('0x4e')][_0x08cb('0x97')]?_0x553aa5[_0x08cb('0x4e')]:_0x1de7f5[_0x08cb('0x4a')];if(!_0x402dc0['query']['hasOwnProperty'](_0x08cb('0xf0'))){_0x553aa5[_0x08cb('0x34')]=qs['limit'](_0x402dc0[_0x08cb('0x4b')]['limit']);_0x553aa5[_0x08cb('0x33')]=qs[_0x08cb('0x33')](_0x402dc0['query'][_0x08cb('0x33')]);}_0x553aa5['order']=qs[_0x08cb('0x50')](_0x402dc0[_0x08cb('0x4b')][_0x08cb('0x50')]);_0x553aa5[_0x08cb('0x51')]=qs[_0x08cb('0x4d')](_[_0x08cb('0x52')](_0x402dc0[_0x08cb('0x4b')],_0x1de7f5[_0x08cb('0x4d')]));_0x553aa5[_0x08cb('0x51')][_0x08cb('0xa9')]=_0x1ad918['id'];if(_0x402dc0[_0x08cb('0x4b')][_0x08cb('0x88')]){_0x553aa5[_0x08cb('0x51')]=_[_0x08cb('0x99')](_0x553aa5['where'],{'$or':_[_0x08cb('0x3f')](_0x553aa5[_0x08cb('0x4e')],function(_0x2d9e5d){var _0xa02dc1={};_0xa02dc1[_0x2d9e5d]={'$like':'%'+_0x402dc0['query'][_0x08cb('0x88')]+'%'};return _0xa02dc1;})});}_0x553aa5['where']['secret']=![];if(_0x402dc0[_0x08cb('0x4b')]['id']){_0x553aa5[_0x08cb('0x51')]['id']={'$gt':_0x402dc0[_0x08cb('0x4b')]['id']};}_0x553aa5=_[_0x08cb('0x99')]({},_0x553aa5,_0x402dc0[_0x08cb('0xaf')]);return db[_0x08cb('0xec')][_0x08cb('0x32')]({'where':_0x553aa5[_0x08cb('0x51')]})[_0x08cb('0x24')](function(_0x3ed049){_0x5f51e3['count']=_0x3ed049;_0x553aa5[_0x08cb('0xae')]=[];if(_0x402dc0[_0x08cb('0x4b')]['includeAgent']){_0x553aa5[_0x08cb('0xae')][_0x08cb('0x43')]({'model':db['User'],'as':_0x08cb('0x75'),'attributes':['id',_0x08cb('0xd5'),_0x08cb('0xd4')]});}if(_0x402dc0['query'][_0x08cb('0xad')]){_0x553aa5[_0x08cb('0xae')]=[{'all':!![]}];}return db[_0x08cb('0xec')][_0x08cb('0xf2')](_0x553aa5);})['then'](function(_0x4a3bff){_0x5f51e3[_0x08cb('0xf3')]=_0x4a3bff;return _0x5f51e3;});}})['then'](respondWithFilteredResult(_0x39b4fd,_0x553aa5))['catch'](handleError(_0x39b4fd,null));};exports['addTags']=function(_0x430c58,_0x57a193,_0x90017a){return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x430c58[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x57a193,null))[_0x08cb('0x24')](function(_0x4c098a){if(_0x4c098a){return _0x4c098a[_0x08cb('0xf5')](_0x430c58[_0x08cb('0xb1')][_0x08cb('0xed')],_[_0x08cb('0xf6')](_0x430c58[_0x08cb('0xb1')],['ids','id'])||{})[_0x08cb('0xf7')](function(){return db[_0x08cb('0x73')][_0x08cb('0xf2')]({'attributes':['id',_0x08cb('0x3c'),_0x08cb('0x55')],'where':{'id':_0x430c58[_0x08cb('0xb1')]['ids']}});})[_0x08cb('0x24')](function(_0xad44e6){socket['emit'](_0x08cb('0xf8'),{'id':Number(_0x430c58['params']['id']),'tags':_0xad44e6||[]});return{'id':Number(_0x430c58[_0x08cb('0xb2')]['id']),'tags':_0xad44e6||[]};});}})[_0x08cb('0x24')](respondWithResult(_0x57a193,null))[_0x08cb('0x44')](handleError(_0x57a193,null));};exports[_0x08cb('0xf9')]=function(_0x469a6e,_0x42a9d1,_0x1556a0){return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x469a6e[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x42a9d1,null))['then'](function(_0x45d613){if(_0x45d613){return _0x45d613['removeTags'](_0x469a6e[_0x08cb('0x4b')]['ids']);}})[_0x08cb('0x24')](respondWithStatusCode(_0x42a9d1,null))[_0x08cb('0x44')](handleError(_0x42a9d1,null));};exports[_0x08cb('0xc2')]=function(_0x2686c7,_0x1e5e3f){var _0x5a5253=moment()[_0x08cb('0xfa')]()[_0x08cb('0x98')]();var _0x2a3e61=path[_0x08cb('0x8d')](config['root'],'server',_0x08cb('0xfb'),_0x08cb('0xfc'));var _0x145f59=path[_0x08cb('0x8d')](config[_0x08cb('0xc3')],_0x08cb('0xfd'),'files',_0x08cb('0xfe'));var _0x42f856=path[_0x08cb('0x8d')](_0x2a3e61,_0x5a5253);var _0x4d4116=util[_0x08cb('0xc8')](_0x08cb('0xff'),_0x2686c7['params']['id'],_0x5a5253);var _0x144244=path[_0x08cb('0x8d')](_0x2a3e61,_0x4d4116);var _0x5b6e4b=![];return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x2686c7[_0x08cb('0xb2')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x08cb('0xcb'),'attributes':['id',_0x08cb('0xb1'),_0x08cb('0x7c'),_0x08cb('0xd9'),_0x08cb('0xda'),_0x08cb('0x83')],'include':[{'model':db[_0x08cb('0x75')],'as':_0x08cb('0x75'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x08cb('0xcc')],'as':_0x08cb('0x6a'),'attributes':['id','firstName',_0x08cb('0x100')],'raw':!![]},{'model':db[_0x08cb('0xc1')],'as':_0x08cb('0xc1'),'raw':!![]}]},{'model':db[_0x08cb('0x101')],'as':_0x08cb('0x102'),'attributes':['id',_0x08cb('0x3c')]},{'model':db[_0x08cb('0x75')],'as':_0x08cb('0x103'),'attributes':['id',_0x08cb('0xd5')]}]})[_0x08cb('0x24')](handleEntityNotFound(_0x1e5e3f,null))[_0x08cb('0x24')](function(_0x5c272e){if(_0x5c272e){var _0x2a84c8=_0x5c272e[_0x08cb('0x104')]({'plain':!![]});_0x5b6e4b=!![];var _0x1fb5b0={'format':'A4','border':_0x08cb('0x105'),'header':{'height':_0x08cb('0x106'),'contents':{'first':_0x08cb('0x107')}},'footer':{'height':_0x08cb('0x108'),'contents':{'default':util[_0x08cb('0xc8')]('
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0x08cb('0xc8')](_0x08cb('0x109'),_0x08cb('0x10a'),_0x2a84c8['id']),moment()[_0x08cb('0xc8')](_0x08cb('0x10b'))[_0x08cb('0x98')]())}}};fs['mkdirSync'](_0x42f856);var _0x514165={'channel':_0x08cb('0x10a'),'account':_0x2a84c8[_0x08cb('0x102')]['name'],'agent':_0x2a84c8['Owner']?_0x2a84c8[_0x08cb('0x103')]['fullname']:'N.A.','createdAt':moment(_0x2a84c8[_0x08cb('0x7c')])[_0x08cb('0xc8')](_0x08cb('0xf1'))[_0x08cb('0x98')](),'closedAt':_0x2a84c8['closed']?moment(_0x2a84c8['closedAt'])[_0x08cb('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2a84c8['disposition'],'chatInfo':{'browser':_0x2a84c8[_0x08cb('0x10c')],'os':_0x2a84c8[_0x08cb('0x10d')],'referer':_0x2a84c8[_0x08cb('0x10e')],'customerIp':_0x2a84c8[_0x08cb('0x10f')],'customerPort':_0x2a84c8[_0x08cb('0x110')]?_0x2a84c8['customerPort']:_0x08cb('0x111')},'messages':_(_0x2a84c8[_0x08cb('0xcb')])[_0x08cb('0x112')]()[_0x08cb('0x88')]({'secret':![]})['map'](function(_0x481072){if(_0x481072[_0x08cb('0xc1')]){var _0x1922b3=path['join'](_0x145f59,_0x481072[_0x08cb('0xc1')][_0x08cb('0xbd')]);if(fs[_0x08cb('0x113')](_0x1922b3)){fs['createReadStream'](_0x1922b3)[_0x08cb('0x114')](fs[_0x08cb('0x115')](path['join'](_0x42f856,_0x481072[_0x08cb('0xc1')]['basename'])));}}return{'date':moment(_0x481072[_0x08cb('0x7c')])[_0x08cb('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x481072[_0x08cb('0xd9')]===_0x08cb('0x116')?_0x481072[_0x08cb('0x75')]?_0x481072['User']['fullname']:_0x08cb('0xd2'):_0x481072['Contact'][_0x08cb('0x117')]+(_0x481072['Contact'][_0x08cb('0x100')]?'\x20'+_0x481072[_0x08cb('0x6a')][_0x08cb('0x100')]:''),'body':_0x481072['Attachment']?_0x481072[_0x08cb('0xc1')][_0x08cb('0xbd')]:_0x481072[_0x08cb('0xb1')],'direction':_0x481072[_0x08cb('0xd9')]===_0x08cb('0x116')?'A':'C','secret':_0x481072[_0x08cb('0xda')],'read':_0x481072[_0x08cb('0x83')],'attachment':_0x481072[_0x08cb('0xc1')]};})['value']()};return ejs[_0x08cb('0x118')](path['join'](config[_0x08cb('0xc3')],_0x08cb('0xfd'),_0x08cb('0x119'),'downloadInteraction.html'),{'interaction':_0x514165})['then'](function(_0x207b16){return new BPromise(function(_0xbd81ff,_0x4125c0){pdf['create'](_0x207b16,_0x1fb5b0)['toFile'](path[_0x08cb('0x8d')](_0x42f856,'transcript-'+_0x2a84c8['id']+'-'+_0x5a5253+_0x08cb('0x11a')),function(_0x268bc9,_0x1a988d){if(_0x268bc9)return _0x4125c0(_0x268bc9);_0xbd81ff(_0x1a988d);});});});}})[_0x08cb('0x24')](function(){if(_0x5b6e4b){return new BPromise(function(_0x5afc07,_0x52c359){zipdir(_0x42f856,{'saveTo':_0x144244},function(_0x4a7c12,_0x40b17b){if(_0x4a7c12)return _0x52c359(_0x4a7c12);return _0x5afc07(_0x40b17b);});})[_0x08cb('0x24')](function(){return new BPromise(function(_0x5a5799,_0x1a1e14){rimraf(_0x42f856,function(_0x1c537c){if(_0x1c537c)_0x1a1e14(_0x1c537c);return _0x5a5799();});});})['then'](function(){return _0x1e5e3f[_0x08cb('0xc2')](_0x144244,_0x4d4116,function(_0x5e84cb){if(_0x5e84cb){console[_0x08cb('0x11b')]('err',_0x5e84cb);}else{fs[_0x08cb('0x11c')](_0x144244);}});});}else{return _0x1e5e3f[_0x08cb('0x2f')](0xc8);}})[_0x08cb('0x44')](handleError(_0x1e5e3f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 67e2a55..8088f92 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 _0x3aee=['getUsers','then','setDataValue','Users','map','findAll','length','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','update','remove'];(function(_0x1567e8,_0xa15c03){var _0x346fd1=function(_0x164c55){while(--_0x164c55){_0x1567e8['push'](_0x1567e8['shift']());}};_0x346fd1(++_0xa15c03);}(_0x3aee,0x180));var _0xe3ae=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x3aee[_0x59bcb1];return _0x4a737f;};'use strict';var EventEmitter=require(_0xe3ae('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xe3ae('0x1')];var ChatMessage=require(_0xe3ae('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe3ae('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe3ae('0x4'),'afterDestroy':_0xe3ae('0x5')};function emitEvent(_0x5c53a5){return function(_0x191e9d,_0x1b027b,_0x493181){_0x191e9d[_0xe3ae('0x6')]({'attributes':['id'],'raw':!![]})[_0xe3ae('0x7')](function(_0x437f24){_0x191e9d[_0xe3ae('0x8')](_0xe3ae('0x9'),_0x437f24[_0xe3ae('0xa')](function(_0xb405){return{'id':_0xb405['id']};}));return ChatMessage[_0xe3ae('0xb')]({'where':{'ChatInteractionId':_0x191e9d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe3ae('0x7')](function(_0x20fc75){_0x191e9d[_0xe3ae('0x8')]('unreadMessages',_0x20fc75[_0xe3ae('0xc')]);ChatInteractionEvents['emit'](_0x5c53a5+':'+_0x191e9d['id'],_0x191e9d);ChatInteractionEvents['emit'](_0x5c53a5,_0x191e9d);_0x493181(null);})['catch'](_0x493181(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xe3ae('0xd')](e,emitEvent(event));}}module[_0xe3ae('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x1ddc=['setDataValue','Users','findAll','unreadMessages','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ddc,0x7f));var _0xc1dd=function(_0x1a0d1f,_0x88e7db){_0x1a0d1f=_0x1a0d1f-0x0;var _0x1770a5=_0x1ddc[_0x1a0d1f];return _0x1770a5;};'use strict';var EventEmitter=require(_0xc1dd('0x0'));var ChatInteraction=require(_0xc1dd('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xc1dd('0x1'))['db'][_0xc1dd('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc1dd('0x3')](0x0);var events={'afterCreate':_0xc1dd('0x4'),'afterUpdate':'update','afterDestroy':_0xc1dd('0x5')};function emitEvent(_0x1bddc2){return function(_0x14f1ae,_0x16f445,_0x4223c1){_0x14f1ae[_0xc1dd('0x6')]({'attributes':['id'],'raw':!![]})[_0xc1dd('0x7')](function(_0x43e35c){_0x14f1ae[_0xc1dd('0x8')](_0xc1dd('0x9'),_0x43e35c['map'](function(_0x3a4155){return{'id':_0x3a4155['id']};}));return ChatMessage[_0xc1dd('0xa')]({'where':{'ChatInteractionId':_0x14f1ae['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc1dd('0x7')](function(_0x437759){_0x14f1ae[_0xc1dd('0x8')](_0xc1dd('0xb'),_0x437759['length']);ChatInteractionEvents['emit'](_0x1bddc2+':'+_0x14f1ae['id'],_0x14f1ae);ChatInteractionEvents[_0xc1dd('0xc')](_0x1bddc2,_0x14f1ae);_0x4223c1(null);})['catch'](_0x4223c1(null));};}for(var e in events){if(events[_0xc1dd('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xc1dd('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index bc0bb2f..0081628 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 _0x1332=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x2be0c4,_0x3dd330){var _0x23d84b=function(_0x578ed3){while(--_0x578ed3){_0x2be0c4['push'](_0x2be0c4['shift']());}};_0x23d84b(++_0x3dd330);}(_0x1332,0x19f));var _0x2133=function(_0x834778,_0x35abff){_0x834778=_0x834778-0x0;var _0x2c1f26=_0x1332[_0x834778];return _0x2c1f26;};'use strict';var _=require(_0x2133('0x0'));var util=require(_0x2133('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2133('0x2'));var BPromise=require(_0x2133('0x3'));var rp=require(_0x2133('0x4'));var fs=require('fs');var path=require(_0x2133('0x5'));var rimraf=require(_0x2133('0x6'));var config=require(_0x2133('0x7'));var attributes=require(_0x2133('0x8'));module[_0x2133('0x9')]=function(_0x2df87e,_0x554a75){return _0x2df87e[_0x2133('0xa')](_0x2133('0xb'),attributes,{'tableName':_0x2133('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33d547,_0xc43cdb,_0x4bfa63){if(_0x33d547[_0x2133('0xd')](_0x2133('0xe'))){_0x33d547[_0x2133('0xf')]=moment()[_0x2133('0x10')](_0x2133('0x11'));}_0x4bfa63(null,_0x33d547);}},'charset':'utf8mb4','collate':_0x2133('0x12')});};
\ No newline at end of file
+var _0x147d=['define','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x147d,0x193));var _0xd147=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x147d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd147('0x0'));var util=require(_0xd147('0x1'));var logger=require('../../config/logger')(_0xd147('0x2'));var moment=require(_0xd147('0x3'));var BPromise=require(_0xd147('0x4'));var rp=require(_0xd147('0x5'));var fs=require('fs');var path=require(_0xd147('0x6'));var rimraf=require(_0xd147('0x7'));var config=require(_0xd147('0x8'));var attributes=require(_0xd147('0x9'));module[_0xd147('0xa')]=function(_0x1cbc35,_0x43d516){return _0x1cbc35[_0xd147('0xb')]('ChatInteraction',attributes,{'tableName':_0xd147('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x179c80,_0x148aab,_0x4e5f27){if(_0x179c80[_0xd147('0xd')](_0xd147('0xe'))){_0x179c80['closedAt']=moment()[_0xd147('0xf')](_0xd147('0x10'));}_0x4e5f27(null,_0x179c80);}},'charset':'utf8mb4','collate':_0xd147('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 486a5d0..7de92d0 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 _0xa3e5=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','socket.io-emitter','redis','./chatInteraction.socket','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','lodash','moment'];(function(_0x1fae35,_0x385d6a){var _0x22f1a7=function(_0x181ef9){while(--_0x181ef9){_0x1fae35['push'](_0x1fae35['shift']());}};_0x22f1a7(++_0x385d6a);}(_0xa3e5,0x198));var _0x5a3e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa3e5[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5a3e('0x0'));var util=require('util');var moment=require(_0x5a3e('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a3e('0x2'));var fs=require('fs');var Redis=require(_0x5a3e('0x3'));var db=require(_0x5a3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a3e('0x5'));var config=require('../../config/environment');var jayson=require(_0x5a3e('0x6'));var client=jayson[_0x5a3e('0x7')][_0x5a3e('0x8')]({'port':0x232a});config['redis']=_[_0x5a3e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5a3e('0xa'))(new Redis(config[_0x5a3e('0xb')]));require(_0x5a3e('0xc'))[_0x5a3e('0xd')](socket);function respondWithRpcPromise(_0x2ab45e,_0x5c44b4,_0x1fbe2e){return new BPromise(function(_0x2826ac,_0x3e01cd){return client['request'](_0x2ab45e,_0x1fbe2e)[_0x5a3e('0xe')](function(_0x45efe5){logger[_0x5a3e('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x5c44b4,_0x5a3e('0x10'));logger[_0x5a3e('0x11')](_0x5a3e('0x12'),_0x5c44b4,'request\x20sent',JSON[_0x5a3e('0x13')](_0x45efe5));if(_0x45efe5[_0x5a3e('0x14')]){if(_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x15')]===0x1f4){logger[_0x5a3e('0x14')](_0x5a3e('0x16'),_0x5c44b4,_0x45efe5['error']['message']);return _0x3e01cd(_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x17')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5c44b4,_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x17')]);return _0x2826ac(_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x17')]);}else{logger['info'](_0x5a3e('0x16'),_0x5c44b4,_0x5a3e('0x10'));_0x2826ac(_0x45efe5[_0x5a3e('0x18')]['message']);}})[_0x5a3e('0x19')](function(_0xb971b8){logger[_0x5a3e('0x14')](_0x5a3e('0x16'),_0x5c44b4,_0xb971b8);_0x3e01cd(_0xb971b8);});});}exports[_0x5a3e('0x1a')]=function(_0x8bc4da){var _0x12b3a3=this;return new Promise(function(_0x3d9432,_0x468097){return db[_0x5a3e('0x1b')][_0x5a3e('0x1c')](_0x8bc4da[_0x5a3e('0x1d')],{'raw':_0x8bc4da['options']?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8bc4da[_0x5a3e('0x1e')]?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x20')]||null:null,'attributes':_0x8bc4da['options']?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x21')]||null:null,'limit':_0x8bc4da[_0x5a3e('0x1e')]?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x22')]||null:null})[_0x5a3e('0xe')](function(_0x18bb50){logger['info'](_0x5a3e('0x1a'),_0x8bc4da);logger[_0x5a3e('0x11')](_0x5a3e('0x1a'),_0x8bc4da,JSON['stringify'](_0x18bb50));_0x3d9432(_0x18bb50);})[_0x5a3e('0x19')](function(_0x24e07e){logger[_0x5a3e('0x14')]('UpdateChatInteraction',_0x24e07e[_0x5a3e('0x17')],_0x8bc4da);_0x468097(_0x12b3a3[_0x5a3e('0x14')](0x1f4,_0x24e07e[_0x5a3e('0x17')]));});});};exports[_0x5a3e('0x23')]=function(_0x9c19e1){return new Promise(function(_0x41e565,_0xf23c24){return db[_0x5a3e('0x1b')][_0x5a3e('0x24')]({'where':_0x9c19e1[_0x5a3e('0x1e')]?_0x9c19e1[_0x5a3e('0x1e')][_0x5a3e('0x20')]||null:null})['then'](function(_0x23af6f){if(_0x23af6f){return _0x23af6f[_0x5a3e('0x25')](_0x9c19e1['body']['ids'],_[_0x5a3e('0x26')](_0x9c19e1[_0x5a3e('0x1d')],[_0x5a3e('0x27'),'id'])||{});}})['spread'](function(_0x5c589c){logger[_0x5a3e('0xf')](_0x5a3e('0x28'),_0x9c19e1);logger[_0x5a3e('0x11')]('AddTags',_0x9c19e1,JSON[_0x5a3e('0x13')](_0x5c589c));_0x41e565(_0x5c589c);})[_0x5a3e('0x19')](function(_0x56fd23){logger[_0x5a3e('0x14')](_0x5a3e('0x28'),_0x56fd23[_0x5a3e('0x17')],_0x9c19e1);_0xf23c24(_this[_0x5a3e('0x14')](0x1f4,_0x56fd23[_0x5a3e('0x17')]));});});};
\ No newline at end of file
+var _0x84f3=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','options','raw','limit','find','where','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1b123b,_0x283629){var _0x1bb89c=function(_0x163d67){while(--_0x163d67){_0x1b123b['push'](_0x1b123b['shift']());}};_0x1bb89c(++_0x283629);}(_0x84f3,0x1b9));var _0x384f=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x84f3[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x384f('0x0'));var util=require(_0x384f('0x1'));var moment=require(_0x384f('0x2'));var BPromise=require(_0x384f('0x3'));var rs=require(_0x384f('0x4'));var fs=require('fs');var Redis=require(_0x384f('0x5'));var db=require(_0x384f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x384f('0x7'))(_0x384f('0x8'));var config=require(_0x384f('0x9'));var jayson=require(_0x384f('0xa'));var client=jayson[_0x384f('0xb')][_0x384f('0xc')]({'port':0x232a});config[_0x384f('0xd')]=_[_0x384f('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x384f('0xd')]));require(_0x384f('0xf'))[_0x384f('0x10')](socket);function respondWithRpcPromise(_0x55e70f,_0xa61bd7,_0x442514){return new BPromise(function(_0x50a497,_0x17a14e){return client['request'](_0x55e70f,_0x442514)[_0x384f('0x11')](function(_0x914913){logger[_0x384f('0x12')](_0x384f('0x13'),_0xa61bd7,_0x384f('0x14'));logger[_0x384f('0x15')](_0x384f('0x16'),_0xa61bd7,_0x384f('0x14'),JSON[_0x384f('0x17')](_0x914913));if(_0x914913[_0x384f('0x18')]){if(_0x914913[_0x384f('0x18')][_0x384f('0x19')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xa61bd7,_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);return _0x17a14e(_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);}logger[_0x384f('0x18')](_0x384f('0x13'),_0xa61bd7,_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);return _0x50a497(_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);}else{logger['info'](_0x384f('0x13'),_0xa61bd7,_0x384f('0x14'));_0x50a497(_0x914913[_0x384f('0x1b')][_0x384f('0x1a')]);}})['catch'](function(_0x443c05){logger[_0x384f('0x18')](_0x384f('0x13'),_0xa61bd7,_0x443c05);_0x17a14e(_0x443c05);});});}exports[_0x384f('0x1c')]=function(_0x1360d3){var _0x2b43f3=this;return new Promise(function(_0x53277c,_0xd6b92f){return db[_0x384f('0x1d')][_0x384f('0x1e')](_0x1360d3['body'],{'raw':_0x1360d3['options']?_0x1360d3[_0x384f('0x1f')][_0x384f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1360d3[_0x384f('0x1f')]?_0x1360d3['options']['where']||null:null,'attributes':_0x1360d3[_0x384f('0x1f')]?_0x1360d3['options']['attributes']||null:null,'limit':_0x1360d3[_0x384f('0x1f')]?_0x1360d3[_0x384f('0x1f')][_0x384f('0x21')]||null:null})[_0x384f('0x11')](function(_0x3969a1){logger[_0x384f('0x12')](_0x384f('0x1c'),_0x1360d3);logger['debug'](_0x384f('0x1c'),_0x1360d3,JSON['stringify'](_0x3969a1));_0x53277c(_0x3969a1);})['catch'](function(_0x39774a){logger[_0x384f('0x18')](_0x384f('0x1c'),_0x39774a['message'],_0x1360d3);_0xd6b92f(_0x2b43f3[_0x384f('0x18')](0x1f4,_0x39774a[_0x384f('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x38f4d8){return new Promise(function(_0x2ed48b,_0x2e80c){return db[_0x384f('0x1d')][_0x384f('0x22')]({'where':_0x38f4d8[_0x384f('0x1f')]?_0x38f4d8[_0x384f('0x1f')][_0x384f('0x23')]||null:null})[_0x384f('0x11')](function(_0x28f016){if(_0x28f016){return _0x28f016[_0x384f('0x24')](_0x38f4d8[_0x384f('0x25')][_0x384f('0x26')],_[_0x384f('0x27')](_0x38f4d8['body'],['ids','id'])||{});}})[_0x384f('0x28')](function(_0xeeeef1){logger[_0x384f('0x12')](_0x384f('0x29'),_0x38f4d8);logger[_0x384f('0x15')]('AddTags',_0x38f4d8,JSON[_0x384f('0x17')](_0xeeeef1));_0x2ed48b(_0xeeeef1);})['catch'](function(_0x3c9662){logger['error'](_0x384f('0x29'),_0x3c9662[_0x384f('0x1a')],_0x38f4d8);_0x2e80c(_this[_0x384f('0x18')](0x1f4,_0x3c9662['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index cb5cba2..c9f7b2c 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 _0x614d=['chatInteraction:','save','update','removeListener','register'];(function(_0x29a821,_0x5ae8d3){var _0xae076c=function(_0x214fa8){while(--_0x214fa8){_0x29a821['push'](_0x29a821['shift']());}};_0xae076c(++_0x5ae8d3);}(_0x614d,0x150));var _0xd614=function(_0x2e8781,_0x3d023c){_0x2e8781=_0x2e8781-0x0;var _0x5e098c=_0x614d[_0x2e8781];return _0x5e098c;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xd614('0x0'),'remove',_0xd614('0x1')];function createListener(_0x5113eb,_0x409833){return function(_0x1b342c){_0x409833['emit'](_0x5113eb,_0x1b342c);};}function removeListener(_0x32e6c7,_0x4d945f){return function(){ChatInteractionEvents[_0xd614('0x2')](_0x32e6c7,_0x4d945f);};}exports[_0xd614('0x3')]=function(_0x1d3b5d){for(var _0x328ad6=0x0,_0x287a22=events['length'];_0x328ad6<_0x287a22;_0x328ad6++){var _0x3cc48e=events[_0x328ad6];var _0x4c4d02=createListener(_0xd614('0x4')+_0x3cc48e,_0x1d3b5d);ChatInteractionEvents['on'](_0x3cc48e,_0x4c4d02);}};
\ No newline at end of file
+var _0xa3c3=['remove','update','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0xa3c3,0xd7));var _0x3a3c=function(_0x14631b,_0x472a16){_0x14631b=_0x14631b-0x0;var _0x568bfc=_0xa3c3[_0x14631b];return _0x568bfc;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x3a3c('0x0'),_0x3a3c('0x1'),_0x3a3c('0x2')];function createListener(_0x1d2340,_0x461962){return function(_0x42373f){_0x461962[_0x3a3c('0x3')](_0x1d2340,_0x42373f);};}function removeListener(_0x2cebe8,_0x503969){return function(){ChatInteractionEvents[_0x3a3c('0x4')](_0x2cebe8,_0x503969);};}exports[_0x3a3c('0x5')]=function(_0x50ea5a){for(var _0x36a872=0x0,_0x4d7f32=events[_0x3a3c('0x6')];_0x36a872<_0x4d7f32;_0x36a872++){var _0x513dc9=events[_0x36a872];var _0x573198=createListener(_0x3a3c('0x7')+_0x513dc9,_0x50ea5a);ChatInteractionEvents['on'](_0x513dc9,_0x573198);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 736bd13..439e562 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 _0x2cfc=['../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','removeTags','exports','multer','path','connect-timeout','express','Router'];(function(_0x114a66,_0x56bb5b){var _0x2544c7=function(_0x531d03){while(--_0x531d03){_0x114a66['push'](_0x114a66['shift']());}};_0x2544c7(++_0x56bb5b);}(_0x2cfc,0xe6));var _0xc2cf=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x2cfc[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0xc2cf('0x0'));var util=require('util');var path=require(_0xc2cf('0x1'));var timeout=require(_0xc2cf('0x2'));var express=require(_0xc2cf('0x3'));var router=express[_0xc2cf('0x4')]();var auth=require(_0xc2cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc2cf('0x6'));var controller=require(_0xc2cf('0x7'));router['get']('/',auth[_0xc2cf('0x8')](),controller[_0xc2cf('0x9')]);router['get'](_0xc2cf('0xa'),auth[_0xc2cf('0x8')](),controller['describe']);router[_0xc2cf('0xb')](_0xc2cf('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xc2cf('0xd')]);router[_0xc2cf('0xb')](_0xc2cf('0xe'),auth[_0xc2cf('0xf')](),controller[_0xc2cf('0x10')]);router[_0xc2cf('0xb')](_0xc2cf('0x11'),auth[_0xc2cf('0x8')](),controller[_0xc2cf('0x12')]);router[_0xc2cf('0xb')](_0xc2cf('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xc2cf('0x14'),auth['isAuthenticated'](),controller[_0xc2cf('0x15')]);router[_0xc2cf('0x16')]('/',auth[_0xc2cf('0x8')](),controller['create']);var upload=multer({'storage':multer[_0xc2cf('0x17')]({'destination':function(_0x2cf85f,_0x233f1a,_0x549be9){_0x549be9(null,path['join'](config[_0xc2cf('0x18')],_0xc2cf('0x19')));},'filename':function(_0x23737e,_0x31c8b9,_0x41b859){_0x41b859(null,util['format'](_0xc2cf('0x1a'),Date[_0xc2cf('0x1b')](),_0x31c8b9[_0xc2cf('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc2cf('0x16')](_0xc2cf('0x1d'),upload[_0xc2cf('0x1e')](_0xc2cf('0x1f')),controller[_0xc2cf('0x20')]);router[_0xc2cf('0x16')](_0xc2cf('0x11'),auth[_0xc2cf('0xf')](),controller['addMessage']);router[_0xc2cf('0x16')](_0xc2cf('0x21'),auth[_0xc2cf('0x8')](),interaction[_0xc2cf('0x22')](_0xc2cf('0x23'),'chatinteraction:addtags'),controller[_0xc2cf('0x24')]);router[_0xc2cf('0x25')](_0xc2cf('0xc'),auth[_0xc2cf('0x8')](),interaction[_0xc2cf('0x22')]('chat',_0xc2cf('0x26')),controller['update']);router[_0xc2cf('0x25')](_0xc2cf('0x27'),controller[_0xc2cf('0x28')]);router[_0xc2cf('0x25')](_0xc2cf('0x29'),auth[_0xc2cf('0xf')](),controller[_0xc2cf('0x2a')]);router[_0xc2cf('0x25')](_0xc2cf('0x2b'),controller[_0xc2cf('0x2c')]);router['delete']('/:id',auth[_0xc2cf('0x8')](),interaction[_0xc2cf('0x22')](_0xc2cf('0x23'),'chatinteraction:destroy'),controller['destroy']);router['delete'](_0xc2cf('0x21'),auth[_0xc2cf('0x8')](),controller[_0xc2cf('0x2d')]);module[_0xc2cf('0x2e')]=router;
\ No newline at end of file
+var _0xf241=['/:id/attachment_download','attachmentDownload','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','attachmentUpload','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized'];(function(_0x2bf7cf,_0x5a28fe){var _0x3c2eab=function(_0x3b77e0){while(--_0x3b77e0){_0x2bf7cf['push'](_0x2bf7cf['shift']());}};_0x3c2eab(++_0x5a28fe);}(_0xf241,0x7b));var _0x1f24=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf241[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x1f24('0x0'));var util=require(_0x1f24('0x1'));var path=require(_0x1f24('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f24('0x3'));var router=express[_0x1f24('0x4')]();var auth=require(_0x1f24('0x5'));var interaction=require(_0x1f24('0x6'));var config=require(_0x1f24('0x7'));var controller=require(_0x1f24('0x8'));router['get']('/',auth[_0x1f24('0x9')](),controller['index']);router[_0x1f24('0xa')](_0x1f24('0xb'),auth[_0x1f24('0x9')](),controller[_0x1f24('0xc')]);router[_0x1f24('0xa')](_0x1f24('0xd'),auth[_0x1f24('0xe')](),controller['show']);router[_0x1f24('0xa')](_0x1f24('0xf'),auth[_0x1f24('0xe')](),controller[_0x1f24('0x10')]);router['get']('/:id/messages',auth[_0x1f24('0x9')](),controller['getMessages']);router[_0x1f24('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x1f24('0xa')](_0x1f24('0x11'),auth[_0x1f24('0x9')](),controller[_0x1f24('0x12')]);router[_0x1f24('0x13')]('/',auth[_0x1f24('0x9')](),controller[_0x1f24('0x14')]);var upload=multer({'storage':multer[_0x1f24('0x15')]({'destination':function(_0x581506,_0x39de98,_0x354669){_0x354669(null,path[_0x1f24('0x16')](config[_0x1f24('0x17')],_0x1f24('0x18')));},'filename':function(_0x48940f,_0x15daa8,_0x6da09a){_0x6da09a(null,util[_0x1f24('0x19')](_0x1f24('0x1a'),Date[_0x1f24('0x1b')](),_0x15daa8[_0x1f24('0x1c')][_0x1f24('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single']('file'),controller[_0x1f24('0x1e')]);router[_0x1f24('0x13')]('/:id/messages',auth[_0x1f24('0xe')](),controller['addMessage']);router[_0x1f24('0x13')](_0x1f24('0x1f'),auth[_0x1f24('0x9')](),interaction[_0x1f24('0x20')](_0x1f24('0x21'),'chatinteraction:addtags'),controller[_0x1f24('0x22')]);router[_0x1f24('0x23')](_0x1f24('0xd'),auth['isAuthenticated'](),interaction[_0x1f24('0x20')](_0x1f24('0x21'),_0x1f24('0x24')),controller[_0x1f24('0x25')]);router['put'](_0x1f24('0x26'),controller[_0x1f24('0x27')]);router['put']('/:id/abandon',auth[_0x1f24('0xe')](),controller[_0x1f24('0x28')]);router[_0x1f24('0x23')](_0x1f24('0x29'),controller[_0x1f24('0x2a')]);router[_0x1f24('0x2b')](_0x1f24('0xd'),auth[_0x1f24('0x9')](),interaction[_0x1f24('0x20')](_0x1f24('0x21'),_0x1f24('0x2c')),controller['destroy']);router['delete'](_0x1f24('0x1f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x1f24('0x2d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 0bb26e5..bd9abcb 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 _0x0295=['sequelize','medium'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0295,0x1f0));var _0x5029=function(_0x83609a,_0x4623de){_0x83609a=_0x83609a-0x0;var _0x3de3aa=_0x0295[_0x83609a];return _0x3de3aa;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x5029('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x30eeaf,_0x352238){var _0x1687da=function(_0x4ee15d){while(--_0x4ee15d){_0x30eeaf['push'](_0x30eeaf['shift']());}};_0x1687da(++_0x352238);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5cecc0,_0x524daf){_0x5cecc0=_0x5cecc0-0x0;var _0x4739a8=_0x5f2f[_0x5cecc0];return _0x4739a8;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 6c8676b..401ca6d 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 _0x4205=['where','pick','filter','VIRTUAL','options','ChatInternalMessage','count','includeAll','include','findAll','rows','show','params','keys','merge','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','isEmpty','length','push','FromId','ToId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x136985,_0x3d07bd){var _0x4c139d=function(_0x2feddd){while(--_0x2feddd){_0x136985['push'](_0x136985['shift']());}};_0x4c139d(++_0x3d07bd);}(_0x4205,0x1e3));var _0x5420=function(_0x5baa94,_0x592538){_0x5baa94=_0x5baa94-0x0;var _0x14329a=_0x4205[_0x5baa94];return _0x14329a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5420('0x0'));var zipdir=require(_0x5420('0x1'));var jsonpatch=require(_0x5420('0x2'));var rp=require(_0x5420('0x3'));var moment=require(_0x5420('0x4'));var BPromise=require(_0x5420('0x5'));var Mustache=require(_0x5420('0x6'));var util=require(_0x5420('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5420('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5420('0x9'));var jsforce=require(_0x5420('0xa'));var deskjs=require(_0x5420('0xb'));var toCsv=require(_0x5420('0xc'));var querystring=require(_0x5420('0xd'));var Papa=require('papaparse');var Redis=require(_0x5420('0xe'));var authService=require(_0x5420('0xf'));var qs=require(_0x5420('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5420('0x11'));var logger=require('../../config/logger')(_0x5420('0x12'));var utils=require(_0x5420('0x13'));var config=require(_0x5420('0x14'));var db=require(_0x5420('0x15'))['db'];config[_0x5420('0x16')]=_[_0x5420('0x17')](config[_0x5420('0x16')],{'host':_0x5420('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5420('0x16')]));require(_0x5420('0x19'))[_0x5420('0x1a')](socket);function respondWithStatusCode(_0x4b0bf0,_0x1b2eb5){_0x1b2eb5=_0x1b2eb5||0xcc;return function(_0x31690b){if(_0x31690b){return _0x4b0bf0[_0x5420('0x1b')](_0x1b2eb5);}return _0x4b0bf0[_0x5420('0x1c')](_0x1b2eb5)[_0x5420('0x1d')]();};}function respondWithResult(_0x304a6d,_0x2217f6){_0x2217f6=_0x2217f6||0xc8;return function(_0x1abf57){if(_0x1abf57){return _0x304a6d[_0x5420('0x1c')](_0x2217f6)[_0x5420('0x1e')](_0x1abf57);}};}function respondWithFilteredResult(_0x1604f7,_0x3fd3c1){return function(_0x26d227){if(_0x26d227){var _0x4c43e6=_0x26d227['count'],_0x5957df=_0x3fd3c1[_0x5420('0x1f')],_0x1adbba=_0x3fd3c1[_0x5420('0x1f')]+_0x3fd3c1[_0x5420('0x20')],_0x2ab4bd;if(_0x1adbba>=_0x4c43e6){_0x1adbba=_0x4c43e6;_0x2ab4bd=0xc8;}else{_0x2ab4bd=0xce;}_0x1604f7[_0x5420('0x1c')](_0x2ab4bd);return _0x1604f7['set'](_0x5420('0x21'),_0x5957df+'-'+_0x1adbba+'/'+_0x4c43e6)[_0x5420('0x1e')](_0x26d227);}return null;};}function patchUpdates(_0xdf4854){return function(_0x1d6524){try{jsonpatch[_0x5420('0x22')](_0x1d6524,_0xdf4854,!![]);}catch(_0x2d85dd){return BPromise['reject'](_0x2d85dd);}return _0x1d6524[_0x5420('0x23')]();};}function saveUpdates(_0x4c940f,_0x56dee9){return function(_0x535a05){if(_0x535a05){return _0x535a05[_0x5420('0x24')](_0x4c940f)[_0x5420('0x25')](function(_0x1f1cee){return _0x1f1cee;});}return null;};}function removeEntity(_0x1cdf70,_0x19fbef){return function(_0x142c67){if(_0x142c67){return _0x142c67[_0x5420('0x26')]()[_0x5420('0x25')](function(){_0x1cdf70[_0x5420('0x1c')](0xcc)[_0x5420('0x1d')]();});}};}function handleEntityNotFound(_0x20666b,_0x2d061f){return function(_0xc1937c){if(!_0xc1937c){_0x20666b[_0x5420('0x1b')](0x194);}return _0xc1937c;};}function handleError(_0x566b87,_0x70cbe7){_0x70cbe7=_0x70cbe7||0x1f4;return function(_0x49c94b){logger[_0x5420('0x27')](_0x49c94b[_0x5420('0x28')]);if(_0x49c94b[_0x5420('0x29')]){delete _0x49c94b[_0x5420('0x29')];}_0x566b87['status'](_0x70cbe7)['send'](_0x49c94b);};}exports[_0x5420('0x2a')]=function(_0x1f08ab,_0x523c61){var _0x12980f={},_0x5999d1={},_0x5792f4={'count':0x0,'rows':[]};var _0x325061=_[_0x5420('0x2b')](db['ChatInternalMessage'][_0x5420('0x2c')],function(_0x1f14bc){return{'name':_0x1f14bc['fieldName'],'type':_0x1f14bc[_0x5420('0x2d')][_0x5420('0x2e')]};});_0x5999d1[_0x5420('0x2f')]=_[_0x5420('0x2b')](_0x325061,_0x5420('0x29'));_0x5999d1[_0x5420('0x30')]=_['keys'](_0x1f08ab[_0x5420('0x30')]);_0x5999d1[_0x5420('0x31')]=_[_0x5420('0x32')](_0x5999d1[_0x5420('0x2f')],_0x5999d1[_0x5420('0x30')]);_0x12980f['attributes']=_[_0x5420('0x32')](_0x5999d1[_0x5420('0x2f')],qs['fields'](_0x1f08ab['query'][_0x5420('0x33')]));_0x12980f[_0x5420('0x34')]=_0x12980f[_0x5420('0x34')]['length']?_0x12980f[_0x5420('0x34')]:_0x5999d1[_0x5420('0x2f')];if(!_0x1f08ab[_0x5420('0x30')][_0x5420('0x35')](_0x5420('0x36'))){_0x12980f[_0x5420('0x20')]=qs['limit'](_0x1f08ab[_0x5420('0x30')][_0x5420('0x20')]);_0x12980f[_0x5420('0x1f')]=qs[_0x5420('0x1f')](_0x1f08ab[_0x5420('0x30')][_0x5420('0x1f')]);}_0x12980f[_0x5420('0x37')]=qs[_0x5420('0x38')](_0x1f08ab[_0x5420('0x30')]['sort']);_0x12980f[_0x5420('0x39')]=qs[_0x5420('0x31')](_[_0x5420('0x3a')](_0x1f08ab[_0x5420('0x30')],_0x5999d1[_0x5420('0x31')]));if(_0x1f08ab[_0x5420('0x30')][_0x5420('0x3b')]){_0x12980f[_0x5420('0x39')]=_['merge'](_0x12980f[_0x5420('0x39')],{'$or':_[_0x5420('0x2b')](_0x325061,function(_0x44a4ed){if(_0x44a4ed[_0x5420('0x2d')]['key']!==_0x5420('0x3c')){var _0x66075c={};_0x66075c[_0x44a4ed['field']]={'$like':'%'+_0x1f08ab['query'][_0x5420('0x3b')]+'%'};return _0x66075c;}})});}_0x12980f=_['merge']({},_0x12980f,_0x1f08ab[_0x5420('0x3d')]);var _0x517381={'where':_0x12980f[_0x5420('0x39')]};return db[_0x5420('0x3e')][_0x5420('0x3f')](_0x517381)[_0x5420('0x25')](function(_0x4ba311){_0x5792f4[_0x5420('0x3f')]=_0x4ba311;if(_0x1f08ab[_0x5420('0x30')][_0x5420('0x40')]){_0x12980f[_0x5420('0x41')]=[{'all':!![]}];}return db[_0x5420('0x3e')][_0x5420('0x42')](_0x12980f);})[_0x5420('0x25')](function(_0xd8b2aa){_0x5792f4[_0x5420('0x43')]=_0xd8b2aa;return _0x5792f4;})[_0x5420('0x25')](respondWithFilteredResult(_0x523c61,_0x12980f))['catch'](handleError(_0x523c61,null));};exports[_0x5420('0x44')]=function(_0x3bdd6a,_0xf429d9){var _0x4d1012={'raw':!![],'where':{'id':_0x3bdd6a[_0x5420('0x45')]['id']}},_0x594e8d={};_0x594e8d['model']=_[_0x5420('0x46')](db[_0x5420('0x3e')]['rawAttributes']);_0x594e8d['query']=_['keys'](_0x3bdd6a[_0x5420('0x30')]);_0x594e8d[_0x5420('0x31')]=_[_0x5420('0x32')](_0x594e8d[_0x5420('0x2f')],_0x594e8d[_0x5420('0x30')]);_0x4d1012[_0x5420('0x34')]=_[_0x5420('0x32')](_0x594e8d['model'],qs[_0x5420('0x33')](_0x3bdd6a[_0x5420('0x30')][_0x5420('0x33')]));_0x4d1012[_0x5420('0x34')]=_0x4d1012['attributes']['length']?_0x4d1012[_0x5420('0x34')]:_0x594e8d[_0x5420('0x2f')];if(_0x3bdd6a['query'][_0x5420('0x40')]){_0x4d1012[_0x5420('0x41')]=[{'all':!![]}];}_0x4d1012=_[_0x5420('0x47')]({},_0x4d1012,_0x3bdd6a[_0x5420('0x3d')]);return db[_0x5420('0x3e')][_0x5420('0x48')](_0x4d1012)[_0x5420('0x25')](handleEntityNotFound(_0xf429d9,null))[_0x5420('0x25')](respondWithResult(_0xf429d9,null))['catch'](handleError(_0xf429d9,null));};exports[_0x5420('0x49')]=function(_0x34acf2,_0xf4be17){return db[_0x5420('0x3e')][_0x5420('0x49')](_0x34acf2['body'],{})[_0x5420('0x25')](respondWithResult(_0xf4be17,0xc9))['catch'](handleError(_0xf4be17,null));};exports[_0x5420('0x24')]=function(_0x7f9dc6,_0x27e522){if(_0x7f9dc6[_0x5420('0x4a')]['id']){delete _0x7f9dc6['body']['id'];}return db[_0x5420('0x3e')][_0x5420('0x48')]({'where':{'id':_0x7f9dc6['params']['id']}})[_0x5420('0x25')](handleEntityNotFound(_0x27e522,null))['then'](saveUpdates(_0x7f9dc6['body'],null))['then'](respondWithResult(_0x27e522,null))['catch'](handleError(_0x27e522,null));};exports[_0x5420('0x26')]=function(_0x4cfcb1,_0x1c313d){return db[_0x5420('0x3e')]['find']({'where':{'id':_0x4cfcb1[_0x5420('0x45')]['id']}})[_0x5420('0x25')](handleEntityNotFound(_0x1c313d,null))[_0x5420('0x25')](removeEntity(_0x1c313d,null))[_0x5420('0x4b')](handleError(_0x1c313d,null));};exports[_0x5420('0x4c')]=function(_0xe6d374,_0x45658e){return db[_0x5420('0x3e')][_0x5420('0x4c')]()['then'](respondWithResult(_0x45658e,null))['catch'](handleError(_0x45658e,null));};function wrapUser(_0x29c36c){return function(_0xef9e49){var _0x39a516=_0x29c36c[_0x5420('0x4d')]({'plain':!![]});_0x39a516[_0x5420('0x4e')]=[];if(_0xef9e49){_0x39a516[_0x5420('0x4f')]=_0xef9e49[_0x5420('0x50')];_0x39a516['lastMessage']=_0xef9e49;}else{_0x39a516[_0x5420('0x4f')]=moment(0x0)[_0x5420('0x51')](_0x5420('0x52'));_0x39a516[_0x5420('0x53')]={};}return _0x39a516;};}exports[_0x5420('0x54')]=function(_0x16e214,_0x4f336e,_0xf71ad){var _0x3842d4=[];return db[_0x5420('0x55')][_0x5420('0x42')]({'where':{'role':[_0x5420('0x56'),_0x5420('0x57'),_0x5420('0x58')]},'attributes':['id',_0x5420('0x59'),'name','role',_0x5420('0x5a'),'internal',_0x5420('0x5b'),_0x5420('0x5c'),_0x5420('0x5d'),_0x5420('0x5e')],'order':qs[_0x5420('0x38')]('-online'),'include':[{'model':db[_0x5420('0x5f')],'as':_0x5420('0x60'),'attributes':['id',_0x5420('0x29'),'type'],'through':{'attributes':[]}}]})[_0x5420('0x25')](function(_0x423f43){if(_0x423f43){var _0x152b04=_0x16e214[_0x5420('0x58')][_0x5420('0x4d')]({'plain':!![]});if(!_0x152b04)throw new Error(_0x5420('0x61'));if(_0x152b04[_0x5420('0x62')]===_0x5420('0x58')){return db['UserProfileSection'][_0x5420('0x48')]({'where':{'name':_0x5420('0x63'),'userProfileId':_0x152b04[_0x5420('0x64')]},'raw':!![]})[_0x5420('0x25')](function(_0x171fbe){if(_0x171fbe){if(_0x171fbe['autoAssociation']===0x0){return db['UserProfileResource'][_0x5420('0x42')]({'where':{'sectionId':_0x171fbe['id']},'raw':!![]})['then'](function(_0x53a410){var _0x2e13e0=[];if(_[_0x5420('0x65')](_0x53a410)){_0x2e13e0=_['filter'](_0x423f43,function(_0x2b66c4){if(_0x2b66c4[_0x5420('0x62')]!==_0x5420('0x56')){return _0x2b66c4;}});return _0x2e13e0;}else{for(var _0x3ba18d=0x0;_0x3ba18d<_0x423f43[_0x5420('0x66')];_0x3ba18d++){var _0x3626e3=_0x423f43[_0x3ba18d];if(_0x3626e3[_0x5420('0x62')]===_0x5420('0x56')){var _0x314bdb=_[_0x5420('0x48')](_0x53a410,function(_0x4bb46b){return _0x4bb46b['resourceId']===_0x3626e3['id'];});if(_0x314bdb)_0x2e13e0[_0x5420('0x67')](_0x3626e3);}else{_0x2e13e0[_0x5420('0x67')](_0x3626e3);}}return _0x2e13e0;}});}else{return _0x423f43;}}else{var _0x52138e=_['filter'](_0x423f43,function(_0x1af238){if(_0x1af238[_0x5420('0x62')]!==_0x5420('0x56')){return _0x1af238;}});return _0x52138e;}});}else{return _0x423f43;}}})[_0x5420('0x25')](function(_0xf5cdc3){var _0x24bf68=[];if(_0xf5cdc3){_0x3842d4=_0xf5cdc3;for(var _0x32d993=0x0;_0x32d993<_0xf5cdc3[_0x5420('0x66')];_0x32d993+=0x1){_0x3842d4[_0x32d993]['messages']=[];_0x24bf68[_0x5420('0x67')](db['ChatInternalMessage'][_0x5420('0x48')]({'where':{'FromId':[_0x16e214[_0x5420('0x58')]['id'],_0xf5cdc3[_0x32d993]['id']],'ToId':[_0x16e214[_0x5420('0x58')]['id'],_0xf5cdc3[_0x32d993]['id']],'ChatGroupId':null},'attributes':['id',_0x5420('0x50'),_0x5420('0x68'),_0x5420('0x69'),'read','body'],'order':qs[_0x5420('0x38')](_0x5420('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5420('0x25')](wrapUser(_0xf5cdc3[_0x32d993])));}return BPromise[_0x5420('0x6b')](_0x24bf68);}return[];})[_0x5420('0x25')](function(_0x1eb64a){return{'rows':_0x1eb64a,'count':_0x1eb64a[_0x5420('0x66')]};})['then'](respondWithResult(_0x4f336e,null))['catch'](handleError(_0x4f336e,null));};
\ No newline at end of file
+var _0xd165=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','merge','field','options','includeAll','findAll','catch','show','params','include','find','body','describe','get','createdAt','lastMessageAt','format','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','messages','FromId','ToId','read','-createdAt','all','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','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','../../mysqldb','redis','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage'];(function(_0x244daf,_0x2260d1){var _0x30ce43=function(_0x1e1a93){while(--_0x1e1a93){_0x244daf['push'](_0x244daf['shift']());}};_0x30ce43(++_0x2260d1);}(_0xd165,0xae));var _0x5d16=function(_0x4f9b79,_0x4fff39){_0x4f9b79=_0x4f9b79-0x0;var _0x60c10f=_0xd165[_0x4f9b79];return _0x60c10f;};'use strict';var pdf=require(_0x5d16('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5d16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d16('0x2'));var rp=require(_0x5d16('0x3'));var moment=require(_0x5d16('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d16('0x5'));var path=require(_0x5d16('0x6'));var sox=require(_0x5d16('0x7'));var csv=require(_0x5d16('0x8'));var ejs=require(_0x5d16('0x9'));var fs=require('fs');var _=require(_0x5d16('0xa'));var squel=require(_0x5d16('0xb'));var crypto=require(_0x5d16('0xc'));var jsforce=require(_0x5d16('0xd'));var deskjs=require(_0x5d16('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5d16('0xf'));var Papa=require(_0x5d16('0x10'));var Redis=require(_0x5d16('0x11'));var authService=require(_0x5d16('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5d16('0x13'));var hardwareService=require(_0x5d16('0x14'));var logger=require(_0x5d16('0x15'))(_0x5d16('0x16'));var utils=require(_0x5d16('0x17'));var config=require(_0x5d16('0x18'));var db=require(_0x5d16('0x19'))['db'];config['redis']=_['defaults'](config[_0x5d16('0x1a')],{'host':_0x5d16('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d16('0x1a')]));require(_0x5d16('0x1c'))['register'](socket);function respondWithStatusCode(_0x273d2d,_0x48ce8a){_0x48ce8a=_0x48ce8a||0xcc;return function(_0x3be55c){if(_0x3be55c){return _0x273d2d[_0x5d16('0x1d')](_0x48ce8a);}return _0x273d2d[_0x5d16('0x1e')](_0x48ce8a)[_0x5d16('0x1f')]();};}function respondWithResult(_0x4a5816,_0x1c7bc6){_0x1c7bc6=_0x1c7bc6||0xc8;return function(_0x3977f3){if(_0x3977f3){return _0x4a5816[_0x5d16('0x1e')](_0x1c7bc6)[_0x5d16('0x20')](_0x3977f3);}};}function respondWithFilteredResult(_0x2c11ed,_0x38225f){return function(_0x43e973){if(_0x43e973){var _0x10e858=_0x43e973[_0x5d16('0x21')],_0xe1746c=_0x38225f['offset'],_0x1602e0=_0x38225f[_0x5d16('0x22')]+_0x38225f[_0x5d16('0x23')],_0x2d85c2;if(_0x1602e0>=_0x10e858){_0x1602e0=_0x10e858;_0x2d85c2=0xc8;}else{_0x2d85c2=0xce;}_0x2c11ed[_0x5d16('0x1e')](_0x2d85c2);return _0x2c11ed[_0x5d16('0x24')](_0x5d16('0x25'),_0xe1746c+'-'+_0x1602e0+'/'+_0x10e858)[_0x5d16('0x20')](_0x43e973);}return null;};}function patchUpdates(_0x40d822){return function(_0x23864b){try{jsonpatch[_0x5d16('0x26')](_0x23864b,_0x40d822,!![]);}catch(_0xf5a601){return BPromise[_0x5d16('0x27')](_0xf5a601);}return _0x23864b[_0x5d16('0x28')]();};}function saveUpdates(_0x5addbc,_0x15e3d9){return function(_0x4036f4){if(_0x4036f4){return _0x4036f4[_0x5d16('0x29')](_0x5addbc)[_0x5d16('0x2a')](function(_0x157465){return _0x157465;});}return null;};}function removeEntity(_0x1cf7a7,_0x4406b1){return function(_0xe7700c){if(_0xe7700c){return _0xe7700c[_0x5d16('0x2b')]()['then'](function(){_0x1cf7a7[_0x5d16('0x1e')](0xcc)[_0x5d16('0x1f')]();});}};}function handleEntityNotFound(_0xd3f45,_0x448c9f){return function(_0x3a15b4){if(!_0x3a15b4){_0xd3f45[_0x5d16('0x1d')](0x194);}return _0x3a15b4;};}function handleError(_0x3aad3c,_0x28cff5){_0x28cff5=_0x28cff5||0x1f4;return function(_0x593f58){logger['error'](_0x593f58[_0x5d16('0x2c')]);if(_0x593f58[_0x5d16('0x2d')]){delete _0x593f58[_0x5d16('0x2d')];}_0x3aad3c[_0x5d16('0x1e')](_0x28cff5)[_0x5d16('0x2e')](_0x593f58);};}exports[_0x5d16('0x2f')]=function(_0x2f82c2,_0x2d663f){var _0x31f169={},_0x5de925={},_0x1cb3d5={'count':0x0,'rows':[]};var _0x387c89=_[_0x5d16('0x30')](db[_0x5d16('0x31')][_0x5d16('0x32')],function(_0x5c1a30){return{'name':_0x5c1a30[_0x5d16('0x33')],'type':_0x5c1a30[_0x5d16('0x34')][_0x5d16('0x35')]};});_0x5de925[_0x5d16('0x36')]=_[_0x5d16('0x30')](_0x387c89,_0x5d16('0x2d'));_0x5de925[_0x5d16('0x37')]=_[_0x5d16('0x38')](_0x2f82c2['query']);_0x5de925[_0x5d16('0x39')]=_[_0x5d16('0x3a')](_0x5de925[_0x5d16('0x36')],_0x5de925[_0x5d16('0x37')]);_0x31f169['attributes']=_[_0x5d16('0x3a')](_0x5de925[_0x5d16('0x36')],qs['fields'](_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x3b')]));_0x31f169[_0x5d16('0x3c')]=_0x31f169[_0x5d16('0x3c')][_0x5d16('0x3d')]?_0x31f169[_0x5d16('0x3c')]:_0x5de925[_0x5d16('0x36')];if(!_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x3e')]('nolimit')){_0x31f169[_0x5d16('0x23')]=qs[_0x5d16('0x23')](_0x2f82c2[_0x5d16('0x37')]['limit']);_0x31f169[_0x5d16('0x22')]=qs[_0x5d16('0x22')](_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x22')]);}_0x31f169[_0x5d16('0x3f')]=qs['sort'](_0x2f82c2['query']['sort']);_0x31f169[_0x5d16('0x40')]=qs[_0x5d16('0x39')](_[_0x5d16('0x41')](_0x2f82c2['query'],_0x5de925['filters']));if(_0x2f82c2[_0x5d16('0x37')]['filter']){_0x31f169[_0x5d16('0x40')]=_[_0x5d16('0x42')](_0x31f169['where'],{'$or':_[_0x5d16('0x30')](_0x387c89,function(_0x2fefb9){if(_0x2fefb9['type']['key']!=='VIRTUAL'){var _0x43fceb={};_0x43fceb[_0x2fefb9[_0x5d16('0x43')]]={'$like':'%'+_0x2f82c2['query']['filter']+'%'};return _0x43fceb;}})});}_0x31f169=_[_0x5d16('0x42')]({},_0x31f169,_0x2f82c2[_0x5d16('0x44')]);var _0x5de80b={'where':_0x31f169[_0x5d16('0x40')]};return db[_0x5d16('0x31')][_0x5d16('0x21')](_0x5de80b)['then'](function(_0x3e246a){_0x1cb3d5[_0x5d16('0x21')]=_0x3e246a;if(_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x45')]){_0x31f169['include']=[{'all':!![]}];}return db[_0x5d16('0x31')][_0x5d16('0x46')](_0x31f169);})[_0x5d16('0x2a')](function(_0x5aa15a){_0x1cb3d5['rows']=_0x5aa15a;return _0x1cb3d5;})['then'](respondWithFilteredResult(_0x2d663f,_0x31f169))[_0x5d16('0x47')](handleError(_0x2d663f,null));};exports[_0x5d16('0x48')]=function(_0x11cce0,_0x269e42){var _0x3cdce2={'raw':!![],'where':{'id':_0x11cce0[_0x5d16('0x49')]['id']}},_0x51f62b={};_0x51f62b[_0x5d16('0x36')]=_[_0x5d16('0x38')](db[_0x5d16('0x31')][_0x5d16('0x32')]);_0x51f62b[_0x5d16('0x37')]=_['keys'](_0x11cce0[_0x5d16('0x37')]);_0x51f62b[_0x5d16('0x39')]=_[_0x5d16('0x3a')](_0x51f62b[_0x5d16('0x36')],_0x51f62b['query']);_0x3cdce2[_0x5d16('0x3c')]=_[_0x5d16('0x3a')](_0x51f62b[_0x5d16('0x36')],qs[_0x5d16('0x3b')](_0x11cce0[_0x5d16('0x37')][_0x5d16('0x3b')]));_0x3cdce2[_0x5d16('0x3c')]=_0x3cdce2['attributes']['length']?_0x3cdce2[_0x5d16('0x3c')]:_0x51f62b['model'];if(_0x11cce0[_0x5d16('0x37')][_0x5d16('0x45')]){_0x3cdce2[_0x5d16('0x4a')]=[{'all':!![]}];}_0x3cdce2=_[_0x5d16('0x42')]({},_0x3cdce2,_0x11cce0[_0x5d16('0x44')]);return db[_0x5d16('0x31')][_0x5d16('0x4b')](_0x3cdce2)[_0x5d16('0x2a')](handleEntityNotFound(_0x269e42,null))['then'](respondWithResult(_0x269e42,null))[_0x5d16('0x47')](handleError(_0x269e42,null));};exports['create']=function(_0x48e8e9,_0x19008b){return db[_0x5d16('0x31')]['create'](_0x48e8e9[_0x5d16('0x4c')],{})['then'](respondWithResult(_0x19008b,0xc9))[_0x5d16('0x47')](handleError(_0x19008b,null));};exports['update']=function(_0x4ae9df,_0x3f11d0){if(_0x4ae9df[_0x5d16('0x4c')]['id']){delete _0x4ae9df[_0x5d16('0x4c')]['id'];}return db[_0x5d16('0x31')][_0x5d16('0x4b')]({'where':{'id':_0x4ae9df[_0x5d16('0x49')]['id']}})[_0x5d16('0x2a')](handleEntityNotFound(_0x3f11d0,null))[_0x5d16('0x2a')](saveUpdates(_0x4ae9df[_0x5d16('0x4c')],null))[_0x5d16('0x2a')](respondWithResult(_0x3f11d0,null))[_0x5d16('0x47')](handleError(_0x3f11d0,null));};exports[_0x5d16('0x2b')]=function(_0x10f645,_0x5b9536){return db[_0x5d16('0x31')][_0x5d16('0x4b')]({'where':{'id':_0x10f645[_0x5d16('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b9536,null))['then'](removeEntity(_0x5b9536,null))['catch'](handleError(_0x5b9536,null));};exports[_0x5d16('0x4d')]=function(_0x19c7df,_0xeda5d6){return db[_0x5d16('0x31')][_0x5d16('0x4d')]()['then'](respondWithResult(_0xeda5d6,null))[_0x5d16('0x47')](handleError(_0xeda5d6,null));};function wrapUser(_0x58cf38){return function(_0xe5c13f){var _0x4fc40b=_0x58cf38[_0x5d16('0x4e')]({'plain':!![]});_0x4fc40b['messages']=[];if(_0xe5c13f){_0x4fc40b['lastMessageAt']=_0xe5c13f[_0x5d16('0x4f')];_0x4fc40b['lastMessage']=_0xe5c13f;}else{_0x4fc40b[_0x5d16('0x50')]=moment(0x0)[_0x5d16('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fc40b['lastMessage']={};}return _0x4fc40b;};}exports['getUsers']=function(_0x45fee0,_0x3312de,_0x1ad80f){var _0x20f5d1=[];return db[_0x5d16('0x52')][_0x5d16('0x46')]({'where':{'role':[_0x5d16('0x53'),_0x5d16('0x54'),_0x5d16('0x55')]},'attributes':['id',_0x5d16('0x56'),_0x5d16('0x2d'),_0x5d16('0x57'),_0x5d16('0x58'),_0x5d16('0x59'),_0x5d16('0x5a'),_0x5d16('0x5b'),_0x5d16('0x5c'),_0x5d16('0x5d')],'order':qs[_0x5d16('0x5e')](_0x5d16('0x5f')),'include':[{'model':db[_0x5d16('0x60')],'as':_0x5d16('0x61'),'attributes':['id',_0x5d16('0x2d'),_0x5d16('0x34')],'through':{'attributes':[]}}]})[_0x5d16('0x2a')](function(_0x356604){if(_0x356604){var _0x5095ac=_0x45fee0[_0x5d16('0x55')][_0x5d16('0x4e')]({'plain':!![]});if(!_0x5095ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5095ac[_0x5d16('0x57')]==='user'){return db[_0x5d16('0x62')][_0x5d16('0x4b')]({'where':{'name':_0x5d16('0x63'),'userProfileId':_0x5095ac['userProfileId']},'raw':!![]})[_0x5d16('0x2a')](function(_0xa01c2){if(_0xa01c2){if(_0xa01c2[_0x5d16('0x64')]===0x0){return db[_0x5d16('0x65')][_0x5d16('0x46')]({'where':{'sectionId':_0xa01c2['id']},'raw':!![]})['then'](function(_0x5d33cb){var _0x5ef85f=[];if(_[_0x5d16('0x66')](_0x5d33cb)){_0x5ef85f=_[_0x5d16('0x67')](_0x356604,function(_0x2f0c62){if(_0x2f0c62[_0x5d16('0x57')]!==_0x5d16('0x53')){return _0x2f0c62;}});return _0x5ef85f;}else{for(var _0x259939=0x0;_0x259939<_0x356604['length'];_0x259939++){var _0x83abbe=_0x356604[_0x259939];if(_0x83abbe['role']===_0x5d16('0x53')){var _0x4c50d4=_[_0x5d16('0x4b')](_0x5d33cb,function(_0x3da1db){return _0x3da1db[_0x5d16('0x68')]===_0x83abbe['id'];});if(_0x4c50d4)_0x5ef85f[_0x5d16('0x69')](_0x83abbe);}else{_0x5ef85f[_0x5d16('0x69')](_0x83abbe);}}return _0x5ef85f;}});}else{return _0x356604;}}else{var _0x279b29=_['filter'](_0x356604,function(_0x2de295){if(_0x2de295['role']!==_0x5d16('0x53')){return _0x2de295;}});return _0x279b29;}});}else{return _0x356604;}}})[_0x5d16('0x2a')](function(_0x34e98e){var _0x57a43a=[];if(_0x34e98e){_0x20f5d1=_0x34e98e;for(var _0x96a1=0x0;_0x96a1<_0x34e98e['length'];_0x96a1+=0x1){_0x20f5d1[_0x96a1][_0x5d16('0x6a')]=[];_0x57a43a[_0x5d16('0x69')](db[_0x5d16('0x31')][_0x5d16('0x4b')]({'where':{'FromId':[_0x45fee0[_0x5d16('0x55')]['id'],_0x34e98e[_0x96a1]['id']],'ToId':[_0x45fee0[_0x5d16('0x55')]['id'],_0x34e98e[_0x96a1]['id']],'ChatGroupId':null},'attributes':['id',_0x5d16('0x4f'),_0x5d16('0x6b'),_0x5d16('0x6c'),_0x5d16('0x6d'),_0x5d16('0x4c')],'order':qs[_0x5d16('0x5e')](_0x5d16('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5d16('0x2a')](wrapUser(_0x34e98e[_0x96a1])));}return BPromise[_0x5d16('0x6f')](_0x57a43a);}return[];})[_0x5d16('0x2a')](function(_0x1d52af){return{'rows':_0x1d52af,'count':_0x1d52af[_0x5d16('0x3d')]};})[_0x5d16('0x2a')](respondWithResult(_0x3312de,null))['catch'](handleError(_0x3312de,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f3dc1d4..156bec5 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 _0xc1eb=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b4ec4,_0x2611b4){var _0xa84d97=function(_0x306c8c){while(--_0x306c8c){_0x4b4ec4['push'](_0x4b4ec4['shift']());}};_0xa84d97(++_0x2611b4);}(_0xc1eb,0x1ed));var _0xbc1e=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0xc1eb[_0x3d5df9];return _0x50ba39;};'use strict';var EventEmitter=require(_0xbc1e('0x0'));var ChatInternalMessage=require(_0xbc1e('0x1'))['db'][_0xbc1e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbc1e('0x3')](0x0);var events={'afterCreate':_0xbc1e('0x4'),'afterUpdate':_0xbc1e('0x5'),'afterDestroy':_0xbc1e('0x6')};function emitEvent(_0x564175){return function(_0x325b7d,_0x1fe06b,_0x162f93){ChatInternalMessageEvents['emit'](_0x564175+':'+_0x325b7d['id'],_0x325b7d);ChatInternalMessageEvents[_0xbc1e('0x7')](_0x564175,_0x325b7d);_0x162f93(null);};}for(var e in events){if(events[_0xbc1e('0x8')](e)){var event=events[e];ChatInternalMessage[_0xbc1e('0x9')](e,emitEvent(event));}}module[_0xbc1e('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xa554=['../../mysqldb','ChatInternalMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x713bd8,_0x2f3a74){var _0x5085ec=function(_0x3bc388){while(--_0x3bc388){_0x713bd8['push'](_0x713bd8['shift']());}};_0x5085ec(++_0x2f3a74);}(_0xa554,0x104));var _0x4a55=function(_0x1c9dc4,_0x5ca808){_0x1c9dc4=_0x1c9dc4-0x0;var _0x523d0a=_0xa554[_0x1c9dc4];return _0x523d0a;};'use strict';var EventEmitter=require(_0x4a55('0x0'));var ChatInternalMessage=require(_0x4a55('0x1'))['db'][_0x4a55('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4a55('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4a55('0x4')};function emitEvent(_0x541e09){return function(_0x277b9,_0x572d83,_0x43841f){ChatInternalMessageEvents[_0x4a55('0x5')](_0x541e09+':'+_0x277b9['id'],_0x277b9);ChatInternalMessageEvents[_0x4a55('0x5')](_0x541e09,_0x277b9);_0x43841f(null);};}for(var e in events){if(events[_0x4a55('0x6')](e)){var event=events[e];ChatInternalMessage[_0x4a55('0x7')](e,emitEvent(event));}}module[_0x4a55('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 ef5abf8..9b7b257 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 _0x9ffd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x8856e4,_0x472b29){var _0x11276e=function(_0x518750){while(--_0x518750){_0x8856e4['push'](_0x8856e4['shift']());}};_0x11276e(++_0x472b29);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x427dba,_0xe995eb){_0x427dba=_0x427dba-0x0;var _0x4fdecb=_0x9ffd[_0x427dba];return _0x4fdecb;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd9ff('0xc'),'collate':_0xd9ff('0xd')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 47192e9..a0475cf 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 _0x3b07=['request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x51829a,_0x314d38){var _0x7bae53=function(_0x47fbce){while(--_0x47fbce){_0x51829a['push'](_0x51829a['shift']());}};_0x7bae53(++_0x314d38);}(_0x3b07,0x1b4));var _0x73b0=function(_0x1d591f,_0x3e6682){_0x1d591f=_0x1d591f-0x0;var _0x4f41b3=_0x3b07[_0x1d591f];return _0x4f41b3;};'use strict';var _=require(_0x73b0('0x0'));var util=require(_0x73b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x73b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73b0('0x3'))['db'];var utils=require(_0x73b0('0x4'));var logger=require(_0x73b0('0x5'))(_0x73b0('0x6'));var config=require(_0x73b0('0x7'));var jayson=require(_0x73b0('0x8'));var client=jayson[_0x73b0('0x9')]['http']({'port':0x232a});config[_0x73b0('0xa')]=_[_0x73b0('0xb')](config['redis'],{'host':_0x73b0('0xc'),'port':0x18eb});var socket=require(_0x73b0('0xd'))(new Redis(config[_0x73b0('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x42dcef,_0x4b8604,_0x483559){return new BPromise(function(_0x68408f,_0x529262){return client[_0x73b0('0xe')](_0x42dcef,_0x483559)[_0x73b0('0xf')](function(_0x1f0cac){logger[_0x73b0('0x10')](_0x73b0('0x11'),_0x4b8604,_0x73b0('0x12'));logger[_0x73b0('0x13')](_0x73b0('0x14'),_0x4b8604,'request\x20sent',JSON[_0x73b0('0x15')](_0x1f0cac));if(_0x1f0cac[_0x73b0('0x16')]){if(_0x1f0cac['error']['code']===0x1f4){logger[_0x73b0('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b8604,_0x1f0cac[_0x73b0('0x16')]['message']);return _0x529262(_0x1f0cac[_0x73b0('0x16')][_0x73b0('0x17')]);}logger[_0x73b0('0x16')](_0x73b0('0x11'),_0x4b8604,_0x1f0cac['error'][_0x73b0('0x17')]);return _0x68408f(_0x1f0cac[_0x73b0('0x16')][_0x73b0('0x17')]);}else{logger[_0x73b0('0x10')](_0x73b0('0x11'),_0x4b8604,_0x73b0('0x12'));_0x68408f(_0x1f0cac[_0x73b0('0x18')]['message']);}})['catch'](function(_0x217c97){logger[_0x73b0('0x16')](_0x73b0('0x11'),_0x4b8604,_0x217c97);_0x529262(_0x217c97);});});}
\ No newline at end of file
+var _0xe33a=['jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','../../config/utils','../../config/logger','rpc'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xe33a,0xa3));var _0xae33=function(_0x275cb1,_0x1b913d){_0x275cb1=_0x275cb1-0x0;var _0x2f92b4=_0xe33a[_0x275cb1];return _0x2f92b4;};'use strict';var _=require(_0xae33('0x0'));var util=require('util');var moment=require(_0xae33('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae33('0x2'));var logger=require(_0xae33('0x3'))(_0xae33('0x4'));var config=require('../../config/environment');var jayson=require(_0xae33('0x5'));var client=jayson[_0xae33('0x6')][_0xae33('0x7')]({'port':0x232a});config[_0xae33('0x8')]=_[_0xae33('0x9')](config[_0xae33('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xae33('0xa'))(new Redis(config[_0xae33('0x8')]));require('./chatInternalMessage.socket')[_0xae33('0xb')](socket);function respondWithRpcPromise(_0x207a78,_0x26b846,_0x1949a6){return new BPromise(function(_0x1115d1,_0x5d4aea){return client[_0xae33('0xc')](_0x207a78,_0x1949a6)[_0xae33('0xd')](function(_0x59c179){logger[_0xae33('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x26b846,_0xae33('0xf'));logger[_0xae33('0x10')](_0xae33('0x11'),_0x26b846,_0xae33('0xf'),JSON['stringify'](_0x59c179));if(_0x59c179[_0xae33('0x12')]){if(_0x59c179[_0xae33('0x12')][_0xae33('0x13')]===0x1f4){logger[_0xae33('0x12')](_0xae33('0x14'),_0x26b846,_0x59c179[_0xae33('0x12')]['message']);return _0x5d4aea(_0x59c179[_0xae33('0x12')][_0xae33('0x15')]);}logger[_0xae33('0x12')](_0xae33('0x14'),_0x26b846,_0x59c179['error'][_0xae33('0x15')]);return _0x1115d1(_0x59c179[_0xae33('0x12')][_0xae33('0x15')]);}else{logger[_0xae33('0xe')](_0xae33('0x14'),_0x26b846,_0xae33('0xf'));_0x1115d1(_0x59c179[_0xae33('0x16')]['message']);}})[_0xae33('0x17')](function(_0x4fe322){logger[_0xae33('0x12')](_0xae33('0x14'),_0x26b846,_0x4fe322);_0x5d4aea(_0x4fe322);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 8341bd0..250ba70 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 _0xcee0=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x463e3e,_0x26102e){var _0x236ff4=function(_0x37f15f){while(--_0x37f15f){_0x463e3e['push'](_0x463e3e['shift']());}};_0x236ff4(++_0x26102e);}(_0xcee0,0x1e1));var _0x0cee=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xcee0[_0x510c60];return _0x49c4aa;};'use strict';var ChatInternalMessageEvents=require(_0x0cee('0x0'));var events=[_0x0cee('0x1'),_0x0cee('0x2'),_0x0cee('0x3')];function createListener(_0x3f1953,_0xb77cd5){return function(_0x26f908){_0xb77cd5[_0x0cee('0x4')](_0x3f1953,_0x26f908);};}function removeListener(_0x3d96bf,_0x4b32f3){return function(){ChatInternalMessageEvents[_0x0cee('0x5')](_0x3d96bf,_0x4b32f3);};}exports[_0x0cee('0x6')]=function(_0x1b3abb){for(var _0x465e67=0x0,_0x2af845=events['length'];_0x465e67<_0x2af845;_0x465e67++){var _0x45491f=events[_0x465e67];var _0x24ff83=createListener(_0x0cee('0x7')+_0x45491f,_0x1b3abb);ChatInternalMessageEvents['on'](_0x45491f,_0x24ff83);}};
\ No newline at end of file
+var _0x867f=['remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x55ac98,_0x1f68ee){var _0x34943a=function(_0x5dcd6e){while(--_0x5dcd6e){_0x55ac98['push'](_0x55ac98['shift']());}};_0x34943a(++_0x1f68ee);}(_0x867f,0xe6));var _0xf867=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x867f[_0x5b34c0];return _0x242bd3;};'use strict';var ChatInternalMessageEvents=require(_0xf867('0x0'));var events=[_0xf867('0x1'),_0xf867('0x2'),_0xf867('0x3')];function createListener(_0x433c45,_0x35da23){return function(_0x28e708){_0x35da23[_0xf867('0x4')](_0x433c45,_0x28e708);};}function removeListener(_0x333d91,_0x57ce95){return function(){ChatInternalMessageEvents['removeListener'](_0x333d91,_0x57ce95);};}exports[_0xf867('0x5')]=function(_0x2e0691){for(var _0x2c09b1=0x0,_0x2841d1=events[_0xf867('0x6')];_0x2c09b1<_0x2841d1;_0x2c09b1++){var _0x5c35f9=events[_0x2c09b1];var _0x583f87=createListener(_0xf867('0x7')+_0x5c35f9,_0x2e0691);ChatInternalMessageEvents['on'](_0x5c35f9,_0x583f87);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4459bd3..2b7b83e 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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x2fc76b,_0x1e14a3){var _0x32ea6a=function(_0xe66595){while(--_0xe66595){_0x2fc76b['push'](_0x2fc76b['shift']());}};_0x32ea6a(++_0x1e14a3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router;
\ No newline at end of file
+var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x547e39,_0x3f5107){var _0x4b90f9=function(_0x441579){while(--_0x441579){_0x547e39['push'](_0x547e39['shift']());}};_0x4b90f9(++_0x3f5107);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xb7e7[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index eb5456d..2c5d7cc 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 _0xf537=['DATE','sequelize','medium','BOOLEAN','ENUM'];(function(_0x3c2075,_0x93f1a8){var _0x267249=function(_0x57c866){while(--_0x57c866){_0x3c2075['push'](_0x3c2075['shift']());}};_0x267249(++_0x93f1a8);}(_0xf537,0x182));var _0x7f53=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf537[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7f53('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7f53('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7f53('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7f53('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f53('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7f53('0x4')]}};
\ No newline at end of file
+var _0x70b9=['DATE','sequelize','TEXT','medium','out'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x70b9,0xf6));var _0x970b=function(_0x1966a5,_0x3aab3a){_0x1966a5=_0x1966a5-0x0;var _0x56c4b7=_0x70b9[_0x1966a5];return _0x56c4b7;};'use strict';var Sequelize=require(_0x970b('0x0'));module['exports']={'body':{'type':Sequelize[_0x970b('0x1')](_0x970b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x970b('0x3')),'defaultValue':_0x970b('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x970b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index f0cc091..015fc39 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 _0xaac5=['event','EventManager','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','keys','filters','intersection','model','query','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','type','field','options','ChatMessage','includeAll','include','findAll','rows','find','create','body','params','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','interface','SIP/%s','user','channel','acceptmessage','parse','interaction','formData','agent','rejectMessage'];(function(_0x185d2a,_0x308609){var _0x4dea27=function(_0x513443){while(--_0x513443){_0x185d2a['push'](_0x185d2a['shift']());}};_0x4dea27(++_0x308609);}(_0xaac5,0x1ca));var _0x5aac=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xaac5[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x5aac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5aac('0x1'));var zipdir=require(_0x5aac('0x2'));var jsonpatch=require(_0x5aac('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5aac('0x4'));var Mustache=require(_0x5aac('0x5'));var util=require('util');var path=require(_0x5aac('0x6'));var sox=require(_0x5aac('0x7'));var csv=require(_0x5aac('0x8'));var ejs=require(_0x5aac('0x9'));var fs=require('fs');var _=require(_0x5aac('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5aac('0xb'));var deskjs=require(_0x5aac('0xc'));var toCsv=require(_0x5aac('0x8'));var querystring=require(_0x5aac('0xd'));var Papa=require(_0x5aac('0xe'));var Redis=require(_0x5aac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5aac('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5aac('0x11'))['db'];config[_0x5aac('0x12')]=_[_0x5aac('0x13')](config[_0x5aac('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x5aac('0x14'))(new Redis(config[_0x5aac('0x12')]));require(_0x5aac('0x15'))[_0x5aac('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5aac('0x17')][_0x5aac('0x18')]({'port':0x232c});var client9002=jayson[_0x5aac('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5386ae,_0x27394a,_0x4eb4e2){if(_0x4eb4e2){var _0x6920c0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6920c0[_0x5aac('0x19')](_0x27394a)){return _0x5386ae;}else{throw new Error(_0x5aac('0x1a'));}}else{return _0x5386ae;}}function respondWithRpcPromise(_0xdf52fc,_0x107624,_0x1972ff,_0x430813){return new BPromise(function(_0x2e7bd8,_0x48e1b4){var _0x304a79=_0x430813||client;return _0x304a79['request'](_0xdf52fc,_0x1972ff)[_0x5aac('0x1b')](function(_0x335fc4){logger[_0x5aac('0x1c')](_0x5aac('0x1d'),_0x107624,_0x5aac('0x1e'));logger[_0x5aac('0x1f')](_0x5aac('0x20'),_0x107624,'request\x20sent',JSON[_0x5aac('0x21')](_0x335fc4));if(_0x335fc4['error']){if(_0x335fc4[_0x5aac('0x22')][_0x5aac('0x23')]===0x1f4){logger[_0x5aac('0x22')](_0x5aac('0x1d'),_0x107624,_0x335fc4['error']['message']);return _0x48e1b4(_0x335fc4[_0x5aac('0x22')][_0x5aac('0x24')]);}logger['error'](_0x5aac('0x1d'),_0x107624,_0x335fc4['error'][_0x5aac('0x24')]);return _0x2e7bd8(_0x335fc4[_0x5aac('0x22')][_0x5aac('0x24')]);}else{logger[_0x5aac('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x107624,_0x5aac('0x1e'));_0x2e7bd8(_0x335fc4[_0x5aac('0x25')][_0x5aac('0x24')]);}})[_0x5aac('0x26')](function(_0xac16b4){logger[_0x5aac('0x22')](_0x5aac('0x1d'),_0x107624,_0xac16b4);_0x48e1b4(_0xac16b4);});});}function respondWithStatusCode(_0x381d41,_0x236cb9){_0x236cb9=_0x236cb9||0xcc;return function(_0x48e851){if(_0x48e851){return _0x381d41[_0x5aac('0x27')](_0x236cb9);}return _0x381d41[_0x5aac('0x28')](_0x236cb9)[_0x5aac('0x29')]();};}function respondWithResult(_0x24c244,_0x48a65b){_0x48a65b=_0x48a65b||0xc8;return function(_0x1b29c8){if(_0x1b29c8){return _0x24c244[_0x5aac('0x28')](_0x48a65b)[_0x5aac('0x2a')](_0x1b29c8);}};}function respondWithFilteredResult(_0x2d2117,_0x516002){return function(_0x406443){if(_0x406443){var _0x2f77f8=_0x406443[_0x5aac('0x2b')],_0x5c6f85=_0x516002['offset'],_0x41c6e9=_0x516002[_0x5aac('0x2c')]+_0x516002['limit'],_0x158df0;if(_0x41c6e9>=_0x2f77f8){_0x41c6e9=_0x2f77f8;_0x158df0=0xc8;}else{_0x158df0=0xce;}_0x2d2117[_0x5aac('0x28')](_0x158df0);return _0x2d2117['set'](_0x5aac('0x2d'),_0x5c6f85+'-'+_0x41c6e9+'/'+_0x2f77f8)[_0x5aac('0x2a')](_0x406443);}return null;};}function patchUpdates(_0x1ad036){return function(_0x319895){try{jsonpatch['apply'](_0x319895,_0x1ad036,!![]);}catch(_0x4cace6){return BPromise[_0x5aac('0x2e')](_0x4cace6);}return _0x319895['save']();};}function saveUpdates(_0x4a2383,_0x2900f7){return function(_0x2abda6){if(_0x2abda6){return _0x2abda6[_0x5aac('0x2f')](_0x4a2383)[_0x5aac('0x1b')](function(_0x7ce403){return _0x7ce403;});}return null;};}function removeEntity(_0x2874c1,_0x25f804){return function(_0x1c78d3){if(_0x1c78d3){return _0x1c78d3[_0x5aac('0x30')]()[_0x5aac('0x1b')](function(){_0x2874c1[_0x5aac('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289cd4,_0x34b262){return function(_0x25ece8){if(!_0x25ece8){_0x289cd4[_0x5aac('0x27')](0x194);}return _0x25ece8;};}function handleError(_0x2023f4,_0x1f6cb7){_0x1f6cb7=_0x1f6cb7||0x1f4;return function(_0x4fe424){logger[_0x5aac('0x22')](_0x4fe424['stack']);if(_0x4fe424[_0x5aac('0x31')]){delete _0x4fe424[_0x5aac('0x31')];}_0x2023f4[_0x5aac('0x28')](_0x1f6cb7)[_0x5aac('0x32')](_0x4fe424);};}exports[_0x5aac('0x33')]=function(_0x1fc68b,_0x1a7760){var _0x44f42a={},_0x46a89b={},_0x19fbb9={'count':0x0,'rows':[]};var _0x3cf44f=_[_0x5aac('0x34')](db['ChatMessage'][_0x5aac('0x35')],function(_0x33f805){return{'name':_0x33f805[_0x5aac('0x36')],'type':_0x33f805['type']['key']};});_0x46a89b['model']=_[_0x5aac('0x34')](_0x3cf44f,_0x5aac('0x31'));_0x46a89b['query']=_[_0x5aac('0x37')](_0x1fc68b['query']);_0x46a89b[_0x5aac('0x38')]=_[_0x5aac('0x39')](_0x46a89b[_0x5aac('0x3a')],_0x46a89b[_0x5aac('0x3b')]);_0x44f42a[_0x5aac('0x3c')]=_['intersection'](_0x46a89b[_0x5aac('0x3a')],qs[_0x5aac('0x3d')](_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x3d')]));_0x44f42a[_0x5aac('0x3c')]=_0x44f42a[_0x5aac('0x3c')]['length']?_0x44f42a[_0x5aac('0x3c')]:_0x46a89b['model'];if(!_0x1fc68b['query']['hasOwnProperty'](_0x5aac('0x3e'))){_0x44f42a[_0x5aac('0x3f')]=qs[_0x5aac('0x3f')](_0x1fc68b[_0x5aac('0x3b')]['limit']);_0x44f42a[_0x5aac('0x2c')]=qs['offset'](_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x2c')]);}_0x44f42a[_0x5aac('0x40')]=qs[_0x5aac('0x41')](_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x41')]);_0x44f42a[_0x5aac('0x42')]=qs[_0x5aac('0x38')](_[_0x5aac('0x43')](_0x1fc68b[_0x5aac('0x3b')],_0x46a89b[_0x5aac('0x38')]));if(_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x44')]){_0x44f42a['where']=_[_0x5aac('0x45')](_0x44f42a[_0x5aac('0x42')],{'$or':_['map'](_0x3cf44f,function(_0x121e6c){if(_0x121e6c[_0x5aac('0x46')]['key']!=='VIRTUAL'){var _0x1023c7={};_0x1023c7[_0x121e6c[_0x5aac('0x47')]]={'$like':'%'+_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x44')]+'%'};return _0x1023c7;}})});}_0x44f42a=_[_0x5aac('0x45')]({},_0x44f42a,_0x1fc68b[_0x5aac('0x48')]);var _0xa5c59d={'where':_0x44f42a[_0x5aac('0x42')]};return db[_0x5aac('0x49')]['count'](_0xa5c59d)[_0x5aac('0x1b')](function(_0x5b4477){_0x19fbb9[_0x5aac('0x2b')]=_0x5b4477;if(_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x4a')]){_0x44f42a[_0x5aac('0x4b')]=[{'all':!![]}];}return db[_0x5aac('0x49')][_0x5aac('0x4c')](_0x44f42a);})[_0x5aac('0x1b')](function(_0x519534){_0x19fbb9[_0x5aac('0x4d')]=_0x519534;return _0x19fbb9;})['then'](respondWithFilteredResult(_0x1a7760,_0x44f42a))['catch'](handleError(_0x1a7760,null));};exports['show']=function(_0xc93242,_0x56e8ef){var _0x2d3fb3={'raw':!![],'where':{'id':_0xc93242['params']['id']}},_0x52b316={};_0x52b316['model']=_['keys'](db[_0x5aac('0x49')][_0x5aac('0x35')]);_0x52b316[_0x5aac('0x3b')]=_['keys'](_0xc93242['query']);_0x52b316['filters']=_['intersection'](_0x52b316[_0x5aac('0x3a')],_0x52b316[_0x5aac('0x3b')]);_0x2d3fb3[_0x5aac('0x3c')]=_[_0x5aac('0x39')](_0x52b316['model'],qs[_0x5aac('0x3d')](_0xc93242[_0x5aac('0x3b')][_0x5aac('0x3d')]));_0x2d3fb3[_0x5aac('0x3c')]=_0x2d3fb3[_0x5aac('0x3c')]['length']?_0x2d3fb3['attributes']:_0x52b316[_0x5aac('0x3a')];if(_0xc93242[_0x5aac('0x3b')]['includeAll']){_0x2d3fb3[_0x5aac('0x4b')]=[{'all':!![]}];}_0x2d3fb3=_[_0x5aac('0x45')]({},_0x2d3fb3,_0xc93242[_0x5aac('0x48')]);return db[_0x5aac('0x49')][_0x5aac('0x4e')](_0x2d3fb3)[_0x5aac('0x1b')](handleEntityNotFound(_0x56e8ef,null))[_0x5aac('0x1b')](respondWithResult(_0x56e8ef,null))[_0x5aac('0x26')](handleError(_0x56e8ef,null));};exports[_0x5aac('0x4f')]=function(_0x28a589,_0xcec67f){return db[_0x5aac('0x49')]['create'](_0x28a589[_0x5aac('0x50')],{})[_0x5aac('0x1b')](respondWithResult(_0xcec67f,0xc9))[_0x5aac('0x26')](handleError(_0xcec67f,null));};exports['update']=function(_0x52b945,_0x600d6b){if(_0x52b945[_0x5aac('0x50')]['id']){delete _0x52b945[_0x5aac('0x50')]['id'];}return db[_0x5aac('0x49')]['find']({'where':{'id':_0x52b945[_0x5aac('0x51')]['id']}})[_0x5aac('0x1b')](handleEntityNotFound(_0x600d6b,null))[_0x5aac('0x1b')](saveUpdates(_0x52b945['body'],null))[_0x5aac('0x1b')](respondWithResult(_0x600d6b,null))[_0x5aac('0x26')](handleError(_0x600d6b,null));};exports['destroy']=function(_0x873d89,_0x1852ee){return db[_0x5aac('0x49')][_0x5aac('0x4e')]({'where':{'id':_0x873d89[_0x5aac('0x51')]['id']}})[_0x5aac('0x1b')](handleEntityNotFound(_0x1852ee,null))[_0x5aac('0x1b')](removeEntity(_0x1852ee,null))[_0x5aac('0x26')](handleError(_0x1852ee,null));};exports[_0x5aac('0x52')]=function(_0x1803da,_0x39d57c){return db[_0x5aac('0x49')][_0x5aac('0x52')]()[_0x5aac('0x1b')](respondWithResult(_0x39d57c,null))[_0x5aac('0x26')](handleError(_0x39d57c,null));};var interaction_log=require(_0x5aac('0x53'))(_0x5aac('0x54'));exports[_0x5aac('0x55')]=function(_0x53f0d0,_0x2e73ad,_0xa6df02){var _0x488e06={'channel':_0x5aac('0x56')};if(_0x53f0d0[_0x5aac('0x50')]['id']){delete _0x53f0d0[_0x5aac('0x50')]['id'];}_0x53f0d0[_0x5aac('0x50')][_0x5aac('0x57')]=!![];_0x53f0d0[_0x5aac('0x50')][_0x5aac('0x58')]=moment()[_0x5aac('0x59')](_0x5aac('0x5a'));_0x53f0d0[_0x5aac('0x50')][_0x5aac('0x5b')]=_0x53f0d0['body'][_0x5aac('0x5b')]||_0x53f0d0['user']['id'];return db['ChatMessage'][_0x5aac('0x4e')]({'where':{'id':_0x53f0d0[_0x5aac('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x5aac('0x5c')],'as':'Contact'}]})[_0x5aac('0x1b')](handleEntityNotFound(_0x2e73ad,null))[_0x5aac('0x1b')](saveUpdates(_0x53f0d0[_0x5aac('0x50')],null))[_0x5aac('0x1b')](function(_0x968256){if(_0x968256){_0x488e06[_0x5aac('0x24')]=_0x968256[_0x5aac('0x5d')]({'plain':!![]});return db[_0x5aac('0x5e')][_0x5aac('0x4e')]({'where':{'id':_0x968256[_0x5aac('0x5f')]}});}return null;})[_0x5aac('0x1b')](handleEntityNotFound(_0x2e73ad,null))[_0x5aac('0x1b')](function(_0x3c1f77){if(_0x3c1f77){return _0x3c1f77[_0x5aac('0x2f')]({'UserId':_0x53f0d0['body']['UserId'],'read1stAt':_[_0x5aac('0x60')](_0x3c1f77[_0x5aac('0x61')])?moment()['format'](_0x5aac('0x5a')):undefined});}return null;})['then'](function(_0x2b0844){if(_0x2b0844){_0x488e06['interaction']=_0x2b0844[_0x5aac('0x5d')]({'plain':!![]});interaction_log[_0x5aac('0x1c')](_0x5aac('0x62'),_0x53f0d0['user']['id'],_0x53f0d0['user']['name'],_0x53f0d0['user'][_0x5aac('0x63')],_0x488e06['interaction']['id'],_0x53f0d0[_0x5aac('0x50')]?JSON['stringify'](_0x53f0d0['body']):_0x5aac('0x64'));return respondWithRpcPromise(_0x5aac('0x65'),'acceptMessage',_0x488e06);}return null;})['then'](function(_0x58c67c){if(_0x58c67c){if(_0x53f0d0['body']['manual']){_0x488e06['message'][_0x5aac('0x66')]=util[_0x5aac('0x59')](_0x5aac('0x67'),_0x53f0d0[_0x5aac('0x68')]['name']);_0x488e06[_0x5aac('0x24')][_0x5aac('0x69')]=_0x488e06[_0x5aac('0x69')];_0x488e06[_0x5aac('0x24')]['event']=_0x5aac('0x55');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5aac('0x6a'),'message':_['merge'](_0x488e06[_0x5aac('0x24')],JSON[_0x5aac('0x6b')](_0x488e06[_0x5aac('0x6c')][_0x5aac('0x6d')]))},client9002)['then'](function(){return _0x488e06;});}return _0x488e06;}return null;})[_0x5aac('0x1b')](respondWithResult(_0x2e73ad,null))[_0x5aac('0x26')](handleError(_0x2e73ad,null));};var interaction_log=require(_0x5aac('0x53'))('chat-interactions');exports[_0x5aac('0x2e')]=function(_0x40fc9a,_0x3618ca,_0x555fb5){var _0x4643be={'agent':{},'channel':'chat'};if(_0x40fc9a[_0x5aac('0x50')]['id']){delete _0x40fc9a[_0x5aac('0x50')]['id'];}_0x40fc9a[_0x5aac('0x50')][_0x5aac('0x5b')]=_0x40fc9a[_0x5aac('0x50')][_0x5aac('0x5b')]||_0x40fc9a['user']['id'];_0x4643be[_0x5aac('0x6e')]['id']=_0x40fc9a[_0x5aac('0x50')][_0x5aac('0x5b')];return db[_0x5aac('0x49')][_0x5aac('0x4e')]({'where':{'id':_0x40fc9a[_0x5aac('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3618ca,null))[_0x5aac('0x1b')](function(_0x29e9c6){if(_0x29e9c6){_0x4643be[_0x5aac('0x24')]=_0x29e9c6[_0x5aac('0x5d')]({'plain':!![]});return db[_0x5aac('0x5e')][_0x5aac('0x4e')]({'where':{'id':_0x29e9c6[_0x5aac('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x3618ca,null))[_0x5aac('0x1b')](function(_0x17dd0e){if(_0x17dd0e){_0x4643be[_0x5aac('0x6c')]=_0x17dd0e[_0x5aac('0x5d')]({'plain':!![]});interaction_log[_0x5aac('0x1c')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x40fc9a[_0x5aac('0x68')]['id'],_0x40fc9a[_0x5aac('0x68')]['name'],_0x40fc9a['user'][_0x5aac('0x63')],_0x4643be[_0x5aac('0x6c')]['id'],_0x40fc9a[_0x5aac('0x50')]?JSON['stringify'](_0x40fc9a[_0x5aac('0x50')]):_0x5aac('0x64'));return respondWithRpcPromise('RejectMessage',_0x5aac('0x6f'),_0x4643be);}return null;})[_0x5aac('0x1b')](function(_0x283cf5){if(_0x283cf5){_0x283cf5[_0x5aac('0x24')][_0x5aac('0x66')]=util[_0x5aac('0x59')](_0x5aac('0x67'),_0x40fc9a['user'][_0x5aac('0x31')]);_0x283cf5[_0x5aac('0x24')][_0x5aac('0x69')]=_0x4643be[_0x5aac('0x69')];_0x283cf5['message'][_0x5aac('0x70')]=_0x5aac('0x2e');respondWithRpcPromise(_0x5aac('0x71'),_0x5aac('0x71'),{'event':'rejectmessage','message':_0x283cf5[_0x5aac('0x24')]},client9002);return _0x4643be;}return null;})[_0x5aac('0x1b')](respondWithResult(_0x3618ca,null))[_0x5aac('0x26')](handleError(_0x3618ca,null));};
\ No newline at end of file
+var _0x9209=['length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','field','options','includeAll','include','rows','fields','find','create','body','params','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','stringify','AcceptMessage','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','test','request','then','info','request\x20sent','debug','error','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','name','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes'];(function(_0x1957ac,_0x2d9e3c){var _0xde4b98=function(_0x11c85d){while(--_0x11c85d){_0x1957ac['push'](_0x1957ac['shift']());}};_0xde4b98(++_0x2d9e3c);}(_0x9209,0x1a8));var _0x9920=function(_0x3eb3ef,_0x411945){_0x3eb3ef=_0x3eb3ef-0x0;var _0x2e156d=_0x9209[_0x3eb3ef];return _0x2e156d;};'use strict';var pdf=require(_0x9920('0x0'));var emlformat=require(_0x9920('0x1'));var rimraf=require(_0x9920('0x2'));var zipdir=require(_0x9920('0x3'));var jsonpatch=require(_0x9920('0x4'));var rp=require(_0x9920('0x5'));var moment=require(_0x9920('0x6'));var BPromise=require(_0x9920('0x7'));var Mustache=require(_0x9920('0x8'));var util=require(_0x9920('0x9'));var path=require('path');var sox=require(_0x9920('0xa'));var csv=require(_0x9920('0xb'));var ejs=require(_0x9920('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9920('0xd'));var crypto=require(_0x9920('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9920('0xf'));var toCsv=require(_0x9920('0xb'));var querystring=require(_0x9920('0x10'));var Papa=require(_0x9920('0x11'));var Redis=require(_0x9920('0x12'));var authService=require(_0x9920('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9920('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9920('0x15'))(_0x9920('0x16'));var utils=require(_0x9920('0x17'));var config=require(_0x9920('0x18'));var db=require(_0x9920('0x19'))['db'];config['redis']=_[_0x9920('0x1a')](config[_0x9920('0x1b')],{'host':_0x9920('0x1c'),'port':0x18eb});var socket=require(_0x9920('0x1d'))(new Redis(config[_0x9920('0x1b')]));require('./chatMessage.socket')[_0x9920('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9920('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x9920('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5480e2,_0x26060d,_0x3c9d0b){if(_0x3c9d0b){var _0x384afc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x384afc[_0x9920('0x21')](_0x26060d)){return _0x5480e2;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5480e2;}}function respondWithRpcPromise(_0x553806,_0x1f59c5,_0x40eb3d,_0x45d817){return new BPromise(function(_0x1540ef,_0x5d750d){var _0xf8bd91=_0x45d817||client;return _0xf8bd91[_0x9920('0x22')](_0x553806,_0x40eb3d)[_0x9920('0x23')](function(_0x248504){logger[_0x9920('0x24')]('ChatMessage,\x20%s,\x20%s',_0x1f59c5,_0x9920('0x25'));logger[_0x9920('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1f59c5,_0x9920('0x25'),JSON['stringify'](_0x248504));if(_0x248504[_0x9920('0x27')]){if(_0x248504[_0x9920('0x27')]['code']===0x1f4){logger[_0x9920('0x27')]('ChatMessage,\x20%s,\x20%s',_0x1f59c5,_0x248504['error'][_0x9920('0x28')]);return _0x5d750d(_0x248504[_0x9920('0x27')][_0x9920('0x28')]);}logger[_0x9920('0x27')](_0x9920('0x29'),_0x1f59c5,_0x248504['error'][_0x9920('0x28')]);return _0x1540ef(_0x248504[_0x9920('0x27')][_0x9920('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1f59c5,'request\x20sent');_0x1540ef(_0x248504[_0x9920('0x2a')][_0x9920('0x28')]);}})[_0x9920('0x2b')](function(_0x724a96){logger[_0x9920('0x27')](_0x9920('0x29'),_0x1f59c5,_0x724a96);_0x5d750d(_0x724a96);});});}function respondWithStatusCode(_0x34f5b4,_0x368668){_0x368668=_0x368668||0xcc;return function(_0x4be0eb){if(_0x4be0eb){return _0x34f5b4[_0x9920('0x2c')](_0x368668);}return _0x34f5b4[_0x9920('0x2d')](_0x368668)[_0x9920('0x2e')]();};}function respondWithResult(_0x41f4cb,_0x590446){_0x590446=_0x590446||0xc8;return function(_0x37a904){if(_0x37a904){return _0x41f4cb['status'](_0x590446)[_0x9920('0x2f')](_0x37a904);}};}function respondWithFilteredResult(_0x32f2bc,_0x1b6013){return function(_0x466230){if(_0x466230){var _0x4b7ce7=_0x466230[_0x9920('0x30')],_0x2b67d7=_0x1b6013[_0x9920('0x31')],_0x3ce4cf=_0x1b6013[_0x9920('0x31')]+_0x1b6013[_0x9920('0x32')],_0x4ca24c;if(_0x3ce4cf>=_0x4b7ce7){_0x3ce4cf=_0x4b7ce7;_0x4ca24c=0xc8;}else{_0x4ca24c=0xce;}_0x32f2bc[_0x9920('0x2d')](_0x4ca24c);return _0x32f2bc['set'](_0x9920('0x33'),_0x2b67d7+'-'+_0x3ce4cf+'/'+_0x4b7ce7)[_0x9920('0x2f')](_0x466230);}return null;};}function patchUpdates(_0x44a778){return function(_0x1def4a){try{jsonpatch[_0x9920('0x34')](_0x1def4a,_0x44a778,!![]);}catch(_0x4d99ab){return BPromise['reject'](_0x4d99ab);}return _0x1def4a[_0x9920('0x35')]();};}function saveUpdates(_0x5affd9,_0x27390f){return function(_0x1b92d7){if(_0x1b92d7){return _0x1b92d7[_0x9920('0x36')](_0x5affd9)[_0x9920('0x23')](function(_0x11e4e0){return _0x11e4e0;});}return null;};}function removeEntity(_0x524547,_0x5640ff){return function(_0x70b4f2){if(_0x70b4f2){return _0x70b4f2['destroy']()[_0x9920('0x23')](function(){_0x524547[_0x9920('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48aab0,_0x286f57){return function(_0x4f9a4d){if(!_0x4f9a4d){_0x48aab0[_0x9920('0x2c')](0x194);}return _0x4f9a4d;};}function handleError(_0x1edc17,_0x49a568){_0x49a568=_0x49a568||0x1f4;return function(_0x3b3bfe){logger[_0x9920('0x27')](_0x3b3bfe['stack']);if(_0x3b3bfe[_0x9920('0x37')]){delete _0x3b3bfe[_0x9920('0x37')];}_0x1edc17[_0x9920('0x2d')](_0x49a568)['send'](_0x3b3bfe);};}exports[_0x9920('0x38')]=function(_0x28c939,_0x29b803){var _0x47d69f={},_0x3e6b7={},_0x511a37={'count':0x0,'rows':[]};var _0x2c65fd=_['map'](db[_0x9920('0x39')][_0x9920('0x3a')],function(_0x57104d){return{'name':_0x57104d[_0x9920('0x3b')],'type':_0x57104d[_0x9920('0x3c')][_0x9920('0x3d')]};});_0x3e6b7[_0x9920('0x3e')]=_[_0x9920('0x3f')](_0x2c65fd,_0x9920('0x37'));_0x3e6b7[_0x9920('0x40')]=_[_0x9920('0x41')](_0x28c939[_0x9920('0x40')]);_0x3e6b7['filters']=_[_0x9920('0x42')](_0x3e6b7['model'],_0x3e6b7[_0x9920('0x40')]);_0x47d69f[_0x9920('0x43')]=_[_0x9920('0x42')](_0x3e6b7[_0x9920('0x3e')],qs['fields'](_0x28c939[_0x9920('0x40')]['fields']));_0x47d69f[_0x9920('0x43')]=_0x47d69f[_0x9920('0x43')][_0x9920('0x44')]?_0x47d69f['attributes']:_0x3e6b7['model'];if(!_0x28c939['query'][_0x9920('0x45')]('nolimit')){_0x47d69f['limit']=qs[_0x9920('0x32')](_0x28c939[_0x9920('0x40')][_0x9920('0x32')]);_0x47d69f['offset']=qs[_0x9920('0x31')](_0x28c939['query'][_0x9920('0x31')]);}_0x47d69f[_0x9920('0x46')]=qs['sort'](_0x28c939[_0x9920('0x40')][_0x9920('0x47')]);_0x47d69f[_0x9920('0x48')]=qs[_0x9920('0x49')](_[_0x9920('0x4a')](_0x28c939[_0x9920('0x40')],_0x3e6b7[_0x9920('0x49')]));if(_0x28c939[_0x9920('0x40')][_0x9920('0x4b')]){_0x47d69f['where']=_[_0x9920('0x4c')](_0x47d69f[_0x9920('0x48')],{'$or':_['map'](_0x2c65fd,function(_0x13754a){if(_0x13754a[_0x9920('0x3c')][_0x9920('0x3d')]!=='VIRTUAL'){var _0x25da2b={};_0x25da2b[_0x13754a[_0x9920('0x4d')]]={'$like':'%'+_0x28c939[_0x9920('0x40')][_0x9920('0x4b')]+'%'};return _0x25da2b;}})});}_0x47d69f=_[_0x9920('0x4c')]({},_0x47d69f,_0x28c939[_0x9920('0x4e')]);var _0x584aa9={'where':_0x47d69f['where']};return db[_0x9920('0x39')][_0x9920('0x30')](_0x584aa9)['then'](function(_0x3399c4){_0x511a37[_0x9920('0x30')]=_0x3399c4;if(_0x28c939[_0x9920('0x40')][_0x9920('0x4f')]){_0x47d69f[_0x9920('0x50')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x47d69f);})[_0x9920('0x23')](function(_0x2fbc50){_0x511a37[_0x9920('0x51')]=_0x2fbc50;return _0x511a37;})[_0x9920('0x23')](respondWithFilteredResult(_0x29b803,_0x47d69f))['catch'](handleError(_0x29b803,null));};exports['show']=function(_0x201638,_0x4d4ff6){var _0xe56a65={'raw':!![],'where':{'id':_0x201638['params']['id']}},_0x4ce6ab={};_0x4ce6ab[_0x9920('0x3e')]=_[_0x9920('0x41')](db[_0x9920('0x39')]['rawAttributes']);_0x4ce6ab[_0x9920('0x40')]=_[_0x9920('0x41')](_0x201638[_0x9920('0x40')]);_0x4ce6ab[_0x9920('0x49')]=_[_0x9920('0x42')](_0x4ce6ab[_0x9920('0x3e')],_0x4ce6ab['query']);_0xe56a65[_0x9920('0x43')]=_[_0x9920('0x42')](_0x4ce6ab['model'],qs[_0x9920('0x52')](_0x201638[_0x9920('0x40')]['fields']));_0xe56a65[_0x9920('0x43')]=_0xe56a65[_0x9920('0x43')][_0x9920('0x44')]?_0xe56a65[_0x9920('0x43')]:_0x4ce6ab[_0x9920('0x3e')];if(_0x201638['query'][_0x9920('0x4f')]){_0xe56a65[_0x9920('0x50')]=[{'all':!![]}];}_0xe56a65=_[_0x9920('0x4c')]({},_0xe56a65,_0x201638[_0x9920('0x4e')]);return db[_0x9920('0x39')][_0x9920('0x53')](_0xe56a65)[_0x9920('0x23')](handleEntityNotFound(_0x4d4ff6,null))['then'](respondWithResult(_0x4d4ff6,null))['catch'](handleError(_0x4d4ff6,null));};exports[_0x9920('0x54')]=function(_0x1e373e,_0x1ca272){return db[_0x9920('0x39')][_0x9920('0x54')](_0x1e373e['body'],{})[_0x9920('0x23')](respondWithResult(_0x1ca272,0xc9))['catch'](handleError(_0x1ca272,null));};exports['update']=function(_0x46aaa3,_0x2aa739){if(_0x46aaa3[_0x9920('0x55')]['id']){delete _0x46aaa3[_0x9920('0x55')]['id'];}return db[_0x9920('0x39')][_0x9920('0x53')]({'where':{'id':_0x46aaa3[_0x9920('0x56')]['id']}})[_0x9920('0x23')](handleEntityNotFound(_0x2aa739,null))[_0x9920('0x23')](saveUpdates(_0x46aaa3[_0x9920('0x55')],null))['then'](respondWithResult(_0x2aa739,null))[_0x9920('0x2b')](handleError(_0x2aa739,null));};exports['destroy']=function(_0x16a333,_0x236023){return db[_0x9920('0x39')]['find']({'where':{'id':_0x16a333[_0x9920('0x56')]['id']}})[_0x9920('0x23')](handleEntityNotFound(_0x236023,null))[_0x9920('0x23')](removeEntity(_0x236023,null))['catch'](handleError(_0x236023,null));};exports[_0x9920('0x57')]=function(_0x4b8b9c,_0x240d59){return db[_0x9920('0x39')]['describe']()[_0x9920('0x23')](respondWithResult(_0x240d59,null))['catch'](handleError(_0x240d59,null));};var interaction_log=require('../../config/logger')(_0x9920('0x58'));exports['accept']=function(_0x2eb302,_0xc4b01,_0x32e8b4){var _0x3e50bd={'channel':_0x9920('0x59')};if(_0x2eb302[_0x9920('0x55')]['id']){delete _0x2eb302[_0x9920('0x55')]['id'];}_0x2eb302[_0x9920('0x55')][_0x9920('0x5a')]=!![];_0x2eb302[_0x9920('0x55')][_0x9920('0x5b')]=moment()[_0x9920('0x5c')](_0x9920('0x5d'));_0x2eb302[_0x9920('0x55')][_0x9920('0x5e')]=_0x2eb302[_0x9920('0x55')]['UserId']||_0x2eb302[_0x9920('0x5f')]['id'];return db[_0x9920('0x39')][_0x9920('0x53')]({'where':{'id':_0x2eb302[_0x9920('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x9920('0x60')],'as':_0x9920('0x61')}]})['then'](handleEntityNotFound(_0xc4b01,null))[_0x9920('0x23')](saveUpdates(_0x2eb302[_0x9920('0x55')],null))[_0x9920('0x23')](function(_0x521cde){if(_0x521cde){_0x3e50bd[_0x9920('0x28')]=_0x521cde[_0x9920('0x62')]({'plain':!![]});return db[_0x9920('0x63')][_0x9920('0x53')]({'where':{'id':_0x521cde[_0x9920('0x64')]}});}return null;})[_0x9920('0x23')](handleEntityNotFound(_0xc4b01,null))[_0x9920('0x23')](function(_0x107e99){if(_0x107e99){return _0x107e99[_0x9920('0x36')]({'UserId':_0x2eb302['body'][_0x9920('0x5e')],'read1stAt':_[_0x9920('0x65')](_0x107e99[_0x9920('0x66')])?moment()[_0x9920('0x5c')](_0x9920('0x5d')):undefined});}return null;})['then'](function(_0xd201f8){if(_0xd201f8){_0x3e50bd[_0x9920('0x67')]=_0xd201f8[_0x9920('0x62')]({'plain':!![]});interaction_log[_0x9920('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2eb302[_0x9920('0x5f')]['id'],_0x2eb302[_0x9920('0x5f')]['name'],_0x2eb302[_0x9920('0x5f')][_0x9920('0x68')],_0x3e50bd[_0x9920('0x67')]['id'],_0x2eb302[_0x9920('0x55')]?JSON[_0x9920('0x69')](_0x2eb302['body']):'null');return respondWithRpcPromise(_0x9920('0x6a'),_0x9920('0x6b'),_0x3e50bd);}return null;})['then'](function(_0x1d8237){if(_0x1d8237){if(_0x2eb302['body']['manual']){_0x3e50bd['message']['interface']=util[_0x9920('0x5c')](_0x9920('0x6c'),_0x2eb302[_0x9920('0x5f')][_0x9920('0x37')]);_0x3e50bd['message'][_0x9920('0x6d')]=_0x3e50bd[_0x9920('0x6d')];_0x3e50bd[_0x9920('0x28')][_0x9920('0x6e')]=_0x9920('0x6f');return respondWithRpcPromise(_0x9920('0x70'),'EventManager',{'event':_0x9920('0x71'),'message':_['merge'](_0x3e50bd[_0x9920('0x28')],JSON[_0x9920('0x72')](_0x3e50bd['interaction'][_0x9920('0x73')]))},client9002)[_0x9920('0x23')](function(){return _0x3e50bd;});}return _0x3e50bd;}return null;})['then'](respondWithResult(_0xc4b01,null))['catch'](handleError(_0xc4b01,null));};var interaction_log=require(_0x9920('0x15'))(_0x9920('0x58'));exports['reject']=function(_0x376d91,_0x4cb897,_0x290c19){var _0x4bb721={'agent':{},'channel':_0x9920('0x59')};if(_0x376d91[_0x9920('0x55')]['id']){delete _0x376d91['body']['id'];}_0x376d91[_0x9920('0x55')][_0x9920('0x5e')]=_0x376d91['body'][_0x9920('0x5e')]||_0x376d91[_0x9920('0x5f')]['id'];_0x4bb721[_0x9920('0x74')]['id']=_0x376d91[_0x9920('0x55')]['UserId'];return db[_0x9920('0x39')][_0x9920('0x53')]({'where':{'id':_0x376d91['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cb897,null))['then'](function(_0x46c61c){if(_0x46c61c){_0x4bb721[_0x9920('0x28')]=_0x46c61c['get']({'plain':!![]});return db[_0x9920('0x63')][_0x9920('0x53')]({'where':{'id':_0x46c61c[_0x9920('0x64')]}});}return null;})[_0x9920('0x23')](handleEntityNotFound(_0x4cb897,null))[_0x9920('0x23')](function(_0x1827b8){if(_0x1827b8){_0x4bb721['interaction']=_0x1827b8[_0x9920('0x62')]({'plain':!![]});interaction_log[_0x9920('0x24')](_0x9920('0x75'),_0x376d91['user']['id'],_0x376d91[_0x9920('0x5f')][_0x9920('0x37')],_0x376d91[_0x9920('0x5f')][_0x9920('0x68')],_0x4bb721[_0x9920('0x67')]['id'],_0x376d91['body']?JSON[_0x9920('0x69')](_0x376d91[_0x9920('0x55')]):_0x9920('0x76'));return respondWithRpcPromise(_0x9920('0x77'),_0x9920('0x78'),_0x4bb721);}return null;})['then'](function(_0x980df0){if(_0x980df0){_0x980df0[_0x9920('0x28')][_0x9920('0x79')]=util['format']('SIP/%s',_0x376d91[_0x9920('0x5f')][_0x9920('0x37')]);_0x980df0[_0x9920('0x28')][_0x9920('0x6d')]=_0x4bb721['channel'];_0x980df0['message'][_0x9920('0x6e')]='reject';respondWithRpcPromise(_0x9920('0x70'),_0x9920('0x70'),{'event':_0x9920('0x7a'),'message':_0x980df0['message']},client9002);return _0x4bb721;}return null;})[_0x9920('0x23')](respondWithResult(_0x4cb897,null))[_0x9920('0x2b')](handleError(_0x4cb897,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 100f2ec..fcd9eed 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 _0x07e6=['emit','hook','setMaxListeners','save','update','remove'];(function(_0xbfbef0,_0x218b21){var _0x3fdf6f=function(_0x468471){while(--_0x468471){_0xbfbef0['push'](_0xbfbef0['shift']());}};_0x3fdf6f(++_0x218b21);}(_0x07e6,0x19a));var _0x607e=function(_0x182199,_0x4f59f1){_0x182199=_0x182199-0x0;var _0x35b58b=_0x07e6[_0x182199];return _0x35b58b;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x607e('0x0')](0x0);var events={'afterCreate':_0x607e('0x1'),'afterUpdate':_0x607e('0x2'),'afterDestroy':_0x607e('0x3')};function emitEvent(_0x39bc37){return function(_0x1c5c25,_0x416102,_0x333ee6){ChatMessageEvents['emit'](_0x39bc37+':'+_0x1c5c25['id'],_0x1c5c25);ChatMessageEvents[_0x607e('0x4')](_0x39bc37,_0x1c5c25);_0x333ee6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x607e('0x5')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x3401=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x2f3824,_0x12ca3a){var _0x1de74f=function(_0x4ea12e){while(--_0x4ea12e){_0x2f3824['push'](_0x2f3824['shift']());}};_0x1de74f(++_0x12ca3a);}(_0x3401,0x1e1));var _0x1340=function(_0x509707,_0x3818fc){_0x509707=_0x509707-0x0;var _0x44f988=_0x3401[_0x509707];return _0x44f988;};'use strict';var EventEmitter=require(_0x1340('0x0'));var ChatMessage=require(_0x1340('0x1'))['db'][_0x1340('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1340('0x3')](0x0);var events={'afterCreate':_0x1340('0x4'),'afterUpdate':'update','afterDestroy':_0x1340('0x5')};function emitEvent(_0x471d2b){return function(_0x2ba699,_0x14b5df,_0x279551){ChatMessageEvents['emit'](_0x471d2b+':'+_0x2ba699['id'],_0x2ba699);ChatMessageEvents['emit'](_0x471d2b,_0x2ba699);_0x279551(null);};}for(var e in events){if(events[_0x1340('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x1340('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 b943bfe..a328f8f 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 _0x4808=['ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x4808,0xf4));var _0x8480=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x4808[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x8480('0x0'));var util=require(_0x8480('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8480('0x2'));var BPromise=require(_0x8480('0x3'));var rp=require(_0x8480('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8480('0x5'));var config=require(_0x8480('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x438c06,_0x48e7c2){return _0x438c06[_0x8480('0x7')](_0x8480('0x8'),attributes,{'tableName':_0x8480('0x9'),'paranoid':![],'indexes':[{'name':_0x8480('0xa'),'fields':['body'],'type':_0x8480('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11aa80,_0x13d06a,_0x4aab0e){var _0x378908=_0x438c06[_0x8480('0xc')];var _0x1ab618=_0x11aa80[_0x8480('0xd')]({'plain':!![]});if(_0x1ab618[_0x8480('0xe')][_0x8480('0xf')]()==='in'||_0x1ab618[_0x8480('0xe')]['toLowerCase']()===_0x8480('0x10')&&!_0x1ab618['secret']&&!_[_0x8480('0x11')](_0x1ab618[_0x8480('0x12')])){_0x378908['ChatInteraction'][_0x8480('0x13')]({'where':{'id':_0x1ab618[_0x8480('0x14')]}})[_0x8480('0x15')](function(_0x2f0f2f){if(_0x2f0f2f){_0x2f0f2f[_0x8480('0x16')]({'lastMsgAt':_0x1ab618[_0x8480('0x17')],'lastMsgDirection':_0x1ab618[_0x8480('0xe')][_0x8480('0xf')]()});}})[_0x8480('0x18')](function(_0x3410ac){console[_0x8480('0x19')](_0x3410ac);});}_0x4aab0e();}},'charset':_0x8480('0x1a'),'collate':_0x8480('0x1b')});};
\ No newline at end of file
+var _0x9ffe=['get','direction','toLowerCase','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','lodash','util','../../config/logger','api','bluebird','request-promise','path','ChatMessage','fti_chat_messages','body','models'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0x9ffe,0xfd));var _0xe9ff=function(_0xf8bd98,_0x722df){_0xf8bd98=_0xf8bd98-0x0;var _0x34e8af=_0x9ffe[_0xf8bd98];return _0x34e8af;};'use strict';var _=require(_0xe9ff('0x0'));var util=require(_0xe9ff('0x1'));var logger=require(_0xe9ff('0x2'))(_0xe9ff('0x3'));var moment=require('moment');var BPromise=require(_0xe9ff('0x4'));var rp=require(_0xe9ff('0x5'));var fs=require('fs');var path=require(_0xe9ff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2ee7e2,_0x648807){return _0x2ee7e2['define'](_0xe9ff('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xe9ff('0x8'),'fields':[_0xe9ff('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a734d,_0x5da2e1,_0x15c87f){var _0x405669=_0x2ee7e2[_0xe9ff('0xa')];var _0x47f368=_0x4a734d[_0xe9ff('0xb')]({'plain':!![]});if(_0x47f368[_0xe9ff('0xc')]['toLowerCase']()==='in'||_0x47f368[_0xe9ff('0xc')][_0xe9ff('0xd')]()==='out'&&!_0x47f368['secret']&&!_['isNil'](_0x47f368[_0xe9ff('0xe')])){_0x405669[_0xe9ff('0xf')][_0xe9ff('0x10')]({'where':{'id':_0x47f368[_0xe9ff('0x11')]}})[_0xe9ff('0x12')](function(_0x1da863){if(_0x1da863){_0x1da863[_0xe9ff('0x13')]({'lastMsgAt':_0x47f368[_0xe9ff('0x14')],'lastMsgDirection':_0x47f368[_0xe9ff('0xc')]['toLowerCase']()});}})[_0xe9ff('0x15')](function(_0x5174df){console['error'](_0x5174df);});}_0x15c87f();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 80dd8bf..4fc3cd8 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 _0xcb2a=['error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x37b3c1,_0x1dba8a){var _0x109803=function(_0x9dbe6e){while(--_0x9dbe6e){_0x37b3c1['push'](_0x37b3c1['shift']());}};_0x109803(++_0x1dba8a);}(_0xcb2a,0xc0));var _0xacb2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcb2a[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xacb2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacb2('0x1'));var fs=require('fs');var Redis=require(_0xacb2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xacb2('0x3'));var logger=require('../../config/logger')(_0xacb2('0x4'));var config=require(_0xacb2('0x5'));var jayson=require(_0xacb2('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xacb2('0x7')]=_[_0xacb2('0x8')](config[_0xacb2('0x7')],{'host':_0xacb2('0x9'),'port':0x18eb});var socket=require(_0xacb2('0xa'))(new Redis(config[_0xacb2('0x7')]));require('./chatMessage.socket')[_0xacb2('0xb')](socket);function respondWithRpcPromise(_0x2f60c3,_0x43f2ec,_0x59678f){return new BPromise(function(_0x21f79a,_0x5e523b){return client[_0xacb2('0xc')](_0x2f60c3,_0x59678f)[_0xacb2('0xd')](function(_0x41dcff){logger[_0xacb2('0xe')]('ChatMessage,\x20%s,\x20%s',_0x43f2ec,_0xacb2('0xf'));logger[_0xacb2('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x43f2ec,'request\x20sent',JSON[_0xacb2('0x11')](_0x41dcff));if(_0x41dcff[_0xacb2('0x12')]){if(_0x41dcff[_0xacb2('0x12')][_0xacb2('0x13')]===0x1f4){logger[_0xacb2('0x12')](_0xacb2('0x14'),_0x43f2ec,_0x41dcff[_0xacb2('0x12')][_0xacb2('0x15')]);return _0x5e523b(_0x41dcff[_0xacb2('0x12')][_0xacb2('0x15')]);}logger[_0xacb2('0x12')](_0xacb2('0x14'),_0x43f2ec,_0x41dcff['error'][_0xacb2('0x15')]);return _0x21f79a(_0x41dcff['error'][_0xacb2('0x15')]);}else{logger[_0xacb2('0xe')]('ChatMessage,\x20%s,\x20%s',_0x43f2ec,_0xacb2('0xf'));_0x21f79a(_0x41dcff[_0xacb2('0x16')][_0xacb2('0x15')]);}})['catch'](function(_0x27d694){logger[_0xacb2('0x12')](_0xacb2('0x14'),_0x43f2ec,_0x27d694);_0x5e523b(_0x27d694);});});}exports[_0xacb2('0x17')]=function(_0x120cdb){var _0x377d09=this;return new Promise(function(_0x1f21fe,_0x26b9a6){return db[_0xacb2('0x18')][_0xacb2('0x19')](_0x120cdb[_0xacb2('0x1a')],{'raw':_0x120cdb[_0xacb2('0x1b')]?_0x120cdb[_0xacb2('0x1b')][_0xacb2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2e82de){logger['info']('CreateChatMessage',_0x120cdb);logger[_0xacb2('0x10')](_0xacb2('0x17'),_0x120cdb,JSON[_0xacb2('0x11')](_0x2e82de));_0x1f21fe(_0x2e82de);})[_0xacb2('0x1d')](function(_0x4f0950){logger['error']('CreateChatMessage',_0x4f0950[_0xacb2('0x15')],_0x120cdb);_0x26b9a6(_0x377d09[_0xacb2('0x12')](0x1f4,_0x4f0950[_0xacb2('0x15')]));});});};
\ No newline at end of file
+var _0x25bb=['debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then'];(function(_0x2a4452,_0x48673f){var _0xd71e4d=function(_0x167744){while(--_0x167744){_0x2a4452['push'](_0x2a4452['shift']());}};_0xd71e4d(++_0x48673f);}(_0x25bb,0xd4));var _0xb25b=function(_0x3149bc,_0x29b5e3){_0x3149bc=_0x3149bc-0x0;var _0x1e5e34=_0x25bb[_0x3149bc];return _0x1e5e34;};'use strict';var _=require(_0xb25b('0x0'));var util=require(_0xb25b('0x1'));var moment=require(_0xb25b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb25b('0x3'));var fs=require('fs');var Redis=require(_0xb25b('0x4'));var db=require(_0xb25b('0x5'))['db'];var utils=require(_0xb25b('0x6'));var logger=require(_0xb25b('0x7'))(_0xb25b('0x8'));var config=require('../../config/environment');var jayson=require(_0xb25b('0x9'));var client=jayson[_0xb25b('0xa')][_0xb25b('0xb')]({'port':0x232a});config['redis']=_[_0xb25b('0xc')](config[_0xb25b('0xd')],{'host':_0xb25b('0xe'),'port':0x18eb});var socket=require(_0xb25b('0xf'))(new Redis(config[_0xb25b('0xd')]));require('./chatMessage.socket')[_0xb25b('0x10')](socket);function respondWithRpcPromise(_0x5a5d30,_0x5bcda1,_0x51fa58){return new BPromise(function(_0x593ab4,_0xe72ff9){return client[_0xb25b('0x11')](_0x5a5d30,_0x51fa58)['then'](function(_0x225bfe){logger[_0xb25b('0x12')](_0xb25b('0x13'),_0x5bcda1,_0xb25b('0x14'));logger['debug'](_0xb25b('0x15'),_0x5bcda1,'request\x20sent',JSON['stringify'](_0x225bfe));if(_0x225bfe[_0xb25b('0x16')]){if(_0x225bfe[_0xb25b('0x16')]['code']===0x1f4){logger[_0xb25b('0x16')](_0xb25b('0x13'),_0x5bcda1,_0x225bfe['error'][_0xb25b('0x17')]);return _0xe72ff9(_0x225bfe[_0xb25b('0x16')]['message']);}logger['error'](_0xb25b('0x13'),_0x5bcda1,_0x225bfe['error'][_0xb25b('0x17')]);return _0x593ab4(_0x225bfe[_0xb25b('0x16')][_0xb25b('0x17')]);}else{logger[_0xb25b('0x12')](_0xb25b('0x13'),_0x5bcda1,_0xb25b('0x14'));_0x593ab4(_0x225bfe[_0xb25b('0x18')][_0xb25b('0x17')]);}})[_0xb25b('0x19')](function(_0xb7b24){logger[_0xb25b('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5bcda1,_0xb7b24);_0xe72ff9(_0xb7b24);});});}exports[_0xb25b('0x1a')]=function(_0x463191){var _0x1d82d5=this;return new Promise(function(_0x28c90b,_0x9e786a){return db[_0xb25b('0x1b')][_0xb25b('0x1c')](_0x463191[_0xb25b('0x1d')],{'raw':_0x463191[_0xb25b('0x1e')]?_0x463191[_0xb25b('0x1e')][_0xb25b('0x1f')]===undefined?!![]:![]:!![]})[_0xb25b('0x20')](function(_0x55d873){logger['info']('CreateChatMessage',_0x463191);logger[_0xb25b('0x21')](_0xb25b('0x1a'),_0x463191,JSON[_0xb25b('0x22')](_0x55d873));_0x28c90b(_0x55d873);})['catch'](function(_0x11acfe){logger['error'](_0xb25b('0x1a'),_0x11acfe['message'],_0x463191);_0x9e786a(_0x1d82d5['error'](0x1f4,_0x11acfe[_0xb25b('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index b380fdb..84578b5 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 _0x3f8a=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1e878f,_0x3a63e7){_0x1e878f=_0x1e878f-0x0;var _0x442563=_0x3f8a[_0x1e878f];return _0x442563;};'use strict';var ChatMessageEvents=require(_0xa3f8('0x0'));var events=[_0xa3f8('0x1'),_0xa3f8('0x2'),_0xa3f8('0x3')];function createListener(_0x512b4c,_0x467a6c){return function(_0x143375){_0x467a6c[_0xa3f8('0x4')](_0x512b4c,_0x143375);};}function removeListener(_0x15b6aa,_0x2553fd){return function(){ChatMessageEvents[_0xa3f8('0x5')](_0x15b6aa,_0x2553fd);};}exports[_0xa3f8('0x6')]=function(_0x471464){for(var _0x1f160a=0x0,_0xf895d9=events[_0xa3f8('0x7')];_0x1f160a<_0xf895d9;_0x1f160a++){var _0x268332=events[_0x1f160a];var _0x2faf2e=createListener(_0xa3f8('0x8')+_0x268332,_0x471464);ChatMessageEvents['on'](_0x268332,_0x2faf2e);}};
\ No newline at end of file
+var _0xc1c6=['length','chatMessage:','./chatMessage.events','save','remove','emit','register'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3b795b,_0x1ca010){_0x3b795b=_0x3b795b-0x0;var _0x5a13fc=_0xc1c6[_0x3b795b];return _0x5a13fc;};'use strict';var ChatMessageEvents=require(_0x6c1c('0x0'));var events=[_0x6c1c('0x1'),_0x6c1c('0x2'),'update'];function createListener(_0x114c93,_0x4c33ca){return function(_0x426398){_0x4c33ca[_0x6c1c('0x3')](_0x114c93,_0x426398);};}function removeListener(_0x265d2c,_0x59f799){return function(){ChatMessageEvents['removeListener'](_0x265d2c,_0x59f799);};}exports[_0x6c1c('0x4')]=function(_0x524a6b){for(var _0x50c1bb=0x0,_0x582bec=events[_0x6c1c('0x5')];_0x50c1bb<_0x582bec;_0x50c1bb++){var _0x2eb1ba=events[_0x50c1bb];var _0x38369d=createListener(_0x6c1c('0x6')+_0x2eb1ba,_0x524a6b);ChatMessageEvents['on'](_0x2eb1ba,_0x38369d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c155fda..87617c4 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 _0xf579=['exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x4c480a,_0x34ebf2){var _0x2c0b49=function(_0x5a2cf6){while(--_0x5a2cf6){_0x4c480a['push'](_0x4c480a['shift']());}};_0x2c0b49(++_0x34ebf2);}(_0xf579,0x139));var _0x9f57=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf579[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x9f57('0x0'));var path=require('path');var timeout=require(_0x9f57('0x1'));var express=require(_0x9f57('0x2'));var router=express['Router']();var auth=require(_0x9f57('0x3'));var interaction=require(_0x9f57('0x4'));var config=require(_0x9f57('0x5'));var controller=require('./chatMessage.controller');router[_0x9f57('0x6')]('/',auth['isAuthenticated'](),controller[_0x9f57('0x7')]);router[_0x9f57('0x6')](_0x9f57('0x8'),auth[_0x9f57('0x9')](),controller[_0x9f57('0xa')]);router[_0x9f57('0x6')](_0x9f57('0xb'),auth[_0x9f57('0x9')](),controller['show']);router[_0x9f57('0xc')]('/',auth[_0x9f57('0x9')](),interaction[_0x9f57('0xd')](_0x9f57('0xe'),_0x9f57('0xf')),controller['create']);router['put'](_0x9f57('0xb'),controller[_0x9f57('0x10')]);router[_0x9f57('0x11')](_0x9f57('0x12'),auth[_0x9f57('0x9')](),controller[_0x9f57('0x13')]);router[_0x9f57('0x11')](_0x9f57('0x14'),auth[_0x9f57('0x9')](),controller[_0x9f57('0x15')]);router['delete'](_0x9f57('0xb'),auth['isAuthenticated'](),controller[_0x9f57('0x16')]);module[_0x9f57('0x17')]=router;
\ No newline at end of file
+var _0x5abe=['delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','/describe','isAuthenticated','describe','post','tracked','chatmessage:create','create','/:id','update','/:id/accept','accept','put','/:id/reject','reject'];(function(_0x29f06c,_0x3f36c1){var _0x5c8626=function(_0x1a4b01){while(--_0x1a4b01){_0x29f06c['push'](_0x29f06c['shift']());}};_0x5c8626(++_0x3f36c1);}(_0x5abe,0x161));var _0xe5ab=function(_0x19fb5e,_0x316197){_0x19fb5e=_0x19fb5e-0x0;var _0x48d0fa=_0x5abe[_0x19fb5e];return _0x48d0fa;};'use strict';var multer=require(_0xe5ab('0x0'));var util=require(_0xe5ab('0x1'));var path=require('path');var timeout=require(_0xe5ab('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe5ab('0x3'));var interaction=require(_0xe5ab('0x4'));var config=require(_0xe5ab('0x5'));var controller=require(_0xe5ab('0x6'));router[_0xe5ab('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe5ab('0x7')](_0xe5ab('0x8'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0xa')]);router['get']('/:id',auth[_0xe5ab('0x9')](),controller['show']);router[_0xe5ab('0xb')]('/',auth[_0xe5ab('0x9')](),interaction[_0xe5ab('0xc')]('chat',_0xe5ab('0xd')),controller[_0xe5ab('0xe')]);router['put'](_0xe5ab('0xf'),controller[_0xe5ab('0x10')]);router['put'](_0xe5ab('0x11'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0x12')]);router[_0xe5ab('0x13')](_0xe5ab('0x14'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0x15')]);router[_0xe5ab('0x16')](_0xe5ab('0xf'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0x17')]);module[_0xe5ab('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index c990d45..a28872f 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 _0x8e02=['TEXT','sequelize','exports'];(function(_0xac9411,_0x1fa94c){var _0x5ca0f4=function(_0x287ee8){while(--_0x287ee8){_0xac9411['push'](_0xac9411['shift']());}};_0x5ca0f4(++_0x1fa94c);}(_0x8e02,0x121));var _0x28e0=function(_0x3e5fb6,_0x21fb13){_0x3e5fb6=_0x3e5fb6-0x0;var _0x547d83=_0x8e02[_0x3e5fb6];return _0x547d83;};'use strict';var Sequelize=require(_0x28e0('0x0'));module[_0x28e0('0x1')]={'body':{'type':Sequelize[_0x28e0('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x084f=['sequelize','exports','medium'];(function(_0x4c5804,_0xb8dc50){var _0x406867=function(_0xda1fa){while(--_0xda1fa){_0x4c5804['push'](_0x4c5804['shift']());}};_0x406867(++_0xb8dc50);}(_0x084f,0x132));var _0xf084=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x084f[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0xf084('0x0'));module[_0xf084('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf084('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 637d60d..c44a6ad 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 _0xaa89=['error','name','send','index','ChatOfflineMessage','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','map','field','count','include','findAll','rows','catch','length','includeAll','merge','options','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy'];(function(_0x3ceb28,_0x2f61ea){var _0x31c60b=function(_0x5009d8){while(--_0x5009d8){_0x3ceb28['push'](_0x3ceb28['shift']());}};_0x31c60b(++_0x2f61ea);}(_0xaa89,0xb4));var _0x9aa8=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0xaa89[_0x6dfbaa];return _0xfbe02;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9aa8('0x0'));var rimraf=require(_0x9aa8('0x1'));var zipdir=require(_0x9aa8('0x2'));var jsonpatch=require(_0x9aa8('0x3'));var rp=require(_0x9aa8('0x4'));var moment=require(_0x9aa8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9aa8('0x6'));var util=require('util');var path=require(_0x9aa8('0x7'));var sox=require(_0x9aa8('0x8'));var csv=require(_0x9aa8('0x9'));var ejs=require(_0x9aa8('0xa'));var fs=require('fs');var _=require(_0x9aa8('0xb'));var squel=require(_0x9aa8('0xc'));var crypto=require(_0x9aa8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9aa8('0xe'));var toCsv=require(_0x9aa8('0x9'));var querystring=require('querystring');var Papa=require(_0x9aa8('0xf'));var Redis=require(_0x9aa8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9aa8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9aa8('0x12'))(_0x9aa8('0x13'));var utils=require('../../config/utils');var config=require(_0x9aa8('0x14'));var db=require(_0x9aa8('0x15'))['db'];function respondWithStatusCode(_0x386c8f,_0x4f16e0){_0x4f16e0=_0x4f16e0||0xcc;return function(_0xcb441b){if(_0xcb441b){return _0x386c8f[_0x9aa8('0x16')](_0x4f16e0);}return _0x386c8f[_0x9aa8('0x17')](_0x4f16e0)['end']();};}function respondWithResult(_0x5959b0,_0x3c5113){_0x3c5113=_0x3c5113||0xc8;return function(_0x442c82){if(_0x442c82){return _0x5959b0[_0x9aa8('0x17')](_0x3c5113)[_0x9aa8('0x18')](_0x442c82);}};}function respondWithFilteredResult(_0x151130,_0x444b9d){return function(_0x2e4ea3){if(_0x2e4ea3){var _0x4bc1b8=_0x2e4ea3['count'],_0x5a6bc9=_0x444b9d[_0x9aa8('0x19')],_0x502891=_0x444b9d[_0x9aa8('0x19')]+_0x444b9d[_0x9aa8('0x1a')],_0x3a0569;if(_0x502891>=_0x4bc1b8){_0x502891=_0x4bc1b8;_0x3a0569=0xc8;}else{_0x3a0569=0xce;}_0x151130['status'](_0x3a0569);return _0x151130['set'](_0x9aa8('0x1b'),_0x5a6bc9+'-'+_0x502891+'/'+_0x4bc1b8)['json'](_0x2e4ea3);}return null;};}function patchUpdates(_0x1fc11d){return function(_0x3b65a7){try{jsonpatch[_0x9aa8('0x1c')](_0x3b65a7,_0x1fc11d,!![]);}catch(_0x26ff9f){return BPromise[_0x9aa8('0x1d')](_0x26ff9f);}return _0x3b65a7[_0x9aa8('0x1e')]();};}function saveUpdates(_0x31558c,_0x579542){return function(_0x307ecd){if(_0x307ecd){return _0x307ecd['update'](_0x31558c)[_0x9aa8('0x1f')](function(_0x2e371b){return _0x2e371b;});}return null;};}function removeEntity(_0x55426b,_0x265940){return function(_0x1dfce8){if(_0x1dfce8){return _0x1dfce8[_0x9aa8('0x20')]()[_0x9aa8('0x1f')](function(){_0x55426b[_0x9aa8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f232,_0x126ffa){return function(_0x21390d){if(!_0x21390d){_0x37f232[_0x9aa8('0x16')](0x194);}return _0x21390d;};}function handleError(_0x44c401,_0x1ebdec){_0x1ebdec=_0x1ebdec||0x1f4;return function(_0x3d38ab){logger[_0x9aa8('0x21')](_0x3d38ab['stack']);if(_0x3d38ab[_0x9aa8('0x22')]){delete _0x3d38ab[_0x9aa8('0x22')];}_0x44c401[_0x9aa8('0x17')](_0x1ebdec)[_0x9aa8('0x23')](_0x3d38ab);};}exports[_0x9aa8('0x24')]=function(_0x9851ec,_0x384283){var _0x3f6530={},_0x989642={},_0x54ce38={'count':0x0,'rows':[]};var _0x59de58=_['map'](db[_0x9aa8('0x25')][_0x9aa8('0x26')],function(_0xee9218){return{'name':_0xee9218['fieldName'],'type':_0xee9218[_0x9aa8('0x27')][_0x9aa8('0x28')]};});_0x989642[_0x9aa8('0x29')]=_['map'](_0x59de58,'name');_0x989642['query']=_[_0x9aa8('0x2a')](_0x9851ec[_0x9aa8('0x2b')]);_0x989642[_0x9aa8('0x2c')]=_['intersection'](_0x989642[_0x9aa8('0x29')],_0x989642[_0x9aa8('0x2b')]);_0x3f6530[_0x9aa8('0x2d')]=_[_0x9aa8('0x2e')](_0x989642[_0x9aa8('0x29')],qs[_0x9aa8('0x2f')](_0x9851ec['query'][_0x9aa8('0x2f')]));_0x3f6530['attributes']=_0x3f6530[_0x9aa8('0x2d')]['length']?_0x3f6530[_0x9aa8('0x2d')]:_0x989642[_0x9aa8('0x29')];if(!_0x9851ec[_0x9aa8('0x2b')][_0x9aa8('0x30')]('nolimit')){_0x3f6530[_0x9aa8('0x1a')]=qs['limit'](_0x9851ec['query']['limit']);_0x3f6530['offset']=qs[_0x9aa8('0x19')](_0x9851ec['query'][_0x9aa8('0x19')]);}_0x3f6530[_0x9aa8('0x31')]=qs[_0x9aa8('0x32')](_0x9851ec[_0x9aa8('0x2b')][_0x9aa8('0x32')]);_0x3f6530[_0x9aa8('0x33')]=qs['filters'](_[_0x9aa8('0x34')](_0x9851ec[_0x9aa8('0x2b')],_0x989642[_0x9aa8('0x2c')]));if(_0x9851ec['query'][_0x9aa8('0x35')]){_0x3f6530[_0x9aa8('0x33')]=_['merge'](_0x3f6530[_0x9aa8('0x33')],{'$or':_[_0x9aa8('0x36')](_0x59de58,function(_0x2489b4){if(_0x2489b4[_0x9aa8('0x27')]['key']!=='VIRTUAL'){var _0x2b64a6={};_0x2b64a6[_0x2489b4[_0x9aa8('0x37')]]={'$like':'%'+_0x9851ec[_0x9aa8('0x2b')][_0x9aa8('0x35')]+'%'};return _0x2b64a6;}})});}_0x3f6530=_['merge']({},_0x3f6530,_0x9851ec['options']);var _0x2ae8a7={'where':_0x3f6530[_0x9aa8('0x33')]};return db['ChatOfflineMessage'][_0x9aa8('0x38')](_0x2ae8a7)[_0x9aa8('0x1f')](function(_0x50ac75){_0x54ce38[_0x9aa8('0x38')]=_0x50ac75;if(_0x9851ec[_0x9aa8('0x2b')]['includeAll']){_0x3f6530[_0x9aa8('0x39')]=[{'all':!![]}];}return db[_0x9aa8('0x25')][_0x9aa8('0x3a')](_0x3f6530);})['then'](function(_0x3e1d80){_0x54ce38[_0x9aa8('0x3b')]=_0x3e1d80;return _0x54ce38;})[_0x9aa8('0x1f')](respondWithFilteredResult(_0x384283,_0x3f6530))[_0x9aa8('0x3c')](handleError(_0x384283,null));};exports['show']=function(_0x48ac50,_0x3be1d4){var _0x5aa17b={'raw':!![],'where':{'id':_0x48ac50['params']['id']}},_0x11eecb={};_0x11eecb[_0x9aa8('0x29')]=_['keys'](db['ChatOfflineMessage'][_0x9aa8('0x26')]);_0x11eecb[_0x9aa8('0x2b')]=_['keys'](_0x48ac50[_0x9aa8('0x2b')]);_0x11eecb[_0x9aa8('0x2c')]=_[_0x9aa8('0x2e')](_0x11eecb[_0x9aa8('0x29')],_0x11eecb[_0x9aa8('0x2b')]);_0x5aa17b[_0x9aa8('0x2d')]=_[_0x9aa8('0x2e')](_0x11eecb[_0x9aa8('0x29')],qs[_0x9aa8('0x2f')](_0x48ac50[_0x9aa8('0x2b')][_0x9aa8('0x2f')]));_0x5aa17b[_0x9aa8('0x2d')]=_0x5aa17b[_0x9aa8('0x2d')][_0x9aa8('0x3d')]?_0x5aa17b['attributes']:_0x11eecb[_0x9aa8('0x29')];if(_0x48ac50[_0x9aa8('0x2b')][_0x9aa8('0x3e')]){_0x5aa17b[_0x9aa8('0x39')]=[{'all':!![]}];}_0x5aa17b=_[_0x9aa8('0x3f')]({},_0x5aa17b,_0x48ac50[_0x9aa8('0x40')]);return db[_0x9aa8('0x25')]['find'](_0x5aa17b)[_0x9aa8('0x1f')](handleEntityNotFound(_0x3be1d4,null))['then'](respondWithResult(_0x3be1d4,null))[_0x9aa8('0x3c')](handleError(_0x3be1d4,null));};exports[_0x9aa8('0x41')]=function(_0x27fe39,_0x30d534){return db['ChatOfflineMessage'][_0x9aa8('0x41')](_0x27fe39[_0x9aa8('0x42')],{})[_0x9aa8('0x1f')](respondWithResult(_0x30d534,0xc9))['catch'](handleError(_0x30d534,null));};exports[_0x9aa8('0x43')]=function(_0x3d0260,_0x403fef){if(_0x3d0260[_0x9aa8('0x42')]['id']){delete _0x3d0260[_0x9aa8('0x42')]['id'];}return db['ChatOfflineMessage'][_0x9aa8('0x44')]({'where':{'id':_0x3d0260[_0x9aa8('0x45')]['id']}})[_0x9aa8('0x1f')](handleEntityNotFound(_0x403fef,null))[_0x9aa8('0x1f')](saveUpdates(_0x3d0260[_0x9aa8('0x42')],null))[_0x9aa8('0x1f')](respondWithResult(_0x403fef,null))[_0x9aa8('0x3c')](handleError(_0x403fef,null));};exports[_0x9aa8('0x20')]=function(_0x27078b,_0x576bc9){return db['ChatOfflineMessage']['find']({'where':{'id':_0x27078b[_0x9aa8('0x45')]['id']}})[_0x9aa8('0x1f')](handleEntityNotFound(_0x576bc9,null))[_0x9aa8('0x1f')](removeEntity(_0x576bc9,null))['catch'](handleError(_0x576bc9,null));};exports[_0x9aa8('0x46')]=function(_0x3def22,_0x7f08b2){return db[_0x9aa8('0x25')]['describe']()[_0x9aa8('0x1f')](respondWithResult(_0x7f08b2,null))[_0x9aa8('0x3c')](handleError(_0x7f08b2,null));};
\ No newline at end of file
+var _0x7528=['query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','catch','params','keys','fields','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key','model'];(function(_0x5d374f,_0x200a34){var _0x5819b4=function(_0x26464f){while(--_0x26464f){_0x5d374f['push'](_0x5d374f['shift']());}};_0x5819b4(++_0x200a34);}(_0x7528,0xb8));var _0x8752=function(_0x9290e5,_0x294298){_0x9290e5=_0x9290e5-0x0;var _0x125c7d=_0x7528[_0x9290e5];return _0x125c7d;};'use strict';var pdf=require(_0x8752('0x0'));var emlformat=require(_0x8752('0x1'));var rimraf=require(_0x8752('0x2'));var zipdir=require(_0x8752('0x3'));var jsonpatch=require(_0x8752('0x4'));var rp=require(_0x8752('0x5'));var moment=require(_0x8752('0x6'));var BPromise=require(_0x8752('0x7'));var Mustache=require('mustache');var util=require(_0x8752('0x8'));var path=require(_0x8752('0x9'));var sox=require(_0x8752('0xa'));var csv=require(_0x8752('0xb'));var ejs=require(_0x8752('0xc'));var fs=require('fs');var _=require(_0x8752('0xd'));var squel=require(_0x8752('0xe'));var crypto=require(_0x8752('0xf'));var jsforce=require(_0x8752('0x10'));var deskjs=require(_0x8752('0x11'));var toCsv=require(_0x8752('0xb'));var querystring=require(_0x8752('0x12'));var Papa=require(_0x8752('0x13'));var Redis=require(_0x8752('0x14'));var authService=require(_0x8752('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x8752('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8752('0x17'));var utils=require(_0x8752('0x18'));var config=require(_0x8752('0x19'));var db=require(_0x8752('0x1a'))['db'];function respondWithStatusCode(_0x2ecaf0,_0x5b8d41){_0x5b8d41=_0x5b8d41||0xcc;return function(_0x54a6d3){if(_0x54a6d3){return _0x2ecaf0[_0x8752('0x1b')](_0x5b8d41);}return _0x2ecaf0['status'](_0x5b8d41)[_0x8752('0x1c')]();};}function respondWithResult(_0x4e59bb,_0x5654e4){_0x5654e4=_0x5654e4||0xc8;return function(_0xc47c5a){if(_0xc47c5a){return _0x4e59bb['status'](_0x5654e4)[_0x8752('0x1d')](_0xc47c5a);}};}function respondWithFilteredResult(_0x132052,_0x3a523f){return function(_0x50fcc3){if(_0x50fcc3){var _0x26da17=_0x50fcc3['count'],_0x483f06=_0x3a523f[_0x8752('0x1e')],_0x53dd36=_0x3a523f[_0x8752('0x1e')]+_0x3a523f['limit'],_0x28baaa;if(_0x53dd36>=_0x26da17){_0x53dd36=_0x26da17;_0x28baaa=0xc8;}else{_0x28baaa=0xce;}_0x132052[_0x8752('0x1f')](_0x28baaa);return _0x132052[_0x8752('0x20')](_0x8752('0x21'),_0x483f06+'-'+_0x53dd36+'/'+_0x26da17)[_0x8752('0x1d')](_0x50fcc3);}return null;};}function patchUpdates(_0x3c01aa){return function(_0x2cf282){try{jsonpatch[_0x8752('0x22')](_0x2cf282,_0x3c01aa,!![]);}catch(_0x49a3f5){return BPromise['reject'](_0x49a3f5);}return _0x2cf282['save']();};}function saveUpdates(_0x1def32,_0x1f1dae){return function(_0x37b2e9){if(_0x37b2e9){return _0x37b2e9[_0x8752('0x23')](_0x1def32)[_0x8752('0x24')](function(_0x15774f){return _0x15774f;});}return null;};}function removeEntity(_0x235dfa,_0x2ed5d9){return function(_0x339f4a){if(_0x339f4a){return _0x339f4a[_0x8752('0x25')]()[_0x8752('0x24')](function(){_0x235dfa['status'](0xcc)[_0x8752('0x1c')]();});}};}function handleEntityNotFound(_0x415e04,_0x39ab97){return function(_0x3bdeae){if(!_0x3bdeae){_0x415e04[_0x8752('0x1b')](0x194);}return _0x3bdeae;};}function handleError(_0x58f6c5,_0x501461){_0x501461=_0x501461||0x1f4;return function(_0x84a229){logger[_0x8752('0x26')](_0x84a229[_0x8752('0x27')]);if(_0x84a229[_0x8752('0x28')]){delete _0x84a229[_0x8752('0x28')];}_0x58f6c5[_0x8752('0x1f')](_0x501461)[_0x8752('0x29')](_0x84a229);};}exports[_0x8752('0x2a')]=function(_0x33804e,_0x1610a7){var _0x4977b1={},_0xc90341={},_0x4971ca={'count':0x0,'rows':[]};var _0x305354=_[_0x8752('0x2b')](db[_0x8752('0x2c')][_0x8752('0x2d')],function(_0x13e675){return{'name':_0x13e675[_0x8752('0x2e')],'type':_0x13e675[_0x8752('0x2f')][_0x8752('0x30')]};});_0xc90341[_0x8752('0x31')]=_['map'](_0x305354,_0x8752('0x28'));_0xc90341[_0x8752('0x32')]=_['keys'](_0x33804e[_0x8752('0x32')]);_0xc90341[_0x8752('0x33')]=_[_0x8752('0x34')](_0xc90341[_0x8752('0x31')],_0xc90341[_0x8752('0x32')]);_0x4977b1['attributes']=_[_0x8752('0x34')](_0xc90341[_0x8752('0x31')],qs['fields'](_0x33804e[_0x8752('0x32')]['fields']));_0x4977b1[_0x8752('0x35')]=_0x4977b1[_0x8752('0x35')][_0x8752('0x36')]?_0x4977b1[_0x8752('0x35')]:_0xc90341[_0x8752('0x31')];if(!_0x33804e['query'][_0x8752('0x37')](_0x8752('0x38'))){_0x4977b1[_0x8752('0x39')]=qs[_0x8752('0x39')](_0x33804e[_0x8752('0x32')][_0x8752('0x39')]);_0x4977b1[_0x8752('0x1e')]=qs[_0x8752('0x1e')](_0x33804e[_0x8752('0x32')]['offset']);}_0x4977b1[_0x8752('0x3a')]=qs['sort'](_0x33804e[_0x8752('0x32')][_0x8752('0x3b')]);_0x4977b1[_0x8752('0x3c')]=qs[_0x8752('0x33')](_[_0x8752('0x3d')](_0x33804e[_0x8752('0x32')],_0xc90341[_0x8752('0x33')]));if(_0x33804e[_0x8752('0x32')]['filter']){_0x4977b1[_0x8752('0x3c')]=_['merge'](_0x4977b1[_0x8752('0x3c')],{'$or':_[_0x8752('0x2b')](_0x305354,function(_0x356e4c){if(_0x356e4c[_0x8752('0x2f')][_0x8752('0x30')]!==_0x8752('0x3e')){var _0x545704={};_0x545704[_0x356e4c['field']]={'$like':'%'+_0x33804e[_0x8752('0x32')][_0x8752('0x3f')]+'%'};return _0x545704;}})});}_0x4977b1=_[_0x8752('0x40')]({},_0x4977b1,_0x33804e[_0x8752('0x41')]);var _0x211212={'where':_0x4977b1[_0x8752('0x3c')]};return db[_0x8752('0x2c')][_0x8752('0x42')](_0x211212)[_0x8752('0x24')](function(_0x425bda){_0x4971ca[_0x8752('0x42')]=_0x425bda;if(_0x33804e[_0x8752('0x32')]['includeAll']){_0x4977b1[_0x8752('0x43')]=[{'all':!![]}];}return db[_0x8752('0x2c')][_0x8752('0x44')](_0x4977b1);})[_0x8752('0x24')](function(_0x58635d){_0x4971ca['rows']=_0x58635d;return _0x4971ca;})[_0x8752('0x24')](respondWithFilteredResult(_0x1610a7,_0x4977b1))[_0x8752('0x45')](handleError(_0x1610a7,null));};exports['show']=function(_0x555bd8,_0x529b0a){var _0x399f94={'raw':!![],'where':{'id':_0x555bd8[_0x8752('0x46')]['id']}},_0x517f17={};_0x517f17[_0x8752('0x31')]=_[_0x8752('0x47')](db[_0x8752('0x2c')]['rawAttributes']);_0x517f17[_0x8752('0x32')]=_[_0x8752('0x47')](_0x555bd8[_0x8752('0x32')]);_0x517f17[_0x8752('0x33')]=_[_0x8752('0x34')](_0x517f17[_0x8752('0x31')],_0x517f17['query']);_0x399f94[_0x8752('0x35')]=_['intersection'](_0x517f17[_0x8752('0x31')],qs['fields'](_0x555bd8[_0x8752('0x32')][_0x8752('0x48')]));_0x399f94[_0x8752('0x35')]=_0x399f94[_0x8752('0x35')]['length']?_0x399f94[_0x8752('0x35')]:_0x517f17[_0x8752('0x31')];if(_0x555bd8[_0x8752('0x32')][_0x8752('0x49')]){_0x399f94[_0x8752('0x43')]=[{'all':!![]}];}_0x399f94=_['merge']({},_0x399f94,_0x555bd8[_0x8752('0x41')]);return db[_0x8752('0x2c')][_0x8752('0x4a')](_0x399f94)[_0x8752('0x24')](handleEntityNotFound(_0x529b0a,null))[_0x8752('0x24')](respondWithResult(_0x529b0a,null))['catch'](handleError(_0x529b0a,null));};exports['create']=function(_0x4908c1,_0x5634da){return db[_0x8752('0x2c')][_0x8752('0x4b')](_0x4908c1['body'],{})[_0x8752('0x24')](respondWithResult(_0x5634da,0xc9))[_0x8752('0x45')](handleError(_0x5634da,null));};exports[_0x8752('0x23')]=function(_0x4531a1,_0x2108c4){if(_0x4531a1['body']['id']){delete _0x4531a1[_0x8752('0x4c')]['id'];}return db[_0x8752('0x2c')][_0x8752('0x4a')]({'where':{'id':_0x4531a1['params']['id']}})[_0x8752('0x24')](handleEntityNotFound(_0x2108c4,null))[_0x8752('0x24')](saveUpdates(_0x4531a1[_0x8752('0x4c')],null))['then'](respondWithResult(_0x2108c4,null))[_0x8752('0x45')](handleError(_0x2108c4,null));};exports[_0x8752('0x25')]=function(_0x3a73ef,_0xc562a3){return db[_0x8752('0x2c')][_0x8752('0x4a')]({'where':{'id':_0x3a73ef['params']['id']}})[_0x8752('0x24')](handleEntityNotFound(_0xc562a3,null))[_0x8752('0x24')](removeEntity(_0xc562a3,null))['catch'](handleError(_0xc562a3,null));};exports[_0x8752('0x4d')]=function(_0x5215f5,_0x9b34ef){return db['ChatOfflineMessage'][_0x8752('0x4d')]()[_0x8752('0x24')](respondWithResult(_0x9b34ef,null))[_0x8752('0x45')](handleError(_0x9b34ef,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index c830ef7..ab1840a 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 _0x50a6=['util','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0x50a6,0xa4));var _0x650a=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x50a6[_0x2c5255];return _0x30d0ea;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));module['exports']=function(_0x4eabde,_0x2d486d){return _0x4eabde[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':_0x650a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x650a('0xa')});};
\ No newline at end of file
+var _0xa8a8=['bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5eca47,_0x59df4a){var _0x3776c2=function(_0x5b957d){while(--_0x5b957d){_0x5eca47['push'](_0x5eca47['shift']());}};_0x3776c2(++_0x59df4a);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2bac71,_0x1a46c3){_0x2bac71=_0x2bac71-0x0;var _0x154465=_0xa8a8[_0x2bac71];return _0x154465;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a8a('0xe'),'collate':_0x8a8a('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f351ba3..f539c4c 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 _0x137a=['request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5c2dd5,_0x5e339f){var _0x98129b=function(_0x5a7b2f){while(--_0x5a7b2f){_0x5c2dd5['push'](_0x5c2dd5['shift']());}};_0x98129b(++_0x5e339f);}(_0x137a,0x8f));var _0xa137=function(_0x33ce84,_0x25b01a){_0x33ce84=_0x33ce84-0x0;var _0x4dfa04=_0x137a[_0x33ce84];return _0x4dfa04;};'use strict';var _=require('lodash');var util=require(_0xa137('0x0'));var moment=require(_0xa137('0x1'));var BPromise=require(_0xa137('0x2'));var rs=require(_0xa137('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa137('0x4'));var logger=require(_0xa137('0x5'))(_0xa137('0x6'));var config=require(_0xa137('0x7'));var jayson=require(_0xa137('0x8'));var client=jayson[_0xa137('0x9')][_0xa137('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4af803,_0x17d4f5,_0x2f142b){return new BPromise(function(_0x2e2bce,_0x28abfd){return client[_0xa137('0xb')](_0x4af803,_0x2f142b)['then'](function(_0x1c35d4){logger[_0xa137('0xc')](_0xa137('0xd'),_0x17d4f5,_0xa137('0xe'));logger[_0xa137('0xf')](_0xa137('0x10'),_0x17d4f5,'request\x20sent',JSON[_0xa137('0x11')](_0x1c35d4));if(_0x1c35d4[_0xa137('0x12')]){if(_0x1c35d4['error'][_0xa137('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x17d4f5,_0x1c35d4[_0xa137('0x12')][_0xa137('0x14')]);return _0x28abfd(_0x1c35d4[_0xa137('0x12')][_0xa137('0x14')]);}logger[_0xa137('0x12')](_0xa137('0xd'),_0x17d4f5,_0x1c35d4[_0xa137('0x12')][_0xa137('0x14')]);return _0x2e2bce(_0x1c35d4[_0xa137('0x12')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x17d4f5,_0xa137('0xe'));_0x2e2bce(_0x1c35d4['result'][_0xa137('0x14')]);}})[_0xa137('0x15')](function(_0x3f5e7e){logger[_0xa137('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x17d4f5,_0x3f5e7e);_0x28abfd(_0x3f5e7e);});});}
\ No newline at end of file
+var _0x0674=['ChatOfflineMessage,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0xf0e90f,_0x34c54e){var _0x3cbd07=function(_0x23a2a7){while(--_0x23a2a7){_0xf0e90f['push'](_0xf0e90f['shift']());}};_0x3cbd07(++_0x34c54e);}(_0x0674,0x145));var _0x4067=function(_0x5f29b3,_0x4f007c){_0x5f29b3=_0x5f29b3-0x0;var _0x36ec6a=_0x0674[_0x5f29b3];return _0x36ec6a;};'use strict';var _=require(_0x4067('0x0'));var util=require(_0x4067('0x1'));var moment=require(_0x4067('0x2'));var BPromise=require(_0x4067('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4067('0x4'));var db=require(_0x4067('0x5'))['db'];var utils=require(_0x4067('0x6'));var logger=require(_0x4067('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4067('0x8')][_0x4067('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9a,_0x27a1ee,_0x3a9e6d){return new BPromise(function(_0x1c408a,_0x17012a){return client[_0x4067('0xa')](_0x326b9a,_0x3a9e6d)[_0x4067('0xb')](function(_0xb68663){logger[_0x4067('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27a1ee,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x27a1ee,_0x4067('0xd'),JSON[_0x4067('0xe')](_0xb68663));if(_0xb68663[_0x4067('0xf')]){if(_0xb68663[_0x4067('0xf')][_0x4067('0x10')]===0x1f4){logger[_0x4067('0xf')](_0x4067('0x11'),_0x27a1ee,_0xb68663[_0x4067('0xf')][_0x4067('0x12')]);return _0x17012a(_0xb68663[_0x4067('0xf')][_0x4067('0x12')]);}logger[_0x4067('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27a1ee,_0xb68663[_0x4067('0xf')][_0x4067('0x12')]);return _0x1c408a(_0xb68663[_0x4067('0xf')]['message']);}else{logger['info'](_0x4067('0x11'),_0x27a1ee,'request\x20sent');_0x1c408a(_0xb68663['result']['message']);}})['catch'](function(_0x57b379){logger[_0x4067('0xf')](_0x4067('0x11'),_0x27a1ee,_0x57b379);_0x17012a(_0x57b379);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index eabb735..8c45c7a 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 _0x62df=['Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','express'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0x62df,0x82));var _0xf62d=function(_0x50dfb0,_0x4f2dbe){_0x50dfb0=_0x50dfb0-0x0;var _0x30a43f=_0x62df[_0x50dfb0];return _0x30a43f;};'use strict';var multer=require(_0xf62d('0x0'));var util=require(_0xf62d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf62d('0x2'));var router=express[_0xf62d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf62d('0x4'));var config=require(_0xf62d('0x5'));var controller=require(_0xf62d('0x6'));router[_0xf62d('0x7')]('/',auth[_0xf62d('0x8')](),controller[_0xf62d('0x9')]);router['get'](_0xf62d('0xa'),auth[_0xf62d('0x8')](),controller[_0xf62d('0xb')]);router[_0xf62d('0x7')](_0xf62d('0xc'),auth[_0xf62d('0x8')](),controller[_0xf62d('0xd')]);router['post']('/',auth[_0xf62d('0x8')](),controller[_0xf62d('0xe')]);router[_0xf62d('0xf')](_0xf62d('0xc'),auth[_0xf62d('0x8')](),controller[_0xf62d('0x10')]);router[_0xf62d('0x11')](_0xf62d('0xc'),auth[_0xf62d('0x8')](),controller[_0xf62d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0195=['update','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','put'];(function(_0x40502f,_0x5aff42){var _0x12a5b9=function(_0x35dbd3){while(--_0x35dbd3){_0x40502f['push'](_0x40502f['shift']());}};_0x12a5b9(++_0x5aff42);}(_0x0195,0xb7));var _0x5019=function(_0x49c9b2,_0x4b0a0b){_0x49c9b2=_0x49c9b2-0x0;var _0x163e08=_0x0195[_0x49c9b2];return _0x163e08;};'use strict';var multer=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var path=require(_0x5019('0x2'));var timeout=require('connect-timeout');var express=require(_0x5019('0x3'));var router=express[_0x5019('0x4')]();var auth=require(_0x5019('0x5'));var interaction=require(_0x5019('0x6'));var config=require(_0x5019('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x5019('0x8')]('/',auth[_0x5019('0x9')](),controller[_0x5019('0xa')]);router['get'](_0x5019('0xb'),auth[_0x5019('0x9')](),controller[_0x5019('0xc')]);router[_0x5019('0x8')]('/:id',auth[_0x5019('0x9')](),controller['show']);router[_0x5019('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5019('0xe')]('/:id',auth[_0x5019('0x9')](),controller[_0x5019('0xf')]);router['delete'](_0x5019('0x10'),auth['isAuthenticated'](),controller[_0x5019('0x11')]);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 c0d097a..cc460e2 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 _0xf60a=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x50e7b6,_0x101b29){var _0x25346b=function(_0x380e58){while(--_0x380e58){_0x50e7b6['push'](_0x50e7b6['shift']());}};_0x25346b(++_0x101b29);}(_0xf60a,0xc9));var _0xaf60=function(_0x1ea01b,_0x15a0e9){_0x1ea01b=_0x1ea01b-0x0;var _0x5b97fa=_0xf60a[_0x1ea01b];return _0x5b97fa;};'use strict';var Sequelize=require(_0xaf60('0x0'));module[_0xaf60('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xaf60('0x2')](_0xaf60('0x3'),_0xaf60('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xaf60('0x5')]},'timeout':{'type':Sequelize[_0xaf60('0x6')]}};
\ No newline at end of file
+var _0xb8e6=['sequelize','exports','STRING','mouseOver','INTEGER'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xb8e6,0x87));var _0x6b8e=function(_0x39c6bb,_0x3168e4){_0x39c6bb=_0x39c6bb-0x0;var _0x9cc25f=_0xb8e6[_0x39c6bb];return _0x9cc25f;};'use strict';var Sequelize=require(_0x6b8e('0x0'));module[_0x6b8e('0x1')]={'name':{'type':Sequelize[_0x6b8e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b8e('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6b8e('0x2')]},'timeout':{'type':Sequelize[_0x6b8e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e9e3816..53c96e0 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 _0xcddd=['fields','attributes','length','includeAll','merge','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','show','keys','ChatProactiveAction','query','model'];(function(_0x5dc88c,_0x5773cc){var _0x43648c=function(_0x30a50b){while(--_0x30a50b){_0x5dc88c['push'](_0x5dc88c['shift']());}};_0x43648c(++_0x5773cc);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x4a314a,_0x8b5b01){_0x4a314a=_0x4a314a-0x0;var _0x3ff41d=_0xcddd[_0x4a314a];return _0x3ff41d;};'use strict';var pdf=require(_0xdcdd('0x0'));var emlformat=require(_0xdcdd('0x1'));var rimraf=require(_0xdcdd('0x2'));var zipdir=require(_0xdcdd('0x3'));var jsonpatch=require(_0xdcdd('0x4'));var rp=require(_0xdcdd('0x5'));var moment=require(_0xdcdd('0x6'));var BPromise=require(_0xdcdd('0x7'));var Mustache=require(_0xdcdd('0x8'));var util=require(_0xdcdd('0x9'));var path=require(_0xdcdd('0xa'));var sox=require(_0xdcdd('0xb'));var csv=require('to-csv');var ejs=require(_0xdcdd('0xc'));var fs=require('fs');var _=require(_0xdcdd('0xd'));var squel=require('squel');var crypto=require(_0xdcdd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdcdd('0xf'));var toCsv=require(_0xdcdd('0x10'));var querystring=require(_0xdcdd('0x11'));var Papa=require('papaparse');var Redis=require(_0xdcdd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdcdd('0x13'));var as=require(_0xdcdd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcdd('0x15'))(_0xdcdd('0x16'));var utils=require(_0xdcdd('0x17'));var config=require(_0xdcdd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e7859,_0x40a316){_0x40a316=_0x40a316||0xcc;return function(_0x11e0b4){if(_0x11e0b4){return _0x4e7859['sendStatus'](_0x40a316);}return _0x4e7859[_0xdcdd('0x19')](_0x40a316)[_0xdcdd('0x1a')]();};}function respondWithResult(_0x265837,_0x18ab60){_0x18ab60=_0x18ab60||0xc8;return function(_0x2cd434){if(_0x2cd434){return _0x265837['status'](_0x18ab60)[_0xdcdd('0x1b')](_0x2cd434);}};}function respondWithFilteredResult(_0xb27495,_0x5ea867){return function(_0x31ae41){if(_0x31ae41){var _0x2702b0=_0x31ae41['count'],_0x4d9a72=_0x5ea867[_0xdcdd('0x1c')],_0x534847=_0x5ea867[_0xdcdd('0x1c')]+_0x5ea867[_0xdcdd('0x1d')],_0x313273;if(_0x534847>=_0x2702b0){_0x534847=_0x2702b0;_0x313273=0xc8;}else{_0x313273=0xce;}_0xb27495[_0xdcdd('0x19')](_0x313273);return _0xb27495[_0xdcdd('0x1e')](_0xdcdd('0x1f'),_0x4d9a72+'-'+_0x534847+'/'+_0x2702b0)['json'](_0x31ae41);}return null;};}function patchUpdates(_0x3d4932){return function(_0x52c38b){try{jsonpatch[_0xdcdd('0x20')](_0x52c38b,_0x3d4932,!![]);}catch(_0x5f38c0){return BPromise['reject'](_0x5f38c0);}return _0x52c38b[_0xdcdd('0x21')]();};}function saveUpdates(_0xddaa45,_0x28a477){return function(_0xfadcc0){if(_0xfadcc0){return _0xfadcc0[_0xdcdd('0x22')](_0xddaa45)[_0xdcdd('0x23')](function(_0x13f1b1){return _0x13f1b1;});}return null;};}function removeEntity(_0x14e523,_0x18b78d){return function(_0x51ca55){if(_0x51ca55){return _0x51ca55[_0xdcdd('0x24')]()[_0xdcdd('0x23')](function(){_0x14e523[_0xdcdd('0x19')](0xcc)[_0xdcdd('0x1a')]();});}};}function handleEntityNotFound(_0x3e31ae,_0x26a365){return function(_0x5cf148){if(!_0x5cf148){_0x3e31ae[_0xdcdd('0x25')](0x194);}return _0x5cf148;};}function handleError(_0x11f567,_0x2a3e38){_0x2a3e38=_0x2a3e38||0x1f4;return function(_0x873850){logger[_0xdcdd('0x26')](_0x873850[_0xdcdd('0x27')]);if(_0x873850[_0xdcdd('0x28')]){delete _0x873850[_0xdcdd('0x28')];}_0x11f567[_0xdcdd('0x19')](_0x2a3e38)[_0xdcdd('0x29')](_0x873850);};}exports[_0xdcdd('0x2a')]=function(_0x34a6b0,_0x3b1b4a){var _0xe6b71={'raw':!![],'where':{'id':_0x34a6b0['params']['id']}},_0x49cb3e={};_0x49cb3e['model']=_[_0xdcdd('0x2b')](db[_0xdcdd('0x2c')]['rawAttributes']);_0x49cb3e[_0xdcdd('0x2d')]=_[_0xdcdd('0x2b')](_0x34a6b0['query']);_0x49cb3e['filters']=_['intersection'](_0x49cb3e[_0xdcdd('0x2e')],_0x49cb3e[_0xdcdd('0x2d')]);_0xe6b71['attributes']=_['intersection'](_0x49cb3e[_0xdcdd('0x2e')],qs[_0xdcdd('0x2f')](_0x34a6b0[_0xdcdd('0x2d')]['fields']));_0xe6b71[_0xdcdd('0x30')]=_0xe6b71[_0xdcdd('0x30')][_0xdcdd('0x31')]?_0xe6b71[_0xdcdd('0x30')]:_0x49cb3e['model'];if(_0x34a6b0[_0xdcdd('0x2d')][_0xdcdd('0x32')]){_0xe6b71['include']=[{'all':!![]}];}_0xe6b71=_[_0xdcdd('0x33')]({},_0xe6b71,_0x34a6b0[_0xdcdd('0x34')]);return db[_0xdcdd('0x2c')][_0xdcdd('0x35')](_0xe6b71)[_0xdcdd('0x23')](handleEntityNotFound(_0x3b1b4a,null))[_0xdcdd('0x23')](respondWithResult(_0x3b1b4a,null))[_0xdcdd('0x36')](handleError(_0x3b1b4a,null));};exports[_0xdcdd('0x37')]=function(_0x510755,_0x1035e4){return db[_0xdcdd('0x2c')][_0xdcdd('0x37')](_0x510755[_0xdcdd('0x38')],{})[_0xdcdd('0x23')](respondWithResult(_0x1035e4,0xc9))[_0xdcdd('0x36')](handleError(_0x1035e4,null));};exports[_0xdcdd('0x22')]=function(_0xaca658,_0x4c90d3){if(_0xaca658[_0xdcdd('0x38')]['id']){delete _0xaca658['body']['id'];}return db[_0xdcdd('0x2c')][_0xdcdd('0x35')]({'where':{'id':_0xaca658[_0xdcdd('0x39')]['id']}})['then'](handleEntityNotFound(_0x4c90d3,null))[_0xdcdd('0x23')](saveUpdates(_0xaca658[_0xdcdd('0x38')],null))[_0xdcdd('0x23')](respondWithResult(_0x4c90d3,null))[_0xdcdd('0x36')](handleError(_0x4c90d3,null));};exports[_0xdcdd('0x24')]=function(_0x4a946b,_0xcacc53){return db[_0xdcdd('0x2c')]['find']({'where':{'id':_0x4a946b[_0xdcdd('0x39')]['id']}})['then'](handleEntityNotFound(_0xcacc53,null))[_0xdcdd('0x23')](removeEntity(_0xcacc53,null))[_0xdcdd('0x36')](handleError(_0xcacc53,null));};
\ No newline at end of file
+var _0x77f7=['merge','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x77f7,0xbd));var _0x777f=function(_0x2701a1,_0x30bffc){_0x2701a1=_0x2701a1-0x0;var _0x1cb0d9=_0x77f7[_0x2701a1];return _0x1cb0d9;};'use strict';var pdf=require(_0x777f('0x0'));var emlformat=require(_0x777f('0x1'));var rimraf=require(_0x777f('0x2'));var zipdir=require(_0x777f('0x3'));var jsonpatch=require(_0x777f('0x4'));var rp=require(_0x777f('0x5'));var moment=require(_0x777f('0x6'));var BPromise=require(_0x777f('0x7'));var Mustache=require(_0x777f('0x8'));var util=require('util');var path=require('path');var sox=require(_0x777f('0x9'));var csv=require(_0x777f('0xa'));var ejs=require(_0x777f('0xb'));var fs=require('fs');var _=require(_0x777f('0xc'));var squel=require(_0x777f('0xd'));var crypto=require(_0x777f('0xe'));var jsforce=require(_0x777f('0xf'));var deskjs=require(_0x777f('0x10'));var toCsv=require(_0x777f('0xa'));var querystring=require(_0x777f('0x11'));var Papa=require('papaparse');var Redis=require(_0x777f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x777f('0x13'));var as=require(_0x777f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x777f('0x15'))(_0x777f('0x16'));var utils=require(_0x777f('0x17'));var config=require('../../config/environment');var db=require(_0x777f('0x18'))['db'];function respondWithStatusCode(_0xaa421a,_0x285bf7){_0x285bf7=_0x285bf7||0xcc;return function(_0x30f31b){if(_0x30f31b){return _0xaa421a[_0x777f('0x19')](_0x285bf7);}return _0xaa421a[_0x777f('0x1a')](_0x285bf7)['end']();};}function respondWithResult(_0x33c907,_0x2cef15){_0x2cef15=_0x2cef15||0xc8;return function(_0x5468c0){if(_0x5468c0){return _0x33c907[_0x777f('0x1a')](_0x2cef15)[_0x777f('0x1b')](_0x5468c0);}};}function respondWithFilteredResult(_0x198805,_0x43d45a){return function(_0xf4d60b){if(_0xf4d60b){var _0x217e98=_0xf4d60b[_0x777f('0x1c')],_0x41855a=_0x43d45a[_0x777f('0x1d')],_0x4cdaa9=_0x43d45a[_0x777f('0x1d')]+_0x43d45a[_0x777f('0x1e')],_0x856923;if(_0x4cdaa9>=_0x217e98){_0x4cdaa9=_0x217e98;_0x856923=0xc8;}else{_0x856923=0xce;}_0x198805[_0x777f('0x1a')](_0x856923);return _0x198805[_0x777f('0x1f')]('Content-Range',_0x41855a+'-'+_0x4cdaa9+'/'+_0x217e98)['json'](_0xf4d60b);}return null;};}function patchUpdates(_0x40c91e){return function(_0x270a5b){try{jsonpatch[_0x777f('0x20')](_0x270a5b,_0x40c91e,!![]);}catch(_0x58aae1){return BPromise[_0x777f('0x21')](_0x58aae1);}return _0x270a5b[_0x777f('0x22')]();};}function saveUpdates(_0x1897f0,_0x143f3d){return function(_0x5d31f1){if(_0x5d31f1){return _0x5d31f1[_0x777f('0x23')](_0x1897f0)['then'](function(_0x28407f){return _0x28407f;});}return null;};}function removeEntity(_0x4d1278,_0x1cc281){return function(_0x38e32f){if(_0x38e32f){return _0x38e32f[_0x777f('0x24')]()[_0x777f('0x25')](function(){_0x4d1278[_0x777f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x780490,_0x17f1ed){return function(_0x5089ba){if(!_0x5089ba){_0x780490[_0x777f('0x19')](0x194);}return _0x5089ba;};}function handleError(_0x52d4fc,_0x39a714){_0x39a714=_0x39a714||0x1f4;return function(_0x4385d9){logger[_0x777f('0x26')](_0x4385d9[_0x777f('0x27')]);if(_0x4385d9[_0x777f('0x28')]){delete _0x4385d9[_0x777f('0x28')];}_0x52d4fc[_0x777f('0x1a')](_0x39a714)[_0x777f('0x29')](_0x4385d9);};}exports[_0x777f('0x2a')]=function(_0x4dd10d,_0x5b865c){var _0x16ca18={'raw':!![],'where':{'id':_0x4dd10d[_0x777f('0x2b')]['id']}},_0x37655d={};_0x37655d[_0x777f('0x2c')]=_[_0x777f('0x2d')](db[_0x777f('0x2e')][_0x777f('0x2f')]);_0x37655d['query']=_[_0x777f('0x2d')](_0x4dd10d[_0x777f('0x30')]);_0x37655d['filters']=_[_0x777f('0x31')](_0x37655d[_0x777f('0x2c')],_0x37655d['query']);_0x16ca18['attributes']=_[_0x777f('0x31')](_0x37655d[_0x777f('0x2c')],qs[_0x777f('0x32')](_0x4dd10d[_0x777f('0x30')][_0x777f('0x32')]));_0x16ca18[_0x777f('0x33')]=_0x16ca18[_0x777f('0x33')][_0x777f('0x34')]?_0x16ca18[_0x777f('0x33')]:_0x37655d[_0x777f('0x2c')];if(_0x4dd10d['query'][_0x777f('0x35')]){_0x16ca18[_0x777f('0x36')]=[{'all':!![]}];}_0x16ca18=_[_0x777f('0x37')]({},_0x16ca18,_0x4dd10d[_0x777f('0x38')]);return db[_0x777f('0x2e')][_0x777f('0x39')](_0x16ca18)['then'](handleEntityNotFound(_0x5b865c,null))[_0x777f('0x25')](respondWithResult(_0x5b865c,null))[_0x777f('0x3a')](handleError(_0x5b865c,null));};exports['create']=function(_0x259983,_0x4e3d35){return db['ChatProactiveAction'][_0x777f('0x3b')](_0x259983[_0x777f('0x3c')],{})[_0x777f('0x25')](respondWithResult(_0x4e3d35,0xc9))[_0x777f('0x3a')](handleError(_0x4e3d35,null));};exports[_0x777f('0x23')]=function(_0x28b9fb,_0x3049c1){if(_0x28b9fb[_0x777f('0x3c')]['id']){delete _0x28b9fb['body']['id'];}return db['ChatProactiveAction'][_0x777f('0x39')]({'where':{'id':_0x28b9fb[_0x777f('0x2b')]['id']}})[_0x777f('0x25')](handleEntityNotFound(_0x3049c1,null))[_0x777f('0x25')](saveUpdates(_0x28b9fb[_0x777f('0x3c')],null))[_0x777f('0x25')](respondWithResult(_0x3049c1,null))[_0x777f('0x3a')](handleError(_0x3049c1,null));};exports[_0x777f('0x24')]=function(_0x5f33e6,_0x22e6f3){return db[_0x777f('0x2e')][_0x777f('0x39')]({'where':{'id':_0x5f33e6[_0x777f('0x2b')]['id']}})[_0x777f('0x25')](handleEntityNotFound(_0x22e6f3,null))[_0x777f('0x25')](removeEntity(_0x22e6f3,null))[_0x777f('0x3a')](handleError(_0x22e6f3,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index d5ea73e..c13ce11 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 _0x8811=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x4c3797,_0x450618){var _0x10c2ac=function(_0x2981c5){while(--_0x2981c5){_0x4c3797['push'](_0x4c3797['shift']());}};_0x10c2ac(++_0x450618);}(_0x8811,0x152));var _0x1881=function(_0x3179c3,_0x5a3ee3){_0x3179c3=_0x3179c3-0x0;var _0xfde233=_0x8811[_0x3179c3];return _0xfde233;};'use strict';var _=require(_0x1881('0x0'));var util=require(_0x1881('0x1'));var logger=require('../../config/logger')(_0x1881('0x2'));var moment=require(_0x1881('0x3'));var BPromise=require(_0x1881('0x4'));var rp=require(_0x1881('0x5'));var fs=require('fs');var path=require(_0x1881('0x6'));var rimraf=require('rimraf');var config=require(_0x1881('0x7'));var attributes=require(_0x1881('0x8'));module[_0x1881('0x9')]=function(_0x5b02a1,_0x2d56d9){return _0x5b02a1[_0x1881('0xa')](_0x1881('0xb'),attributes,{'tableName':_0x1881('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdbd=['api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash'];(function(_0x198366,_0x54eaf1){var _0x34c5c0=function(_0x36ca9f){while(--_0x36ca9f){_0x198366['push'](_0x198366['shift']());}};_0x34c5c0(++_0x54eaf1);}(_0xfdbd,0x15f));var _0xdfdb=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xfdbd[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0xdfdb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var fs=require('fs');var path=require(_0xdfdb('0x5'));var rimraf=require(_0xdfdb('0x6'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x7'));module[_0xdfdb('0x8')]=function(_0x4a8aac,_0x4552f8){return _0x4a8aac[_0xdfdb('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xdfdb('0xa'),'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 c1f2713..cb9a67e 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 _0xa6a2=['jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xa6a2,0x1be));var _0x2a6a=function(_0x3d210f,_0x5a877b){_0x3d210f=_0x3d210f-0x0;var _0x4e9048=_0xa6a2[_0x3d210f];return _0x4e9048;};'use strict';var _=require(_0x2a6a('0x0'));var util=require(_0x2a6a('0x1'));var moment=require(_0x2a6a('0x2'));var BPromise=require(_0x2a6a('0x3'));var rs=require(_0x2a6a('0x4'));var fs=require('fs');var Redis=require(_0x2a6a('0x5'));var db=require(_0x2a6a('0x6'))['db'];var utils=require(_0x2a6a('0x7'));var logger=require(_0x2a6a('0x8'))(_0x2a6a('0x9'));var config=require('../../config/environment');var jayson=require(_0x2a6a('0xa'));var client=jayson['client'][_0x2a6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e664,_0x3be2bc,_0x44ea00){return new BPromise(function(_0xc7c737,_0x1caec4){return client[_0x2a6a('0xc')](_0x19e664,_0x44ea00)[_0x2a6a('0xd')](function(_0x262136){logger[_0x2a6a('0xe')](_0x2a6a('0xf'),_0x3be2bc,_0x2a6a('0x10'));logger['debug'](_0x2a6a('0x11'),_0x3be2bc,_0x2a6a('0x10'),JSON[_0x2a6a('0x12')](_0x262136));if(_0x262136['error']){if(_0x262136[_0x2a6a('0x13')][_0x2a6a('0x14')]===0x1f4){logger[_0x2a6a('0x13')](_0x2a6a('0xf'),_0x3be2bc,_0x262136[_0x2a6a('0x13')][_0x2a6a('0x15')]);return _0x1caec4(_0x262136[_0x2a6a('0x13')]['message']);}logger[_0x2a6a('0x13')](_0x2a6a('0xf'),_0x3be2bc,_0x262136[_0x2a6a('0x13')][_0x2a6a('0x15')]);return _0xc7c737(_0x262136[_0x2a6a('0x13')]['message']);}else{logger[_0x2a6a('0xe')](_0x2a6a('0xf'),_0x3be2bc,'request\x20sent');_0xc7c737(_0x262136[_0x2a6a('0x16')][_0x2a6a('0x15')]);}})[_0x2a6a('0x17')](function(_0x2928c5){logger[_0x2a6a('0x13')](_0x2a6a('0xf'),_0x3be2bc,_0x2928c5);_0x1caec4(_0x2928c5);});});}
\ No newline at end of file
+var _0x6ab0=['info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x984b93,_0x26ee75){var _0x396307=function(_0x585ec6){while(--_0x585ec6){_0x984b93['push'](_0x984b93['shift']());}};_0x396307(++_0x26ee75);}(_0x6ab0,0x13e));var _0x06ab=function(_0x32035d,_0x54482d){_0x32035d=_0x32035d-0x0;var _0xcda2ca=_0x6ab0[_0x32035d];return _0xcda2ca;};'use strict';var _=require(_0x06ab('0x0'));var util=require(_0x06ab('0x1'));var moment=require('moment');var BPromise=require(_0x06ab('0x2'));var rs=require(_0x06ab('0x3'));var fs=require('fs');var Redis=require(_0x06ab('0x4'));var db=require(_0x06ab('0x5'))['db'];var utils=require(_0x06ab('0x6'));var logger=require('../../config/logger')(_0x06ab('0x7'));var config=require(_0x06ab('0x8'));var jayson=require(_0x06ab('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc58765,_0x5b6576,_0x2ff068){return new BPromise(function(_0x41817f,_0x726eb6){return client[_0x06ab('0xa')](_0xc58765,_0x2ff068)[_0x06ab('0xb')](function(_0x41563b){logger[_0x06ab('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b6576,_0x06ab('0xd'));logger[_0x06ab('0xe')](_0x06ab('0xf'),_0x5b6576,'request\x20sent',JSON[_0x06ab('0x10')](_0x41563b));if(_0x41563b[_0x06ab('0x11')]){if(_0x41563b[_0x06ab('0x11')][_0x06ab('0x12')]===0x1f4){logger[_0x06ab('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b6576,_0x41563b[_0x06ab('0x11')][_0x06ab('0x13')]);return _0x726eb6(_0x41563b['error'][_0x06ab('0x13')]);}logger[_0x06ab('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b6576,_0x41563b[_0x06ab('0x11')][_0x06ab('0x13')]);return _0x41817f(_0x41563b[_0x06ab('0x11')]['message']);}else{logger[_0x06ab('0xc')](_0x06ab('0x14'),_0x5b6576,_0x06ab('0xd'));_0x41817f(_0x41563b['result'][_0x06ab('0x13')]);}})[_0x06ab('0x15')](function(_0x3b67ed){logger['error'](_0x06ab('0x14'),_0x5b6576,_0x3b67ed);_0x726eb6(_0x3b67ed);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 6954b15..c880b28 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 _0xa6a4=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer'];(function(_0x140cd1,_0x1193d6){var _0x1e2546=function(_0x4c81bb){while(--_0x4c81bb){_0x140cd1['push'](_0x140cd1['shift']());}};_0x1e2546(++_0x1193d6);}(_0xa6a4,0xe9));var _0x4a6a=function(_0xcbe2e9,_0x1960f9){_0xcbe2e9=_0xcbe2e9-0x0;var _0x27ca1b=_0xa6a4[_0xcbe2e9];return _0x27ca1b;};'use strict';var multer=require(_0x4a6a('0x0'));var util=require(_0x4a6a('0x1'));var path=require(_0x4a6a('0x2'));var timeout=require(_0x4a6a('0x3'));var express=require(_0x4a6a('0x4'));var router=express[_0x4a6a('0x5')]();var auth=require(_0x4a6a('0x6'));var interaction=require(_0x4a6a('0x7'));var config=require('../../config/environment');var controller=require(_0x4a6a('0x8'));router[_0x4a6a('0x9')](_0x4a6a('0xa'),auth[_0x4a6a('0xb')](),controller[_0x4a6a('0xc')]);router[_0x4a6a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4a6a('0xe')]('/:id',auth[_0x4a6a('0xb')](),controller[_0x4a6a('0xf')]);router['delete'](_0x4a6a('0xa'),auth[_0x4a6a('0xb')](),controller[_0x4a6a('0x10')]);module[_0x4a6a('0x11')]=router;
\ No newline at end of file
+var _0x1b99=['show','post','delete','multer','util','path','express','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x167117,_0x2dee70){var _0x387b70=function(_0x58f7e0){while(--_0x58f7e0){_0x167117['push'](_0x167117['shift']());}};_0x387b70(++_0x2dee70);}(_0x1b99,0x17c));var _0x91b9=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x1b99[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0x91b9('0x0'));var util=require(_0x91b9('0x1'));var path=require(_0x91b9('0x2'));var timeout=require('connect-timeout');var express=require(_0x91b9('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x91b9('0x4'));var config=require(_0x91b9('0x5'));var controller=require(_0x91b9('0x6'));router[_0x91b9('0x7')](_0x91b9('0x8'),auth[_0x91b9('0x9')](),controller[_0x91b9('0xa')]);router[_0x91b9('0xb')]('/',auth[_0x91b9('0x9')](),controller['create']);router['put'](_0x91b9('0x8'),auth[_0x91b9('0x9')](),controller['update']);router[_0x91b9('0xc')](_0x91b9('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 10e195b..8d0cc9d 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 _0x6e24=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x18a984,_0x227db9){var _0xc483df=function(_0x566290){while(--_0x566290){_0x18a984['push'](_0x18a984['shift']());}};_0xc483df(++_0x227db9);}(_0x6e24,0x188));var _0x46e2=function(_0x4fe4fc,_0x4a14a7){_0x4fe4fc=_0x4fe4fc-0x0;var _0x251df2=_0x6e24[_0x4fe4fc];return _0x251df2;};'use strict';var Sequelize=require(_0x46e2('0x0'));module[_0x46e2('0x1')]={'name':{'type':Sequelize[_0x46e2('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x46e2('0x2')]},'timeout':{'type':Sequelize[_0x46e2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x46e2('0x4')](_0x46e2('0x5'),'beepall',_0x46e2('0x6'))}};
\ No newline at end of file
+var _0xf7ef=['roundrobin','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x282292,_0x3c434f){var _0x299155=function(_0x54c3ec){while(--_0x54c3ec){_0x282292['push'](_0x282292['shift']());}};_0x299155(++_0x3c434f);}(_0xf7ef,0x94));var _0xff7e=function(_0x579652,_0x17a7ad){_0x579652=_0x579652-0x0;var _0x4bbc48=_0xf7ef[_0x579652];return _0x4bbc48;};'use strict';var Sequelize=require(_0xff7e('0x0'));module[_0xff7e('0x1')]={'name':{'type':Sequelize[_0xff7e('0x2')],'unique':_0xff7e('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xff7e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff7e('0x4')]('rrmemory',_0xff7e('0x5'),_0xff7e('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 96d271d..d989689 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 _0x9195=['union','compact','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','test','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','get','ChatQueues','UserProfileResource','destroy','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','online','interface','flatMap','Agents','sequelize','transaction','UserChatQueue','findOrCreate','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all'];(function(_0x570e1a,_0x5796cc){var _0x5e7998=function(_0x21b98f){while(--_0x21b98f){_0x570e1a['push'](_0x570e1a['shift']());}};_0x5e7998(++_0x5796cc);}(_0x9195,0x1da));var _0x5919=function(_0x5a45f5,_0x5746bf){_0x5a45f5=_0x5a45f5-0x0;var _0x202b18=_0x9195[_0x5a45f5];return _0x202b18;};'use strict';var pdf=require(_0x5919('0x0'));var emlformat=require(_0x5919('0x1'));var rimraf=require(_0x5919('0x2'));var zipdir=require(_0x5919('0x3'));var jsonpatch=require(_0x5919('0x4'));var rp=require(_0x5919('0x5'));var moment=require('moment');var BPromise=require(_0x5919('0x6'));var Mustache=require(_0x5919('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5919('0x8'));var csv=require(_0x5919('0x9'));var ejs=require(_0x5919('0xa'));var fs=require('fs');var _=require(_0x5919('0xb'));var squel=require(_0x5919('0xc'));var crypto=require(_0x5919('0xd'));var jsforce=require(_0x5919('0xe'));var deskjs=require(_0x5919('0xf'));var toCsv=require(_0x5919('0x9'));var querystring=require(_0x5919('0x10'));var Papa=require(_0x5919('0x11'));var Redis=require(_0x5919('0x12'));var authService=require(_0x5919('0x13'));var qs=require(_0x5919('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5919('0x15'));var logger=require(_0x5919('0x16'))('api');var utils=require(_0x5919('0x17'));var config=require('../../config/environment');var db=require(_0x5919('0x18'))['db'];config[_0x5919('0x19')]=_[_0x5919('0x1a')](config[_0x5919('0x19')],{'host':_0x5919('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5919('0x19')]));require(_0x5919('0x1c'))[_0x5919('0x1d')](socket);var jayson=require(_0x5919('0x1e'));var client=jayson[_0x5919('0x1f')][_0x5919('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5492e2,_0x17eb57,_0x274b80){if(_0x274b80){var _0x4a02aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a02aa[_0x5919('0x21')](_0x17eb57)){return _0x5492e2;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5492e2;}}function respondWithRpcPromise(_0x1b22ac,_0x2ed84f,_0xad4b1d,_0x226640){return new BPromise(function(_0xc3d591,_0x2c1b0c){var _0xe51c32=_0x226640||client;return _0xe51c32[_0x5919('0x22')](_0x1b22ac,_0xad4b1d)[_0x5919('0x23')](function(_0x45bd4e){logger[_0x5919('0x24')](_0x5919('0x25'),_0x2ed84f,_0x5919('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2ed84f,_0x5919('0x26'),JSON[_0x5919('0x27')](_0x45bd4e));if(_0x45bd4e[_0x5919('0x28')]){if(_0x45bd4e[_0x5919('0x28')]['code']===0x1f4){logger[_0x5919('0x28')](_0x5919('0x25'),_0x2ed84f,_0x45bd4e['error']['message']);return _0x2c1b0c(_0x45bd4e[_0x5919('0x28')][_0x5919('0x29')]);}logger[_0x5919('0x28')](_0x5919('0x25'),_0x2ed84f,_0x45bd4e[_0x5919('0x28')]['message']);return _0xc3d591(_0x45bd4e[_0x5919('0x28')]['message']);}else{logger[_0x5919('0x24')]('ChatQueue,\x20%s,\x20%s',_0x2ed84f,_0x5919('0x26'));_0xc3d591(_0x45bd4e[_0x5919('0x2a')][_0x5919('0x29')]);}})[_0x5919('0x2b')](function(_0x3ac2e2){logger[_0x5919('0x28')]('ChatQueue,\x20%s,\x20%s',_0x2ed84f,_0x3ac2e2);_0x2c1b0c(_0x3ac2e2);});});}function respondWithStatusCode(_0x2615ff,_0x3a51a4){_0x3a51a4=_0x3a51a4||0xcc;return function(_0x19d8e4){if(_0x19d8e4){return _0x2615ff[_0x5919('0x2c')](_0x3a51a4);}return _0x2615ff['status'](_0x3a51a4)['end']();};}function respondWithResult(_0x3b63dc,_0x317e1c){_0x317e1c=_0x317e1c||0xc8;return function(_0x1a509f){if(_0x1a509f){return _0x3b63dc[_0x5919('0x2d')](_0x317e1c)['json'](_0x1a509f);}};}function respondWithFilteredResult(_0x7d3144,_0x4495db){return function(_0x507017){if(_0x507017){var _0x1f5931=_0x507017[_0x5919('0x2e')],_0x25cf0b=_0x4495db[_0x5919('0x2f')],_0x5ed9b6=_0x4495db['offset']+_0x4495db[_0x5919('0x30')],_0x2ed7bd;if(_0x5ed9b6>=_0x1f5931){_0x5ed9b6=_0x1f5931;_0x2ed7bd=0xc8;}else{_0x2ed7bd=0xce;}_0x7d3144['status'](_0x2ed7bd);return _0x7d3144[_0x5919('0x31')](_0x5919('0x32'),_0x25cf0b+'-'+_0x5ed9b6+'/'+_0x1f5931)[_0x5919('0x33')](_0x507017);}return null;};}function patchUpdates(_0x3dc14f){return function(_0x3ca05e){try{jsonpatch[_0x5919('0x34')](_0x3ca05e,_0x3dc14f,!![]);}catch(_0x40c84e){return BPromise['reject'](_0x40c84e);}return _0x3ca05e[_0x5919('0x35')]();};}function saveUpdates(_0x48ab4d,_0x37c00b){return function(_0x176422){if(_0x176422){return _0x176422[_0x5919('0x36')](_0x48ab4d)['then'](function(_0x2e07f3){return _0x2e07f3;});}return null;};}function removeEntity(_0x310ba8,_0x353124){return function(_0x35f159){if(_0x35f159){return _0x35f159['destroy']()[_0x5919('0x23')](function(){var _0x1ee3c6=_0x35f159[_0x5919('0x37')]({'plain':!![]});var _0xa10cc5=_0x5919('0x38');return db[_0x5919('0x39')][_0x5919('0x3a')]({'where':{'type':_0xa10cc5,'resourceId':_0x1ee3c6['id']}})['then'](function(){return _0x35f159;});})[_0x5919('0x23')](function(){_0x310ba8['status'](0xcc)[_0x5919('0x3b')]();});}};}function handleEntityNotFound(_0x575927,_0x464612){return function(_0x2b5708){if(!_0x2b5708){_0x575927['sendStatus'](0x194);}return _0x2b5708;};}function handleError(_0x1823aa,_0x188b20){_0x188b20=_0x188b20||0x1f4;return function(_0x55f6da){logger[_0x5919('0x28')](_0x55f6da[_0x5919('0x3c')]);if(_0x55f6da[_0x5919('0x3d')]){delete _0x55f6da[_0x5919('0x3d')];}_0x1823aa[_0x5919('0x2d')](_0x188b20)['send'](_0x55f6da);};}exports[_0x5919('0x3e')]=function(_0xf87f00,_0x2b1e96){var _0x159734={},_0x5362c={},_0x15c9c6={'count':0x0,'rows':[]};var _0x316025=_[_0x5919('0x3f')](db[_0x5919('0x40')][_0x5919('0x41')],function(_0x4faffe){return{'name':_0x4faffe[_0x5919('0x42')],'type':_0x4faffe[_0x5919('0x43')][_0x5919('0x44')]};});_0x5362c['model']=_[_0x5919('0x3f')](_0x316025,_0x5919('0x3d'));_0x5362c[_0x5919('0x45')]=_[_0x5919('0x46')](_0xf87f00[_0x5919('0x45')]);_0x5362c[_0x5919('0x47')]=_[_0x5919('0x48')](_0x5362c[_0x5919('0x49')],_0x5362c[_0x5919('0x45')]);_0x159734[_0x5919('0x4a')]=_['intersection'](_0x5362c['model'],qs[_0x5919('0x4b')](_0xf87f00[_0x5919('0x45')]['fields']));_0x159734[_0x5919('0x4a')]=_0x159734[_0x5919('0x4a')][_0x5919('0x4c')]?_0x159734['attributes']:_0x5362c[_0x5919('0x49')];if(!_0xf87f00['query'][_0x5919('0x4d')](_0x5919('0x4e'))){_0x159734[_0x5919('0x30')]=qs[_0x5919('0x30')](_0xf87f00[_0x5919('0x45')][_0x5919('0x30')]);_0x159734[_0x5919('0x2f')]=qs[_0x5919('0x2f')](_0xf87f00['query'][_0x5919('0x2f')]);}_0x159734[_0x5919('0x4f')]=qs[_0x5919('0x50')](_0xf87f00[_0x5919('0x45')][_0x5919('0x50')]);_0x159734[_0x5919('0x51')]=qs[_0x5919('0x47')](_[_0x5919('0x52')](_0xf87f00['query'],_0x5362c[_0x5919('0x47')]));if(_0xf87f00['query'][_0x5919('0x53')]){_0x159734[_0x5919('0x51')]=_[_0x5919('0x54')](_0x159734[_0x5919('0x51')],{'$or':_['map'](_0x316025,function(_0x23e026){if(_0x23e026[_0x5919('0x43')][_0x5919('0x44')]!==_0x5919('0x55')){var _0x1ec0f8={};_0x1ec0f8[_0x23e026['field']]={'$like':'%'+_0xf87f00[_0x5919('0x45')]['filter']+'%'};return _0x1ec0f8;}})});}_0x159734=_[_0x5919('0x54')]({},_0x159734,_0xf87f00[_0x5919('0x56')]);var _0x4d43d5={'where':_0x159734[_0x5919('0x51')]};return db[_0x5919('0x40')][_0x5919('0x2e')](_0x4d43d5)[_0x5919('0x23')](function(_0x5bc3c5){_0x15c9c6[_0x5919('0x2e')]=_0x5bc3c5;if(_0xf87f00[_0x5919('0x45')][_0x5919('0x57')]){_0x159734[_0x5919('0x58')]=[{'all':!![]}];}return db[_0x5919('0x40')][_0x5919('0x59')](_0x159734);})['then'](function(_0x28b657){_0x15c9c6[_0x5919('0x5a')]=_0x28b657;return _0x15c9c6;})[_0x5919('0x23')](respondWithFilteredResult(_0x2b1e96,_0x159734))[_0x5919('0x2b')](handleError(_0x2b1e96,null));};exports[_0x5919('0x5b')]=function(_0x2ff37a,_0x394509){var _0xe8eecd={'raw':!![],'where':{'id':_0x2ff37a['params']['id']}},_0x326de5={};_0x326de5[_0x5919('0x49')]=_[_0x5919('0x46')](db[_0x5919('0x40')][_0x5919('0x41')]);_0x326de5[_0x5919('0x45')]=_[_0x5919('0x46')](_0x2ff37a[_0x5919('0x45')]);_0x326de5['filters']=_[_0x5919('0x48')](_0x326de5[_0x5919('0x49')],_0x326de5[_0x5919('0x45')]);_0xe8eecd['attributes']=_[_0x5919('0x48')](_0x326de5[_0x5919('0x49')],qs[_0x5919('0x4b')](_0x2ff37a[_0x5919('0x45')]['fields']));_0xe8eecd['attributes']=_0xe8eecd[_0x5919('0x4a')]['length']?_0xe8eecd[_0x5919('0x4a')]:_0x326de5[_0x5919('0x49')];if(_0x2ff37a['query']['includeAll']){_0xe8eecd[_0x5919('0x58')]=[{'all':!![]}];}_0xe8eecd=_[_0x5919('0x54')]({},_0xe8eecd,_0x2ff37a[_0x5919('0x56')]);return db[_0x5919('0x40')][_0x5919('0x5c')](_0xe8eecd)[_0x5919('0x23')](handleEntityNotFound(_0x394509,null))[_0x5919('0x23')](respondWithResult(_0x394509,null))[_0x5919('0x2b')](handleError(_0x394509,null));};exports[_0x5919('0x5d')]=function(_0x4f78d8,_0xa53f2d){return db['ChatQueue'][_0x5919('0x5d')](_0x4f78d8['body'],{})[_0x5919('0x23')](function(_0x56b3c0){var _0x1b3a88=_0x4f78d8['user'][_0x5919('0x37')]({'plain':!![]});if(!_0x1b3a88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b3a88[_0x5919('0x5e')]===_0x5919('0x5f')){var _0x49e431=_0x56b3c0['get']({'plain':!![]});var _0x3441db='ChatQueues';return db[_0x5919('0x60')][_0x5919('0x5c')]({'where':{'name':_0x3441db,'userProfileId':_0x1b3a88[_0x5919('0x61')]},'raw':!![]})['then'](function(_0x563c83){if(_0x563c83&&_0x563c83[_0x5919('0x62')]===0x0){return db['UserProfileResource'][_0x5919('0x5d')]({'name':_0x49e431[_0x5919('0x3d')],'resourceId':_0x49e431['id'],'type':_0x563c83[_0x5919('0x3d')],'sectionId':_0x563c83['id']},{})['then'](function(){return _0x56b3c0;});}else{return _0x56b3c0;}})[_0x5919('0x2b')](function(_0x5c99fb){logger[_0x5919('0x28')](_0x5919('0x63'),_0x5c99fb);throw _0x5c99fb;});}return _0x56b3c0;})[_0x5919('0x23')](respondWithResult(_0xa53f2d,0xc9))['catch'](handleError(_0xa53f2d,null));};exports[_0x5919('0x36')]=function(_0x5462ec,_0x56fc09){if(_0x5462ec['body']['id']){delete _0x5462ec[_0x5919('0x64')]['id'];}return db['ChatQueue'][_0x5919('0x5c')]({'where':{'id':_0x5462ec[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x56fc09,null))[_0x5919('0x23')](saveUpdates(_0x5462ec[_0x5919('0x64')],null))[_0x5919('0x23')](respondWithResult(_0x56fc09,null))[_0x5919('0x2b')](handleError(_0x56fc09,null));};exports[_0x5919('0x3a')]=function(_0x5ac592,_0x1ad830){return db['ChatQueue'][_0x5919('0x5c')]({'where':{'id':_0x5ac592[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x1ad830,null))[_0x5919('0x23')](removeEntity(_0x1ad830,null))['catch'](handleError(_0x1ad830,null));};exports[_0x5919('0x66')]=function(_0x3ada2e,_0x5f2dd6){return db[_0x5919('0x40')][_0x5919('0x66')]()['then'](respondWithResult(_0x5f2dd6,null))[_0x5919('0x2b')](handleError(_0x5f2dd6,null));};exports[_0x5919('0x67')]=function(_0x151164,_0x1b79d0,_0x555269){var _0x1ceef9={'raw':!![],'where':{}},_0x1f8c1a={},_0x52cb3a;return db[_0x5919('0x40')][_0x5919('0x68')]({'where':{'id':_0x151164[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x1b79d0,null))[_0x5919('0x23')](function(_0x4cfa0e){if(_0x4cfa0e){_0x52cb3a=_0x4cfa0e[_0x5919('0x37')]({'plain':!![]});_0x1f8c1a['model']=_['keys'](db['UserChatQueue']['rawAttributes']);_0x1f8c1a['query']=_[_0x5919('0x46')](_0x151164['query']);_0x1f8c1a[_0x5919('0x47')]=_[_0x5919('0x48')](_0x1f8c1a[_0x5919('0x49')],_0x1f8c1a[_0x5919('0x45')]);_0x1ceef9[_0x5919('0x4a')]=_[_0x5919('0x48')](_0x1f8c1a['model'],qs[_0x5919('0x4b')](_0x151164[_0x5919('0x45')][_0x5919('0x4b')]));_0x1ceef9[_0x5919('0x4a')]=_0x1ceef9[_0x5919('0x4a')]['length']?_0x1ceef9[_0x5919('0x4a')]:_0x1f8c1a[_0x5919('0x49')];if(!_0x151164[_0x5919('0x45')][_0x5919('0x4d')](_0x5919('0x4e'))){_0x1ceef9[_0x5919('0x30')]=qs[_0x5919('0x30')](_0x151164[_0x5919('0x45')][_0x5919('0x30')]);_0x1ceef9[_0x5919('0x2f')]=qs[_0x5919('0x2f')](_0x151164[_0x5919('0x45')][_0x5919('0x2f')]);}_0x1ceef9[_0x5919('0x4f')]=qs['sort'](_0x151164[_0x5919('0x45')]['sort']);_0x1ceef9[_0x5919('0x51')]=qs[_0x5919('0x47')](_[_0x5919('0x52')](_0x151164[_0x5919('0x45')],_0x1f8c1a[_0x5919('0x47')]));_0x1ceef9[_0x5919('0x51')][_0x5919('0x69')]=_0x4cfa0e['id'];if(_0x151164[_0x5919('0x45')][_0x5919('0x53')]){_0x1ceef9[_0x5919('0x51')]=_[_0x5919('0x54')](_0x1ceef9[_0x5919('0x51')],{'$or':_[_0x5919('0x3f')](_0x1ceef9[_0x5919('0x4a')],function(_0x31eb18){var _0x215e39={};_0x215e39[_0x31eb18]={'$like':'%'+_0x151164['query'][_0x5919('0x53')]+'%'};return _0x215e39;})});}_0x1ceef9=_['merge']({},_0x1ceef9,_0x151164[_0x5919('0x56')]);return db['UserChatQueue'][_0x5919('0x59')](_0x1ceef9);}})[_0x5919('0x23')](function(_0x4423d6){if(_0x4423d6){return db[_0x5919('0x6a')]['findAndCountAll']({'where':{'id':_['map'](_0x4423d6,_0x5919('0x6b')),'role':_0x5919('0x6c')},'attributes':['id','name',_0x5919('0x6d'),_0x5919('0x6e'),_0x5919('0x6f')]});}})['then'](function(_0x48d1c5){if(_0x48d1c5){return{'count':_0x48d1c5[_0x5919('0x2e')],'rows':_[_0x5919('0x3f')](_0x48d1c5[_0x5919('0x5a')],function(_0x48d248){return{'membername':_0x48d248['name'],'UserId':_0x48d248['id'],'queue_name':_0x52cb3a[_0x5919('0x3d')],'ChatQueueId':_0x52cb3a['id'],'interface':util['format']('%s/%s',_0x5919('0x70'),_0x48d248['name']),'penalty':0x0,'paused':_0x48d248[_0x5919('0x6d')],'createdAt':_0x48d248[_0x5919('0x6f')],'updatedAt':_0x48d248['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5919('0x23')](respondWithFilteredResult(_0x1b79d0,_0x1ceef9))[_0x5919('0x2b')](handleError(_0x1b79d0,null));};exports['getTeams']=function(_0x16de0b,_0x32f2e9,_0xc498){var _0x37fccf={};var _0x401bf1={};var _0x9e9f6d;var _0x5e9d33;return db['ChatQueue'][_0x5919('0x68')]({'where':{'id':_0x16de0b[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x32f2e9,null))['then'](function(_0x585f8f){if(_0x585f8f){_0x9e9f6d=_0x585f8f;_0x401bf1[_0x5919('0x49')]=_[_0x5919('0x46')](db['Team'][_0x5919('0x41')]);_0x401bf1[_0x5919('0x45')]=_['keys'](_0x16de0b[_0x5919('0x45')]);_0x401bf1[_0x5919('0x47')]=_[_0x5919('0x48')](_0x401bf1[_0x5919('0x49')],_0x401bf1[_0x5919('0x45')]);_0x37fccf[_0x5919('0x4a')]=_[_0x5919('0x48')](_0x401bf1[_0x5919('0x49')],qs['fields'](_0x16de0b[_0x5919('0x45')]['fields']));_0x37fccf[_0x5919('0x4a')]=_0x37fccf['attributes']['length']?_0x37fccf[_0x5919('0x4a')]:_0x401bf1[_0x5919('0x49')];_0x37fccf[_0x5919('0x4f')]=qs[_0x5919('0x50')](_0x16de0b[_0x5919('0x45')][_0x5919('0x50')]);_0x37fccf[_0x5919('0x51')]=qs['filters'](_[_0x5919('0x52')](_0x16de0b[_0x5919('0x45')],_0x401bf1['filters']));if(_0x16de0b[_0x5919('0x45')][_0x5919('0x53')]){_0x37fccf[_0x5919('0x51')]=_[_0x5919('0x54')](_0x37fccf[_0x5919('0x51')],{'$or':_[_0x5919('0x3f')](_0x37fccf[_0x5919('0x4a')],function(_0x41a46b){var _0x22163d={};_0x22163d[_0x41a46b]={'$like':'%'+_0x16de0b[_0x5919('0x45')][_0x5919('0x53')]+'%'};return _0x22163d;})});}_0x37fccf=_[_0x5919('0x54')]({},_0x37fccf,_0x16de0b['options']);return _0x9e9f6d['getTeams'](_0x37fccf);}})[_0x5919('0x23')](function(_0x1dd67b){if(_0x1dd67b){_0x5e9d33=_0x1dd67b[_0x5919('0x4c')];if(!_0x16de0b['query'][_0x5919('0x4d')](_0x5919('0x4e'))){_0x37fccf[_0x5919('0x30')]=qs[_0x5919('0x30')](_0x16de0b[_0x5919('0x45')]['limit']);_0x37fccf['offset']=qs['offset'](_0x16de0b[_0x5919('0x45')][_0x5919('0x2f')]);}return _0x9e9f6d[_0x5919('0x71')](_0x37fccf);}})[_0x5919('0x23')](function(_0x3f5fc6){if(_0x3f5fc6){return _0x3f5fc6?{'count':_0x5e9d33,'rows':_0x3f5fc6}:null;}})[_0x5919('0x23')](respondWithResult(_0x32f2e9,null))[_0x5919('0x2b')](handleError(_0x32f2e9,null));};exports[_0x5919('0x72')]=function(_0x12cdbf,_0x427ac9,_0x34f20d){var _0x1e05a6=_0x12cdbf[_0x5919('0x64')][_0x5919('0x73')];return db[_0x5919('0x74')][_0x5919('0x59')]({'where':{'id':_0x1e05a6},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5919('0x3d'),_0x5919('0x75'),'voicePause',_0x5919('0x76')],'raw':!![]}]})[_0x5919('0x23')](function(_0x3fd29a){if(_0x3fd29a){var _0xefd08c=_[_0x5919('0x77')](_0x3fd29a,function(_0x530046){var _0x7fa6ac=_0x530046[_0x5919('0x37')]({'plain':!![]});return _0x7fa6ac[_0x5919('0x78')];});return db[_0x5919('0x40')][_0x5919('0x5c')]({'where':{'id':_0x12cdbf[_0x5919('0x65')]['id']}})[_0x5919('0x23')](function(_0x11259a){return db[_0x5919('0x79')][_0x5919('0x7a')](function(_0x20c1a6){return _0x11259a['addTeams'](_0x1e05a6,{'transaction':_0x20c1a6})[_0x5919('0x23')](function(){return BPromise['each'](_0xefd08c,function(_0x498e48){return db[_0x5919('0x7b')][_0x5919('0x7c')]({'where':{'UserId':_0x498e48['id'],'ChatQueueId':_0x12cdbf[_0x5919('0x65')]['id']},'transaction':_0x20c1a6});});})[_0x5919('0x23')](function(){_0xefd08c['forEach'](function(_0x6963ca){socket[_0x5919('0x7d')](_0x5919('0x7e'),{'UserId':_0x6963ca['id'],'ChatQueueId':_0x11259a['id']});});});});});}})[_0x5919('0x23')](respondWithStatusCode(_0x427ac9,null))[_0x5919('0x2b')](handleError(_0x427ac9,null));};exports[_0x5919('0x7f')]=function(_0x1631dd,_0x31db66,_0x5a07f9){return db['Team'][_0x5919('0x59')]({'where':{'id':_0x1631dd[_0x5919('0x45')][_0x5919('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5919('0x78'),'attributes':['id'],'raw':!![]}]})[_0x5919('0x23')](handleEntityNotFound(_0x31db66,null))[_0x5919('0x23')](function(_0x5023db){var _0x372fde=_[_0x5919('0x3f')](_0x5023db,'id');var _0xecd90f=[];var _0x1d6440=[];var _0x574f0c=squel['select']();_0x574f0c[_0x5919('0x80')](_0x5919('0x81'))['from'](_0x5919('0x82'),'tq')[_0x5919('0x83')](_0x5919('0x84'),'ut',_0x5919('0x85'))['where']('ChatQueueId\x20=\x20?',_0x1631dd[_0x5919('0x65')]['id']);for(var _0x26007f=0x0;_0x26007f<_0x5023db[_0x5919('0x4c')];_0x26007f+=0x1){let _0x510c82=_0x5023db[_0x26007f];for(var _0x541075=0x0;_0x541075<_0x510c82['Agents'][_0x5919('0x4c')];_0x541075+=0x1){let _0x31fec9=_0x510c82['Agents'][_0x541075];var _0x141c49=_0x574f0c['clone']();_0x141c49[_0x5919('0x51')](_0x5919('0x86'),_0x31fec9['id']);_0x1d6440[_0x5919('0x87')](db[_0x5919('0x79')][_0x5919('0x45')](_0x141c49[_0x5919('0x88')](),{'type':db[_0x5919('0x79')][_0x5919('0x89')][_0x5919('0x8a')]})[_0x5919('0x23')](function(_0x6bafcc){if(_0x6bafcc[_0x5919('0x4c')]===0x1){return _0x31fec9['id'];}else{var _0x109a7d=_[_0x5919('0x8b')](_['map'](_0x6bafcc,_0x5919('0x8c')),function(_0x5aef31){return _['includes'](_0x372fde,_0x5aef31);});if(_0x109a7d){return _0x31fec9['id'];}}}));}}return BPromise[_0x5919('0x8d')](_0x1d6440)[_0x5919('0x23')](function(_0x439afa){_0xecd90f=_(_0xecd90f)[_0x5919('0x8e')](_0x439afa)[_0x5919('0x8f')]()[_0x5919('0x90')]();return db[_0x5919('0x40')]['find']({'where':{'id':_0x1631dd[_0x5919('0x65')]['id']}})[_0x5919('0x23')](function(_0xbe171e){return db[_0x5919('0x79')][_0x5919('0x7a')](function(_0x5ed471){return _0xbe171e[_0x5919('0x7f')](_0x1631dd[_0x5919('0x45')][_0x5919('0x73')],{'transaction':_0x5ed471})[_0x5919('0x23')](function(){if(!_[_0x5919('0x91')](_0xecd90f)){return _0xbe171e['removeAgents'](_0xecd90f,{'transaction':_0x5ed471});}})[_0x5919('0x23')](function(){_0xecd90f[_0x5919('0x92')](function(_0x304671){socket[_0x5919('0x7d')](_0x5919('0x93'),{'UserId':_0x304671,'ChatQueueId':_0xbe171e['id']});});});});});});})[_0x5919('0x23')](respondWithStatusCode(_0x31db66,null))[_0x5919('0x2b')](handleError(_0x31db66,null));};exports['addAgents']=function(_0x3e9587,_0x29f459,_0x401bbb){return db[_0x5919('0x40')][_0x5919('0x5c')]({'where':{'id':_0x3e9587[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x29f459,null))['then'](function(_0x2e9333){if(_0x2e9333){return _0x2e9333[_0x5919('0x94')](_0x3e9587[_0x5919('0x64')]['ids'],_[_0x5919('0x95')](_0x3e9587[_0x5919('0x64')],['ids','id'])||{})[_0x5919('0x96')](function(_0xdfeb87){for(var _0xae5cf8=0x0;_0xae5cf8<_0x3e9587['body'][_0x5919('0x73')][_0x5919('0x4c')];_0xae5cf8+=0x1){socket[_0x5919('0x7d')](_0x5919('0x7e'),{'UserId':_0x3e9587[_0x5919('0x64')]['ids'][_0xae5cf8],'ChatQueueId':_0x3e9587[_0x5919('0x65')]['id']});}return _0xdfeb87;});}})[_0x5919('0x23')](respondWithResult(_0x29f459,null))[_0x5919('0x2b')](handleError(_0x29f459,null));};exports['removeAgents']=function(_0x319f68,_0x4e743b,_0xc9173){return db[_0x5919('0x40')][_0x5919('0x5c')]({'where':{'id':_0x319f68[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x4e743b,null))['then'](function(_0x2b7a92){if(_0x2b7a92){return _0x2b7a92[_0x5919('0x97')](_0x319f68[_0x5919('0x45')][_0x5919('0x73')])[_0x5919('0x23')](function(){if(_[_0x5919('0x98')](_0x319f68['query'][_0x5919('0x73')])){for(var _0x54b545=0x0;_0x54b545<_0x319f68[_0x5919('0x45')][_0x5919('0x73')][_0x5919('0x4c')];_0x54b545+=0x1){socket[_0x5919('0x7d')](_0x5919('0x93'),{'UserId':Number(_0x319f68[_0x5919('0x45')][_0x5919('0x73')][_0x54b545]),'ChatQueueId':Number(_0x319f68[_0x5919('0x65')]['id'])});}}else{socket['emit'](_0x5919('0x93'),{'UserId':Number(_0x319f68[_0x5919('0x45')][_0x5919('0x73')]),'ChatQueueId':Number(_0x319f68['params']['id'])});}});}})[_0x5919('0x23')](respondWithStatusCode(_0x4e743b,null))[_0x5919('0x2b')](handleError(_0x4e743b,null));};exports[_0x5919('0x99')]=function(_0x4ca0b8,_0x1718b3,_0xa1555d){var _0xa25e59={};var _0xd44497={};var _0x15104f;var _0xec5427;return db['ChatQueue'][_0x5919('0x68')]({'where':{'id':_0x4ca0b8[_0x5919('0x65')]['id']}})['then'](handleEntityNotFound(_0x1718b3,null))[_0x5919('0x23')](function(_0x36adee){if(_0x36adee){_0x15104f=_0x36adee;_0xd44497[_0x5919('0x49')]=_['keys'](db[_0x5919('0x6a')]['rawAttributes']);_0xd44497['query']=_[_0x5919('0x46')](_0x4ca0b8[_0x5919('0x45')]);_0xd44497[_0x5919('0x47')]=_[_0x5919('0x48')](_0xd44497[_0x5919('0x49')],_0xd44497[_0x5919('0x45')]);_0xa25e59['attributes']=_[_0x5919('0x48')](_0xd44497['model'],qs[_0x5919('0x4b')](_0x4ca0b8[_0x5919('0x45')][_0x5919('0x4b')]));_0xa25e59[_0x5919('0x4a')]=_0xa25e59[_0x5919('0x4a')][_0x5919('0x4c')]?_0xa25e59[_0x5919('0x4a')]:_0xd44497[_0x5919('0x49')];_0xa25e59[_0x5919('0x4f')]=qs[_0x5919('0x50')](_0x4ca0b8[_0x5919('0x45')]['sort']);_0xa25e59[_0x5919('0x51')]=qs[_0x5919('0x47')](_[_0x5919('0x52')](_0x4ca0b8[_0x5919('0x45')],_0xd44497[_0x5919('0x47')]));if(_0x4ca0b8[_0x5919('0x45')][_0x5919('0x53')]){_0xa25e59[_0x5919('0x51')]=_[_0x5919('0x54')](_0xa25e59['where'],{'$or':_[_0x5919('0x3f')](_0xa25e59[_0x5919('0x4a')],function(_0x323bbc){var _0x1b9f5f={};_0x1b9f5f[_0x323bbc]={'$like':'%'+_0x4ca0b8[_0x5919('0x45')][_0x5919('0x53')]+'%'};return _0x1b9f5f;})});}_0xa25e59=_['merge']({},_0xa25e59,_0x4ca0b8['options']);return _0x15104f[_0x5919('0x99')](_0xa25e59);}})['then'](function(_0x1c2ecd){if(_0x1c2ecd){_0xec5427=_0x1c2ecd[_0x5919('0x4c')];if(!_0x4ca0b8['query'][_0x5919('0x4d')]('nolimit')){_0xa25e59[_0x5919('0x30')]=qs[_0x5919('0x30')](_0x4ca0b8[_0x5919('0x45')][_0x5919('0x30')]);_0xa25e59[_0x5919('0x2f')]=qs['offset'](_0x4ca0b8[_0x5919('0x45')][_0x5919('0x2f')]);}return _0x15104f[_0x5919('0x99')](_0xa25e59);}})[_0x5919('0x23')](function(_0x100796){if(_0x100796){return _0x100796?{'count':_0xec5427,'rows':_0x100796}:null;}})['then'](respondWithResult(_0x1718b3,null))['catch'](handleError(_0x1718b3,null));};
\ No newline at end of file
+var _0x639a=['emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes','all','compact','value','transaction','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','intersection','find','create','body','role','userProfileId','autoAssociation','describe','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','flatMap','findOrCreate'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x639a,0x145));var _0xa639=function(_0x2bab5e,_0x4fa1df){_0x2bab5e=_0x2bab5e-0x0;var _0x3b0a52=_0x639a[_0x2bab5e];return _0x3b0a52;};'use strict';var pdf=require(_0xa639('0x0'));var emlformat=require(_0xa639('0x1'));var rimraf=require(_0xa639('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa639('0x3'));var moment=require('moment');var BPromise=require(_0xa639('0x4'));var Mustache=require(_0xa639('0x5'));var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require(_0xa639('0x9'));var ejs=require(_0xa639('0xa'));var fs=require('fs');var _=require(_0xa639('0xb'));var squel=require('squel');var crypto=require(_0xa639('0xc'));var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa639('0xf'));var Redis=require('ioredis');var authService=require(_0xa639('0x10'));var qs=require(_0xa639('0x11'));var as=require(_0xa639('0x12'));var hardwareService=require(_0xa639('0x13'));var logger=require(_0xa639('0x14'))(_0xa639('0x15'));var utils=require('../../config/utils');var config=require(_0xa639('0x16'));var db=require(_0xa639('0x17'))['db'];config[_0xa639('0x18')]=_[_0xa639('0x19')](config['redis'],{'host':_0xa639('0x1a'),'port':0x18eb});var socket=require(_0xa639('0x1b'))(new Redis(config[_0xa639('0x18')]));require(_0xa639('0x1c'))[_0xa639('0x1d')](socket);var jayson=require(_0xa639('0x1e'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1dc69e,_0x61a087,_0x20da79){if(_0x20da79){var _0x3614a3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3614a3[_0xa639('0x1f')](_0x61a087)){return _0x1dc69e;}else{throw new Error(_0xa639('0x20'));}}else{return _0x1dc69e;}}function respondWithRpcPromise(_0x15a0a0,_0x20e101,_0x3fbfb8,_0x9dce3e){return new BPromise(function(_0x460880,_0x36cdde){var _0x22b583=_0x9dce3e||client;return _0x22b583[_0xa639('0x21')](_0x15a0a0,_0x3fbfb8)[_0xa639('0x22')](function(_0x5d17a5){logger[_0xa639('0x23')]('ChatQueue,\x20%s,\x20%s',_0x20e101,_0xa639('0x24'));logger[_0xa639('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x20e101,_0xa639('0x24'),JSON['stringify'](_0x5d17a5));if(_0x5d17a5['error']){if(_0x5d17a5[_0xa639('0x26')][_0xa639('0x27')]===0x1f4){logger[_0xa639('0x26')](_0xa639('0x28'),_0x20e101,_0x5d17a5[_0xa639('0x26')][_0xa639('0x29')]);return _0x36cdde(_0x5d17a5[_0xa639('0x26')][_0xa639('0x29')]);}logger[_0xa639('0x26')](_0xa639('0x28'),_0x20e101,_0x5d17a5[_0xa639('0x26')]['message']);return _0x460880(_0x5d17a5[_0xa639('0x26')][_0xa639('0x29')]);}else{logger['info'](_0xa639('0x28'),_0x20e101,_0xa639('0x24'));_0x460880(_0x5d17a5[_0xa639('0x2a')]['message']);}})['catch'](function(_0x71f29d){logger[_0xa639('0x26')](_0xa639('0x28'),_0x20e101,_0x71f29d);_0x36cdde(_0x71f29d);});});}function respondWithStatusCode(_0x312b53,_0x353edd){_0x353edd=_0x353edd||0xcc;return function(_0x3a4625){if(_0x3a4625){return _0x312b53['sendStatus'](_0x353edd);}return _0x312b53[_0xa639('0x2b')](_0x353edd)['end']();};}function respondWithResult(_0x58071c,_0x24ed61){_0x24ed61=_0x24ed61||0xc8;return function(_0x29de25){if(_0x29de25){return _0x58071c[_0xa639('0x2b')](_0x24ed61)[_0xa639('0x2c')](_0x29de25);}};}function respondWithFilteredResult(_0x418e12,_0x2542a8){return function(_0x2c8c48){if(_0x2c8c48){var _0x1d3e6a=_0x2c8c48[_0xa639('0x2d')],_0x286218=_0x2542a8['offset'],_0x2ebf1b=_0x2542a8[_0xa639('0x2e')]+_0x2542a8[_0xa639('0x2f')],_0x3cfb18;if(_0x2ebf1b>=_0x1d3e6a){_0x2ebf1b=_0x1d3e6a;_0x3cfb18=0xc8;}else{_0x3cfb18=0xce;}_0x418e12['status'](_0x3cfb18);return _0x418e12[_0xa639('0x30')](_0xa639('0x31'),_0x286218+'-'+_0x2ebf1b+'/'+_0x1d3e6a)[_0xa639('0x2c')](_0x2c8c48);}return null;};}function patchUpdates(_0x2d4e3f){return function(_0x1e2724){try{jsonpatch[_0xa639('0x32')](_0x1e2724,_0x2d4e3f,!![]);}catch(_0x35b2f6){return BPromise[_0xa639('0x33')](_0x35b2f6);}return _0x1e2724['save']();};}function saveUpdates(_0x5bc70a,_0x1dcd52){return function(_0x55e0da){if(_0x55e0da){return _0x55e0da[_0xa639('0x34')](_0x5bc70a)[_0xa639('0x22')](function(_0xe1fac8){return _0xe1fac8;});}return null;};}function removeEntity(_0x35a113,_0x281b62){return function(_0x31bc85){if(_0x31bc85){return _0x31bc85[_0xa639('0x35')]()['then'](function(){var _0x589004=_0x31bc85[_0xa639('0x36')]({'plain':!![]});var _0x47fe53=_0xa639('0x37');return db[_0xa639('0x38')]['destroy']({'where':{'type':_0x47fe53,'resourceId':_0x589004['id']}})[_0xa639('0x22')](function(){return _0x31bc85;});})['then'](function(){_0x35a113['status'](0xcc)[_0xa639('0x39')]();});}};}function handleEntityNotFound(_0x2bc503,_0x496475){return function(_0x13ace0){if(!_0x13ace0){_0x2bc503['sendStatus'](0x194);}return _0x13ace0;};}function handleError(_0xf6a9f9,_0x9fbc3a){_0x9fbc3a=_0x9fbc3a||0x1f4;return function(_0x3fac51){logger[_0xa639('0x26')](_0x3fac51[_0xa639('0x3a')]);if(_0x3fac51[_0xa639('0x3b')]){delete _0x3fac51[_0xa639('0x3b')];}_0xf6a9f9[_0xa639('0x2b')](_0x9fbc3a)[_0xa639('0x3c')](_0x3fac51);};}exports[_0xa639('0x3d')]=function(_0x2289ef,_0x5ca741){var _0x114424={},_0x2030c3={},_0x4bfea7={'count':0x0,'rows':[]};var _0x130dec=_[_0xa639('0x3e')](db[_0xa639('0x3f')][_0xa639('0x40')],function(_0x97a6cb){return{'name':_0x97a6cb['fieldName'],'type':_0x97a6cb['type'][_0xa639('0x41')]};});_0x2030c3[_0xa639('0x42')]=_['map'](_0x130dec,'name');_0x2030c3['query']=_[_0xa639('0x43')](_0x2289ef[_0xa639('0x44')]);_0x2030c3[_0xa639('0x45')]=_['intersection'](_0x2030c3[_0xa639('0x42')],_0x2030c3[_0xa639('0x44')]);_0x114424[_0xa639('0x46')]=_['intersection'](_0x2030c3[_0xa639('0x42')],qs[_0xa639('0x47')](_0x2289ef[_0xa639('0x44')][_0xa639('0x47')]));_0x114424[_0xa639('0x46')]=_0x114424['attributes'][_0xa639('0x48')]?_0x114424[_0xa639('0x46')]:_0x2030c3['model'];if(!_0x2289ef[_0xa639('0x44')][_0xa639('0x49')]('nolimit')){_0x114424[_0xa639('0x2f')]=qs['limit'](_0x2289ef[_0xa639('0x44')]['limit']);_0x114424['offset']=qs['offset'](_0x2289ef[_0xa639('0x44')][_0xa639('0x2e')]);}_0x114424['order']=qs[_0xa639('0x4a')](_0x2289ef[_0xa639('0x44')][_0xa639('0x4a')]);_0x114424[_0xa639('0x4b')]=qs[_0xa639('0x45')](_[_0xa639('0x4c')](_0x2289ef[_0xa639('0x44')],_0x2030c3['filters']));if(_0x2289ef[_0xa639('0x44')]['filter']){_0x114424[_0xa639('0x4b')]=_[_0xa639('0x4d')](_0x114424[_0xa639('0x4b')],{'$or':_['map'](_0x130dec,function(_0x3c195b){if(_0x3c195b[_0xa639('0x4e')][_0xa639('0x41')]!==_0xa639('0x4f')){var _0x3ced92={};_0x3ced92[_0x3c195b['field']]={'$like':'%'+_0x2289ef['query'][_0xa639('0x50')]+'%'};return _0x3ced92;}})});}_0x114424=_[_0xa639('0x4d')]({},_0x114424,_0x2289ef[_0xa639('0x51')]);var _0x243b8c={'where':_0x114424[_0xa639('0x4b')]};return db['ChatQueue'][_0xa639('0x2d')](_0x243b8c)[_0xa639('0x22')](function(_0xc4f1b1){_0x4bfea7[_0xa639('0x2d')]=_0xc4f1b1;if(_0x2289ef['query'][_0xa639('0x52')]){_0x114424['include']=[{'all':!![]}];}return db[_0xa639('0x3f')][_0xa639('0x53')](_0x114424);})[_0xa639('0x22')](function(_0x3d66f1){_0x4bfea7[_0xa639('0x54')]=_0x3d66f1;return _0x4bfea7;})[_0xa639('0x22')](respondWithFilteredResult(_0x5ca741,_0x114424))[_0xa639('0x55')](handleError(_0x5ca741,null));};exports[_0xa639('0x56')]=function(_0x58f8e3,_0x48f7a4){var _0x119279={'raw':!![],'where':{'id':_0x58f8e3[_0xa639('0x57')]['id']}},_0x42f298={};_0x42f298[_0xa639('0x42')]=_[_0xa639('0x43')](db[_0xa639('0x3f')][_0xa639('0x40')]);_0x42f298[_0xa639('0x44')]=_[_0xa639('0x43')](_0x58f8e3[_0xa639('0x44')]);_0x42f298[_0xa639('0x45')]=_[_0xa639('0x58')](_0x42f298[_0xa639('0x42')],_0x42f298['query']);_0x119279['attributes']=_['intersection'](_0x42f298['model'],qs[_0xa639('0x47')](_0x58f8e3[_0xa639('0x44')][_0xa639('0x47')]));_0x119279[_0xa639('0x46')]=_0x119279[_0xa639('0x46')][_0xa639('0x48')]?_0x119279[_0xa639('0x46')]:_0x42f298[_0xa639('0x42')];if(_0x58f8e3[_0xa639('0x44')][_0xa639('0x52')]){_0x119279['include']=[{'all':!![]}];}_0x119279=_['merge']({},_0x119279,_0x58f8e3[_0xa639('0x51')]);return db[_0xa639('0x3f')][_0xa639('0x59')](_0x119279)[_0xa639('0x22')](handleEntityNotFound(_0x48f7a4,null))[_0xa639('0x22')](respondWithResult(_0x48f7a4,null))[_0xa639('0x55')](handleError(_0x48f7a4,null));};exports[_0xa639('0x5a')]=function(_0x3c9051,_0x71594f){return db[_0xa639('0x3f')][_0xa639('0x5a')](_0x3c9051[_0xa639('0x5b')],{})[_0xa639('0x22')](function(_0xfed0c1){var _0x164505=_0x3c9051['user']['get']({'plain':!![]});if(!_0x164505)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x164505[_0xa639('0x5c')]==='user'){var _0x1b8e11=_0xfed0c1[_0xa639('0x36')]({'plain':!![]});var _0x5b2088='ChatQueues';return db['UserProfileSection'][_0xa639('0x59')]({'where':{'name':_0x5b2088,'userProfileId':_0x164505[_0xa639('0x5d')]},'raw':!![]})[_0xa639('0x22')](function(_0x261109){if(_0x261109&&_0x261109[_0xa639('0x5e')]===0x0){return db[_0xa639('0x38')][_0xa639('0x5a')]({'name':_0x1b8e11['name'],'resourceId':_0x1b8e11['id'],'type':_0x261109[_0xa639('0x3b')],'sectionId':_0x261109['id']},{})[_0xa639('0x22')](function(){return _0xfed0c1;});}else{return _0xfed0c1;}})[_0xa639('0x55')](function(_0xe2d7ba){logger[_0xa639('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe2d7ba);throw _0xe2d7ba;});}return _0xfed0c1;})[_0xa639('0x22')](respondWithResult(_0x71594f,0xc9))['catch'](handleError(_0x71594f,null));};exports['update']=function(_0x356946,_0x20110c){if(_0x356946[_0xa639('0x5b')]['id']){delete _0x356946[_0xa639('0x5b')]['id'];}return db[_0xa639('0x3f')]['find']({'where':{'id':_0x356946['params']['id']}})['then'](handleEntityNotFound(_0x20110c,null))[_0xa639('0x22')](saveUpdates(_0x356946[_0xa639('0x5b')],null))[_0xa639('0x22')](respondWithResult(_0x20110c,null))[_0xa639('0x55')](handleError(_0x20110c,null));};exports[_0xa639('0x35')]=function(_0x8e9401,_0x441535){return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0x8e9401[_0xa639('0x57')]['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x441535,null))['then'](removeEntity(_0x441535,null))['catch'](handleError(_0x441535,null));};exports[_0xa639('0x5f')]=function(_0x1e5db3,_0x634a64){return db['ChatQueue'][_0xa639('0x5f')]()[_0xa639('0x22')](respondWithResult(_0x634a64,null))[_0xa639('0x55')](handleError(_0x634a64,null));};exports['getMembers']=function(_0x4e37b1,_0x5c65fa,_0xf5b309){var _0x3a5e2f={'raw':!![],'where':{}},_0x58738b={},_0x4e3e04;return db['ChatQueue']['findOne']({'where':{'id':_0x4e37b1[_0xa639('0x57')]['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x5c65fa,null))[_0xa639('0x22')](function(_0x38b58e){if(_0x38b58e){_0x4e3e04=_0x38b58e[_0xa639('0x36')]({'plain':!![]});_0x58738b['model']=_[_0xa639('0x43')](db[_0xa639('0x60')][_0xa639('0x40')]);_0x58738b[_0xa639('0x44')]=_['keys'](_0x4e37b1[_0xa639('0x44')]);_0x58738b[_0xa639('0x45')]=_[_0xa639('0x58')](_0x58738b['model'],_0x58738b[_0xa639('0x44')]);_0x3a5e2f[_0xa639('0x46')]=_[_0xa639('0x58')](_0x58738b[_0xa639('0x42')],qs[_0xa639('0x47')](_0x4e37b1[_0xa639('0x44')]['fields']));_0x3a5e2f[_0xa639('0x46')]=_0x3a5e2f[_0xa639('0x46')][_0xa639('0x48')]?_0x3a5e2f['attributes']:_0x58738b['model'];if(!_0x4e37b1[_0xa639('0x44')][_0xa639('0x49')](_0xa639('0x61'))){_0x3a5e2f['limit']=qs[_0xa639('0x2f')](_0x4e37b1[_0xa639('0x44')][_0xa639('0x2f')]);_0x3a5e2f[_0xa639('0x2e')]=qs['offset'](_0x4e37b1[_0xa639('0x44')][_0xa639('0x2e')]);}_0x3a5e2f[_0xa639('0x62')]=qs[_0xa639('0x4a')](_0x4e37b1[_0xa639('0x44')]['sort']);_0x3a5e2f[_0xa639('0x4b')]=qs[_0xa639('0x45')](_[_0xa639('0x4c')](_0x4e37b1[_0xa639('0x44')],_0x58738b['filters']));_0x3a5e2f[_0xa639('0x4b')][_0xa639('0x63')]=_0x38b58e['id'];if(_0x4e37b1[_0xa639('0x44')][_0xa639('0x50')]){_0x3a5e2f['where']=_['merge'](_0x3a5e2f[_0xa639('0x4b')],{'$or':_[_0xa639('0x3e')](_0x3a5e2f[_0xa639('0x46')],function(_0x2cafa0){var _0x2bb5e4={};_0x2bb5e4[_0x2cafa0]={'$like':'%'+_0x4e37b1[_0xa639('0x44')][_0xa639('0x50')]+'%'};return _0x2bb5e4;})});}_0x3a5e2f=_[_0xa639('0x4d')]({},_0x3a5e2f,_0x4e37b1[_0xa639('0x51')]);return db[_0xa639('0x60')]['findAll'](_0x3a5e2f);}})[_0xa639('0x22')](function(_0x5acbfa){if(_0x5acbfa){return db[_0xa639('0x64')][_0xa639('0x65')]({'where':{'id':_[_0xa639('0x3e')](_0x5acbfa,_0xa639('0x66')),'role':'agent'},'attributes':['id',_0xa639('0x3b'),_0xa639('0x67'),'updatedAt','createdAt']});}})['then'](function(_0x2d3b08){if(_0x2d3b08){return{'count':_0x2d3b08['count'],'rows':_[_0xa639('0x3e')](_0x2d3b08['rows'],function(_0x2f9dc2){return{'membername':_0x2f9dc2['name'],'UserId':_0x2f9dc2['id'],'queue_name':_0x4e3e04[_0xa639('0x3b')],'ChatQueueId':_0x4e3e04['id'],'interface':util['format'](_0xa639('0x68'),_0xa639('0x69'),_0x2f9dc2[_0xa639('0x3b')]),'penalty':0x0,'paused':_0x2f9dc2[_0xa639('0x67')],'createdAt':_0x2f9dc2['createdAt'],'updatedAt':_0x2f9dc2[_0xa639('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5c65fa,_0x3a5e2f))[_0xa639('0x55')](handleError(_0x5c65fa,null));};exports[_0xa639('0x6b')]=function(_0x97af71,_0x25b096,_0x3a67c5){var _0x1b8f6c={};var _0x56b578={};var _0x2b6cbb;var _0x1707ca;return db[_0xa639('0x3f')][_0xa639('0x6c')]({'where':{'id':_0x97af71[_0xa639('0x57')]['id']}})['then'](handleEntityNotFound(_0x25b096,null))[_0xa639('0x22')](function(_0x1b3b77){if(_0x1b3b77){_0x2b6cbb=_0x1b3b77;_0x56b578[_0xa639('0x42')]=_[_0xa639('0x43')](db[_0xa639('0x6d')][_0xa639('0x40')]);_0x56b578[_0xa639('0x44')]=_[_0xa639('0x43')](_0x97af71[_0xa639('0x44')]);_0x56b578[_0xa639('0x45')]=_[_0xa639('0x58')](_0x56b578['model'],_0x56b578[_0xa639('0x44')]);_0x1b8f6c[_0xa639('0x46')]=_[_0xa639('0x58')](_0x56b578[_0xa639('0x42')],qs[_0xa639('0x47')](_0x97af71[_0xa639('0x44')][_0xa639('0x47')]));_0x1b8f6c[_0xa639('0x46')]=_0x1b8f6c[_0xa639('0x46')][_0xa639('0x48')]?_0x1b8f6c[_0xa639('0x46')]:_0x56b578[_0xa639('0x42')];_0x1b8f6c[_0xa639('0x62')]=qs[_0xa639('0x4a')](_0x97af71['query'][_0xa639('0x4a')]);_0x1b8f6c[_0xa639('0x4b')]=qs['filters'](_['pick'](_0x97af71[_0xa639('0x44')],_0x56b578[_0xa639('0x45')]));if(_0x97af71['query'][_0xa639('0x50')]){_0x1b8f6c[_0xa639('0x4b')]=_['merge'](_0x1b8f6c[_0xa639('0x4b')],{'$or':_[_0xa639('0x3e')](_0x1b8f6c[_0xa639('0x46')],function(_0x2e65d2){var _0x45afd1={};_0x45afd1[_0x2e65d2]={'$like':'%'+_0x97af71['query'][_0xa639('0x50')]+'%'};return _0x45afd1;})});}_0x1b8f6c=_[_0xa639('0x4d')]({},_0x1b8f6c,_0x97af71[_0xa639('0x51')]);return _0x2b6cbb[_0xa639('0x6b')](_0x1b8f6c);}})[_0xa639('0x22')](function(_0x6712f5){if(_0x6712f5){_0x1707ca=_0x6712f5['length'];if(!_0x97af71[_0xa639('0x44')][_0xa639('0x49')]('nolimit')){_0x1b8f6c[_0xa639('0x2f')]=qs[_0xa639('0x2f')](_0x97af71['query'][_0xa639('0x2f')]);_0x1b8f6c['offset']=qs['offset'](_0x97af71['query'][_0xa639('0x2e')]);}return _0x2b6cbb[_0xa639('0x6b')](_0x1b8f6c);}})[_0xa639('0x22')](function(_0x4261d2){if(_0x4261d2){return _0x4261d2?{'count':_0x1707ca,'rows':_0x4261d2}:null;}})[_0xa639('0x22')](respondWithResult(_0x25b096,null))[_0xa639('0x55')](handleError(_0x25b096,null));};exports[_0xa639('0x6e')]=function(_0x127bf8,_0x3b42c6,_0x57bbd3){var _0x20eb82=_0x127bf8[_0xa639('0x5b')][_0xa639('0x6f')];return db['Team'][_0xa639('0x53')]({'where':{'id':_0x20eb82},'attributes':['id'],'include':[{'model':db[_0xa639('0x64')],'as':_0xa639('0x70'),'attributes':['id',_0xa639('0x3b'),'online',_0xa639('0x71'),'interface'],'raw':!![]}]})[_0xa639('0x22')](function(_0x591e4f){if(_0x591e4f){var _0x4d2f38=_[_0xa639('0x72')](_0x591e4f,function(_0x8ebb8a){var _0x85b3b1=_0x8ebb8a['get']({'plain':!![]});return _0x85b3b1[_0xa639('0x70')];});return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0x127bf8[_0xa639('0x57')]['id']}})['then'](function(_0x4fecd8){return db['sequelize']['transaction'](function(_0x4570ac){return _0x4fecd8[_0xa639('0x6e')](_0x20eb82,{'transaction':_0x4570ac})[_0xa639('0x22')](function(){return BPromise['each'](_0x4d2f38,function(_0x35cd81){return db[_0xa639('0x60')][_0xa639('0x73')]({'where':{'UserId':_0x35cd81['id'],'ChatQueueId':_0x127bf8['params']['id']},'transaction':_0x4570ac});});})[_0xa639('0x22')](function(){_0x4d2f38['forEach'](function(_0x4f2662){socket[_0xa639('0x74')]('userChatQueue:save',{'UserId':_0x4f2662['id'],'ChatQueueId':_0x4fecd8['id']});});});});});}})[_0xa639('0x22')](respondWithStatusCode(_0x3b42c6,null))[_0xa639('0x55')](handleError(_0x3b42c6,null));};exports[_0xa639('0x75')]=function(_0xc9cb2c,_0x2e5551,_0x4f5837){return db[_0xa639('0x6d')]['findAll']({'where':{'id':_0xc9cb2c[_0xa639('0x44')][_0xa639('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xa639('0x64')],'as':_0xa639('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e5551,null))[_0xa639('0x22')](function(_0x126dc1){var _0x416387=_['map'](_0x126dc1,'id');var _0x4312c4=[];var _0x5efe0e=[];var _0x2b8cc2=squel[_0xa639('0x76')]();_0x2b8cc2['field'](_0xa639('0x77'))[_0xa639('0x78')](_0xa639('0x79'),'tq')[_0xa639('0x7a')]('user_has_teams','ut',_0xa639('0x7b'))[_0xa639('0x4b')](_0xa639('0x7c'),_0xc9cb2c['params']['id']);for(var _0x15b3a7=0x0;_0x15b3a7<_0x126dc1[_0xa639('0x48')];_0x15b3a7+=0x1){let _0x47e295=_0x126dc1[_0x15b3a7];for(var _0x409399=0x0;_0x409399<_0x47e295['Agents'][_0xa639('0x48')];_0x409399+=0x1){let _0x35b15e=_0x47e295['Agents'][_0x409399];var _0x1ad8d0=_0x2b8cc2[_0xa639('0x7d')]();_0x1ad8d0[_0xa639('0x4b')](_0xa639('0x7e'),_0x35b15e['id']);_0x5efe0e[_0xa639('0x7f')](db['sequelize'][_0xa639('0x44')](_0x1ad8d0[_0xa639('0x80')](),{'type':db[_0xa639('0x81')]['QueryTypes'][_0xa639('0x82')]})[_0xa639('0x22')](function(_0x5e170f){if(_0x5e170f[_0xa639('0x48')]===0x1){return _0x35b15e['id'];}else{var _0x254fbf=_[_0xa639('0x83')](_[_0xa639('0x3e')](_0x5e170f,_0xa639('0x84')),function(_0xd51532){return _[_0xa639('0x85')](_0x416387,_0xd51532);});if(_0x254fbf){return _0x35b15e['id'];}}}));}}return BPromise[_0xa639('0x86')](_0x5efe0e)[_0xa639('0x22')](function(_0x3820ec){_0x4312c4=_(_0x4312c4)['union'](_0x3820ec)[_0xa639('0x87')]()[_0xa639('0x88')]();return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0xc9cb2c[_0xa639('0x57')]['id']}})[_0xa639('0x22')](function(_0x2c9d3f){return db['sequelize'][_0xa639('0x89')](function(_0x590322){return _0x2c9d3f[_0xa639('0x75')](_0xc9cb2c['query'][_0xa639('0x6f')],{'transaction':_0x590322})[_0xa639('0x22')](function(){if(!_['isEmpty'](_0x4312c4)){return _0x2c9d3f[_0xa639('0x8a')](_0x4312c4,{'transaction':_0x590322});}})[_0xa639('0x22')](function(){_0x4312c4[_0xa639('0x8b')](function(_0x420128){socket[_0xa639('0x74')](_0xa639('0x8c'),{'UserId':_0x420128,'ChatQueueId':_0x2c9d3f['id']});});});});});});})[_0xa639('0x22')](respondWithStatusCode(_0x2e5551,null))[_0xa639('0x55')](handleError(_0x2e5551,null));};exports[_0xa639('0x8d')]=function(_0x341936,_0x593ef7,_0x11b9f5){return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0x341936[_0xa639('0x57')]['id']}})['then'](handleEntityNotFound(_0x593ef7,null))[_0xa639('0x22')](function(_0x3bba2d){if(_0x3bba2d){return _0x3bba2d[_0xa639('0x8d')](_0x341936[_0xa639('0x5b')][_0xa639('0x6f')],_[_0xa639('0x8e')](_0x341936[_0xa639('0x5b')],[_0xa639('0x6f'),'id'])||{})[_0xa639('0x8f')](function(_0x594ab1){for(var _0x505d77=0x0;_0x505d77<_0x341936[_0xa639('0x5b')][_0xa639('0x6f')][_0xa639('0x48')];_0x505d77+=0x1){socket[_0xa639('0x74')](_0xa639('0x90'),{'UserId':_0x341936[_0xa639('0x5b')][_0xa639('0x6f')][_0x505d77],'ChatQueueId':_0x341936['params']['id']});}return _0x594ab1;});}})['then'](respondWithResult(_0x593ef7,null))['catch'](handleError(_0x593ef7,null));};exports['removeAgents']=function(_0x52618a,_0x2db0ee,_0x424f6b){return db[_0xa639('0x3f')]['find']({'where':{'id':_0x52618a[_0xa639('0x57')]['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x2db0ee,null))[_0xa639('0x22')](function(_0x2efa49){if(_0x2efa49){return _0x2efa49[_0xa639('0x8a')](_0x52618a['query'][_0xa639('0x6f')])['then'](function(){if(_[_0xa639('0x91')](_0x52618a[_0xa639('0x44')][_0xa639('0x6f')])){for(var _0x4ffa85=0x0;_0x4ffa85<_0x52618a[_0xa639('0x44')]['ids'][_0xa639('0x48')];_0x4ffa85+=0x1){socket[_0xa639('0x74')]('userChatQueue:remove',{'UserId':Number(_0x52618a['query'][_0xa639('0x6f')][_0x4ffa85]),'ChatQueueId':Number(_0x52618a[_0xa639('0x57')]['id'])});}}else{socket[_0xa639('0x74')](_0xa639('0x8c'),{'UserId':Number(_0x52618a['query']['ids']),'ChatQueueId':Number(_0x52618a[_0xa639('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2db0ee,null))[_0xa639('0x55')](handleError(_0x2db0ee,null));};exports[_0xa639('0x92')]=function(_0x271d7f,_0x3dfb5e,_0x50f859){var _0x450ddb={};var _0x468d78={};var _0x46d1e1;var _0xdae155;return db[_0xa639('0x3f')][_0xa639('0x6c')]({'where':{'id':_0x271d7f['params']['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x3dfb5e,null))[_0xa639('0x22')](function(_0x2761d6){if(_0x2761d6){_0x46d1e1=_0x2761d6;_0x468d78[_0xa639('0x42')]=_[_0xa639('0x43')](db['User'][_0xa639('0x40')]);_0x468d78[_0xa639('0x44')]=_['keys'](_0x271d7f[_0xa639('0x44')]);_0x468d78[_0xa639('0x45')]=_[_0xa639('0x58')](_0x468d78[_0xa639('0x42')],_0x468d78['query']);_0x450ddb[_0xa639('0x46')]=_[_0xa639('0x58')](_0x468d78[_0xa639('0x42')],qs[_0xa639('0x47')](_0x271d7f[_0xa639('0x44')][_0xa639('0x47')]));_0x450ddb[_0xa639('0x46')]=_0x450ddb[_0xa639('0x46')][_0xa639('0x48')]?_0x450ddb[_0xa639('0x46')]:_0x468d78['model'];_0x450ddb[_0xa639('0x62')]=qs[_0xa639('0x4a')](_0x271d7f[_0xa639('0x44')][_0xa639('0x4a')]);_0x450ddb['where']=qs[_0xa639('0x45')](_[_0xa639('0x4c')](_0x271d7f[_0xa639('0x44')],_0x468d78[_0xa639('0x45')]));if(_0x271d7f[_0xa639('0x44')][_0xa639('0x50')]){_0x450ddb[_0xa639('0x4b')]=_[_0xa639('0x4d')](_0x450ddb[_0xa639('0x4b')],{'$or':_[_0xa639('0x3e')](_0x450ddb[_0xa639('0x46')],function(_0x55a4f2){var _0x1362e7={};_0x1362e7[_0x55a4f2]={'$like':'%'+_0x271d7f[_0xa639('0x44')][_0xa639('0x50')]+'%'};return _0x1362e7;})});}_0x450ddb=_[_0xa639('0x4d')]({},_0x450ddb,_0x271d7f['options']);return _0x46d1e1[_0xa639('0x92')](_0x450ddb);}})[_0xa639('0x22')](function(_0xe70881){if(_0xe70881){_0xdae155=_0xe70881['length'];if(!_0x271d7f[_0xa639('0x44')][_0xa639('0x49')]('nolimit')){_0x450ddb[_0xa639('0x2f')]=qs['limit'](_0x271d7f[_0xa639('0x44')][_0xa639('0x2f')]);_0x450ddb[_0xa639('0x2e')]=qs[_0xa639('0x2e')](_0x271d7f['query']['offset']);}return _0x46d1e1[_0xa639('0x92')](_0x450ddb);}})[_0xa639('0x22')](function(_0x8e3705){if(_0x8e3705){return _0x8e3705?{'count':_0xdae155,'rows':_0x8e3705}:null;}})[_0xa639('0x22')](respondWithResult(_0x3dfb5e,null))[_0xa639('0x55')](handleError(_0x3dfb5e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 2217325..f49c1a4 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 _0x15cb=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x1d1cac,_0x2a142c){var _0x4557a0=function(_0x2349df){while(--_0x2349df){_0x1d1cac['push'](_0x1d1cac['shift']());}};_0x4557a0(++_0x2a142c);}(_0x15cb,0x16f));var _0xb15c=function(_0x2303f4,_0x4e593c){_0x2303f4=_0x2303f4-0x0;var _0x37f15e=_0x15cb[_0x2303f4];return _0x37f15e;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xb15c('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb15c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb15c('0x2'),'afterDestroy':_0xb15c('0x3')};function emitEvent(_0x2777f9){return function(_0x3d8546,_0x4f1c8f,_0x432920){ChatQueueEvents[_0xb15c('0x4')](_0x2777f9+':'+_0x3d8546['id'],_0x3d8546);ChatQueueEvents['emit'](_0x2777f9,_0x3d8546);_0x432920(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb15c('0x5')](e,emitEvent(event));}}module[_0xb15c('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0xdbf5=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x360662,_0x1d89bd){_0x360662=_0x360662-0x0;var _0x323419=_0xdbf5[_0x360662];return _0x323419;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5dbf('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5dbf('0x1'),'afterUpdate':_0x5dbf('0x2'),'afterDestroy':_0x5dbf('0x3')};function emitEvent(_0x3afe14){return function(_0x38b629,_0x1a1ea9,_0x776036){ChatQueueEvents[_0x5dbf('0x4')](_0x3afe14+':'+_0x38b629['id'],_0x38b629);ChatQueueEvents[_0x5dbf('0x4')](_0x3afe14,_0x38b629);_0x776036(null);};}for(var e in events){if(events[_0x5dbf('0x5')](e)){var event=events[e];ChatQueue[_0x5dbf('0x6')](e,emitEvent(event));}}module[_0x5dbf('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 26956fc..8e3ecb3 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 _0xd314=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatQueue.attributes','chat_queues'];(function(_0x284258,_0x41159b){var _0x1231fc=function(_0x13683d){while(--_0x13683d){_0x284258['push'](_0x284258['shift']());}};_0x1231fc(++_0x41159b);}(_0xd314,0x87));var _0x4d31=function(_0x22a712,_0x5e26a3){_0x22a712=_0x22a712-0x0;var _0x5b327c=_0xd314[_0x22a712];return _0x5b327c;};'use strict';var _=require(_0x4d31('0x0'));var util=require('util');var logger=require(_0x4d31('0x1'))(_0x4d31('0x2'));var moment=require(_0x4d31('0x3'));var BPromise=require(_0x4d31('0x4'));var rp=require(_0x4d31('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d31('0x6'));var attributes=require(_0x4d31('0x7'));module['exports']=function(_0x22dd4f,_0x4a880d){return _0x22dd4f['define']('ChatQueue',attributes,{'tableName':_0x4d31('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a78=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','chat_queues','lodash'];(function(_0x542ca9,_0x51e21e){var _0x21a6db=function(_0x53e324){while(--_0x53e324){_0x542ca9['push'](_0x542ca9['shift']());}};_0x21a6db(++_0x51e21e);}(_0x4a78,0xba));var _0x84a7=function(_0x283d40,_0x1ceda2){_0x283d40=_0x283d40-0x0;var _0x2db520=_0x4a78[_0x283d40];return _0x2db520;};'use strict';var _=require(_0x84a7('0x0'));var util=require('util');var logger=require(_0x84a7('0x1'))(_0x84a7('0x2'));var moment=require(_0x84a7('0x3'));var BPromise=require(_0x84a7('0x4'));var rp=require(_0x84a7('0x5'));var fs=require('fs');var path=require(_0x84a7('0x6'));var rimraf=require(_0x84a7('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x84a7('0x8')]=function(_0x37774b,_0xafc363){return _0x37774b[_0x84a7('0x9')]('ChatQueue',attributes,{'tableName':_0x84a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index c392657..b29b4ee 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 _0xb1fa=['localhost','then','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','debug','ChatQueue','ShowChatQueue','stringify','moment','randomstring','../../config/environment','redis'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2da52b,_0x1d20da){_0x2da52b=_0x2da52b-0x0;var _0x334e25=_0xb1fa[_0x2da52b];return _0x334e25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab1f('0x0'));var BPromise=require('bluebird');var rs=require(_0xab1f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xab1f('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xab1f('0x3')]=_['defaults'](config[_0xab1f('0x3')],{'host':_0xab1f('0x4'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab1f('0x3')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2a21f9,_0xbac6e5,_0x448a55){return new BPromise(function(_0x6136b3,_0x3f0f7e){return client['request'](_0x2a21f9,_0x448a55)[_0xab1f('0x5')](function(_0x4a62b1){logger['info'](_0xab1f('0x6'),_0xbac6e5,_0xab1f('0x7'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xbac6e5,_0xab1f('0x7'),JSON['stringify'](_0x4a62b1));if(_0x4a62b1[_0xab1f('0x8')]){if(_0x4a62b1[_0xab1f('0x8')][_0xab1f('0x9')]===0x1f4){logger['error'](_0xab1f('0x6'),_0xbac6e5,_0x4a62b1[_0xab1f('0x8')][_0xab1f('0xa')]);return _0x3f0f7e(_0x4a62b1[_0xab1f('0x8')]['message']);}logger[_0xab1f('0x8')]('ChatQueue,\x20%s,\x20%s',_0xbac6e5,_0x4a62b1[_0xab1f('0x8')][_0xab1f('0xa')]);return _0x6136b3(_0x4a62b1[_0xab1f('0x8')]['message']);}else{logger[_0xab1f('0xb')](_0xab1f('0x6'),_0xbac6e5,'request\x20sent');_0x6136b3(_0x4a62b1[_0xab1f('0xc')][_0xab1f('0xa')]);}})[_0xab1f('0xd')](function(_0x231ce7){logger[_0xab1f('0x8')]('ChatQueue,\x20%s,\x20%s',_0xbac6e5,_0x231ce7);_0x3f0f7e(_0x231ce7);});});}exports[_0xab1f('0xe')]=function(_0x2c4862){var _0x512260=this;return new Promise(function(_0x128422,_0x30f973){return db['ChatQueue']['findAll']({'raw':_0x2c4862[_0xab1f('0xf')]?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x10')]===undefined?!![]:![]:!![],'where':_0x2c4862[_0xab1f('0xf')]?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x11')]||null:null,'attributes':_0x2c4862[_0xab1f('0xf')]?_0x2c4862['options'][_0xab1f('0x12')]||null:null,'limit':_0x2c4862[_0xab1f('0xf')]?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x13')]||null:null,'include':_0x2c4862['options']?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x14')]?_[_0xab1f('0x15')](_0x2c4862[_0xab1f('0xf')]['include'],function(_0x153083){return{'model':db[_0x153083[_0xab1f('0x16')]],'as':_0x153083['as'],'attributes':_0x153083[_0xab1f('0x12')],'include':_0x153083[_0xab1f('0x14')]?_[_0xab1f('0x15')](_0x153083[_0xab1f('0x14')],function(_0x357c51){return{'model':db[_0x357c51['model']],'as':_0x357c51['as'],'attributes':_0x357c51[_0xab1f('0x12')],'include':_0x357c51['include']?_[_0xab1f('0x15')](_0x357c51['include'],function(_0x3357b9){return{'model':db[_0x3357b9[_0xab1f('0x16')]],'as':_0x3357b9['as'],'attributes':_0x3357b9[_0xab1f('0x12')]};}):[]};}):[]};}):[]:[]})[_0xab1f('0x5')](function(_0x137042){logger[_0xab1f('0xb')](_0xab1f('0xe'),_0x2c4862);logger[_0xab1f('0x17')](_0xab1f('0xe'),_0x2c4862,JSON['stringify'](_0x137042));_0x128422(_0x137042);})[_0xab1f('0xd')](function(_0x5e6170){logger[_0xab1f('0x8')](_0xab1f('0xe'),_0x5e6170[_0xab1f('0xa')],_0x2c4862);_0x30f973(_0x512260[_0xab1f('0x8')](0x1f4,_0x5e6170[_0xab1f('0xa')]));});});};exports['ShowChatQueue']=function(_0x11ec23){var _0x3c11d7=this;return new Promise(function(_0x1de532,_0x5e1cf0){return db[_0xab1f('0x18')]['find']({'raw':_0x11ec23[_0xab1f('0xf')]?_0x11ec23['options'][_0xab1f('0x10')]===undefined?!![]:![]:!![],'where':_0x11ec23['options']?_0x11ec23[_0xab1f('0xf')][_0xab1f('0x11')]||null:null,'attributes':_0x11ec23[_0xab1f('0xf')]?_0x11ec23[_0xab1f('0xf')]['attributes']||null:null,'include':_0x11ec23['options']?_0x11ec23[_0xab1f('0xf')]['include']?_[_0xab1f('0x15')](_0x11ec23[_0xab1f('0xf')][_0xab1f('0x14')],function(_0xf5a7cb){return{'model':db[_0xf5a7cb[_0xab1f('0x16')]],'as':_0xf5a7cb['as'],'attributes':_0xf5a7cb[_0xab1f('0x12')],'include':_0xf5a7cb['include']?_[_0xab1f('0x15')](_0xf5a7cb[_0xab1f('0x14')],function(_0x500110){return{'model':db[_0x500110['model']],'as':_0x500110['as'],'attributes':_0x500110[_0xab1f('0x12')],'include':_0x500110[_0xab1f('0x14')]?_[_0xab1f('0x15')](_0x500110[_0xab1f('0x14')],function(_0x298bb9){return{'model':db[_0x298bb9[_0xab1f('0x16')]],'as':_0x298bb9['as'],'attributes':_0x298bb9['attributes']};}):[]};}):[]};}):[]:[]})[_0xab1f('0x5')](function(_0x31b16b){logger[_0xab1f('0xb')](_0xab1f('0x19'),_0x11ec23);logger[_0xab1f('0x17')](_0xab1f('0x19'),_0x11ec23,JSON[_0xab1f('0x1a')](_0x31b16b));_0x1de532(_0x31b16b);})['catch'](function(_0x276609){logger[_0xab1f('0x8')](_0xab1f('0x19'),_0x276609[_0xab1f('0xa')],_0x11ec23);_0x5e1cf0(_0x3c11d7[_0xab1f('0x8')](0x1f4,_0x276609[_0xab1f('0xa')]));});});};
\ No newline at end of file
+var _0x82d8=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','ShowChatQueue','find','lodash','moment','ioredis','../../config/utils'];(function(_0x1e39f3,_0x4802a4){var _0x23a85b=function(_0x547083){while(--_0x547083){_0x1e39f3['push'](_0x1e39f3['shift']());}};_0x23a85b(++_0x4802a4);}(_0x82d8,0xff));var _0x882d=function(_0x1f5e25,_0x4c09be){_0x1f5e25=_0x1f5e25-0x0;var _0x52fd89=_0x82d8[_0x1f5e25];return _0x52fd89;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var moment=require(_0x882d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x882d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x882d('0x4'));var jayson=require(_0x882d('0x5'));var client=jayson[_0x882d('0x6')][_0x882d('0x7')]({'port':0x232a});config[_0x882d('0x8')]=_[_0x882d('0x9')](config[_0x882d('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x882d('0xa'))(new Redis(config[_0x882d('0x8')]));require(_0x882d('0xb'))['register'](socket);function respondWithRpcPromise(_0x2781b1,_0x3ad799,_0x5e342a){return new BPromise(function(_0x130954,_0xa2ca7f){return client[_0x882d('0xc')](_0x2781b1,_0x5e342a)['then'](function(_0x287672){logger[_0x882d('0xd')](_0x882d('0xe'),_0x3ad799,_0x882d('0xf'));logger[_0x882d('0x10')](_0x882d('0x11'),_0x3ad799,_0x882d('0xf'),JSON['stringify'](_0x287672));if(_0x287672['error']){if(_0x287672[_0x882d('0x12')][_0x882d('0x13')]===0x1f4){logger[_0x882d('0x12')](_0x882d('0xe'),_0x3ad799,_0x287672[_0x882d('0x12')]['message']);return _0xa2ca7f(_0x287672[_0x882d('0x12')][_0x882d('0x14')]);}logger[_0x882d('0x12')](_0x882d('0xe'),_0x3ad799,_0x287672[_0x882d('0x12')][_0x882d('0x14')]);return _0x130954(_0x287672[_0x882d('0x12')][_0x882d('0x14')]);}else{logger[_0x882d('0xd')]('ChatQueue,\x20%s,\x20%s',_0x3ad799,'request\x20sent');_0x130954(_0x287672[_0x882d('0x15')]['message']);}})[_0x882d('0x16')](function(_0x47d6a0){logger[_0x882d('0x12')](_0x882d('0xe'),_0x3ad799,_0x47d6a0);_0xa2ca7f(_0x47d6a0);});});}exports[_0x882d('0x17')]=function(_0x559a9b){var _0x22068=this;return new Promise(function(_0x282345,_0x14d709){return db['ChatQueue'][_0x882d('0x18')]({'raw':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')][_0x882d('0x1a')]===undefined?!![]:![]:!![],'where':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')][_0x882d('0x1b')]||null:null,'attributes':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')]['attributes']||null:null,'limit':_0x559a9b[_0x882d('0x19')]?_0x559a9b['options'][_0x882d('0x1c')]||null:null,'include':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')][_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x559a9b['options'][_0x882d('0x1d')],function(_0x58ddb2){return{'model':db[_0x58ddb2[_0x882d('0x1f')]],'as':_0x58ddb2['as'],'attributes':_0x58ddb2[_0x882d('0x20')],'include':_0x58ddb2['include']?_['map'](_0x58ddb2['include'],function(_0x546fba){return{'model':db[_0x546fba[_0x882d('0x1f')]],'as':_0x546fba['as'],'attributes':_0x546fba[_0x882d('0x20')],'include':_0x546fba[_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x546fba['include'],function(_0x287251){return{'model':db[_0x287251[_0x882d('0x1f')]],'as':_0x287251['as'],'attributes':_0x287251[_0x882d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x882d('0x21')](function(_0xe040d8){logger['info']('GetChatQueue',_0x559a9b);logger['debug'](_0x882d('0x17'),_0x559a9b,JSON[_0x882d('0x22')](_0xe040d8));_0x282345(_0xe040d8);})[_0x882d('0x16')](function(_0x49d16f){logger[_0x882d('0x12')](_0x882d('0x17'),_0x49d16f[_0x882d('0x14')],_0x559a9b);_0x14d709(_0x22068[_0x882d('0x12')](0x1f4,_0x49d16f[_0x882d('0x14')]));});});};exports[_0x882d('0x23')]=function(_0x5806a9){var _0x21a75e=this;return new Promise(function(_0x5b2c3a,_0x41f404){return db['ChatQueue'][_0x882d('0x24')]({'raw':_0x5806a9['options']?_0x5806a9[_0x882d('0x19')][_0x882d('0x1a')]===undefined?!![]:![]:!![],'where':_0x5806a9[_0x882d('0x19')]?_0x5806a9[_0x882d('0x19')][_0x882d('0x1b')]||null:null,'attributes':_0x5806a9['options']?_0x5806a9[_0x882d('0x19')]['attributes']||null:null,'include':_0x5806a9[_0x882d('0x19')]?_0x5806a9[_0x882d('0x19')][_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x5806a9[_0x882d('0x19')][_0x882d('0x1d')],function(_0x4becfa){return{'model':db[_0x4becfa['model']],'as':_0x4becfa['as'],'attributes':_0x4becfa['attributes'],'include':_0x4becfa[_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x4becfa[_0x882d('0x1d')],function(_0x45b2a0){return{'model':db[_0x45b2a0[_0x882d('0x1f')]],'as':_0x45b2a0['as'],'attributes':_0x45b2a0['attributes'],'include':_0x45b2a0[_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x45b2a0[_0x882d('0x1d')],function(_0x425dcf){return{'model':db[_0x425dcf[_0x882d('0x1f')]],'as':_0x425dcf['as'],'attributes':_0x425dcf[_0x882d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x882d('0x21')](function(_0xdc43b3){logger[_0x882d('0xd')]('ShowChatQueue',_0x5806a9);logger['debug']('ShowChatQueue',_0x5806a9,JSON[_0x882d('0x22')](_0xdc43b3));_0x5b2c3a(_0xdc43b3);})[_0x882d('0x16')](function(_0x1aec6f){logger[_0x882d('0x12')]('ShowChatQueue',_0x1aec6f['message'],_0x5806a9);_0x41f404(_0x21a75e[_0x882d('0x12')](0x1f4,_0x1aec6f[_0x882d('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index a2a3829..7100b53 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 _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x471a85,_0x239e8d){var _0x5f2039=function(_0x378952){while(--_0x378952){_0x471a85['push'](_0x471a85['shift']());}};_0x5f2039(++_0x239e8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x405778,_0xa4dd3b){_0x405778=_0x405778-0x0;var _0x341735=_0xb10b[_0x405778];return _0x341735;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
+var _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x3172de,_0x1e5298){var _0x37233c=function(_0x27e9e8){while(--_0x27e9e8){_0x3172de['push'](_0x3172de['shift']());}};_0x37233c(++_0x1e5298);}(_0x0b0e,0x187));var _0xe0b0=function(_0x17dcd1,_0x3b7ccb){_0x17dcd1=_0x17dcd1-0x0;var _0x12af77=_0x0b0e[_0x17dcd1];return _0x12af77;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 519fe6a..4ee0c5c 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 _0x1050=['../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x5b1428,_0x45296d){var _0x31704b=function(_0x2071ea){while(--_0x2071ea){_0x5b1428['push'](_0x5b1428['shift']());}};_0x31704b(++_0x45296d);}(_0x1050,0x157));var _0x0105=function(_0x35c500,_0x4132be){_0x35c500=_0x35c500-0x0;var _0x2aa8b7=_0x1050[_0x35c500];return _0x2aa8b7;};'use strict';var multer=require('multer');var util=require(_0x0105('0x0'));var path=require(_0x0105('0x1'));var timeout=require(_0x0105('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0105('0x3'));var interaction=require(_0x0105('0x4'));var config=require(_0x0105('0x5'));var controller=require(_0x0105('0x6'));router[_0x0105('0x7')]('/',auth[_0x0105('0x8')](),controller['index']);router[_0x0105('0x7')](_0x0105('0x9'),auth['isAuthenticated'](),controller[_0x0105('0xa')]);router[_0x0105('0x7')](_0x0105('0xb'),auth[_0x0105('0x8')](),controller[_0x0105('0xc')]);router[_0x0105('0x7')](_0x0105('0xd'),auth['isAuthenticated'](),controller[_0x0105('0xe')]);router['get'](_0x0105('0xf'),auth[_0x0105('0x8')](),controller[_0x0105('0x10')]);router[_0x0105('0x7')](_0x0105('0x11'),auth[_0x0105('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0105('0x12')]);router[_0x0105('0x13')](_0x0105('0xf'),auth[_0x0105('0x8')](),controller[_0x0105('0x14')]);router['post'](_0x0105('0x11'),auth[_0x0105('0x8')](),controller[_0x0105('0x15')]);router[_0x0105('0x16')](_0x0105('0xb'),auth['isAuthenticated'](),controller[_0x0105('0x17')]);router[_0x0105('0x18')]('/:id',auth[_0x0105('0x8')](),controller[_0x0105('0x19')]);router[_0x0105('0x18')](_0x0105('0xf'),auth['isAuthenticated'](),controller[_0x0105('0x1a')]);router[_0x0105('0x18')](_0x0105('0x11'),auth[_0x0105('0x8')](),controller[_0x0105('0x1b')]);module[_0x0105('0x1c')]=router;
\ No newline at end of file
+var _0x54b9=['create','addTeams','update','delete','/:id','destroy','removeTeams','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id/members','getMembers','/:id/teams','/:id/users','post'];(function(_0x24d22f,_0xfa6241){var _0x33b153=function(_0x28caa6){while(--_0x28caa6){_0x24d22f['push'](_0x24d22f['shift']());}};_0x33b153(++_0xfa6241);}(_0x54b9,0xc0));var _0x954b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x54b9[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x954b('0x0'));var util=require(_0x954b('0x1'));var path=require(_0x954b('0x2'));var timeout=require(_0x954b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x954b('0x4'));var interaction=require(_0x954b('0x5'));var config=require(_0x954b('0x6'));var controller=require('./chatQueue.controller');router[_0x954b('0x7')]('/',auth[_0x954b('0x8')](),controller['index']);router[_0x954b('0x7')]('/describe',auth[_0x954b('0x8')](),controller[_0x954b('0x9')]);router['get']('/:id',auth[_0x954b('0x8')](),controller['show']);router['get'](_0x954b('0xa'),auth[_0x954b('0x8')](),controller[_0x954b('0xb')]);router[_0x954b('0x7')](_0x954b('0xc'),auth[_0x954b('0x8')](),controller['getTeams']);router[_0x954b('0x7')](_0x954b('0xd'),auth[_0x954b('0x8')](),controller['getAgents']);router[_0x954b('0xe')]('/',auth[_0x954b('0x8')](),controller[_0x954b('0xf')]);router[_0x954b('0xe')](_0x954b('0xc'),auth[_0x954b('0x8')](),controller[_0x954b('0x10')]);router['post'](_0x954b('0xd'),auth[_0x954b('0x8')](),controller['addAgents']);router['put']('/:id',auth[_0x954b('0x8')](),controller[_0x954b('0x11')]);router[_0x954b('0x12')](_0x954b('0x13'),auth[_0x954b('0x8')](),controller[_0x954b('0x14')]);router[_0x954b('0x12')]('/:id/teams',auth[_0x954b('0x8')](),controller[_0x954b('0x15')]);router[_0x954b('0x12')](_0x954b('0xd'),auth[_0x954b('0x8')](),controller['removeAgents']);module[_0x954b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 5b9cdab..e559399 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 _0xd105=['STRING','DATE','moment','sequelize'];(function(_0x81e0be,_0x509cab){var _0x1fa2c1=function(_0x51cb6e){while(--_0x51cb6e){_0x81e0be['push'](_0x81e0be['shift']());}};_0x1fa2c1(++_0x509cab);}(_0xd105,0x8a));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x5d10('0x0'));var Sequelize=require(_0x5d10('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5d10('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5d10('0x2')]},'joinAt':{'type':Sequelize[_0x5d10('0x3')]},'leaveAt':{'type':Sequelize[_0x5d10('0x3')]},'acceptAt':{'type':Sequelize[_0x5d10('0x3')]},'exitAt':{'type':Sequelize[_0x5d10('0x3')]},'reason':{'type':Sequelize[_0x5d10('0x2')]}};
\ No newline at end of file
+var _0xdf72=['DATE','moment','sequelize','exports','STRING'];(function(_0x351283,_0x5966a6){var _0x122685=function(_0x528e21){while(--_0x528e21){_0x351283['push'](_0x351283['shift']());}};_0x122685(++_0x5966a6);}(_0xdf72,0x146));var _0x2df7=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0xdf72[_0x52684f];return _0x4a55f0;};'use strict';var moment=require(_0x2df7('0x0'));var Sequelize=require(_0x2df7('0x1'));module[_0x2df7('0x2')]={'uniqueid':{'type':Sequelize[_0x2df7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2df7('0x3')]},'joinAt':{'type':Sequelize[_0x2df7('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2df7('0x4')]},'exitAt':{'type':Sequelize[_0x2df7('0x4')]},'reason':{'type':Sequelize[_0x2df7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9668e5a..ccc02b7 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 _0x2abd=['error','send','index','map','ChatQueueReport','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','field','options','count','include','findAll','rows','catch','fields','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x375989,_0x371b04){var _0x5dfca5=function(_0x282fe3){while(--_0x282fe3){_0x375989['push'](_0x375989['shift']());}};_0x5dfca5(++_0x371b04);}(_0x2abd,0x72));var _0xd2ab=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x2abd[_0x413feb];return _0x40ee88;};'use strict';var pdf=require(_0xd2ab('0x0'));var emlformat=require(_0xd2ab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd2ab('0x2'));var jsonpatch=require(_0xd2ab('0x3'));var rp=require(_0xd2ab('0x4'));var moment=require(_0xd2ab('0x5'));var BPromise=require(_0xd2ab('0x6'));var Mustache=require(_0xd2ab('0x7'));var util=require(_0xd2ab('0x8'));var path=require(_0xd2ab('0x9'));var sox=require(_0xd2ab('0xa'));var csv=require(_0xd2ab('0xb'));var ejs=require(_0xd2ab('0xc'));var fs=require('fs');var _=require(_0xd2ab('0xd'));var squel=require('squel');var crypto=require(_0xd2ab('0xe'));var jsforce=require(_0xd2ab('0xf'));var deskjs=require(_0xd2ab('0x10'));var toCsv=require(_0xd2ab('0xb'));var querystring=require('querystring');var Papa=require(_0xd2ab('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd2ab('0x12'));var as=require(_0xd2ab('0x13'));var hardwareService=require(_0xd2ab('0x14'));var logger=require(_0xd2ab('0x15'))(_0xd2ab('0x16'));var utils=require(_0xd2ab('0x17'));var config=require(_0xd2ab('0x18'));var db=require(_0xd2ab('0x19'))['db'];function respondWithStatusCode(_0x104ac0,_0x5618e8){_0x5618e8=_0x5618e8||0xcc;return function(_0x4e8677){if(_0x4e8677){return _0x104ac0[_0xd2ab('0x1a')](_0x5618e8);}return _0x104ac0[_0xd2ab('0x1b')](_0x5618e8)[_0xd2ab('0x1c')]();};}function respondWithResult(_0x8933f5,_0x388137){_0x388137=_0x388137||0xc8;return function(_0x1ab6bd){if(_0x1ab6bd){return _0x8933f5[_0xd2ab('0x1b')](_0x388137)[_0xd2ab('0x1d')](_0x1ab6bd);}};}function respondWithFilteredResult(_0x6d3e3f,_0x37a00b){return function(_0x2f7ab5){if(_0x2f7ab5){var _0xf4c83c=_0x2f7ab5['count'],_0x4df135=_0x37a00b[_0xd2ab('0x1e')],_0xa9fcb8=_0x37a00b['offset']+_0x37a00b[_0xd2ab('0x1f')],_0x26cf0c;if(_0xa9fcb8>=_0xf4c83c){_0xa9fcb8=_0xf4c83c;_0x26cf0c=0xc8;}else{_0x26cf0c=0xce;}_0x6d3e3f['status'](_0x26cf0c);return _0x6d3e3f[_0xd2ab('0x20')](_0xd2ab('0x21'),_0x4df135+'-'+_0xa9fcb8+'/'+_0xf4c83c)['json'](_0x2f7ab5);}return null;};}function patchUpdates(_0x18a3a5){return function(_0x4f83a7){try{jsonpatch[_0xd2ab('0x22')](_0x4f83a7,_0x18a3a5,!![]);}catch(_0x2bc663){return BPromise[_0xd2ab('0x23')](_0x2bc663);}return _0x4f83a7[_0xd2ab('0x24')]();};}function saveUpdates(_0x452e0a,_0x122f48){return function(_0x542331){if(_0x542331){return _0x542331[_0xd2ab('0x25')](_0x452e0a)[_0xd2ab('0x26')](function(_0xc19989){return _0xc19989;});}return null;};}function removeEntity(_0x1559e9,_0x2c3fcc){return function(_0x21cdc0){if(_0x21cdc0){return _0x21cdc0[_0xd2ab('0x27')]()[_0xd2ab('0x26')](function(){_0x1559e9[_0xd2ab('0x1b')](0xcc)[_0xd2ab('0x1c')]();});}};}function handleEntityNotFound(_0x42fe0d,_0xaacbab){return function(_0x4f52bf){if(!_0x4f52bf){_0x42fe0d['sendStatus'](0x194);}return _0x4f52bf;};}function handleError(_0x3af511,_0x58584a){_0x58584a=_0x58584a||0x1f4;return function(_0x3638e5){logger[_0xd2ab('0x28')](_0x3638e5['stack']);if(_0x3638e5['name']){delete _0x3638e5['name'];}_0x3af511[_0xd2ab('0x1b')](_0x58584a)[_0xd2ab('0x29')](_0x3638e5);};}exports[_0xd2ab('0x2a')]=function(_0x5c0db9,_0x582350){var _0x20b61b={},_0x349998={},_0x505ef0={'count':0x0,'rows':[]};var _0x3345b0=_[_0xd2ab('0x2b')](db[_0xd2ab('0x2c')][_0xd2ab('0x2d')],function(_0x395ac2){return{'name':_0x395ac2['fieldName'],'type':_0x395ac2[_0xd2ab('0x2e')][_0xd2ab('0x2f')]};});_0x349998[_0xd2ab('0x30')]=_[_0xd2ab('0x2b')](_0x3345b0,_0xd2ab('0x31'));_0x349998['query']=_[_0xd2ab('0x32')](_0x5c0db9[_0xd2ab('0x33')]);_0x349998[_0xd2ab('0x34')]=_[_0xd2ab('0x35')](_0x349998[_0xd2ab('0x30')],_0x349998[_0xd2ab('0x33')]);_0x20b61b['attributes']=_['intersection'](_0x349998[_0xd2ab('0x30')],qs['fields'](_0x5c0db9[_0xd2ab('0x33')]['fields']));_0x20b61b[_0xd2ab('0x36')]=_0x20b61b['attributes'][_0xd2ab('0x37')]?_0x20b61b[_0xd2ab('0x36')]:_0x349998[_0xd2ab('0x30')];if(!_0x5c0db9[_0xd2ab('0x33')][_0xd2ab('0x38')]('nolimit')){_0x20b61b['limit']=qs[_0xd2ab('0x1f')](_0x5c0db9[_0xd2ab('0x33')]['limit']);_0x20b61b[_0xd2ab('0x1e')]=qs['offset'](_0x5c0db9['query']['offset']);}_0x20b61b[_0xd2ab('0x39')]=qs[_0xd2ab('0x3a')](_0x5c0db9['query'][_0xd2ab('0x3a')]);_0x20b61b[_0xd2ab('0x3b')]=qs[_0xd2ab('0x34')](_[_0xd2ab('0x3c')](_0x5c0db9['query'],_0x349998[_0xd2ab('0x34')]));if(_0x5c0db9[_0xd2ab('0x33')][_0xd2ab('0x3d')]){_0x20b61b[_0xd2ab('0x3b')]=_[_0xd2ab('0x3e')](_0x20b61b[_0xd2ab('0x3b')],{'$or':_[_0xd2ab('0x2b')](_0x3345b0,function(_0x45435a){if(_0x45435a[_0xd2ab('0x2e')][_0xd2ab('0x2f')]!==_0xd2ab('0x3f')){var _0x798219={};_0x798219[_0x45435a[_0xd2ab('0x40')]]={'$like':'%'+_0x5c0db9['query'][_0xd2ab('0x3d')]+'%'};return _0x798219;}})});}_0x20b61b=_['merge']({},_0x20b61b,_0x5c0db9[_0xd2ab('0x41')]);var _0x26eda5={'where':_0x20b61b['where']};return db[_0xd2ab('0x2c')]['count'](_0x26eda5)[_0xd2ab('0x26')](function(_0x5a9e2e){_0x505ef0[_0xd2ab('0x42')]=_0x5a9e2e;if(_0x5c0db9[_0xd2ab('0x33')]['includeAll']){_0x20b61b[_0xd2ab('0x43')]=[{'all':!![]}];}return db[_0xd2ab('0x2c')][_0xd2ab('0x44')](_0x20b61b);})[_0xd2ab('0x26')](function(_0x22c3f5){_0x505ef0[_0xd2ab('0x45')]=_0x22c3f5;return _0x505ef0;})['then'](respondWithFilteredResult(_0x582350,_0x20b61b))[_0xd2ab('0x46')](handleError(_0x582350,null));};exports['show']=function(_0x261982,_0x10550c){var _0x345398={'raw':!![],'where':{'id':_0x261982['params']['id']}},_0x1c808a={};_0x1c808a[_0xd2ab('0x30')]=_[_0xd2ab('0x32')](db[_0xd2ab('0x2c')]['rawAttributes']);_0x1c808a[_0xd2ab('0x33')]=_[_0xd2ab('0x32')](_0x261982[_0xd2ab('0x33')]);_0x1c808a[_0xd2ab('0x34')]=_[_0xd2ab('0x35')](_0x1c808a['model'],_0x1c808a['query']);_0x345398[_0xd2ab('0x36')]=_[_0xd2ab('0x35')](_0x1c808a['model'],qs['fields'](_0x261982[_0xd2ab('0x33')][_0xd2ab('0x47')]));_0x345398[_0xd2ab('0x36')]=_0x345398['attributes']['length']?_0x345398[_0xd2ab('0x36')]:_0x1c808a[_0xd2ab('0x30')];if(_0x261982[_0xd2ab('0x33')]['includeAll']){_0x345398['include']=[{'all':!![]}];}_0x345398=_[_0xd2ab('0x3e')]({},_0x345398,_0x261982['options']);return db[_0xd2ab('0x2c')][_0xd2ab('0x48')](_0x345398)[_0xd2ab('0x26')](handleEntityNotFound(_0x10550c,null))[_0xd2ab('0x26')](respondWithResult(_0x10550c,null))[_0xd2ab('0x46')](handleError(_0x10550c,null));};exports[_0xd2ab('0x49')]=function(_0x4406ac,_0x2030d9){return db[_0xd2ab('0x2c')][_0xd2ab('0x49')](_0x4406ac[_0xd2ab('0x4a')],{})['then'](respondWithResult(_0x2030d9,0xc9))['catch'](handleError(_0x2030d9,null));};exports[_0xd2ab('0x25')]=function(_0x3623c4,_0x17a5a2){if(_0x3623c4[_0xd2ab('0x4a')]['id']){delete _0x3623c4[_0xd2ab('0x4a')]['id'];}return db['ChatQueueReport'][_0xd2ab('0x48')]({'where':{'id':_0x3623c4[_0xd2ab('0x4b')]['id']}})[_0xd2ab('0x26')](handleEntityNotFound(_0x17a5a2,null))[_0xd2ab('0x26')](saveUpdates(_0x3623c4[_0xd2ab('0x4a')],null))['then'](respondWithResult(_0x17a5a2,null))[_0xd2ab('0x46')](handleError(_0x17a5a2,null));};exports['destroy']=function(_0x266719,_0x323ca9){return db[_0xd2ab('0x2c')][_0xd2ab('0x48')]({'where':{'id':_0x266719['params']['id']}})[_0xd2ab('0x26')](handleEntityNotFound(_0x323ca9,null))['then'](removeEntity(_0x323ca9,null))['catch'](handleError(_0x323ca9,null));};exports['describe']=function(_0x1da50c,_0x22f8f0){return db[_0xd2ab('0x2c')][_0xd2ab('0x4c')]()[_0xd2ab('0x26')](respondWithResult(_0x22f8f0,null))[_0xd2ab('0x46')](handleError(_0x22f8f0,null));};
\ No newline at end of file
+var _0x8556=['fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','field','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','ChatQueueReport','rawAttributes'];(function(_0x376a9f,_0x602742){var _0x5dfc90=function(_0x52c597){while(--_0x52c597){_0x376a9f['push'](_0x376a9f['shift']());}};_0x5dfc90(++_0x602742);}(_0x8556,0x1da));var _0x6855=function(_0xd2dfeb,_0x51aa27){_0xd2dfeb=_0xd2dfeb-0x0;var _0x313172=_0x8556[_0xd2dfeb];return _0x313172;};'use strict';var pdf=require(_0x6855('0x0'));var emlformat=require(_0x6855('0x1'));var rimraf=require(_0x6855('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6855('0x3'));var rp=require(_0x6855('0x4'));var moment=require(_0x6855('0x5'));var BPromise=require(_0x6855('0x6'));var Mustache=require(_0x6855('0x7'));var util=require(_0x6855('0x8'));var path=require(_0x6855('0x9'));var sox=require(_0x6855('0xa'));var csv=require(_0x6855('0xb'));var ejs=require(_0x6855('0xc'));var fs=require('fs');var _=require(_0x6855('0xd'));var squel=require('squel');var crypto=require(_0x6855('0xe'));var jsforce=require(_0x6855('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6855('0xb'));var querystring=require(_0x6855('0x10'));var Papa=require(_0x6855('0x11'));var Redis=require(_0x6855('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6855('0x13'));var as=require(_0x6855('0x14'));var hardwareService=require(_0x6855('0x15'));var logger=require('../../config/logger')(_0x6855('0x16'));var utils=require(_0x6855('0x17'));var config=require(_0x6855('0x18'));var db=require(_0x6855('0x19'))['db'];function respondWithStatusCode(_0x2156a4,_0x42a558){_0x42a558=_0x42a558||0xcc;return function(_0x21417f){if(_0x21417f){return _0x2156a4[_0x6855('0x1a')](_0x42a558);}return _0x2156a4[_0x6855('0x1b')](_0x42a558)['end']();};}function respondWithResult(_0x25c6a6,_0x250071){_0x250071=_0x250071||0xc8;return function(_0x3c9fc3){if(_0x3c9fc3){return _0x25c6a6[_0x6855('0x1b')](_0x250071)['json'](_0x3c9fc3);}};}function respondWithFilteredResult(_0x580d54,_0x47dce7){return function(_0x3c9b19){if(_0x3c9b19){var _0x4b5422=_0x3c9b19[_0x6855('0x1c')],_0x523fb4=_0x47dce7['offset'],_0x35773a=_0x47dce7[_0x6855('0x1d')]+_0x47dce7[_0x6855('0x1e')],_0x392ff1;if(_0x35773a>=_0x4b5422){_0x35773a=_0x4b5422;_0x392ff1=0xc8;}else{_0x392ff1=0xce;}_0x580d54[_0x6855('0x1b')](_0x392ff1);return _0x580d54[_0x6855('0x1f')](_0x6855('0x20'),_0x523fb4+'-'+_0x35773a+'/'+_0x4b5422)[_0x6855('0x21')](_0x3c9b19);}return null;};}function patchUpdates(_0x4766b0){return function(_0x595a61){try{jsonpatch['apply'](_0x595a61,_0x4766b0,!![]);}catch(_0x484ed9){return BPromise[_0x6855('0x22')](_0x484ed9);}return _0x595a61[_0x6855('0x23')]();};}function saveUpdates(_0x555c97,_0x3fd295){return function(_0x1d454f){if(_0x1d454f){return _0x1d454f[_0x6855('0x24')](_0x555c97)[_0x6855('0x25')](function(_0x589fa4){return _0x589fa4;});}return null;};}function removeEntity(_0x4b3746,_0x78a466){return function(_0x4160c5){if(_0x4160c5){return _0x4160c5[_0x6855('0x26')]()['then'](function(){_0x4b3746[_0x6855('0x1b')](0xcc)[_0x6855('0x27')]();});}};}function handleEntityNotFound(_0x5d9c1e,_0x5a589c){return function(_0x2db098){if(!_0x2db098){_0x5d9c1e[_0x6855('0x1a')](0x194);}return _0x2db098;};}function handleError(_0x3c5372,_0x3e677f){_0x3e677f=_0x3e677f||0x1f4;return function(_0x119bdd){logger[_0x6855('0x28')](_0x119bdd['stack']);if(_0x119bdd['name']){delete _0x119bdd[_0x6855('0x29')];}_0x3c5372[_0x6855('0x1b')](_0x3e677f)['send'](_0x119bdd);};}exports['index']=function(_0x4e0053,_0x48f021){var _0x25b243={},_0x546ea5={},_0x3b64f6={'count':0x0,'rows':[]};var _0x1a4c8e=_['map'](db[_0x6855('0x2a')][_0x6855('0x2b')],function(_0x34022b){return{'name':_0x34022b[_0x6855('0x2c')],'type':_0x34022b[_0x6855('0x2d')][_0x6855('0x2e')]};});_0x546ea5[_0x6855('0x2f')]=_[_0x6855('0x30')](_0x1a4c8e,_0x6855('0x29'));_0x546ea5[_0x6855('0x31')]=_['keys'](_0x4e0053[_0x6855('0x31')]);_0x546ea5[_0x6855('0x32')]=_['intersection'](_0x546ea5['model'],_0x546ea5[_0x6855('0x31')]);_0x25b243[_0x6855('0x33')]=_[_0x6855('0x34')](_0x546ea5['model'],qs['fields'](_0x4e0053[_0x6855('0x31')][_0x6855('0x35')]));_0x25b243['attributes']=_0x25b243[_0x6855('0x33')][_0x6855('0x36')]?_0x25b243['attributes']:_0x546ea5[_0x6855('0x2f')];if(!_0x4e0053[_0x6855('0x31')][_0x6855('0x37')](_0x6855('0x38'))){_0x25b243[_0x6855('0x1e')]=qs[_0x6855('0x1e')](_0x4e0053[_0x6855('0x31')]['limit']);_0x25b243[_0x6855('0x1d')]=qs[_0x6855('0x1d')](_0x4e0053[_0x6855('0x31')][_0x6855('0x1d')]);}_0x25b243[_0x6855('0x39')]=qs[_0x6855('0x3a')](_0x4e0053[_0x6855('0x31')][_0x6855('0x3a')]);_0x25b243['where']=qs[_0x6855('0x32')](_['pick'](_0x4e0053[_0x6855('0x31')],_0x546ea5[_0x6855('0x32')]));if(_0x4e0053[_0x6855('0x31')]['filter']){_0x25b243[_0x6855('0x3b')]=_[_0x6855('0x3c')](_0x25b243[_0x6855('0x3b')],{'$or':_[_0x6855('0x30')](_0x1a4c8e,function(_0x42b3db){if(_0x42b3db['type'][_0x6855('0x2e')]!=='VIRTUAL'){var _0x2e5bdf={};_0x2e5bdf[_0x42b3db[_0x6855('0x3d')]]={'$like':'%'+_0x4e0053[_0x6855('0x31')]['filter']+'%'};return _0x2e5bdf;}})});}_0x25b243=_[_0x6855('0x3c')]({},_0x25b243,_0x4e0053[_0x6855('0x3e')]);var _0x2580a5={'where':_0x25b243[_0x6855('0x3b')]};return db[_0x6855('0x2a')][_0x6855('0x1c')](_0x2580a5)[_0x6855('0x25')](function(_0x463bbf){_0x3b64f6[_0x6855('0x1c')]=_0x463bbf;if(_0x4e0053[_0x6855('0x31')][_0x6855('0x3f')]){_0x25b243[_0x6855('0x40')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x25b243);})['then'](function(_0x91e52f){_0x3b64f6[_0x6855('0x41')]=_0x91e52f;return _0x3b64f6;})[_0x6855('0x25')](respondWithFilteredResult(_0x48f021,_0x25b243))[_0x6855('0x42')](handleError(_0x48f021,null));};exports[_0x6855('0x43')]=function(_0x3d1849,_0x42c8bd){var _0x4f7388={'raw':!![],'where':{'id':_0x3d1849[_0x6855('0x44')]['id']}},_0x7fa40d={};_0x7fa40d[_0x6855('0x2f')]=_[_0x6855('0x45')](db[_0x6855('0x2a')][_0x6855('0x2b')]);_0x7fa40d[_0x6855('0x31')]=_[_0x6855('0x45')](_0x3d1849[_0x6855('0x31')]);_0x7fa40d[_0x6855('0x32')]=_[_0x6855('0x34')](_0x7fa40d[_0x6855('0x2f')],_0x7fa40d[_0x6855('0x31')]);_0x4f7388[_0x6855('0x33')]=_[_0x6855('0x34')](_0x7fa40d[_0x6855('0x2f')],qs[_0x6855('0x35')](_0x3d1849[_0x6855('0x31')][_0x6855('0x35')]));_0x4f7388[_0x6855('0x33')]=_0x4f7388['attributes'][_0x6855('0x36')]?_0x4f7388[_0x6855('0x33')]:_0x7fa40d[_0x6855('0x2f')];if(_0x3d1849[_0x6855('0x31')][_0x6855('0x3f')]){_0x4f7388[_0x6855('0x40')]=[{'all':!![]}];}_0x4f7388=_[_0x6855('0x3c')]({},_0x4f7388,_0x3d1849['options']);return db[_0x6855('0x2a')][_0x6855('0x46')](_0x4f7388)[_0x6855('0x25')](handleEntityNotFound(_0x42c8bd,null))[_0x6855('0x25')](respondWithResult(_0x42c8bd,null))[_0x6855('0x42')](handleError(_0x42c8bd,null));};exports['create']=function(_0x126b91,_0x3130fb){return db[_0x6855('0x2a')][_0x6855('0x47')](_0x126b91[_0x6855('0x48')],{})['then'](respondWithResult(_0x3130fb,0xc9))[_0x6855('0x42')](handleError(_0x3130fb,null));};exports[_0x6855('0x24')]=function(_0x47967b,_0x4f77b7){if(_0x47967b[_0x6855('0x48')]['id']){delete _0x47967b['body']['id'];}return db[_0x6855('0x2a')]['find']({'where':{'id':_0x47967b['params']['id']}})[_0x6855('0x25')](handleEntityNotFound(_0x4f77b7,null))[_0x6855('0x25')](saveUpdates(_0x47967b[_0x6855('0x48')],null))[_0x6855('0x25')](respondWithResult(_0x4f77b7,null))[_0x6855('0x42')](handleError(_0x4f77b7,null));};exports[_0x6855('0x26')]=function(_0x52147f,_0x3e010d){return db[_0x6855('0x2a')]['find']({'where':{'id':_0x52147f['params']['id']}})[_0x6855('0x25')](handleEntityNotFound(_0x3e010d,null))[_0x6855('0x25')](removeEntity(_0x3e010d,null))[_0x6855('0x42')](handleError(_0x3e010d,null));};exports['describe']=function(_0x4d9f47,_0x4968a1){return db[_0x6855('0x2a')][_0x6855('0x49')]()[_0x6855('0x25')](respondWithResult(_0x4968a1,null))['catch'](handleError(_0x4968a1,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 517ba83..30845a1 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 _0x1369=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./chatQueueReport.attributes','exports'];(function(_0x391ad0,_0x554c01){var _0x94f53b=function(_0x37d5be){while(--_0x37d5be){_0x391ad0['push'](_0x391ad0['shift']());}};_0x94f53b(++_0x554c01);}(_0x1369,0xe1));var _0x9136=function(_0x471932,_0x16536d){_0x471932=_0x471932-0x0;var _0x28198c=_0x1369[_0x471932];return _0x28198c;};'use strict';var _=require(_0x9136('0x0'));var util=require(_0x9136('0x1'));var logger=require(_0x9136('0x2'))('api');var moment=require(_0x9136('0x3'));var BPromise=require(_0x9136('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9136('0x5'));var rimraf=require(_0x9136('0x6'));var config=require('../../config/environment');var attributes=require(_0x9136('0x7'));module[_0x9136('0x8')]=function(_0x2af998,_0x250a7){return _0x2af998[_0x9136('0x9')](_0x9136('0xa'),attributes,{'tableName':_0x9136('0xb'),'paranoid':![],'indexes':[{'name':_0x9136('0xc'),'fields':[_0x9136('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d2b=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueueReport.attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7d2b,0xd4));var _0xb7d2=function(_0x85d80c,_0x19871e){_0x85d80c=_0x85d80c-0x0;var _0xf6332b=_0x7d2b[_0x85d80c];return _0xf6332b;};'use strict';var _=require(_0xb7d2('0x0'));var util=require(_0xb7d2('0x1'));var logger=require(_0xb7d2('0x2'))(_0xb7d2('0x3'));var moment=require(_0xb7d2('0x4'));var BPromise=require(_0xb7d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7d2('0x6'));var rimraf=require('rimraf');var config=require(_0xb7d2('0x7'));var attributes=require(_0xb7d2('0x8'));module['exports']=function(_0x2ff90a,_0x4df649){return _0x2ff90a[_0xb7d2('0x9')](_0xb7d2('0xa'),attributes,{'tableName':_0xb7d2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb7d2('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 2981e9d..519a2d5 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 _0xa108=['ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0xa108,0x104));var _0x8a10=function(_0x5aa067,_0x2656ea){_0x5aa067=_0x5aa067-0x0;var _0x2210ae=_0xa108[_0x5aa067];return _0x2210ae;};'use strict';var _=require(_0x8a10('0x0'));var util=require(_0x8a10('0x1'));var moment=require(_0x8a10('0x2'));var BPromise=require(_0x8a10('0x3'));var rs=require(_0x8a10('0x4'));var fs=require('fs');var Redis=require(_0x8a10('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a10('0x6'));var logger=require(_0x8a10('0x7'))(_0x8a10('0x8'));var config=require(_0x8a10('0x9'));var jayson=require(_0x8a10('0xa'));var client=jayson['client'][_0x8a10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3128ae,_0x5f357e,_0xa6a8fb){return new BPromise(function(_0x17776,_0x2cb3f1){return client[_0x8a10('0xc')](_0x3128ae,_0xa6a8fb)[_0x8a10('0xd')](function(_0xfac78b){logger[_0x8a10('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x5f357e,'request\x20sent');logger[_0x8a10('0xf')](_0x8a10('0x10'),_0x5f357e,_0x8a10('0x11'),JSON['stringify'](_0xfac78b));if(_0xfac78b['error']){if(_0xfac78b[_0x8a10('0x12')][_0x8a10('0x13')]===0x1f4){logger[_0x8a10('0x12')](_0x8a10('0x14'),_0x5f357e,_0xfac78b[_0x8a10('0x12')][_0x8a10('0x15')]);return _0x2cb3f1(_0xfac78b[_0x8a10('0x12')][_0x8a10('0x15')]);}logger[_0x8a10('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x5f357e,_0xfac78b['error'][_0x8a10('0x15')]);return _0x17776(_0xfac78b['error'][_0x8a10('0x15')]);}else{logger[_0x8a10('0xe')](_0x8a10('0x14'),_0x5f357e,_0x8a10('0x11'));_0x17776(_0xfac78b[_0x8a10('0x16')][_0x8a10('0x15')]);}})[_0x8a10('0x17')](function(_0x406be5){logger['error'](_0x8a10('0x14'),_0x5f357e,_0x406be5);_0x2cb3f1(_0x406be5);});});}exports['CreateChatQueueReport']=function(_0x376722){var _0x19f002=this;return new Promise(function(_0x3f463a,_0x9d7ae8){return db[_0x8a10('0x18')]['create'](_0x376722['body'],{'raw':_0x376722[_0x8a10('0x19')]?_0x376722[_0x8a10('0x19')][_0x8a10('0x1a')]===undefined?!![]:![]:!![]})[_0x8a10('0xd')](function(_0x173adb){logger['info']('CreateChatQueueReport',_0x376722);logger[_0x8a10('0xf')](_0x8a10('0x1b'),_0x376722,JSON[_0x8a10('0x1c')](_0x173adb));_0x3f463a(_0x173adb);})[_0x8a10('0x17')](function(_0x24aff0){logger[_0x8a10('0x12')]('CreateChatQueueReport',_0x24aff0['message'],_0x376722);_0x9d7ae8(_0x19f002[_0x8a10('0x12')](0x1f4,_0x24aff0['message']));});});};exports[_0x8a10('0x1d')]=function(_0x4e80bd){var _0x3515df=this;return new Promise(function(_0x3f2201,_0x31276e){return db[_0x8a10('0x18')][_0x8a10('0x1e')](_0x4e80bd[_0x8a10('0x1f')],{'raw':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd['options'][_0x8a10('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd[_0x8a10('0x19')][_0x8a10('0x20')]||null:null,'attributes':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd[_0x8a10('0x19')][_0x8a10('0x21')]||null:null,'limit':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd[_0x8a10('0x19')][_0x8a10('0x22')]||null:null})[_0x8a10('0xd')](function(_0x17c546){logger[_0x8a10('0xe')](_0x8a10('0x1d'),_0x4e80bd);logger[_0x8a10('0xf')](_0x8a10('0x1d'),_0x4e80bd,JSON[_0x8a10('0x1c')](_0x17c546));_0x3f2201(_0x17c546);})[_0x8a10('0x17')](function(_0x5b0baa){logger[_0x8a10('0x12')](_0x8a10('0x1d'),_0x5b0baa['message'],_0x4e80bd);_0x31276e(_0x3515df[_0x8a10('0x12')](0x1f4,_0x5b0baa[_0x8a10('0x15')]));});});};
\ No newline at end of file
+var _0x3b87=['update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x3b87,0x190));var _0x73b8=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3b87[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x73b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x73b8('0x1'));var rs=require(_0x73b8('0x2'));var fs=require('fs');var Redis=require(_0x73b8('0x3'));var db=require(_0x73b8('0x4'))['db'];var utils=require(_0x73b8('0x5'));var logger=require(_0x73b8('0x6'))(_0x73b8('0x7'));var config=require(_0x73b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x73b8('0x9')][_0x73b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26be15,_0x8d2cd0,_0x11b019){return new BPromise(function(_0x3667aa,_0x2f6f1d){return client['request'](_0x26be15,_0x11b019)[_0x73b8('0xb')](function(_0x54ef8e){logger[_0x73b8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x8d2cd0,'request\x20sent');logger[_0x73b8('0xd')](_0x73b8('0xe'),_0x8d2cd0,_0x73b8('0xf'),JSON[_0x73b8('0x10')](_0x54ef8e));if(_0x54ef8e[_0x73b8('0x11')]){if(_0x54ef8e[_0x73b8('0x11')]['code']===0x1f4){logger['error'](_0x73b8('0x12'),_0x8d2cd0,_0x54ef8e[_0x73b8('0x11')][_0x73b8('0x13')]);return _0x2f6f1d(_0x54ef8e[_0x73b8('0x11')][_0x73b8('0x13')]);}logger[_0x73b8('0x11')](_0x73b8('0x12'),_0x8d2cd0,_0x54ef8e['error'][_0x73b8('0x13')]);return _0x3667aa(_0x54ef8e[_0x73b8('0x11')][_0x73b8('0x13')]);}else{logger[_0x73b8('0xc')](_0x73b8('0x12'),_0x8d2cd0,_0x73b8('0xf'));_0x3667aa(_0x54ef8e[_0x73b8('0x14')][_0x73b8('0x13')]);}})[_0x73b8('0x15')](function(_0x5ba06e){logger[_0x73b8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x8d2cd0,_0x5ba06e);_0x2f6f1d(_0x5ba06e);});});}exports[_0x73b8('0x16')]=function(_0x53731c){var _0xc03611=this;return new Promise(function(_0x12ade0,_0xebb37e){return db['ChatQueueReport'][_0x73b8('0x17')](_0x53731c[_0x73b8('0x18')],{'raw':_0x53731c['options']?_0x53731c[_0x73b8('0x19')][_0x73b8('0x1a')]===undefined?!![]:![]:!![]})[_0x73b8('0xb')](function(_0x2e41bb){logger[_0x73b8('0xc')](_0x73b8('0x16'),_0x53731c);logger['debug'](_0x73b8('0x16'),_0x53731c,JSON[_0x73b8('0x10')](_0x2e41bb));_0x12ade0(_0x2e41bb);})[_0x73b8('0x15')](function(_0x33796d){logger[_0x73b8('0x11')](_0x73b8('0x16'),_0x33796d['message'],_0x53731c);_0xebb37e(_0xc03611['error'](0x1f4,_0x33796d[_0x73b8('0x13')]));});});};exports[_0x73b8('0x1b')]=function(_0xdf091c){var _0x1d6757=this;return new Promise(function(_0x3ceb5e,_0x2f8834){return db[_0x73b8('0x1c')][_0x73b8('0x1d')](_0xdf091c[_0x73b8('0x18')],{'raw':_0xdf091c['options']?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf091c[_0x73b8('0x19')]?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x1e')]||null:null,'attributes':_0xdf091c[_0x73b8('0x19')]?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x1f')]||null:null,'limit':_0xdf091c[_0x73b8('0x19')]?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x20')]||null:null})[_0x73b8('0xb')](function(_0x1df11a){logger[_0x73b8('0xc')](_0x73b8('0x1b'),_0xdf091c);logger['debug'](_0x73b8('0x1b'),_0xdf091c,JSON['stringify'](_0x1df11a));_0x3ceb5e(_0x1df11a);})[_0x73b8('0x15')](function(_0x3a3b48){logger[_0x73b8('0x11')](_0x73b8('0x1b'),_0x3a3b48[_0x73b8('0x13')],_0xdf091c);_0x2f8834(_0x1d6757[_0x73b8('0x11')](0x1f4,_0x3a3b48[_0x73b8('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index f41782d..f2574cb 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 _0x183e=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0xdf986b,_0x5433e8){var _0x1f8502=function(_0x5cedbc){while(--_0x5cedbc){_0xdf986b['push'](_0xdf986b['shift']());}};_0x1f8502(++_0x5433e8);}(_0x183e,0x111));var _0xe183=function(_0x4bc310,_0x36c272){_0x4bc310=_0x4bc310-0x0;var _0x460218=_0x183e[_0x4bc310];return _0x460218;};'use strict';var multer=require('multer');var util=require(_0xe183('0x0'));var path=require(_0xe183('0x1'));var timeout=require(_0xe183('0x2'));var express=require(_0xe183('0x3'));var router=express[_0xe183('0x4')]();var auth=require(_0xe183('0x5'));var interaction=require(_0xe183('0x6'));var config=require(_0xe183('0x7'));var controller=require(_0xe183('0x8'));router['get']('/',auth[_0xe183('0x9')](),controller['index']);router[_0xe183('0xa')](_0xe183('0xb'),auth[_0xe183('0x9')](),controller[_0xe183('0xc')]);router[_0xe183('0xa')](_0xe183('0xd'),auth[_0xe183('0x9')](),controller[_0xe183('0xe')]);router[_0xe183('0xf')]('/',auth['isAuthenticated'](),controller[_0xe183('0x10')]);router[_0xe183('0x11')](_0xe183('0xd'),auth['isAuthenticated'](),controller[_0xe183('0x12')]);router['delete']('/:id',auth[_0xe183('0x9')](),controller[_0xe183('0x13')]);module[_0xe183('0x14')]=router;
\ No newline at end of file
+var _0x220d=['show','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x581ce4,_0x4495a3){var _0x46df4a=function(_0x2204ef){while(--_0x2204ef){_0x581ce4['push'](_0x581ce4['shift']());}};_0x46df4a(++_0x4495a3);}(_0x220d,0x194));var _0xd220=function(_0x11f033,_0x1198b7){_0x11f033=_0x11f033-0x0;var _0x5a9f69=_0x220d[_0x11f033];return _0x5a9f69;};'use strict';var multer=require(_0xd220('0x0'));var util=require(_0xd220('0x1'));var path=require(_0xd220('0x2'));var timeout=require('connect-timeout');var express=require(_0xd220('0x3'));var router=express[_0xd220('0x4')]();var auth=require(_0xd220('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd220('0x6'));var controller=require('./chatQueueReport.controller');router[_0xd220('0x7')]('/',auth[_0xd220('0x8')](),controller['index']);router[_0xd220('0x7')](_0xd220('0x9'),auth[_0xd220('0x8')](),controller[_0xd220('0xa')]);router[_0xd220('0x7')](_0xd220('0xb'),auth[_0xd220('0x8')](),controller[_0xd220('0xc')]);router['post']('/',auth[_0xd220('0x8')](),controller['create']);router[_0xd220('0xd')](_0xd220('0xb'),auth[_0xd220('0x8')](),controller[_0xd220('0xe')]);router['delete'](_0xd220('0xb'),auth[_0xd220('0x8')](),controller[_0xd220('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index d4309b1..106fa68 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 _0x61b4=['moment','sequelize','exports','STRING','agent','queue','DATE','NOW'];(function(_0x1ae6b8,_0x449a54){var _0x369328=function(_0x53a265){while(--_0x53a265){_0x1ae6b8['push'](_0x1ae6b8['shift']());}};_0x369328(++_0x449a54);}(_0x61b4,0x168));var _0x461b=function(_0x11356c,_0x2c0d4c){_0x11356c=_0x11356c-0x0;var _0x81266a=_0x61b4[_0x11356c];return _0x81266a;};'use strict';var moment=require(_0x461b('0x0'));var Sequelize=require(_0x461b('0x1'));module[_0x461b('0x2')]={'uniqueid':{'type':Sequelize[_0x461b('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x461b('0x4'),_0x461b('0x5')),'allowNull':![],'defaultValue':_0x461b('0x5')},'transferredAt':{'type':Sequelize[_0x461b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x461b('0x7')]}};
\ No newline at end of file
+var _0x6b7f=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0x6b7f,0xd4));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf6b7('0x0'));var Sequelize=require(_0xf6b7('0x1'));module[_0xf6b7('0x2')]={'uniqueid':{'type':Sequelize[_0xf6b7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf6b7('0x4')](_0xf6b7('0x5'),_0xf6b7('0x6'),_0xf6b7('0x7')),'allowNull':![],'defaultValue':_0xf6b7('0x7')},'transferredAt':{'type':Sequelize[_0xf6b7('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xf6b7('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index b166d67..2fa2004 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 _0xa20b=['includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','options'];(function(_0x4174a5,_0xb96b94){var _0x24e13a=function(_0x4d2594){while(--_0x4d2594){_0x4174a5['push'](_0x4174a5['shift']());}};_0x24e13a(++_0xb96b94);}(_0xa20b,0xa4));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba20('0x0'));var rimraf=require(_0xba20('0x1'));var zipdir=require(_0xba20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba20('0x3'));var moment=require(_0xba20('0x4'));var BPromise=require(_0xba20('0x5'));var Mustache=require(_0xba20('0x6'));var util=require('util');var path=require(_0xba20('0x7'));var sox=require('sox');var csv=require(_0xba20('0x8'));var ejs=require(_0xba20('0x9'));var fs=require('fs');var _=require(_0xba20('0xa'));var squel=require(_0xba20('0xb'));var crypto=require(_0xba20('0xc'));var jsforce=require(_0xba20('0xd'));var deskjs=require(_0xba20('0xe'));var toCsv=require(_0xba20('0x8'));var querystring=require(_0xba20('0xf'));var Papa=require(_0xba20('0x10'));var Redis=require(_0xba20('0x11'));var authService=require(_0xba20('0x12'));var qs=require(_0xba20('0x13'));var as=require(_0xba20('0x14'));var hardwareService=require(_0xba20('0x15'));var logger=require(_0xba20('0x16'))('api');var utils=require(_0xba20('0x17'));var config=require(_0xba20('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x113eb7,_0x5289c0){_0x5289c0=_0x5289c0||0xcc;return function(_0x395c5b){if(_0x395c5b){return _0x113eb7[_0xba20('0x19')](_0x5289c0);}return _0x113eb7[_0xba20('0x1a')](_0x5289c0)['end']();};}function respondWithResult(_0x5739c8,_0x528f0f){_0x528f0f=_0x528f0f||0xc8;return function(_0x1cc639){if(_0x1cc639){return _0x5739c8['status'](_0x528f0f)[_0xba20('0x1b')](_0x1cc639);}};}function respondWithFilteredResult(_0x3dac3d,_0x258997){return function(_0x3dcfb2){if(_0x3dcfb2){var _0x3e9acb=_0x3dcfb2[_0xba20('0x1c')],_0x4d39e5=_0x258997[_0xba20('0x1d')],_0xf763c2=_0x258997['offset']+_0x258997[_0xba20('0x1e')],_0x51a2d4;if(_0xf763c2>=_0x3e9acb){_0xf763c2=_0x3e9acb;_0x51a2d4=0xc8;}else{_0x51a2d4=0xce;}_0x3dac3d[_0xba20('0x1a')](_0x51a2d4);return _0x3dac3d[_0xba20('0x1f')]('Content-Range',_0x4d39e5+'-'+_0xf763c2+'/'+_0x3e9acb)[_0xba20('0x1b')](_0x3dcfb2);}return null;};}function patchUpdates(_0xdb7048){return function(_0x34e97f){try{jsonpatch[_0xba20('0x20')](_0x34e97f,_0xdb7048,!![]);}catch(_0x1fd324){return BPromise[_0xba20('0x21')](_0x1fd324);}return _0x34e97f[_0xba20('0x22')]();};}function saveUpdates(_0x2e405c,_0x32777c){return function(_0x564eb5){if(_0x564eb5){return _0x564eb5[_0xba20('0x23')](_0x2e405c)[_0xba20('0x24')](function(_0x4b3ec1){return _0x4b3ec1;});}return null;};}function removeEntity(_0x28a8d6,_0x23f1fe){return function(_0x471299){if(_0x471299){return _0x471299[_0xba20('0x25')]()[_0xba20('0x24')](function(){_0x28a8d6[_0xba20('0x1a')](0xcc)[_0xba20('0x26')]();});}};}function handleEntityNotFound(_0x56b20b,_0x472f6b){return function(_0xe3d0e1){if(!_0xe3d0e1){_0x56b20b[_0xba20('0x19')](0x194);}return _0xe3d0e1;};}function handleError(_0x16b632,_0x4f118e){_0x4f118e=_0x4f118e||0x1f4;return function(_0x18f076){logger[_0xba20('0x27')](_0x18f076[_0xba20('0x28')]);if(_0x18f076['name']){delete _0x18f076[_0xba20('0x29')];}_0x16b632[_0xba20('0x1a')](_0x4f118e)[_0xba20('0x2a')](_0x18f076);};}exports['index']=function(_0x42f266,_0x612346){var _0x217202={},_0x346d67={},_0xf181b9={'count':0x0,'rows':[]};var _0xc28f62=_[_0xba20('0x2b')](db[_0xba20('0x2c')][_0xba20('0x2d')],function(_0x32c433){return{'name':_0x32c433[_0xba20('0x2e')],'type':_0x32c433['type'][_0xba20('0x2f')]};});_0x346d67[_0xba20('0x30')]=_[_0xba20('0x2b')](_0xc28f62,'name');_0x346d67[_0xba20('0x31')]=_[_0xba20('0x32')](_0x42f266['query']);_0x346d67[_0xba20('0x33')]=_['intersection'](_0x346d67['model'],_0x346d67[_0xba20('0x31')]);_0x217202[_0xba20('0x34')]=_[_0xba20('0x35')](_0x346d67[_0xba20('0x30')],qs['fields'](_0x42f266[_0xba20('0x31')][_0xba20('0x36')]));_0x217202['attributes']=_0x217202[_0xba20('0x34')][_0xba20('0x37')]?_0x217202['attributes']:_0x346d67[_0xba20('0x30')];if(!_0x42f266['query']['hasOwnProperty'](_0xba20('0x38'))){_0x217202['limit']=qs[_0xba20('0x1e')](_0x42f266[_0xba20('0x31')]['limit']);_0x217202['offset']=qs[_0xba20('0x1d')](_0x42f266[_0xba20('0x31')]['offset']);}_0x217202[_0xba20('0x39')]=qs[_0xba20('0x3a')](_0x42f266[_0xba20('0x31')][_0xba20('0x3a')]);_0x217202[_0xba20('0x3b')]=qs[_0xba20('0x33')](_[_0xba20('0x3c')](_0x42f266['query'],_0x346d67[_0xba20('0x33')]));if(_0x42f266[_0xba20('0x31')][_0xba20('0x3d')]){_0x217202[_0xba20('0x3b')]=_['merge'](_0x217202[_0xba20('0x3b')],{'$or':_[_0xba20('0x2b')](_0xc28f62,function(_0xd89b6c){if(_0xd89b6c[_0xba20('0x3e')][_0xba20('0x2f')]!==_0xba20('0x3f')){var _0x115493={};_0x115493[_0xd89b6c[_0xba20('0x40')]]={'$like':'%'+_0x42f266[_0xba20('0x31')][_0xba20('0x3d')]+'%'};return _0x115493;}})});}_0x217202=_[_0xba20('0x41')]({},_0x217202,_0x42f266[_0xba20('0x42')]);var _0x241cd0={'where':_0x217202['where']};return db[_0xba20('0x2c')][_0xba20('0x1c')](_0x241cd0)['then'](function(_0x2ed3f5){_0xf181b9[_0xba20('0x1c')]=_0x2ed3f5;if(_0x42f266[_0xba20('0x31')][_0xba20('0x43')]){_0x217202[_0xba20('0x44')]=[{'all':!![]}];}return db[_0xba20('0x2c')][_0xba20('0x45')](_0x217202);})[_0xba20('0x24')](function(_0x5a0eac){_0xf181b9['rows']=_0x5a0eac;return _0xf181b9;})['then'](respondWithFilteredResult(_0x612346,_0x217202))[_0xba20('0x46')](handleError(_0x612346,null));};exports[_0xba20('0x47')]=function(_0x51747e,_0x1c89d2){var _0x44b950={'raw':!![],'where':{'id':_0x51747e[_0xba20('0x48')]['id']}},_0x3508d4={};_0x3508d4[_0xba20('0x30')]=_[_0xba20('0x32')](db['ChatTransferReport'][_0xba20('0x2d')]);_0x3508d4['query']=_['keys'](_0x51747e[_0xba20('0x31')]);_0x3508d4['filters']=_[_0xba20('0x35')](_0x3508d4[_0xba20('0x30')],_0x3508d4[_0xba20('0x31')]);_0x44b950[_0xba20('0x34')]=_[_0xba20('0x35')](_0x3508d4['model'],qs[_0xba20('0x36')](_0x51747e[_0xba20('0x31')]['fields']));_0x44b950['attributes']=_0x44b950[_0xba20('0x34')][_0xba20('0x37')]?_0x44b950[_0xba20('0x34')]:_0x3508d4[_0xba20('0x30')];if(_0x51747e['query'][_0xba20('0x43')]){_0x44b950[_0xba20('0x44')]=[{'all':!![]}];}_0x44b950=_[_0xba20('0x41')]({},_0x44b950,_0x51747e[_0xba20('0x42')]);return db[_0xba20('0x2c')][_0xba20('0x49')](_0x44b950)[_0xba20('0x24')](handleEntityNotFound(_0x1c89d2,null))['then'](respondWithResult(_0x1c89d2,null))[_0xba20('0x46')](handleError(_0x1c89d2,null));};exports['create']=function(_0x53dcf6,_0x56a054){return db[_0xba20('0x2c')][_0xba20('0x4a')](_0x53dcf6[_0xba20('0x4b')],{})['then'](respondWithResult(_0x56a054,0xc9))[_0xba20('0x46')](handleError(_0x56a054,null));};exports[_0xba20('0x23')]=function(_0x3a3771,_0x97df2e){if(_0x3a3771[_0xba20('0x4b')]['id']){delete _0x3a3771[_0xba20('0x4b')]['id'];}return db[_0xba20('0x2c')][_0xba20('0x49')]({'where':{'id':_0x3a3771[_0xba20('0x48')]['id']}})[_0xba20('0x24')](handleEntityNotFound(_0x97df2e,null))[_0xba20('0x24')](saveUpdates(_0x3a3771[_0xba20('0x4b')],null))['then'](respondWithResult(_0x97df2e,null))['catch'](handleError(_0x97df2e,null));};exports[_0xba20('0x25')]=function(_0x408572,_0x8e46ec){return db[_0xba20('0x2c')][_0xba20('0x49')]({'where':{'id':_0x408572[_0xba20('0x48')]['id']}})[_0xba20('0x24')](handleEntityNotFound(_0x8e46ec,null))[_0xba20('0x24')](removeEntity(_0x8e46ec,null))[_0xba20('0x46')](handleError(_0x8e46ec,null));};exports[_0xba20('0x4c')]=function(_0x4847c2,_0x533f1e){return db[_0xba20('0x2c')][_0xba20('0x4c')]()[_0xba20('0x24')](respondWithResult(_0x533f1e,null))['catch'](handleError(_0x533f1e,null));};
\ No newline at end of file
+var _0x513b=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','query','keys','filters','intersection','model','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','attributes','fields','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4404fa,_0x34f28f){var _0x45998f=function(_0x3607b7){while(--_0x3607b7){_0x4404fa['push'](_0x4404fa['shift']());}};_0x45998f(++_0x34f28f);}(_0x513b,0x86));var _0xb513=function(_0x4b06f7,_0x436bca){_0x4b06f7=_0x4b06f7-0x0;var _0x12af91=_0x513b[_0x4b06f7];return _0x12af91;};'use strict';var pdf=require(_0xb513('0x0'));var emlformat=require(_0xb513('0x1'));var rimraf=require(_0xb513('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb513('0x3'));var rp=require(_0xb513('0x4'));var moment=require(_0xb513('0x5'));var BPromise=require(_0xb513('0x6'));var Mustache=require(_0xb513('0x7'));var util=require('util');var path=require(_0xb513('0x8'));var sox=require(_0xb513('0x9'));var csv=require('to-csv');var ejs=require(_0xb513('0xa'));var fs=require('fs');var _=require(_0xb513('0xb'));var squel=require('squel');var crypto=require(_0xb513('0xc'));var jsforce=require(_0xb513('0xd'));var deskjs=require(_0xb513('0xe'));var toCsv=require(_0xb513('0xf'));var querystring=require(_0xb513('0x10'));var Papa=require('papaparse');var Redis=require(_0xb513('0x11'));var authService=require(_0xb513('0x12'));var qs=require(_0xb513('0x13'));var as=require(_0xb513('0x14'));var hardwareService=require(_0xb513('0x15'));var logger=require(_0xb513('0x16'))(_0xb513('0x17'));var utils=require(_0xb513('0x18'));var config=require(_0xb513('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d31a5,_0x598493){_0x598493=_0x598493||0xcc;return function(_0x3208ba){if(_0x3208ba){return _0x2d31a5[_0xb513('0x1a')](_0x598493);}return _0x2d31a5[_0xb513('0x1b')](_0x598493)['end']();};}function respondWithResult(_0x14f9c1,_0x2f4d89){_0x2f4d89=_0x2f4d89||0xc8;return function(_0x943d09){if(_0x943d09){return _0x14f9c1[_0xb513('0x1b')](_0x2f4d89)[_0xb513('0x1c')](_0x943d09);}};}function respondWithFilteredResult(_0x15e77f,_0xde231){return function(_0x4a0dd9){if(_0x4a0dd9){var _0x3d0033=_0x4a0dd9[_0xb513('0x1d')],_0x40d7f1=_0xde231[_0xb513('0x1e')],_0x257814=_0xde231[_0xb513('0x1e')]+_0xde231['limit'],_0x1935be;if(_0x257814>=_0x3d0033){_0x257814=_0x3d0033;_0x1935be=0xc8;}else{_0x1935be=0xce;}_0x15e77f['status'](_0x1935be);return _0x15e77f[_0xb513('0x1f')](_0xb513('0x20'),_0x40d7f1+'-'+_0x257814+'/'+_0x3d0033)[_0xb513('0x1c')](_0x4a0dd9);}return null;};}function patchUpdates(_0xb5ab35){return function(_0x2154a4){try{jsonpatch['apply'](_0x2154a4,_0xb5ab35,!![]);}catch(_0x3a3cb2){return BPromise[_0xb513('0x21')](_0x3a3cb2);}return _0x2154a4[_0xb513('0x22')]();};}function saveUpdates(_0x2f76e4,_0xd6044f){return function(_0x17fbc8){if(_0x17fbc8){return _0x17fbc8['update'](_0x2f76e4)[_0xb513('0x23')](function(_0x63d2){return _0x63d2;});}return null;};}function removeEntity(_0x290ec8,_0x3add47){return function(_0x2cef7c){if(_0x2cef7c){return _0x2cef7c[_0xb513('0x24')]()['then'](function(){_0x290ec8[_0xb513('0x1b')](0xcc)[_0xb513('0x25')]();});}};}function handleEntityNotFound(_0x4056f2,_0x261a42){return function(_0x32ed2a){if(!_0x32ed2a){_0x4056f2[_0xb513('0x1a')](0x194);}return _0x32ed2a;};}function handleError(_0x132e44,_0x362567){_0x362567=_0x362567||0x1f4;return function(_0x38c3ac){logger[_0xb513('0x26')](_0x38c3ac[_0xb513('0x27')]);if(_0x38c3ac[_0xb513('0x28')]){delete _0x38c3ac[_0xb513('0x28')];}_0x132e44[_0xb513('0x1b')](_0x362567)[_0xb513('0x29')](_0x38c3ac);};}exports[_0xb513('0x2a')]=function(_0x386014,_0x5314b3){var _0x2639b3={},_0x176845={},_0x163476={'count':0x0,'rows':[]};var _0x33acab=_[_0xb513('0x2b')](db[_0xb513('0x2c')][_0xb513('0x2d')],function(_0xaf9011){return{'name':_0xaf9011['fieldName'],'type':_0xaf9011[_0xb513('0x2e')]['key']};});_0x176845['model']=_[_0xb513('0x2b')](_0x33acab,_0xb513('0x28'));_0x176845[_0xb513('0x2f')]=_[_0xb513('0x30')](_0x386014[_0xb513('0x2f')]);_0x176845[_0xb513('0x31')]=_[_0xb513('0x32')](_0x176845[_0xb513('0x33')],_0x176845[_0xb513('0x2f')]);_0x2639b3['attributes']=_['intersection'](_0x176845[_0xb513('0x33')],qs['fields'](_0x386014[_0xb513('0x2f')]['fields']));_0x2639b3['attributes']=_0x2639b3['attributes'][_0xb513('0x34')]?_0x2639b3['attributes']:_0x176845[_0xb513('0x33')];if(!_0x386014[_0xb513('0x2f')][_0xb513('0x35')](_0xb513('0x36'))){_0x2639b3[_0xb513('0x37')]=qs[_0xb513('0x37')](_0x386014['query'][_0xb513('0x37')]);_0x2639b3[_0xb513('0x1e')]=qs[_0xb513('0x1e')](_0x386014[_0xb513('0x2f')]['offset']);}_0x2639b3['order']=qs[_0xb513('0x38')](_0x386014[_0xb513('0x2f')][_0xb513('0x38')]);_0x2639b3[_0xb513('0x39')]=qs[_0xb513('0x31')](_['pick'](_0x386014[_0xb513('0x2f')],_0x176845[_0xb513('0x31')]));if(_0x386014[_0xb513('0x2f')][_0xb513('0x3a')]){_0x2639b3['where']=_[_0xb513('0x3b')](_0x2639b3[_0xb513('0x39')],{'$or':_['map'](_0x33acab,function(_0xed8de6){if(_0xed8de6[_0xb513('0x2e')][_0xb513('0x3c')]!==_0xb513('0x3d')){var _0x21a66a={};_0x21a66a[_0xed8de6[_0xb513('0x3e')]]={'$like':'%'+_0x386014[_0xb513('0x2f')][_0xb513('0x3a')]+'%'};return _0x21a66a;}})});}_0x2639b3=_[_0xb513('0x3b')]({},_0x2639b3,_0x386014[_0xb513('0x3f')]);var _0x27e348={'where':_0x2639b3[_0xb513('0x39')]};return db[_0xb513('0x2c')][_0xb513('0x1d')](_0x27e348)[_0xb513('0x23')](function(_0x569664){_0x163476[_0xb513('0x1d')]=_0x569664;if(_0x386014[_0xb513('0x2f')][_0xb513('0x40')]){_0x2639b3[_0xb513('0x41')]=[{'all':!![]}];}return db[_0xb513('0x2c')][_0xb513('0x42')](_0x2639b3);})['then'](function(_0x30c5f5){_0x163476[_0xb513('0x43')]=_0x30c5f5;return _0x163476;})[_0xb513('0x23')](respondWithFilteredResult(_0x5314b3,_0x2639b3))[_0xb513('0x44')](handleError(_0x5314b3,null));};exports[_0xb513('0x45')]=function(_0x287ddf,_0x4aa17a){var _0x44acfc={'raw':!![],'where':{'id':_0x287ddf['params']['id']}},_0x1a475f={};_0x1a475f[_0xb513('0x33')]=_[_0xb513('0x30')](db[_0xb513('0x2c')][_0xb513('0x2d')]);_0x1a475f[_0xb513('0x2f')]=_[_0xb513('0x30')](_0x287ddf[_0xb513('0x2f')]);_0x1a475f['filters']=_[_0xb513('0x32')](_0x1a475f[_0xb513('0x33')],_0x1a475f[_0xb513('0x2f')]);_0x44acfc[_0xb513('0x46')]=_[_0xb513('0x32')](_0x1a475f['model'],qs[_0xb513('0x47')](_0x287ddf[_0xb513('0x2f')][_0xb513('0x47')]));_0x44acfc[_0xb513('0x46')]=_0x44acfc[_0xb513('0x46')][_0xb513('0x34')]?_0x44acfc[_0xb513('0x46')]:_0x1a475f[_0xb513('0x33')];if(_0x287ddf[_0xb513('0x2f')][_0xb513('0x40')]){_0x44acfc['include']=[{'all':!![]}];}_0x44acfc=_['merge']({},_0x44acfc,_0x287ddf[_0xb513('0x3f')]);return db[_0xb513('0x2c')][_0xb513('0x48')](_0x44acfc)[_0xb513('0x23')](handleEntityNotFound(_0x4aa17a,null))[_0xb513('0x23')](respondWithResult(_0x4aa17a,null))[_0xb513('0x44')](handleError(_0x4aa17a,null));};exports[_0xb513('0x49')]=function(_0x3fc9bc,_0x368089){return db[_0xb513('0x2c')][_0xb513('0x49')](_0x3fc9bc['body'],{})[_0xb513('0x23')](respondWithResult(_0x368089,0xc9))[_0xb513('0x44')](handleError(_0x368089,null));};exports[_0xb513('0x4a')]=function(_0xe03660,_0x4f8155){if(_0xe03660[_0xb513('0x4b')]['id']){delete _0xe03660[_0xb513('0x4b')]['id'];}return db[_0xb513('0x2c')][_0xb513('0x48')]({'where':{'id':_0xe03660['params']['id']}})[_0xb513('0x23')](handleEntityNotFound(_0x4f8155,null))[_0xb513('0x23')](saveUpdates(_0xe03660[_0xb513('0x4b')],null))[_0xb513('0x23')](respondWithResult(_0x4f8155,null))['catch'](handleError(_0x4f8155,null));};exports[_0xb513('0x24')]=function(_0x53eb6b,_0x230899){return db[_0xb513('0x2c')][_0xb513('0x48')]({'where':{'id':_0x53eb6b[_0xb513('0x4c')]['id']}})[_0xb513('0x23')](handleEntityNotFound(_0x230899,null))[_0xb513('0x23')](removeEntity(_0x230899,null))[_0xb513('0x44')](handleError(_0x230899,null));};exports[_0xb513('0x4d')]=function(_0x2259a8,_0x4366a6){return db[_0xb513('0x2c')][_0xb513('0x4d')]()[_0xb513('0x23')](respondWithResult(_0x4366a6,null))[_0xb513('0x44')](handleError(_0x4366a6,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 65f763f..fb01a71 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 _0x79d3=['rimraf','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x350465,_0x18ed5d){var _0x4ae53d=function(_0x28aa44){while(--_0x28aa44){_0x350465['push'](_0x350465['shift']());}};_0x4ae53d(++_0x18ed5d);}(_0x79d3,0x179));var _0x379d=function(_0x2512fd,_0x5f5bfd){_0x2512fd=_0x2512fd-0x0;var _0x576639=_0x79d3[_0x2512fd];return _0x576639;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var logger=require(_0x379d('0x2'))(_0x379d('0x3'));var moment=require(_0x379d('0x4'));var BPromise=require(_0x379d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x6'));var rimraf=require(_0x379d('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x379d('0x8')]=function(_0x18b0be,_0x2a0f02){return _0x18b0be[_0x379d('0x9')](_0x379d('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x379d('0xb'),'fields':[_0x379d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3472=['request-promise','rimraf','./chatTransferReport.attributes','exports','report_chat_transfer','util','../../config/logger','moment','bluebird'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x3472,0xf8));var _0x2347=function(_0x408d11,_0x5cb230){_0x408d11=_0x408d11-0x0;var _0x4fdcfb=_0x3472[_0x408d11];return _0x4fdcfb;};'use strict';var _=require('lodash');var util=require(_0x2347('0x0'));var logger=require(_0x2347('0x1'))('api');var moment=require(_0x2347('0x2'));var BPromise=require(_0x2347('0x3'));var rp=require(_0x2347('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2347('0x5'));var config=require('../../config/environment');var attributes=require(_0x2347('0x6'));module[_0x2347('0x7')]=function(_0x48c8ac,_0x6ded3){return _0x48c8ac['define']('ChatTransferReport',attributes,{'tableName':_0x2347('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 76d28c2..8e682bd 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 _0x8f9b=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','lodash','moment','randomstring'];(function(_0x497f4f,_0x3ec06c){var _0xa4ca29=function(_0x4671b9){while(--_0x4671b9){_0x497f4f['push'](_0x497f4f['shift']());}};_0xa4ca29(++_0x3ec06c);}(_0x8f9b,0x162));var _0xb8f9=function(_0x5a42a6,_0x4200fc){_0x5a42a6=_0x5a42a6-0x0;var _0x312e35=_0x8f9b[_0x5a42a6];return _0x312e35;};'use strict';var _=require(_0xb8f9('0x0'));var util=require('util');var moment=require(_0xb8f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb8f9('0x2'));var fs=require('fs');var Redis=require(_0xb8f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8f9('0x4'));var logger=require(_0xb8f9('0x5'))('rpc');var config=require(_0xb8f9('0x6'));var jayson=require(_0xb8f9('0x7'));var client=jayson[_0xb8f9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb06a9d,_0x394030,_0x4fc2ac){return new BPromise(function(_0x3d39fb,_0x45adee){return client[_0xb8f9('0x9')](_0xb06a9d,_0x4fc2ac)['then'](function(_0x1b99ab){logger[_0xb8f9('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x394030,_0xb8f9('0xb'));logger[_0xb8f9('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x394030,_0xb8f9('0xb'),JSON[_0xb8f9('0xd')](_0x1b99ab));if(_0x1b99ab[_0xb8f9('0xe')]){if(_0x1b99ab['error']['code']===0x1f4){logger[_0xb8f9('0xe')](_0xb8f9('0xf'),_0x394030,_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);return _0x45adee(_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x394030,_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);return _0x3d39fb(_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);}else{logger[_0xb8f9('0xa')](_0xb8f9('0xf'),_0x394030,_0xb8f9('0xb'));_0x3d39fb(_0x1b99ab['result'][_0xb8f9('0x10')]);}})['catch'](function(_0x33b44a){logger['error'](_0xb8f9('0xf'),_0x394030,_0x33b44a);_0x45adee(_0x33b44a);});});}
\ No newline at end of file
+var _0xf725=['ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x55170f,_0x3c410f){var _0x2e2ee2=function(_0x1d0c2d){while(--_0x1d0c2d){_0x55170f['push'](_0x55170f['shift']());}};_0x2e2ee2(++_0x3c410f);}(_0xf725,0x14f));var _0x5f72=function(_0x2206a4,_0x449449){_0x2206a4=_0x2206a4-0x0;var _0x15a531=_0xf725[_0x2206a4];return _0x15a531;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f72('0x7'))('rpc');var config=require(_0x5f72('0x8'));var jayson=require(_0x5f72('0x9'));var client=jayson[_0x5f72('0xa')][_0x5f72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x533059,_0x33e982,_0x4d73b3){return new BPromise(function(_0x1d2610,_0x2e0a4c){return client[_0x5f72('0xc')](_0x533059,_0x4d73b3)[_0x5f72('0xd')](function(_0x3b6569){logger[_0x5f72('0xe')](_0x5f72('0xf'),_0x33e982,'request\x20sent');logger[_0x5f72('0x10')](_0x5f72('0x11'),_0x33e982,'request\x20sent',JSON[_0x5f72('0x12')](_0x3b6569));if(_0x3b6569[_0x5f72('0x13')]){if(_0x3b6569[_0x5f72('0x13')][_0x5f72('0x14')]===0x1f4){logger[_0x5f72('0x13')](_0x5f72('0xf'),_0x33e982,_0x3b6569[_0x5f72('0x13')]['message']);return _0x2e0a4c(_0x3b6569[_0x5f72('0x13')][_0x5f72('0x15')]);}logger[_0x5f72('0x13')](_0x5f72('0xf'),_0x33e982,_0x3b6569[_0x5f72('0x13')]['message']);return _0x1d2610(_0x3b6569[_0x5f72('0x13')][_0x5f72('0x15')]);}else{logger[_0x5f72('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x33e982,_0x5f72('0x16'));_0x1d2610(_0x3b6569[_0x5f72('0x17')][_0x5f72('0x15')]);}})[_0x5f72('0x18')](function(_0x5e2490){logger[_0x5f72('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x33e982,_0x5e2490);_0x2e0a4c(_0x5e2490);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 6b3470e..d231041 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 _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xb10b,0x12a));var _0xbb10=function(_0x4bf3f9,_0x459195){_0x4bf3f9=_0x4bf3f9-0x0;var _0x7bd6fc=_0xb10b[_0x4bf3f9];return _0x7bd6fc;};'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 auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 4cfb67a..df82826 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 _0x609b=['rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','text','name','getDataValue','onlineForm','parse','setDataValue','input','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x609b,0x8b));var _0xb609=function(_0x14b688,_0x3a39e7){_0x14b688=_0x14b688-0x0;var _0x3d6c64=_0x609b[_0x14b688];return _0x3d6c64;};'use strict';var Sequelize=require(_0xb609('0x0'));var rs=require(_0xb609('0x1'));module[_0xb609('0x2')]={'name':{'type':Sequelize[_0xb609('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xb609('0x3')]},'mapKey':{'type':Sequelize[_0xb609('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x4')},'key':{'type':Sequelize[_0xb609('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb609('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb609('0x3')]},'animation':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb609('0xa')](_0xb609('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0xc')},'start_chat_button':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xf')},'download_transcript':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb609('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x13')},'noteTitle':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x14')},'placeholderMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x17')},'conditionAgreement':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb609('0xa')](_0xb609('0x18'),_0xb609('0x19')),'defaultValue':_0xb609('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xb609('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb609('0x11')],'defaultValue':function(){return JSON[_0xb609('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xb609('0x1b'),'required':!![]},'props':{'title':_0xb609('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb609('0x4'),'type':_0xb609('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb609('0x1d')](_0xb609('0x1e'))?JSON[_0xb609('0x1f')](this['getDataValue'](_0xb609('0x1e'))):{};},'set':function(_0xf1c6bb){return this[_0xb609('0x20')](_0xb609('0x1e'),JSON[_0xb609('0x1a')](_0xf1c6bb));}},'offlineForm':{'type':Sequelize[_0xb609('0x11')],'defaultValue':function(){return JSON[_0xb609('0x1a')]({'items':[{'type':_0xb609('0x21'),'props':{'title':_0xb609('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb609('0x4'),'type':_0xb609('0x4')},'variable':null},{'type':_0xb609('0x22'),'config':{'placeholder':_0xb609('0x23')},'props':{'title':_0xb609('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb609('0x1d')](_0xb609('0x24'))?JSON['parse'](this[_0xb609('0x1d')](_0xb609('0x24'))):{};},'set':function(_0x7ca5d1){return this[_0xb609('0x20')](_0xb609('0x24'),JSON[_0xb609('0x1a')](_0x7ca5d1));}},'token':{'type':Sequelize[_0xb609('0x3')],'defaultValue':function(){return rs[_0xb609('0x25')]();}},'autoclose':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb609('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb609('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x29')},'skipUnmanaged':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb609('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb609('0x11')],'defaultValue':function(){return _0xb609('0x2a');}},'notificationSound':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xb609('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xb609('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x2e')},'systemAvatar':{'type':Sequelize[_0xb609('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb609('0x8')],'comment':_0xb609('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![],'comment':_0xb609('0x30'),'set':function(_0x4c3baa){if(!_0x4c3baa)this[_0xb609('0x20')]('mandatoryDispositionPauseId',null);this[_0xb609('0x20')](_0xb609('0x31'),_0x4c3baa);}}};
\ No newline at end of file
+var _0x8ed3=['Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8ed3,0x18c));var _0x38ed=function(_0x1e9483,_0x1a4949){_0x1e9483=_0x1e9483-0x0;var _0x4b7e09=_0x8ed3[_0x1e9483];return _0x4b7e09;};'use strict';var Sequelize=require(_0x38ed('0x0'));var rs=require(_0x38ed('0x1'));module['exports']={'name':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x3')},'mapKeyOffline':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x3')},'key':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'defaultValue':_0x38ed('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'defaultValue':_0x38ed('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x38ed('0x2')]},'animation':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x38ed('0x9')](_0x38ed('0xa'),_0x38ed('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xc')},'start_chat_button':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0xe')},'header_offline':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xf')},'download_transcript':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x38ed('0x11')]},'closingQuestion':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x13')},'noteTitle':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x15')},'closingMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x16')},'closingMessageButton':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x17')},'conditionAgreement':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0x38ed('0x19'),_0x38ed('0x1a')),'defaultValue':_0x38ed('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x38ed('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x38ed('0x1b'),'helpText':''}},{'type':_0x38ed('0x1c'),'props':{'title':_0x38ed('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x38ed('0x1d')](_0x38ed('0x1e'))?JSON[_0x38ed('0x1f')](this[_0x38ed('0x1d')](_0x38ed('0x1e'))):{};},'set':function(_0x8ce0c3){return this[_0x38ed('0x20')](_0x38ed('0x1e'),JSON['stringify'](_0x8ce0c3));}},'offlineForm':{'type':Sequelize[_0x38ed('0x11')],'defaultValue':function(){return JSON[_0x38ed('0x21')]({'items':[{'type':_0x38ed('0x1c'),'props':{'title':_0x38ed('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x38ed('0x3')},'variable':null},{'type':_0x38ed('0x22'),'config':{'placeholder':_0x38ed('0x23')},'props':{'title':_0x38ed('0x23'),'helpText':_0x38ed('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x38ed('0x1d')](_0x38ed('0x25'))?JSON[_0x38ed('0x1f')](this[_0x38ed('0x1d')]('offlineForm')):{};},'set':function(_0x4cfea9){return this['setDataValue'](_0x38ed('0x25'),JSON['stringify'](_0x4cfea9));}},'token':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x26')},'waitingMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x27')},'offlineMessageBody':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x38ed('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x38ed('0x11')],'defaultValue':function(){return _0x38ed('0x29');}},'notificationSound':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x38ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x2a')},'verticalAlignment':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x2b')},'defaultTitle':{'type':Sequelize[_0x38ed('0x2')]},'customerAvatar':{'type':Sequelize[_0x38ed('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x38ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x38ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x2c')},'systemAvatar':{'type':Sequelize[_0x38ed('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38ed('0x7')],'comment':_0x38ed('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![],'comment':_0x38ed('0x2e'),'set':function(_0x2969f1){if(!_0x2969f1)this[_0x38ed('0x20')](_0x38ed('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x2969f1);}}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1376064..b425523 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 _0xc5b3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','existsSync','notify','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','list','orderBy','priority','asc','Applications','contact','customerIp','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','startRouting','Start','EventManager','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','alignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','test','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','find','create','body','get'];(function(_0x478caa,_0x18fa89){var _0x3cd54e=function(_0x2387fe){while(--_0x2387fe){_0x478caa['push'](_0x478caa['shift']());}};_0x3cd54e(++_0x18fa89);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0xc5b3[_0x4cb095];return _0x2b565d;};'use strict';var pdf=require(_0x3c5b('0x0'));var emlformat=require(_0x3c5b('0x1'));var rimraf=require(_0x3c5b('0x2'));var zipdir=require(_0x3c5b('0x3'));var jsonpatch=require(_0x3c5b('0x4'));var rp=require(_0x3c5b('0x5'));var moment=require(_0x3c5b('0x6'));var BPromise=require(_0x3c5b('0x7'));var Mustache=require('mustache');var util=require(_0x3c5b('0x8'));var path=require(_0x3c5b('0x9'));var sox=require('sox');var csv=require(_0x3c5b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c5b('0xb'));var squel=require(_0x3c5b('0xc'));var crypto=require(_0x3c5b('0xd'));var jsforce=require(_0x3c5b('0xe'));var deskjs=require(_0x3c5b('0xf'));var toCsv=require(_0x3c5b('0xa'));var querystring=require(_0x3c5b('0x10'));var Papa=require('papaparse');var Redis=require(_0x3c5b('0x11'));var authService=require(_0x3c5b('0x12'));var qs=require(_0x3c5b('0x13'));var as=require(_0x3c5b('0x14'));var hardwareService=require(_0x3c5b('0x15'));var logger=require('../../config/logger')(_0x3c5b('0x16'));var utils=require(_0x3c5b('0x17'));var config=require(_0x3c5b('0x18'));var db=require(_0x3c5b('0x19'))['db'];config[_0x3c5b('0x1a')]=_[_0x3c5b('0x1b')](config[_0x3c5b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c5b('0x1c'))(new Redis(config[_0x3c5b('0x1a')]));require(_0x3c5b('0x1d'))[_0x3c5b('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3c5b('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x3c5b('0x1f')][_0x3c5b('0x20')]({'port':0x232a});var client9003=jayson['client'][_0x3c5b('0x20')]({'port':0x232b});function checkPasswordPattern(_0x88069a,_0x5d64cb,_0x32c58e){if(_0x32c58e){var _0x1cbe52=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cbe52[_0x3c5b('0x21')](_0x5d64cb)){return _0x88069a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x88069a;}}function respondWithRpcPromise(_0x825859,_0x4945ad,_0x40fe47,_0x3cec41){return new BPromise(function(_0x413266,_0x2189ce){var _0x37dfb0=_0x3cec41||client;return _0x37dfb0[_0x3c5b('0x22')](_0x825859,_0x40fe47)['then'](function(_0x4a76d5){logger[_0x3c5b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x4945ad,_0x3c5b('0x24'));logger[_0x3c5b('0x25')](_0x3c5b('0x26'),_0x4945ad,'request\x20sent',JSON[_0x3c5b('0x27')](_0x4a76d5));if(_0x4a76d5['error']){if(_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x29')]===0x1f4){logger[_0x3c5b('0x28')](_0x3c5b('0x2a'),_0x4945ad,_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x2b')]);return _0x2189ce(_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x2b')]);}logger['error'](_0x3c5b('0x2a'),_0x4945ad,_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x2b')]);return _0x413266(_0x4a76d5['error'][_0x3c5b('0x2b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4945ad,'request\x20sent');_0x413266(_0x4a76d5['result'][_0x3c5b('0x2b')]);}})[_0x3c5b('0x2c')](function(_0x1572d4){logger['error'](_0x3c5b('0x2a'),_0x4945ad,_0x1572d4);_0x2189ce(_0x1572d4);});});}function respondWithStatusCode(_0x5c7fc2,_0x3548e9){_0x3548e9=_0x3548e9||0xcc;return function(_0xdffcbd){if(_0xdffcbd){return _0x5c7fc2[_0x3c5b('0x2d')](_0x3548e9);}return _0x5c7fc2[_0x3c5b('0x2e')](_0x3548e9)[_0x3c5b('0x2f')]();};}function respondWithResult(_0x42c5e1,_0x37cd2f){_0x37cd2f=_0x37cd2f||0xc8;return function(_0x2764b6){if(_0x2764b6){return _0x42c5e1[_0x3c5b('0x2e')](_0x37cd2f)['json'](_0x2764b6);}};}function respondWithFilteredResult(_0x173cd1,_0x217022){return function(_0x42f017){if(_0x42f017){var _0x410ebf=_0x42f017[_0x3c5b('0x30')],_0x36c4ba=_0x217022['offset'],_0x1c686a=_0x217022['offset']+_0x217022[_0x3c5b('0x31')],_0x2e730b;if(_0x1c686a>=_0x410ebf){_0x1c686a=_0x410ebf;_0x2e730b=0xc8;}else{_0x2e730b=0xce;}_0x173cd1[_0x3c5b('0x2e')](_0x2e730b);return _0x173cd1['set'](_0x3c5b('0x32'),_0x36c4ba+'-'+_0x1c686a+'/'+_0x410ebf)[_0x3c5b('0x33')](_0x42f017);}return null;};}function patchUpdates(_0x52a50b){return function(_0x1ba178){try{jsonpatch[_0x3c5b('0x34')](_0x1ba178,_0x52a50b,!![]);}catch(_0x539da6){return BPromise[_0x3c5b('0x35')](_0x539da6);}return _0x1ba178[_0x3c5b('0x36')]();};}function saveUpdates(_0x388acd,_0x3031d5){return function(_0x16aa9c){if(_0x16aa9c){return _0x16aa9c[_0x3c5b('0x37')](_0x388acd)[_0x3c5b('0x38')](function(_0x3029b0){return _0x3029b0;});}return null;};}function removeEntity(_0x382908,_0x31a33c){return function(_0x4cd37a){if(_0x4cd37a){return _0x4cd37a[_0x3c5b('0x39')]()[_0x3c5b('0x38')](function(){var _0x34ebdf=_0x4cd37a['get']({'plain':!![]});var _0x3d9afc=_0x3c5b('0x3a');return db[_0x3c5b('0x3b')]['destroy']({'where':{'type':_0x3d9afc,'resourceId':_0x34ebdf['id']}})['then'](function(){return _0x4cd37a;});})[_0x3c5b('0x38')](function(){_0x382908['status'](0xcc)[_0x3c5b('0x2f')]();});}};}function handleEntityNotFound(_0x5a468,_0x217c39){return function(_0x2f6aba){if(!_0x2f6aba){_0x5a468[_0x3c5b('0x2d')](0x194);}return _0x2f6aba;};}function handleError(_0x31f0dd,_0x24886d){_0x24886d=_0x24886d||0x1f4;return function(_0x5c2674){logger['error'](_0x5c2674[_0x3c5b('0x3c')]);if(_0x5c2674[_0x3c5b('0x3d')]){delete _0x5c2674['name'];}_0x31f0dd[_0x3c5b('0x2e')](_0x24886d)[_0x3c5b('0x3e')](_0x5c2674);};}exports[_0x3c5b('0x3f')]=function(_0x4693c1,_0x4e0948){var _0x1e494d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3e5b7={},_0x39e1cf={'count':0x0,'rows':[]};var _0x401deb=_[_0x3c5b('0x40')](db[_0x3c5b('0x41')][_0x3c5b('0x42')],function(_0x1175d7){return{'name':_0x1175d7[_0x3c5b('0x43')],'type':_0x1175d7['type']['key']};});_0x3e5b7['model']=_[_0x3c5b('0x40')](_0x401deb,_0x3c5b('0x3d'));_0x3e5b7[_0x3c5b('0x44')]=_['keys'](_0x4693c1['query']);_0x3e5b7[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x3e5b7['model'],_0x3e5b7[_0x3c5b('0x44')]);_0x1e494d['attributes']=_['intersection'](_0x3e5b7[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x1e494d[_0x3c5b('0x49')]=_0x1e494d[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x1e494d[_0x3c5b('0x49')]:_0x3e5b7[_0x3c5b('0x47')];if(!_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x4b')]('nolimit')){_0x1e494d[_0x3c5b('0x31')]=qs['limit'](_0x4693c1[_0x3c5b('0x44')]['limit']);_0x1e494d[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x1e494d[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x1e494d['where']=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x4693c1[_0x3c5b('0x44')],_0x3e5b7[_0x3c5b('0x45')]));if(_0x4693c1['query'][_0x3c5b('0x50')]){_0x1e494d[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x1e494d[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x401deb,function(_0x38bcb0){if(_0x38bcb0[_0x3c5b('0x53')][_0x3c5b('0x54')]!==_0x3c5b('0x55')){var _0x264ef9={};_0x264ef9[_0x38bcb0[_0x3c5b('0x56')]]={'$like':'%'+_0x4693c1[_0x3c5b('0x44')]['filter']+'%'};return _0x264ef9;}})});}_0x1e494d=_['merge']({},_0x1e494d,_0x4693c1[_0x3c5b('0x57')]);var _0x19a129={'where':_0x1e494d[_0x3c5b('0x51')]};return db['ChatWebsite'][_0x3c5b('0x30')](_0x19a129)['then'](function(_0x9c0d0b){_0x39e1cf[_0x3c5b('0x30')]=_0x9c0d0b;if(_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x1e494d[_0x3c5b('0x59')]=[{'all':!![]}];}return db[_0x3c5b('0x41')][_0x3c5b('0x5a')](_0x1e494d);})[_0x3c5b('0x38')](function(_0x337e6d){_0x39e1cf[_0x3c5b('0x5b')]=_0x337e6d;return _0x39e1cf;})[_0x3c5b('0x38')](respondWithFilteredResult(_0x4e0948,_0x1e494d))[_0x3c5b('0x2c')](handleError(_0x4e0948,null));};exports[_0x3c5b('0x5c')]=function(_0x829e00,_0x3ac181){var _0x3033e3={'raw':![],'where':{'id':_0x829e00[_0x3c5b('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x3c5b('0x5e')}]},_0x4f812f={};_0x4f812f[_0x3c5b('0x47')]=_['keys'](db[_0x3c5b('0x41')]['rawAttributes']);_0x4f812f[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x829e00['query']);_0x4f812f[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x4f812f['model'],_0x4f812f[_0x3c5b('0x44')]);_0x3033e3[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x4f812f[_0x3c5b('0x47')],qs['fields'](_0x829e00[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x3033e3[_0x3c5b('0x49')]=_0x3033e3[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x3033e3[_0x3c5b('0x49')]:_0x4f812f[_0x3c5b('0x47')];if(_0x829e00[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x3033e3[_0x3c5b('0x59')]=[{'all':!![]}];}_0x3033e3=_['merge']({},_0x3033e3,_0x829e00[_0x3c5b('0x57')]);return db[_0x3c5b('0x41')][_0x3c5b('0x60')](_0x3033e3)[_0x3c5b('0x38')](handleEntityNotFound(_0x3ac181,null))['then'](respondWithResult(_0x3ac181,null))[_0x3c5b('0x2c')](handleError(_0x3ac181,null));};exports[_0x3c5b('0x61')]=function(_0x37aadb,_0xd89df4){return db[_0x3c5b('0x41')][_0x3c5b('0x61')](_0x37aadb[_0x3c5b('0x62')],{})[_0x3c5b('0x38')](function(_0x2bbafe){var _0x5454a9=_0x37aadb['user'][_0x3c5b('0x63')]({'plain':!![]});if(!_0x5454a9)throw new Error(_0x3c5b('0x64'));if(_0x5454a9[_0x3c5b('0x65')]===_0x3c5b('0x66')){var _0x172a2e=_0x2bbafe[_0x3c5b('0x63')]({'plain':!![]});var _0x42d7df=_0x3c5b('0x3a');return db[_0x3c5b('0x67')]['find']({'where':{'name':_0x42d7df,'userProfileId':_0x5454a9[_0x3c5b('0x68')]},'raw':!![]})[_0x3c5b('0x38')](function(_0x50fba1){if(_0x50fba1&&_0x50fba1['autoAssociation']===0x0){return db[_0x3c5b('0x3b')][_0x3c5b('0x61')]({'name':_0x172a2e['name'],'resourceId':_0x172a2e['id'],'type':_0x50fba1[_0x3c5b('0x3d')],'sectionId':_0x50fba1['id']},{})[_0x3c5b('0x38')](function(){return _0x2bbafe;});}else{return _0x2bbafe;}})[_0x3c5b('0x2c')](function(_0x560c77){logger[_0x3c5b('0x28')](_0x3c5b('0x69'),_0x560c77);throw _0x560c77;});}return _0x2bbafe;})[_0x3c5b('0x38')](respondWithResult(_0xd89df4,0xc9))['catch'](handleError(_0xd89df4,null));};exports[_0x3c5b('0x37')]=function(_0x2a83aa,_0x347114){if(_0x2a83aa[_0x3c5b('0x62')]['id']){delete _0x2a83aa[_0x3c5b('0x62')]['id'];}return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x2a83aa['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3c5b('0x38')](handleEntityNotFound(_0x347114,null))[_0x3c5b('0x38')](saveUpdates(_0x2a83aa[_0x3c5b('0x62')],null))['then'](respondWithResult(_0x347114,null))['catch'](handleError(_0x347114,null));};exports[_0x3c5b('0x39')]=function(_0x77ea7a,_0xefeb61){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x77ea7a['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0xefeb61,null))[_0x3c5b('0x38')](removeEntity(_0xefeb61,null))[_0x3c5b('0x2c')](handleError(_0xefeb61,null));};exports[_0x3c5b('0x6a')]=function(_0x35b590,_0x10f79b){return db[_0x3c5b('0x41')][_0x3c5b('0x6a')]()[_0x3c5b('0x38')](respondWithResult(_0x10f79b,null))[_0x3c5b('0x2c')](handleError(_0x10f79b,null));};exports['addDisposition']=function(_0x1cea04,_0x16694a,_0x5980e6){if(_0x1cea04['body']['id']){delete _0x1cea04[_0x3c5b('0x62')]['id'];}return db[_0x3c5b('0x41')]['find']({'where':{'id':_0x1cea04['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x16694a,null))['then'](function(_0x2240e5){if(_0x2240e5){_0x1cea04['body'][_0x3c5b('0x6b')]=_0x2240e5['id'];return db[_0x3c5b('0x6c')]['create'](_0x1cea04[_0x3c5b('0x62')]);}})[_0x3c5b('0x38')](respondWithResult(_0x16694a,null))[_0x3c5b('0x2c')](handleError(_0x16694a,null));};exports[_0x3c5b('0x6d')]=function(_0x3fb875,_0x3ca60c,_0x271fba){var _0x5d67cc={'raw':![],'where':{}};var _0x17c76c={};var _0x29c572={'count':0x0,'rows':[]};return db[_0x3c5b('0x41')]['findOne']({'where':{'id':_0x3fb875['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x3ca60c,null))[_0x3c5b('0x38')](function(_0x3311d3){if(_0x3311d3){_0x17c76c[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db['Disposition'][_0x3c5b('0x42')]);_0x17c76c[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x3fb875[_0x3c5b('0x44')]);_0x17c76c[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x17c76c[_0x3c5b('0x47')],_0x17c76c[_0x3c5b('0x44')]);_0x5d67cc[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x17c76c[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x3fb875['query'][_0x3c5b('0x48')]));_0x5d67cc[_0x3c5b('0x49')]=_0x5d67cc[_0x3c5b('0x49')]['length']?_0x5d67cc[_0x3c5b('0x49')]:_0x17c76c[_0x3c5b('0x47')];if(!_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x4b')]('nolimit')){_0x5d67cc[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x3fb875[_0x3c5b('0x44')]['limit']);_0x5d67cc[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x5d67cc[_0x3c5b('0x4d')]=qs['sort'](_0x3fb875['query'][_0x3c5b('0x4e')]);_0x5d67cc[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x3fb875[_0x3c5b('0x44')],_0x17c76c[_0x3c5b('0x45')]));_0x5d67cc[_0x3c5b('0x51')]['ChatWebsiteId']=_0x3311d3['id'];if(_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x5d67cc[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x5d67cc[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x5d67cc[_0x3c5b('0x49')],function(_0x3923d8){var _0x111833={};_0x111833[_0x3923d8]={'$like':'%'+_0x3fb875[_0x3c5b('0x44')]['filter']+'%'};return _0x111833;})});}_0x5d67cc=_[_0x3c5b('0x52')]({},_0x5d67cc,_0x3fb875[_0x3c5b('0x57')]);return db[_0x3c5b('0x6c')][_0x3c5b('0x30')]({'where':_0x5d67cc[_0x3c5b('0x51')]})['then'](function(_0x1a8370){_0x29c572[_0x3c5b('0x30')]=_0x1a8370;if(_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x5d67cc[_0x3c5b('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5d67cc);})[_0x3c5b('0x38')](function(_0x26b8b4){_0x29c572[_0x3c5b('0x5b')]=_0x26b8b4;return _0x29c572;});}})[_0x3c5b('0x38')](respondWithFilteredResult(_0x3ca60c,_0x5d67cc))[_0x3c5b('0x2c')](handleError(_0x3ca60c,null));};exports[_0x3c5b('0x6e')]=function(_0x5d18b4,_0x4157c8,_0x5939eb){return db['ChatWebsite'][_0x3c5b('0x60')]({'where':{'id':_0x5d18b4['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x4157c8,null))['then'](function(_0xfae598){if(_0xfae598){return _0xfae598['removeDispositions'](_0x5d18b4[_0x3c5b('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x4157c8,null))[_0x3c5b('0x2c')](handleError(_0x4157c8,null));};exports[_0x3c5b('0x6f')]=function(_0x5ced7f,_0x203cc9,_0x13581b){if(_0x5ced7f[_0x3c5b('0x62')]['id']){delete _0x5ced7f['body']['id'];}return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x5ced7f[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x203cc9,null))[_0x3c5b('0x38')](function(_0x1fd7f9){if(_0x1fd7f9){_0x5ced7f[_0x3c5b('0x62')][_0x3c5b('0x6b')]=_0x1fd7f9['id'];return db[_0x3c5b('0x70')][_0x3c5b('0x61')](_0x5ced7f['body']);}})[_0x3c5b('0x38')](respondWithResult(_0x203cc9,null))[_0x3c5b('0x2c')](handleError(_0x203cc9,null));};exports[_0x3c5b('0x71')]=function(_0x2660c6,_0x5312d0,_0x4a59c7){var _0x489849={'raw':![],'where':{}};var _0x19b40f={};var _0x177703={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3c5b('0x72')]({'where':{'id':_0x2660c6[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x5312d0,null))[_0x3c5b('0x38')](function(_0x3c5ed5){if(_0x3c5ed5){_0x19b40f[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db['CannedAnswer'][_0x3c5b('0x42')]);_0x19b40f[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x2660c6['query']);_0x19b40f['filters']=_[_0x3c5b('0x46')](_0x19b40f[_0x3c5b('0x47')],_0x19b40f['query']);_0x489849['attributes']=_[_0x3c5b('0x46')](_0x19b40f['model'],qs[_0x3c5b('0x48')](_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x489849[_0x3c5b('0x49')]=_0x489849[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x489849['attributes']:_0x19b40f['model'];if(!_0x2660c6['query'][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x489849[_0x3c5b('0x31')]=qs['limit'](_0x2660c6[_0x3c5b('0x44')]['limit']);_0x489849['offset']=qs[_0x3c5b('0x4c')](_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x489849[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x2660c6[_0x3c5b('0x44')]['sort']);_0x489849[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x2660c6[_0x3c5b('0x44')],_0x19b40f[_0x3c5b('0x45')]));_0x489849[_0x3c5b('0x51')]['ChatWebsiteId']=_0x3c5ed5['id'];if(_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x489849[_0x3c5b('0x51')]=_['merge'](_0x489849['where'],{'$or':_['map'](_0x489849[_0x3c5b('0x49')],function(_0x1b424d){var _0x3b5522={};_0x3b5522[_0x1b424d]={'$like':'%'+_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x50')]+'%'};return _0x3b5522;})});}_0x489849=_[_0x3c5b('0x52')]({},_0x489849,_0x2660c6['options']);return db[_0x3c5b('0x70')][_0x3c5b('0x30')]({'where':_0x489849[_0x3c5b('0x51')]})[_0x3c5b('0x38')](function(_0x158b5e){_0x177703[_0x3c5b('0x30')]=_0x158b5e;if(_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x489849['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x3c5b('0x5a')](_0x489849);})['then'](function(_0x1c9238){_0x177703[_0x3c5b('0x5b')]=_0x1c9238;return _0x177703;});}})['then'](respondWithFilteredResult(_0x5312d0,_0x489849))[_0x3c5b('0x2c')](handleError(_0x5312d0,null));};exports[_0x3c5b('0x74')]=function(_0x280883,_0x25c3a0,_0x4cd353){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x280883['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x25c3a0,null))[_0x3c5b('0x38')](function(_0x17afa3){if(_0x17afa3){return _0x17afa3['removeAnswers'](_0x280883[_0x3c5b('0x44')][_0x3c5b('0x75')]);}})[_0x3c5b('0x38')](respondWithStatusCode(_0x25c3a0,null))[_0x3c5b('0x2c')](handleError(_0x25c3a0,null));};exports[_0x3c5b('0x76')]=function(_0x5a239,_0x1cf699,_0x4c660d){_0x5a239[_0x3c5b('0x62')]['sitepic']=_0x5a239[_0x3c5b('0x77')][_0x3c5b('0x78')];return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x5a239[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x1cf699,null))[_0x3c5b('0x38')](saveUpdates(_0x5a239[_0x3c5b('0x62')],null))['then'](respondWithResult(_0x1cf699,null))[_0x3c5b('0x2c')](handleError(_0x1cf699,null));};exports[_0x3c5b('0x79')]=function(_0x29f1fb,_0xe96c4,_0x37c672){_0x29f1fb[_0x3c5b('0x62')][_0x3c5b('0x7a')]=_0x29f1fb['file'][_0x3c5b('0x78')];return db['ChatWebsite'][_0x3c5b('0x60')]({'where':{'id':_0x29f1fb[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0xe96c4,null))[_0x3c5b('0x38')](saveUpdates(_0x29f1fb[_0x3c5b('0x62')],null))[_0x3c5b('0x38')](respondWithResult(_0xe96c4,null))[_0x3c5b('0x2c')](handleError(_0xe96c4,null));};exports[_0x3c5b('0x7b')]=function(_0x37a1b8,_0x4537d4,_0x18bb13){_0x37a1b8[_0x3c5b('0x62')][_0x3c5b('0x7c')]=_0x37a1b8[_0x3c5b('0x77')][_0x3c5b('0x78')];return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x37a1b8[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x4537d4,null))[_0x3c5b('0x38')](saveUpdates(_0x37a1b8[_0x3c5b('0x62')],null))[_0x3c5b('0x38')](respondWithResult(_0x4537d4,null))['catch'](handleError(_0x4537d4,null));};exports['addSystemAvatar']=function(_0x301b5f,_0x50f787,_0x1fad2d){_0x301b5f['body'][_0x3c5b('0x7d')]=_0x301b5f[_0x3c5b('0x77')][_0x3c5b('0x78')];return db[_0x3c5b('0x41')]['find']({'where':{'id':_0x301b5f[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x50f787,null))[_0x3c5b('0x38')](saveUpdates(_0x301b5f[_0x3c5b('0x62')],null))[_0x3c5b('0x38')](respondWithResult(_0x50f787,null))['catch'](handleError(_0x50f787,null));};exports[_0x3c5b('0x7e')]=function(_0x12ec7e,_0x48dda6,_0x41802d){var _0x14f335=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x81'));var _0x7280c9={'where':{'id':_0x12ec7e['params']['id']},'attributes':['id',_0x3c5b('0x82')],'raw':!![]};var _0x7086c2=![];return require('../../config/license/util')['getLicense']()[_0x3c5b('0x38')](function(_0x2c14ac){if(_0x2c14ac){_0x7086c2=_0x2c14ac[_0x3c5b('0x83')];}})[_0x3c5b('0x38')](function(){return db[_0x3c5b('0x41')][_0x3c5b('0x60')](_0x7280c9);})[_0x3c5b('0x38')](handleEntityNotFound(_0x48dda6,null))['then'](function(_0x347ba6){if(_0x347ba6){if(!_[_0x3c5b('0x84')](_0x347ba6[_0x3c5b('0x82')])){if(fs['existsSync'](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],'server/files/images/logos/',_0x347ba6['sitepic']))&&_0x7086c2){_0x14f335=path[_0x3c5b('0x7f')](config['root'],_0x3c5b('0x85'),_0x347ba6['sitepic']);}}return _0x48dda6[_0x3c5b('0x86')](_0x14f335);}})[_0x3c5b('0x2c')](handleError(_0x48dda6,null));};exports['getAvatar']=function(_0xb3bf88,_0x218fcf,_0x546f3e){var _0x1da1d9=path[_0x3c5b('0x7f')](config['root'],_0x3c5b('0x87'));var _0x2a205d={'where':{'id':_0xb3bf88['params']['id']},'attributes':['id',_0x3c5b('0x7a')],'raw':!![]};return db['ChatWebsite'][_0x3c5b('0x60')](_0x2a205d)[_0x3c5b('0x38')](handleEntityNotFound(_0x218fcf,null))[_0x3c5b('0x38')](function(_0x50436d){if(_0x50436d){if(!_[_0x3c5b('0x84')](_0x50436d['agentAvatar'])){if(fs['existsSync'](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x50436d[_0x3c5b('0x7a')]))){_0x1da1d9=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x50436d['agentAvatar']);}}return _0x218fcf[_0x3c5b('0x86')](_0x1da1d9);}})[_0x3c5b('0x2c')](handleError(_0x218fcf,null));};exports['getCustomerAvatar']=function(_0x52b09d,_0x108022,_0x438897){var _0x54e6c0=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x89'));var _0x5501df={'where':{'id':_0x52b09d[_0x3c5b('0x5d')]['id']},'attributes':['id',_0x3c5b('0x7c'),_0x3c5b('0x8a')],'raw':!![]};return db['ChatWebsite']['find'](_0x5501df)[_0x3c5b('0x38')](handleEntityNotFound(_0x108022,null))[_0x3c5b('0x38')](function(_0x119793){if(_0x119793){if(!_[_0x3c5b('0x84')](_0x119793['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x3c5b('0x80')],'server/files/images/avatars/',_0x119793['customerAvatar']))&&_0x119793[_0x3c5b('0x8a')]){_0x54e6c0=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x119793['customerAvatar']);}}return _0x108022[_0x3c5b('0x86')](_0x54e6c0);}})['catch'](handleError(_0x108022,null));};exports[_0x3c5b('0x8b')]=function(_0x4db89f,_0x30815c,_0x341314){var _0x1b94e2=path[_0x3c5b('0x7f')](config['root'],_0x3c5b('0x8c'));var _0x510e14={'where':{'id':_0x4db89f[_0x3c5b('0x5d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3c5b('0x41')][_0x3c5b('0x60')](_0x510e14)[_0x3c5b('0x38')](handleEntityNotFound(_0x30815c,null))[_0x3c5b('0x38')](function(_0x108209){if(_0x108209){if(!_['isNil'](_0x108209['systemAvatar'])){if(fs[_0x3c5b('0x8d')](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x108209[_0x3c5b('0x7d')]))){_0x1b94e2=path['join'](config['root'],_0x3c5b('0x88'),_0x108209[_0x3c5b('0x7d')]);}}return _0x30815c['download'](_0x1b94e2);}})[_0x3c5b('0x2c')](handleError(_0x30815c,null));};exports[_0x3c5b('0x8e')]=function(_0x2919a4,_0x43ed19,_0x4a221b){var _0x50c624=require('user-agent-parser');var _0x3634a2=new _0x50c624();var _0xe65b8b=_0x3634a2['setUA'](_0x2919a4[_0x3c5b('0x8f')]['user-agent'])[_0x3c5b('0x90')]();var _0x4f6554={'body':_0x2919a4['body'],'channel':_0x3c5b('0x91')};var _0x2eed20=[];var _0xb4f635=[];var _0x901a10={};var _0x1981d6=![];return db[_0x3c5b('0x92')][_0x3c5b('0x6a')]()['then'](function(_0x1bf079){if(!_0x1bf079){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x95'));}_0x2eed20=_['difference'](_[_0x3c5b('0x5f')](_0x1bf079),[_0x3c5b('0x96'),_0x3c5b('0x97')]);_0xb4f635=_[_0x3c5b('0x98')](_['keys'](_0x1bf079),[_0x3c5b('0x96'),_0x3c5b('0x97'),_0x3c5b('0x99'),_0x3c5b('0x9a')]);if(_0x2919a4[_0x3c5b('0x62')]['id']){delete _0x2919a4[_0x3c5b('0x62')]['id'];}if(_['isNil'](_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9b')])){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x9c'));}if(_['isNil'](_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x62')])||_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x62')]===''){throw new db['Sequelize'][(_0x3c5b('0x94'))](_0x3c5b('0x9d'));}if(_[_0x3c5b('0x84')](_0x2919a4['body'][_0x3c5b('0x9e')])){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x9f')+_0xb4f635);}if(!_[_0x3c5b('0xa0')](_0xb4f635,_0x2919a4[_0x3c5b('0x62')]['mapKey'])){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0xa1')+_0xb4f635);}_0x901a10[_0x2919a4['body'][_0x3c5b('0x9e')]]=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9b')];})[_0x3c5b('0x38')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x2919a4[_0x3c5b('0x5d')]['id']},'include':[{'model':db[_0x3c5b('0xa2')],'as':_0x3c5b('0xa3'),'include':[{'model':db['CmContact'],'as':_0x3c5b('0xa4'),'where':_0x901a10,'limit':0x1,'order':[[_0x3c5b('0x97'),_0x3c5b('0xa5')]]}]},{'model':db[_0x3c5b('0xa6')],'as':'Applications'}]});})[_0x3c5b('0x38')](handleEntityNotFound(_0x43ed19,null))[_0x3c5b('0x38')](function(_0x5260c9){if(_0x5260c9&&_0x5260c9[_0x3c5b('0xa3')]){_0x4f6554[_0x3c5b('0xa7')]=_0x5260c9;_0x4f6554[_0x3c5b('0xa8')]=_0x5260c9['Applications'];_0x4f6554[_0x3c5b('0xa9')]=_0x5260c9['List'];_0x4f6554[_0x3c5b('0xa8')]=_[_0x3c5b('0xaa')](_0x4f6554[_0x3c5b('0xa8')],[_0x3c5b('0xab')],[_0x3c5b('0xac')]);if(_0x4f6554[_0x3c5b('0xa7')]['Applications']){delete _0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xad')];}if(_0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xa3')]&&_0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xa3')][_0x3c5b('0xa4')]['length']){return _0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xa3')]['Contacts'][0x0];}var _0x2416ea=_[_0x3c5b('0x1b')](_0x2919a4['body'],{'firstName':_0x2919a4['body'][_0x3c5b('0x9b')],'ListId':_0x5260c9['ListId']});_0x2416ea[_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9e')]]=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9b')];return db['CmContact'][_0x3c5b('0x61')](_0x2416ea,{'fields':_0x2eed20,'raw':!![]});}})[_0x3c5b('0x38')](handleEntityNotFound(_0x43ed19,null))['then'](function(_0x1b2d7a){_0x4f6554[_0x3c5b('0xae')]=_0x1b2d7a;var _0x36ac0e=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xaf')];if(_0x2919a4[_0x3c5b('0x8f')]['cf-connecting-ip']){_0x36ac0e=_0x2919a4[_0x3c5b('0x8f')]['cf-connecting-ip'];}else if(_0x2919a4[_0x3c5b('0x8f')][_0x3c5b('0xb0')]){_0x36ac0e=_[_0x3c5b('0xb1')](_0x2919a4[_0x3c5b('0x8f')]['x-forwarded-for'][_0x3c5b('0xb2')](','));}if(_0x1b2d7a){var _0x36118c={'ContactId':_0x1b2d7a['id'],'ChatWebsiteId':_0x2919a4[_0x3c5b('0x5d')]['id'],'from':(_0x1b2d7a[_0x3c5b('0xb3')]||'')+'\x20'+(_0x1b2d7a['lastName']||''),'customerIp':_0x36ac0e,'customerPort':_0x2919a4['headers'][_0x3c5b('0xb4')]?_0x2919a4['headers']['x-real-port']:null,'referer':_0x2919a4['body'][_0x3c5b('0xb5')],'browserName':_0xe65b8b[_0x3c5b('0xb6')]['name']&&_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0xb7')]?util['format']('%s\x20%s',_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0x3d')],_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0xb7')]):_0x3c5b('0xb8'),'browserVersion':_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0xb7')]||_0x3c5b('0xb8'),'osName':util['format'](_0x3c5b('0xb9'),_0xe65b8b['os'][_0x3c5b('0x3d')],_0xe65b8b['os']['version']),'osVersion':_0xe65b8b['os']['version'],'deviceModel':_0xe65b8b[_0x3c5b('0xba')]['model']&&_0xe65b8b['device'][_0x3c5b('0xbb')]?util[_0x3c5b('0xbc')](_0x3c5b('0xbd'),_0xe65b8b[_0x3c5b('0xba')]['model'],_0xe65b8b[_0x3c5b('0xba')]['vendor'],_0xe65b8b[_0x3c5b('0xba')][_0x3c5b('0x53')]):null,'deviceVendor':_0xe65b8b['device'][_0x3c5b('0xbb')],'deviceType':_0xe65b8b[_0x3c5b('0xba')][_0x3c5b('0x53')],'formData':JSON['stringify'](_0x2919a4[_0x3c5b('0x62')])};var _0x38485d={'ChatWebsiteId':_0x2919a4[_0x3c5b('0x5d')]['id'],'closed':![]};if(_0x2919a4['body'][_0x3c5b('0xbe')]){_0x38485d['threadId']=_0x2919a4['body'][_0x3c5b('0xbe')];return db[_0x3c5b('0xbf')]['find']({'where':_0x38485d})['then'](function(_0x278f36){if(_0x278f36){return[_0x278f36,![]];}_0x36118c['threadId']=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xbe')];_0x36118c['externalUrl']=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc0')];return db['ChatInteraction'][_0x3c5b('0x61')](_0x36118c)[_0x3c5b('0x38')](function(_0x43c49d){return[_0x43c49d,!![]];});});}_0x38485d[_0x3c5b('0xc1')]=_0x1b2d7a['id'];if(_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc2')]&&_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc2')]['id']){_0x38485d['id']=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc2')]['id'];return db[_0x3c5b('0xbf')][_0x3c5b('0x60')]({'where':_0x38485d})[_0x3c5b('0x38')](function(_0x2c59ac){if(_0x2c59ac){return[_0x2c59ac,![]];}return db['ChatInteraction'][_0x3c5b('0x61')](_0x36118c)[_0x3c5b('0x38')](function(_0x2f8a72){return[_0x2f8a72,!![]];});});}return db[_0x3c5b('0xbf')]['create'](_0x36118c)[_0x3c5b('0x38')](function(_0x14f8b3){return[_0x14f8b3,!![]];});}})['spread'](function(_0x7e1693,_0x238d06){if(_0x7e1693){_0x1981d6=_0x238d06;if(!_0x238d06){var _0x4a13d1={'from':(_0x4f6554[_0x3c5b('0xae')][_0x3c5b('0xb3')]||'')+'\x20'+(_0x4f6554[_0x3c5b('0xae')][_0x3c5b('0xc3')]||'')};if(_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xbe')]&&_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc4')]&&_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xbe')]!=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc4')]){_0x4a13d1[_0x3c5b('0xbe')]=_0x2919a4['body']['messageId'];}return _0x7e1693['update'](_0x4a13d1);}else{return _0x7e1693;}}})[_0x3c5b('0x38')](function(_0x5d5500){_0x4f6554[_0x3c5b('0xc2')]=_0x5d5500['get']({'plain':!![]});_0x4f6554['interaction'][_0x3c5b('0xc5')]=_0x1981d6;if(_0x4f6554['interaction'][_0x3c5b('0xc5')]){if(_0x4f6554['account'][_0x3c5b('0xc6')]){_0x4f6554[_0x3c5b('0xa8')][_0x3c5b('0xc7')]({'id':0x0,'priority':_0x4f6554[_0x3c5b('0xa8')][_0x3c5b('0x4a')]+0x1,'app':'close','appdata':_0x3c5b('0xc8'),'interval':_0x3c5b('0xc9')});}}return db[_0x3c5b('0xca')][_0x3c5b('0x61')]({'body':_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x62')],'ChatWebsiteId':_0x2919a4['params']['id'],'ChatInteractionId':_0x5d5500['id'],'direction':'in','ContactId':_0x4f6554[_0x3c5b('0xae')]['id'],'AttachmentId':_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xcb')]});})[_0x3c5b('0x38')](function(_0x1ec6b4){_0x4f6554['message']=_0x1ec6b4;if(_0x4f6554[_0x3c5b('0xc2')][_0x3c5b('0xcc')]){return db[_0x3c5b('0xcd')][_0x3c5b('0x60')]({'attributes':['id',_0x3c5b('0x3d')],'where':{'id':_0x4f6554[_0x3c5b('0xc2')][_0x3c5b('0xcc')]}})['then'](function(_0x364c95){if(_0x364c95){_0x4f6554[_0x3c5b('0xa8')][_0x3c5b('0xce')]({'id':0x0,'priority':0x0,'app':_0x3c5b('0xcf'),'appdata':_0x364c95[_0x3c5b('0x3d')]+','+(_0x4f6554[_0x3c5b('0xa7')]['waitForTheAssignedAgent']||0xa),'interval':_0x3c5b('0xc9')});_0x4f6554['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x3c5b('0xd0'),_0x4f6554);});}return respondWithRpcPromise(_0x3c5b('0xd1'),_0x3c5b('0xd0'),_0x4f6554);})[_0x3c5b('0x38')](function(_0x31ba4d){respondWithRpcPromise(_0x3c5b('0xd2'),_0x3c5b('0xd2'),{'event':_0x3c5b('0x8e'),'message':_0x31ba4d},client9002);return _0x31ba4d;})[_0x3c5b('0x38')](respondWithResult(_0x43ed19,null))[_0x3c5b('0x2c')](handleError(_0x43ed19,null));};exports[_0x3c5b('0xd3')]=function(_0x44b7a2,_0x4a6fa4,_0x36dd51){var _0x53a65d,_0x11f268,_0x27f28f;var _0x5dfc90=[];var _0xc015c5=[];var _0x5daff8={};return db['CmContact']['describe']()['then'](function(_0x98c78a){if(!_0x98c78a){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x95'));}_0xc015c5=_[_0x3c5b('0x98')](_[_0x3c5b('0x5f')](_0x98c78a),[_0x3c5b('0x96'),_0x3c5b('0x97')]);_0x5dfc90=_[_0x3c5b('0x98')](_[_0x3c5b('0x5f')](_0x98c78a),[_0x3c5b('0x96'),_0x3c5b('0x97'),_0x3c5b('0x99'),_0x3c5b('0x9a')]);if(_0x44b7a2[_0x3c5b('0x62')]['id']){delete _0x44b7a2[_0x3c5b('0x62')]['id'];}if(_[_0x3c5b('0x84')](_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')])){throw _0x4a6fa4[_0x3c5b('0x2e')](0x1f4)[_0x3c5b('0x3e')](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x3c5b('0x84')](_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x62')])||_0x44b7a2['body'][_0x3c5b('0x62')]===''){throw _0x4a6fa4['status'](0x1f4)[_0x3c5b('0x3e')](new db[(_0x3c5b('0x93'))]['ValidationError'](_0x3c5b('0x9d')));}if(_[_0x3c5b('0x84')](_0x44b7a2[_0x3c5b('0x62')]['mapKeyOffline'])){throw _0x4a6fa4[_0x3c5b('0x2e')](0x1f4)[_0x3c5b('0x3e')](new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0xd4')+_0x5dfc90));}if(!_[_0x3c5b('0xa0')](_0x5dfc90,_0x44b7a2['body'][_0x3c5b('0xd5')])){throw _0x4a6fa4[_0x3c5b('0x2e')](0x1f4)[_0x3c5b('0x3e')](new db[(_0x3c5b('0x93'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dfc90));}_0x5daff8[_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0xd5')]]=_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')];})[_0x3c5b('0x38')](function(){return db[_0x3c5b('0x41')]['find']({'where':{'id':_0x44b7a2['params']['id']},'include':[{'model':db[_0x3c5b('0xa2')],'as':_0x3c5b('0xa3')}]});})[_0x3c5b('0x38')](handleEntityNotFound(_0x4a6fa4,null))['then'](function(_0x5b30e3){if(_0x5b30e3&&_0x5b30e3[_0x3c5b('0xa3')]){_0x11f268=_0x5b30e3;var _0x4846c7=_['defaults'](_0x44b7a2[_0x3c5b('0x62')],{'firstName':_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')],'phone':_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')],'ListId':_0x5b30e3['ListId']});_0x4846c7[_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0xd5')]]=_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')];return db[_0x3c5b('0x92')][_0x3c5b('0xd6')]({'where':_0x5daff8,'defaults':_0x4846c7});}})[_0x3c5b('0xd7')](function(_0x54b55b){if(_0x54b55b){_0x27f28f=_0x54b55b;var _0x1fb1c5=fs[_0x3c5b('0xd8')](path['join'](config[_0x3c5b('0x80')],_0x3c5b('0xd9')),'utf8');var _0x682437=ejs[_0x3c5b('0xda')](_0x1fb1c5,{'body':_[_0x3c5b('0xdb')](_0x44b7a2['body'][_0x3c5b('0x62')]),'bodyTitle':_0x11f268['offlineMessageBody']});return db[_0x3c5b('0xdc')][_0x3c5b('0x61')]({'body':_0x682437,'ContactId':_0x54b55b['id'],'ChatWebsiteId':_0x11f268['id']});}})[_0x3c5b('0x38')](function(_0x105c35){if(_0x105c35){_0x53a65d=_0x105c35;return db[_0x3c5b('0xdd')][_0x3c5b('0x72')]({'where':{'service':!![]},'include':[{'model':db[_0x3c5b('0xde')],'as':_0x3c5b('0xdf'),'raw':!![]}]});}})['then'](function(_0xf6d15c){if(_0xf6d15c&&_0xf6d15c[_0x3c5b('0xdf')]&&_0x11f268[_0x3c5b('0xe0')]){var _0x30b89b={'tls':{'rejectUnauthorized':![]}};if(_0xf6d15c['Smtp'][_0x3c5b('0xe1')]){_0x30b89b['service']=_0xf6d15c['Smtp']['service'];}else{_0x30b89b[_0x3c5b('0xe2')]=_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe2')];_0x30b89b[_0x3c5b('0xe3')]=_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe3')];_0x30b89b[_0x3c5b('0xe4')]=_0xf6d15c['Smtp'][_0x3c5b('0xe4')];}if(_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe5')]){_0x30b89b[_0x3c5b('0xe6')]={'user':_0xf6d15c[_0x3c5b('0xdf')]['user'],'pass':_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe7')]};}return respondWithRpcPromise(_0x3c5b('0xe8'),'sendMail',{'account':_0x30b89b,'message':{'from':util[_0x3c5b('0xbc')](_0x3c5b('0xe9'),_0xf6d15c['name'],_0xf6d15c[_0x3c5b('0xea')]||_0xf6d15c['Smtp'][_0x3c5b('0x66')]),'to':_0x11f268['forwardOfflineAddress'],'subject':_0x11f268[_0x3c5b('0xeb')],'text':_0x53a65d[_0x3c5b('0x62')]}},client9003)[_0x3c5b('0x38')](function(){return _0x53a65d;})[_0x3c5b('0x2c')](function(_0x2ffc3c){console['error'](_0x2ffc3c);});}})[_0x3c5b('0x38')](function(){if(_0x53a65d){return _0x53a65d;}})[_0x3c5b('0x38')](respondWithResult(_0x4a6fa4,null))[_0x3c5b('0x2c')](handleError(_0x4a6fa4,null));};exports[_0x3c5b('0xec')]=function(_0x143baf,_0x56afd6,_0x162ff5){return db['ChatInteraction']['find']({'where':{'id':_0x143baf[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x56afd6,null))[_0x3c5b('0x38')](function(_0x9b62db){if(_0x9b62db){return _0x9b62db[_0x3c5b('0xec')](_0x143baf[_0x3c5b('0x62')][_0x3c5b('0x75')],_[_0x3c5b('0xed')](_0x143baf['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x56afd6,null))[_0x3c5b('0x2c')](handleError(_0x56afd6,null));};exports[_0x3c5b('0xee')]=function(_0x330d24,_0x2ec27d,_0x4c1ff7){var _0x3f9a4a={'raw':![],'where':{}};var _0x2bd990={};var _0x46ed7c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3c5b('0x72')]({'where':{'id':_0x330d24[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x2ec27d,null))[_0x3c5b('0x38')](function(_0x32c003){if(_0x32c003){_0x2bd990[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db[_0x3c5b('0xbf')][_0x3c5b('0x42')]);_0x2bd990[_0x3c5b('0x44')]=_['keys'](_0x330d24['query']);_0x2bd990['filters']=_[_0x3c5b('0x46')](_0x2bd990[_0x3c5b('0x47')],_0x2bd990[_0x3c5b('0x44')]);_0x3f9a4a[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x2bd990[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x3f9a4a['attributes']=_0x3f9a4a[_0x3c5b('0x49')]['length']?_0x3f9a4a['attributes']:_0x2bd990[_0x3c5b('0x47')];if(!_0x330d24['query'][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x3f9a4a[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x31')]);_0x3f9a4a[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x3f9a4a[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x330d24[_0x3c5b('0x44')]['sort']);_0x3f9a4a[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_['pick'](_0x330d24[_0x3c5b('0x44')],_0x2bd990['filters']));_0x3f9a4a['where']['ChatWebsiteId']=_0x32c003['id'];if(_0x330d24['query'][_0x3c5b('0x50')]){_0x3f9a4a['where']=_[_0x3c5b('0x52')](_0x3f9a4a['where'],{'$or':_[_0x3c5b('0x40')](_0x3f9a4a[_0x3c5b('0x49')],function(_0x53ed39){var _0x3a0f10={};_0x3a0f10[_0x53ed39]={'$like':'%'+_0x330d24['query'][_0x3c5b('0x50')]+'%'};return _0x3a0f10;})});}_0x3f9a4a=_[_0x3c5b('0x52')]({},_0x3f9a4a,_0x330d24[_0x3c5b('0x57')]);return db[_0x3c5b('0xbf')][_0x3c5b('0x30')]({'where':_0x3f9a4a['where']})[_0x3c5b('0x38')](function(_0x1a71e2){_0x46ed7c[_0x3c5b('0x30')]=_0x1a71e2;if(_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x3f9a4a[_0x3c5b('0x59')]=[{'model':db[_0x3c5b('0x92')],'as':_0x3c5b('0xef'),'required':![]},{'model':db[_0x3c5b('0xcd')],'as':_0x3c5b('0xf0'),'attributes':[_0x3c5b('0x3d'),_0x3c5b('0xf1'),_0x3c5b('0xf2')],'required':![]},{'model':db[_0x3c5b('0xf3')],'as':_0x3c5b('0xf4'),'attributes':['id',_0x3c5b('0x3d'),'color'],'where':_0x330d24[_0x3c5b('0x44')][_0x3c5b('0xf5')]?{'id':_0x330d24[_0x3c5b('0x44')]['tag']}:undefined,'required':_0x330d24['query'][_0x3c5b('0xf5')]?!![]:![]}];}return db[_0x3c5b('0xbf')][_0x3c5b('0x5a')](_0x3f9a4a);})[_0x3c5b('0x38')](function(_0x1f9c6a){_0x46ed7c[_0x3c5b('0x5b')]=_0x1f9c6a;return _0x46ed7c;});}})[_0x3c5b('0x38')](respondWithFilteredResult(_0x2ec27d,_0x3f9a4a))['catch'](handleError(_0x2ec27d,null));};function iftimePromise(_0x1355f0,_0x17e6ec){return respondWithRpcPromise(_0x3c5b('0xf6'),_0x3c5b('0xf7'),{'command':_0x17e6ec['timezone']?util[_0x3c5b('0xbc')](_0x3c5b('0xf8'),_0x1355f0['interval'],_0x17e6ec[_0x3c5b('0xf9')]):util[_0x3c5b('0xbc')](_0x3c5b('0xfa'),_0x1355f0['interval'])},client9002)['then'](function(_0x7e6f43){var _0x57d1f4=_0x7e6f43&&_0x7e6f43[_0x3c5b('0xfb')]('true')>=0x0?!![]:![];logger[_0x3c5b('0x23')](_0x3c5b('0xfc'),_0x17e6ec['id'],_0x1355f0['id'],_0x1355f0[_0x3c5b('0xfd')],_0x57d1f4?_0x3c5b('0xfe'):_0x3c5b('0xff'),_0x17e6ec['timezone']?_0x17e6ec['timezone']:_0x3c5b('0x100'));return _0x57d1f4;})[_0x3c5b('0x2c')](function(_0x1462e4){logger[_0x3c5b('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x17e6ec['id'],_0x1355f0['id'],_0x1355f0['interval'],util[_0x3c5b('0x101')](_0x1462e4,{'showHidden':![],'depth':null}),_0x17e6ec['timezone']?_0x17e6ec[_0x3c5b('0xf9')]:_0x3c5b('0x100'));return![];});}exports[_0x3c5b('0xf7')]=function(_0x3712de,_0x4fc023,_0x4c76ff){var _0x23543d=0x0;var _0x29c54c=0x0;var _0x553297=![];var _0x3e2222;var _0x31fc1e;return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x3712de[_0x3c5b('0x5d')]['id']},'include':[{'model':db[_0x3c5b('0x102')],'as':_0x3c5b('0x102'),'include':[{'model':db[_0x3c5b('0x102')],'as':_0x3c5b('0x103'),'attributes':['id',_0x3c5b('0xfd')],'raw':!![]}]}]})[_0x3c5b('0x38')](handleEntityNotFound(_0x4fc023,null))[_0x3c5b('0x38')](function(_0x56efdd){if(_0x56efdd){_0x3e2222=_0x56efdd;return _0x56efdd[_0x3c5b('0x104')]({'raw':!![]});}})[_0x3c5b('0x38')](function(_0x32a494){if(_0x3e2222){if(_0x32a494){_0x31fc1e=_0x32a494;}}return require(_0x3c5b('0x105'))[_0x3c5b('0x106')]();})[_0x3c5b('0x38')](function(_0x4d7660){if(_0x4d7660){_0x29c54c=_0x4d7660[_0x3c5b('0x107')];_0x553297=_0x4d7660[_0x3c5b('0x83')];}})[_0x3c5b('0x38')](function(){return db['ChatInteraction'][_0x3c5b('0x30')]({'where':{'closed':![]}});})[_0x3c5b('0x38')](function(_0x593c77){_0x23543d=_0x593c77;if(_0x29c54c&&_0x593c77>_0x29c54c){return db[_0x3c5b('0x108')][_0x3c5b('0x72')]({'where':{'id':0x1}})[_0x3c5b('0x38')](function(_0xde3ed1){if(_0xde3ed1){_0xde3ed1[_0x3c5b('0x109')](_0x3c5b('0x10a'));}});}})[_0x3c5b('0x38')](function(){if(_0x3e2222[_0x3c5b('0x102')]&&_0x3e2222[_0x3c5b('0x102')][_0x3c5b('0x103')]){var _0x39c403=[];for(var _0x3f6e2a=0x0;_0x3f6e2a<_0x3e2222[_0x3c5b('0x102')]['Intervals'][_0x3c5b('0x4a')];_0x3f6e2a++){var _0x456691=_0x3e2222['Interval'][_0x3c5b('0x103')][_0x3f6e2a][_0x3c5b('0x63')]({'plain':!![]});_0x39c403[_0x3c5b('0xc7')](iftimePromise(_0x456691,_0x3e2222));}return BPromise['all'](_0x39c403)['then'](function(_0x4220cb){return _[_0x3c5b('0x10b')](_0x4220cb);});}else{return!![];}})[_0x3c5b('0x38')](function(_0x55c178){var _0x175e1d=fs[_0x3c5b('0xd8')](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x10c')),'utf8');var _0x2111ba={'remote':_0x3e2222[_0x3c5b('0x10d')],'query':querystring[_0x3c5b('0x27')](_[_0x3c5b('0x52')](_0x3e2222[_0x3c5b('0x63')]({'plain':!![]}),{'customerIp':_0x3712de[_0x3c5b('0x8f')][_0x3c5b('0xb0')]||_0x3712de[_0x3c5b('0x8f')][_0x3c5b('0x10e')]||_0x3712de[_0x3c5b('0x10f')][_0x3c5b('0x110')]||_0x3712de['ip'],'referer':_0x3712de['headers']['referer'],'openedInteractions':_0x23543d,'maxInteractions':_0x29c54c,'virtual':_0x553297[_0x3c5b('0x107')],'online':_0x55c178,'custom':_0x553297}))['replace'](/'/g,'\x5c\x27')};_0x4fc023[_0x3c5b('0x3e')](ejs[_0x3c5b('0xda')](Mustache[_0x3c5b('0xda')](_0x175e1d,_0x2111ba),{'proactiveActions':_0x31fc1e,'alignment':_0x3e2222[_0x3c5b('0x111')],'verticalAlignment':_0x3e2222['verticalAlignment']}));})[_0x3c5b('0x2c')](handleError(_0x4fc023,null));};exports[_0x3c5b('0x112')]=function(_0x35f8e0,_0x42728d,_0x4081d5){return db[_0x3c5b('0x41')]['findOne']({'where':{'id':_0x35f8e0[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x42728d,null))[_0x3c5b('0x38')](function(_0x3e1349){if(_0x3e1349){return db[_0x3c5b('0x113')][_0x3c5b('0x114')](function(_0x2f23f9){return db[_0x3c5b('0xa6')]['destroy']({'where':{'ChatWebsiteId':_0x35f8e0[_0x3c5b('0x5d')]['id']},'transaction':_0x2f23f9})[_0x3c5b('0x38')](function(_0x2b91ff){var _0x4a3046=_[_0x3c5b('0x40')](_0x35f8e0[_0x3c5b('0x62')],function(_0x3fd47a){_0x3fd47a[_0x3c5b('0x6b')]=_0x35f8e0[_0x3c5b('0x5d')]['id'];return _0x3fd47a;});return db[_0x3c5b('0xa6')][_0x3c5b('0x115')](_0x4a3046,{'transaction':_0x2f23f9});});})[_0x3c5b('0x38')](function(){return db[_0x3c5b('0xa6')][_0x3c5b('0x116')]({'where':{'ChatWebsiteId':_0x35f8e0[_0x3c5b('0x5d')]['id']},'order':_0x3c5b('0xab')});});}})[_0x3c5b('0x38')](respondWithResult(_0x42728d,null))[_0x3c5b('0x2c')](handleError(_0x42728d,null));};exports['getApplications']=function(_0x45a27b,_0x38abc5,_0x494090){var _0x43f691={};var _0x552d38={};var _0x24a8db;var _0x3b7500;return db[_0x3c5b('0x41')][_0x3c5b('0x72')]({'where':{'id':_0x45a27b[_0x3c5b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x38abc5,null))[_0x3c5b('0x38')](function(_0x23836b){if(_0x23836b){_0x24a8db=_0x23836b;_0x552d38['model']=_[_0x3c5b('0x5f')](db[_0x3c5b('0xa6')][_0x3c5b('0x42')]);_0x552d38[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x45a27b['query']);_0x552d38[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x552d38['model'],_0x552d38[_0x3c5b('0x44')]);_0x43f691[_0x3c5b('0x49')]=_['intersection'](_0x552d38['model'],qs[_0x3c5b('0x48')](_0x45a27b['query'][_0x3c5b('0x48')]));_0x43f691['attributes']=_0x43f691['attributes'][_0x3c5b('0x4a')]?_0x43f691[_0x3c5b('0x49')]:_0x552d38[_0x3c5b('0x47')];_0x43f691[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x45a27b[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x43f691[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x45a27b[_0x3c5b('0x44')],_0x552d38['filters']));if(_0x45a27b['query'][_0x3c5b('0x50')]){_0x43f691[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x43f691[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x43f691[_0x3c5b('0x49')],function(_0x40a96b){var _0x523664={};_0x523664[_0x40a96b]={'$like':'%'+_0x45a27b[_0x3c5b('0x44')][_0x3c5b('0x50')]+'%'};return _0x523664;})});}_0x43f691=_[_0x3c5b('0x52')]({},_0x43f691,_0x45a27b[_0x3c5b('0x57')]);return _0x24a8db[_0x3c5b('0x117')](_0x43f691);}})[_0x3c5b('0x38')](function(_0x5b8c21){if(_0x5b8c21){_0x3b7500=_0x5b8c21[_0x3c5b('0x4a')];if(!_0x45a27b['query']['hasOwnProperty'](_0x3c5b('0x73'))){_0x43f691[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x45a27b['query'][_0x3c5b('0x31')]);_0x43f691[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x45a27b[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}return _0x24a8db[_0x3c5b('0x117')](_0x43f691);}})[_0x3c5b('0x38')](function(_0x32045e){if(_0x32045e){return _0x32045e?{'count':_0x3b7500,'rows':_0x32045e}:null;}})[_0x3c5b('0x38')](respondWithResult(_0x38abc5,null))[_0x3c5b('0x2c')](handleError(_0x38abc5,null));};exports[_0x3c5b('0x118')]=function(_0x2809c7,_0x3428cf,_0x2ea499){return db[_0x3c5b('0x119')][_0x3c5b('0x60')]({'where':{'id':_0x2809c7[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x3428cf,null))[_0x3c5b('0x38')](function(_0x24beed){if(_0x24beed){return _0x24beed['addProactiveActions'](_0x2809c7[_0x3c5b('0x62')][_0x3c5b('0x75')],_[_0x3c5b('0xed')](_0x2809c7['body'],['ids','id'])||{});}})[_0x3c5b('0x38')](respondWithResult(_0x3428cf,null))[_0x3c5b('0x2c')](handleError(_0x3428cf,null));};exports[_0x3c5b('0x104')]=function(_0x331e9f,_0x1b623c,_0x204908){var _0x1fb5a9={};var _0x12bafd={};var _0x5270c2;var _0x349c3d;return db[_0x3c5b('0x41')][_0x3c5b('0x72')]({'where':{'id':_0x331e9f[_0x3c5b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1b623c,null))['then'](function(_0x53547a){if(_0x53547a){_0x5270c2=_0x53547a;_0x12bafd[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db[_0x3c5b('0x11a')][_0x3c5b('0x42')]);_0x12bafd[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x331e9f['query']);_0x12bafd['filters']=_['intersection'](_0x12bafd[_0x3c5b('0x47')],_0x12bafd['query']);_0x1fb5a9[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x12bafd[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x331e9f['query'][_0x3c5b('0x48')]));_0x1fb5a9[_0x3c5b('0x49')]=_0x1fb5a9[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x1fb5a9[_0x3c5b('0x49')]:_0x12bafd[_0x3c5b('0x47')];_0x1fb5a9['order']=qs['sort'](_0x331e9f['query']['sort']);_0x1fb5a9[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_['pick'](_0x331e9f[_0x3c5b('0x44')],_0x12bafd[_0x3c5b('0x45')]));if(_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x1fb5a9[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x1fb5a9[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x1fb5a9['attributes'],function(_0x2e7d51){var _0x99f064={};_0x99f064[_0x2e7d51]={'$like':'%'+_0x331e9f[_0x3c5b('0x44')]['filter']+'%'};return _0x99f064;})});}_0x1fb5a9=_[_0x3c5b('0x52')]({},_0x1fb5a9,_0x331e9f[_0x3c5b('0x57')]);return _0x5270c2[_0x3c5b('0x104')](_0x1fb5a9);}})[_0x3c5b('0x38')](function(_0x15190c){if(_0x15190c){_0x349c3d=_0x15190c['length'];if(!_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x1fb5a9[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x31')]);_0x1fb5a9[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}return _0x5270c2[_0x3c5b('0x104')](_0x1fb5a9);}})['then'](function(_0x59230c){if(_0x59230c){return _0x59230c?{'count':_0x349c3d,'rows':_0x59230c}:null;}})[_0x3c5b('0x38')](respondWithResult(_0x1b623c,null))[_0x3c5b('0x2c')](handleError(_0x1b623c,null));};exports[_0x3c5b('0x11b')]=function(_0x16ea0e,_0x3feac1,_0x321d4a){var _0x4561ea=_0x16ea0e[_0x3c5b('0x44')][_0x3c5b('0x11c')]===_0x3c5b('0x11d')?'offlineForm':_0x3c5b('0x11e');return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'attributes':['id',_0x4561ea],'where':{'id':_0x16ea0e['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x3feac1,null))['then'](function(_0x5afc9e){if(_0x5afc9e){var _0x34d017=_0x5afc9e[_0x4561ea];var _0x5b4a37=_0x34d017&&_0x34d017[_0x3c5b('0x11f')]?_0x34d017[_0x3c5b('0x11f')]:[];_0x3feac1['send']({'fromKey':_[_0x3c5b('0x84')](_0x34d017[_0x3c5b('0x120')])?undefined:_0x34d017[_0x3c5b('0x120')],'count':_0x5b4a37[_0x3c5b('0x4a')],'rows':_0x5b4a37});}})[_0x3c5b('0x2c')](handleError(_0x3feac1,null));};exports[_0x3c5b('0x121')]=function(_0x9ef0a3,_0xc80b0b,_0xe555d9){var _0x2a4cb6={'raw':!![],'where':{}};var _0x19cf45={};var _0x493ebf={'count':0x0,'rows':[]};return db[_0x3c5b('0x41')][_0x3c5b('0x72')]({'where':{'id':_0x9ef0a3[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0xc80b0b,null))[_0x3c5b('0x38')](function(_0x8fd2e0){if(_0x8fd2e0){_0x19cf45[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db['ChatOfflineMessage']['rawAttributes']);_0x19cf45[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x9ef0a3[_0x3c5b('0x44')]);_0x19cf45['filters']=_[_0x3c5b('0x46')](_0x19cf45[_0x3c5b('0x47')],_0x19cf45[_0x3c5b('0x44')]);_0x2a4cb6[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x19cf45[_0x3c5b('0x47')],qs['fields'](_0x9ef0a3['query'][_0x3c5b('0x48')]));_0x2a4cb6[_0x3c5b('0x49')]=_0x2a4cb6['attributes']['length']?_0x2a4cb6['attributes']:_0x19cf45[_0x3c5b('0x47')];if(!_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x2a4cb6[_0x3c5b('0x31')]=qs['limit'](_0x9ef0a3['query'][_0x3c5b('0x31')]);_0x2a4cb6[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x2a4cb6[_0x3c5b('0x4d')]=qs['sort'](_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x2a4cb6[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x9ef0a3[_0x3c5b('0x44')],_0x19cf45[_0x3c5b('0x45')]));_0x2a4cb6['where'][_0x3c5b('0x6b')]=_0x8fd2e0['id'];if(_0x9ef0a3['query'][_0x3c5b('0x50')]){_0x2a4cb6[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x2a4cb6[_0x3c5b('0x51')],{'$or':_['map'](_0x2a4cb6[_0x3c5b('0x49')],function(_0x345423){var _0xf31e8f={};_0xf31e8f[_0x345423]={'$like':'%'+_0x9ef0a3['query']['filter']+'%'};return _0xf31e8f;})});}_0x2a4cb6=_[_0x3c5b('0x52')]({},_0x2a4cb6,_0x9ef0a3['options']);return db[_0x3c5b('0xdc')][_0x3c5b('0x30')]({'where':_0x2a4cb6[_0x3c5b('0x51')]})['then'](function(_0x3d7ce7){_0x493ebf[_0x3c5b('0x30')]=_0x3d7ce7;if(_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x2a4cb6[_0x3c5b('0x59')]=[{'all':!![]}];}return db[_0x3c5b('0xdc')]['findAll'](_0x2a4cb6);})[_0x3c5b('0x38')](function(_0x2e93e4){_0x493ebf[_0x3c5b('0x5b')]=_0x2e93e4;return _0x493ebf;});}})[_0x3c5b('0x38')](respondWithFilteredResult(_0xc80b0b,_0x2a4cb6))[_0x3c5b('0x2c')](handleError(_0xc80b0b,null));};exports[_0x3c5b('0x122')]=function(_0x3cf205,_0x54fe2e,_0x20432d){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x3cf205[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x54fe2e,null))['then'](function(_0x4f2c40){if(_0x4f2c40){return _0x4f2c40[_0x3c5b('0x122')](_0x3cf205[_0x3c5b('0x62')][_0x3c5b('0x75')],_['omit'](_0x3cf205[_0x3c5b('0x62')],[_0x3c5b('0x75'),'id'])||{})[_0x3c5b('0xd7')](function(_0x1c0dcc){for(var _0x1cb099=0x0;_0x1cb099<_0x3cf205[_0x3c5b('0x62')][_0x3c5b('0x75')][_0x3c5b('0x4a')];_0x1cb099+=0x1){socket[_0x3c5b('0x123')](_0x3c5b('0x124'),{'UserId':_0x3cf205['body']['ids'][_0x1cb099],'ChatWebsiteId':_0x3cf205[_0x3c5b('0x5d')]['id']});}return _0x1c0dcc;});}})[_0x3c5b('0x38')](respondWithResult(_0x54fe2e,null))[_0x3c5b('0x2c')](handleError(_0x54fe2e,null));};exports[_0x3c5b('0x125')]=function(_0x23e23d,_0x1fa1b5,_0x544a2f){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x23e23d[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x1fa1b5,null))['then'](function(_0x47839a){if(_0x47839a){return _0x47839a[_0x3c5b('0x125')](_0x23e23d[_0x3c5b('0x44')][_0x3c5b('0x75')])[_0x3c5b('0x38')](function(){if(_[_0x3c5b('0x126')](_0x23e23d[_0x3c5b('0x44')][_0x3c5b('0x75')])){for(var _0x5315ec=0x0;_0x5315ec<_0x23e23d['query'][_0x3c5b('0x75')][_0x3c5b('0x4a')];_0x5315ec+=0x1){socket[_0x3c5b('0x123')](_0x3c5b('0x127'),{'UserId':Number(_0x23e23d[_0x3c5b('0x44')]['ids'][_0x5315ec]),'ChatWebsiteId':Number(_0x23e23d[_0x3c5b('0x5d')]['id'])});}}else{socket['emit'](_0x3c5b('0x127'),{'UserId':Number(_0x23e23d[_0x3c5b('0x44')][_0x3c5b('0x75')]),'ChatWebsiteId':Number(_0x23e23d[_0x3c5b('0x5d')]['id'])});}});}})[_0x3c5b('0x38')](respondWithStatusCode(_0x1fa1b5,null))['catch'](handleError(_0x1fa1b5,null));};exports['getAgents']=function(_0x26e7aa,_0x36b2b3,_0x44e524){var _0x5a4269={};var _0x1dbf2d={};var _0x3f2b72;var _0x331e54;return db['ChatWebsite'][_0x3c5b('0x72')]({'where':{'id':_0x26e7aa[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x36b2b3,null))[_0x3c5b('0x38')](function(_0x542606){if(_0x542606){_0x3f2b72=_0x542606;_0x1dbf2d['model']=_[_0x3c5b('0x5f')](db[_0x3c5b('0xcd')][_0x3c5b('0x42')]);_0x1dbf2d[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x26e7aa[_0x3c5b('0x44')]);_0x1dbf2d['filters']=_[_0x3c5b('0x46')](_0x1dbf2d[_0x3c5b('0x47')],_0x1dbf2d[_0x3c5b('0x44')]);_0x5a4269[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x1dbf2d[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x5a4269[_0x3c5b('0x49')]=_0x5a4269[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x5a4269[_0x3c5b('0x49')]:_0x1dbf2d['model'];_0x5a4269['order']=qs['sort'](_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x5a4269[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x26e7aa[_0x3c5b('0x44')],_0x1dbf2d[_0x3c5b('0x45')]));if(_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x5a4269['where']=_['merge'](_0x5a4269['where'],{'$or':_[_0x3c5b('0x40')](_0x5a4269['attributes'],function(_0x511e9d){var _0x1782ea={};_0x1782ea[_0x511e9d]={'$like':'%'+_0x26e7aa[_0x3c5b('0x44')]['filter']+'%'};return _0x1782ea;})});}_0x5a4269=_[_0x3c5b('0x52')]({},_0x5a4269,_0x26e7aa[_0x3c5b('0x57')]);return _0x3f2b72[_0x3c5b('0x128')](_0x5a4269);}})[_0x3c5b('0x38')](function(_0x1badb1){if(_0x1badb1){_0x331e54=_0x1badb1[_0x3c5b('0x4a')];if(!_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x5a4269[_0x3c5b('0x31')]=qs['limit'](_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x31')]);_0x5a4269[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x26e7aa[_0x3c5b('0x44')]['offset']);}return _0x3f2b72[_0x3c5b('0x128')](_0x5a4269);}})[_0x3c5b('0x38')](function(_0x2bc0ce){if(_0x2bc0ce){return _0x2bc0ce?{'count':_0x331e54,'rows':_0x2bc0ce}:null;}})[_0x3c5b('0x38')](respondWithResult(_0x36b2b3,null))[_0x3c5b('0x2c')](handleError(_0x36b2b3,null));};
\ No newline at end of file
+var _0x5abf=['%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','push','close','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','offline','no\x20available\x20attributes','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','addInteraction','include','Contact','User','Owner','fullname','Tag','Tags','color','tag','findAll','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','some','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','info','catch','status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','removeDispositions','ids','getAnswers','CannedAnswer','ChatWebsiteId','includeAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','ListId','contact','customerIp','x-forwarded-for','first','split','lastName','x-real-port','referer','browser'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5abf,0x72));var _0xf5ab=function(_0x2b3cad,_0x573629){_0x2b3cad=_0x2b3cad-0x0;var _0x2175c4=_0x5abf[_0x2b3cad];return _0x2175c4;};'use strict';var pdf=require(_0xf5ab('0x0'));var emlformat=require(_0xf5ab('0x1'));var rimraf=require(_0xf5ab('0x2'));var zipdir=require(_0xf5ab('0x3'));var jsonpatch=require(_0xf5ab('0x4'));var rp=require(_0xf5ab('0x5'));var moment=require(_0xf5ab('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf5ab('0x7'));var util=require(_0xf5ab('0x8'));var path=require(_0xf5ab('0x9'));var sox=require(_0xf5ab('0xa'));var csv=require(_0xf5ab('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf5ab('0xc'));var squel=require(_0xf5ab('0xd'));var crypto=require(_0xf5ab('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf5ab('0xf'));var toCsv=require(_0xf5ab('0xb'));var querystring=require('querystring');var Papa=require(_0xf5ab('0x10'));var Redis=require('ioredis');var authService=require(_0xf5ab('0x11'));var qs=require(_0xf5ab('0x12'));var as=require(_0xf5ab('0x13'));var hardwareService=require(_0xf5ab('0x14'));var logger=require(_0xf5ab('0x15'))(_0xf5ab('0x16'));var utils=require(_0xf5ab('0x17'));var config=require(_0xf5ab('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf5ab('0x19')](config[_0xf5ab('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf5ab('0x1b'))[_0xf5ab('0x1c')](socket);var jayson=require(_0xf5ab('0x1d'));var client=jayson[_0xf5ab('0x1e')][_0xf5ab('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xf5ab('0x1f')]({'port':0x232a});var client9003=jayson[_0xf5ab('0x1e')]['http']({'port':0x232b});function checkPasswordPattern(_0x19a1ff,_0x1db38a,_0x20bbd3){if(_0x20bbd3){var _0x2bd5ec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bd5ec[_0xf5ab('0x20')](_0x1db38a)){return _0x19a1ff;}else{throw new Error(_0xf5ab('0x21'));}}else{return _0x19a1ff;}}function respondWithRpcPromise(_0x20ada7,_0x36587f,_0x390059,_0xe055f4){return new BPromise(function(_0x4b68a3,_0x9ebe56){var _0x85a31d=_0xe055f4||client;return _0x85a31d[_0xf5ab('0x22')](_0x20ada7,_0x390059)[_0xf5ab('0x23')](function(_0xa45fd3){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x36587f,_0xf5ab('0x24'));logger['debug'](_0xf5ab('0x25'),_0x36587f,'request\x20sent',JSON[_0xf5ab('0x26')](_0xa45fd3));if(_0xa45fd3[_0xf5ab('0x27')]){if(_0xa45fd3[_0xf5ab('0x27')][_0xf5ab('0x28')]===0x1f4){logger[_0xf5ab('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x36587f,_0xa45fd3['error'][_0xf5ab('0x29')]);return _0x9ebe56(_0xa45fd3[_0xf5ab('0x27')][_0xf5ab('0x29')]);}logger[_0xf5ab('0x27')](_0xf5ab('0x2a'),_0x36587f,_0xa45fd3['error']['message']);return _0x4b68a3(_0xa45fd3[_0xf5ab('0x27')][_0xf5ab('0x29')]);}else{logger[_0xf5ab('0x2b')](_0xf5ab('0x2a'),_0x36587f,_0xf5ab('0x24'));_0x4b68a3(_0xa45fd3['result'][_0xf5ab('0x29')]);}})[_0xf5ab('0x2c')](function(_0x52711b){logger['error'](_0xf5ab('0x2a'),_0x36587f,_0x52711b);_0x9ebe56(_0x52711b);});});}function respondWithStatusCode(_0xd0526e,_0x1703f4){_0x1703f4=_0x1703f4||0xcc;return function(_0x3449c9){if(_0x3449c9){return _0xd0526e['sendStatus'](_0x1703f4);}return _0xd0526e[_0xf5ab('0x2d')](_0x1703f4)['end']();};}function respondWithResult(_0x5518a1,_0x41d4f6){_0x41d4f6=_0x41d4f6||0xc8;return function(_0x561006){if(_0x561006){return _0x5518a1[_0xf5ab('0x2d')](_0x41d4f6)[_0xf5ab('0x2e')](_0x561006);}};}function respondWithFilteredResult(_0xad64fd,_0x3406a7){return function(_0x2cfadb){if(_0x2cfadb){var _0x202a5d=_0x2cfadb[_0xf5ab('0x2f')],_0x6c602e=_0x3406a7[_0xf5ab('0x30')],_0xa30edd=_0x3406a7[_0xf5ab('0x30')]+_0x3406a7[_0xf5ab('0x31')],_0x324173;if(_0xa30edd>=_0x202a5d){_0xa30edd=_0x202a5d;_0x324173=0xc8;}else{_0x324173=0xce;}_0xad64fd[_0xf5ab('0x2d')](_0x324173);return _0xad64fd[_0xf5ab('0x32')]('Content-Range',_0x6c602e+'-'+_0xa30edd+'/'+_0x202a5d)[_0xf5ab('0x2e')](_0x2cfadb);}return null;};}function patchUpdates(_0x2ea9c3){return function(_0x53ae97){try{jsonpatch[_0xf5ab('0x33')](_0x53ae97,_0x2ea9c3,!![]);}catch(_0x4e23a8){return BPromise[_0xf5ab('0x34')](_0x4e23a8);}return _0x53ae97[_0xf5ab('0x35')]();};}function saveUpdates(_0x23914d,_0x37684c){return function(_0x10db92){if(_0x10db92){return _0x10db92[_0xf5ab('0x36')](_0x23914d)[_0xf5ab('0x23')](function(_0x3488d8){return _0x3488d8;});}return null;};}function removeEntity(_0x2ed05f,_0x429c0a){return function(_0x11ef13){if(_0x11ef13){return _0x11ef13[_0xf5ab('0x37')]()[_0xf5ab('0x23')](function(){var _0x38659c=_0x11ef13[_0xf5ab('0x38')]({'plain':!![]});var _0x290278=_0xf5ab('0x39');return db[_0xf5ab('0x3a')][_0xf5ab('0x37')]({'where':{'type':_0x290278,'resourceId':_0x38659c['id']}})[_0xf5ab('0x23')](function(){return _0x11ef13;});})[_0xf5ab('0x23')](function(){_0x2ed05f[_0xf5ab('0x2d')](0xcc)[_0xf5ab('0x3b')]();});}};}function handleEntityNotFound(_0x46fc20,_0x452a7c){return function(_0x2135e6){if(!_0x2135e6){_0x46fc20['sendStatus'](0x194);}return _0x2135e6;};}function handleError(_0x199fa0,_0x45427a){_0x45427a=_0x45427a||0x1f4;return function(_0x49f704){logger[_0xf5ab('0x27')](_0x49f704[_0xf5ab('0x3c')]);if(_0x49f704[_0xf5ab('0x3d')]){delete _0x49f704[_0xf5ab('0x3d')];}_0x199fa0[_0xf5ab('0x2d')](_0x45427a)['send'](_0x49f704);};}exports[_0xf5ab('0x3e')]=function(_0x820d50,_0x3f964f){var _0x252870={'include':[{'model':db[_0xf5ab('0x3f')],'as':_0xf5ab('0x40')}]},_0xac424a={},_0x2dfccf={'count':0x0,'rows':[]};var _0x27b56d=_['map'](db[_0xf5ab('0x41')][_0xf5ab('0x42')],function(_0x488a60){return{'name':_0x488a60['fieldName'],'type':_0x488a60[_0xf5ab('0x43')][_0xf5ab('0x44')]};});_0xac424a[_0xf5ab('0x45')]=_[_0xf5ab('0x46')](_0x27b56d,_0xf5ab('0x3d'));_0xac424a[_0xf5ab('0x47')]=_[_0xf5ab('0x48')](_0x820d50[_0xf5ab('0x47')]);_0xac424a[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0xac424a[_0xf5ab('0x45')],_0xac424a[_0xf5ab('0x47')]);_0x252870['attributes']=_[_0xf5ab('0x4a')](_0xac424a['model'],qs[_0xf5ab('0x4b')](_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x252870[_0xf5ab('0x4c')]=_0x252870[_0xf5ab('0x4c')]['length']?_0x252870[_0xf5ab('0x4c')]:_0xac424a[_0xf5ab('0x45')];if(!_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x252870['limit']=qs[_0xf5ab('0x31')](_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x252870[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x820d50[_0xf5ab('0x47')]['offset']);}_0x252870[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x252870[_0xf5ab('0x51')]=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x820d50[_0xf5ab('0x47')],_0xac424a[_0xf5ab('0x49')]));if(_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x252870[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x252870[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x27b56d,function(_0x31c574){if(_0x31c574['type']['key']!=='VIRTUAL'){var _0x34c6a6={};_0x34c6a6[_0x31c574['field']]={'$like':'%'+_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x34c6a6;}})});}_0x252870=_[_0xf5ab('0x54')]({},_0x252870,_0x820d50[_0xf5ab('0x55')]);var _0x3966bf={'where':_0x252870[_0xf5ab('0x51')]};return db[_0xf5ab('0x41')][_0xf5ab('0x2f')](_0x3966bf)['then'](function(_0x22c836){_0x2dfccf['count']=_0x22c836;if(_0x820d50['query']['includeAll']){_0x252870['include']=[{'all':!![]}];}return db[_0xf5ab('0x41')]['findAll'](_0x252870);})['then'](function(_0x419f6d){_0x2dfccf[_0xf5ab('0x56')]=_0x419f6d;return _0x2dfccf;})[_0xf5ab('0x23')](respondWithFilteredResult(_0x3f964f,_0x252870))[_0xf5ab('0x2c')](handleError(_0x3f964f,null));};exports[_0xf5ab('0x57')]=function(_0x4fc4d0,_0xb2a4dc){var _0x1186bc={'raw':![],'where':{'id':_0x4fc4d0[_0xf5ab('0x58')]['id']},'include':[{'model':db[_0xf5ab('0x3f')],'as':_0xf5ab('0x40')}]},_0x23c7ba={};_0x23c7ba[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x41')][_0xf5ab('0x42')]);_0x23c7ba['query']=_[_0xf5ab('0x48')](_0x4fc4d0[_0xf5ab('0x47')]);_0x23c7ba[_0xf5ab('0x49')]=_['intersection'](_0x23c7ba[_0xf5ab('0x45')],_0x23c7ba[_0xf5ab('0x47')]);_0x1186bc[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x23c7ba[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x4fc4d0[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x1186bc[_0xf5ab('0x4c')]=_0x1186bc[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x1186bc[_0xf5ab('0x4c')]:_0x23c7ba[_0xf5ab('0x45')];if(_0x4fc4d0[_0xf5ab('0x47')]['includeAll']){_0x1186bc['include']=[{'all':!![]}];}_0x1186bc=_[_0xf5ab('0x54')]({},_0x1186bc,_0x4fc4d0[_0xf5ab('0x55')]);return db[_0xf5ab('0x41')][_0xf5ab('0x5a')](_0x1186bc)['then'](handleEntityNotFound(_0xb2a4dc,null))['then'](respondWithResult(_0xb2a4dc,null))[_0xf5ab('0x2c')](handleError(_0xb2a4dc,null));};exports[_0xf5ab('0x5b')]=function(_0x40b834,_0x1e23c4){return db[_0xf5ab('0x41')]['create'](_0x40b834[_0xf5ab('0x5c')],{})[_0xf5ab('0x23')](function(_0xcd417d){var _0xba4d=_0x40b834[_0xf5ab('0x5d')][_0xf5ab('0x38')]({'plain':!![]});if(!_0xba4d)throw new Error(_0xf5ab('0x5e'));if(_0xba4d[_0xf5ab('0x5f')]===_0xf5ab('0x5d')){var _0x14f010=_0xcd417d[_0xf5ab('0x38')]({'plain':!![]});var _0x310b9c=_0xf5ab('0x39');return db[_0xf5ab('0x60')][_0xf5ab('0x5a')]({'where':{'name':_0x310b9c,'userProfileId':_0xba4d[_0xf5ab('0x61')]},'raw':!![]})[_0xf5ab('0x23')](function(_0x41edf7){if(_0x41edf7&&_0x41edf7['autoAssociation']===0x0){return db[_0xf5ab('0x3a')]['create']({'name':_0x14f010[_0xf5ab('0x3d')],'resourceId':_0x14f010['id'],'type':_0x41edf7['name'],'sectionId':_0x41edf7['id']},{})[_0xf5ab('0x23')](function(){return _0xcd417d;});}else{return _0xcd417d;}})['catch'](function(_0x18d7e7){logger['error'](_0xf5ab('0x62'),_0x18d7e7);throw _0x18d7e7;});}return _0xcd417d;})[_0xf5ab('0x23')](respondWithResult(_0x1e23c4,0xc9))[_0xf5ab('0x2c')](handleError(_0x1e23c4,null));};exports[_0xf5ab('0x36')]=function(_0x1f5624,_0x567de9){if(_0x1f5624['body']['id']){delete _0x1f5624[_0xf5ab('0x5c')]['id'];}return db[_0xf5ab('0x41')]['find']({'where':{'id':_0x1f5624[_0xf5ab('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xf5ab('0x40')}]})[_0xf5ab('0x23')](handleEntityNotFound(_0x567de9,null))[_0xf5ab('0x23')](saveUpdates(_0x1f5624[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x567de9,null))['catch'](handleError(_0x567de9,null));};exports[_0xf5ab('0x37')]=function(_0x34299b,_0x4b9cab){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x34299b[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x4b9cab,null))['then'](removeEntity(_0x4b9cab,null))[_0xf5ab('0x2c')](handleError(_0x4b9cab,null));};exports['describe']=function(_0x167a66,_0x39b5a6){return db[_0xf5ab('0x41')][_0xf5ab('0x63')]()[_0xf5ab('0x23')](respondWithResult(_0x39b5a6,null))['catch'](handleError(_0x39b5a6,null));};exports[_0xf5ab('0x64')]=function(_0x5b77a5,_0x14d7d4,_0x39c155){if(_0x5b77a5['body']['id']){delete _0x5b77a5['body']['id'];}return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x5b77a5[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x14d7d4,null))[_0xf5ab('0x23')](function(_0x4ac216){if(_0x4ac216){_0x5b77a5[_0xf5ab('0x5c')]['ChatWebsiteId']=_0x4ac216['id'];return db['Disposition'][_0xf5ab('0x5b')](_0x5b77a5[_0xf5ab('0x5c')]);}})[_0xf5ab('0x23')](respondWithResult(_0x14d7d4,null))[_0xf5ab('0x2c')](handleError(_0x14d7d4,null));};exports[_0xf5ab('0x65')]=function(_0x1354d7,_0x54d096,_0x208899){var _0x3e3c21={'raw':![],'where':{}};var _0x5e370b={};var _0x3d7d65={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf5ab('0x66')]({'where':{'id':_0x1354d7[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x54d096,null))[_0xf5ab('0x23')](function(_0x37812a){if(_0x37812a){_0x5e370b[_0xf5ab('0x45')]=_['keys'](db[_0xf5ab('0x67')]['rawAttributes']);_0x5e370b[_0xf5ab('0x47')]=_['keys'](_0x1354d7[_0xf5ab('0x47')]);_0x5e370b['filters']=_[_0xf5ab('0x4a')](_0x5e370b[_0xf5ab('0x45')],_0x5e370b[_0xf5ab('0x47')]);_0x3e3c21[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x5e370b[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x1354d7[_0xf5ab('0x47')]['fields']));_0x3e3c21[_0xf5ab('0x4c')]=_0x3e3c21[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x3e3c21[_0xf5ab('0x4c')]:_0x5e370b['model'];if(!_0x1354d7[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x3e3c21[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x1354d7['query'][_0xf5ab('0x31')]);_0x3e3c21['offset']=qs[_0xf5ab('0x30')](_0x1354d7['query'][_0xf5ab('0x30')]);}_0x3e3c21[_0xf5ab('0x4f')]=qs['sort'](_0x1354d7[_0xf5ab('0x47')]['sort']);_0x3e3c21['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x1354d7['query'],_0x5e370b[_0xf5ab('0x49')]));_0x3e3c21[_0xf5ab('0x51')]['ChatWebsiteId']=_0x37812a['id'];if(_0x1354d7['query'][_0xf5ab('0x53')]){_0x3e3c21[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x3e3c21[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x3e3c21[_0xf5ab('0x4c')],function(_0x76bb32){var _0x3eb545={};_0x3eb545[_0x76bb32]={'$like':'%'+_0x1354d7[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x3eb545;})});}_0x3e3c21=_[_0xf5ab('0x54')]({},_0x3e3c21,_0x1354d7[_0xf5ab('0x55')]);return db[_0xf5ab('0x67')][_0xf5ab('0x2f')]({'where':_0x3e3c21[_0xf5ab('0x51')]})['then'](function(_0x5254d6){_0x3d7d65[_0xf5ab('0x2f')]=_0x5254d6;if(_0x1354d7['query']['includeAll']){_0x3e3c21['include']=[{'all':!![]}];}return db[_0xf5ab('0x67')]['findAll'](_0x3e3c21);})['then'](function(_0x395805){_0x3d7d65['rows']=_0x395805;return _0x3d7d65;});}})['then'](respondWithFilteredResult(_0x54d096,_0x3e3c21))['catch'](handleError(_0x54d096,null));};exports[_0xf5ab('0x68')]=function(_0x583995,_0x716a47,_0x486f42){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x583995[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x716a47,null))['then'](function(_0x4c91de){if(_0x4c91de){return _0x4c91de['removeDispositions'](_0x583995[_0xf5ab('0x47')][_0xf5ab('0x69')]);}})[_0xf5ab('0x23')](respondWithStatusCode(_0x716a47,null))['catch'](handleError(_0x716a47,null));};exports['addAnswer']=function(_0x34421f,_0x561066,_0x38f9ba){if(_0x34421f['body']['id']){delete _0x34421f[_0xf5ab('0x5c')]['id'];}return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x34421f[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x561066,null))[_0xf5ab('0x23')](function(_0x4ea453){if(_0x4ea453){_0x34421f['body']['ChatWebsiteId']=_0x4ea453['id'];return db['CannedAnswer'][_0xf5ab('0x5b')](_0x34421f[_0xf5ab('0x5c')]);}})[_0xf5ab('0x23')](respondWithResult(_0x561066,null))[_0xf5ab('0x2c')](handleError(_0x561066,null));};exports[_0xf5ab('0x6a')]=function(_0x39e4b2,_0x33644f,_0x47e4fc){var _0x4ace9b={'raw':![],'where':{}};var _0x3f09f1={};var _0x1a5e4e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x39e4b2[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x33644f,null))[_0xf5ab('0x23')](function(_0x8a5a80){if(_0x8a5a80){_0x3f09f1[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x6b')][_0xf5ab('0x42')]);_0x3f09f1['query']=_[_0xf5ab('0x48')](_0x39e4b2[_0xf5ab('0x47')]);_0x3f09f1['filters']=_[_0xf5ab('0x4a')](_0x3f09f1[_0xf5ab('0x45')],_0x3f09f1['query']);_0x4ace9b[_0xf5ab('0x4c')]=_['intersection'](_0x3f09f1[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x4ace9b[_0xf5ab('0x4c')]=_0x4ace9b[_0xf5ab('0x4c')]['length']?_0x4ace9b[_0xf5ab('0x4c')]:_0x3f09f1['model'];if(!_0x39e4b2[_0xf5ab('0x47')]['hasOwnProperty'](_0xf5ab('0x4e'))){_0x4ace9b['limit']=qs[_0xf5ab('0x31')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x4ace9b[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x30')]);}_0x4ace9b[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x4ace9b[_0xf5ab('0x51')]=qs[_0xf5ab('0x49')](_['pick'](_0x39e4b2[_0xf5ab('0x47')],_0x3f09f1[_0xf5ab('0x49')]));_0x4ace9b[_0xf5ab('0x51')][_0xf5ab('0x6c')]=_0x8a5a80['id'];if(_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x4ace9b[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x4ace9b[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x4ace9b['attributes'],function(_0x36a463){var _0x3eb79d={};_0x3eb79d[_0x36a463]={'$like':'%'+_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x3eb79d;})});}_0x4ace9b=_[_0xf5ab('0x54')]({},_0x4ace9b,_0x39e4b2['options']);return db['CannedAnswer'][_0xf5ab('0x2f')]({'where':_0x4ace9b['where']})[_0xf5ab('0x23')](function(_0x1da7a3){_0x1a5e4e['count']=_0x1da7a3;if(_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x6d')]){_0x4ace9b['include']=[{'all':!![]}];}return db[_0xf5ab('0x6b')]['findAll'](_0x4ace9b);})[_0xf5ab('0x23')](function(_0xb1fd91){_0x1a5e4e['rows']=_0xb1fd91;return _0x1a5e4e;});}})[_0xf5ab('0x23')](respondWithFilteredResult(_0x33644f,_0x4ace9b))['catch'](handleError(_0x33644f,null));};exports[_0xf5ab('0x6e')]=function(_0x3ad84e,_0x40cfcc,_0x5b9862){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x3ad84e[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x40cfcc,null))[_0xf5ab('0x23')](function(_0xfc540e){if(_0xfc540e){return _0xfc540e['removeAnswers'](_0x3ad84e['query'][_0xf5ab('0x69')]);}})['then'](respondWithStatusCode(_0x40cfcc,null))['catch'](handleError(_0x40cfcc,null));};exports[_0xf5ab('0x6f')]=function(_0x40e731,_0x9491a6,_0x1f858b){_0x40e731[_0xf5ab('0x5c')][_0xf5ab('0x70')]=_0x40e731[_0xf5ab('0x71')][_0xf5ab('0x72')];return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x40e731[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x9491a6,null))[_0xf5ab('0x23')](saveUpdates(_0x40e731[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x9491a6,null))[_0xf5ab('0x2c')](handleError(_0x9491a6,null));};exports[_0xf5ab('0x73')]=function(_0x282c76,_0x14ac46,_0x3ffbcc){_0x282c76[_0xf5ab('0x5c')][_0xf5ab('0x74')]=_0x282c76[_0xf5ab('0x71')][_0xf5ab('0x72')];return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x282c76[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x14ac46,null))[_0xf5ab('0x23')](saveUpdates(_0x282c76[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x14ac46,null))[_0xf5ab('0x2c')](handleError(_0x14ac46,null));};exports[_0xf5ab('0x75')]=function(_0x3c8f19,_0x4c7448,_0x73a4eb){_0x3c8f19['body']['customerAvatar']=_0x3c8f19[_0xf5ab('0x71')][_0xf5ab('0x72')];return db[_0xf5ab('0x41')]['find']({'where':{'id':_0x3c8f19[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x4c7448,null))[_0xf5ab('0x23')](saveUpdates(_0x3c8f19[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x4c7448,null))['catch'](handleError(_0x4c7448,null));};exports['addSystemAvatar']=function(_0x12da5e,_0x681cf,_0x48a6e7){_0x12da5e[_0xf5ab('0x5c')][_0xf5ab('0x76')]=_0x12da5e['file'][_0xf5ab('0x72')];return db['ChatWebsite'][_0xf5ab('0x5a')]({'where':{'id':_0x12da5e['params']['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x681cf,null))['then'](saveUpdates(_0x12da5e[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x681cf,null))['catch'](handleError(_0x681cf,null));};exports['getLogo']=function(_0x2fba17,_0x282ace,_0x39ce1d){var _0x46bb97=path['join'](config[_0xf5ab('0x77')],_0xf5ab('0x78'));var _0x2febeb={'where':{'id':_0x2fba17[_0xf5ab('0x58')]['id']},'attributes':['id',_0xf5ab('0x70')],'raw':!![]};var _0x535442=![];return require(_0xf5ab('0x79'))[_0xf5ab('0x7a')]()[_0xf5ab('0x23')](function(_0xe8e72c){if(_0xe8e72c){_0x535442=_0xe8e72c[_0xf5ab('0x7b')];}})[_0xf5ab('0x23')](function(){return db[_0xf5ab('0x41')]['find'](_0x2febeb);})['then'](handleEntityNotFound(_0x282ace,null))[_0xf5ab('0x23')](function(_0x220d65){if(_0x220d65){if(!_[_0xf5ab('0x7c')](_0x220d65[_0xf5ab('0x70')])){if(fs['existsSync'](path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x7e'),_0x220d65[_0xf5ab('0x70')]))&&_0x535442){_0x46bb97=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x7e'),_0x220d65['sitepic']);}}return _0x282ace[_0xf5ab('0x7f')](_0x46bb97);}})[_0xf5ab('0x2c')](handleError(_0x282ace,null));};exports[_0xf5ab('0x80')]=function(_0x1897e9,_0x1c5cf6,_0xb60c3e){var _0x58eee0=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x81'));var _0x4e70f4={'where':{'id':_0x1897e9[_0xf5ab('0x58')]['id']},'attributes':['id',_0xf5ab('0x74')],'raw':!![]};return db[_0xf5ab('0x41')][_0xf5ab('0x5a')](_0x4e70f4)[_0xf5ab('0x23')](handleEntityNotFound(_0x1c5cf6,null))[_0xf5ab('0x23')](function(_0x562a3b){if(_0x562a3b){if(!_['isNil'](_0x562a3b['agentAvatar'])){if(fs['existsSync'](path[_0xf5ab('0x7d')](config['root'],_0xf5ab('0x82'),_0x562a3b[_0xf5ab('0x74')]))){_0x58eee0=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x82'),_0x562a3b['agentAvatar']);}}return _0x1c5cf6[_0xf5ab('0x7f')](_0x58eee0);}})['catch'](handleError(_0x1c5cf6,null));};exports['getCustomerAvatar']=function(_0x111522,_0x339bbd,_0x8b0b90){var _0x418ab3=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],'server/files/images/avatars/customer_avatar.png');var _0x4f1e4f={'where':{'id':_0x111522['params']['id']},'attributes':['id',_0xf5ab('0x83'),_0xf5ab('0x84')],'raw':!![]};return db['ChatWebsite'][_0xf5ab('0x5a')](_0x4f1e4f)[_0xf5ab('0x23')](handleEntityNotFound(_0x339bbd,null))[_0xf5ab('0x23')](function(_0x1aa8da){if(_0x1aa8da){if(!_[_0xf5ab('0x7c')](_0x1aa8da[_0xf5ab('0x83')])){if(fs['existsSync'](path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x82'),_0x1aa8da[_0xf5ab('0x83')]))&&_0x1aa8da[_0xf5ab('0x84')]){_0x418ab3=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x82'),_0x1aa8da[_0xf5ab('0x83')]);}}return _0x339bbd['download'](_0x418ab3);}})[_0xf5ab('0x2c')](handleError(_0x339bbd,null));};exports[_0xf5ab('0x85')]=function(_0x2c9168,_0x534fce,_0x3667c2){var _0x3a038e=path[_0xf5ab('0x7d')](config['root'],_0xf5ab('0x86'));var _0x42ce91={'where':{'id':_0x2c9168[_0xf5ab('0x58')]['id']},'attributes':['id',_0xf5ab('0x76')],'raw':!![]};return db[_0xf5ab('0x41')][_0xf5ab('0x5a')](_0x42ce91)['then'](handleEntityNotFound(_0x534fce,null))[_0xf5ab('0x23')](function(_0x53502e){if(_0x53502e){if(!_[_0xf5ab('0x7c')](_0x53502e['systemAvatar'])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/avatars/',_0x53502e['systemAvatar']))){_0x3a038e=path[_0xf5ab('0x7d')](config['root'],_0xf5ab('0x82'),_0x53502e[_0xf5ab('0x76')]);}}return _0x534fce[_0xf5ab('0x7f')](_0x3a038e);}})[_0xf5ab('0x2c')](handleError(_0x534fce,null));};exports['notify']=function(_0x966a7d,_0x1407af,_0x447668){var _0x251107=require(_0xf5ab('0x87'));var _0x3b62af=new _0x251107();var _0x418a2c=_0x3b62af['setUA'](_0x966a7d[_0xf5ab('0x88')][_0xf5ab('0x89')])[_0xf5ab('0x8a')]();var _0x509639={'body':_0x966a7d[_0xf5ab('0x5c')],'channel':_0xf5ab('0x8b')};var _0x21690c=[];var _0x35aede=[];var _0x280a25={};var _0x392c94=![];return db['CmContact'][_0xf5ab('0x63')]()[_0xf5ab('0x23')](function(_0x5b1fec){if(!_0x5b1fec){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('no\x20available\x20attributes');}_0x21690c=_[_0xf5ab('0x8e')](_[_0xf5ab('0x48')](_0x5b1fec),[_0xf5ab('0x8f'),_0xf5ab('0x90')]);_0x35aede=_[_0xf5ab('0x8e')](_[_0xf5ab('0x48')](_0x5b1fec),[_0xf5ab('0x8f'),_0xf5ab('0x90'),_0xf5ab('0x91'),'ListId']);if(_0x966a7d[_0xf5ab('0x5c')]['id']){delete _0x966a7d[_0xf5ab('0x5c')]['id'];}if(_[_0xf5ab('0x7c')](_0x966a7d[_0xf5ab('0x5c')]['from'])){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('from\x20is\x20mandatory');}if(_[_0xf5ab('0x7c')](_0x966a7d[_0xf5ab('0x5c')]['body'])||_0x966a7d['body'][_0xf5ab('0x5c')]===''){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf5ab('0x7c')](_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')])){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))](_0xf5ab('0x93')+_0x35aede);}if(!_[_0xf5ab('0x94')](_0x35aede,_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')])){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35aede);}_0x280a25[_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')]]=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x95')];})['then'](function(){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x966a7d['params']['id']},'include':[{'model':db['CmList'],'as':_0xf5ab('0x96'),'include':[{'model':db[_0xf5ab('0x97')],'as':_0xf5ab('0x98'),'where':_0x280a25,'limit':0x1,'order':[['updatedAt',_0xf5ab('0x99')]]}]},{'model':db[_0xf5ab('0x9a')],'as':_0xf5ab('0x9b')}]});})[_0xf5ab('0x23')](handleEntityNotFound(_0x1407af,null))[_0xf5ab('0x23')](function(_0x2ab22c){if(_0x2ab22c&&_0x2ab22c['List']){_0x509639['account']=_0x2ab22c;_0x509639['applications']=_0x2ab22c['Applications'];_0x509639['list']=_0x2ab22c[_0xf5ab('0x96')];_0x509639[_0xf5ab('0x9c')]=_[_0xf5ab('0x9d')](_0x509639['applications'],[_0xf5ab('0x9e')],[_0xf5ab('0x9f')]);if(_0x509639['account'][_0xf5ab('0x9b')]){delete _0x509639['account'][_0xf5ab('0x9b')];}if(_0x509639[_0xf5ab('0xa0')][_0xf5ab('0x96')]&&_0x509639['account'][_0xf5ab('0x96')][_0xf5ab('0x98')][_0xf5ab('0x59')]){return _0x509639[_0xf5ab('0xa0')]['List']['Contacts'][0x0];}var _0x30116b=_[_0xf5ab('0x19')](_0x966a7d[_0xf5ab('0x5c')],{'firstName':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x95')],'ListId':_0x2ab22c[_0xf5ab('0xa1')]});_0x30116b[_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')]]=_0x966a7d[_0xf5ab('0x5c')]['from'];return db['CmContact'][_0xf5ab('0x5b')](_0x30116b,{'fields':_0x21690c,'raw':!![]});}})[_0xf5ab('0x23')](handleEntityNotFound(_0x1407af,null))['then'](function(_0x5cac2f){_0x509639[_0xf5ab('0xa2')]=_0x5cac2f;var _0x382ab1=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xa3')];if(_0x966a7d['headers']['cf-connecting-ip']){_0x382ab1=_0x966a7d['headers']['cf-connecting-ip'];}else if(_0x966a7d['headers'][_0xf5ab('0xa4')]){_0x382ab1=_[_0xf5ab('0xa5')](_0x966a7d['headers']['x-forwarded-for'][_0xf5ab('0xa6')](','));}if(_0x5cac2f){var _0x5901a4={'ContactId':_0x5cac2f['id'],'ChatWebsiteId':_0x966a7d['params']['id'],'from':(_0x5cac2f['firstName']||'')+'\x20'+(_0x5cac2f[_0xf5ab('0xa7')]||''),'customerIp':_0x382ab1,'customerPort':_0x966a7d['headers'][_0xf5ab('0xa8')]?_0x966a7d[_0xf5ab('0x88')][_0xf5ab('0xa8')]:null,'referer':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xa9')],'browserName':_0x418a2c['browser']['name']&&_0x418a2c[_0xf5ab('0xaa')]['version']?util['format'](_0xf5ab('0xab'),_0x418a2c[_0xf5ab('0xaa')]['name'],_0x418a2c[_0xf5ab('0xaa')][_0xf5ab('0xac')]):_0xf5ab('0xad'),'browserVersion':_0x418a2c[_0xf5ab('0xaa')][_0xf5ab('0xac')]||'unknown','osName':util[_0xf5ab('0xae')](_0xf5ab('0xab'),_0x418a2c['os'][_0xf5ab('0x3d')],_0x418a2c['os'][_0xf5ab('0xac')]),'osVersion':_0x418a2c['os'][_0xf5ab('0xac')],'deviceModel':_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0x45')]&&_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0xb0')]?util['format'](_0xf5ab('0xb1'),_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0x45')],_0x418a2c['device'][_0xf5ab('0xb0')],_0x418a2c['device'][_0xf5ab('0x43')]):null,'deviceVendor':_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0xb0')],'deviceType':_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0x43')],'formData':JSON['stringify'](_0x966a7d[_0xf5ab('0x5c')])};var _0x29468d={'ChatWebsiteId':_0x966a7d[_0xf5ab('0x58')]['id'],'closed':![]};if(_0x966a7d[_0xf5ab('0x5c')]['threadId']){_0x29468d['threadId']=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb2')];return db[_0xf5ab('0xb3')][_0xf5ab('0x5a')]({'where':_0x29468d})['then'](function(_0x261e69){if(_0x261e69){return[_0x261e69,![]];}_0x5901a4[_0xf5ab('0xb2')]=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb2')];_0x5901a4[_0xf5ab('0xb4')]=_0x966a7d[_0xf5ab('0x5c')]['externalUrl'];return db[_0xf5ab('0xb3')]['create'](_0x5901a4)[_0xf5ab('0x23')](function(_0x527b33){return[_0x527b33,!![]];});});}_0x29468d[_0xf5ab('0xb5')]=_0x5cac2f['id'];if(_0x966a7d['body'][_0xf5ab('0xb6')]&&_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb6')]['id']){_0x29468d['id']=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb6')]['id'];return db[_0xf5ab('0xb3')][_0xf5ab('0x5a')]({'where':_0x29468d})['then'](function(_0x396137){if(_0x396137){return[_0x396137,![]];}return db[_0xf5ab('0xb3')][_0xf5ab('0x5b')](_0x5901a4)[_0xf5ab('0x23')](function(_0x3179d1){return[_0x3179d1,!![]];});});}return db[_0xf5ab('0xb3')]['create'](_0x5901a4)[_0xf5ab('0x23')](function(_0x34f918){return[_0x34f918,!![]];});}})[_0xf5ab('0xb7')](function(_0x1f231b,_0x2b420b){if(_0x1f231b){_0x392c94=_0x2b420b;if(!_0x2b420b){var _0x2295b3={'from':(_0x509639[_0xf5ab('0xa2')][_0xf5ab('0xb8')]||'')+'\x20'+(_0x509639[_0xf5ab('0xa2')]['lastName']||'')};if(_0x966a7d['body'][_0xf5ab('0xb2')]&&_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb9')]&&_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb2')]!=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb9')]){_0x2295b3['threadId']=_0x966a7d[_0xf5ab('0x5c')]['messageId'];}return _0x1f231b[_0xf5ab('0x36')](_0x2295b3);}else{return _0x1f231b;}}})[_0xf5ab('0x23')](function(_0x36510a){_0x509639['interaction']=_0x36510a[_0xf5ab('0x38')]({'plain':!![]});_0x509639[_0xf5ab('0xb6')][_0xf5ab('0xba')]=_0x392c94;if(_0x509639[_0xf5ab('0xb6')][_0xf5ab('0xba')]){if(_0x509639[_0xf5ab('0xa0')]['autoclose']){_0x509639[_0xf5ab('0x9c')][_0xf5ab('0xbb')]({'id':0x0,'priority':_0x509639[_0xf5ab('0x9c')][_0xf5ab('0x59')]+0x1,'app':_0xf5ab('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0xf5ab('0x5b')]({'body':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x5c')],'ChatWebsiteId':_0x966a7d[_0xf5ab('0x58')]['id'],'ChatInteractionId':_0x36510a['id'],'direction':'in','ContactId':_0x509639[_0xf5ab('0xa2')]['id'],'AttachmentId':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xbd')]});})[_0xf5ab('0x23')](function(_0x21d23b){_0x509639['message']=_0x21d23b;if(_0x509639['interaction'][_0xf5ab('0xbe')]){return db['User']['find']({'attributes':['id',_0xf5ab('0x3d')],'where':{'id':_0x509639[_0xf5ab('0xb6')]['UserId']}})['then'](function(_0x4e150a){if(_0x4e150a){_0x509639[_0xf5ab('0x9c')][_0xf5ab('0xbf')]({'id':0x0,'priority':0x0,'app':_0xf5ab('0xc0'),'appdata':_0x4e150a[_0xf5ab('0x3d')]+','+(_0x509639[_0xf5ab('0xa0')][_0xf5ab('0xc1')]||0xa),'interval':_0xf5ab('0xc2')});_0x509639[_0xf5ab('0xc3')]=!![];}return respondWithRpcPromise(_0xf5ab('0xc4'),_0xf5ab('0xc5'),_0x509639);});}return respondWithRpcPromise(_0xf5ab('0xc4'),_0xf5ab('0xc5'),_0x509639);})['then'](function(_0x3d1325){respondWithRpcPromise('EventManager',_0xf5ab('0xc6'),{'event':_0xf5ab('0xc7'),'message':_0x3d1325},client9002);return _0x3d1325;})[_0xf5ab('0x23')](respondWithResult(_0x1407af,null))[_0xf5ab('0x2c')](handleError(_0x1407af,null));};exports[_0xf5ab('0xc8')]=function(_0x7bda62,_0x5b9b41,_0x3e38aa){var _0x44f453,_0xee4c66,_0x248dbe;var _0x2db41a=[];var _0x31f64a=[];var _0x4b66db={};return db[_0xf5ab('0x97')][_0xf5ab('0x63')]()[_0xf5ab('0x23')](function(_0xa885f6){if(!_0xa885f6){throw new db['Sequelize'][(_0xf5ab('0x8d'))](_0xf5ab('0xc9'));}_0x31f64a=_[_0xf5ab('0x8e')](_['keys'](_0xa885f6),['createdAt',_0xf5ab('0x90')]);_0x2db41a=_[_0xf5ab('0x8e')](_[_0xf5ab('0x48')](_0xa885f6),[_0xf5ab('0x8f'),'updatedAt','CompanyId',_0xf5ab('0xa1')]);if(_0x7bda62[_0xf5ab('0x5c')]['id']){delete _0x7bda62[_0xf5ab('0x5c')]['id'];}if(_[_0xf5ab('0x7c')](_0x7bda62['body'][_0xf5ab('0x95')])){throw _0x5b9b41['status'](0x1f4)[_0xf5ab('0xca')](new db['Sequelize']['ValidationError'](_0xf5ab('0xcb')));}if(_['isNil'](_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x5c')])||_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x5c')]===''){throw _0x5b9b41[_0xf5ab('0x2d')](0x1f4)['send'](new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))](_0xf5ab('0xcc')));}if(_[_0xf5ab('0x7c')](_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0xcd')])){throw _0x5b9b41[_0xf5ab('0x2d')](0x1f4)[_0xf5ab('0xca')](new db[(_0xf5ab('0x8c'))]['ValidationError'](_0xf5ab('0xce')+_0x2db41a));}if(!_[_0xf5ab('0x94')](_0x2db41a,_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0xcd')])){throw _0x5b9b41['status'](0x1f4)[_0xf5ab('0xca')](new db[(_0xf5ab('0x8c'))]['ValidationError'](_0xf5ab('0xcf')+_0x2db41a));}_0x4b66db[_0x7bda62['body'][_0xf5ab('0xcd')]]=_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x95')];})[_0xf5ab('0x23')](function(){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x7bda62[_0xf5ab('0x58')]['id']},'include':[{'model':db[_0xf5ab('0xd0')],'as':_0xf5ab('0x96')}]});})[_0xf5ab('0x23')](handleEntityNotFound(_0x5b9b41,null))[_0xf5ab('0x23')](function(_0x19607a){if(_0x19607a&&_0x19607a['List']){_0xee4c66=_0x19607a;var _0x164bb5=_[_0xf5ab('0x19')](_0x7bda62[_0xf5ab('0x5c')],{'firstName':_0x7bda62['body'][_0xf5ab('0x95')],'phone':_0x7bda62['body'][_0xf5ab('0x95')],'ListId':_0x19607a[_0xf5ab('0xa1')]});_0x164bb5[_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0xcd')]]=_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x95')];return db[_0xf5ab('0x97')][_0xf5ab('0xd1')]({'where':_0x4b66db,'defaults':_0x164bb5});}})[_0xf5ab('0xb7')](function(_0x3f44eb){if(_0x3f44eb){_0x248dbe=_0x3f44eb;var _0x44651a=fs[_0xf5ab('0xd2')](path[_0xf5ab('0x7d')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x455388=ejs['render'](_0x44651a,{'body':_['toPairs'](_0x7bda62['body'][_0xf5ab('0x5c')]),'bodyTitle':_0xee4c66[_0xf5ab('0xd3')]});return db[_0xf5ab('0xd4')][_0xf5ab('0x5b')]({'body':_0x455388,'ContactId':_0x3f44eb['id'],'ChatWebsiteId':_0xee4c66['id']});}})[_0xf5ab('0x23')](function(_0x4b3f87){if(_0x4b3f87){_0x44f453=_0x4b3f87;return db[_0xf5ab('0xd5')][_0xf5ab('0x66')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf5ab('0xd6'),'raw':!![]}]});}})[_0xf5ab('0x23')](function(_0x1a18b1){if(_0x1a18b1&&_0x1a18b1[_0xf5ab('0xd6')]&&_0xee4c66['forwardOfflineAddress']){var _0x1fbaa6={'tls':{'rejectUnauthorized':![]}};if(_0x1a18b1[_0xf5ab('0xd6')]['service']){_0x1fbaa6['service']=_0x1a18b1[_0xf5ab('0xd6')]['service'];}else{_0x1fbaa6[_0xf5ab('0xd7')]=_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xd7')];_0x1fbaa6[_0xf5ab('0xd8')]=_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xd8')];_0x1fbaa6['secure']=_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xd9')];}if(_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xda')]){_0x1fbaa6['auth']={'user':_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0x5d')],'pass':_0x1a18b1[_0xf5ab('0xd6')]['pass']};}return respondWithRpcPromise(_0xf5ab('0xdb'),_0xf5ab('0xdc'),{'account':_0x1fbaa6,'message':{'from':util[_0xf5ab('0xae')](_0xf5ab('0xdd'),_0x1a18b1[_0xf5ab('0x3d')],_0x1a18b1[_0xf5ab('0xde')]||_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0x5d')]),'to':_0xee4c66[_0xf5ab('0xdf')],'subject':_0xee4c66['offlineMessageSubject'],'text':_0x44f453['body']}},client9003)[_0xf5ab('0x23')](function(){return _0x44f453;})[_0xf5ab('0x2c')](function(_0x373935){console[_0xf5ab('0x27')](_0x373935);});}})[_0xf5ab('0x23')](function(){if(_0x44f453){return _0x44f453;}})[_0xf5ab('0x23')](respondWithResult(_0x5b9b41,null))[_0xf5ab('0x2c')](handleError(_0x5b9b41,null));};exports[_0xf5ab('0xe0')]=function(_0x1fa1d5,_0x122d2d,_0x20e3ab){return db['ChatInteraction'][_0xf5ab('0x5a')]({'where':{'id':_0x1fa1d5[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x122d2d,null))[_0xf5ab('0x23')](function(_0x3a73fb){if(_0x3a73fb){return _0x3a73fb['addInteraction'](_0x1fa1d5['body'][_0xf5ab('0x69')],_['omit'](_0x1fa1d5[_0xf5ab('0x5c')],[_0xf5ab('0x69'),'id'])||{});}})['then'](respondWithResult(_0x122d2d,null))[_0xf5ab('0x2c')](handleError(_0x122d2d,null));};exports['getInteractions']=function(_0x575fe7,_0x500e4,_0x5b4140){var _0x5b4d91={'raw':![],'where':{}};var _0x46db93={};var _0x73eae8={'count':0x0,'rows':[]};return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x575fe7[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x500e4,null))['then'](function(_0xc19969){if(_0xc19969){_0x46db93[_0xf5ab('0x45')]=_['keys'](db[_0xf5ab('0xb3')]['rawAttributes']);_0x46db93['query']=_[_0xf5ab('0x48')](_0x575fe7[_0xf5ab('0x47')]);_0x46db93[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0x46db93[_0xf5ab('0x45')],_0x46db93[_0xf5ab('0x47')]);_0x5b4d91['attributes']=_[_0xf5ab('0x4a')](_0x46db93[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x575fe7[_0xf5ab('0x47')]['fields']));_0x5b4d91[_0xf5ab('0x4c')]=_0x5b4d91['attributes'][_0xf5ab('0x59')]?_0x5b4d91['attributes']:_0x46db93['model'];if(!_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x5b4d91[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x575fe7['query']['limit']);_0x5b4d91['offset']=qs[_0xf5ab('0x30')](_0x575fe7['query'][_0xf5ab('0x30')]);}_0x5b4d91[_0xf5ab('0x4f')]=qs['sort'](_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x5b4d91[_0xf5ab('0x51')]=qs['filters'](_[_0xf5ab('0x52')](_0x575fe7['query'],_0x46db93[_0xf5ab('0x49')]));_0x5b4d91['where'][_0xf5ab('0x6c')]=_0xc19969['id'];if(_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x5b4d91['where']=_[_0xf5ab('0x54')](_0x5b4d91[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x5b4d91['attributes'],function(_0x33c27f){var _0x4a82b8={};_0x4a82b8[_0x33c27f]={'$like':'%'+_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x4a82b8;})});}_0x5b4d91=_[_0xf5ab('0x54')]({},_0x5b4d91,_0x575fe7[_0xf5ab('0x55')]);return db[_0xf5ab('0xb3')]['count']({'where':_0x5b4d91[_0xf5ab('0x51')]})[_0xf5ab('0x23')](function(_0x2785b2){_0x73eae8[_0xf5ab('0x2f')]=_0x2785b2;if(_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x6d')]){_0x5b4d91[_0xf5ab('0xe1')]=[{'model':db[_0xf5ab('0x97')],'as':_0xf5ab('0xe2'),'required':![]},{'model':db[_0xf5ab('0xe3')],'as':_0xf5ab('0xe4'),'attributes':[_0xf5ab('0x3d'),_0xf5ab('0xe5'),'internal'],'required':![]},{'model':db[_0xf5ab('0xe6')],'as':_0xf5ab('0xe7'),'attributes':['id',_0xf5ab('0x3d'),_0xf5ab('0xe8')],'where':_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0xe9')]?{'id':_0x575fe7[_0xf5ab('0x47')]['tag']}:undefined,'required':_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0xe9')]?!![]:![]}];}return db[_0xf5ab('0xb3')][_0xf5ab('0xea')](_0x5b4d91);})['then'](function(_0x316e62){_0x73eae8[_0xf5ab('0x56')]=_0x316e62;return _0x73eae8;});}})[_0xf5ab('0x23')](respondWithFilteredResult(_0x500e4,_0x5b4d91))[_0xf5ab('0x2c')](handleError(_0x500e4,null));};function iftimePromise(_0x5e2dcb,_0x4ea06e){return respondWithRpcPromise(_0xf5ab('0xeb'),_0xf5ab('0xec'),{'command':_0x4ea06e[_0xf5ab('0xed')]?util[_0xf5ab('0xae')](_0xf5ab('0xee'),_0x5e2dcb[_0xf5ab('0xef')],_0x4ea06e['timezone']):util[_0xf5ab('0xae')](_0xf5ab('0xf0'),_0x5e2dcb[_0xf5ab('0xef')])},client9002)[_0xf5ab('0x23')](function(_0xfc5817){var _0x404515=_0xfc5817&&_0xfc5817[_0xf5ab('0xf1')](_0xf5ab('0xf2'))>=0x0?!![]:![];logger['info'](_0xf5ab('0xf3'),_0x4ea06e['id'],_0x5e2dcb['id'],_0x5e2dcb[_0xf5ab('0xef')],_0x404515?_0xf5ab('0xf4'):_0xf5ab('0xf5'),_0x4ea06e['timezone']?_0x4ea06e[_0xf5ab('0xed')]:_0xf5ab('0xf6'));return _0x404515;})['catch'](function(_0x57fcc2){logger[_0xf5ab('0x27')](_0xf5ab('0xf3'),_0x4ea06e['id'],_0x5e2dcb['id'],_0x5e2dcb[_0xf5ab('0xef')],util[_0xf5ab('0xf7')](_0x57fcc2,{'showHidden':![],'depth':null}),_0x4ea06e[_0xf5ab('0xed')]?_0x4ea06e['timezone']:_0xf5ab('0xf6'));return![];});}exports[_0xf5ab('0xec')]=function(_0x10ded8,_0x2f7c8c,_0x4de49d){var _0x49c0d5=0x0;var _0x234a27=0x0;var _0x55297f=![];var _0x323ed4;var _0x1c9b36;return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x10ded8[_0xf5ab('0x58')]['id']},'include':[{'model':db[_0xf5ab('0xf8')],'as':_0xf5ab('0xf8'),'include':[{'model':db[_0xf5ab('0xf8')],'as':_0xf5ab('0xf9'),'attributes':['id',_0xf5ab('0xef')],'raw':!![]}]}]})[_0xf5ab('0x23')](handleEntityNotFound(_0x2f7c8c,null))['then'](function(_0x273291){if(_0x273291){_0x323ed4=_0x273291;return _0x273291[_0xf5ab('0xfa')]({'raw':!![]});}})[_0xf5ab('0x23')](function(_0x28fca9){if(_0x323ed4){if(_0x28fca9){_0x1c9b36=_0x28fca9;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0xfc4f67){if(_0xfc4f67){_0x234a27=_0xfc4f67['virtual'];_0x55297f=_0xfc4f67[_0xf5ab('0x7b')];}})[_0xf5ab('0x23')](function(){return db[_0xf5ab('0xb3')][_0xf5ab('0x2f')]({'where':{'closed':![]}});})[_0xf5ab('0x23')](function(_0x50f5f2){_0x49c0d5=_0x50f5f2;if(_0x234a27&&_0x50f5f2>_0x234a27){return db[_0xf5ab('0xfb')]['findOne']({'where':{'id':0x1}})[_0xf5ab('0x23')](function(_0x5aacbf){if(_0x5aacbf){_0x5aacbf['increment'](_0xf5ab('0xfc'));}});}})[_0xf5ab('0x23')](function(){if(_0x323ed4[_0xf5ab('0xf8')]&&_0x323ed4[_0xf5ab('0xf8')][_0xf5ab('0xf9')]){var _0x547af5=[];for(var _0xe2c6c3=0x0;_0xe2c6c3<_0x323ed4[_0xf5ab('0xf8')][_0xf5ab('0xf9')][_0xf5ab('0x59')];_0xe2c6c3++){var _0x234aed=_0x323ed4[_0xf5ab('0xf8')][_0xf5ab('0xf9')][_0xe2c6c3][_0xf5ab('0x38')]({'plain':!![]});_0x547af5[_0xf5ab('0xbb')](iftimePromise(_0x234aed,_0x323ed4));}return BPromise['all'](_0x547af5)[_0xf5ab('0x23')](function(_0x26505a){return _[_0xf5ab('0xfd')](_0x26505a);});}else{return!![];}})[_0xf5ab('0x23')](function(_0x35ab6d){var _0x15479b=fs['readFileSync'](path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0xfe')),_0xf5ab('0xff'));var _0x2e6dda={'remote':_0x323ed4[_0xf5ab('0x100')],'query':querystring[_0xf5ab('0x26')](_[_0xf5ab('0x54')](_0x323ed4['get']({'plain':!![]}),{'customerIp':_0x10ded8['headers'][_0xf5ab('0xa4')]||_0x10ded8['headers'][_0xf5ab('0x101')]||_0x10ded8[_0xf5ab('0x102')][_0xf5ab('0x103')]||_0x10ded8['ip'],'referer':_0x10ded8[_0xf5ab('0x88')][_0xf5ab('0xa9')],'openedInteractions':_0x49c0d5,'maxInteractions':_0x234a27,'virtual':_0x55297f['virtual'],'online':_0x35ab6d,'custom':_0x55297f}))[_0xf5ab('0x104')](/'/g,'\x5c\x27')};_0x2f7c8c[_0xf5ab('0xca')](ejs[_0xf5ab('0x105')](Mustache[_0xf5ab('0x105')](_0x15479b,_0x2e6dda),{'proactiveActions':_0x1c9b36,'alignment':_0x323ed4[_0xf5ab('0x106')],'verticalAlignment':_0x323ed4[_0xf5ab('0x107')]}));})[_0xf5ab('0x2c')](handleError(_0x2f7c8c,null));};exports[_0xf5ab('0x108')]=function(_0x220058,_0x2cdf17,_0x5a2b40){return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x220058[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x2cdf17,null))['then'](function(_0x5d4d74){if(_0x5d4d74){return db[_0xf5ab('0x109')]['transaction'](function(_0x4b02f1){return db['ChatApplication'][_0xf5ab('0x37')]({'where':{'ChatWebsiteId':_0x220058['params']['id']},'transaction':_0x4b02f1})[_0xf5ab('0x23')](function(_0x12db3d){var _0x549689=_['map'](_0x220058[_0xf5ab('0x5c')],function(_0xa323be){_0xa323be['ChatWebsiteId']=_0x220058[_0xf5ab('0x58')]['id'];return _0xa323be;});return db[_0xf5ab('0x9a')][_0xf5ab('0x10a')](_0x549689,{'transaction':_0x4b02f1});});})['then'](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x220058[_0xf5ab('0x58')]['id']},'order':_0xf5ab('0x9e')});});}})[_0xf5ab('0x23')](respondWithResult(_0x2cdf17,null))[_0xf5ab('0x2c')](handleError(_0x2cdf17,null));};exports[_0xf5ab('0x10b')]=function(_0x392b4f,_0x4bf9eb,_0x30e7bd){var _0x5af57d={};var _0x3a32d4={};var _0x4ff90d;var _0x9279b0;return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x392b4f[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x4bf9eb,null))[_0xf5ab('0x23')](function(_0x8a91c1){if(_0x8a91c1){_0x4ff90d=_0x8a91c1;_0x3a32d4[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x9a')]['rawAttributes']);_0x3a32d4['query']=_[_0xf5ab('0x48')](_0x392b4f[_0xf5ab('0x47')]);_0x3a32d4[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0x3a32d4[_0xf5ab('0x45')],_0x3a32d4['query']);_0x5af57d[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x3a32d4[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x5af57d[_0xf5ab('0x4c')]=_0x5af57d[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x5af57d[_0xf5ab('0x4c')]:_0x3a32d4[_0xf5ab('0x45')];_0x5af57d[_0xf5ab('0x4f')]=qs['sort'](_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x5af57d['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x392b4f[_0xf5ab('0x47')],_0x3a32d4[_0xf5ab('0x49')]));if(_0x392b4f[_0xf5ab('0x47')]['filter']){_0x5af57d[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x5af57d[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x5af57d[_0xf5ab('0x4c')],function(_0x559e80){var _0xf1ba4={};_0xf1ba4[_0x559e80]={'$like':'%'+_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0xf1ba4;})});}_0x5af57d=_[_0xf5ab('0x54')]({},_0x5af57d,_0x392b4f[_0xf5ab('0x55')]);return _0x4ff90d[_0xf5ab('0x10b')](_0x5af57d);}})[_0xf5ab('0x23')](function(_0x135936){if(_0x135936){_0x9279b0=_0x135936['length'];if(!_0x392b4f[_0xf5ab('0x47')]['hasOwnProperty'](_0xf5ab('0x4e'))){_0x5af57d[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x392b4f['query'][_0xf5ab('0x31')]);_0x5af57d[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x30')]);}return _0x4ff90d[_0xf5ab('0x10b')](_0x5af57d);}})[_0xf5ab('0x23')](function(_0x540c87){if(_0x540c87){return _0x540c87?{'count':_0x9279b0,'rows':_0x540c87}:null;}})[_0xf5ab('0x23')](respondWithResult(_0x4bf9eb,null))[_0xf5ab('0x2c')](handleError(_0x4bf9eb,null));};exports[_0xf5ab('0x10c')]=function(_0x2656d9,_0x11c44d,_0x59c383){return db[_0xf5ab('0x10d')][_0xf5ab('0x5a')]({'where':{'id':_0x2656d9[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x11c44d,null))[_0xf5ab('0x23')](function(_0x4fcc4e){if(_0x4fcc4e){return _0x4fcc4e[_0xf5ab('0x10c')](_0x2656d9[_0xf5ab('0x5c')][_0xf5ab('0x69')],_[_0xf5ab('0x10e')](_0x2656d9[_0xf5ab('0x5c')],[_0xf5ab('0x69'),'id'])||{});}})[_0xf5ab('0x23')](respondWithResult(_0x11c44d,null))[_0xf5ab('0x2c')](handleError(_0x11c44d,null));};exports['getProactiveActions']=function(_0xa8d49b,_0x19fa27,_0xf89b4f){var _0x469fe6={};var _0x1a14eb={};var _0x21ff90;var _0x2439ca;return db[_0xf5ab('0x41')][_0xf5ab('0x66')]({'where':{'id':_0xa8d49b[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x19fa27,null))[_0xf5ab('0x23')](function(_0x2acf7a){if(_0x2acf7a){_0x21ff90=_0x2acf7a;_0x1a14eb[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x10f')][_0xf5ab('0x42')]);_0x1a14eb[_0xf5ab('0x47')]=_[_0xf5ab('0x48')](_0xa8d49b[_0xf5ab('0x47')]);_0x1a14eb[_0xf5ab('0x49')]=_['intersection'](_0x1a14eb[_0xf5ab('0x45')],_0x1a14eb['query']);_0x469fe6[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x1a14eb['model'],qs[_0xf5ab('0x4b')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x469fe6[_0xf5ab('0x4c')]=_0x469fe6[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x469fe6[_0xf5ab('0x4c')]:_0x1a14eb[_0xf5ab('0x45')];_0x469fe6[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x469fe6[_0xf5ab('0x51')]=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0xa8d49b[_0xf5ab('0x47')],_0x1a14eb['filters']));if(_0xa8d49b[_0xf5ab('0x47')]['filter']){_0x469fe6[_0xf5ab('0x51')]=_['merge'](_0x469fe6[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x469fe6[_0xf5ab('0x4c')],function(_0x3689b2){var _0x36ea4a={};_0x36ea4a[_0x3689b2]={'$like':'%'+_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x36ea4a;})});}_0x469fe6=_[_0xf5ab('0x54')]({},_0x469fe6,_0xa8d49b[_0xf5ab('0x55')]);return _0x21ff90['getProactiveActions'](_0x469fe6);}})[_0xf5ab('0x23')](function(_0x244332){if(_0x244332){_0x2439ca=_0x244332['length'];if(!_0xa8d49b['query'][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x469fe6[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x469fe6['offset']=qs[_0xf5ab('0x30')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x30')]);}return _0x21ff90[_0xf5ab('0xfa')](_0x469fe6);}})[_0xf5ab('0x23')](function(_0x20c192){if(_0x20c192){return _0x20c192?{'count':_0x2439ca,'rows':_0x20c192}:null;}})[_0xf5ab('0x23')](respondWithResult(_0x19fa27,null))['catch'](handleError(_0x19fa27,null));};exports[_0xf5ab('0x110')]=function(_0x2f7bf4,_0x496faa,_0x5bf55f){var _0x1f0c63=_0x2f7bf4[_0xf5ab('0x47')]['online']==='false'?_0xf5ab('0x111'):_0xf5ab('0x112');return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'attributes':['id',_0x1f0c63],'where':{'id':_0x2f7bf4[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x496faa,null))[_0xf5ab('0x23')](function(_0x406847){if(_0x406847){var _0x2c6912=_0x406847[_0x1f0c63];var _0x599af1=_0x2c6912&&_0x2c6912[_0xf5ab('0x113')]?_0x2c6912[_0xf5ab('0x113')]:[];_0x496faa['send']({'fromKey':_['isNil'](_0x2c6912[_0xf5ab('0x114')])?undefined:_0x2c6912[_0xf5ab('0x114')],'count':_0x599af1[_0xf5ab('0x59')],'rows':_0x599af1});}})[_0xf5ab('0x2c')](handleError(_0x496faa,null));};exports[_0xf5ab('0x115')]=function(_0x3f7ec3,_0x2d0171,_0x4bc333){var _0x60a07f={'raw':!![],'where':{}};var _0x3beb30={};var _0x3da427={'count':0x0,'rows':[]};return db[_0xf5ab('0x41')][_0xf5ab('0x66')]({'where':{'id':_0x3f7ec3[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x2d0171,null))['then'](function(_0x199449){if(_0x199449){_0x3beb30['model']=_['keys'](db[_0xf5ab('0xd4')][_0xf5ab('0x42')]);_0x3beb30['query']=_[_0xf5ab('0x48')](_0x3f7ec3[_0xf5ab('0x47')]);_0x3beb30[_0xf5ab('0x49')]=_['intersection'](_0x3beb30[_0xf5ab('0x45')],_0x3beb30[_0xf5ab('0x47')]);_0x60a07f[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x3beb30['model'],qs[_0xf5ab('0x4b')](_0x3f7ec3[_0xf5ab('0x47')]['fields']));_0x60a07f[_0xf5ab('0x4c')]=_0x60a07f['attributes']['length']?_0x60a07f['attributes']:_0x3beb30[_0xf5ab('0x45')];if(!_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x60a07f[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x3f7ec3['query']['limit']);_0x60a07f[_0xf5ab('0x30')]=qs['offset'](_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x30')]);}_0x60a07f[_0xf5ab('0x4f')]=qs['sort'](_0x3f7ec3['query'][_0xf5ab('0x50')]);_0x60a07f['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x3f7ec3['query'],_0x3beb30[_0xf5ab('0x49')]));_0x60a07f[_0xf5ab('0x51')][_0xf5ab('0x6c')]=_0x199449['id'];if(_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x60a07f['where']=_[_0xf5ab('0x54')](_0x60a07f[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x60a07f[_0xf5ab('0x4c')],function(_0x2d022a){var _0x4e3a52={};_0x4e3a52[_0x2d022a]={'$like':'%'+_0x3f7ec3[_0xf5ab('0x47')]['filter']+'%'};return _0x4e3a52;})});}_0x60a07f=_[_0xf5ab('0x54')]({},_0x60a07f,_0x3f7ec3[_0xf5ab('0x55')]);return db['ChatOfflineMessage'][_0xf5ab('0x2f')]({'where':_0x60a07f[_0xf5ab('0x51')]})[_0xf5ab('0x23')](function(_0x1c62b2){_0x3da427['count']=_0x1c62b2;if(_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x6d')]){_0x60a07f[_0xf5ab('0xe1')]=[{'all':!![]}];}return db[_0xf5ab('0xd4')][_0xf5ab('0xea')](_0x60a07f);})[_0xf5ab('0x23')](function(_0x4457a3){_0x3da427['rows']=_0x4457a3;return _0x3da427;});}})['then'](respondWithFilteredResult(_0x2d0171,_0x60a07f))[_0xf5ab('0x2c')](handleError(_0x2d0171,null));};exports[_0xf5ab('0x116')]=function(_0x35a22f,_0x5a8dea,_0xe0c2eb){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x35a22f[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x5a8dea,null))['then'](function(_0x1909bf){if(_0x1909bf){return _0x1909bf[_0xf5ab('0x116')](_0x35a22f['body'][_0xf5ab('0x69')],_[_0xf5ab('0x10e')](_0x35a22f[_0xf5ab('0x5c')],[_0xf5ab('0x69'),'id'])||{})[_0xf5ab('0xb7')](function(_0x31fe8f){for(var _0x5e641d=0x0;_0x5e641d<_0x35a22f[_0xf5ab('0x5c')][_0xf5ab('0x69')][_0xf5ab('0x59')];_0x5e641d+=0x1){socket[_0xf5ab('0x117')](_0xf5ab('0x118'),{'UserId':_0x35a22f['body'][_0xf5ab('0x69')][_0x5e641d],'ChatWebsiteId':_0x35a22f['params']['id']});}return _0x31fe8f;});}})[_0xf5ab('0x23')](respondWithResult(_0x5a8dea,null))[_0xf5ab('0x2c')](handleError(_0x5a8dea,null));};exports[_0xf5ab('0x119')]=function(_0x198da8,_0x24ccd,_0x54a6a0){return db['ChatWebsite'][_0xf5ab('0x5a')]({'where':{'id':_0x198da8[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x24ccd,null))[_0xf5ab('0x23')](function(_0x47e8b1){if(_0x47e8b1){return _0x47e8b1[_0xf5ab('0x119')](_0x198da8['query'][_0xf5ab('0x69')])['then'](function(){if(_[_0xf5ab('0x11a')](_0x198da8[_0xf5ab('0x47')][_0xf5ab('0x69')])){for(var _0x43dd81=0x0;_0x43dd81<_0x198da8[_0xf5ab('0x47')][_0xf5ab('0x69')][_0xf5ab('0x59')];_0x43dd81+=0x1){socket[_0xf5ab('0x117')]('userChatWebsite:remove',{'UserId':Number(_0x198da8['query'][_0xf5ab('0x69')][_0x43dd81]),'ChatWebsiteId':Number(_0x198da8[_0xf5ab('0x58')]['id'])});}}else{socket[_0xf5ab('0x117')](_0xf5ab('0x11b'),{'UserId':Number(_0x198da8[_0xf5ab('0x47')][_0xf5ab('0x69')]),'ChatWebsiteId':Number(_0x198da8[_0xf5ab('0x58')]['id'])});}});}})[_0xf5ab('0x23')](respondWithStatusCode(_0x24ccd,null))[_0xf5ab('0x2c')](handleError(_0x24ccd,null));};exports[_0xf5ab('0x11c')]=function(_0x3dbdd0,_0x2b6592,_0x210811){var _0x1d63cb={};var _0x4dbd15={};var _0x916df0;var _0x52ed3f;return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x3dbdd0[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x2b6592,null))[_0xf5ab('0x23')](function(_0x13406c){if(_0x13406c){_0x916df0=_0x13406c;_0x4dbd15[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0xe3')][_0xf5ab('0x42')]);_0x4dbd15[_0xf5ab('0x47')]=_['keys'](_0x3dbdd0['query']);_0x4dbd15[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0x4dbd15[_0xf5ab('0x45')],_0x4dbd15[_0xf5ab('0x47')]);_0x1d63cb[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x4dbd15[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x3dbdd0[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x1d63cb['attributes']=_0x1d63cb[_0xf5ab('0x4c')]['length']?_0x1d63cb[_0xf5ab('0x4c')]:_0x4dbd15[_0xf5ab('0x45')];_0x1d63cb[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0x3dbdd0['query'][_0xf5ab('0x50')]);_0x1d63cb['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x3dbdd0[_0xf5ab('0x47')],_0x4dbd15[_0xf5ab('0x49')]));if(_0x3dbdd0[_0xf5ab('0x47')]['filter']){_0x1d63cb[_0xf5ab('0x51')]=_['merge'](_0x1d63cb['where'],{'$or':_['map'](_0x1d63cb[_0xf5ab('0x4c')],function(_0x3b2aaf){var _0xd83bcc={};_0xd83bcc[_0x3b2aaf]={'$like':'%'+_0x3dbdd0[_0xf5ab('0x47')]['filter']+'%'};return _0xd83bcc;})});}_0x1d63cb=_[_0xf5ab('0x54')]({},_0x1d63cb,_0x3dbdd0[_0xf5ab('0x55')]);return _0x916df0['getAgents'](_0x1d63cb);}})[_0xf5ab('0x23')](function(_0x4acaa5){if(_0x4acaa5){_0x52ed3f=_0x4acaa5[_0xf5ab('0x59')];if(!_0x3dbdd0[_0xf5ab('0x47')]['hasOwnProperty']('nolimit')){_0x1d63cb['limit']=qs[_0xf5ab('0x31')](_0x3dbdd0[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x1d63cb[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x3dbdd0['query'][_0xf5ab('0x30')]);}return _0x916df0[_0xf5ab('0x11c')](_0x1d63cb);}})[_0xf5ab('0x23')](function(_0x16fda9){if(_0x16fda9){return _0x16fda9?{'count':_0x52ed3f,'rows':_0x16fda9}:null;}})['then'](respondWithResult(_0x2b6592,null))[_0xf5ab('0x2c')](handleError(_0x2b6592,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1129a4b..2229870 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 _0xd0a4=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd0a4,0x158));var _0x4d0a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd0a4[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x4d0a('0x0'));var ChatWebsite=require(_0x4d0a('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4d0a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d0a('0x3'),'afterDestroy':_0x4d0a('0x4')};function emitEvent(_0x160660){return function(_0xbedfe2,_0x55274b,_0x43a06e){ChatWebsiteEvents['emit'](_0x160660+':'+_0xbedfe2['id'],_0xbedfe2);ChatWebsiteEvents[_0x4d0a('0x5')](_0x160660,_0xbedfe2);_0x43a06e(null);};}for(var e in events){if(events[_0x4d0a('0x6')](e)){var event=events[e];ChatWebsite[_0x4d0a('0x7')](e,emitEvent(event));}}module[_0x4d0a('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3c9a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x550651,_0x32926b){var _0x53edcf=function(_0x1ebc42){while(--_0x1ebc42){_0x550651['push'](_0x550651['shift']());}};_0x53edcf(++_0x32926b);}(_0x3c9a,0x13c));var _0xa3c9=function(_0xcfaec8,_0x1b75d0){_0xcfaec8=_0xcfaec8-0x0;var _0x996e63=_0x3c9a[_0xcfaec8];return _0x996e63;};'use strict';var EventEmitter=require(_0xa3c9('0x0'));var ChatWebsite=require(_0xa3c9('0x1'))['db'][_0xa3c9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa3c9('0x3')](0x0);var events={'afterCreate':_0xa3c9('0x4'),'afterUpdate':_0xa3c9('0x5'),'afterDestroy':_0xa3c9('0x6')};function emitEvent(_0x385857){return function(_0x54b30c,_0x185dac,_0x249365){ChatWebsiteEvents[_0xa3c9('0x7')](_0x385857+':'+_0x54b30c['id'],_0x54b30c);ChatWebsiteEvents[_0xa3c9('0x7')](_0x385857,_0x54b30c);_0x249365(null);};}for(var e in events){if(events[_0xa3c9('0x8')](e)){var event=events[e];ChatWebsite[_0xa3c9('0x9')](e,emitEvent(event));}}module[_0xa3c9('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 1aec856..75b21ca 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 _0x6e6c=['moment','path','../../config/environment','exports','define','ChatWebsite','lodash','util','api'];(function(_0x296b7b,_0x59c5a4){var _0x19f81b=function(_0x33c7ed){while(--_0x33c7ed){_0x296b7b['push'](_0x296b7b['shift']());}};_0x19f81b(++_0x59c5a4);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./chatWebsite.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9861=['ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x5d846b,_0x582c41){var _0x4dd9e9=function(_0x44c9cd){while(--_0x44c9cd){_0x5d846b['push'](_0x5d846b['shift']());}};_0x4dd9e9(++_0x582c41);}(_0x9861,0x176));var _0x1986=function(_0x14ddfc,_0x3a94fc){_0x14ddfc=_0x14ddfc-0x0;var _0x4a9443=_0x9861[_0x14ddfc];return _0x4a9443;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1986('0x1'));var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var rp=require(_0x1986('0x4'));var fs=require('fs');var path=require(_0x1986('0x5'));var rimraf=require(_0x1986('0x6'));var config=require('../../config/environment');var attributes=require(_0x1986('0x7'));module[_0x1986('0x8')]=function(_0x1b56d6,_0x17ccbf){return _0x1b56d6[_0x1986('0x9')](_0x1986('0xa'),attributes,{'tableName':_0x1986('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 05a818e..843a5b4 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 _0x5496=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5496,0x175));var _0x6549=function(_0x25e4a4,_0x3354ef){_0x25e4a4=_0x25e4a4-0x0;var _0x2c409f=_0x5496[_0x25e4a4];return _0x2c409f;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});config[_0x6549('0xa')]=_['defaults'](config[_0x6549('0xa')],{'host':_0x6549('0xb'),'port':0x18eb});var socket=require(_0x6549('0xc'))(new Redis(config['redis']));require(_0x6549('0xd'))[_0x6549('0xe')](socket);function respondWithRpcPromise(_0x2ecce2,_0x135c2c,_0x1e5083){return new BPromise(function(_0x3e08a6,_0x50fa35){return client['request'](_0x2ecce2,_0x1e5083)[_0x6549('0xf')](function(_0xac828c){logger[_0x6549('0x10')](_0x6549('0x11'),_0x135c2c,_0x6549('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x135c2c,_0x6549('0x12'),JSON[_0x6549('0x13')](_0xac828c));if(_0xac828c['error']){if(_0xac828c[_0x6549('0x14')][_0x6549('0x15')]===0x1f4){logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0xac828c[_0x6549('0x14')][_0x6549('0x16')]);return _0x50fa35(_0xac828c['error']['message']);}logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0xac828c['error'][_0x6549('0x16')]);return _0x3e08a6(_0xac828c[_0x6549('0x14')][_0x6549('0x16')]);}else{logger[_0x6549('0x10')](_0x6549('0x11'),_0x135c2c,'request\x20sent');_0x3e08a6(_0xac828c['result'][_0x6549('0x16')]);}})['catch'](function(_0x56c15b){logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0x56c15b);_0x50fa35(_0x56c15b);});});}
\ No newline at end of file
+var _0xc1c6=['./chatWebsite.socket','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x181c44,_0x43b397){var _0x19fb14=function(_0x9a6f4a){while(--_0x9a6f4a){_0x181c44['push'](_0x181c44['shift']());}};_0x19fb14(++_0x43b397);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x335107,_0x49c2cd){_0x335107=_0x335107-0x0;var _0x764666=_0xc1c6[_0x335107];return _0x764666;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});config['redis']=_[_0x6c1c('0x9')](config[_0x6c1c('0xa')],{'host':_0x6c1c('0xb'),'port':0x18eb});var socket=require(_0x6c1c('0xc'))(new Redis(config['redis']));require(_0x6c1c('0xd'))[_0x6c1c('0xe')](socket);function respondWithRpcPromise(_0x524d21,_0x147c7b,_0x36275f){return new BPromise(function(_0xb3bd12,_0x1137e8){return client['request'](_0x524d21,_0x36275f)[_0x6c1c('0xf')](function(_0x2a4fd4){logger[_0x6c1c('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));logger[_0x6c1c('0x12')](_0x6c1c('0x13'),_0x147c7b,'request\x20sent',JSON[_0x6c1c('0x14')](_0x2a4fd4));if(_0x2a4fd4['error']){if(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x16')]===0x1f4){logger[_0x6c1c('0x15')](_0x6c1c('0x17'),_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0x1137e8(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);}logger[_0x6c1c('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0xb3bd12(_0x2a4fd4['error'][_0x6c1c('0x18')]);}else{logger[_0x6c1c('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));_0xb3bd12(_0x2a4fd4['result'][_0x6c1c('0x18')]);}})[_0x6c1c('0x19')](function(_0x5a3bb7){logger[_0x6c1c('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x5a3bb7);_0x1137e8(_0x5a3bb7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a56fd5b..8d76812 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2fba2b,_0x4977bf){var _0x438896=function(_0x3c73ca){while(--_0x3c73ca){_0x2fba2b['push'](_0x2fba2b['shift']());}};_0x438896(++_0x4977bf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x138ed8,_0x394451){_0x138ed8=_0x138ed8-0x0;var _0xa1b00e=_0x5f2f[_0x138ed8];return _0xa1b00e;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1b0957,_0x2fa428){var _0x35c05b=function(_0x2898da){while(--_0x2898da){_0x1b0957['push'](_0x1b0957['shift']());}};_0x35c05b(++_0x2fa428);}(_0x7a54,0x106));var _0x47a5=function(_0x488641,_0x5776c3){_0x488641=_0x488641-0x0;var _0x474b85=_0x7a54[_0x488641];return _0x474b85;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 3d17910..7a88625 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 _0x3754=['addLogo','diskStorage','/:id/avatar','addAvatar','server/files/images/avatars/','now','/:id/customer_avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','join','root','server/files/images/logos/','format','%s-%s','originalname','file'];(function(_0x22b4ed,_0x12bf21){var _0x54d987=function(_0x2768be){while(--_0x2768be){_0x22b4ed['push'](_0x22b4ed['shift']());}};_0x54d987(++_0x12bf21);}(_0x3754,0xfb));var _0x4375=function(_0x1f752a,_0x5dba98){_0x1f752a=_0x1f752a-0x0;var _0x2f8b01=_0x3754[_0x1f752a];return _0x2f8b01;};'use strict';var multer=require('multer');var util=require(_0x4375('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x4375('0x1'));var interaction=require(_0x4375('0x2'));var config=require(_0x4375('0x3'));var controller=require(_0x4375('0x4'));router[_0x4375('0x5')]('/',auth[_0x4375('0x6')](),controller[_0x4375('0x7')]);router[_0x4375('0x5')]('/describe',auth[_0x4375('0x6')](),controller['describe']);router['get'](_0x4375('0x8'),auth[_0x4375('0x6')](),controller[_0x4375('0x9')]);router[_0x4375('0x5')](_0x4375('0xa'),auth[_0x4375('0x6')](),controller['getDispositions']);router[_0x4375('0x5')]('/:id/canned_answers',auth[_0x4375('0x6')](),controller['getAnswers']);router[_0x4375('0x5')]('/:id/logo',controller[_0x4375('0xb')]);router[_0x4375('0x5')]('/:id/avatar',controller[_0x4375('0xc')]);router['get']('/:id/customer_avatar',controller[_0x4375('0xd')]);router[_0x4375('0x5')](_0x4375('0xe'),controller['getSystemAvatar']);router['get'](_0x4375('0xf'),auth[_0x4375('0x6')](),controller['getInteractions']);router['get'](_0x4375('0x10'),controller['getSnippet']);router[_0x4375('0x5')](_0x4375('0x11'),auth[_0x4375('0x6')](),controller[_0x4375('0x12')]);router[_0x4375('0x5')](_0x4375('0x13'),auth[_0x4375('0x6')](),controller['getProactiveActions']);router[_0x4375('0x5')](_0x4375('0x14'),controller[_0x4375('0x15')]);router[_0x4375('0x5')]('/:id/offline_messages',auth[_0x4375('0x6')](),controller[_0x4375('0x16')]);router[_0x4375('0x5')](_0x4375('0x17'),auth[_0x4375('0x6')](),controller[_0x4375('0x18')]);router[_0x4375('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4375('0x19')](_0x4375('0xa'),auth[_0x4375('0x6')](),controller[_0x4375('0x1a')]);router[_0x4375('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ca660,_0x19986d,_0x16a22a){_0x16a22a(null,path[_0x4375('0x1b')](config[_0x4375('0x1c')],_0x4375('0x1d')));},'filename':function(_0x1479eb,_0x379799,_0x5b24bb){_0x5b24bb(null,util[_0x4375('0x1e')](_0x4375('0x1f'),Date['now'](),_0x379799[_0x4375('0x20')]));}})});router['post']('/:id/logo',upload['single'](_0x4375('0x21')),controller[_0x4375('0x22')]);var upload=multer({'storage':multer[_0x4375('0x23')]({'destination':function(_0x5c93d9,_0x4b34fd,_0x41e214){_0x41e214(null,path['join'](config[_0x4375('0x1c')],'server/files/images/avatars/'));},'filename':function(_0x208b61,_0x1877e7,_0x1513c9){_0x1513c9(null,util[_0x4375('0x1e')](_0x4375('0x1f'),Date['now'](),_0x1877e7['originalname']));}})});router['post'](_0x4375('0x24'),upload['single']('file'),controller[_0x4375('0x25')]);var upload=multer({'storage':multer[_0x4375('0x23')]({'destination':function(_0x552fb8,_0x36c44e,_0x2c39e9){_0x2c39e9(null,path[_0x4375('0x1b')](config[_0x4375('0x1c')],_0x4375('0x26')));},'filename':function(_0x43ff1f,_0x31e313,_0x100f87){_0x100f87(null,util['format'](_0x4375('0x1f'),Date[_0x4375('0x27')](),_0x31e313['originalname']));}})});router[_0x4375('0x19')](_0x4375('0x28'),upload[_0x4375('0x29')](_0x4375('0x21')),controller[_0x4375('0x2a')]);var upload=multer({'storage':multer[_0x4375('0x23')]({'destination':function(_0x4dff96,_0xbc89f9,_0x45f630){_0x45f630(null,path[_0x4375('0x1b')](config['root'],_0x4375('0x26')));},'filename':function(_0x24b6d2,_0x36eeb8,_0x5a3efd){_0x5a3efd(null,util[_0x4375('0x1e')]('%s-%s',Date[_0x4375('0x27')](),_0x36eeb8[_0x4375('0x20')]));}})});router[_0x4375('0x19')](_0x4375('0xe'),upload[_0x4375('0x29')]('file'),controller[_0x4375('0x2b')]);router[_0x4375('0x19')](_0x4375('0x2c'),controller['notify']);router[_0x4375('0x19')](_0x4375('0x2d'),controller[_0x4375('0x2e')]);router[_0x4375('0x19')](_0x4375('0xf'),auth[_0x4375('0x6')](),controller[_0x4375('0x2f')]);router[_0x4375('0x19')](_0x4375('0x11'),auth[_0x4375('0x6')](),controller[_0x4375('0x30')]);router[_0x4375('0x19')](_0x4375('0x13'),auth[_0x4375('0x6')](),controller[_0x4375('0x31')]);router[_0x4375('0x19')](_0x4375('0x17'),auth[_0x4375('0x6')](),controller['addAgents']);router['put'](_0x4375('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x4375('0x32')](_0x4375('0x8'),auth['isAuthenticated'](),controller[_0x4375('0x33')]);router['delete'](_0x4375('0xa'),auth[_0x4375('0x6')](),controller[_0x4375('0x34')]);router[_0x4375('0x32')](_0x4375('0x35'),auth[_0x4375('0x6')](),controller[_0x4375('0x36')]);router[_0x4375('0x32')](_0x4375('0x17'),auth[_0x4375('0x6')](),controller[_0x4375('0x37')]);module[_0x4375('0x38')]=router;
\ No newline at end of file
+var _0x952d=['file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','root','server/files/images/logos/','format','%s-%s','now','originalname','single','diskStorage','join','server/files/images/avatars/','addAvatar'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x952d,0x199));var _0xd952=function(_0x103e8d,_0x1fda2f){_0x103e8d=_0x103e8d-0x0;var _0x4580ec=_0x952d[_0x103e8d];return _0x4580ec;};'use strict';var multer=require(_0xd952('0x0'));var util=require(_0xd952('0x1'));var path=require(_0xd952('0x2'));var timeout=require(_0xd952('0x3'));var express=require('express');var router=express[_0xd952('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd952('0x5'));var controller=require(_0xd952('0x6'));router[_0xd952('0x7')]('/',auth[_0xd952('0x8')](),controller[_0xd952('0x9')]);router[_0xd952('0x7')](_0xd952('0xa'),auth[_0xd952('0x8')](),controller[_0xd952('0xb')]);router[_0xd952('0x7')]('/:id',auth[_0xd952('0x8')](),controller[_0xd952('0xc')]);router[_0xd952('0x7')](_0xd952('0xd'),auth[_0xd952('0x8')](),controller['getDispositions']);router[_0xd952('0x7')](_0xd952('0xe'),auth[_0xd952('0x8')](),controller[_0xd952('0xf')]);router[_0xd952('0x7')](_0xd952('0x10'),controller['getLogo']);router[_0xd952('0x7')](_0xd952('0x11'),controller['getAvatar']);router['get'](_0xd952('0x12'),controller[_0xd952('0x13')]);router[_0xd952('0x7')](_0xd952('0x14'),controller[_0xd952('0x15')]);router['get']('/:id/interactions',auth[_0xd952('0x8')](),controller[_0xd952('0x16')]);router[_0xd952('0x7')](_0xd952('0x17'),controller['getSnippet']);router[_0xd952('0x7')](_0xd952('0x18'),auth[_0xd952('0x8')](),controller[_0xd952('0x19')]);router[_0xd952('0x7')](_0xd952('0x1a'),auth[_0xd952('0x8')](),controller[_0xd952('0x1b')]);router['get'](_0xd952('0x1c'),controller[_0xd952('0x1d')]);router[_0xd952('0x7')]('/:id/offline_messages',auth[_0xd952('0x8')](),controller[_0xd952('0x1e')]);router[_0xd952('0x7')](_0xd952('0x1f'),auth[_0xd952('0x8')](),controller[_0xd952('0x20')]);router[_0xd952('0x21')]('/',auth[_0xd952('0x8')](),controller['create']);router[_0xd952('0x21')]('/:id/dispositions',auth[_0xd952('0x8')](),controller[_0xd952('0x22')]);router[_0xd952('0x21')](_0xd952('0xe'),auth[_0xd952('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x24294f,_0x2ebe54,_0x6972e6){_0x6972e6(null,path['join'](config[_0xd952('0x23')],_0xd952('0x24')));},'filename':function(_0xb8cf62,_0x5873a2,_0x2f86ac){_0x2f86ac(null,util[_0xd952('0x25')](_0xd952('0x26'),Date[_0xd952('0x27')](),_0x5873a2[_0xd952('0x28')]));}})});router[_0xd952('0x21')]('/:id/logo',upload[_0xd952('0x29')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xd952('0x2a')]({'destination':function(_0x2d1e5f,_0x4e64b1,_0x59fe71){_0x59fe71(null,path[_0xd952('0x2b')](config[_0xd952('0x23')],_0xd952('0x2c')));},'filename':function(_0x327069,_0x22ae05,_0x21da96){_0x21da96(null,util[_0xd952('0x25')](_0xd952('0x26'),Date['now'](),_0x22ae05['originalname']));}})});router['post'](_0xd952('0x11'),upload['single']('file'),controller[_0xd952('0x2d')]);var upload=multer({'storage':multer[_0xd952('0x2a')]({'destination':function(_0x5e0f89,_0x4b96ac,_0x400dfc){_0x400dfc(null,path['join'](config[_0xd952('0x23')],_0xd952('0x2c')));},'filename':function(_0x35da3f,_0x3af257,_0x217206){_0x217206(null,util[_0xd952('0x25')]('%s-%s',Date[_0xd952('0x27')](),_0x3af257['originalname']));}})});router[_0xd952('0x21')]('/:id/customer_avatar',upload[_0xd952('0x29')](_0xd952('0x2e')),controller[_0xd952('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c9db0,_0x385376,_0x14c27e){_0x14c27e(null,path[_0xd952('0x2b')](config[_0xd952('0x23')],'server/files/images/avatars/'));},'filename':function(_0x4c6d20,_0x4326f9,_0x292ccf){_0x292ccf(null,util[_0xd952('0x25')](_0xd952('0x26'),Date['now'](),_0x4326f9[_0xd952('0x28')]));}})});router[_0xd952('0x21')](_0xd952('0x14'),upload['single'](_0xd952('0x2e')),controller[_0xd952('0x30')]);router[_0xd952('0x21')](_0xd952('0x31'),controller[_0xd952('0x32')]);router[_0xd952('0x21')](_0xd952('0x33'),controller[_0xd952('0x34')]);router[_0xd952('0x21')](_0xd952('0x35'),auth[_0xd952('0x8')](),controller[_0xd952('0x36')]);router[_0xd952('0x21')]('/:id/applications',auth[_0xd952('0x8')](),controller['addApplications']);router['post'](_0xd952('0x1a'),auth[_0xd952('0x8')](),controller[_0xd952('0x37')]);router[_0xd952('0x21')](_0xd952('0x1f'),auth['isAuthenticated'](),controller[_0xd952('0x38')]);router['put'](_0xd952('0x39'),auth[_0xd952('0x8')](),controller[_0xd952('0x3a')]);router[_0xd952('0x3b')]('/:id',auth[_0xd952('0x8')](),controller[_0xd952('0x3c')]);router['delete'](_0xd952('0xd'),auth[_0xd952('0x8')](),controller[_0xd952('0x3d')]);router[_0xd952('0x3b')](_0xd952('0xe'),auth['isAuthenticated'](),controller[_0xd952('0x3e')]);router[_0xd952('0x3b')](_0xd952('0x1f'),auth['isAuthenticated'](),controller[_0xd952('0x3f')]);module[_0xd952('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 03bb8ca..3ba03bf 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 _0x1a4b=['exports','STRING','name','sequelize'];(function(_0x16ce2b,_0x2f48e1){var _0x5cf403=function(_0x478e9b){while(--_0x478e9b){_0x16ce2b['push'](_0x16ce2b['shift']());}};_0x5cf403(++_0x2f48e1);}(_0x1a4b,0x9f));var _0xb1a4=function(_0x219c12,_0x3a391b){_0x219c12=_0x219c12-0x0;var _0x2d6031=_0x1a4b[_0x219c12];return _0x2d6031;};'use strict';var Sequelize=require(_0xb1a4('0x0'));module[_0xb1a4('0x1')]={'name':{'type':Sequelize[_0xb1a4('0x2')],'unique':_0xb1a4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb1a4('0x2')]},'companyId':{'type':Sequelize[_0xb1a4('0x2')]},'website':{'type':Sequelize[_0xb1a4('0x2')]},'phone':{'type':Sequelize[_0xb1a4('0x2')]},'fax':{'type':Sequelize[_0xb1a4('0x2')]},'type':{'type':Sequelize[_0xb1a4('0x2')]},'street':{'type':Sequelize[_0xb1a4('0x2')]},'postalCode':{'type':Sequelize[_0xb1a4('0x2')]},'city':{'type':Sequelize[_0xb1a4('0x2')]},'country':{'type':Sequelize[_0xb1a4('0x2')]},'email':{'type':Sequelize[_0xb1a4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb1a4('0x2')]},'sStreet':{'type':Sequelize[_0xb1a4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xb1a4('0x2')]},'sCountry':{'type':Sequelize[_0xb1a4('0x2')]},'description':{'type':Sequelize[_0xb1a4('0x2')]}};
\ No newline at end of file
+var _0x0d23=['exports','name','STRING','sequelize'];(function(_0x526d0c,_0x589427){var _0x42fa82=function(_0x186dd3){while(--_0x186dd3){_0x526d0c['push'](_0x526d0c['shift']());}};_0x42fa82(++_0x589427);}(_0x0d23,0xbb));var _0x30d2=function(_0xe34312,_0x3cfe6a){_0xe34312=_0xe34312-0x0;var _0x2e15ae=_0x0d23[_0xe34312];return _0x2e15ae;};'use strict';var Sequelize=require(_0x30d2('0x0'));module[_0x30d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x30d2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x30d2('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x30d2('0x3')]},'postalCode':{'type':Sequelize[_0x30d2('0x3')]},'city':{'type':Sequelize[_0x30d2('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x30d2('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x30d2('0x3')]},'sCity':{'type':Sequelize[_0x30d2('0x3')]},'sCountry':{'type':Sequelize[_0x30d2('0x3')]},'description':{'type':Sequelize[_0x30d2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 0f695be..270abbc 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 _0x61ee=['Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','filter','includeAll','findAll','rows','catch','rawAttributes','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','getContacts','findOne','pick','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','update','destroy','then'];(function(_0x1c9cab,_0x5e3c39){var _0xe5e91d=function(_0x409645){while(--_0x409645){_0x1c9cab['push'](_0x1c9cab['shift']());}};_0xe5e91d(++_0x5e3c39);}(_0x61ee,0x1ba));var _0xe61e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61ee[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xe61e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe61e('0x1'));var zipdir=require(_0xe61e('0x2'));var jsonpatch=require(_0xe61e('0x3'));var rp=require(_0xe61e('0x4'));var moment=require(_0xe61e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe61e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe61e('0x7'));var ejs=require(_0xe61e('0x8'));var fs=require('fs');var _=require(_0xe61e('0x9'));var squel=require('squel');var crypto=require(_0xe61e('0xa'));var jsforce=require(_0xe61e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe61e('0x7'));var querystring=require(_0xe61e('0xc'));var Papa=require('papaparse');var Redis=require(_0xe61e('0xd'));var authService=require(_0xe61e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe61e('0xf'));var hardwareService=require(_0xe61e('0x10'));var logger=require(_0xe61e('0x11'))('api');var utils=require(_0xe61e('0x12'));var config=require(_0xe61e('0x13'));var db=require(_0xe61e('0x14'))['db'];function respondWithStatusCode(_0x477352,_0x2a74de){_0x2a74de=_0x2a74de||0xcc;return function(_0x72e0fb){if(_0x72e0fb){return _0x477352[_0xe61e('0x15')](_0x2a74de);}return _0x477352[_0xe61e('0x16')](_0x2a74de)[_0xe61e('0x17')]();};}function respondWithResult(_0x4a18ca,_0x111523){_0x111523=_0x111523||0xc8;return function(_0xa711cd){if(_0xa711cd){return _0x4a18ca['status'](_0x111523)[_0xe61e('0x18')](_0xa711cd);}};}function respondWithFilteredResult(_0x2c1a5d,_0x13a8f5){return function(_0x45b8d4){if(_0x45b8d4){var _0x182bfd=_0x45b8d4[_0xe61e('0x19')],_0x218ce4=_0x13a8f5[_0xe61e('0x1a')],_0x17accc=_0x13a8f5['offset']+_0x13a8f5[_0xe61e('0x1b')],_0x446664;if(_0x17accc>=_0x182bfd){_0x17accc=_0x182bfd;_0x446664=0xc8;}else{_0x446664=0xce;}_0x2c1a5d[_0xe61e('0x16')](_0x446664);return _0x2c1a5d['set']('Content-Range',_0x218ce4+'-'+_0x17accc+'/'+_0x182bfd)[_0xe61e('0x18')](_0x45b8d4);}return null;};}function patchUpdates(_0x4b12de){return function(_0x5332ea){try{jsonpatch[_0xe61e('0x1c')](_0x5332ea,_0x4b12de,!![]);}catch(_0x396132){return BPromise['reject'](_0x396132);}return _0x5332ea['save']();};}function saveUpdates(_0xac44ff,_0x4d3d56){return function(_0x43db10){if(_0x43db10){return _0x43db10[_0xe61e('0x1d')](_0xac44ff)['then'](function(_0x433cf7){return _0x433cf7;});}return null;};}function removeEntity(_0x39b264,_0x29bda2){return function(_0x19aee0){if(_0x19aee0){return _0x19aee0[_0xe61e('0x1e')]()[_0xe61e('0x1f')](function(){var _0x15f4f8=_0x19aee0['get']({'plain':!![]});var _0x17b9ee=_0xe61e('0x20');return db[_0xe61e('0x21')][_0xe61e('0x1e')]({'where':{'type':_0x17b9ee,'resourceId':_0x15f4f8['id']}})['then'](function(){return _0x19aee0;});})[_0xe61e('0x1f')](function(){_0x39b264['status'](0xcc)[_0xe61e('0x17')]();});}};}function handleEntityNotFound(_0x12b256,_0x361bf6){return function(_0x4bbeb2){if(!_0x4bbeb2){_0x12b256[_0xe61e('0x15')](0x194);}return _0x4bbeb2;};}function handleError(_0x222601,_0x2c0c1a){_0x2c0c1a=_0x2c0c1a||0x1f4;return function(_0x204bbc){logger[_0xe61e('0x22')](_0x204bbc[_0xe61e('0x23')]);if(_0x204bbc[_0xe61e('0x24')]){delete _0x204bbc['name'];}_0x222601[_0xe61e('0x16')](_0x2c0c1a)[_0xe61e('0x25')](_0x204bbc);};}exports[_0xe61e('0x26')]=function(_0x54b1c0,_0x971f64){var _0xa14537={},_0x2c8bd1={},_0x286fc1={'count':0x0,'rows':[]};return db[_0xe61e('0x27')][_0xe61e('0x28')]()[_0xe61e('0x1f')](function(_0x429901){_0x2c8bd1[_0xe61e('0x29')]=_[_0xe61e('0x2a')](_0x429901);_0x2c8bd1[_0xe61e('0x2b')]=_['keys'](_0x54b1c0[_0xe61e('0x2b')]);_0x2c8bd1[_0xe61e('0x2c')]=_[_0xe61e('0x2d')](_0x2c8bd1['model'],_0x2c8bd1['query']);_0xa14537[_0xe61e('0x2e')]=_[_0xe61e('0x2d')](_0x2c8bd1[_0xe61e('0x29')],qs['fields'](_0x54b1c0[_0xe61e('0x2b')][_0xe61e('0x2f')]));_0xa14537['attributes']=_0xa14537[_0xe61e('0x2e')][_0xe61e('0x30')]?_0xa14537[_0xe61e('0x2e')]:_0x2c8bd1[_0xe61e('0x29')];if(!_0x54b1c0[_0xe61e('0x2b')]['hasOwnProperty'](_0xe61e('0x31'))){_0xa14537[_0xe61e('0x1b')]=qs[_0xe61e('0x1b')](_0x54b1c0['query'][_0xe61e('0x1b')]);_0xa14537[_0xe61e('0x1a')]=qs['offset'](_0x54b1c0[_0xe61e('0x2b')][_0xe61e('0x1a')]);}_0xa14537[_0xe61e('0x32')]=qs[_0xe61e('0x33')](_0x54b1c0[_0xe61e('0x2b')]['sort']);_0xa14537['where']=qs['filters'](_['pick'](_0x54b1c0[_0xe61e('0x2b')],_0x2c8bd1['filters']));if(_0x54b1c0[_0xe61e('0x2b')]['filter']){_0xa14537[_0xe61e('0x34')]=_[_0xe61e('0x35')](_0xa14537[_0xe61e('0x34')],{'$or':_[_0xe61e('0x36')](_0xa14537[_0xe61e('0x2e')],function(_0x2e119d){var _0x10fd00={};_0x10fd00[_0x2e119d]={'$like':'%'+_0x54b1c0[_0xe61e('0x2b')][_0xe61e('0x37')]+'%'};return _0x10fd00;})});}_0xa14537=_[_0xe61e('0x35')]({},_0xa14537,_0x54b1c0['options']);var _0x57bfe2={'where':_0xa14537[_0xe61e('0x34')]};return db['CmCompany'][_0xe61e('0x19')](_0x57bfe2)['then'](function(_0x3d62a3){_0x286fc1['count']=_0x3d62a3;if(_0x54b1c0['query'][_0xe61e('0x38')]){_0xa14537['include']=[{'all':!![]}];}return db[_0xe61e('0x27')][_0xe61e('0x39')](_0xa14537);})[_0xe61e('0x1f')](function(_0x181173){_0x286fc1[_0xe61e('0x3a')]=_0x181173;return _0x286fc1;})['then'](respondWithFilteredResult(_0x971f64,_0xa14537))[_0xe61e('0x3b')](handleError(_0x971f64,null));});};exports['show']=function(_0x133598,_0x107d56){var _0x1eb0cf={'raw':![],'where':{'id':_0x133598['params']['id']}},_0xdee77c={};_0xdee77c[_0xe61e('0x29')]=_[_0xe61e('0x2a')](db['CmCompany'][_0xe61e('0x3c')]);_0xdee77c[_0xe61e('0x2b')]=_[_0xe61e('0x2a')](_0x133598['query']);_0xdee77c[_0xe61e('0x2c')]=_[_0xe61e('0x2d')](_0xdee77c[_0xe61e('0x29')],_0xdee77c['query']);_0x1eb0cf[_0xe61e('0x2e')]=_[_0xe61e('0x2d')](_0xdee77c[_0xe61e('0x29')],qs[_0xe61e('0x2f')](_0x133598['query'][_0xe61e('0x2f')]));_0x1eb0cf[_0xe61e('0x2e')]=_0x1eb0cf[_0xe61e('0x2e')][_0xe61e('0x30')]?_0x1eb0cf[_0xe61e('0x2e')]:_0xdee77c['model'];if(_0x133598[_0xe61e('0x2b')][_0xe61e('0x38')]){_0x1eb0cf[_0xe61e('0x3d')]=[{'all':!![]}];}_0x1eb0cf=_[_0xe61e('0x35')]({},_0x1eb0cf,_0x133598[_0xe61e('0x3e')]);return db[_0xe61e('0x27')][_0xe61e('0x3f')](_0x1eb0cf)[_0xe61e('0x1f')](handleEntityNotFound(_0x107d56,null))['then'](respondWithResult(_0x107d56,null))['catch'](handleError(_0x107d56,null));};exports[_0xe61e('0x40')]=function(_0x3c4ba9,_0x422c77){return db['CmCompany']['create'](_0x3c4ba9[_0xe61e('0x41')],{})['then'](function(_0x4055a5){var _0x3e4a4b=_0x3c4ba9[_0xe61e('0x42')][_0xe61e('0x43')]({'plain':!![]});if(!_0x3e4a4b)throw new Error(_0xe61e('0x44'));if(_0x3e4a4b[_0xe61e('0x45')]===_0xe61e('0x42')){var _0x3ba394=_0x4055a5[_0xe61e('0x43')]({'plain':!![]});var _0x11073d=_0xe61e('0x20');return db[_0xe61e('0x46')]['find']({'where':{'name':_0x11073d,'userProfileId':_0x3e4a4b['userProfileId']},'raw':!![]})[_0xe61e('0x1f')](function(_0x3b8266){if(_0x3b8266&&_0x3b8266[_0xe61e('0x47')]===0x0){return db['UserProfileResource'][_0xe61e('0x40')]({'name':_0x3ba394[_0xe61e('0x24')],'resourceId':_0x3ba394['id'],'type':_0x3b8266[_0xe61e('0x24')],'sectionId':_0x3b8266['id']},{})[_0xe61e('0x1f')](function(){return _0x4055a5;});}else{return _0x4055a5;}})[_0xe61e('0x3b')](function(_0x159671){logger[_0xe61e('0x22')](_0xe61e('0x48'),_0x159671);throw _0x159671;});}return _0x4055a5;})['then'](respondWithResult(_0x422c77,0xc9))['catch'](handleError(_0x422c77,null));};exports[_0xe61e('0x1d')]=function(_0x58985a,_0x339a2a){if(_0x58985a[_0xe61e('0x41')]['id']){delete _0x58985a['body']['id'];}return db[_0xe61e('0x27')]['find']({'where':{'id':_0x58985a['params']['id']}})[_0xe61e('0x1f')](handleEntityNotFound(_0x339a2a,null))[_0xe61e('0x1f')](saveUpdates(_0x58985a[_0xe61e('0x41')],null))[_0xe61e('0x1f')](respondWithResult(_0x339a2a,null))[_0xe61e('0x3b')](handleError(_0x339a2a,null));};exports[_0xe61e('0x1e')]=function(_0x39077e,_0x277639){return db[_0xe61e('0x27')][_0xe61e('0x3f')]({'where':{'id':_0x39077e[_0xe61e('0x49')]['id']}})['then'](handleEntityNotFound(_0x277639,null))[_0xe61e('0x1f')](removeEntity(_0x277639,null))[_0xe61e('0x3b')](handleError(_0x277639,null));};exports[_0xe61e('0x28')]=function(_0x3a5eac,_0x1a2b23){return db[_0xe61e('0x27')][_0xe61e('0x28')]()['then'](respondWithResult(_0x1a2b23,null))[_0xe61e('0x3b')](handleError(_0x1a2b23,null));};exports['addContacts']=function(_0x508372,_0x4daa67,_0xe8b2bc){return db['CmContact'][_0xe61e('0x3f')]({'where':{'id':_0x508372[_0xe61e('0x49')]['id']}})[_0xe61e('0x1f')](handleEntityNotFound(_0x4daa67,null))[_0xe61e('0x1f')](function(_0x557612){if(_0x557612){return _0x557612[_0xe61e('0x4a')](_0x508372[_0xe61e('0x41')]['ids'],_[_0xe61e('0x4b')](_0x508372['body'],['ids','id'])||{});}})[_0xe61e('0x1f')](respondWithResult(_0x4daa67,null))[_0xe61e('0x3b')](handleError(_0x4daa67,null));};exports[_0xe61e('0x4c')]=function(_0x1094eb,_0x195e75,_0x3e2a31){var _0x5c9404={};var _0x7c767c={};var _0x2c950d;var _0x312dc2;return db[_0xe61e('0x27')][_0xe61e('0x4d')]({'where':{'id':_0x1094eb[_0xe61e('0x49')]['id']}})['then'](handleEntityNotFound(_0x195e75,null))[_0xe61e('0x1f')](function(_0x441a30){if(_0x441a30){_0x2c950d=_0x441a30;_0x7c767c['model']=_[_0xe61e('0x2a')](db['CmContact'][_0xe61e('0x3c')]);_0x7c767c['query']=_[_0xe61e('0x2a')](_0x1094eb[_0xe61e('0x2b')]);_0x7c767c['filters']=_[_0xe61e('0x2d')](_0x7c767c[_0xe61e('0x29')],_0x7c767c[_0xe61e('0x2b')]);_0x5c9404[_0xe61e('0x2e')]=_[_0xe61e('0x2d')](_0x7c767c['model'],qs[_0xe61e('0x2f')](_0x1094eb[_0xe61e('0x2b')]['fields']));_0x5c9404['attributes']=_0x5c9404[_0xe61e('0x2e')][_0xe61e('0x30')]?_0x5c9404[_0xe61e('0x2e')]:_0x7c767c[_0xe61e('0x29')];_0x5c9404[_0xe61e('0x32')]=qs[_0xe61e('0x33')](_0x1094eb['query'][_0xe61e('0x33')]);_0x5c9404[_0xe61e('0x34')]=qs[_0xe61e('0x2c')](_[_0xe61e('0x4e')](_0x1094eb['query'],_0x7c767c[_0xe61e('0x2c')]));if(_0x1094eb['query'][_0xe61e('0x37')]){_0x5c9404['where']=_[_0xe61e('0x35')](_0x5c9404[_0xe61e('0x34')],{'$or':_[_0xe61e('0x36')](_0x5c9404[_0xe61e('0x2e')],function(_0x535cf5){var _0x3543b9={};_0x3543b9[_0x535cf5]={'$like':'%'+_0x1094eb['query'][_0xe61e('0x37')]+'%'};return _0x3543b9;})});}_0x5c9404=_[_0xe61e('0x35')]({},_0x5c9404,_0x1094eb[_0xe61e('0x3e')]);return _0x2c950d['getContacts'](_0x5c9404);}})[_0xe61e('0x1f')](function(_0x6de4d1){if(_0x6de4d1){_0x312dc2=_0x6de4d1['length'];if(!_0x1094eb[_0xe61e('0x2b')]['hasOwnProperty'](_0xe61e('0x31'))){_0x5c9404[_0xe61e('0x1b')]=qs[_0xe61e('0x1b')](_0x1094eb['query'][_0xe61e('0x1b')]);_0x5c9404[_0xe61e('0x1a')]=qs[_0xe61e('0x1a')](_0x1094eb['query'][_0xe61e('0x1a')]);}return _0x2c950d[_0xe61e('0x4c')](_0x5c9404);}})['then'](function(_0x2675db){if(_0x2675db){return _0x2675db?{'count':_0x312dc2,'rows':_0x2675db}:null;}})[_0xe61e('0x1f')](respondWithResult(_0x195e75,null))[_0xe61e('0x3b')](handleError(_0x195e75,null));};
\ No newline at end of file
+var _0xb945=['order','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','reject','save','update','destroy','get','Companies','UserProfileResource','then','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','merge','map','filter','options','includeAll','include','catch','show','params','rawAttributes','filters','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb945,0x1e2));var _0x5b94=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xb945[_0x2074db];return _0x27324c;};'use strict';var pdf=require(_0x5b94('0x0'));var emlformat=require(_0x5b94('0x1'));var rimraf=require(_0x5b94('0x2'));var zipdir=require(_0x5b94('0x3'));var jsonpatch=require(_0x5b94('0x4'));var rp=require('request-promise');var moment=require(_0x5b94('0x5'));var BPromise=require(_0x5b94('0x6'));var Mustache=require(_0x5b94('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5b94('0x8'));var ejs=require(_0x5b94('0x9'));var fs=require('fs');var _=require(_0x5b94('0xa'));var squel=require(_0x5b94('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b94('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5b94('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b94('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5b94('0xe'));var hardwareService=require(_0x5b94('0xf'));var logger=require(_0x5b94('0x10'))(_0x5b94('0x11'));var utils=require(_0x5b94('0x12'));var config=require(_0x5b94('0x13'));var db=require(_0x5b94('0x14'))['db'];function respondWithStatusCode(_0x2ecefc,_0x418f85){_0x418f85=_0x418f85||0xcc;return function(_0x1227f8){if(_0x1227f8){return _0x2ecefc[_0x5b94('0x15')](_0x418f85);}return _0x2ecefc['status'](_0x418f85)[_0x5b94('0x16')]();};}function respondWithResult(_0xa80cc5,_0x40f647){_0x40f647=_0x40f647||0xc8;return function(_0x18d6af){if(_0x18d6af){return _0xa80cc5['status'](_0x40f647)[_0x5b94('0x17')](_0x18d6af);}};}function respondWithFilteredResult(_0x50f2d7,_0x454101){return function(_0x54d34c){if(_0x54d34c){var _0x58d135=_0x54d34c[_0x5b94('0x18')],_0x6c9dca=_0x454101[_0x5b94('0x19')],_0x384438=_0x454101[_0x5b94('0x19')]+_0x454101['limit'],_0x39b2b4;if(_0x384438>=_0x58d135){_0x384438=_0x58d135;_0x39b2b4=0xc8;}else{_0x39b2b4=0xce;}_0x50f2d7[_0x5b94('0x1a')](_0x39b2b4);return _0x50f2d7['set'](_0x5b94('0x1b'),_0x6c9dca+'-'+_0x384438+'/'+_0x58d135)[_0x5b94('0x17')](_0x54d34c);}return null;};}function patchUpdates(_0x17c262){return function(_0x2bd284){try{jsonpatch['apply'](_0x2bd284,_0x17c262,!![]);}catch(_0xde1cff){return BPromise[_0x5b94('0x1c')](_0xde1cff);}return _0x2bd284[_0x5b94('0x1d')]();};}function saveUpdates(_0x5847b1,_0x36c203){return function(_0x13163f){if(_0x13163f){return _0x13163f[_0x5b94('0x1e')](_0x5847b1)['then'](function(_0x22956b){return _0x22956b;});}return null;};}function removeEntity(_0x552fc,_0x3b0334){return function(_0x428570){if(_0x428570){return _0x428570[_0x5b94('0x1f')]()['then'](function(){var _0x504d70=_0x428570[_0x5b94('0x20')]({'plain':!![]});var _0x5156ee=_0x5b94('0x21');return db[_0x5b94('0x22')][_0x5b94('0x1f')]({'where':{'type':_0x5156ee,'resourceId':_0x504d70['id']}})[_0x5b94('0x23')](function(){return _0x428570;});})['then'](function(){_0x552fc[_0x5b94('0x1a')](0xcc)[_0x5b94('0x16')]();});}};}function handleEntityNotFound(_0x219387,_0x4d0179){return function(_0x887057){if(!_0x887057){_0x219387['sendStatus'](0x194);}return _0x887057;};}function handleError(_0x33ef86,_0x3cbdda){_0x3cbdda=_0x3cbdda||0x1f4;return function(_0x19e28b){logger[_0x5b94('0x24')](_0x19e28b[_0x5b94('0x25')]);if(_0x19e28b[_0x5b94('0x26')]){delete _0x19e28b[_0x5b94('0x26')];}_0x33ef86['status'](_0x3cbdda)[_0x5b94('0x27')](_0x19e28b);};}exports[_0x5b94('0x28')]=function(_0x1f0cc7,_0x26c8cf){var _0x5ae5f6={},_0x113511={},_0x20305f={'count':0x0,'rows':[]};return db[_0x5b94('0x29')][_0x5b94('0x2a')]()[_0x5b94('0x23')](function(_0x6fae4e){_0x113511['model']=_[_0x5b94('0x2b')](_0x6fae4e);_0x113511['query']=_['keys'](_0x1f0cc7[_0x5b94('0x2c')]);_0x113511['filters']=_[_0x5b94('0x2d')](_0x113511[_0x5b94('0x2e')],_0x113511[_0x5b94('0x2c')]);_0x5ae5f6['attributes']=_[_0x5b94('0x2d')](_0x113511[_0x5b94('0x2e')],qs[_0x5b94('0x2f')](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x2f')]));_0x5ae5f6[_0x5b94('0x30')]=_0x5ae5f6[_0x5b94('0x30')][_0x5b94('0x31')]?_0x5ae5f6['attributes']:_0x113511['model'];if(!_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x32')]('nolimit')){_0x5ae5f6[_0x5b94('0x33')]=qs['limit'](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x33')]);_0x5ae5f6[_0x5b94('0x19')]=qs['offset'](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x19')]);}_0x5ae5f6['order']=qs[_0x5b94('0x34')](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x34')]);_0x5ae5f6[_0x5b94('0x35')]=qs['filters'](_[_0x5b94('0x36')](_0x1f0cc7[_0x5b94('0x2c')],_0x113511['filters']));if(_0x1f0cc7[_0x5b94('0x2c')]['filter']){_0x5ae5f6['where']=_[_0x5b94('0x37')](_0x5ae5f6[_0x5b94('0x35')],{'$or':_[_0x5b94('0x38')](_0x5ae5f6[_0x5b94('0x30')],function(_0x471121){var _0x4291e1={};_0x4291e1[_0x471121]={'$like':'%'+_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x39')]+'%'};return _0x4291e1;})});}_0x5ae5f6=_[_0x5b94('0x37')]({},_0x5ae5f6,_0x1f0cc7[_0x5b94('0x3a')]);var _0x52ae83={'where':_0x5ae5f6[_0x5b94('0x35')]};return db[_0x5b94('0x29')][_0x5b94('0x18')](_0x52ae83)['then'](function(_0x2249ed){_0x20305f[_0x5b94('0x18')]=_0x2249ed;if(_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0x5ae5f6[_0x5b94('0x3c')]=[{'all':!![]}];}return db[_0x5b94('0x29')]['findAll'](_0x5ae5f6);})[_0x5b94('0x23')](function(_0x152fdb){_0x20305f['rows']=_0x152fdb;return _0x20305f;})[_0x5b94('0x23')](respondWithFilteredResult(_0x26c8cf,_0x5ae5f6))[_0x5b94('0x3d')](handleError(_0x26c8cf,null));});};exports[_0x5b94('0x3e')]=function(_0x48b5d6,_0x5d09b7){var _0xf854f9={'raw':![],'where':{'id':_0x48b5d6[_0x5b94('0x3f')]['id']}},_0x18112a={};_0x18112a['model']=_[_0x5b94('0x2b')](db['CmCompany'][_0x5b94('0x40')]);_0x18112a[_0x5b94('0x2c')]=_[_0x5b94('0x2b')](_0x48b5d6['query']);_0x18112a[_0x5b94('0x41')]=_[_0x5b94('0x2d')](_0x18112a['model'],_0x18112a[_0x5b94('0x2c')]);_0xf854f9[_0x5b94('0x30')]=_['intersection'](_0x18112a[_0x5b94('0x2e')],qs[_0x5b94('0x2f')](_0x48b5d6[_0x5b94('0x2c')][_0x5b94('0x2f')]));_0xf854f9['attributes']=_0xf854f9['attributes'][_0x5b94('0x31')]?_0xf854f9['attributes']:_0x18112a[_0x5b94('0x2e')];if(_0x48b5d6[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0xf854f9['include']=[{'all':!![]}];}_0xf854f9=_[_0x5b94('0x37')]({},_0xf854f9,_0x48b5d6[_0x5b94('0x3a')]);return db[_0x5b94('0x29')]['find'](_0xf854f9)['then'](handleEntityNotFound(_0x5d09b7,null))[_0x5b94('0x23')](respondWithResult(_0x5d09b7,null))['catch'](handleError(_0x5d09b7,null));};exports[_0x5b94('0x42')]=function(_0xbf5ab0,_0x513821){return db[_0x5b94('0x29')][_0x5b94('0x42')](_0xbf5ab0[_0x5b94('0x43')],{})['then'](function(_0x34456e){var _0x18cecf=_0xbf5ab0[_0x5b94('0x44')][_0x5b94('0x20')]({'plain':!![]});if(!_0x18cecf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18cecf['role']===_0x5b94('0x44')){var _0x12928e=_0x34456e[_0x5b94('0x20')]({'plain':!![]});var _0x2b747f='Companies';return db[_0x5b94('0x45')][_0x5b94('0x46')]({'where':{'name':_0x2b747f,'userProfileId':_0x18cecf[_0x5b94('0x47')]},'raw':!![]})[_0x5b94('0x23')](function(_0x318868){if(_0x318868&&_0x318868[_0x5b94('0x48')]===0x0){return db[_0x5b94('0x22')][_0x5b94('0x42')]({'name':_0x12928e[_0x5b94('0x26')],'resourceId':_0x12928e['id'],'type':_0x318868[_0x5b94('0x26')],'sectionId':_0x318868['id']},{})[_0x5b94('0x23')](function(){return _0x34456e;});}else{return _0x34456e;}})['catch'](function(_0x50ffc9){logger[_0x5b94('0x24')](_0x5b94('0x49'),_0x50ffc9);throw _0x50ffc9;});}return _0x34456e;})[_0x5b94('0x23')](respondWithResult(_0x513821,0xc9))[_0x5b94('0x3d')](handleError(_0x513821,null));};exports[_0x5b94('0x1e')]=function(_0x4750f7,_0x3991b7){if(_0x4750f7[_0x5b94('0x43')]['id']){delete _0x4750f7[_0x5b94('0x43')]['id'];}return db[_0x5b94('0x29')][_0x5b94('0x46')]({'where':{'id':_0x4750f7['params']['id']}})[_0x5b94('0x23')](handleEntityNotFound(_0x3991b7,null))['then'](saveUpdates(_0x4750f7['body'],null))['then'](respondWithResult(_0x3991b7,null))[_0x5b94('0x3d')](handleError(_0x3991b7,null));};exports[_0x5b94('0x1f')]=function(_0x45205d,_0x1bd1ac){return db[_0x5b94('0x29')][_0x5b94('0x46')]({'where':{'id':_0x45205d[_0x5b94('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1bd1ac,null))['then'](removeEntity(_0x1bd1ac,null))[_0x5b94('0x3d')](handleError(_0x1bd1ac,null));};exports[_0x5b94('0x2a')]=function(_0x1b59f3,_0x10a03c){return db['CmCompany'][_0x5b94('0x2a')]()[_0x5b94('0x23')](respondWithResult(_0x10a03c,null))[_0x5b94('0x3d')](handleError(_0x10a03c,null));};exports[_0x5b94('0x4a')]=function(_0x22efbc,_0x23d9a9,_0xf44148){return db[_0x5b94('0x4b')][_0x5b94('0x46')]({'where':{'id':_0x22efbc['params']['id']}})[_0x5b94('0x23')](handleEntityNotFound(_0x23d9a9,null))[_0x5b94('0x23')](function(_0x26b931){if(_0x26b931){return _0x26b931[_0x5b94('0x4a')](_0x22efbc[_0x5b94('0x43')][_0x5b94('0x4c')],_['omit'](_0x22efbc['body'],['ids','id'])||{});}})[_0x5b94('0x23')](respondWithResult(_0x23d9a9,null))[_0x5b94('0x3d')](handleError(_0x23d9a9,null));};exports[_0x5b94('0x4d')]=function(_0x4b2627,_0x52356b,_0x415a7e){var _0x2bf393={};var _0x44ad67={};var _0x41e24d;var _0x4984fb;return db[_0x5b94('0x29')]['findOne']({'where':{'id':_0x4b2627[_0x5b94('0x3f')]['id']}})[_0x5b94('0x23')](handleEntityNotFound(_0x52356b,null))[_0x5b94('0x23')](function(_0x191bc4){if(_0x191bc4){_0x41e24d=_0x191bc4;_0x44ad67['model']=_[_0x5b94('0x2b')](db[_0x5b94('0x4b')][_0x5b94('0x40')]);_0x44ad67[_0x5b94('0x2c')]=_['keys'](_0x4b2627[_0x5b94('0x2c')]);_0x44ad67['filters']=_[_0x5b94('0x2d')](_0x44ad67['model'],_0x44ad67[_0x5b94('0x2c')]);_0x2bf393[_0x5b94('0x30')]=_[_0x5b94('0x2d')](_0x44ad67[_0x5b94('0x2e')],qs[_0x5b94('0x2f')](_0x4b2627['query']['fields']));_0x2bf393[_0x5b94('0x30')]=_0x2bf393[_0x5b94('0x30')][_0x5b94('0x31')]?_0x2bf393[_0x5b94('0x30')]:_0x44ad67['model'];_0x2bf393[_0x5b94('0x4e')]=qs['sort'](_0x4b2627[_0x5b94('0x2c')][_0x5b94('0x34')]);_0x2bf393[_0x5b94('0x35')]=qs[_0x5b94('0x41')](_[_0x5b94('0x36')](_0x4b2627[_0x5b94('0x2c')],_0x44ad67[_0x5b94('0x41')]));if(_0x4b2627['query'][_0x5b94('0x39')]){_0x2bf393[_0x5b94('0x35')]=_[_0x5b94('0x37')](_0x2bf393[_0x5b94('0x35')],{'$or':_['map'](_0x2bf393[_0x5b94('0x30')],function(_0x1ec656){var _0x4071a1={};_0x4071a1[_0x1ec656]={'$like':'%'+_0x4b2627['query']['filter']+'%'};return _0x4071a1;})});}_0x2bf393=_[_0x5b94('0x37')]({},_0x2bf393,_0x4b2627[_0x5b94('0x3a')]);return _0x41e24d['getContacts'](_0x2bf393);}})['then'](function(_0x31d51a){if(_0x31d51a){_0x4984fb=_0x31d51a[_0x5b94('0x31')];if(!_0x4b2627[_0x5b94('0x2c')][_0x5b94('0x32')](_0x5b94('0x4f'))){_0x2bf393['limit']=qs[_0x5b94('0x33')](_0x4b2627['query'][_0x5b94('0x33')]);_0x2bf393['offset']=qs[_0x5b94('0x19')](_0x4b2627[_0x5b94('0x2c')][_0x5b94('0x19')]);}return _0x41e24d[_0x5b94('0x4d')](_0x2bf393);}})['then'](function(_0x203884){if(_0x203884){return _0x203884?{'count':_0x4984fb,'rows':_0x203884}:null;}})[_0x5b94('0x23')](respondWithResult(_0x52356b,null))[_0x5b94('0x3d')](handleError(_0x52356b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index eda6f82..bf1a6ba 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 _0x50a6=['./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','moment','request-promise','path','rimraf'];(function(_0x1b1365,_0x205568){var _0x5edfd8=function(_0xae9b3d){while(--_0xae9b3d){_0x1b1365['push'](_0x1b1365['shift']());}};_0x5edfd8(++_0x205568);}(_0x50a6,0xa4));var _0x650a=function(_0x5d4366,_0x1ea497){_0x5d4366=_0x5d4366-0x0;var _0x373165=_0x50a6[_0x5d4366];return _0x373165;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));module['exports']=function(_0x4eabde,_0x2d486d){return _0x4eabde[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':_0x650a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc18a=['cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x3eab03,_0x55192c){var _0x3eda6e=function(_0x2165c5){while(--_0x2165c5){_0x3eab03['push'](_0x3eab03['shift']());}};_0x3eda6e(++_0x55192c);}(_0xc18a,0x1cf));var _0xac18=function(_0x26615d,_0x280370){_0x26615d=_0x26615d-0x0;var _0x26ce8d=_0xc18a[_0x26615d];return _0x26ce8d;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var logger=require(_0xac18('0x2'))(_0xac18('0x3'));var moment=require('moment');var BPromise=require(_0xac18('0x4'));var rp=require(_0xac18('0x5'));var fs=require('fs');var path=require(_0xac18('0x6'));var rimraf=require(_0xac18('0x7'));var config=require(_0xac18('0x8'));var attributes=require(_0xac18('0x9'));module[_0xac18('0xa')]=function(_0x395493,_0x49136f){return _0x395493[_0xac18('0xb')](_0xac18('0xc'),attributes,{'tableName':_0xac18('0xd'),'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 79174d1..d820362 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 _0x4738=['request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4738,0x156));var _0x8473=function(_0x3402ca,_0x1d0bcf){_0x3402ca=_0x3402ca-0x0;var _0x399c2d=_0x4738[_0x3402ca];return _0x399c2d;};'use strict';var _=require(_0x8473('0x0'));var util=require(_0x8473('0x1'));var moment=require(_0x8473('0x2'));var BPromise=require('bluebird');var rs=require(_0x8473('0x3'));var fs=require('fs');var Redis=require(_0x8473('0x4'));var db=require(_0x8473('0x5'))['db'];var utils=require(_0x8473('0x6'));var logger=require('../../config/logger')(_0x8473('0x7'));var config=require(_0x8473('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8473('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x135fef,_0x3c4f00,_0xcdfbc6){return new BPromise(function(_0x1eb7bd,_0x870372){return client[_0x8473('0xa')](_0x135fef,_0xcdfbc6)['then'](function(_0x2baa72){logger[_0x8473('0xb')]('CmCompany,\x20%s,\x20%s',_0x3c4f00,_0x8473('0xc'));logger[_0x8473('0xd')](_0x8473('0xe'),_0x3c4f00,_0x8473('0xc'),JSON[_0x8473('0xf')](_0x2baa72));if(_0x2baa72[_0x8473('0x10')]){if(_0x2baa72['error'][_0x8473('0x11')]===0x1f4){logger[_0x8473('0x10')](_0x8473('0x12'),_0x3c4f00,_0x2baa72['error'][_0x8473('0x13')]);return _0x870372(_0x2baa72[_0x8473('0x10')][_0x8473('0x13')]);}logger[_0x8473('0x10')](_0x8473('0x12'),_0x3c4f00,_0x2baa72[_0x8473('0x10')][_0x8473('0x13')]);return _0x1eb7bd(_0x2baa72[_0x8473('0x10')][_0x8473('0x13')]);}else{logger[_0x8473('0xb')](_0x8473('0x12'),_0x3c4f00,_0x8473('0xc'));_0x1eb7bd(_0x2baa72[_0x8473('0x14')][_0x8473('0x13')]);}})[_0x8473('0x15')](function(_0xc9648d){logger[_0x8473('0x10')](_0x8473('0x12'),_0x3c4f00,_0xc9648d);_0x870372(_0xc9648d);});});}
\ No newline at end of file
+var _0xe0e4=['request','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x518db9,_0x124b85){var _0x1233fe=function(_0x6d23c0){while(--_0x6d23c0){_0x518db9['push'](_0x518db9['shift']());}};_0x1233fe(++_0x124b85);}(_0xe0e4,0x1ef));var _0x4e0e=function(_0x523295,_0x5c15d4){_0x523295=_0x523295-0x0;var _0x487b16=_0xe0e4[_0x523295];return _0x487b16;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4e0e('0x0'));var BPromise=require(_0x4e0e('0x1'));var rs=require(_0x4e0e('0x2'));var fs=require('fs');var Redis=require(_0x4e0e('0x3'));var db=require(_0x4e0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e0e('0x5'))(_0x4e0e('0x6'));var config=require(_0x4e0e('0x7'));var jayson=require(_0x4e0e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f2e80,_0x591068,_0x197425){return new BPromise(function(_0x40fff4,_0x4e31af){return client[_0x4e0e('0x9')](_0x3f2e80,_0x197425)['then'](function(_0x45ddeb){logger['info'](_0x4e0e('0xa'),_0x591068,'request\x20sent');logger[_0x4e0e('0xb')](_0x4e0e('0xc'),_0x591068,_0x4e0e('0xd'),JSON[_0x4e0e('0xe')](_0x45ddeb));if(_0x45ddeb[_0x4e0e('0xf')]){if(_0x45ddeb['error'][_0x4e0e('0x10')]===0x1f4){logger['error'](_0x4e0e('0xa'),_0x591068,_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);return _0x4e31af(_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);}logger[_0x4e0e('0xf')](_0x4e0e('0xa'),_0x591068,_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);return _0x40fff4(_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);}else{logger[_0x4e0e('0x12')](_0x4e0e('0xa'),_0x591068,_0x4e0e('0xd'));_0x40fff4(_0x45ddeb[_0x4e0e('0x13')][_0x4e0e('0x11')]);}})[_0x4e0e('0x14')](function(_0x59f2e7){logger[_0x4e0e('0xf')](_0x4e0e('0xa'),_0x591068,_0x59f2e7);_0x4e31af(_0x59f2e7);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 085b738..103481d 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 _0xbff5=['addContacts','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','getContacts','post'];(function(_0x53fe55,_0xdeddc){var _0x289f64=function(_0xde37b5){while(--_0xde37b5){_0x53fe55['push'](_0x53fe55['shift']());}};_0x289f64(++_0xdeddc);}(_0xbff5,0x1bc));var _0x5bff=function(_0x325db0,_0x12d594){_0x325db0=_0x325db0-0x0;var _0xe50aae=_0xbff5[_0x325db0];return _0xe50aae;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var auth=require(_0x5bff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bff('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x5bff('0x8')](),controller[_0x5bff('0x9')]);router[_0x5bff('0xa')](_0x5bff('0xb'),auth[_0x5bff('0x8')](),controller[_0x5bff('0xc')]);router[_0x5bff('0xa')](_0x5bff('0xd'),auth[_0x5bff('0x8')](),controller['show']);router[_0x5bff('0xa')]('/:id/contacts',auth[_0x5bff('0x8')](),controller[_0x5bff('0xe')]);router['post']('/',auth[_0x5bff('0x8')](),controller['create']);router[_0x5bff('0xf')]('/:id/contacts',auth[_0x5bff('0x8')](),controller[_0x5bff('0x10')]);router['put'](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0x11')]);router[_0x5bff('0x12')]('/:id',auth[_0x5bff('0x8')](),controller[_0x5bff('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa6b0=['util','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer'];(function(_0x372b9e,_0x59fa28){var _0x698bbe=function(_0x119ce5){while(--_0x119ce5){_0x372b9e['push'](_0x372b9e['shift']());}};_0x698bbe(++_0x59fa28);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x42bffa,_0x28f24e){_0x42bffa=_0x42bffa-0x0;var _0x216e7d=_0xa6b0[_0x42bffa];return _0x216e7d;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var auth=require(_0x0a6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a6b('0x5'));var controller=require(_0x0a6b('0x6'));router[_0x0a6b('0x7')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x9')]);router[_0x0a6b('0x7')](_0x0a6b('0xa'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xb')]);router[_0x0a6b('0x7')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller['show']);router['get'](_0x0a6b('0xd'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xe')]);router[_0x0a6b('0xf')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x10')]);router[_0x0a6b('0xf')](_0x0a6b('0xd'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x13')]);router['delete']('/:id',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x14')]);module[_0x0a6b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index a6134d8..343004f 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 _0x2a49=['exports','STRING','INTEGER','UNSIGNED'];(function(_0x11767a,_0x14aa23){var _0x2e2c24=function(_0x33bb54){while(--_0x33bb54){_0x11767a['push'](_0x11767a['shift']());}};_0x2e2c24(++_0x14aa23);}(_0x2a49,0x164));var _0x92a4=function(_0x5169dc,_0x5d9983){_0x5169dc=_0x5169dc-0x0;var _0x4642a3=_0x2a49[_0x5169dc];return _0x4642a3;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x92a4('0x0')]={'firstName':{'type':Sequelize[_0x92a4('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x92a4('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x92a4('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x92a4('0x1')]},'mobile':{'type':Sequelize[_0x92a4('0x1')]},'fax':{'type':Sequelize[_0x92a4('0x1')]},'email':{'type':Sequelize[_0x92a4('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x92a4('0x1')]},'fb_data':{'type':Sequelize[_0x92a4('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x92a4('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x92a4('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x92a4('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x92a4('0x2')](0x2)[_0x92a4('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x8269=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8269,0xbc));var _0x9826=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8269[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9826('0x0'));var Sequelize=require('sequelize');module[_0x9826('0x1')]={'firstName':{'type':Sequelize[_0x9826('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9826('0x2')]},'street':{'type':Sequelize[_0x9826('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9826('0x2')]},'country':{'type':Sequelize[_0x9826('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9826('0x2')]},'description':{'type':Sequelize[_0x9826('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9826('0x2')]},'fax':{'type':Sequelize[_0x9826('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x9826('0x2')]},'twitter':{'type':Sequelize[_0x9826('0x2')]},'skype':{'type':Sequelize[_0x9826('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9826('0x2')]},'wechat':{'type':Sequelize[_0x9826('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9826('0x4')]},'priority':{'type':Sequelize[_0x9826('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9826('0x5')],'defaultValue':Sequelize[_0x9826('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 3580d83..32276ed 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 _0x3fce=['Tag','color','push','omit','format','cf_%d','$and','pickBy','table','setFields','id\x20=\x20?','toParam','phone','rawAttributes','nolimit','setTags','ContactId','options','includeAll','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','end','json','count','limit','set','apply','save','then','destroy','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','offset','sort','where','pick','select','field','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','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?','castTo','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','tag','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize','Tags','rows','catch','params','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error'];(function(_0x25f3f7,_0x13f4b0){var _0x4b8e8f=function(_0x23e73b){while(--_0x23e73b){_0x25f3f7['push'](_0x25f3f7['shift']());}};_0x4b8e8f(++_0x13f4b0);}(_0x3fce,0x121));var _0xe3fc=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x3fce[_0x2002b3];return _0x2756f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe3fc('0x0'));var rimraf=require(_0xe3fc('0x1'));var zipdir=require(_0xe3fc('0x2'));var jsonpatch=require(_0xe3fc('0x3'));var rp=require(_0xe3fc('0x4'));var moment=require(_0xe3fc('0x5'));var BPromise=require(_0xe3fc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe3fc('0x7'));var ejs=require(_0xe3fc('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe3fc('0x9'));var crypto=require('crypto');var jsforce=require(_0xe3fc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe3fc('0x7'));var querystring=require(_0xe3fc('0xb'));var Papa=require(_0xe3fc('0xc'));var Redis=require(_0xe3fc('0xd'));var authService=require(_0xe3fc('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3fc('0xf'));var logger=require(_0xe3fc('0x10'))(_0xe3fc('0x11'));var utils=require('../../config/utils');var config=require(_0xe3fc('0x12'));var db=require(_0xe3fc('0x13'))['db'];config[_0xe3fc('0x14')]=_[_0xe3fc('0x15')](config[_0xe3fc('0x14')],{'host':_0xe3fc('0x16'),'port':0x18eb});var socket=require(_0xe3fc('0x17'))(new Redis(config['redis']));require(_0xe3fc('0x18'))[_0xe3fc('0x19')](socket);function respondWithStatusCode(_0x4b2ed4,_0x3f7ae2){_0x3f7ae2=_0x3f7ae2||0xcc;return function(_0x3d437f){if(_0x3d437f){return _0x4b2ed4['sendStatus'](_0x3f7ae2);}return _0x4b2ed4[_0xe3fc('0x1a')](_0x3f7ae2)[_0xe3fc('0x1b')]();};}function respondWithResult(_0x4b6256,_0x4fa4d4){_0x4fa4d4=_0x4fa4d4||0xc8;return function(_0x5953ac){if(_0x5953ac){return _0x4b6256[_0xe3fc('0x1a')](_0x4fa4d4)[_0xe3fc('0x1c')](_0x5953ac);}};}function respondWithFilteredResult(_0x2f8cc9,_0x59a6db){return function(_0x58a4b8){if(_0x58a4b8){var _0x354695=_0x58a4b8[_0xe3fc('0x1d')],_0x5a4d98=_0x59a6db['offset'],_0x404e04=_0x59a6db['offset']+_0x59a6db[_0xe3fc('0x1e')],_0xca0203;if(_0x404e04>=_0x354695){_0x404e04=_0x354695;_0xca0203=0xc8;}else{_0xca0203=0xce;}_0x2f8cc9[_0xe3fc('0x1a')](_0xca0203);return _0x2f8cc9[_0xe3fc('0x1f')]('Content-Range',_0x5a4d98+'-'+_0x404e04+'/'+_0x354695)[_0xe3fc('0x1c')](_0x58a4b8);}return null;};}function patchUpdates(_0xfac19f){return function(_0x498bd3){try{jsonpatch[_0xe3fc('0x20')](_0x498bd3,_0xfac19f,!![]);}catch(_0x82da29){return BPromise['reject'](_0x82da29);}return _0x498bd3[_0xe3fc('0x21')]();};}function saveUpdates(_0x457cef,_0x1e307a){return function(_0x5b53a7){if(_0x5b53a7){return _0x5b53a7['update'](_0x457cef)[_0xe3fc('0x22')](function(_0x4f4134){return _0x4f4134;});}return null;};}function removeEntity(_0x55ea5e,_0x383f19){return function(_0x2e9322){if(_0x2e9322){return _0x2e9322[_0xe3fc('0x23')]()[_0xe3fc('0x22')](function(){_0x55ea5e['status'](0xcc)[_0xe3fc('0x1b')]();});}};}function handleEntityNotFound(_0x54e294,_0x507656){return function(_0x5abdb3){if(!_0x5abdb3){_0x54e294['sendStatus'](0x194);}return _0x5abdb3;};}function handleError(_0x51dc35,_0x16045e){_0x16045e=_0x16045e||0x1f4;return function(_0x35a7b5){logger['error'](_0x35a7b5[_0xe3fc('0x24')]);if(_0x35a7b5[_0xe3fc('0x25')]){delete _0x35a7b5['name'];}_0x51dc35[_0xe3fc('0x1a')](_0x16045e)[_0xe3fc('0x26')](_0x35a7b5);};}exports[_0xe3fc('0x27')]=function(_0x3bc101,_0x3d173e){var _0x21ccdd={},_0x396685={},_0x205687={'count':0x0,'rows':[]};return db[_0xe3fc('0x28')][_0xe3fc('0x29')]()[_0xe3fc('0x22')](function(_0x39f375){var _0x25a0af=[];for(var _0x43714d=0x0;_0x43714d','Attachments','Data','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','split','length','slice','join','Anonymous','pop','html'];(function(_0x16d3f8,_0x3f5dd3){var _0x49a172=function(_0x2f730d){while(--_0x2f730d){_0x16d3f8['push'](_0x16d3f8['shift']());}};_0x49a172(++_0x3f5dd3);}(_0x2a7c,0xb3));var _0xc2a7=function(_0x10fc54,_0x45adbd){_0x10fc54=_0x10fc54-0x0;var _0x4f0903=_0x2a7c[_0x10fc54];return _0x4f0903;};'use strict';var _=require(_0xc2a7('0x0'));var moment=require(_0xc2a7('0x1'));var random=require(_0xc2a7('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xc2a7('0x3'));var tnef=require(_0xc2a7('0x4'));var logger=require(_0xc2a7('0x5'))(_0xc2a7('0x6'));var config=require(_0xc2a7('0x7'));function getAddress(_0x324780){var _0x1b5c03=_[_0xc2a7('0x8')](_0x324780['value']);return _0x1b5c03&&_0x1b5c03[_0xc2a7('0x9')]?_0x1b5c03['address']:_0xc2a7('0xa')+random[_0xc2a7('0xb')](0x6)+_0xc2a7('0xc');}function getFirstName(_0x8be6d5){var _0x1a3af1=_[_0xc2a7('0x8')](_0x8be6d5[_0xc2a7('0xd')]);if(_0x1a3af1&&_0x1a3af1[_0xc2a7('0xe')]){var _0x4dd8bb=_0x1a3af1[_0xc2a7('0xe')][_0xc2a7('0xf')](/\s+/);return _0x4dd8bb[_0xc2a7('0x10')]?_0x4dd8bb[_0xc2a7('0x11')](0x0,-0x1)[_0xc2a7('0x12')]('\x20'):_0x1a3af1['name'];}return _0xc2a7('0x13');}function getLastName(_0x442bcf){var _0x211216=_['head'](_0x442bcf[_0xc2a7('0xd')]);if(_0x211216&&_0x211216[_0xc2a7('0xe')]){var _0x3eb538=_0x211216[_0xc2a7('0xe')]['split'](/\s+/);return _0x3eb538['length']>0x1?_0x3eb538[_0xc2a7('0x14')]():'';}return'';}function getMails(_0x10e8d8,_0x241d21){var _0x271eff='';for(var _0x36fb29=0x0;_0x36fb29<_0x241d21[_0xc2a7('0xd')][_0xc2a7('0x10')];_0x36fb29+=0x1){if(_0x241d21[_0xc2a7('0xd')][_0x36fb29][_0xc2a7('0x9')]!==_0x10e8d8){if(!_['isEmpty'](_0x271eff)){_0x271eff+=',';}_0x271eff+=_0x241d21[_0xc2a7('0xd')][_0x36fb29][_0xc2a7('0xe')]||_0x241d21['value'][_0x36fb29][_0xc2a7('0x9')]||'';_0x271eff+='\x20<';_0x271eff+=_0x241d21[_0xc2a7('0xd')][_0x36fb29]['address']?_0x241d21[_0xc2a7('0xd')][_0x36fb29][_0xc2a7('0x9')]:_0xc2a7('0xa')+random[_0xc2a7('0xb')](0x6)+_0xc2a7('0xc');_0x271eff+='>';}}return _0x271eff;}function parseEmail(_0x264174,_0xec6c43,_0x2e978c){if(_0xec6c43[_0xc2a7('0x15')]){var _0x5b09fc=/