From: Andrea Bianco
Date: Sat, 2 Jan 2021 10:17:58 +0000 (+0100)
Subject: Built motion from commit (unavailable).|2.5.11
X-Git-Tag: 2.5.11
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=6b8dca8de1a6b807be7e36077511bb032e7382e5;p=motion2.git
Built motion from commit (unavailable).|2.5.11
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9a3c5c1..ab55957 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-01-02T09:50:37.016Z",
+ "time": "2021-01-02T10:11:03.106Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9602335..f349811 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-01-02T09:50:37.016Z",
+ "time": "2021-01-02T10:11:03.106Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index b421184..8734597 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 _0xacd2=['VIRTUAL','getDataValue','action','STRING','contactManager','browser','bot','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'];(function(_0x17dae9,_0x1ffca0){var _0x2004b7=function(_0x1ab0e8){while(--_0x1ab0e8){_0x17dae9['push'](_0x17dae9['shift']());}};_0x2004b7(++_0x1ffca0);}(_0xacd2,0x144));var _0x2acd=function(_0x69cac6,_0x1a7831){_0x69cac6=_0x69cac6-0x0;var _0x40b986=_0xacd2[_0x69cac6];return _0x40b986;};'use strict';var Sequelize=require(_0x2acd('0x0'));module['exports']={'name':{'type':Sequelize[_0x2acd('0x1')],'get':function(_0x48853b){return this[_0x2acd('0x2')](_0x2acd('0x3'));}},'action':{'type':Sequelize[_0x2acd('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2acd('0x5'),'integration','motionbar','jscripty','urlForward',_0x2acd('0x6'),_0x2acd('0x7'),_0x2acd('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2acd('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x2acd('0xa')},'data2':{'type':Sequelize[_0x2acd('0x4')](0x1000),'comment':_0x2acd('0xb')},'data3':{'type':Sequelize[_0x2acd('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x2acd('0x4')](0x1000)},'data5':{'type':Sequelize[_0x2acd('0x4')](0x1000)},'data6':{'type':Sequelize[_0x2acd('0x4')]},'data7':{'type':Sequelize[_0x2acd('0xc')]}};
\ No newline at end of file
+var _0xe813=['VIRTUAL','getDataValue','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xe813,0x151));var _0x3e81=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0xe813[_0x5f42f1];return _0x5534ee;};'use strict';var Sequelize=require('sequelize');module[_0x3e81('0x0')]={'name':{'type':Sequelize[_0x3e81('0x1')],'get':function(_0x31e885){return this[_0x3e81('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x3e81('0x3'),_0x3e81('0x4'),_0x3e81('0x5'),'urlForward',_0x3e81('0x6'),_0x3e81('0x7'),_0x3e81('0x8')]],'msg':_0x3e81('0x9')}},'comment':_0x3e81('0x9')},'data1':{'type':Sequelize[_0x3e81('0xa')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x3e81('0xa')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3e81('0xb')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x3e81('0xa')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x3e81('0xc')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 86fc020..d64b850 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 _0xa423=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','json','apply','reject','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x1d4f4c,_0x3c3f4a){var _0x4ab87a=function(_0x5598ee){while(--_0x5598ee){_0x1d4f4c['push'](_0x1d4f4c['shift']());}};_0x4ab87a(++_0x3c3f4a);}(_0xa423,0x16c));var _0x3a42=function(_0x349edb,_0x2fc4b1){_0x349edb=_0x349edb-0x0;var _0x517f7e=_0xa423[_0x349edb];return _0x517f7e;};'use strict';var pdf=require(_0x3a42('0x0'));var emlformat=require(_0x3a42('0x1'));var rimraf=require(_0x3a42('0x2'));var zipdir=require(_0x3a42('0x3'));var jsonpatch=require(_0x3a42('0x4'));var rp=require('request-promise');var moment=require(_0x3a42('0x5'));var BPromise=require(_0x3a42('0x6'));var Mustache=require('mustache');var util=require(_0x3a42('0x7'));var path=require(_0x3a42('0x8'));var sox=require(_0x3a42('0x9'));var csv=require(_0x3a42('0xa'));var ejs=require(_0x3a42('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3a42('0xc'));var crypto=require(_0x3a42('0xd'));var jsforce=require(_0x3a42('0xe'));var deskjs=require(_0x3a42('0xf'));var toCsv=require(_0x3a42('0xa'));var querystring=require(_0x3a42('0x10'));var Papa=require(_0x3a42('0x11'));var Redis=require(_0x3a42('0x12'));var authService=require(_0x3a42('0x13'));var qs=require(_0x3a42('0x14'));var as=require(_0x3a42('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a42('0x16'))(_0x3a42('0x17'));var utils=require(_0x3a42('0x18'));var config=require(_0x3a42('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11ccc8,_0x4df153){_0x4df153=_0x4df153||0xcc;return function(_0x4008ea){if(_0x4008ea){return _0x11ccc8[_0x3a42('0x1a')](_0x4df153);}return _0x11ccc8[_0x3a42('0x1b')](_0x4df153)[_0x3a42('0x1c')]();};}function respondWithResult(_0x891963,_0x475602){_0x475602=_0x475602||0xc8;return function(_0x5f5244){if(_0x5f5244){return _0x891963[_0x3a42('0x1b')](_0x475602)['json'](_0x5f5244);}};}function respondWithFilteredResult(_0x469c73,_0x4b1d68){return function(_0x3e5d77){if(_0x3e5d77){var _0x5895a8=_0x3e5d77['count'],_0x46ef1e=_0x4b1d68[_0x3a42('0x1d')],_0x4edcf5=_0x4b1d68[_0x3a42('0x1d')]+_0x4b1d68[_0x3a42('0x1e')],_0x486c74;if(_0x4edcf5>=_0x5895a8){_0x4edcf5=_0x5895a8;_0x486c74=0xc8;}else{_0x486c74=0xce;}_0x469c73[_0x3a42('0x1b')](_0x486c74);return _0x469c73[_0x3a42('0x1f')]('Content-Range',_0x46ef1e+'-'+_0x4edcf5+'/'+_0x5895a8)[_0x3a42('0x20')](_0x3e5d77);}return null;};}function patchUpdates(_0x2e5e64){return function(_0x49f00e){try{jsonpatch[_0x3a42('0x21')](_0x49f00e,_0x2e5e64,!![]);}catch(_0xa89087){return BPromise[_0x3a42('0x22')](_0xa89087);}return _0x49f00e['save']();};}function saveUpdates(_0x1fcea4,_0x3f4afb){return function(_0x3bb792){if(_0x3bb792){return _0x3bb792[_0x3a42('0x23')](_0x1fcea4)[_0x3a42('0x24')](function(_0x526d7c){return _0x526d7c;});}return null;};}function removeEntity(_0x34927a,_0x42b40f){return function(_0x379fe6){if(_0x379fe6){return _0x379fe6[_0x3a42('0x25')]()[_0x3a42('0x24')](function(){_0x34927a['status'](0xcc)[_0x3a42('0x1c')]();});}};}function handleEntityNotFound(_0x41b374,_0x477cb9){return function(_0x1add9b){if(!_0x1add9b){_0x41b374[_0x3a42('0x1a')](0x194);}return _0x1add9b;};}function handleError(_0x258917,_0x2ee4b8){_0x2ee4b8=_0x2ee4b8||0x1f4;return function(_0x434044){logger[_0x3a42('0x26')](_0x434044[_0x3a42('0x27')]);if(_0x434044[_0x3a42('0x28')]){delete _0x434044['name'];}_0x258917[_0x3a42('0x1b')](_0x2ee4b8)[_0x3a42('0x29')](_0x434044);};}exports['update']=function(_0x3027dd,_0x5b5897){if(_0x3027dd[_0x3a42('0x2a')]['id']){delete _0x3027dd[_0x3a42('0x2a')]['id'];}return db[_0x3a42('0x2b')][_0x3a42('0x2c')]({'where':{'id':_0x3027dd[_0x3a42('0x2d')]['id']}})[_0x3a42('0x24')](handleEntityNotFound(_0x5b5897,null))['then'](saveUpdates(_0x3027dd[_0x3a42('0x2a')],null))[_0x3a42('0x24')](respondWithResult(_0x5b5897,null))[_0x3a42('0x2e')](handleError(_0x5b5897,null));};exports[_0x3a42('0x25')]=function(_0x1c8fe1,_0x44ef39){return db[_0x3a42('0x2b')]['find']({'where':{'id':_0x1c8fe1[_0x3a42('0x2d')]['id']}})[_0x3a42('0x24')](handleEntityNotFound(_0x44ef39,null))[_0x3a42('0x24')](removeEntity(_0x44ef39,null))[_0x3a42('0x2e')](handleError(_0x44ef39,null));};
\ No newline at end of file
+var _0xa46e=['status','json','count','limit','apply','reject','save','then','destroy','end','error','stack','send','body','Action','find','params','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3dad57,_0x1dd8b3){var _0x47a6b5=function(_0x6e545d){while(--_0x6e545d){_0x3dad57['push'](_0x3dad57['shift']());}};_0x47a6b5(++_0x1dd8b3);}(_0xa46e,0x8a));var _0xea46=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xa46e[_0x3ff085];return _0x2b68c3;};'use strict';var pdf=require(_0xea46('0x0'));var emlformat=require(_0xea46('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xea46('0x2'));var jsonpatch=require(_0xea46('0x3'));var rp=require(_0xea46('0x4'));var moment=require('moment');var BPromise=require(_0xea46('0x5'));var Mustache=require('mustache');var util=require(_0xea46('0x6'));var path=require('path');var sox=require(_0xea46('0x7'));var csv=require('to-csv');var ejs=require(_0xea46('0x8'));var fs=require('fs');var _=require(_0xea46('0x9'));var squel=require('squel');var crypto=require(_0xea46('0xa'));var jsforce=require(_0xea46('0xb'));var deskjs=require(_0xea46('0xc'));var toCsv=require(_0xea46('0xd'));var querystring=require(_0xea46('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea46('0xf'));var as=require(_0xea46('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea46('0x11'))(_0xea46('0x12'));var utils=require(_0xea46('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea46('0x14'));var db=require(_0xea46('0x15'))['db'];function respondWithStatusCode(_0x4e10f3,_0x13390c){_0x13390c=_0x13390c||0xcc;return function(_0x1a4fe2){if(_0x1a4fe2){return _0x4e10f3['sendStatus'](_0x13390c);}return _0x4e10f3[_0xea46('0x16')](_0x13390c)['end']();};}function respondWithResult(_0x3024af,_0x42c328){_0x42c328=_0x42c328||0xc8;return function(_0x6c4bc4){if(_0x6c4bc4){return _0x3024af[_0xea46('0x16')](_0x42c328)[_0xea46('0x17')](_0x6c4bc4);}};}function respondWithFilteredResult(_0x2ef436,_0x81ee45){return function(_0x20a79c){if(_0x20a79c){var _0x176ad2=_0x20a79c[_0xea46('0x18')],_0x59e1ea=_0x81ee45['offset'],_0x2fa2f9=_0x81ee45['offset']+_0x81ee45[_0xea46('0x19')],_0xbf225e;if(_0x2fa2f9>=_0x176ad2){_0x2fa2f9=_0x176ad2;_0xbf225e=0xc8;}else{_0xbf225e=0xce;}_0x2ef436[_0xea46('0x16')](_0xbf225e);return _0x2ef436['set']('Content-Range',_0x59e1ea+'-'+_0x2fa2f9+'/'+_0x176ad2)[_0xea46('0x17')](_0x20a79c);}return null;};}function patchUpdates(_0x9b7d04){return function(_0x4ff93d){try{jsonpatch[_0xea46('0x1a')](_0x4ff93d,_0x9b7d04,!![]);}catch(_0x16ae38){return BPromise[_0xea46('0x1b')](_0x16ae38);}return _0x4ff93d[_0xea46('0x1c')]();};}function saveUpdates(_0x53b8db,_0x2b6491){return function(_0x4e220f){if(_0x4e220f){return _0x4e220f['update'](_0x53b8db)[_0xea46('0x1d')](function(_0x59e431){return _0x59e431;});}return null;};}function removeEntity(_0x4cc673,_0x5064d8){return function(_0x3b25fe){if(_0x3b25fe){return _0x3b25fe[_0xea46('0x1e')]()[_0xea46('0x1d')](function(){_0x4cc673['status'](0xcc)[_0xea46('0x1f')]();});}};}function handleEntityNotFound(_0x59b10d,_0x12e688){return function(_0x2008b0){if(!_0x2008b0){_0x59b10d['sendStatus'](0x194);}return _0x2008b0;};}function handleError(_0xac33c3,_0x5480eb){_0x5480eb=_0x5480eb||0x1f4;return function(_0x2b3a8f){logger[_0xea46('0x20')](_0x2b3a8f[_0xea46('0x21')]);if(_0x2b3a8f['name']){delete _0x2b3a8f['name'];}_0xac33c3[_0xea46('0x16')](_0x5480eb)[_0xea46('0x22')](_0x2b3a8f);};}exports['update']=function(_0x3b3928,_0x4999b0){if(_0x3b3928[_0xea46('0x23')]['id']){delete _0x3b3928['body']['id'];}return db[_0xea46('0x24')][_0xea46('0x25')]({'where':{'id':_0x3b3928[_0xea46('0x26')]['id']}})[_0xea46('0x1d')](handleEntityNotFound(_0x4999b0,null))[_0xea46('0x1d')](saveUpdates(_0x3b3928[_0xea46('0x23')],null))['then'](respondWithResult(_0x4999b0,null))[_0xea46('0x27')](handleError(_0x4999b0,null));};exports[_0xea46('0x1e')]=function(_0x200e10,_0x5e0e35){return db[_0xea46('0x24')][_0xea46('0x25')]({'where':{'id':_0x200e10[_0xea46('0x26')]['id']}})['then'](handleEntityNotFound(_0x5e0e35,null))['then'](removeEntity(_0x5e0e35,null))['catch'](handleError(_0x5e0e35,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 197bfd8..8c72709 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 _0x0aa7=['bluebird','path','rimraf','Action','tools_actions','util','../../config/logger','api'];(function(_0x4f945d,_0x4856fc){var _0x35cc15=function(_0x2545a8){while(--_0x2545a8){_0x4f945d['push'](_0x4f945d['shift']());}};_0x35cc15(++_0x4856fc);}(_0x0aa7,0x175));var _0x70aa=function(_0x40a77f,_0x1d5f8d){_0x40a77f=_0x40a77f-0x0;var _0x415aa1=_0x0aa7[_0x40a77f];return _0x415aa1;};'use strict';var _=require('lodash');var util=require(_0x70aa('0x0'));var logger=require(_0x70aa('0x1'))(_0x70aa('0x2'));var moment=require('moment');var BPromise=require(_0x70aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70aa('0x4'));var rimraf=require(_0x70aa('0x5'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x1610f0,_0x21fa45){return _0x1610f0['define'](_0x70aa('0x6'),attributes,{'tableName':_0x70aa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeba4=['./action.attributes','exports','define','Action','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x475923,_0x25d9ec){var _0x374030=function(_0x3f256b){while(--_0x3f256b){_0x475923['push'](_0x475923['shift']());}};_0x374030(++_0x25d9ec);}(_0xeba4,0x1b4));var _0x4eba=function(_0x227c59,_0x575c83){_0x227c59=_0x227c59-0x0;var _0x35aeac=_0xeba4[_0x227c59];return _0x35aeac;};'use strict';var _=require(_0x4eba('0x0'));var util=require(_0x4eba('0x1'));var logger=require('../../config/logger')(_0x4eba('0x2'));var moment=require(_0x4eba('0x3'));var BPromise=require(_0x4eba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eba('0x5'));var rimraf=require(_0x4eba('0x6'));var config=require(_0x4eba('0x7'));var attributes=require(_0x4eba('0x8'));module[_0x4eba('0x9')]=function(_0x278bfd,_0x1f8585){return _0x278bfd[_0x4eba('0xa')](_0x4eba('0xb'),attributes,{'tableName':'tools_actions','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 a7e139a..63df0e6 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 _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2d5755,_0xbf768){var _0x4d1e6c=function(_0x751aca){while(--_0x751aca){_0x2d5755['push'](_0x2d5755['shift']());}};_0x4d1e6c(++_0xbf768);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x13fb43,_0x2fe5e3){var _0x22b3b4=function(_0x444121){while(--_0x444121){_0x13fb43['push'](_0x13fb43['shift']());}};_0x22b3b4(++_0x2fe5e3);}(_0xe706,0xa3));var _0x6e70=function(_0x3bb63a,_0x15af8f){_0x3bb63a=_0x3bb63a-0x0;var _0x3b822a=_0xe706[_0x3bb63a];return _0x3b822a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('Action,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b5cc1dd..d65d9bd 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 _0x5811=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2a0099,_0x4cf712){var _0x2d4237=function(_0x4f46f1){while(--_0x4f46f1){_0x2a0099['push'](_0x2a0099['shift']());}};_0x2d4237(++_0x4cf712);}(_0x5811,0xe9));var _0x1581=function(_0x465781,_0x3c3e57){_0x465781=_0x465781-0x0;var _0x931aaa=_0x5811[_0x465781];return _0x931aaa;};'use strict';var multer=require(_0x1581('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1581('0x1'));var express=require(_0x1581('0x2'));var router=express[_0x1581('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1581('0x4'));var config=require(_0x1581('0x5'));var controller=require(_0x1581('0x6'));router[_0x1581('0x7')](_0x1581('0x8'),auth['isAuthenticated'](),controller[_0x1581('0x9')]);router[_0x1581('0xa')](_0x1581('0x8'),auth['isAuthenticated'](),controller[_0x1581('0xb')]);module[_0x1581('0xc')]=router;
\ No newline at end of file
+var _0x95bf=['path','connect-timeout','express','Router','../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','exports','multer','util'];(function(_0xeb4cc8,_0x2da854){var _0x2883ee=function(_0x3053fb){while(--_0x3053fb){_0xeb4cc8['push'](_0xeb4cc8['shift']());}};_0x2883ee(++_0x2da854);}(_0x95bf,0x7c));var _0xf95b=function(_0x150c4a,_0x5b1b0f){_0x150c4a=_0x150c4a-0x0;var _0x492247=_0x95bf[_0x150c4a];return _0x492247;};'use strict';var multer=require(_0xf95b('0x0'));var util=require(_0xf95b('0x1'));var path=require(_0xf95b('0x2'));var timeout=require(_0xf95b('0x3'));var express=require(_0xf95b('0x4'));var router=express[_0xf95b('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf95b('0x6'));var controller=require(_0xf95b('0x7'));router[_0xf95b('0x8')](_0xf95b('0x9'),auth['isAuthenticated'](),controller[_0xf95b('0xa')]);router['delete']('/:id',auth[_0xf95b('0xb')](),controller[_0xf95b('0xc')]);module[_0xf95b('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index ff0f9e5..5391013 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 _0x8547=['TEXT','sequelize','exports','STRING'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x8547,0x165));var _0x7854=function(_0x105e4b,_0x3a50e4){_0x105e4b=_0x105e4b-0x0;var _0x2150e9=_0x8547[_0x105e4b];return _0x2150e9;};'use strict';var Sequelize=require(_0x7854('0x0'));module[_0x7854('0x1')]={'name':{'type':Sequelize[_0x7854('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7854('0x2')]},'parent':{'type':Sequelize[_0x7854('0x2')]},'table':{'type':Sequelize[_0x7854('0x2')]},'conditions':{'type':Sequelize[_0x7854('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x31dc=['STRING','TEXT','exports'];(function(_0xf6811,_0x10f5f9){var _0x2b07e0=function(_0x1adc4f){while(--_0x1adc4f){_0xf6811['push'](_0xf6811['shift']());}};_0x2b07e0(++_0x10f5f9);}(_0x31dc,0x107));var _0xc31d=function(_0x29c103,_0x339048){_0x29c103=_0x29c103-0x0;var _0x2af4c9=_0x31dc[_0x29c103];return _0x2af4c9;};'use strict';var Sequelize=require('sequelize');module[_0xc31d('0x0')]={'name':{'type':Sequelize[_0xc31d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc31d('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xc31d('0x1')]},'conditions':{'type':Sequelize[_0xc31d('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 192e529..a96669d 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 _0x4c90=['type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','merge','filter','count','includeAll','include','findAll','rows','show','params','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','right_join','cross_join','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','condition','keyBy','function','debug','QueryTypes','output','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','from','countTable','run','runReport','value','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','set','Content-Range','save','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','AnalyticCustomReport','rawAttributes'];(function(_0xc3248d,_0x40996c){var _0x18e9f4=function(_0x86a96f){while(--_0x86a96f){_0xc3248d['push'](_0xc3248d['shift']());}};_0x18e9f4(++_0x40996c);}(_0x4c90,0x73));var _0x04c9=function(_0x29cb68,_0x500f0b){_0x29cb68=_0x29cb68-0x0;var _0x4fb66c=_0x4c90[_0x29cb68];return _0x4fb66c;};'use strict';var pdf=require(_0x04c9('0x0'));var emlformat=require(_0x04c9('0x1'));var rimraf=require(_0x04c9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04c9('0x3'));var rp=require('request-promise');var moment=require(_0x04c9('0x4'));var BPromise=require(_0x04c9('0x5'));var Mustache=require(_0x04c9('0x6'));var util=require(_0x04c9('0x7'));var path=require(_0x04c9('0x8'));var sox=require('sox');var csv=require(_0x04c9('0x9'));var ejs=require(_0x04c9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x04c9('0xb'));var jsforce=require(_0x04c9('0xc'));var deskjs=require(_0x04c9('0xd'));var toCsv=require(_0x04c9('0x9'));var querystring=require('querystring');var Papa=require(_0x04c9('0xe'));var Redis=require(_0x04c9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04c9('0x10'));var logger=require(_0x04c9('0x11'))(_0x04c9('0x12'));var utils=require('../../config/utils');var config=require(_0x04c9('0x13'));var licenseUtil=require(_0x04c9('0x14'));var db=require(_0x04c9('0x15'))['db'];var dbH=require('../../mysqldb')[_0x04c9('0x16')];function respondWithStatusCode(_0xf34736,_0x1ecfbf){_0x1ecfbf=_0x1ecfbf||0xcc;return function(_0x660fbc){if(_0x660fbc){return _0xf34736[_0x04c9('0x17')](_0x1ecfbf);}return _0xf34736[_0x04c9('0x18')](_0x1ecfbf)[_0x04c9('0x19')]();};}function respondWithResult(_0x3d2589,_0x531146){_0x531146=_0x531146||0xc8;return function(_0x42aea9){if(_0x42aea9){return _0x3d2589[_0x04c9('0x18')](_0x531146)[_0x04c9('0x1a')](_0x42aea9);}};}function respondWithFilteredResult(_0x418208,_0x48d0c4){return function(_0x2be721){if(_0x2be721){var _0x4cad6d=_0x2be721['count'],_0x541c6d=_0x48d0c4[_0x04c9('0x1b')],_0x3a7a91=_0x48d0c4[_0x04c9('0x1b')]+_0x48d0c4[_0x04c9('0x1c')],_0x49dd88;if(_0x3a7a91>=_0x4cad6d){_0x3a7a91=_0x4cad6d;_0x49dd88=0xc8;}else{_0x49dd88=0xce;}_0x418208['status'](_0x49dd88);return _0x418208[_0x04c9('0x1d')](_0x04c9('0x1e'),_0x541c6d+'-'+_0x3a7a91+'/'+_0x4cad6d)[_0x04c9('0x1a')](_0x2be721);}return null;};}function patchUpdates(_0x16307f){return function(_0x357344){try{jsonpatch['apply'](_0x357344,_0x16307f,!![]);}catch(_0x1555dc){return BPromise['reject'](_0x1555dc);}return _0x357344[_0x04c9('0x1f')]();};}function saveUpdates(_0x2d5691,_0xb3e0){return function(_0x1817c3){if(_0x1817c3){return _0x1817c3['update'](_0x2d5691)[_0x04c9('0x20')](function(_0x48cae2){return _0x48cae2;});}return null;};}function removeEntity(_0x2cd2bb,_0x37b337){return function(_0x1dc155){if(_0x1dc155){return _0x1dc155[_0x04c9('0x21')]()[_0x04c9('0x20')](function(){var _0x5889fc=_0x1dc155[_0x04c9('0x22')]({'plain':!![]});var _0x57fb99=_0x04c9('0x23');return db[_0x04c9('0x24')][_0x04c9('0x21')]({'where':{'type':_0x57fb99,'resourceId':_0x5889fc['id']}})[_0x04c9('0x20')](function(){return _0x1dc155;});})[_0x04c9('0x20')](function(){_0x2cd2bb[_0x04c9('0x18')](0xcc)[_0x04c9('0x19')]();});}};}function handleEntityNotFound(_0x4117d1,_0x393e9b){return function(_0x518417){if(!_0x518417){_0x4117d1[_0x04c9('0x17')](0x194);}return _0x518417;};}function handleError(_0x323655,_0x5bab3d){_0x5bab3d=_0x5bab3d||0x1f4;return function(_0x38de1f){logger['error'](_0x38de1f[_0x04c9('0x25')]);if(_0x38de1f[_0x04c9('0x26')]){delete _0x38de1f[_0x04c9('0x26')];}_0x323655['status'](_0x5bab3d)['send'](_0x38de1f);};}exports[_0x04c9('0x27')]=function(_0x303446,_0x1e7fde){var _0x2a3d6c={},_0x585ed4={},_0x275e3b={'count':0x0,'rows':[]};var _0x786dc2=_['map'](db[_0x04c9('0x28')][_0x04c9('0x29')],function(_0x5ea67a){return{'name':_0x5ea67a['fieldName'],'type':_0x5ea67a[_0x04c9('0x2a')]['key']};});_0x585ed4['model']=_[_0x04c9('0x2b')](_0x786dc2,_0x04c9('0x26'));_0x585ed4[_0x04c9('0x2c')]=_[_0x04c9('0x2d')](_0x303446['query']);_0x585ed4['filters']=_[_0x04c9('0x2e')](_0x585ed4[_0x04c9('0x2f')],_0x585ed4['query']);_0x2a3d6c[_0x04c9('0x30')]=_['intersection'](_0x585ed4[_0x04c9('0x2f')],qs[_0x04c9('0x31')](_0x303446[_0x04c9('0x2c')][_0x04c9('0x31')]));_0x2a3d6c[_0x04c9('0x30')]=_0x2a3d6c[_0x04c9('0x30')][_0x04c9('0x32')]?_0x2a3d6c[_0x04c9('0x30')]:_0x585ed4[_0x04c9('0x2f')];if(!_0x303446[_0x04c9('0x2c')][_0x04c9('0x33')](_0x04c9('0x34'))){_0x2a3d6c[_0x04c9('0x1c')]=qs[_0x04c9('0x1c')](_0x303446[_0x04c9('0x2c')]['limit']);_0x2a3d6c[_0x04c9('0x1b')]=qs[_0x04c9('0x1b')](_0x303446[_0x04c9('0x2c')][_0x04c9('0x1b')]);}_0x2a3d6c['order']=qs[_0x04c9('0x35')](_0x303446[_0x04c9('0x2c')][_0x04c9('0x35')]);_0x2a3d6c['where']=qs[_0x04c9('0x36')](_['pick'](_0x303446[_0x04c9('0x2c')],_0x585ed4[_0x04c9('0x36')]),_0x786dc2);if(_0x303446['query']['filter']){_0x2a3d6c[_0x04c9('0x37')]=_[_0x04c9('0x38')](_0x2a3d6c[_0x04c9('0x37')],{'$or':_[_0x04c9('0x2b')](_0x786dc2,function(_0x1b0054){if(_0x1b0054[_0x04c9('0x2a')]!=='VIRTUAL'){var _0x35366e={};_0x35366e[_0x1b0054[_0x04c9('0x26')]]={'$like':'%'+_0x303446['query'][_0x04c9('0x39')]+'%'};return _0x35366e;}})});}_0x2a3d6c=_[_0x04c9('0x38')]({},_0x2a3d6c,_0x303446['options']);var _0x3e4461={'where':_0x2a3d6c[_0x04c9('0x37')]};return db[_0x04c9('0x28')][_0x04c9('0x3a')](_0x3e4461)[_0x04c9('0x20')](function(_0x1cf2f4){_0x275e3b[_0x04c9('0x3a')]=_0x1cf2f4;if(_0x303446[_0x04c9('0x2c')][_0x04c9('0x3b')]){_0x2a3d6c[_0x04c9('0x3c')]=[{'all':!![]}];}return db[_0x04c9('0x28')][_0x04c9('0x3d')](_0x2a3d6c);})[_0x04c9('0x20')](function(_0x194272){_0x275e3b[_0x04c9('0x3e')]=_0x194272;return _0x275e3b;})[_0x04c9('0x20')](respondWithFilteredResult(_0x1e7fde,_0x2a3d6c))['catch'](handleError(_0x1e7fde,null));};exports[_0x04c9('0x3f')]=function(_0x26173b,_0x5b58ca){var _0x101172={'raw':![],'where':{'id':_0x26173b[_0x04c9('0x40')]['id']}},_0x2cd298={};_0x2cd298[_0x04c9('0x2f')]=_['keys'](db[_0x04c9('0x28')][_0x04c9('0x29')]);_0x2cd298[_0x04c9('0x2c')]=_[_0x04c9('0x2d')](_0x26173b[_0x04c9('0x2c')]);_0x2cd298[_0x04c9('0x36')]=_['intersection'](_0x2cd298[_0x04c9('0x2f')],_0x2cd298[_0x04c9('0x2c')]);_0x101172[_0x04c9('0x30')]=_[_0x04c9('0x2e')](_0x2cd298[_0x04c9('0x2f')],qs[_0x04c9('0x31')](_0x26173b['query']['fields']));_0x101172[_0x04c9('0x30')]=_0x101172['attributes']['length']?_0x101172[_0x04c9('0x30')]:_0x2cd298[_0x04c9('0x2f')];if(_0x26173b[_0x04c9('0x2c')][_0x04c9('0x3b')]){_0x101172[_0x04c9('0x3c')]=[{'all':!![]}];}_0x101172=_[_0x04c9('0x38')]({},_0x101172,_0x26173b[_0x04c9('0x41')]);return db['AnalyticCustomReport']['find'](_0x101172)[_0x04c9('0x20')](handleEntityNotFound(_0x5b58ca,null))['then'](respondWithResult(_0x5b58ca,null))[_0x04c9('0x42')](handleError(_0x5b58ca,null));};exports[_0x04c9('0x43')]=function(_0x2caf66,_0x5a2c42){return db[_0x04c9('0x28')][_0x04c9('0x43')](_0x2caf66['body'],{})[_0x04c9('0x20')](function(_0x4db042){var _0x1d13a4=_0x2caf66[_0x04c9('0x44')][_0x04c9('0x22')]({'plain':!![]});if(!_0x1d13a4)throw new Error(_0x04c9('0x45'));if(_0x1d13a4[_0x04c9('0x46')]===_0x04c9('0x44')){var _0x12105a=_0x4db042[_0x04c9('0x22')]({'plain':!![]});var _0x14f6d1=_0x04c9('0x47');return db['UserProfileSection'][_0x04c9('0x48')]({'where':{'name':_0x14f6d1,'userProfileId':_0x1d13a4[_0x04c9('0x49')]},'raw':!![]})[_0x04c9('0x20')](function(_0x1c8804){if(_0x1c8804&&_0x1c8804['autoAssociation']===0x0){return db['UserProfileResource'][_0x04c9('0x43')]({'name':_0x12105a['name'],'resourceId':_0x12105a['id'],'type':_0x04c9('0x23'),'sectionId':_0x1c8804['id']},{})[_0x04c9('0x20')](function(){return _0x4db042;});}else{return _0x4db042;}})[_0x04c9('0x42')](function(_0x32385e){logger[_0x04c9('0x4a')](_0x04c9('0x4b'),_0x32385e);throw _0x32385e;});}return _0x4db042;})[_0x04c9('0x20')](respondWithResult(_0x5a2c42,0xc9))['catch'](handleError(_0x5a2c42,null));};exports[_0x04c9('0x4c')]=function(_0xbcf23,_0x282e35){if(_0xbcf23['body']['id']){delete _0xbcf23['body']['id'];}return db['AnalyticCustomReport'][_0x04c9('0x48')]({'where':{'id':_0xbcf23['params']['id']}})['then'](handleEntityNotFound(_0x282e35,null))[_0x04c9('0x20')](saveUpdates(_0xbcf23[_0x04c9('0x4d')],null))[_0x04c9('0x20')](respondWithResult(_0x282e35,null))['catch'](handleError(_0x282e35,null));};exports[_0x04c9('0x21')]=function(_0x1e6316,_0x39aebc){return db[_0x04c9('0x28')][_0x04c9('0x48')]({'where':{'id':_0x1e6316[_0x04c9('0x40')]['id']}})[_0x04c9('0x20')](handleEntityNotFound(_0x39aebc,null))['then'](removeEntity(_0x39aebc,null))[_0x04c9('0x42')](handleError(_0x39aebc,null));};exports[_0x04c9('0x4e')]=function(_0x1b17e3,_0x24479f){var _0x53e9db=0xa;var _0x2b911a=[_0x04c9('0x4f'),'left_join',_0x04c9('0x50'),_0x04c9('0x51')];var _0x40a217={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x04c9('0x52'),'AVG':_0x04c9('0x53'),'GROUP_CONCAT':_0x04c9('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x04c9('0x55')};var _0x2d6b60={'SEC_TO_TIME':_0x04c9('0x56'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x04c9('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4e8afe=function(_0x5be214){return!_[_0x04c9('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x04c9('0x59')],_0x5be214);};var _0x7ff07f=function(_0x5de580){if(!_0x5de580||!_0x5de580[_0x04c9('0x5a')][_0x04c9('0x32')]){return'';}for(var _0x454998='(',_0x2afc9c=0x0;_0x2afc9c<_0x5de580[_0x04c9('0x5a')][_0x04c9('0x32')];_0x2afc9c+=0x1){_0x2afc9c>0x0&&(_0x454998+='\x20'+_0x5de580[_0x04c9('0x5b')]+'\x20');_0x454998+=_0x5de580[_0x04c9('0x5a')][_0x2afc9c][_0x04c9('0x5c')]?_0x7ff07f(_0x5de580['rules'][_0x2afc9c][_0x04c9('0x5c')]):_0x5de580[_0x04c9('0x5a')][_0x2afc9c][_0x04c9('0x5d')]+'\x20'+_0x5de580[_0x04c9('0x5a')][_0x2afc9c]['condition']+(_0x4e8afe(_0x5de580[_0x04c9('0x5a')][_0x2afc9c]['condition'])?'\x20'+_0x5de580[_0x04c9('0x5a')][_0x2afc9c]['value']:'');}return _0x454998+')';};var _0x581dea={'where':{'id':_0x1b17e3[_0x04c9('0x40')]['id']}},_0x4c1505,_0x44d357,_0x24df7c,_0x1bb5a3,_0x44fd19;_0x581dea=_[_0x04c9('0x38')]({},_0x581dea,_0x1b17e3[_0x04c9('0x41')]);return db['AnalyticCustomReport'][_0x04c9('0x48')](_0x581dea)[_0x04c9('0x20')](function(_0x5e0a64){if(_0x5e0a64){_0x4c1505=_0x5e0a64;return _0x5e0a64[_0x04c9('0x5e')]();}return null;})['then'](function(_0xb7534c){if(_0xb7534c){if(!_0xb7534c['length']){throw new db[(_0x04c9('0x5f'))][(_0x04c9('0x60'))](_0x04c9('0x61'),0x193);}_0x44d357=_0xb7534c;return db[_0x04c9('0x62')]['findAll']({'raw':!![]});}return null;})[_0x04c9('0x20')](function(_0x3f012f){if(_0x3f012f){_0x24df7c=_['keyBy'](_0x3f012f,'id');var _0x790101;var _0x229e8f=squel[_0x04c9('0x63')]();_0x229e8f['from'](_0x4c1505[_0x04c9('0x64')]);for(var _0x27ff8d=0x0;_0x27ff8d<_0x44d357[_0x04c9('0x32')];_0x27ff8d+=0x1){_0x790101=_0x44d357[_0x27ff8d][_0x04c9('0x65')]?_0x24df7c[_0x44d357[_0x27ff8d][_0x04c9('0x65')]]['metric']:_0x44d357[_0x27ff8d]['field'];_0x790101=_0x44d357[_0x27ff8d]['function']?_[_0x04c9('0x66')](_0x40a217[_0x44d357[_0x27ff8d]['function']],'%s',_0x790101):_0x790101;_0x790101=_0x44d357[_0x27ff8d][_0x04c9('0x67')]?_[_0x04c9('0x66')](_0x2d6b60[_0x44d357[_0x27ff8d]['format']],'%s',_0x790101):_0x790101;if(_0x44d357[_0x27ff8d][_0x04c9('0x68')]){_0x229e8f[_0x04c9('0x5c')](_0x790101);}_0x44d357[_0x27ff8d][_0x04c9('0x69')]&&_0x229e8f[_0x04c9('0x6a')](_0x790101,_0x44d357[_0x27ff8d][_0x04c9('0x69')]===_0x04c9('0x6b')?![]:!![]);_0x229e8f['field'](_0x790101,_0x44d357[_0x27ff8d][_0x04c9('0x6c')]||_0x790101);}if(_0x4c1505[_0x04c9('0x6d')]){_0x4c1505[_0x04c9('0x6d')]=JSON[_0x04c9('0x6e')](_0x4c1505[_0x04c9('0x6d')]);for(var _0x3d980e=0x0;_0x3d980e<_0x4c1505['joins'][_0x04c9('0x32')];_0x3d980e+=0x1){if(_0x4c1505[_0x04c9('0x6d')][_0x3d980e][_0x04c9('0x2a')]&&_[_0x04c9('0x58')](_0x2b911a,_0x4c1505[_0x04c9('0x6d')][_0x3d980e][_0x04c9('0x2a')])&&_0x4c1505[_0x04c9('0x6d')][_0x3d980e][_0x04c9('0x6f')]&&_0x4c1505[_0x04c9('0x6d')][_0x3d980e]['foreignTable']&&_0x4c1505[_0x04c9('0x6d')][_0x3d980e]['foreignKey']){_0x229e8f[_0x4c1505[_0x04c9('0x6d')][_0x3d980e]['type']](_0x4c1505[_0x04c9('0x6d')][_0x3d980e][_0x04c9('0x70')],null,util[_0x04c9('0x67')](_0x04c9('0x71'),_0x4c1505[_0x04c9('0x64')],_0x4c1505[_0x04c9('0x6d')][_0x3d980e][_0x04c9('0x6f')],_0x4c1505['joins'][_0x3d980e][_0x04c9('0x70')],_0x4c1505[_0x04c9('0x6d')][_0x3d980e][_0x04c9('0x72')]));}}}if(_0x4c1505['conditions']){_0x4c1505[_0x04c9('0x73')]=JSON['parse'](_0x4c1505[_0x04c9('0x73')]);_0x229e8f[_0x04c9('0x37')](_0x7ff07f(_0x4c1505['conditions'][_0x04c9('0x5c')]));}_0x44fd19=_0x229e8f[_0x04c9('0x74')]();_0x229e8f[_0x04c9('0x1c')](_0x53e9db);_0x229e8f[_0x04c9('0x1b')](0x0);logger['debug'](_0x04c9('0x75'),_0x229e8f[_0x04c9('0x76')]());return db[_0x04c9('0x77')][_0x04c9('0x2c')](_0x229e8f['toString'](),{'type':db['sequelize']['QueryTypes'][_0x04c9('0x78')]});}})[_0x04c9('0x20')](respondWithResult(_0x24479f,null))['catch'](handleError(_0x24479f,null));};function runReport(_0x3417f0,_0x3be4c7,_0x3707db){var _0x233a9a=_0x3be4c7[_0x04c9('0x26')];var _0x462720=0xa;var _0x3840b3=[_0x04c9('0x4f'),_0x04c9('0x79'),_0x04c9('0x50'),_0x04c9('0x51')];var _0x5c3062={'SUM':_0x04c9('0x7a'),'COUNT':_0x04c9('0x7b'),'COUNT DISTINCT':_0x04c9('0x7c'),'MAX':_0x04c9('0x7d'),'MIN':_0x04c9('0x52'),'AVG':_0x04c9('0x53'),'GROUP_CONCAT':_0x04c9('0x54'),'GROUP_CONCAT ASC':_0x04c9('0x7e'),'GROUP_CONCAT DESC':_0x04c9('0x55')};var _0x5907ba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x04c9('0x7f'),'HOUR':_0x04c9('0x80'),'ROUND':_0x04c9('0x57'),'UNIX_TIMESTAMP':_0x04c9('0x81')};var _0x5eae0a=function(_0x45c1df){return!_[_0x04c9('0x58')]([_0x04c9('0x82'),_0x04c9('0x83'),_0x04c9('0x84'),_0x04c9('0x59')],_0x45c1df);};var _0x40b929=function(_0x1248a3){if(!_0x1248a3||!_0x1248a3[_0x04c9('0x5a')][_0x04c9('0x32')]){return'';}for(var _0x5dbb33='(',_0x4ed340=0x0;_0x4ed340<_0x1248a3[_0x04c9('0x5a')]['length'];_0x4ed340+=0x1){_0x4ed340>0x0&&(_0x5dbb33+='\x20'+_0x1248a3[_0x04c9('0x5b')]+'\x20');_0x5dbb33+=_0x1248a3[_0x04c9('0x5a')][_0x4ed340][_0x04c9('0x5c')]?_0x40b929(_0x1248a3[_0x04c9('0x5a')][_0x4ed340][_0x04c9('0x5c')]):_0x1248a3['rules'][_0x4ed340][_0x04c9('0x5d')]+'\x20'+_0x1248a3[_0x04c9('0x5a')][_0x4ed340]['condition']+(_0x5eae0a(_0x1248a3[_0x04c9('0x5a')][_0x4ed340][_0x04c9('0x85')])?'\x20'+_0x1248a3['rules'][_0x4ed340]['value']:'');}return _0x5dbb33+')';};var _0x10c33e={'where':{'id':_0x3417f0['id']}},_0x379f4b,_0x3cc62b,_0x27f6a3,_0x3e1c87,_0x148d67;_0x10c33e=_['merge']({},_0x10c33e,_0x3707db);return db[_0x04c9('0x28')][_0x04c9('0x48')](_0x10c33e)[_0x04c9('0x20')](function(_0x31f4d3){if(_0x31f4d3){_0x379f4b=_0x31f4d3;return _0x31f4d3[_0x04c9('0x5e')]();}return null;})[_0x04c9('0x20')](function(_0x15f677){if(_0x15f677){if(!_0x15f677[_0x04c9('0x32')]){throw new db[(_0x04c9('0x5f'))][(_0x04c9('0x60'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3cc62b=_0x15f677;return db['AnalyticMetric'][_0x04c9('0x3d')]({'raw':!![]});}return null;})[_0x04c9('0x20')](function(_0x661022){if(_0x661022){_0x27f6a3=_[_0x04c9('0x86')](_0x661022,'id');var _0x449b80;var _0x157707=squel[_0x04c9('0x63')]();_0x157707['from'](_0x379f4b['table']);for(var _0xc27adf=0x0;_0xc27adf<_0x3cc62b[_0x04c9('0x32')];_0xc27adf+=0x1){_0x449b80=_0x3cc62b[_0xc27adf][_0x04c9('0x65')]?_0x27f6a3[_0x3cc62b[_0xc27adf][_0x04c9('0x65')]]['metric']:_0x3cc62b[_0xc27adf][_0x04c9('0x5d')];_0x449b80=_0x3cc62b[_0xc27adf][_0x04c9('0x87')]?_[_0x04c9('0x66')](_0x5c3062[_0x3cc62b[_0xc27adf][_0x04c9('0x87')]],'%s',_0x449b80):_0x449b80;_0x449b80=_0x3cc62b[_0xc27adf][_0x04c9('0x67')]?_[_0x04c9('0x66')](_0x5907ba[_0x3cc62b[_0xc27adf]['format']],'%s',_0x449b80):_0x449b80;if(_0x3cc62b[_0xc27adf][_0x04c9('0x68')]){_0x157707[_0x04c9('0x5c')](_0x449b80);}_0x3cc62b[_0xc27adf][_0x04c9('0x69')]&&_0x157707[_0x04c9('0x6a')](_0x449b80,_0x3cc62b[_0xc27adf][_0x04c9('0x69')]===_0x04c9('0x6b')?![]:!![]);_0x157707[_0x04c9('0x5d')](_0x449b80,_0x3cc62b[_0xc27adf][_0x04c9('0x6c')]||_0x449b80);}if(_0x379f4b[_0x04c9('0x6d')]){_0x379f4b[_0x04c9('0x6d')]=JSON[_0x04c9('0x6e')](_0x379f4b[_0x04c9('0x6d')]);for(var _0x166ca8=0x0;_0x166ca8<_0x379f4b['joins']['length'];_0x166ca8+=0x1){if(_0x379f4b[_0x04c9('0x6d')][_0x166ca8][_0x04c9('0x2a')]&&_['includes'](_0x3840b3,_0x379f4b['joins'][_0x166ca8]['type'])&&_0x379f4b['joins'][_0x166ca8][_0x04c9('0x6f')]&&_0x379f4b['joins'][_0x166ca8][_0x04c9('0x70')]&&_0x379f4b[_0x04c9('0x6d')][_0x166ca8][_0x04c9('0x72')]){_0x157707[_0x379f4b[_0x04c9('0x6d')][_0x166ca8][_0x04c9('0x2a')]](_0x379f4b[_0x04c9('0x6d')][_0x166ca8][_0x04c9('0x70')],null,util[_0x04c9('0x67')](_0x04c9('0x71'),_0x379f4b[_0x04c9('0x64')],_0x379f4b['joins'][_0x166ca8]['parentKey'],_0x379f4b[_0x04c9('0x6d')][_0x166ca8]['foreignTable'],_0x379f4b[_0x04c9('0x6d')][_0x166ca8]['foreignKey']));}}}if(_0x379f4b[_0x04c9('0x73')]){_0x379f4b[_0x04c9('0x73')]=JSON[_0x04c9('0x6e')](_0x379f4b[_0x04c9('0x73')]);_0x157707['where'](_0x40b929(_0x379f4b[_0x04c9('0x73')][_0x04c9('0x5c')]));}_0x148d67=_0x157707[_0x04c9('0x74')]();_0x157707[_0x04c9('0x1c')](_0x462720);_0x157707[_0x04c9('0x1b')](0x0);logger[_0x04c9('0x88')](_0x04c9('0x75'),_0x157707[_0x04c9('0x76')]());return db[_0x04c9('0x77')][_0x04c9('0x2c')](_0x157707[_0x04c9('0x76')](),{'type':db[_0x04c9('0x77')][_0x04c9('0x89')][_0x04c9('0x78')]});}})[_0x04c9('0x20')](function(_0x387a51){if(!_0x387a51[_0x04c9('0x32')]){throw new db[(_0x04c9('0x5f'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x3be4c7[_0x04c9('0x8a')]==='web'){return null;}var _0x3218b8=_[_0x04c9('0x38')](_0x3be4c7,{'name':_0x3be4c7['fullPath']||_0x3be4c7[_0x04c9('0x26')]||_0x379f4b['name'],'basename':_0x233a9a,'savename':util[_0x04c9('0x67')]('%s-%s.%s',_0x3be4c7['name']||_0x379f4b[_0x04c9('0x26')],require(_0x04c9('0x8b'))[_0x04c9('0x8c')](0x4),_0x3be4c7['output']||_0x04c9('0x8d')),'reportId':_0x379f4b['id'],'reportType':_0x04c9('0x8e')});return db[_0x04c9('0x8f')][_0x04c9('0x43')](_0x3218b8,{'raw':!![]});})[_0x04c9('0x20')](function(_0x5cd73e){if(_0x379f4b[_0x04c9('0x64')]===_0x04c9('0x90')){_0x148d67[_0x04c9('0x37')](_0x379f4b[_0x04c9('0x64')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3be4c7['startDate'],_0x3be4c7[_0x04c9('0x91')]);}else{_0x148d67[_0x04c9('0x37')](_0x379f4b[_0x04c9('0x64')]+_0x04c9('0x92'),_0x3be4c7['startDate'],_0x3be4c7[_0x04c9('0x91')]);}if(_0x5cd73e){logger[_0x04c9('0x93')]('Run\x20Query:',_0x148d67[_0x04c9('0x76')]());require('child_process')[_0x04c9('0x94')](path['join'](__dirname,_0x04c9('0x95'),_0x5cd73e['output']),[_0x5cd73e['id'],_0x148d67[_0x04c9('0x76')](),path['join'](__dirname,_0x04c9('0x96'),_0x5cd73e[_0x04c9('0x97')]),_0x233a9a]);return _0x5cd73e;}else{var _0x3f2d8d=squel[_0x04c9('0x63')]();_0x3f2d8d[_0x04c9('0x98')]('('+_0x148d67[_0x04c9('0x76')]()+')',_0x04c9('0x99'));_0x3f2d8d[_0x04c9('0x5d')]('COUNT(*)',_0x04c9('0x3a'));_0x148d67[_0x04c9('0x1c')](_0x3be4c7[_0x04c9('0x1c')]||_0x462720);_0x148d67[_0x04c9('0x1b')](_0x3be4c7[_0x04c9('0x1b')]||0x0);return dbH[_0x04c9('0x77')][_0x04c9('0x2c')](_0x3f2d8d[_0x04c9('0x76')](),{'type':dbH[_0x04c9('0x77')][_0x04c9('0x89')]['SELECT']})[_0x04c9('0x20')](function(_0x43e40b){if(!_0x43e40b[_0x04c9('0x32')]){_0x3e1c87=0x0;}else{_0x3e1c87=_0x43e40b[0x0][_0x04c9('0x3a')]||0x0;}return dbH[_0x04c9('0x77')][_0x04c9('0x2c')](_0x148d67['toString'](),{'type':dbH[_0x04c9('0x77')]['QueryTypes'][_0x04c9('0x78')]});})[_0x04c9('0x20')](function(_0xbc5df5){return{'rows':_0xbc5df5||[],'count':_0x3e1c87};});}});}exports[_0x04c9('0x9a')]=function(_0x27e606,_0x53b98a){return runReport(_0x27e606[_0x04c9('0x40')],_0x27e606[_0x04c9('0x2c')],_0x27e606[_0x04c9('0x41')])[_0x04c9('0x20')](respondWithResult(_0x53b98a,null))[_0x04c9('0x42')](handleError(_0x53b98a,null));};exports[_0x04c9('0x9b')]=runReport;exports[_0x04c9('0x2c')]=function(_0xc191a1,_0x2df95f){var _0x5de507=0xa;var _0x4db27c=[_0x04c9('0x4f'),_0x04c9('0x79'),_0x04c9('0x50'),_0x04c9('0x51')];var _0x33cb57={'SUM':_0x04c9('0x7a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x04c9('0x7c'),'MAX':_0x04c9('0x7d'),'MIN':_0x04c9('0x52'),'AVG':_0x04c9('0x53'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x04c9('0x55')};var _0xdf422c={'SEC_TO_TIME':_0x04c9('0x56'),'DATE':_0x04c9('0x7f'),'HOUR':_0x04c9('0x80'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x04c9('0x81')};var _0x4ae5b0=function(_0x2f5864){return!_[_0x04c9('0x58')]([_0x04c9('0x82'),_0x04c9('0x83'),_0x04c9('0x84'),_0x04c9('0x59')],_0x2f5864);};var _0x595822=function(_0x1d79fb){if(!_0x1d79fb||!_0x1d79fb[_0x04c9('0x5a')]['length']){return'';}for(var _0x5b7173='(',_0x2a592d=0x0;_0x2a592d<_0x1d79fb[_0x04c9('0x5a')][_0x04c9('0x32')];_0x2a592d+=0x1){_0x2a592d>0x0&&(_0x5b7173+='\x20'+_0x1d79fb[_0x04c9('0x5b')]+'\x20');_0x5b7173+=_0x1d79fb[_0x04c9('0x5a')][_0x2a592d]['group']?_0x595822(_0x1d79fb[_0x04c9('0x5a')][_0x2a592d][_0x04c9('0x5c')]):_0x1d79fb['rules'][_0x2a592d][_0x04c9('0x5d')]+'\x20'+_0x1d79fb[_0x04c9('0x5a')][_0x2a592d]['condition']+(_0x4ae5b0(_0x1d79fb[_0x04c9('0x5a')][_0x2a592d]['condition'])?'\x20'+_0x1d79fb[_0x04c9('0x5a')][_0x2a592d][_0x04c9('0x9c')]:'');}return _0x5b7173+')';};var _0x21a2f7={'where':{'id':_0xc191a1[_0x04c9('0x40')]['id']}},_0x199b0b,_0x4e88af,_0x356635,_0x467fa3,_0x37fed3;_0x21a2f7=_[_0x04c9('0x38')]({},_0x21a2f7,_0xc191a1[_0x04c9('0x41')]);return db[_0x04c9('0x28')][_0x04c9('0x48')](_0x21a2f7)[_0x04c9('0x20')](function(_0x19eddf){if(_0x19eddf){_0x199b0b=_0x19eddf;return _0x19eddf[_0x04c9('0x5e')]();}return null;})[_0x04c9('0x20')](function(_0x2f0c86){if(_0x2f0c86){if(!_0x2f0c86[_0x04c9('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x04c9('0x61'),0x193);}_0x4e88af=_0x2f0c86;return db[_0x04c9('0x62')][_0x04c9('0x3d')]({'raw':!![]});}return null;})[_0x04c9('0x20')](function(_0x4e1b6f){if(_0x4e1b6f){_0x356635=_['keyBy'](_0x4e1b6f,'id');var _0x303def;var _0x3d38e4=squel[_0x04c9('0x63')]();_0x3d38e4['from'](_0x199b0b[_0x04c9('0x64')]);for(var _0xbd5cd3=0x0;_0xbd5cd3<_0x4e88af[_0x04c9('0x32')];_0xbd5cd3+=0x1){_0x303def=_0x4e88af[_0xbd5cd3][_0x04c9('0x65')]?_0x356635[_0x4e88af[_0xbd5cd3][_0x04c9('0x65')]]['metric']:_0x4e88af[_0xbd5cd3][_0x04c9('0x5d')];_0x303def=_0x4e88af[_0xbd5cd3][_0x04c9('0x87')]?_[_0x04c9('0x66')](_0x33cb57[_0x4e88af[_0xbd5cd3][_0x04c9('0x87')]],'%s',_0x303def):_0x303def;_0x303def=_0x4e88af[_0xbd5cd3][_0x04c9('0x67')]?_[_0x04c9('0x66')](_0xdf422c[_0x4e88af[_0xbd5cd3][_0x04c9('0x67')]],'%s',_0x303def):_0x303def;if(_0x4e88af[_0xbd5cd3][_0x04c9('0x68')]){_0x3d38e4['group'](_0x303def);}_0x4e88af[_0xbd5cd3][_0x04c9('0x69')]&&_0x3d38e4[_0x04c9('0x6a')](_0x303def,_0x4e88af[_0xbd5cd3]['orderBy']==='DESC'?![]:!![]);_0x3d38e4['field'](_0x303def,_0x4e88af[_0xbd5cd3][_0x04c9('0x6c')]||_0x303def);}if(_0x199b0b[_0x04c9('0x6d')]){_0x199b0b['joins']=JSON[_0x04c9('0x6e')](_0x199b0b[_0x04c9('0x6d')]);for(var _0x3910c1=0x0;_0x3910c1<_0x199b0b[_0x04c9('0x6d')][_0x04c9('0x32')];_0x3910c1+=0x1){if(_0x199b0b[_0x04c9('0x6d')][_0x3910c1][_0x04c9('0x2a')]&&_[_0x04c9('0x58')](_0x4db27c,_0x199b0b['joins'][_0x3910c1][_0x04c9('0x2a')])&&_0x199b0b[_0x04c9('0x6d')][_0x3910c1][_0x04c9('0x6f')]&&_0x199b0b[_0x04c9('0x6d')][_0x3910c1][_0x04c9('0x70')]&&_0x199b0b['joins'][_0x3910c1][_0x04c9('0x72')]){_0x3d38e4[_0x199b0b['joins'][_0x3910c1][_0x04c9('0x2a')]](_0x199b0b[_0x04c9('0x6d')][_0x3910c1][_0x04c9('0x70')],null,util[_0x04c9('0x67')]('%s.%s\x20=\x20%s.%s',_0x199b0b[_0x04c9('0x64')],_0x199b0b[_0x04c9('0x6d')][_0x3910c1]['parentKey'],_0x199b0b[_0x04c9('0x6d')][_0x3910c1]['foreignTable'],_0x199b0b[_0x04c9('0x6d')][_0x3910c1]['foreignKey']));}}}if(_0x199b0b[_0x04c9('0x73')]){_0x199b0b[_0x04c9('0x73')]=JSON['parse'](_0x199b0b[_0x04c9('0x73')]);_0x3d38e4['where'](_0x595822(_0x199b0b[_0x04c9('0x73')][_0x04c9('0x5c')]));}_0x37fed3=_0x3d38e4['clone']();_0x3d38e4[_0x04c9('0x1c')](_0x5de507);_0x3d38e4['offset'](0x0);logger['debug'](_0x04c9('0x75'),_0x3d38e4[_0x04c9('0x76')]());return db[_0x04c9('0x77')][_0x04c9('0x2c')](_0x3d38e4[_0x04c9('0x76')](),{'type':db[_0x04c9('0x77')][_0x04c9('0x89')]['SELECT']});}})[_0x04c9('0x20')](function(){return{'sql':_0x37fed3[_0x04c9('0x76')]()};})['then'](respondWithResult(_0x2df95f,null))[_0x04c9('0x42')](handleError(_0x2df95f,null));};
\ No newline at end of file
+var _0x8adb=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','includes','IS\x20NULL','rules','length','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','MIN(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','keyBy','select','alias','%s.%s\x20=\x20%s.%s','clone','ValidationErrorItem','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','countTable','run','runReport','HOUR(%s)','ROUND(%s)','html-pdf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','destroy','then','CustomReports','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x470d48,_0x29d996){var _0xbaee4c=function(_0x175dd1){while(--_0x175dd1){_0x470d48['push'](_0x470d48['shift']());}};_0xbaee4c(++_0x29d996);}(_0x8adb,0x1a8));var _0xb8ad=function(_0x5b38cc,_0x3a8e06){_0x5b38cc=_0x5b38cc-0x0;var _0x24513d=_0x8adb[_0x5b38cc];return _0x24513d;};'use strict';var pdf=require(_0xb8ad('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb8ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb8ad('0x2'));var BPromise=require(_0xb8ad('0x3'));var Mustache=require('mustache');var util=require(_0xb8ad('0x4'));var path=require(_0xb8ad('0x5'));var sox=require(_0xb8ad('0x6'));var csv=require(_0xb8ad('0x7'));var ejs=require(_0xb8ad('0x8'));var fs=require('fs');var _=require(_0xb8ad('0x9'));var squel=require(_0xb8ad('0xa'));var crypto=require(_0xb8ad('0xb'));var jsforce=require(_0xb8ad('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb8ad('0x7'));var querystring=require(_0xb8ad('0xd'));var Papa=require(_0xb8ad('0xe'));var Redis=require(_0xb8ad('0xf'));var authService=require(_0xb8ad('0x10'));var qs=require(_0xb8ad('0x11'));var as=require(_0xb8ad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8ad('0x13'))(_0xb8ad('0x14'));var utils=require(_0xb8ad('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb8ad('0x16'));var db=require(_0xb8ad('0x17'))['db'];var dbH=require(_0xb8ad('0x17'))[_0xb8ad('0x18')];function respondWithStatusCode(_0xabeacf,_0x53e6a4){_0x53e6a4=_0x53e6a4||0xcc;return function(_0x53074b){if(_0x53074b){return _0xabeacf[_0xb8ad('0x19')](_0x53e6a4);}return _0xabeacf['status'](_0x53e6a4)[_0xb8ad('0x1a')]();};}function respondWithResult(_0x9281b3,_0x4b8c71){_0x4b8c71=_0x4b8c71||0xc8;return function(_0x2bcb43){if(_0x2bcb43){return _0x9281b3[_0xb8ad('0x1b')](_0x4b8c71)[_0xb8ad('0x1c')](_0x2bcb43);}};}function respondWithFilteredResult(_0x51c2f0,_0x104cd0){return function(_0x56150c){if(_0x56150c){var _0x4a0215=_0x56150c[_0xb8ad('0x1d')],_0x5cd42b=_0x104cd0['offset'],_0x1a1ad5=_0x104cd0[_0xb8ad('0x1e')]+_0x104cd0[_0xb8ad('0x1f')],_0x52ceca;if(_0x1a1ad5>=_0x4a0215){_0x1a1ad5=_0x4a0215;_0x52ceca=0xc8;}else{_0x52ceca=0xce;}_0x51c2f0[_0xb8ad('0x1b')](_0x52ceca);return _0x51c2f0['set'](_0xb8ad('0x20'),_0x5cd42b+'-'+_0x1a1ad5+'/'+_0x4a0215)[_0xb8ad('0x1c')](_0x56150c);}return null;};}function patchUpdates(_0xdab278){return function(_0x3e195b){try{jsonpatch[_0xb8ad('0x21')](_0x3e195b,_0xdab278,!![]);}catch(_0x125774){return BPromise['reject'](_0x125774);}return _0x3e195b['save']();};}function saveUpdates(_0x4f0063,_0x3fcd83){return function(_0x369beb){if(_0x369beb){return _0x369beb['update'](_0x4f0063)['then'](function(_0x423432){return _0x423432;});}return null;};}function removeEntity(_0x3fd23a,_0x1a7d2d){return function(_0x5da5d4){if(_0x5da5d4){return _0x5da5d4[_0xb8ad('0x22')]()[_0xb8ad('0x23')](function(){var _0x51fb81=_0x5da5d4['get']({'plain':!![]});var _0x591943=_0xb8ad('0x24');return db['UserProfileResource'][_0xb8ad('0x22')]({'where':{'type':_0x591943,'resourceId':_0x51fb81['id']}})[_0xb8ad('0x23')](function(){return _0x5da5d4;});})[_0xb8ad('0x23')](function(){_0x3fd23a[_0xb8ad('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac90,_0xe019f4){return function(_0x397ead){if(!_0x397ead){_0x16ac90[_0xb8ad('0x19')](0x194);}return _0x397ead;};}function handleError(_0x1214c8,_0x1f4aeb){_0x1f4aeb=_0x1f4aeb||0x1f4;return function(_0x231f04){logger['error'](_0x231f04[_0xb8ad('0x25')]);if(_0x231f04[_0xb8ad('0x26')]){delete _0x231f04[_0xb8ad('0x26')];}_0x1214c8[_0xb8ad('0x1b')](_0x1f4aeb)['send'](_0x231f04);};}exports[_0xb8ad('0x27')]=function(_0x39153c,_0x381953){var _0x427bb6={},_0x71153b={},_0x13544d={'count':0x0,'rows':[]};var _0x210788=_[_0xb8ad('0x28')](db[_0xb8ad('0x29')][_0xb8ad('0x2a')],function(_0x199194){return{'name':_0x199194[_0xb8ad('0x2b')],'type':_0x199194[_0xb8ad('0x2c')]['key']};});_0x71153b['model']=_['map'](_0x210788,_0xb8ad('0x26'));_0x71153b[_0xb8ad('0x2d')]=_[_0xb8ad('0x2e')](_0x39153c[_0xb8ad('0x2d')]);_0x71153b[_0xb8ad('0x2f')]=_[_0xb8ad('0x30')](_0x71153b[_0xb8ad('0x31')],_0x71153b['query']);_0x427bb6[_0xb8ad('0x32')]=_['intersection'](_0x71153b[_0xb8ad('0x31')],qs[_0xb8ad('0x33')](_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x33')]));_0x427bb6[_0xb8ad('0x32')]=_0x427bb6['attributes']['length']?_0x427bb6[_0xb8ad('0x32')]:_0x71153b[_0xb8ad('0x31')];if(!_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x34')](_0xb8ad('0x35'))){_0x427bb6[_0xb8ad('0x1f')]=qs[_0xb8ad('0x1f')](_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x1f')]);_0x427bb6[_0xb8ad('0x1e')]=qs[_0xb8ad('0x1e')](_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x1e')]);}_0x427bb6[_0xb8ad('0x36')]=qs['sort'](_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x37')]);_0x427bb6[_0xb8ad('0x38')]=qs[_0xb8ad('0x2f')](_[_0xb8ad('0x39')](_0x39153c['query'],_0x71153b[_0xb8ad('0x2f')]),_0x210788);if(_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x3a')]){_0x427bb6[_0xb8ad('0x38')]=_[_0xb8ad('0x3b')](_0x427bb6[_0xb8ad('0x38')],{'$or':_['map'](_0x210788,function(_0x5da2c7){if(_0x5da2c7[_0xb8ad('0x2c')]!==_0xb8ad('0x3c')){var _0x396769={};_0x396769[_0x5da2c7[_0xb8ad('0x26')]]={'$like':'%'+_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x3a')]+'%'};return _0x396769;}})});}_0x427bb6=_[_0xb8ad('0x3b')]({},_0x427bb6,_0x39153c[_0xb8ad('0x3d')]);var _0x2cbdaa={'where':_0x427bb6[_0xb8ad('0x38')]};return db[_0xb8ad('0x29')][_0xb8ad('0x1d')](_0x2cbdaa)[_0xb8ad('0x23')](function(_0x5eb793){_0x13544d[_0xb8ad('0x1d')]=_0x5eb793;if(_0x39153c[_0xb8ad('0x2d')][_0xb8ad('0x3e')]){_0x427bb6[_0xb8ad('0x3f')]=[{'all':!![]}];}return db[_0xb8ad('0x29')][_0xb8ad('0x40')](_0x427bb6);})['then'](function(_0x1040ed){_0x13544d[_0xb8ad('0x41')]=_0x1040ed;return _0x13544d;})[_0xb8ad('0x23')](respondWithFilteredResult(_0x381953,_0x427bb6))['catch'](handleError(_0x381953,null));};exports[_0xb8ad('0x42')]=function(_0x47cb80,_0xe348d6){var _0x3f17de={'raw':![],'where':{'id':_0x47cb80[_0xb8ad('0x43')]['id']}},_0x51eeca={};_0x51eeca[_0xb8ad('0x31')]=_['keys'](db['AnalyticCustomReport'][_0xb8ad('0x2a')]);_0x51eeca[_0xb8ad('0x2d')]=_[_0xb8ad('0x2e')](_0x47cb80[_0xb8ad('0x2d')]);_0x51eeca[_0xb8ad('0x2f')]=_['intersection'](_0x51eeca[_0xb8ad('0x31')],_0x51eeca[_0xb8ad('0x2d')]);_0x3f17de[_0xb8ad('0x32')]=_[_0xb8ad('0x30')](_0x51eeca[_0xb8ad('0x31')],qs[_0xb8ad('0x33')](_0x47cb80[_0xb8ad('0x2d')]['fields']));_0x3f17de['attributes']=_0x3f17de['attributes']['length']?_0x3f17de[_0xb8ad('0x32')]:_0x51eeca['model'];if(_0x47cb80[_0xb8ad('0x2d')][_0xb8ad('0x3e')]){_0x3f17de[_0xb8ad('0x3f')]=[{'all':!![]}];}_0x3f17de=_['merge']({},_0x3f17de,_0x47cb80['options']);return db[_0xb8ad('0x29')][_0xb8ad('0x44')](_0x3f17de)['then'](handleEntityNotFound(_0xe348d6,null))[_0xb8ad('0x23')](respondWithResult(_0xe348d6,null))['catch'](handleError(_0xe348d6,null));};exports['create']=function(_0x369c61,_0x1184bf){return db[_0xb8ad('0x29')][_0xb8ad('0x45')](_0x369c61[_0xb8ad('0x46')],{})[_0xb8ad('0x23')](function(_0x16f75c){var _0x3f57b9=_0x369c61[_0xb8ad('0x47')][_0xb8ad('0x48')]({'plain':!![]});if(!_0x3f57b9)throw new Error(_0xb8ad('0x49'));if(_0x3f57b9[_0xb8ad('0x4a')]===_0xb8ad('0x47')){var _0x26b728=_0x16f75c['get']({'plain':!![]});var _0x208c75=_0xb8ad('0x4b');return db[_0xb8ad('0x4c')]['find']({'where':{'name':_0x208c75,'userProfileId':_0x3f57b9[_0xb8ad('0x4d')]},'raw':!![]})[_0xb8ad('0x23')](function(_0x4b0157){if(_0x4b0157&&_0x4b0157[_0xb8ad('0x4e')]===0x0){return db[_0xb8ad('0x4f')]['create']({'name':_0x26b728[_0xb8ad('0x26')],'resourceId':_0x26b728['id'],'type':_0xb8ad('0x24'),'sectionId':_0x4b0157['id']},{})[_0xb8ad('0x23')](function(){return _0x16f75c;});}else{return _0x16f75c;}})[_0xb8ad('0x50')](function(_0x126559){logger[_0xb8ad('0x51')](_0xb8ad('0x52'),_0x126559);throw _0x126559;});}return _0x16f75c;})[_0xb8ad('0x23')](respondWithResult(_0x1184bf,0xc9))[_0xb8ad('0x50')](handleError(_0x1184bf,null));};exports[_0xb8ad('0x53')]=function(_0x38aea6,_0x42f82f){if(_0x38aea6[_0xb8ad('0x46')]['id']){delete _0x38aea6[_0xb8ad('0x46')]['id'];}return db['AnalyticCustomReport'][_0xb8ad('0x44')]({'where':{'id':_0x38aea6['params']['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0x42f82f,null))[_0xb8ad('0x23')](saveUpdates(_0x38aea6['body'],null))[_0xb8ad('0x23')](respondWithResult(_0x42f82f,null))['catch'](handleError(_0x42f82f,null));};exports[_0xb8ad('0x22')]=function(_0x5e6a56,_0x4b6511){return db['AnalyticCustomReport'][_0xb8ad('0x44')]({'where':{'id':_0x5e6a56[_0xb8ad('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b6511,null))['then'](removeEntity(_0x4b6511,null))[_0xb8ad('0x50')](handleError(_0x4b6511,null));};exports[_0xb8ad('0x54')]=function(_0x5bc73b,_0x5809fa){var _0x2cae88=0xa;var _0x581ff4=['join',_0xb8ad('0x55'),_0xb8ad('0x56'),'cross_join'];var _0x568972={'SUM':_0xb8ad('0x57'),'COUNT':_0xb8ad('0x58'),'COUNT DISTINCT':_0xb8ad('0x59'),'MAX':_0xb8ad('0x5a'),'MIN':'MIN(%s)','AVG':_0xb8ad('0x5b'),'GROUP_CONCAT':_0xb8ad('0x5c'),'GROUP_CONCAT ASC':_0xb8ad('0x5d'),'GROUP_CONCAT DESC':_0xb8ad('0x5e')};var _0x58c2b9={'SEC_TO_TIME':_0xb8ad('0x5f'),'DATE':_0xb8ad('0x60'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3243c4=function(_0x314d45){return!_[_0xb8ad('0x61')]([_0xb8ad('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x314d45);};var _0x118118=function(_0x337e4a){if(!_0x337e4a||!_0x337e4a[_0xb8ad('0x63')][_0xb8ad('0x64')]){return'';}for(var _0x1529d5='(',_0x130776=0x0;_0x130776<_0x337e4a[_0xb8ad('0x63')]['length'];_0x130776+=0x1){_0x130776>0x0&&(_0x1529d5+='\x20'+_0x337e4a['operator']+'\x20');_0x1529d5+=_0x337e4a[_0xb8ad('0x63')][_0x130776][_0xb8ad('0x65')]?_0x118118(_0x337e4a['rules'][_0x130776][_0xb8ad('0x65')]):_0x337e4a[_0xb8ad('0x63')][_0x130776][_0xb8ad('0x66')]+'\x20'+_0x337e4a[_0xb8ad('0x63')][_0x130776]['condition']+(_0x3243c4(_0x337e4a['rules'][_0x130776][_0xb8ad('0x67')])?'\x20'+_0x337e4a[_0xb8ad('0x63')][_0x130776][_0xb8ad('0x68')]:'');}return _0x1529d5+')';};var _0x1502e7={'where':{'id':_0x5bc73b['params']['id']}},_0xf1b7a5,_0x673ad,_0x9df6c,_0x565f21,_0x5d5e28;_0x1502e7=_[_0xb8ad('0x3b')]({},_0x1502e7,_0x5bc73b['options']);return db[_0xb8ad('0x29')]['find'](_0x1502e7)['then'](function(_0x3374ac){if(_0x3374ac){_0xf1b7a5=_0x3374ac;return _0x3374ac[_0xb8ad('0x69')]();}return null;})[_0xb8ad('0x23')](function(_0xab08d7){if(_0xab08d7){if(!_0xab08d7[_0xb8ad('0x64')]){throw new db[(_0xb8ad('0x6a'))]['ValidationErrorItem'](_0xb8ad('0x6b'),0x193);}_0x673ad=_0xab08d7;return db[_0xb8ad('0x6c')][_0xb8ad('0x40')]({'raw':!![]});}return null;})[_0xb8ad('0x23')](function(_0x55a274){if(_0x55a274){_0x9df6c=_['keyBy'](_0x55a274,'id');var _0x16f558;var _0x4d51d6=squel['select']();_0x4d51d6[_0xb8ad('0x6d')](_0xf1b7a5[_0xb8ad('0x6e')]);for(var _0x35bc8d=0x0;_0x35bc8d<_0x673ad[_0xb8ad('0x64')];_0x35bc8d+=0x1){_0x16f558=_0x673ad[_0x35bc8d][_0xb8ad('0x6f')]?_0x9df6c[_0x673ad[_0x35bc8d][_0xb8ad('0x6f')]][_0xb8ad('0x70')]:_0x673ad[_0x35bc8d][_0xb8ad('0x66')];_0x16f558=_0x673ad[_0x35bc8d][_0xb8ad('0x71')]?_[_0xb8ad('0x72')](_0x568972[_0x673ad[_0x35bc8d][_0xb8ad('0x71')]],'%s',_0x16f558):_0x16f558;_0x16f558=_0x673ad[_0x35bc8d]['format']?_[_0xb8ad('0x72')](_0x58c2b9[_0x673ad[_0x35bc8d][_0xb8ad('0x73')]],'%s',_0x16f558):_0x16f558;if(_0x673ad[_0x35bc8d][_0xb8ad('0x74')]){_0x4d51d6[_0xb8ad('0x65')](_0x16f558);}_0x673ad[_0x35bc8d][_0xb8ad('0x75')]&&_0x4d51d6['order'](_0x16f558,_0x673ad[_0x35bc8d][_0xb8ad('0x75')]===_0xb8ad('0x76')?![]:!![]);_0x4d51d6[_0xb8ad('0x66')](_0x16f558,_0x673ad[_0x35bc8d]['alias']||_0x16f558);}if(_0xf1b7a5[_0xb8ad('0x77')]){_0xf1b7a5[_0xb8ad('0x77')]=JSON[_0xb8ad('0x78')](_0xf1b7a5[_0xb8ad('0x77')]);for(var _0x34414f=0x0;_0x34414f<_0xf1b7a5['joins'][_0xb8ad('0x64')];_0x34414f+=0x1){if(_0xf1b7a5[_0xb8ad('0x77')][_0x34414f][_0xb8ad('0x2c')]&&_[_0xb8ad('0x61')](_0x581ff4,_0xf1b7a5[_0xb8ad('0x77')][_0x34414f][_0xb8ad('0x2c')])&&_0xf1b7a5['joins'][_0x34414f][_0xb8ad('0x79')]&&_0xf1b7a5['joins'][_0x34414f][_0xb8ad('0x7a')]&&_0xf1b7a5['joins'][_0x34414f]['foreignKey']){_0x4d51d6[_0xf1b7a5[_0xb8ad('0x77')][_0x34414f][_0xb8ad('0x2c')]](_0xf1b7a5['joins'][_0x34414f]['foreignTable'],null,util[_0xb8ad('0x73')]('%s.%s\x20=\x20%s.%s',_0xf1b7a5[_0xb8ad('0x6e')],_0xf1b7a5[_0xb8ad('0x77')][_0x34414f][_0xb8ad('0x79')],_0xf1b7a5['joins'][_0x34414f]['foreignTable'],_0xf1b7a5[_0xb8ad('0x77')][_0x34414f][_0xb8ad('0x7b')]));}}}if(_0xf1b7a5[_0xb8ad('0x7c')]){_0xf1b7a5[_0xb8ad('0x7c')]=JSON[_0xb8ad('0x78')](_0xf1b7a5[_0xb8ad('0x7c')]);_0x4d51d6[_0xb8ad('0x38')](_0x118118(_0xf1b7a5[_0xb8ad('0x7c')][_0xb8ad('0x65')]));}_0x5d5e28=_0x4d51d6['clone']();_0x4d51d6['limit'](_0x2cae88);_0x4d51d6[_0xb8ad('0x1e')](0x0);logger[_0xb8ad('0x7d')](_0xb8ad('0x7e'),_0x4d51d6['toString']());return db[_0xb8ad('0x7f')]['query'](_0x4d51d6[_0xb8ad('0x80')](),{'type':db['sequelize'][_0xb8ad('0x81')][_0xb8ad('0x82')]});}})[_0xb8ad('0x23')](respondWithResult(_0x5809fa,null))[_0xb8ad('0x50')](handleError(_0x5809fa,null));};function runReport(_0x466951,_0x4cb910,_0x2f25dd){var _0xd30df2=_0x4cb910[_0xb8ad('0x26')];var _0x58514c=0xa;var _0x1b8a02=[_0xb8ad('0x83'),_0xb8ad('0x55'),'right_join','cross_join'];var _0x34c7d0={'SUM':_0xb8ad('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb8ad('0x59'),'MAX':_0xb8ad('0x5a'),'MIN':_0xb8ad('0x84'),'AVG':_0xb8ad('0x5b'),'GROUP_CONCAT':_0xb8ad('0x5c'),'GROUP_CONCAT ASC':_0xb8ad('0x5d'),'GROUP_CONCAT DESC':_0xb8ad('0x5e')};var _0x386f8a={'SEC_TO_TIME':_0xb8ad('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb8ad('0x85')};var _0x58d1b6=function(_0x6916ec){return!_[_0xb8ad('0x61')]([_0xb8ad('0x62'),_0xb8ad('0x86'),_0xb8ad('0x87'),_0xb8ad('0x88')],_0x6916ec);};var _0x8e01cd=function(_0x3cec65){if(!_0x3cec65||!_0x3cec65[_0xb8ad('0x63')]['length']){return'';}for(var _0xc440c8='(',_0x3e9030=0x0;_0x3e9030<_0x3cec65[_0xb8ad('0x63')][_0xb8ad('0x64')];_0x3e9030+=0x1){_0x3e9030>0x0&&(_0xc440c8+='\x20'+_0x3cec65[_0xb8ad('0x89')]+'\x20');_0xc440c8+=_0x3cec65[_0xb8ad('0x63')][_0x3e9030]['group']?_0x8e01cd(_0x3cec65[_0xb8ad('0x63')][_0x3e9030]['group']):_0x3cec65[_0xb8ad('0x63')][_0x3e9030]['field']+'\x20'+_0x3cec65[_0xb8ad('0x63')][_0x3e9030][_0xb8ad('0x67')]+(_0x58d1b6(_0x3cec65['rules'][_0x3e9030]['condition'])?'\x20'+_0x3cec65[_0xb8ad('0x63')][_0x3e9030][_0xb8ad('0x68')]:'');}return _0xc440c8+')';};var _0x4dbfad={'where':{'id':_0x466951['id']}},_0x283e3b,_0x4f35a8,_0x5337ae,_0xc5934f,_0x5a5f81;_0x4dbfad=_[_0xb8ad('0x3b')]({},_0x4dbfad,_0x2f25dd);return db[_0xb8ad('0x29')]['find'](_0x4dbfad)[_0xb8ad('0x23')](function(_0x43684c){if(_0x43684c){_0x283e3b=_0x43684c;return _0x43684c[_0xb8ad('0x69')]();}return null;})[_0xb8ad('0x23')](function(_0x32a095){if(_0x32a095){if(!_0x32a095[_0xb8ad('0x64')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4f35a8=_0x32a095;return db['AnalyticMetric'][_0xb8ad('0x40')]({'raw':!![]});}return null;})[_0xb8ad('0x23')](function(_0x23c487){if(_0x23c487){_0x5337ae=_[_0xb8ad('0x8a')](_0x23c487,'id');var _0x2ff5b7;var _0x13814b=squel[_0xb8ad('0x8b')]();_0x13814b[_0xb8ad('0x6d')](_0x283e3b['table']);for(var _0x3de20b=0x0;_0x3de20b<_0x4f35a8['length'];_0x3de20b+=0x1){_0x2ff5b7=_0x4f35a8[_0x3de20b]['MetricId']?_0x5337ae[_0x4f35a8[_0x3de20b][_0xb8ad('0x6f')]][_0xb8ad('0x70')]:_0x4f35a8[_0x3de20b][_0xb8ad('0x66')];_0x2ff5b7=_0x4f35a8[_0x3de20b]['function']?_[_0xb8ad('0x72')](_0x34c7d0[_0x4f35a8[_0x3de20b][_0xb8ad('0x71')]],'%s',_0x2ff5b7):_0x2ff5b7;_0x2ff5b7=_0x4f35a8[_0x3de20b][_0xb8ad('0x73')]?_[_0xb8ad('0x72')](_0x386f8a[_0x4f35a8[_0x3de20b][_0xb8ad('0x73')]],'%s',_0x2ff5b7):_0x2ff5b7;if(_0x4f35a8[_0x3de20b]['groupBy']){_0x13814b['group'](_0x2ff5b7);}_0x4f35a8[_0x3de20b][_0xb8ad('0x75')]&&_0x13814b[_0xb8ad('0x36')](_0x2ff5b7,_0x4f35a8[_0x3de20b][_0xb8ad('0x75')]===_0xb8ad('0x76')?![]:!![]);_0x13814b['field'](_0x2ff5b7,_0x4f35a8[_0x3de20b][_0xb8ad('0x8c')]||_0x2ff5b7);}if(_0x283e3b[_0xb8ad('0x77')]){_0x283e3b['joins']=JSON[_0xb8ad('0x78')](_0x283e3b[_0xb8ad('0x77')]);for(var _0x1101b8=0x0;_0x1101b8<_0x283e3b[_0xb8ad('0x77')][_0xb8ad('0x64')];_0x1101b8+=0x1){if(_0x283e3b['joins'][_0x1101b8][_0xb8ad('0x2c')]&&_[_0xb8ad('0x61')](_0x1b8a02,_0x283e3b[_0xb8ad('0x77')][_0x1101b8][_0xb8ad('0x2c')])&&_0x283e3b[_0xb8ad('0x77')][_0x1101b8][_0xb8ad('0x79')]&&_0x283e3b[_0xb8ad('0x77')][_0x1101b8]['foreignTable']&&_0x283e3b[_0xb8ad('0x77')][_0x1101b8]['foreignKey']){_0x13814b[_0x283e3b[_0xb8ad('0x77')][_0x1101b8]['type']](_0x283e3b[_0xb8ad('0x77')][_0x1101b8][_0xb8ad('0x7a')],null,util[_0xb8ad('0x73')](_0xb8ad('0x8d'),_0x283e3b[_0xb8ad('0x6e')],_0x283e3b['joins'][_0x1101b8][_0xb8ad('0x79')],_0x283e3b['joins'][_0x1101b8][_0xb8ad('0x7a')],_0x283e3b['joins'][_0x1101b8]['foreignKey']));}}}if(_0x283e3b[_0xb8ad('0x7c')]){_0x283e3b[_0xb8ad('0x7c')]=JSON[_0xb8ad('0x78')](_0x283e3b['conditions']);_0x13814b[_0xb8ad('0x38')](_0x8e01cd(_0x283e3b[_0xb8ad('0x7c')][_0xb8ad('0x65')]));}_0x5a5f81=_0x13814b[_0xb8ad('0x8e')]();_0x13814b[_0xb8ad('0x1f')](_0x58514c);_0x13814b[_0xb8ad('0x1e')](0x0);logger[_0xb8ad('0x7d')](_0xb8ad('0x7e'),_0x13814b[_0xb8ad('0x80')]());return db[_0xb8ad('0x7f')][_0xb8ad('0x2d')](_0x13814b['toString'](),{'type':db['sequelize'][_0xb8ad('0x81')]['SELECT']});}})[_0xb8ad('0x23')](function(_0x5b03dd){if(!_0x5b03dd[_0xb8ad('0x64')]){throw new db[(_0xb8ad('0x6a'))][(_0xb8ad('0x8f'))](_0xb8ad('0x90'),0xcc);}if(_0x4cb910[_0xb8ad('0x91')]===_0xb8ad('0x92')){return null;}var _0x357ef2=_['merge'](_0x4cb910,{'name':_0x4cb910[_0xb8ad('0x93')]||_0x4cb910[_0xb8ad('0x26')]||_0x283e3b[_0xb8ad('0x26')],'basename':_0xd30df2,'savename':util['format'](_0xb8ad('0x94'),_0x4cb910[_0xb8ad('0x26')]||_0x283e3b[_0xb8ad('0x26')],require(_0xb8ad('0x95'))[_0xb8ad('0x96')](0x4),_0x4cb910[_0xb8ad('0x91')]||'csv'),'reportId':_0x283e3b['id'],'reportType':_0xb8ad('0x97')});return db['AnalyticExtractedReport'][_0xb8ad('0x45')](_0x357ef2,{'raw':!![]});})[_0xb8ad('0x23')](function(_0x343df0){if(_0x283e3b[_0xb8ad('0x6e')]===_0xb8ad('0x98')){_0x5a5f81[_0xb8ad('0x38')](_0x283e3b[_0xb8ad('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4cb910[_0xb8ad('0x99')],_0x4cb910[_0xb8ad('0x9a')]);}else{_0x5a5f81[_0xb8ad('0x38')](_0x283e3b[_0xb8ad('0x6e')]+_0xb8ad('0x9b'),_0x4cb910[_0xb8ad('0x99')],_0x4cb910['endDate']);}if(_0x343df0){logger[_0xb8ad('0x9c')](_0xb8ad('0x9d'),_0x5a5f81['toString']());require(_0xb8ad('0x9e'))['fork'](path[_0xb8ad('0x83')](__dirname,_0xb8ad('0x9f'),_0x343df0['output']),[_0x343df0['id'],_0x5a5f81[_0xb8ad('0x80')](),path[_0xb8ad('0x83')](__dirname,'../../files/reports',_0x343df0['savename']),_0xd30df2]);return _0x343df0;}else{var _0x52a3b6=squel[_0xb8ad('0x8b')]();_0x52a3b6[_0xb8ad('0x6d')]('('+_0x5a5f81[_0xb8ad('0x80')]()+')',_0xb8ad('0xa0'));_0x52a3b6[_0xb8ad('0x66')]('COUNT(*)',_0xb8ad('0x1d'));_0x5a5f81[_0xb8ad('0x1f')](_0x4cb910[_0xb8ad('0x1f')]||_0x58514c);_0x5a5f81[_0xb8ad('0x1e')](_0x4cb910[_0xb8ad('0x1e')]||0x0);return dbH[_0xb8ad('0x7f')][_0xb8ad('0x2d')](_0x52a3b6[_0xb8ad('0x80')](),{'type':dbH['sequelize']['QueryTypes'][_0xb8ad('0x82')]})[_0xb8ad('0x23')](function(_0x35a7ea){if(!_0x35a7ea[_0xb8ad('0x64')]){_0xc5934f=0x0;}else{_0xc5934f=_0x35a7ea[0x0][_0xb8ad('0x1d')]||0x0;}return dbH['sequelize']['query'](_0x5a5f81[_0xb8ad('0x80')](),{'type':dbH[_0xb8ad('0x7f')]['QueryTypes'][_0xb8ad('0x82')]});})['then'](function(_0x4b0a1e){return{'rows':_0x4b0a1e||[],'count':_0xc5934f};});}});}exports[_0xb8ad('0xa1')]=function(_0x385662,_0x2eebb0){return runReport(_0x385662[_0xb8ad('0x43')],_0x385662[_0xb8ad('0x2d')],_0x385662[_0xb8ad('0x3d')])[_0xb8ad('0x23')](respondWithResult(_0x2eebb0,null))[_0xb8ad('0x50')](handleError(_0x2eebb0,null));};exports[_0xb8ad('0xa2')]=runReport;exports[_0xb8ad('0x2d')]=function(_0x595b8e,_0x5a7aa7){var _0x25b6bc=0xa;var _0x455677=[_0xb8ad('0x83'),'left_join',_0xb8ad('0x56'),'cross_join'];var _0x4a625a={'SUM':_0xb8ad('0x57'),'COUNT':_0xb8ad('0x58'),'COUNT DISTINCT':_0xb8ad('0x59'),'MAX':_0xb8ad('0x5a'),'MIN':_0xb8ad('0x84'),'AVG':_0xb8ad('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb8ad('0x5e')};var _0x4ffb23={'SEC_TO_TIME':_0xb8ad('0x5f'),'DATE':_0xb8ad('0x60'),'HOUR':_0xb8ad('0xa3'),'ROUND':_0xb8ad('0xa4'),'UNIX_TIMESTAMP':_0xb8ad('0x85')};var _0x3f976f=function(_0xb98a72){return!_[_0xb8ad('0x61')]([_0xb8ad('0x62'),'IS\x20NOT\x20NULL',_0xb8ad('0x87'),_0xb8ad('0x88')],_0xb98a72);};var _0x4a5ee4=function(_0x272d75){if(!_0x272d75||!_0x272d75[_0xb8ad('0x63')][_0xb8ad('0x64')]){return'';}for(var _0x27074d='(',_0x518f05=0x0;_0x518f05<_0x272d75[_0xb8ad('0x63')][_0xb8ad('0x64')];_0x518f05+=0x1){_0x518f05>0x0&&(_0x27074d+='\x20'+_0x272d75[_0xb8ad('0x89')]+'\x20');_0x27074d+=_0x272d75[_0xb8ad('0x63')][_0x518f05][_0xb8ad('0x65')]?_0x4a5ee4(_0x272d75[_0xb8ad('0x63')][_0x518f05]['group']):_0x272d75['rules'][_0x518f05][_0xb8ad('0x66')]+'\x20'+_0x272d75[_0xb8ad('0x63')][_0x518f05][_0xb8ad('0x67')]+(_0x3f976f(_0x272d75['rules'][_0x518f05][_0xb8ad('0x67')])?'\x20'+_0x272d75[_0xb8ad('0x63')][_0x518f05][_0xb8ad('0x68')]:'');}return _0x27074d+')';};var _0x27e972={'where':{'id':_0x595b8e[_0xb8ad('0x43')]['id']}},_0x3ac96c,_0x27c44d,_0x12fc03,_0x52daac,_0x5da4e2;_0x27e972=_[_0xb8ad('0x3b')]({},_0x27e972,_0x595b8e[_0xb8ad('0x3d')]);return db[_0xb8ad('0x29')]['find'](_0x27e972)[_0xb8ad('0x23')](function(_0x65250e){if(_0x65250e){_0x3ac96c=_0x65250e;return _0x65250e[_0xb8ad('0x69')]();}return null;})[_0xb8ad('0x23')](function(_0x264b4b){if(_0x264b4b){if(!_0x264b4b[_0xb8ad('0x64')]){throw new db[(_0xb8ad('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27c44d=_0x264b4b;return db[_0xb8ad('0x6c')][_0xb8ad('0x40')]({'raw':!![]});}return null;})['then'](function(_0x296cf7){if(_0x296cf7){_0x12fc03=_[_0xb8ad('0x8a')](_0x296cf7,'id');var _0x12e4a9;var _0x3087c3=squel[_0xb8ad('0x8b')]();_0x3087c3['from'](_0x3ac96c[_0xb8ad('0x6e')]);for(var _0x566aee=0x0;_0x566aee<_0x27c44d['length'];_0x566aee+=0x1){_0x12e4a9=_0x27c44d[_0x566aee]['MetricId']?_0x12fc03[_0x27c44d[_0x566aee]['MetricId']]['metric']:_0x27c44d[_0x566aee]['field'];_0x12e4a9=_0x27c44d[_0x566aee][_0xb8ad('0x71')]?_['replace'](_0x4a625a[_0x27c44d[_0x566aee]['function']],'%s',_0x12e4a9):_0x12e4a9;_0x12e4a9=_0x27c44d[_0x566aee][_0xb8ad('0x73')]?_[_0xb8ad('0x72')](_0x4ffb23[_0x27c44d[_0x566aee][_0xb8ad('0x73')]],'%s',_0x12e4a9):_0x12e4a9;if(_0x27c44d[_0x566aee][_0xb8ad('0x74')]){_0x3087c3[_0xb8ad('0x65')](_0x12e4a9);}_0x27c44d[_0x566aee][_0xb8ad('0x75')]&&_0x3087c3[_0xb8ad('0x36')](_0x12e4a9,_0x27c44d[_0x566aee][_0xb8ad('0x75')]===_0xb8ad('0x76')?![]:!![]);_0x3087c3[_0xb8ad('0x66')](_0x12e4a9,_0x27c44d[_0x566aee]['alias']||_0x12e4a9);}if(_0x3ac96c['joins']){_0x3ac96c[_0xb8ad('0x77')]=JSON[_0xb8ad('0x78')](_0x3ac96c[_0xb8ad('0x77')]);for(var _0x507eee=0x0;_0x507eee<_0x3ac96c[_0xb8ad('0x77')]['length'];_0x507eee+=0x1){if(_0x3ac96c[_0xb8ad('0x77')][_0x507eee][_0xb8ad('0x2c')]&&_[_0xb8ad('0x61')](_0x455677,_0x3ac96c['joins'][_0x507eee][_0xb8ad('0x2c')])&&_0x3ac96c['joins'][_0x507eee][_0xb8ad('0x79')]&&_0x3ac96c[_0xb8ad('0x77')][_0x507eee][_0xb8ad('0x7a')]&&_0x3ac96c['joins'][_0x507eee][_0xb8ad('0x7b')]){_0x3087c3[_0x3ac96c[_0xb8ad('0x77')][_0x507eee]['type']](_0x3ac96c[_0xb8ad('0x77')][_0x507eee]['foreignTable'],null,util[_0xb8ad('0x73')](_0xb8ad('0x8d'),_0x3ac96c[_0xb8ad('0x6e')],_0x3ac96c[_0xb8ad('0x77')][_0x507eee][_0xb8ad('0x79')],_0x3ac96c['joins'][_0x507eee][_0xb8ad('0x7a')],_0x3ac96c[_0xb8ad('0x77')][_0x507eee][_0xb8ad('0x7b')]));}}}if(_0x3ac96c[_0xb8ad('0x7c')]){_0x3ac96c[_0xb8ad('0x7c')]=JSON[_0xb8ad('0x78')](_0x3ac96c[_0xb8ad('0x7c')]);_0x3087c3[_0xb8ad('0x38')](_0x4a5ee4(_0x3ac96c['conditions'][_0xb8ad('0x65')]));}_0x5da4e2=_0x3087c3[_0xb8ad('0x8e')]();_0x3087c3[_0xb8ad('0x1f')](_0x25b6bc);_0x3087c3['offset'](0x0);logger[_0xb8ad('0x7d')]('Limited\x20Query:',_0x3087c3[_0xb8ad('0x80')]());return db[_0xb8ad('0x7f')][_0xb8ad('0x2d')](_0x3087c3['toString'](),{'type':db[_0xb8ad('0x7f')]['QueryTypes'][_0xb8ad('0x82')]});}})[_0xb8ad('0x23')](function(){return{'sql':_0x5da4e2['toString']()};})[_0xb8ad('0x23')](respondWithResult(_0x5a7aa7,null))[_0xb8ad('0x50')](handleError(_0x5a7aa7,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ba56e60..143e8ff 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 _0x3e9a=['path','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','bluebird','request-promise'];(function(_0x4b757c,_0x567c0f){var _0x427379=function(_0x423083){while(--_0x423083){_0x4b757c['push'](_0x4b757c['shift']());}};_0x427379(++_0x567c0f);}(_0x3e9a,0x1d2));var _0xa3e9=function(_0x56bd0c,_0x51c525){_0x56bd0c=_0x56bd0c-0x0;var _0x8b5f15=_0x3e9a[_0x56bd0c];return _0x8b5f15;};'use strict';var _=require(_0xa3e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa3e9('0x1'));var moment=require('moment');var BPromise=require(_0xa3e9('0x2'));var rp=require(_0xa3e9('0x3'));var fs=require('fs');var path=require(_0xa3e9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa3e9('0x5'));module[_0xa3e9('0x6')]=function(_0x4b6a4e,_0x427d74){return _0x4b6a4e[_0xa3e9('0x7')](_0xa3e9('0x8'),attributes,{'tableName':_0xa3e9('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa79d=['lodash','util','moment','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x4de948,_0x452a8c){var _0x48fc2c=function(_0x343a9d){while(--_0x343a9d){_0x4de948['push'](_0x4de948['shift']());}};_0x48fc2c(++_0x452a8c);}(_0xa79d,0x144));var _0xda79=function(_0x233b3a,_0x32b752){_0x233b3a=_0x233b3a-0x0;var _0x7dcdc6=_0xa79d[_0x233b3a];return _0x7dcdc6;};'use strict';var _=require(_0xda79('0x0'));var util=require(_0xda79('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xda79('0x2'));var BPromise=require('bluebird');var rp=require(_0xda79('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda79('0x4'));var config=require(_0xda79('0x5'));var attributes=require(_0xda79('0x6'));module['exports']=function(_0x967d2,_0x322683){return _0x967d2['define'](_0xda79('0x7'),attributes,{'tableName':_0xda79('0x8'),'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 9421a4f..d6897c1 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 _0xfbc1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x599d6b,_0x462aed){var _0x4bd9dd=function(_0x29e48d){while(--_0x29e48d){_0x599d6b['push'](_0x599d6b['shift']());}};_0x4bd9dd(++_0x462aed);}(_0xfbc1,0x11b));var _0x1fbc=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xfbc1[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x1fbc('0x0'));var util=require(_0x1fbc('0x1'));var moment=require(_0x1fbc('0x2'));var BPromise=require(_0x1fbc('0x3'));var rs=require(_0x1fbc('0x4'));var fs=require('fs');var Redis=require(_0x1fbc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fbc('0x6'));var logger=require(_0x1fbc('0x7'))(_0x1fbc('0x8'));var config=require(_0x1fbc('0x9'));var jayson=require(_0x1fbc('0xa'));var client=jayson[_0x1fbc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf97519,_0x4f9c35,_0x505904){return new BPromise(function(_0x2b5be1,_0x2dfc70){return client['request'](_0xf97519,_0x505904)[_0x1fbc('0xc')](function(_0x4f0173){logger['info'](_0x1fbc('0xd'),_0x4f9c35,_0x1fbc('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4f9c35,_0x1fbc('0xe'),JSON[_0x1fbc('0xf')](_0x4f0173));if(_0x4f0173[_0x1fbc('0x10')]){if(_0x4f0173['error'][_0x1fbc('0x11')]===0x1f4){logger[_0x1fbc('0x10')](_0x1fbc('0xd'),_0x4f9c35,_0x4f0173[_0x1fbc('0x10')][_0x1fbc('0x12')]);return _0x2dfc70(_0x4f0173[_0x1fbc('0x10')][_0x1fbc('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4f9c35,_0x4f0173['error']['message']);return _0x2b5be1(_0x4f0173[_0x1fbc('0x10')]['message']);}else{logger[_0x1fbc('0x13')](_0x1fbc('0xd'),_0x4f9c35,_0x1fbc('0xe'));_0x2b5be1(_0x4f0173[_0x1fbc('0x14')][_0x1fbc('0x12')]);}})[_0x1fbc('0x15')](function(_0x5517de){logger['error'](_0x1fbc('0xd'),_0x4f9c35,_0x5517de);_0x2dfc70(_0x5517de);});});}
\ No newline at end of file
+var _0x1a49=['ioredis','../../config/utils','rpc','../../config/environment','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring'];(function(_0x37a6f6,_0x146ef8){var _0x3eea3f=function(_0x56539c){while(--_0x56539c){_0x37a6f6['push'](_0x37a6f6['shift']());}};_0x3eea3f(++_0x146ef8);}(_0x1a49,0x1c6));var _0x91a4=function(_0x22c5eb,_0x3edb6a){_0x22c5eb=_0x22c5eb-0x0;var _0xfd07e1=_0x1a49[_0x22c5eb];return _0xfd07e1;};'use strict';var _=require(_0x91a4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x91a4('0x1'));var fs=require('fs');var Redis=require(_0x91a4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x91a4('0x3'));var logger=require('../../config/logger')(_0x91a4('0x4'));var config=require(_0x91a4('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91a4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xf91193,_0x38f575,_0x59955f){return new BPromise(function(_0x46f219,_0x3c30ae){return client[_0x91a4('0x7')](_0xf91193,_0x59955f)['then'](function(_0x443618){logger[_0x91a4('0x8')](_0x91a4('0x9'),_0x38f575,_0x91a4('0xa'));logger[_0x91a4('0xb')](_0x91a4('0xc'),_0x38f575,'request\x20sent',JSON[_0x91a4('0xd')](_0x443618));if(_0x443618['error']){if(_0x443618[_0x91a4('0xe')][_0x91a4('0xf')]===0x1f4){logger[_0x91a4('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x38f575,_0x443618[_0x91a4('0xe')][_0x91a4('0x10')]);return _0x3c30ae(_0x443618[_0x91a4('0xe')][_0x91a4('0x10')]);}logger[_0x91a4('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x38f575,_0x443618[_0x91a4('0xe')]['message']);return _0x46f219(_0x443618[_0x91a4('0xe')][_0x91a4('0x10')]);}else{logger['info'](_0x91a4('0x9'),_0x38f575,_0x91a4('0xa'));_0x46f219(_0x443618[_0x91a4('0x11')][_0x91a4('0x10')]);}})[_0x91a4('0x12')](function(_0x31b0b1){logger[_0x91a4('0xe')](_0x91a4('0x9'),_0x38f575,_0x31b0b1);_0x3c30ae(_0x31b0b1);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 01e404b..cbf70e2 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 _0x13ab=['run','/:id/query','query','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run'];(function(_0x30ef51,_0x4170ba){var _0x329d8e=function(_0x259197){while(--_0x259197){_0x30ef51['push'](_0x30ef51['shift']());}};_0x329d8e(++_0x4170ba);}(_0x13ab,0x188));var _0xb13a=function(_0x2bfdd0,_0x2304c6){_0x2bfdd0=_0x2bfdd0-0x0;var _0x596c7b=_0x13ab[_0x2bfdd0];return _0x596c7b;};'use strict';var multer=require(_0xb13a('0x0'));var util=require(_0xb13a('0x1'));var path=require(_0xb13a('0x2'));var timeout=require(_0xb13a('0x3'));var express=require(_0xb13a('0x4'));var router=express[_0xb13a('0x5')]();var auth=require(_0xb13a('0x6'));var interaction=require(_0xb13a('0x7'));var config=require(_0xb13a('0x8'));var controller=require(_0xb13a('0x9'));router[_0xb13a('0xa')]('/',auth[_0xb13a('0xb')](),controller['index']);router['get'](_0xb13a('0xc'),auth[_0xb13a('0xb')](),controller['show']);router[_0xb13a('0xa')](_0xb13a('0xd'),auth[_0xb13a('0xb')](),controller[_0xb13a('0xe')]);router[_0xb13a('0xa')](_0xb13a('0xf'),auth['isAuthenticated'](),controller[_0xb13a('0x10')]);router[_0xb13a('0xa')](_0xb13a('0x11'),auth['isAuthenticated'](),controller[_0xb13a('0x12')]);router[_0xb13a('0x13')]('/',auth[_0xb13a('0xb')](),controller['create']);router[_0xb13a('0x14')](_0xb13a('0xc'),auth[_0xb13a('0xb')](),controller[_0xb13a('0x15')]);router['delete'](_0xb13a('0xc'),auth['isAuthenticated'](),controller[_0xb13a('0x16')]);module[_0xb13a('0x17')]=router;
\ No newline at end of file
+var _0x143b=['multer','util','connect-timeout','express','Router','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x143b,0x78));var _0xb143=function(_0x33cdb4,_0x26eb1a){_0x33cdb4=_0x33cdb4-0x0;var _0x5c33e1=_0x143b[_0x33cdb4];return _0x5c33e1;};'use strict';var multer=require(_0xb143('0x0'));var util=require(_0xb143('0x1'));var path=require('path');var timeout=require(_0xb143('0x2'));var express=require(_0xb143('0x3'));var router=express[_0xb143('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb143('0x5'));var controller=require(_0xb143('0x6'));router[_0xb143('0x7')]('/',auth[_0xb143('0x8')](),controller[_0xb143('0x9')]);router[_0xb143('0x7')](_0xb143('0xa'),auth[_0xb143('0x8')](),controller[_0xb143('0xb')]);router[_0xb143('0x7')]('/:id/preview',auth['isAuthenticated'](),controller[_0xb143('0xc')]);router[_0xb143('0x7')](_0xb143('0xd'),auth['isAuthenticated'](),controller[_0xb143('0xe')]);router[_0xb143('0x7')](_0xb143('0xf'),auth[_0xb143('0x8')](),controller[_0xb143('0x10')]);router[_0xb143('0x11')]('/',auth[_0xb143('0x8')](),controller[_0xb143('0x12')]);router[_0xb143('0x13')]('/:id',auth[_0xb143('0x8')](),controller[_0xb143('0x14')]);router[_0xb143('0x15')](_0xb143('0xa'),auth['isAuthenticated'](),controller[_0xb143('0x16')]);module[_0xb143('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 883b5d1..3fdcc79 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 _0x1f69=['TEXT','sequelize','exports','STRING'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x1f69,0xe9));var _0x91f6=function(_0x18d4ee,_0x23737a){_0x18d4ee=_0x18d4ee-0x0;var _0x25d717=_0x1f69[_0x18d4ee];return _0x25d717;};'use strict';var Sequelize=require(_0x91f6('0x0'));module[_0x91f6('0x1')]={'name':{'type':Sequelize[_0x91f6('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x91f6('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x91f6('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2590=['TEXT','exports','STRING'];(function(_0x5f51e6,_0xd959b7){var _0x44127a=function(_0x4fc7b8){while(--_0x4fc7b8){_0x5f51e6['push'](_0x5f51e6['shift']());}};_0x44127a(++_0xd959b7);}(_0x2590,0x12a));var _0x0259=function(_0x28fa69,_0x3145fd){_0x28fa69=_0x28fa69-0x0;var _0x439ac2=_0x2590[_0x28fa69];return _0x439ac2;};'use strict';var Sequelize=require('sequelize');module[_0x0259('0x0')]={'name':{'type':Sequelize[_0x0259('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0259('0x1')]},'parent':{'type':Sequelize[_0x0259('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0259('0x2')]},'joins':{'type':Sequelize[_0x0259('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 708deb1..2763e57 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 _0x3731=['web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','replace','html-pdf','rimraf','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','keys','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NOT\x20NULL','operator','ValidationErrorItem','metric','No\x20available\x20data','output'];(function(_0x50b0f7,_0x507fba){var _0x189c27=function(_0x5124e0){while(--_0x5124e0){_0x50b0f7['push'](_0x50b0f7['shift']());}};_0x189c27(++_0x507fba);}(_0x3731,0xba));var _0x1373=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3731[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x1373('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1373('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1373('0x2'));var Mustache=require(_0x1373('0x3'));var util=require(_0x1373('0x4'));var path=require(_0x1373('0x5'));var sox=require(_0x1373('0x6'));var csv=require('to-csv');var ejs=require(_0x1373('0x7'));var fs=require('fs');var _=require(_0x1373('0x8'));var squel=require(_0x1373('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1373('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1373('0xb'));var authService=require(_0x1373('0xc'));var qs=require(_0x1373('0xd'));var as=require(_0x1373('0xe'));var hardwareService=require(_0x1373('0xf'));var logger=require(_0x1373('0x10'))(_0x1373('0x11'));var utils=require(_0x1373('0x12'));var config=require(_0x1373('0x13'));var licenseUtil=require(_0x1373('0x14'));var db=require(_0x1373('0x15'))['db'];var dbH=require(_0x1373('0x15'))[_0x1373('0x16')];function respondWithStatusCode(_0x41742d,_0x4a98d2){_0x4a98d2=_0x4a98d2||0xcc;return function(_0x522597){if(_0x522597){return _0x41742d[_0x1373('0x17')](_0x4a98d2);}return _0x41742d[_0x1373('0x18')](_0x4a98d2)[_0x1373('0x19')]();};}function respondWithResult(_0x55cc31,_0x4b0c93){_0x4b0c93=_0x4b0c93||0xc8;return function(_0x14ac12){if(_0x14ac12){return _0x55cc31[_0x1373('0x18')](_0x4b0c93)[_0x1373('0x1a')](_0x14ac12);}};}function respondWithFilteredResult(_0x3838dc,_0x2144fa){return function(_0x4617cd){if(_0x4617cd){var _0x488501=_0x4617cd[_0x1373('0x1b')],_0x10e19c=_0x2144fa['offset'],_0x521f5b=_0x2144fa[_0x1373('0x1c')]+_0x2144fa[_0x1373('0x1d')],_0x3c37b4;if(_0x521f5b>=_0x488501){_0x521f5b=_0x488501;_0x3c37b4=0xc8;}else{_0x3c37b4=0xce;}_0x3838dc['status'](_0x3c37b4);return _0x3838dc[_0x1373('0x1e')]('Content-Range',_0x10e19c+'-'+_0x521f5b+'/'+_0x488501)[_0x1373('0x1a')](_0x4617cd);}return null;};}function patchUpdates(_0x139ae1){return function(_0x56431c){try{jsonpatch[_0x1373('0x1f')](_0x56431c,_0x139ae1,!![]);}catch(_0x3f3a21){return BPromise[_0x1373('0x20')](_0x3f3a21);}return _0x56431c[_0x1373('0x21')]();};}function saveUpdates(_0x432018,_0xfd7c5e){return function(_0x1b646a){if(_0x1b646a){return _0x1b646a[_0x1373('0x22')](_0x432018)['then'](function(_0x43651a){return _0x43651a;});}return null;};}function removeEntity(_0x520273,_0x3e0dd1){return function(_0x399296){if(_0x399296){return _0x399296[_0x1373('0x23')]()[_0x1373('0x24')](function(){var _0x629424=_0x399296['get']({'plain':!![]});var _0x344a7c=_0x1373('0x25');return db[_0x1373('0x26')][_0x1373('0x23')]({'where':{'type':_0x344a7c,'resourceId':_0x629424['id']}})[_0x1373('0x24')](function(){return _0x399296;});})[_0x1373('0x24')](function(){_0x520273[_0x1373('0x18')](0xcc)[_0x1373('0x19')]();});}};}function handleEntityNotFound(_0x17af19,_0x33786f){return function(_0x4efe17){if(!_0x4efe17){_0x17af19[_0x1373('0x17')](0x194);}return _0x4efe17;};}function handleError(_0x3854ee,_0xdc78ae){_0xdc78ae=_0xdc78ae||0x1f4;return function(_0x5a47c7){logger[_0x1373('0x27')](_0x5a47c7[_0x1373('0x28')]);if(_0x5a47c7[_0x1373('0x29')]){delete _0x5a47c7['name'];}_0x3854ee[_0x1373('0x18')](_0xdc78ae)[_0x1373('0x2a')](_0x5a47c7);};}exports[_0x1373('0x2b')]=function(_0x5545e8,_0x4e863d){var _0x3f2572={},_0x2281f9={},_0x37a967={'count':0x0,'rows':[]};var _0x1b7e33=_[_0x1373('0x2c')](db['AnalyticDefaultReport'][_0x1373('0x2d')],function(_0xc16f52){return{'name':_0xc16f52[_0x1373('0x2e')],'type':_0xc16f52['type'][_0x1373('0x2f')]};});_0x2281f9['model']=_[_0x1373('0x2c')](_0x1b7e33,_0x1373('0x29'));_0x2281f9[_0x1373('0x30')]=_['keys'](_0x5545e8[_0x1373('0x30')]);_0x2281f9[_0x1373('0x31')]=_['intersection'](_0x2281f9['model'],_0x2281f9[_0x1373('0x30')]);_0x3f2572[_0x1373('0x32')]=_[_0x1373('0x33')](_0x2281f9[_0x1373('0x34')],qs[_0x1373('0x35')](_0x5545e8['query'][_0x1373('0x35')]));_0x3f2572[_0x1373('0x32')]=_0x3f2572['attributes'][_0x1373('0x36')]?_0x3f2572[_0x1373('0x32')]:_0x2281f9['model'];if(!_0x5545e8[_0x1373('0x30')][_0x1373('0x37')](_0x1373('0x38'))){_0x3f2572[_0x1373('0x1d')]=qs[_0x1373('0x1d')](_0x5545e8['query'][_0x1373('0x1d')]);_0x3f2572['offset']=qs[_0x1373('0x1c')](_0x5545e8['query']['offset']);}_0x3f2572[_0x1373('0x39')]=qs[_0x1373('0x3a')](_0x5545e8[_0x1373('0x30')][_0x1373('0x3a')]);_0x3f2572[_0x1373('0x3b')]=qs['filters'](_[_0x1373('0x3c')](_0x5545e8[_0x1373('0x30')],_0x2281f9['filters']),_0x1b7e33);if(_0x5545e8['query'][_0x1373('0x3d')]){_0x3f2572[_0x1373('0x3b')]=_['merge'](_0x3f2572['where'],{'$or':_[_0x1373('0x2c')](_0x1b7e33,function(_0xcbb8e5){if(_0xcbb8e5['type']!==_0x1373('0x3e')){var _0x213e8e={};_0x213e8e[_0xcbb8e5[_0x1373('0x29')]]={'$like':'%'+_0x5545e8[_0x1373('0x30')][_0x1373('0x3d')]+'%'};return _0x213e8e;}})});}_0x3f2572=_[_0x1373('0x3f')]({},_0x3f2572,_0x5545e8[_0x1373('0x40')]);var _0x29af10={'where':_0x3f2572[_0x1373('0x3b')]};return db[_0x1373('0x41')][_0x1373('0x1b')](_0x29af10)[_0x1373('0x24')](function(_0x1b27f1){_0x37a967[_0x1373('0x1b')]=_0x1b27f1;if(_0x5545e8[_0x1373('0x30')][_0x1373('0x42')]){_0x3f2572[_0x1373('0x43')]=[{'all':!![]}];}return db[_0x1373('0x41')][_0x1373('0x44')](_0x3f2572);})[_0x1373('0x24')](function(_0x261926){_0x37a967[_0x1373('0x45')]=_0x261926;return _0x37a967;})['then'](respondWithFilteredResult(_0x4e863d,_0x3f2572))[_0x1373('0x46')](handleError(_0x4e863d,null));};exports[_0x1373('0x47')]=function(_0x21590a,_0x4d9955){var _0x337766={'raw':!![],'where':{'id':_0x21590a['params']['id']}},_0x488ce1={};_0x488ce1[_0x1373('0x34')]=_['keys'](db[_0x1373('0x41')][_0x1373('0x2d')]);_0x488ce1[_0x1373('0x30')]=_[_0x1373('0x48')](_0x21590a[_0x1373('0x30')]);_0x488ce1['filters']=_[_0x1373('0x33')](_0x488ce1[_0x1373('0x34')],_0x488ce1[_0x1373('0x30')]);_0x337766[_0x1373('0x32')]=_['intersection'](_0x488ce1[_0x1373('0x34')],qs[_0x1373('0x35')](_0x21590a['query']['fields']));_0x337766[_0x1373('0x32')]=_0x337766['attributes'][_0x1373('0x36')]?_0x337766['attributes']:_0x488ce1[_0x1373('0x34')];if(_0x21590a['query'][_0x1373('0x42')]){_0x337766['include']=[{'all':!![]}];}_0x337766=_[_0x1373('0x3f')]({},_0x337766,_0x21590a[_0x1373('0x40')]);return db['AnalyticDefaultReport'][_0x1373('0x49')](_0x337766)['then'](handleEntityNotFound(_0x4d9955,null))[_0x1373('0x24')](respondWithResult(_0x4d9955,null))[_0x1373('0x46')](handleError(_0x4d9955,null));};exports[_0x1373('0x4a')]=function(_0x16253c,_0x1da31a){return db[_0x1373('0x41')]['create'](_0x16253c['body'],{})[_0x1373('0x24')](function(_0x56867f){var _0x4fbdfd=_0x16253c[_0x1373('0x4b')][_0x1373('0x4c')]({'plain':!![]});if(!_0x4fbdfd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fbdfd['role']===_0x1373('0x4b')){var _0x5d89a8=_0x56867f[_0x1373('0x4c')]({'plain':!![]});var _0x5e8ea6='Reports';return db[_0x1373('0x4d')][_0x1373('0x49')]({'where':{'name':_0x5e8ea6,'userProfileId':_0x4fbdfd[_0x1373('0x4e')]},'raw':!![]})[_0x1373('0x24')](function(_0x443a4c){if(_0x443a4c&&_0x443a4c[_0x1373('0x4f')]===0x0){return db[_0x1373('0x26')]['create']({'name':_0x5d89a8[_0x1373('0x29')],'resourceId':_0x5d89a8['id'],'type':_0x1373('0x25'),'sectionId':_0x443a4c['id']},{})[_0x1373('0x24')](function(){return _0x56867f;});}else{return _0x56867f;}})[_0x1373('0x46')](function(_0x378853){logger[_0x1373('0x27')](_0x1373('0x50'),_0x378853);throw _0x378853;});}return _0x56867f;})['then'](respondWithResult(_0x1da31a,0xc9))[_0x1373('0x46')](handleError(_0x1da31a,null));};exports[_0x1373('0x22')]=function(_0x13a65a,_0x24f2e7){if(_0x13a65a[_0x1373('0x51')]['id']){delete _0x13a65a[_0x1373('0x51')]['id'];}return db[_0x1373('0x41')][_0x1373('0x49')]({'where':{'id':_0x13a65a['params']['id']}})[_0x1373('0x24')](handleEntityNotFound(_0x24f2e7,null))[_0x1373('0x24')](saveUpdates(_0x13a65a[_0x1373('0x51')],null))[_0x1373('0x24')](respondWithResult(_0x24f2e7,null))['catch'](handleError(_0x24f2e7,null));};exports[_0x1373('0x23')]=function(_0x40b2a6,_0x3219e3){return db[_0x1373('0x41')][_0x1373('0x49')]({'where':{'id':_0x40b2a6[_0x1373('0x52')]['id']}})[_0x1373('0x24')](handleEntityNotFound(_0x3219e3,null))[_0x1373('0x24')](removeEntity(_0x3219e3,null))[_0x1373('0x46')](handleError(_0x3219e3,null));};exports['preview']=function(_0x5d2092,_0x1b4f03){var _0x4eb4b2=0xa;var _0x1ca1d3=[_0x1373('0x53'),'left_join',_0x1373('0x54'),_0x1373('0x55')];var _0x1ab6de={'SUM':_0x1373('0x56'),'COUNT':_0x1373('0x57'),'COUNT DISTINCT':_0x1373('0x58'),'MAX':_0x1373('0x59'),'MIN':_0x1373('0x5a'),'AVG':_0x1373('0x5b'),'GROUP_CONCAT':_0x1373('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1373('0x5d')};var _0x49dea1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1373('0x5e'),'HOUR':_0x1373('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1373('0x60')};var _0x31b056=function(_0x133b57){return!_[_0x1373('0x61')]([_0x1373('0x62'),'IS\x20NOT\x20NULL',_0x1373('0x63'),_0x1373('0x64')],_0x133b57);};var _0x22b6e5=function(_0x1a529a){if(!_0x1a529a||!_0x1a529a[_0x1373('0x65')]['length']){return'';}for(var _0x5eae74='(',_0x27f3c2=0x0;_0x27f3c2<_0x1a529a[_0x1373('0x65')][_0x1373('0x36')];_0x27f3c2+=0x1){_0x27f3c2>0x0&&(_0x5eae74+='\x20'+_0x1a529a['operator']+'\x20');_0x5eae74+=_0x1a529a['rules'][_0x27f3c2]['group']?_0x22b6e5(_0x1a529a[_0x1373('0x65')][_0x27f3c2][_0x1373('0x66')]):_0x1a529a['rules'][_0x27f3c2][_0x1373('0x67')]+'\x20'+_0x1a529a['rules'][_0x27f3c2][_0x1373('0x68')]+(_0x31b056(_0x1a529a['rules'][_0x27f3c2][_0x1373('0x68')])?'\x20'+_0x1a529a[_0x1373('0x65')][_0x27f3c2][_0x1373('0x69')]:'');}return _0x5eae74+')';};var _0x4d4ab6={'where':{'id':_0x5d2092[_0x1373('0x52')]['id']}},_0x6d319a,_0x50afa5,_0xa6c6aa,_0x4093cd,_0xaa2462;_0x4d4ab6=_[_0x1373('0x3f')]({},_0x4d4ab6,_0x5d2092['options']);return db[_0x1373('0x41')][_0x1373('0x49')](_0x4d4ab6)[_0x1373('0x24')](function(_0x3ed4e8){if(_0x3ed4e8){_0x6d319a=_0x3ed4e8;return _0x3ed4e8[_0x1373('0x6a')]();}return null;})[_0x1373('0x24')](function(_0x2ea77e){if(_0x2ea77e){if(!_0x2ea77e[_0x1373('0x36')]){throw new db[(_0x1373('0x6b'))]['ValidationErrorItem'](_0x1373('0x6c'),0x193);}_0x50afa5=_0x2ea77e;return db[_0x1373('0x6d')][_0x1373('0x44')]({'raw':!![]});}return null;})[_0x1373('0x24')](function(_0x49e514){if(_0x49e514){_0xa6c6aa=_[_0x1373('0x6e')](_0x49e514,'id');var _0x53f078;var _0x1cf417=squel[_0x1373('0x6f')]();_0x1cf417[_0x1373('0x70')](_0x6d319a[_0x1373('0x71')]);for(var _0x48415c=0x0;_0x48415c<_0x50afa5[_0x1373('0x36')];_0x48415c+=0x1){_0x53f078=_0x50afa5[_0x48415c]['MetricId']?_0xa6c6aa[_0x50afa5[_0x48415c][_0x1373('0x72')]]['metric']:_0x50afa5[_0x48415c][_0x1373('0x67')];_0x53f078=_0x50afa5[_0x48415c][_0x1373('0x73')]?_['replace'](_0x1ab6de[_0x50afa5[_0x48415c][_0x1373('0x73')]],'%s',_0x53f078):_0x53f078;_0x53f078=_0x50afa5[_0x48415c][_0x1373('0x74')]?_['replace'](_0x49dea1[_0x50afa5[_0x48415c][_0x1373('0x74')]],'%s',_0x53f078):_0x53f078;if(_0x50afa5[_0x48415c]['groupBy']){_0x1cf417[_0x1373('0x66')](_0x53f078);}_0x50afa5[_0x48415c][_0x1373('0x75')]&&_0x1cf417[_0x1373('0x39')](_0x53f078,_0x50afa5[_0x48415c]['orderBy']===_0x1373('0x76')?![]:!![]);_0x1cf417[_0x1373('0x67')](_0x53f078,_0x50afa5[_0x48415c][_0x1373('0x77')]||_0x53f078);}if(_0x6d319a[_0x1373('0x78')]){_0x6d319a[_0x1373('0x78')]=JSON[_0x1373('0x79')](_0x6d319a[_0x1373('0x78')]);for(var _0x41cb0b=0x0;_0x41cb0b<_0x6d319a[_0x1373('0x78')][_0x1373('0x36')];_0x41cb0b+=0x1){if(_0x6d319a[_0x1373('0x78')][_0x41cb0b][_0x1373('0x7a')]&&_[_0x1373('0x61')](_0x1ca1d3,_0x6d319a[_0x1373('0x78')][_0x41cb0b][_0x1373('0x7a')])&&_0x6d319a['joins'][_0x41cb0b][_0x1373('0x7b')]&&_0x6d319a[_0x1373('0x78')][_0x41cb0b][_0x1373('0x7c')]&&_0x6d319a['joins'][_0x41cb0b]['foreignKey']){_0x1cf417[_0x6d319a[_0x1373('0x78')][_0x41cb0b]['type']](_0x6d319a[_0x1373('0x78')][_0x41cb0b][_0x1373('0x7c')],null,util[_0x1373('0x74')](_0x1373('0x7d'),_0x6d319a[_0x1373('0x71')],_0x6d319a[_0x1373('0x78')][_0x41cb0b]['parentKey'],_0x6d319a[_0x1373('0x78')][_0x41cb0b][_0x1373('0x7c')],_0x6d319a['joins'][_0x41cb0b][_0x1373('0x7e')]));}}}if(_0x6d319a[_0x1373('0x7f')]){_0x6d319a['conditions']=JSON[_0x1373('0x79')](_0x6d319a[_0x1373('0x7f')]);_0x1cf417[_0x1373('0x3b')](_0x22b6e5(_0x6d319a['conditions'][_0x1373('0x66')]));}_0xaa2462=_0x1cf417[_0x1373('0x80')]();_0x1cf417[_0x1373('0x1d')](_0x4eb4b2);_0x1cf417[_0x1373('0x1c')](0x0);logger[_0x1373('0x81')](_0x1373('0x82'),_0x1cf417['toString']());return db[_0x1373('0x83')][_0x1373('0x30')](_0x1cf417[_0x1373('0x84')](),{'type':db['sequelize'][_0x1373('0x85')][_0x1373('0x86')]});}})['then'](respondWithResult(_0x1b4f03,null))[_0x1373('0x46')](handleError(_0x1b4f03,null));};function runReport(_0x33eb1c,_0x3787d4,_0xceec67){var _0x5a227f=_0x3787d4[_0x1373('0x29')];var _0x5079b4=0xa;var _0xb29782=['join','left_join','right_join',_0x1373('0x55')];var _0x5c129b={'SUM':'SUM(%s)','COUNT':_0x1373('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1373('0x59'),'MIN':_0x1373('0x5a'),'AVG':_0x1373('0x5b'),'GROUP_CONCAT':_0x1373('0x5c'),'GROUP_CONCAT ASC':_0x1373('0x87'),'GROUP_CONCAT DESC':_0x1373('0x5d')};var _0x8bc897={'SEC_TO_TIME':_0x1373('0x88'),'DATE':'DATE(%s)','HOUR':_0x1373('0x5f'),'ROUND':_0x1373('0x89'),'UNIX_TIMESTAMP':_0x1373('0x60')};var _0x1d6f76=function(_0x567bad){return!_[_0x1373('0x61')]([_0x1373('0x62'),_0x1373('0x8a'),_0x1373('0x63'),'IS\x20NOT\x20EMPTY'],_0x567bad);};var _0x54a374=function(_0x611986){if(!_0x611986||!_0x611986['rules'][_0x1373('0x36')]){return'';}for(var _0x5f3f34='(',_0x52bef4=0x0;_0x52bef4<_0x611986[_0x1373('0x65')]['length'];_0x52bef4+=0x1){_0x52bef4>0x0&&(_0x5f3f34+='\x20'+_0x611986[_0x1373('0x8b')]+'\x20');_0x5f3f34+=_0x611986['rules'][_0x52bef4][_0x1373('0x66')]?_0x54a374(_0x611986[_0x1373('0x65')][_0x52bef4][_0x1373('0x66')]):_0x611986[_0x1373('0x65')][_0x52bef4][_0x1373('0x67')]+'\x20'+_0x611986[_0x1373('0x65')][_0x52bef4][_0x1373('0x68')]+(_0x1d6f76(_0x611986[_0x1373('0x65')][_0x52bef4][_0x1373('0x68')])?'\x20'+_0x611986[_0x1373('0x65')][_0x52bef4][_0x1373('0x69')]:'');}return _0x5f3f34+')';};var _0x3db5a9={'where':{'id':_0x33eb1c['id']}},_0x4d7a52,_0x859496,_0x48ec0c,_0x23019a,_0x2cb6d1;_0x3db5a9=_[_0x1373('0x3f')]({},_0x3db5a9,_0xceec67);return db['AnalyticDefaultReport'][_0x1373('0x49')](_0x3db5a9)[_0x1373('0x24')](function(_0x20cea7){if(_0x20cea7){_0x4d7a52=_0x20cea7;return _0x20cea7['getFields']();}return null;})[_0x1373('0x24')](function(_0x5a6a0b){if(_0x5a6a0b){if(!_0x5a6a0b[_0x1373('0x36')]){throw new db[(_0x1373('0x6b'))][(_0x1373('0x8c'))](_0x1373('0x6c'),0x193);}_0x859496=_0x5a6a0b;return db[_0x1373('0x6d')][_0x1373('0x44')]({'raw':!![]});}return null;})[_0x1373('0x24')](function(_0x4c4d1b){if(_0x4c4d1b){_0x48ec0c=_[_0x1373('0x6e')](_0x4c4d1b,'id');var _0x477253;var _0x3801d4=squel[_0x1373('0x6f')]();_0x3801d4[_0x1373('0x70')](_0x4d7a52[_0x1373('0x71')]);for(var _0x4c2bab=0x0;_0x4c2bab<_0x859496['length'];_0x4c2bab+=0x1){_0x477253=_0x859496[_0x4c2bab]['MetricId']?_0x48ec0c[_0x859496[_0x4c2bab]['MetricId']][_0x1373('0x8d')]:_0x859496[_0x4c2bab][_0x1373('0x67')];_0x477253=_0x859496[_0x4c2bab][_0x1373('0x73')]?_['replace'](_0x5c129b[_0x859496[_0x4c2bab][_0x1373('0x73')]],'%s',_0x477253):_0x477253;_0x477253=_0x859496[_0x4c2bab][_0x1373('0x74')]?_['replace'](_0x8bc897[_0x859496[_0x4c2bab][_0x1373('0x74')]],'%s',_0x477253):_0x477253;if(_0x859496[_0x4c2bab]['groupBy']){_0x3801d4['group'](_0x477253);}_0x859496[_0x4c2bab]['orderBy']&&_0x3801d4[_0x1373('0x39')](_0x477253,_0x859496[_0x4c2bab][_0x1373('0x75')]===_0x1373('0x76')?![]:!![]);_0x3801d4[_0x1373('0x67')](_0x477253,_0x859496[_0x4c2bab][_0x1373('0x77')]||_0x477253);}if(_0x4d7a52[_0x1373('0x78')]){_0x4d7a52[_0x1373('0x78')]=JSON[_0x1373('0x79')](_0x4d7a52[_0x1373('0x78')]);for(var _0x5452a9=0x0;_0x5452a9<_0x4d7a52[_0x1373('0x78')][_0x1373('0x36')];_0x5452a9+=0x1){if(_0x4d7a52[_0x1373('0x78')][_0x5452a9]['type']&&_[_0x1373('0x61')](_0xb29782,_0x4d7a52[_0x1373('0x78')][_0x5452a9]['type'])&&_0x4d7a52[_0x1373('0x78')][_0x5452a9][_0x1373('0x7b')]&&_0x4d7a52[_0x1373('0x78')][_0x5452a9][_0x1373('0x7c')]&&_0x4d7a52[_0x1373('0x78')][_0x5452a9]['foreignKey']){_0x3801d4[_0x4d7a52[_0x1373('0x78')][_0x5452a9][_0x1373('0x7a')]](_0x4d7a52[_0x1373('0x78')][_0x5452a9][_0x1373('0x7c')],null,util[_0x1373('0x74')](_0x1373('0x7d'),_0x4d7a52[_0x1373('0x71')],_0x4d7a52[_0x1373('0x78')][_0x5452a9]['parentKey'],_0x4d7a52['joins'][_0x5452a9][_0x1373('0x7c')],_0x4d7a52['joins'][_0x5452a9]['foreignKey']));}}}if(_0x4d7a52[_0x1373('0x7f')]){_0x4d7a52[_0x1373('0x7f')]=JSON[_0x1373('0x79')](_0x4d7a52[_0x1373('0x7f')]);_0x3801d4[_0x1373('0x3b')](_0x54a374(_0x4d7a52['conditions'][_0x1373('0x66')]));}_0x2cb6d1=_0x3801d4[_0x1373('0x80')]();_0x3801d4[_0x1373('0x1d')](_0x5079b4);_0x3801d4[_0x1373('0x1c')](0x0);logger['debug'](_0x1373('0x82'),_0x3801d4['toString']());return db[_0x1373('0x83')]['query'](_0x3801d4['toString'](),{'type':db[_0x1373('0x83')]['QueryTypes'][_0x1373('0x86')]});}})['then'](function(_0x255f23){if(!_0x255f23[_0x1373('0x36')]){throw new db[(_0x1373('0x6b'))][(_0x1373('0x8c'))](_0x1373('0x8e'),0xcc);}if(_0x3787d4[_0x1373('0x8f')]===_0x1373('0x90')){return null;}var _0x209c19=_[_0x1373('0x3f')](_0x3787d4,{'name':_0x3787d4[_0x1373('0x91')]||_0x3787d4['name']||_0x4d7a52[_0x1373('0x29')],'basename':_0x5a227f,'savename':util[_0x1373('0x74')](_0x1373('0x92'),_0x3787d4[_0x1373('0x29')]||_0x4d7a52[_0x1373('0x29')],require('randomstring')[_0x1373('0x93')](0x4),_0x3787d4[_0x1373('0x8f')]||_0x1373('0x94')),'reportId':_0x4d7a52['id'],'reportType':_0x1373('0x95')});return db[_0x1373('0x96')][_0x1373('0x4a')](_0x209c19,{'raw':!![]});})['then'](function(_0x2a244d){if(_0x4d7a52[_0x1373('0x71')]===_0x1373('0x97')){_0x2cb6d1[_0x1373('0x3b')](_0x4d7a52[_0x1373('0x71')]+_0x1373('0x98'),_0x3787d4[_0x1373('0x99')],_0x3787d4[_0x1373('0x9a')]);}else{_0x2cb6d1[_0x1373('0x3b')](_0x4d7a52['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3787d4[_0x1373('0x99')],_0x3787d4['endDate']);}if(_0x2a244d){logger[_0x1373('0x9b')]('Run\x20Query:',_0x2cb6d1[_0x1373('0x84')]());require(_0x1373('0x9c'))[_0x1373('0x9d')](path[_0x1373('0x53')](__dirname,_0x1373('0x9e'),_0x2a244d[_0x1373('0x8f')]),[_0x2a244d['id'],_0x2cb6d1['toString'](),path[_0x1373('0x53')](__dirname,_0x1373('0x9f'),_0x2a244d[_0x1373('0xa0')]),_0x5a227f]);return _0x2a244d;}else{var _0x2da3e3=squel[_0x1373('0x6f')]();_0x2da3e3['from']('('+_0x2cb6d1[_0x1373('0x84')]()+')',_0x1373('0xa1'));_0x2da3e3[_0x1373('0x67')]('COUNT(*)',_0x1373('0x1b'));_0x2cb6d1[_0x1373('0x1d')](_0x3787d4[_0x1373('0x1d')]||_0x5079b4);_0x2cb6d1['offset'](_0x3787d4['offset']||0x0);return dbH[_0x1373('0x83')][_0x1373('0x30')](_0x2da3e3[_0x1373('0x84')](),{'type':dbH[_0x1373('0x83')]['QueryTypes'][_0x1373('0x86')]})[_0x1373('0x24')](function(_0x1f9f8f){if(!_0x1f9f8f[_0x1373('0x36')]){_0x23019a=0x0;}else{_0x23019a=_0x1f9f8f[0x0][_0x1373('0x1b')]||0x0;}return dbH[_0x1373('0x83')][_0x1373('0x30')](_0x2cb6d1[_0x1373('0x84')](),{'type':dbH[_0x1373('0x83')][_0x1373('0x85')][_0x1373('0x86')]});})[_0x1373('0x24')](function(_0x497ec9){return{'rows':_0x497ec9||[],'count':_0x23019a};});}});}exports[_0x1373('0xa2')]=function(_0x5c943a,_0x44f7ae){return runReport(_0x5c943a[_0x1373('0x52')],_0x5c943a[_0x1373('0x30')],_0x5c943a[_0x1373('0x40')])[_0x1373('0x24')](respondWithResult(_0x44f7ae,null))[_0x1373('0x46')](handleError(_0x44f7ae,null));};exports[_0x1373('0xa3')]=runReport;exports[_0x1373('0x30')]=function(_0x1790d4,_0x495612){var _0x3c5f4f=0xa;var _0x1f3fa2=[_0x1373('0x53'),'left_join',_0x1373('0x54'),_0x1373('0x55')];var _0x2f89da={'SUM':_0x1373('0x56'),'COUNT':_0x1373('0x57'),'COUNT DISTINCT':_0x1373('0x58'),'MAX':_0x1373('0x59'),'MIN':_0x1373('0x5a'),'AVG':_0x1373('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1373('0x87'),'GROUP_CONCAT DESC':_0x1373('0x5d')};var _0x2fe8d2={'SEC_TO_TIME':_0x1373('0x88'),'DATE':_0x1373('0x5e'),'HOUR':_0x1373('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1373('0x60')};var _0x4c8ecb=function(_0x5d864f){return!_[_0x1373('0x61')]([_0x1373('0x62'),_0x1373('0x8a'),_0x1373('0x63'),_0x1373('0x64')],_0x5d864f);};var _0x43be8b=function(_0x58bd2f){if(!_0x58bd2f||!_0x58bd2f[_0x1373('0x65')]['length']){return'';}for(var _0x1bd96c='(',_0x769922=0x0;_0x769922<_0x58bd2f[_0x1373('0x65')][_0x1373('0x36')];_0x769922+=0x1){_0x769922>0x0&&(_0x1bd96c+='\x20'+_0x58bd2f[_0x1373('0x8b')]+'\x20');_0x1bd96c+=_0x58bd2f[_0x1373('0x65')][_0x769922]['group']?_0x43be8b(_0x58bd2f['rules'][_0x769922]['group']):_0x58bd2f[_0x1373('0x65')][_0x769922]['field']+'\x20'+_0x58bd2f[_0x1373('0x65')][_0x769922][_0x1373('0x68')]+(_0x4c8ecb(_0x58bd2f['rules'][_0x769922][_0x1373('0x68')])?'\x20'+_0x58bd2f[_0x1373('0x65')][_0x769922][_0x1373('0x69')]:'');}return _0x1bd96c+')';};var _0xe45679={'where':{'id':_0x1790d4[_0x1373('0x52')]['id']}},_0x3ca72c,_0x31a4b3,_0x1ee8e6,_0x2cdc58,_0xbe3575;_0xe45679=_['merge']({},_0xe45679,_0x1790d4[_0x1373('0x40')]);return db[_0x1373('0x41')][_0x1373('0x49')](_0xe45679)[_0x1373('0x24')](function(_0x54cc1e){if(_0x54cc1e){_0x3ca72c=_0x54cc1e;return _0x54cc1e['getFields']();}return null;})[_0x1373('0x24')](function(_0x453f5c){if(_0x453f5c){if(!_0x453f5c[_0x1373('0x36')]){throw new db['Sequelize'][(_0x1373('0x8c'))](_0x1373('0x6c'),0x193);}_0x31a4b3=_0x453f5c;return db[_0x1373('0x6d')][_0x1373('0x44')]({'raw':!![]});}return null;})['then'](function(_0x44c535){if(_0x44c535){_0x1ee8e6=_['keyBy'](_0x44c535,'id');var _0x5d4296;var _0x372eaf=squel[_0x1373('0x6f')]();_0x372eaf[_0x1373('0x70')](_0x3ca72c[_0x1373('0x71')]);for(var _0x4ef479=0x0;_0x4ef479<_0x31a4b3[_0x1373('0x36')];_0x4ef479+=0x1){_0x5d4296=_0x31a4b3[_0x4ef479][_0x1373('0x72')]?_0x1ee8e6[_0x31a4b3[_0x4ef479][_0x1373('0x72')]][_0x1373('0x8d')]:_0x31a4b3[_0x4ef479]['field'];_0x5d4296=_0x31a4b3[_0x4ef479][_0x1373('0x73')]?_[_0x1373('0xa4')](_0x2f89da[_0x31a4b3[_0x4ef479][_0x1373('0x73')]],'%s',_0x5d4296):_0x5d4296;_0x5d4296=_0x31a4b3[_0x4ef479][_0x1373('0x74')]?_['replace'](_0x2fe8d2[_0x31a4b3[_0x4ef479][_0x1373('0x74')]],'%s',_0x5d4296):_0x5d4296;if(_0x31a4b3[_0x4ef479]['groupBy']){_0x372eaf[_0x1373('0x66')](_0x5d4296);}_0x31a4b3[_0x4ef479]['orderBy']&&_0x372eaf[_0x1373('0x39')](_0x5d4296,_0x31a4b3[_0x4ef479]['orderBy']==='DESC'?![]:!![]);_0x372eaf['field'](_0x5d4296,_0x31a4b3[_0x4ef479][_0x1373('0x77')]||_0x5d4296);}if(_0x3ca72c[_0x1373('0x78')]){_0x3ca72c[_0x1373('0x78')]=JSON[_0x1373('0x79')](_0x3ca72c[_0x1373('0x78')]);for(var _0x14f9e0=0x0;_0x14f9e0<_0x3ca72c[_0x1373('0x78')][_0x1373('0x36')];_0x14f9e0+=0x1){if(_0x3ca72c['joins'][_0x14f9e0]['type']&&_[_0x1373('0x61')](_0x1f3fa2,_0x3ca72c[_0x1373('0x78')][_0x14f9e0][_0x1373('0x7a')])&&_0x3ca72c[_0x1373('0x78')][_0x14f9e0][_0x1373('0x7b')]&&_0x3ca72c['joins'][_0x14f9e0][_0x1373('0x7c')]&&_0x3ca72c[_0x1373('0x78')][_0x14f9e0][_0x1373('0x7e')]){_0x372eaf[_0x3ca72c[_0x1373('0x78')][_0x14f9e0][_0x1373('0x7a')]](_0x3ca72c['joins'][_0x14f9e0][_0x1373('0x7c')],null,util[_0x1373('0x74')](_0x1373('0x7d'),_0x3ca72c[_0x1373('0x71')],_0x3ca72c['joins'][_0x14f9e0][_0x1373('0x7b')],_0x3ca72c['joins'][_0x14f9e0][_0x1373('0x7c')],_0x3ca72c['joins'][_0x14f9e0][_0x1373('0x7e')]));}}}if(_0x3ca72c[_0x1373('0x7f')]){_0x3ca72c[_0x1373('0x7f')]=JSON[_0x1373('0x79')](_0x3ca72c[_0x1373('0x7f')]);_0x372eaf[_0x1373('0x3b')](_0x43be8b(_0x3ca72c[_0x1373('0x7f')][_0x1373('0x66')]));}_0xbe3575=_0x372eaf[_0x1373('0x80')]();_0x372eaf[_0x1373('0x1d')](_0x3c5f4f);_0x372eaf[_0x1373('0x1c')](0x0);logger[_0x1373('0x81')]('Limited\x20Query:',_0x372eaf[_0x1373('0x84')]());return db[_0x1373('0x83')][_0x1373('0x30')](_0x372eaf[_0x1373('0x84')](),{'type':db[_0x1373('0x83')][_0x1373('0x85')][_0x1373('0x86')]});}})[_0x1373('0x24')](function(){return{'sql':_0xbe3575[_0x1373('0x84')]()};})['then'](respondWithResult(_0x495612,null))[_0x1373('0x46')](handleError(_0x495612,null));};
\ No newline at end of file
+var _0x6c32=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','count','includeAll','include','findAll','rows','catch','show','attributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','left_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)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','condition','value','options','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','debug','Limited\x20Query:','toString','sequelize','SELECT','join','right_join','cross_join','AVG(%s)','SEC_TO_TIME(%s)','ValidationErrorItem','MetricId','metric','clone','QueryTypes','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','update','destroy','then','get','DefaultReports','UserProfileResource','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x1f27ac,_0x4e9a8f){var _0xfbbfb6=function(_0x23627a){while(--_0x23627a){_0x1f27ac['push'](_0x1f27ac['shift']());}};_0xfbbfb6(++_0x4e9a8f);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x26c3('0x0'));var emlformat=require(_0x26c3('0x1'));var rimraf=require(_0x26c3('0x2'));var zipdir=require(_0x26c3('0x3'));var jsonpatch=require(_0x26c3('0x4'));var rp=require(_0x26c3('0x5'));var moment=require(_0x26c3('0x6'));var BPromise=require(_0x26c3('0x7'));var Mustache=require(_0x26c3('0x8'));var util=require('util');var path=require(_0x26c3('0x9'));var sox=require(_0x26c3('0xa'));var csv=require(_0x26c3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x26c3('0xc'));var squel=require('squel');var crypto=require(_0x26c3('0xd'));var jsforce=require(_0x26c3('0xe'));var deskjs=require(_0x26c3('0xf'));var toCsv=require(_0x26c3('0xb'));var querystring=require(_0x26c3('0x10'));var Papa=require(_0x26c3('0x11'));var Redis=require(_0x26c3('0x12'));var authService=require(_0x26c3('0x13'));var qs=require(_0x26c3('0x14'));var as=require(_0x26c3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x26c3('0x16'));var licenseUtil=require(_0x26c3('0x17'));var db=require(_0x26c3('0x18'))['db'];var dbH=require(_0x26c3('0x18'))['dbH'];function respondWithStatusCode(_0x4c7b94,_0x45fd4f){_0x45fd4f=_0x45fd4f||0xcc;return function(_0x15271a){if(_0x15271a){return _0x4c7b94[_0x26c3('0x19')](_0x45fd4f);}return _0x4c7b94[_0x26c3('0x1a')](_0x45fd4f)[_0x26c3('0x1b')]();};}function respondWithResult(_0x568d0b,_0x5d4e9d){_0x5d4e9d=_0x5d4e9d||0xc8;return function(_0x2acfb1){if(_0x2acfb1){return _0x568d0b[_0x26c3('0x1a')](_0x5d4e9d)['json'](_0x2acfb1);}};}function respondWithFilteredResult(_0x4ed7c1,_0x124cb3){return function(_0x5e863f){if(_0x5e863f){var _0x3ce1ea=_0x5e863f['count'],_0x486486=_0x124cb3[_0x26c3('0x1c')],_0x5c21ea=_0x124cb3['offset']+_0x124cb3[_0x26c3('0x1d')],_0x3931d5;if(_0x5c21ea>=_0x3ce1ea){_0x5c21ea=_0x3ce1ea;_0x3931d5=0xc8;}else{_0x3931d5=0xce;}_0x4ed7c1[_0x26c3('0x1a')](_0x3931d5);return _0x4ed7c1[_0x26c3('0x1e')](_0x26c3('0x1f'),_0x486486+'-'+_0x5c21ea+'/'+_0x3ce1ea)[_0x26c3('0x20')](_0x5e863f);}return null;};}function patchUpdates(_0x497441){return function(_0x5c530f){try{jsonpatch[_0x26c3('0x21')](_0x5c530f,_0x497441,!![]);}catch(_0x39e500){return BPromise['reject'](_0x39e500);}return _0x5c530f['save']();};}function saveUpdates(_0x176795,_0x5c2f7d){return function(_0x501dfd){if(_0x501dfd){return _0x501dfd[_0x26c3('0x22')](_0x176795)['then'](function(_0x21034d){return _0x21034d;});}return null;};}function removeEntity(_0x4a76b5,_0x367b62){return function(_0x4a3ce2){if(_0x4a3ce2){return _0x4a3ce2[_0x26c3('0x23')]()[_0x26c3('0x24')](function(){var _0x2f1648=_0x4a3ce2[_0x26c3('0x25')]({'plain':!![]});var _0x3fafed=_0x26c3('0x26');return db[_0x26c3('0x27')][_0x26c3('0x23')]({'where':{'type':_0x3fafed,'resourceId':_0x2f1648['id']}})[_0x26c3('0x24')](function(){return _0x4a3ce2;});})[_0x26c3('0x24')](function(){_0x4a76b5['status'](0xcc)[_0x26c3('0x1b')]();});}};}function handleEntityNotFound(_0x4c7696,_0x50d85e){return function(_0x44b4f8){if(!_0x44b4f8){_0x4c7696[_0x26c3('0x19')](0x194);}return _0x44b4f8;};}function handleError(_0x58701e,_0x458c89){_0x458c89=_0x458c89||0x1f4;return function(_0x50c7a1){logger[_0x26c3('0x28')](_0x50c7a1[_0x26c3('0x29')]);if(_0x50c7a1[_0x26c3('0x2a')]){delete _0x50c7a1[_0x26c3('0x2a')];}_0x58701e[_0x26c3('0x1a')](_0x458c89)['send'](_0x50c7a1);};}exports[_0x26c3('0x2b')]=function(_0x27f556,_0xebb766){var _0x2b06fe={},_0x13cdbe={},_0x19200e={'count':0x0,'rows':[]};var _0x5557b8=_[_0x26c3('0x2c')](db[_0x26c3('0x2d')][_0x26c3('0x2e')],function(_0x48080f){return{'name':_0x48080f[_0x26c3('0x2f')],'type':_0x48080f[_0x26c3('0x30')][_0x26c3('0x31')]};});_0x13cdbe[_0x26c3('0x32')]=_[_0x26c3('0x2c')](_0x5557b8,_0x26c3('0x2a'));_0x13cdbe['query']=_[_0x26c3('0x33')](_0x27f556[_0x26c3('0x34')]);_0x13cdbe['filters']=_['intersection'](_0x13cdbe['model'],_0x13cdbe['query']);_0x2b06fe['attributes']=_[_0x26c3('0x35')](_0x13cdbe[_0x26c3('0x32')],qs['fields'](_0x27f556[_0x26c3('0x34')][_0x26c3('0x36')]));_0x2b06fe['attributes']=_0x2b06fe['attributes'][_0x26c3('0x37')]?_0x2b06fe['attributes']:_0x13cdbe[_0x26c3('0x32')];if(!_0x27f556['query'][_0x26c3('0x38')](_0x26c3('0x39'))){_0x2b06fe[_0x26c3('0x1d')]=qs[_0x26c3('0x1d')](_0x27f556[_0x26c3('0x34')]['limit']);_0x2b06fe[_0x26c3('0x1c')]=qs[_0x26c3('0x1c')](_0x27f556[_0x26c3('0x34')][_0x26c3('0x1c')]);}_0x2b06fe[_0x26c3('0x3a')]=qs[_0x26c3('0x3b')](_0x27f556['query']['sort']);_0x2b06fe[_0x26c3('0x3c')]=qs[_0x26c3('0x3d')](_[_0x26c3('0x3e')](_0x27f556[_0x26c3('0x34')],_0x13cdbe[_0x26c3('0x3d')]),_0x5557b8);if(_0x27f556['query']['filter']){_0x2b06fe['where']=_[_0x26c3('0x3f')](_0x2b06fe[_0x26c3('0x3c')],{'$or':_[_0x26c3('0x2c')](_0x5557b8,function(_0x3996da){if(_0x3996da[_0x26c3('0x30')]!=='VIRTUAL'){var _0x592764={};_0x592764[_0x3996da[_0x26c3('0x2a')]]={'$like':'%'+_0x27f556[_0x26c3('0x34')][_0x26c3('0x40')]+'%'};return _0x592764;}})});}_0x2b06fe=_[_0x26c3('0x3f')]({},_0x2b06fe,_0x27f556['options']);var _0x4111b6={'where':_0x2b06fe[_0x26c3('0x3c')]};return db[_0x26c3('0x2d')][_0x26c3('0x41')](_0x4111b6)[_0x26c3('0x24')](function(_0x96131d){_0x19200e[_0x26c3('0x41')]=_0x96131d;if(_0x27f556[_0x26c3('0x34')][_0x26c3('0x42')]){_0x2b06fe[_0x26c3('0x43')]=[{'all':!![]}];}return db[_0x26c3('0x2d')][_0x26c3('0x44')](_0x2b06fe);})[_0x26c3('0x24')](function(_0x5aac84){_0x19200e[_0x26c3('0x45')]=_0x5aac84;return _0x19200e;})[_0x26c3('0x24')](respondWithFilteredResult(_0xebb766,_0x2b06fe))[_0x26c3('0x46')](handleError(_0xebb766,null));};exports[_0x26c3('0x47')]=function(_0x1b6f88,_0x1bede8){var _0x567fb2={'raw':!![],'where':{'id':_0x1b6f88['params']['id']}},_0x1845ee={};_0x1845ee[_0x26c3('0x32')]=_['keys'](db[_0x26c3('0x2d')][_0x26c3('0x2e')]);_0x1845ee['query']=_[_0x26c3('0x33')](_0x1b6f88[_0x26c3('0x34')]);_0x1845ee[_0x26c3('0x3d')]=_[_0x26c3('0x35')](_0x1845ee[_0x26c3('0x32')],_0x1845ee['query']);_0x567fb2[_0x26c3('0x48')]=_['intersection'](_0x1845ee[_0x26c3('0x32')],qs['fields'](_0x1b6f88['query'][_0x26c3('0x36')]));_0x567fb2[_0x26c3('0x48')]=_0x567fb2[_0x26c3('0x48')]['length']?_0x567fb2[_0x26c3('0x48')]:_0x1845ee[_0x26c3('0x32')];if(_0x1b6f88[_0x26c3('0x34')][_0x26c3('0x42')]){_0x567fb2[_0x26c3('0x43')]=[{'all':!![]}];}_0x567fb2=_[_0x26c3('0x3f')]({},_0x567fb2,_0x1b6f88['options']);return db[_0x26c3('0x2d')][_0x26c3('0x49')](_0x567fb2)[_0x26c3('0x24')](handleEntityNotFound(_0x1bede8,null))[_0x26c3('0x24')](respondWithResult(_0x1bede8,null))['catch'](handleError(_0x1bede8,null));};exports[_0x26c3('0x4a')]=function(_0x3f4ca9,_0x480bdc){return db[_0x26c3('0x2d')][_0x26c3('0x4a')](_0x3f4ca9['body'],{})[_0x26c3('0x24')](function(_0x4827c6){var _0x2c6d8b=_0x3f4ca9[_0x26c3('0x4b')][_0x26c3('0x25')]({'plain':!![]});if(!_0x2c6d8b)throw new Error(_0x26c3('0x4c'));if(_0x2c6d8b[_0x26c3('0x4d')]===_0x26c3('0x4b')){var _0x129452=_0x4827c6['get']({'plain':!![]});var _0x1b5f08='Reports';return db['UserProfileSection'][_0x26c3('0x49')]({'where':{'name':_0x1b5f08,'userProfileId':_0x2c6d8b[_0x26c3('0x4e')]},'raw':!![]})[_0x26c3('0x24')](function(_0x4dc997){if(_0x4dc997&&_0x4dc997['autoAssociation']===0x0){return db[_0x26c3('0x27')][_0x26c3('0x4a')]({'name':_0x129452[_0x26c3('0x2a')],'resourceId':_0x129452['id'],'type':'DefaultReports','sectionId':_0x4dc997['id']},{})[_0x26c3('0x24')](function(){return _0x4827c6;});}else{return _0x4827c6;}})[_0x26c3('0x46')](function(_0x218f51){logger['error'](_0x26c3('0x4f'),_0x218f51);throw _0x218f51;});}return _0x4827c6;})['then'](respondWithResult(_0x480bdc,0xc9))[_0x26c3('0x46')](handleError(_0x480bdc,null));};exports[_0x26c3('0x22')]=function(_0x356994,_0x499445){if(_0x356994[_0x26c3('0x50')]['id']){delete _0x356994[_0x26c3('0x50')]['id'];}return db[_0x26c3('0x2d')][_0x26c3('0x49')]({'where':{'id':_0x356994[_0x26c3('0x51')]['id']}})[_0x26c3('0x24')](handleEntityNotFound(_0x499445,null))['then'](saveUpdates(_0x356994[_0x26c3('0x50')],null))[_0x26c3('0x24')](respondWithResult(_0x499445,null))['catch'](handleError(_0x499445,null));};exports[_0x26c3('0x23')]=function(_0x5169d2,_0x5c6c24){return db[_0x26c3('0x2d')]['find']({'where':{'id':_0x5169d2[_0x26c3('0x51')]['id']}})[_0x26c3('0x24')](handleEntityNotFound(_0x5c6c24,null))[_0x26c3('0x24')](removeEntity(_0x5c6c24,null))[_0x26c3('0x46')](handleError(_0x5c6c24,null));};exports['preview']=function(_0x5cc4f3,_0x3bd83e){var _0x59fbaf=0xa;var _0x4c38d6=['join',_0x26c3('0x52'),'right_join','cross_join'];var _0x1c7d72={'SUM':_0x26c3('0x53'),'COUNT':_0x26c3('0x54'),'COUNT DISTINCT':_0x26c3('0x55'),'MAX':_0x26c3('0x56'),'MIN':_0x26c3('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x26c3('0x58'),'GROUP_CONCAT ASC':_0x26c3('0x59'),'GROUP_CONCAT DESC':_0x26c3('0x5a')};var _0x2680f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x26c3('0x5b'),'HOUR':_0x26c3('0x5c'),'ROUND':_0x26c3('0x5d'),'UNIX_TIMESTAMP':_0x26c3('0x5e')};var _0x1314a3=function(_0x28cde2){return!_['includes']([_0x26c3('0x5f'),_0x26c3('0x60'),_0x26c3('0x61'),_0x26c3('0x62')],_0x28cde2);};var _0x5cc9fc=function(_0xc5e2f6){if(!_0xc5e2f6||!_0xc5e2f6[_0x26c3('0x63')][_0x26c3('0x37')]){return'';}for(var _0x416373='(',_0x4d4970=0x0;_0x4d4970<_0xc5e2f6[_0x26c3('0x63')][_0x26c3('0x37')];_0x4d4970+=0x1){_0x4d4970>0x0&&(_0x416373+='\x20'+_0xc5e2f6[_0x26c3('0x64')]+'\x20');_0x416373+=_0xc5e2f6[_0x26c3('0x63')][_0x4d4970]['group']?_0x5cc9fc(_0xc5e2f6[_0x26c3('0x63')][_0x4d4970]['group']):_0xc5e2f6[_0x26c3('0x63')][_0x4d4970]['field']+'\x20'+_0xc5e2f6[_0x26c3('0x63')][_0x4d4970][_0x26c3('0x65')]+(_0x1314a3(_0xc5e2f6['rules'][_0x4d4970][_0x26c3('0x65')])?'\x20'+_0xc5e2f6[_0x26c3('0x63')][_0x4d4970][_0x26c3('0x66')]:'');}return _0x416373+')';};var _0xe5c060={'where':{'id':_0x5cc4f3[_0x26c3('0x51')]['id']}},_0x41767d,_0x4fbd2e,_0x1dcf53,_0x6e05e3,_0x115d6a;_0xe5c060=_[_0x26c3('0x3f')]({},_0xe5c060,_0x5cc4f3[_0x26c3('0x67')]);return db[_0x26c3('0x2d')]['find'](_0xe5c060)[_0x26c3('0x24')](function(_0x45d17b){if(_0x45d17b){_0x41767d=_0x45d17b;return _0x45d17b[_0x26c3('0x68')]();}return null;})[_0x26c3('0x24')](function(_0x499849){if(_0x499849){if(!_0x499849[_0x26c3('0x37')]){throw new db[(_0x26c3('0x69'))]['ValidationErrorItem'](_0x26c3('0x6a'),0x193);}_0x4fbd2e=_0x499849;return db[_0x26c3('0x6b')][_0x26c3('0x44')]({'raw':!![]});}return null;})[_0x26c3('0x24')](function(_0x3a5c0f){if(_0x3a5c0f){_0x1dcf53=_[_0x26c3('0x6c')](_0x3a5c0f,'id');var _0x2addd3;var _0x258e32=squel[_0x26c3('0x6d')]();_0x258e32[_0x26c3('0x6e')](_0x41767d[_0x26c3('0x6f')]);for(var _0x3c8a58=0x0;_0x3c8a58<_0x4fbd2e['length'];_0x3c8a58+=0x1){_0x2addd3=_0x4fbd2e[_0x3c8a58]['MetricId']?_0x1dcf53[_0x4fbd2e[_0x3c8a58]['MetricId']]['metric']:_0x4fbd2e[_0x3c8a58][_0x26c3('0x70')];_0x2addd3=_0x4fbd2e[_0x3c8a58][_0x26c3('0x71')]?_[_0x26c3('0x72')](_0x1c7d72[_0x4fbd2e[_0x3c8a58][_0x26c3('0x71')]],'%s',_0x2addd3):_0x2addd3;_0x2addd3=_0x4fbd2e[_0x3c8a58][_0x26c3('0x73')]?_[_0x26c3('0x72')](_0x2680f5[_0x4fbd2e[_0x3c8a58][_0x26c3('0x73')]],'%s',_0x2addd3):_0x2addd3;if(_0x4fbd2e[_0x3c8a58][_0x26c3('0x74')]){_0x258e32['group'](_0x2addd3);}_0x4fbd2e[_0x3c8a58][_0x26c3('0x75')]&&_0x258e32[_0x26c3('0x3a')](_0x2addd3,_0x4fbd2e[_0x3c8a58][_0x26c3('0x75')]===_0x26c3('0x76')?![]:!![]);_0x258e32[_0x26c3('0x70')](_0x2addd3,_0x4fbd2e[_0x3c8a58][_0x26c3('0x77')]||_0x2addd3);}if(_0x41767d['joins']){_0x41767d[_0x26c3('0x78')]=JSON[_0x26c3('0x79')](_0x41767d['joins']);for(var _0x25a2cb=0x0;_0x25a2cb<_0x41767d[_0x26c3('0x78')]['length'];_0x25a2cb+=0x1){if(_0x41767d[_0x26c3('0x78')][_0x25a2cb][_0x26c3('0x30')]&&_[_0x26c3('0x7a')](_0x4c38d6,_0x41767d['joins'][_0x25a2cb][_0x26c3('0x30')])&&_0x41767d[_0x26c3('0x78')][_0x25a2cb][_0x26c3('0x7b')]&&_0x41767d[_0x26c3('0x78')][_0x25a2cb][_0x26c3('0x7c')]&&_0x41767d[_0x26c3('0x78')][_0x25a2cb][_0x26c3('0x7d')]){_0x258e32[_0x41767d['joins'][_0x25a2cb]['type']](_0x41767d[_0x26c3('0x78')][_0x25a2cb][_0x26c3('0x7c')],null,util[_0x26c3('0x73')](_0x26c3('0x7e'),_0x41767d['table'],_0x41767d[_0x26c3('0x78')][_0x25a2cb]['parentKey'],_0x41767d['joins'][_0x25a2cb][_0x26c3('0x7c')],_0x41767d[_0x26c3('0x78')][_0x25a2cb]['foreignKey']));}}}if(_0x41767d[_0x26c3('0x7f')]){_0x41767d['conditions']=JSON[_0x26c3('0x79')](_0x41767d[_0x26c3('0x7f')]);_0x258e32[_0x26c3('0x3c')](_0x5cc9fc(_0x41767d['conditions'][_0x26c3('0x80')]));}_0x115d6a=_0x258e32['clone']();_0x258e32[_0x26c3('0x1d')](_0x59fbaf);_0x258e32[_0x26c3('0x1c')](0x0);logger[_0x26c3('0x81')](_0x26c3('0x82'),_0x258e32[_0x26c3('0x83')]());return db['sequelize']['query'](_0x258e32[_0x26c3('0x83')](),{'type':db[_0x26c3('0x84')]['QueryTypes'][_0x26c3('0x85')]});}})[_0x26c3('0x24')](respondWithResult(_0x3bd83e,null))[_0x26c3('0x46')](handleError(_0x3bd83e,null));};function runReport(_0x4dd8a2,_0x179498,_0x3d5a3b){var _0x4be9ad=_0x179498['name'];var _0x1440c9=0xa;var _0x3d5bab=[_0x26c3('0x86'),_0x26c3('0x52'),_0x26c3('0x87'),_0x26c3('0x88')];var _0x483458={'SUM':_0x26c3('0x53'),'COUNT':_0x26c3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x26c3('0x56'),'MIN':_0x26c3('0x57'),'AVG':_0x26c3('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x26c3('0x59'),'GROUP_CONCAT DESC':_0x26c3('0x5a')};var _0x174245={'SEC_TO_TIME':_0x26c3('0x8a'),'DATE':_0x26c3('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x26c3('0x5e')};var _0x469a0a=function(_0xbaa6af){return!_['includes']([_0x26c3('0x5f'),_0x26c3('0x60'),'IS\x20EMPTY',_0x26c3('0x62')],_0xbaa6af);};var _0x29494f=function(_0x29f690){if(!_0x29f690||!_0x29f690['rules'][_0x26c3('0x37')]){return'';}for(var _0x1544c4='(',_0x452a3e=0x0;_0x452a3e<_0x29f690[_0x26c3('0x63')]['length'];_0x452a3e+=0x1){_0x452a3e>0x0&&(_0x1544c4+='\x20'+_0x29f690['operator']+'\x20');_0x1544c4+=_0x29f690[_0x26c3('0x63')][_0x452a3e][_0x26c3('0x80')]?_0x29494f(_0x29f690[_0x26c3('0x63')][_0x452a3e][_0x26c3('0x80')]):_0x29f690[_0x26c3('0x63')][_0x452a3e][_0x26c3('0x70')]+'\x20'+_0x29f690['rules'][_0x452a3e][_0x26c3('0x65')]+(_0x469a0a(_0x29f690[_0x26c3('0x63')][_0x452a3e][_0x26c3('0x65')])?'\x20'+_0x29f690[_0x26c3('0x63')][_0x452a3e][_0x26c3('0x66')]:'');}return _0x1544c4+')';};var _0x23f7af={'where':{'id':_0x4dd8a2['id']}},_0x34f2ba,_0x1da826,_0x2c173e,_0x30a5f6,_0x52adff;_0x23f7af=_[_0x26c3('0x3f')]({},_0x23f7af,_0x3d5a3b);return db[_0x26c3('0x2d')][_0x26c3('0x49')](_0x23f7af)[_0x26c3('0x24')](function(_0x2ce3e3){if(_0x2ce3e3){_0x34f2ba=_0x2ce3e3;return _0x2ce3e3[_0x26c3('0x68')]();}return null;})['then'](function(_0x221978){if(_0x221978){if(!_0x221978[_0x26c3('0x37')]){throw new db[(_0x26c3('0x69'))][(_0x26c3('0x8b'))](_0x26c3('0x6a'),0x193);}_0x1da826=_0x221978;return db['AnalyticMetric'][_0x26c3('0x44')]({'raw':!![]});}return null;})['then'](function(_0x381b43){if(_0x381b43){_0x2c173e=_[_0x26c3('0x6c')](_0x381b43,'id');var _0x5c3f90;var _0x5b43aa=squel[_0x26c3('0x6d')]();_0x5b43aa[_0x26c3('0x6e')](_0x34f2ba[_0x26c3('0x6f')]);for(var _0x17e3ed=0x0;_0x17e3ed<_0x1da826[_0x26c3('0x37')];_0x17e3ed+=0x1){_0x5c3f90=_0x1da826[_0x17e3ed][_0x26c3('0x8c')]?_0x2c173e[_0x1da826[_0x17e3ed]['MetricId']][_0x26c3('0x8d')]:_0x1da826[_0x17e3ed][_0x26c3('0x70')];_0x5c3f90=_0x1da826[_0x17e3ed]['function']?_[_0x26c3('0x72')](_0x483458[_0x1da826[_0x17e3ed][_0x26c3('0x71')]],'%s',_0x5c3f90):_0x5c3f90;_0x5c3f90=_0x1da826[_0x17e3ed][_0x26c3('0x73')]?_[_0x26c3('0x72')](_0x174245[_0x1da826[_0x17e3ed][_0x26c3('0x73')]],'%s',_0x5c3f90):_0x5c3f90;if(_0x1da826[_0x17e3ed][_0x26c3('0x74')]){_0x5b43aa[_0x26c3('0x80')](_0x5c3f90);}_0x1da826[_0x17e3ed]['orderBy']&&_0x5b43aa[_0x26c3('0x3a')](_0x5c3f90,_0x1da826[_0x17e3ed][_0x26c3('0x75')]===_0x26c3('0x76')?![]:!![]);_0x5b43aa[_0x26c3('0x70')](_0x5c3f90,_0x1da826[_0x17e3ed][_0x26c3('0x77')]||_0x5c3f90);}if(_0x34f2ba[_0x26c3('0x78')]){_0x34f2ba['joins']=JSON[_0x26c3('0x79')](_0x34f2ba[_0x26c3('0x78')]);for(var _0x532c76=0x0;_0x532c76<_0x34f2ba[_0x26c3('0x78')]['length'];_0x532c76+=0x1){if(_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x30')]&&_[_0x26c3('0x7a')](_0x3d5bab,_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x30')])&&_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x7b')]&&_0x34f2ba[_0x26c3('0x78')][_0x532c76]['foreignTable']&&_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x7d')]){_0x5b43aa[_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x30')]](_0x34f2ba[_0x26c3('0x78')][_0x532c76]['foreignTable'],null,util[_0x26c3('0x73')](_0x26c3('0x7e'),_0x34f2ba[_0x26c3('0x6f')],_0x34f2ba['joins'][_0x532c76][_0x26c3('0x7b')],_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x7c')],_0x34f2ba[_0x26c3('0x78')][_0x532c76][_0x26c3('0x7d')]));}}}if(_0x34f2ba['conditions']){_0x34f2ba[_0x26c3('0x7f')]=JSON['parse'](_0x34f2ba[_0x26c3('0x7f')]);_0x5b43aa[_0x26c3('0x3c')](_0x29494f(_0x34f2ba['conditions'][_0x26c3('0x80')]));}_0x52adff=_0x5b43aa[_0x26c3('0x8e')]();_0x5b43aa['limit'](_0x1440c9);_0x5b43aa[_0x26c3('0x1c')](0x0);logger['debug'](_0x26c3('0x82'),_0x5b43aa[_0x26c3('0x83')]());return db[_0x26c3('0x84')]['query'](_0x5b43aa[_0x26c3('0x83')](),{'type':db[_0x26c3('0x84')][_0x26c3('0x8f')][_0x26c3('0x85')]});}})[_0x26c3('0x24')](function(_0x3ea02f){if(!_0x3ea02f[_0x26c3('0x37')]){throw new db[(_0x26c3('0x69'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x179498[_0x26c3('0x90')]===_0x26c3('0x91')){return null;}var _0x2f40a9=_[_0x26c3('0x3f')](_0x179498,{'name':_0x179498[_0x26c3('0x92')]||_0x179498[_0x26c3('0x2a')]||_0x34f2ba['name'],'basename':_0x4be9ad,'savename':util[_0x26c3('0x73')]('%s-%s.%s',_0x179498[_0x26c3('0x2a')]||_0x34f2ba[_0x26c3('0x2a')],require(_0x26c3('0x93'))[_0x26c3('0x94')](0x4),_0x179498[_0x26c3('0x90')]||_0x26c3('0x95')),'reportId':_0x34f2ba['id'],'reportType':_0x26c3('0x96')});return db[_0x26c3('0x97')][_0x26c3('0x4a')](_0x2f40a9,{'raw':!![]});})[_0x26c3('0x24')](function(_0x16f736){if(_0x34f2ba[_0x26c3('0x6f')]==='cdr'){_0x52adff['where'](_0x34f2ba[_0x26c3('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x179498[_0x26c3('0x98')],_0x179498[_0x26c3('0x99')]);}else{_0x52adff[_0x26c3('0x3c')](_0x34f2ba['table']+_0x26c3('0x9a'),_0x179498[_0x26c3('0x98')],_0x179498[_0x26c3('0x99')]);}if(_0x16f736){logger[_0x26c3('0x9b')](_0x26c3('0x9c'),_0x52adff[_0x26c3('0x83')]());require(_0x26c3('0x9d'))[_0x26c3('0x9e')](path['join'](__dirname,_0x26c3('0x9f'),_0x16f736[_0x26c3('0x90')]),[_0x16f736['id'],_0x52adff[_0x26c3('0x83')](),path[_0x26c3('0x86')](__dirname,_0x26c3('0xa0'),_0x16f736['savename']),_0x4be9ad]);return _0x16f736;}else{var _0x2d4cb2=squel[_0x26c3('0x6d')]();_0x2d4cb2['from']('('+_0x52adff[_0x26c3('0x83')]()+')','countTable');_0x2d4cb2[_0x26c3('0x70')](_0x26c3('0xa1'),_0x26c3('0x41'));_0x52adff[_0x26c3('0x1d')](_0x179498['limit']||_0x1440c9);_0x52adff[_0x26c3('0x1c')](_0x179498[_0x26c3('0x1c')]||0x0);return dbH[_0x26c3('0x84')][_0x26c3('0x34')](_0x2d4cb2[_0x26c3('0x83')](),{'type':dbH[_0x26c3('0x84')]['QueryTypes']['SELECT']})['then'](function(_0x13391a){if(!_0x13391a['length']){_0x30a5f6=0x0;}else{_0x30a5f6=_0x13391a[0x0][_0x26c3('0x41')]||0x0;}return dbH[_0x26c3('0x84')]['query'](_0x52adff['toString'](),{'type':dbH[_0x26c3('0x84')]['QueryTypes']['SELECT']});})[_0x26c3('0x24')](function(_0x30568e){return{'rows':_0x30568e||[],'count':_0x30a5f6};});}});}exports[_0x26c3('0xa2')]=function(_0x40f097,_0x1a6938){return runReport(_0x40f097[_0x26c3('0x51')],_0x40f097[_0x26c3('0x34')],_0x40f097[_0x26c3('0x67')])[_0x26c3('0x24')](respondWithResult(_0x1a6938,null))['catch'](handleError(_0x1a6938,null));};exports['runReport']=runReport;exports[_0x26c3('0x34')]=function(_0x2d51b7,_0x58a6fe){var _0x220374=0xa;var _0x3bd6e0=[_0x26c3('0x86'),_0x26c3('0x52'),_0x26c3('0x87'),_0x26c3('0x88')];var _0xd29299={'SUM':_0x26c3('0x53'),'COUNT':_0x26c3('0x54'),'COUNT DISTINCT':_0x26c3('0x55'),'MAX':_0x26c3('0x56'),'MIN':_0x26c3('0x57'),'AVG':_0x26c3('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x26c3('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d313d={'SEC_TO_TIME':_0x26c3('0x8a'),'DATE':_0x26c3('0x5b'),'HOUR':_0x26c3('0x5c'),'ROUND':_0x26c3('0x5d'),'UNIX_TIMESTAMP':_0x26c3('0x5e')};var _0x257a0e=function(_0x5646c7){return!_[_0x26c3('0x7a')]([_0x26c3('0x5f'),'IS\x20NOT\x20NULL',_0x26c3('0x61'),_0x26c3('0x62')],_0x5646c7);};var _0x3cfffe=function(_0x39900c){if(!_0x39900c||!_0x39900c[_0x26c3('0x63')][_0x26c3('0x37')]){return'';}for(var _0x3ce4f7='(',_0x298bf4=0x0;_0x298bf4<_0x39900c[_0x26c3('0x63')][_0x26c3('0x37')];_0x298bf4+=0x1){_0x298bf4>0x0&&(_0x3ce4f7+='\x20'+_0x39900c[_0x26c3('0x64')]+'\x20');_0x3ce4f7+=_0x39900c[_0x26c3('0x63')][_0x298bf4][_0x26c3('0x80')]?_0x3cfffe(_0x39900c[_0x26c3('0x63')][_0x298bf4][_0x26c3('0x80')]):_0x39900c[_0x26c3('0x63')][_0x298bf4][_0x26c3('0x70')]+'\x20'+_0x39900c[_0x26c3('0x63')][_0x298bf4][_0x26c3('0x65')]+(_0x257a0e(_0x39900c[_0x26c3('0x63')][_0x298bf4][_0x26c3('0x65')])?'\x20'+_0x39900c[_0x26c3('0x63')][_0x298bf4]['value']:'');}return _0x3ce4f7+')';};var _0x2dc706={'where':{'id':_0x2d51b7[_0x26c3('0x51')]['id']}},_0x17a862,_0x2a0099,_0xb3c12b,_0x4d480e,_0x1ffe7c;_0x2dc706=_[_0x26c3('0x3f')]({},_0x2dc706,_0x2d51b7[_0x26c3('0x67')]);return db[_0x26c3('0x2d')][_0x26c3('0x49')](_0x2dc706)['then'](function(_0xbf826){if(_0xbf826){_0x17a862=_0xbf826;return _0xbf826['getFields']();}return null;})[_0x26c3('0x24')](function(_0x405cac){if(_0x405cac){if(!_0x405cac[_0x26c3('0x37')]){throw new db[(_0x26c3('0x69'))][(_0x26c3('0x8b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2a0099=_0x405cac;return db[_0x26c3('0x6b')][_0x26c3('0x44')]({'raw':!![]});}return null;})[_0x26c3('0x24')](function(_0x3a5d0b){if(_0x3a5d0b){_0xb3c12b=_[_0x26c3('0x6c')](_0x3a5d0b,'id');var _0x23edd0;var _0x343fc7=squel[_0x26c3('0x6d')]();_0x343fc7['from'](_0x17a862[_0x26c3('0x6f')]);for(var _0x4a0bfa=0x0;_0x4a0bfa<_0x2a0099[_0x26c3('0x37')];_0x4a0bfa+=0x1){_0x23edd0=_0x2a0099[_0x4a0bfa]['MetricId']?_0xb3c12b[_0x2a0099[_0x4a0bfa][_0x26c3('0x8c')]]['metric']:_0x2a0099[_0x4a0bfa]['field'];_0x23edd0=_0x2a0099[_0x4a0bfa][_0x26c3('0x71')]?_[_0x26c3('0x72')](_0xd29299[_0x2a0099[_0x4a0bfa][_0x26c3('0x71')]],'%s',_0x23edd0):_0x23edd0;_0x23edd0=_0x2a0099[_0x4a0bfa][_0x26c3('0x73')]?_[_0x26c3('0x72')](_0x3d313d[_0x2a0099[_0x4a0bfa][_0x26c3('0x73')]],'%s',_0x23edd0):_0x23edd0;if(_0x2a0099[_0x4a0bfa]['groupBy']){_0x343fc7[_0x26c3('0x80')](_0x23edd0);}_0x2a0099[_0x4a0bfa][_0x26c3('0x75')]&&_0x343fc7[_0x26c3('0x3a')](_0x23edd0,_0x2a0099[_0x4a0bfa]['orderBy']===_0x26c3('0x76')?![]:!![]);_0x343fc7[_0x26c3('0x70')](_0x23edd0,_0x2a0099[_0x4a0bfa][_0x26c3('0x77')]||_0x23edd0);}if(_0x17a862[_0x26c3('0x78')]){_0x17a862[_0x26c3('0x78')]=JSON[_0x26c3('0x79')](_0x17a862[_0x26c3('0x78')]);for(var _0x5b201a=0x0;_0x5b201a<_0x17a862['joins'][_0x26c3('0x37')];_0x5b201a+=0x1){if(_0x17a862['joins'][_0x5b201a]['type']&&_[_0x26c3('0x7a')](_0x3bd6e0,_0x17a862[_0x26c3('0x78')][_0x5b201a][_0x26c3('0x30')])&&_0x17a862[_0x26c3('0x78')][_0x5b201a][_0x26c3('0x7b')]&&_0x17a862[_0x26c3('0x78')][_0x5b201a][_0x26c3('0x7c')]&&_0x17a862['joins'][_0x5b201a][_0x26c3('0x7d')]){_0x343fc7[_0x17a862['joins'][_0x5b201a][_0x26c3('0x30')]](_0x17a862[_0x26c3('0x78')][_0x5b201a]['foreignTable'],null,util[_0x26c3('0x73')](_0x26c3('0x7e'),_0x17a862[_0x26c3('0x6f')],_0x17a862[_0x26c3('0x78')][_0x5b201a][_0x26c3('0x7b')],_0x17a862[_0x26c3('0x78')][_0x5b201a][_0x26c3('0x7c')],_0x17a862[_0x26c3('0x78')][_0x5b201a][_0x26c3('0x7d')]));}}}if(_0x17a862[_0x26c3('0x7f')]){_0x17a862[_0x26c3('0x7f')]=JSON[_0x26c3('0x79')](_0x17a862[_0x26c3('0x7f')]);_0x343fc7['where'](_0x3cfffe(_0x17a862['conditions'][_0x26c3('0x80')]));}_0x1ffe7c=_0x343fc7[_0x26c3('0x8e')]();_0x343fc7['limit'](_0x220374);_0x343fc7[_0x26c3('0x1c')](0x0);logger[_0x26c3('0x81')](_0x26c3('0x82'),_0x343fc7[_0x26c3('0x83')]());return db[_0x26c3('0x84')]['query'](_0x343fc7['toString'](),{'type':db['sequelize'][_0x26c3('0x8f')][_0x26c3('0x85')]});}})['then'](function(){return{'sql':_0x1ffe7c['toString']()};})['then'](respondWithResult(_0x58a6fe,null))['catch'](handleError(_0x58a6fe,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 02ba5c1..09057d4 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 _0x5279=['../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x99b186,_0x1c58bf){var _0x1ba9f5=function(_0xe02465){while(--_0xe02465){_0x99b186['push'](_0x99b186['shift']());}};_0x1ba9f5(++_0x1c58bf);}(_0x5279,0xa1));var _0x9527=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x5279[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x9527('0x0'));var util=require(_0x9527('0x1'));var logger=require(_0x9527('0x2'))(_0x9527('0x3'));var moment=require(_0x9527('0x4'));var BPromise=require('bluebird');var rp=require(_0x9527('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9527('0x6'));var config=require(_0x9527('0x7'));var attributes=require(_0x9527('0x8'));module[_0x9527('0x9')]=function(_0x19bfa9,_0xbaac4f){return _0x19bfa9[_0x9527('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x9527('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b91=['moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x206aa9,_0xbeebd2){var _0x1237ec=function(_0x966df){while(--_0x966df){_0x206aa9['push'](_0x206aa9['shift']());}};_0x1237ec(++_0xbeebd2);}(_0x5b91,0x128));var _0x15b9=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x5b91[_0x1bb58c];return _0x277586;};'use strict';var _=require(_0x15b9('0x0'));var util=require(_0x15b9('0x1'));var logger=require(_0x15b9('0x2'))(_0x15b9('0x3'));var moment=require(_0x15b9('0x4'));var BPromise=require(_0x15b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x15b9('0x6'));var config=require(_0x15b9('0x7'));var attributes=require(_0x15b9('0x8'));module[_0x15b9('0x9')]=function(_0x49ebb3,_0x24009b){return _0x49ebb3['define'](_0x15b9('0xa'),attributes,{'tableName':_0x15b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 2d09255..a94b64d 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 _0x18e0=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x18e0,0xa2));var _0x018e=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x18e0[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var util=require(_0x018e('0x0'));var moment=require('moment');var BPromise=require(_0x018e('0x1'));var rs=require(_0x018e('0x2'));var fs=require('fs');var Redis=require(_0x018e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x018e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x018e('0x5'));var jayson=require(_0x018e('0x6'));var client=jayson[_0x018e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6638,_0x36aac8,_0x24e838){return new BPromise(function(_0x5b2267,_0xfc4a7b){return client[_0x018e('0x8')](_0x5b6638,_0x24e838)[_0x018e('0x9')](function(_0x3c1a1b){logger[_0x018e('0xa')](_0x018e('0xb'),_0x36aac8,'request\x20sent');logger[_0x018e('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x36aac8,'request\x20sent',JSON['stringify'](_0x3c1a1b));if(_0x3c1a1b[_0x018e('0xd')]){if(_0x3c1a1b[_0x018e('0xd')][_0x018e('0xe')]===0x1f4){logger[_0x018e('0xd')](_0x018e('0xb'),_0x36aac8,_0x3c1a1b[_0x018e('0xd')][_0x018e('0xf')]);return _0xfc4a7b(_0x3c1a1b[_0x018e('0xd')][_0x018e('0xf')]);}logger['error'](_0x018e('0xb'),_0x36aac8,_0x3c1a1b[_0x018e('0xd')][_0x018e('0xf')]);return _0x5b2267(_0x3c1a1b[_0x018e('0xd')][_0x018e('0xf')]);}else{logger['info'](_0x018e('0xb'),_0x36aac8,_0x018e('0x10'));_0x5b2267(_0x3c1a1b[_0x018e('0x11')][_0x018e('0xf')]);}})['catch'](function(_0x1949f4){logger[_0x018e('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x36aac8,_0x1949f4);_0xfc4a7b(_0x1949f4);});});}
\ No newline at end of file
+var _0x6146=['then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xeb3a3c,_0x1385db){var _0x206d22=function(_0x43494c){while(--_0x43494c){_0xeb3a3c['push'](_0xeb3a3c['shift']());}};_0x206d22(++_0x1385db);}(_0x6146,0xba));var _0x6614=function(_0x7815cd,_0x430226){_0x7815cd=_0x7815cd-0x0;var _0x3f47d5=_0x6146[_0x7815cd];return _0x3f47d5;};'use strict';var _=require(_0x6614('0x0'));var util=require('util');var moment=require(_0x6614('0x1'));var BPromise=require(_0x6614('0x2'));var rs=require(_0x6614('0x3'));var fs=require('fs');var Redis=require(_0x6614('0x4'));var db=require(_0x6614('0x5'))['db'];var utils=require(_0x6614('0x6'));var logger=require(_0x6614('0x7'))('rpc');var config=require(_0x6614('0x8'));var jayson=require(_0x6614('0x9'));var client=jayson[_0x6614('0xa')][_0x6614('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b158b,_0x2e84fa,_0x4116e4){return new BPromise(function(_0x209bdd,_0x9bf15){return client['request'](_0x3b158b,_0x4116e4)[_0x6614('0xc')](function(_0x267e1b){logger[_0x6614('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2e84fa,_0x6614('0xe'));logger[_0x6614('0xf')](_0x6614('0x10'),_0x2e84fa,_0x6614('0xe'),JSON[_0x6614('0x11')](_0x267e1b));if(_0x267e1b[_0x6614('0x12')]){if(_0x267e1b[_0x6614('0x12')]['code']===0x1f4){logger[_0x6614('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2e84fa,_0x267e1b[_0x6614('0x12')][_0x6614('0x13')]);return _0x9bf15(_0x267e1b[_0x6614('0x12')][_0x6614('0x13')]);}logger[_0x6614('0x12')](_0x6614('0x14'),_0x2e84fa,_0x267e1b[_0x6614('0x12')][_0x6614('0x13')]);return _0x209bdd(_0x267e1b[_0x6614('0x12')]['message']);}else{logger['info'](_0x6614('0x14'),_0x2e84fa,_0x6614('0xe'));_0x209bdd(_0x267e1b['result'][_0x6614('0x13')]);}})[_0x6614('0x15')](function(_0x3a0fee){logger['error'](_0x6614('0x14'),_0x2e84fa,_0x3a0fee);_0x9bf15(_0x3a0fee);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 080227e..70ecb6c 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 _0xb95f=['/:id/run','run','/:id/query','query','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb95f,0xc1));var _0xfb95=function(_0x498885,_0x4f50ab){_0x498885=_0x498885-0x0;var _0x17a28d=_0xb95f[_0x498885];return _0x17a28d;};'use strict';var multer=require(_0xfb95('0x0'));var util=require(_0xfb95('0x1'));var path=require('path');var timeout=require(_0xfb95('0x2'));var express=require(_0xfb95('0x3'));var router=express['Router']();var auth=require(_0xfb95('0x4'));var interaction=require(_0xfb95('0x5'));var config=require(_0xfb95('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xfb95('0x7')]('/',auth[_0xfb95('0x8')](),controller[_0xfb95('0x9')]);router[_0xfb95('0x7')](_0xfb95('0xa'),auth['isAuthenticated'](),controller[_0xfb95('0xb')]);router[_0xfb95('0x7')](_0xfb95('0xc'),auth[_0xfb95('0x8')](),controller[_0xfb95('0xd')]);router[_0xfb95('0x7')](_0xfb95('0xe'),auth[_0xfb95('0x8')](),controller[_0xfb95('0xf')]);router['get'](_0xfb95('0x10'),auth[_0xfb95('0x8')](),controller[_0xfb95('0x11')]);router['post']('/',auth[_0xfb95('0x8')](),controller[_0xfb95('0x12')]);router[_0xfb95('0x13')](_0xfb95('0xa'),auth[_0xfb95('0x8')](),controller[_0xfb95('0x14')]);router[_0xfb95('0x15')](_0xfb95('0xa'),auth[_0xfb95('0x8')](),controller['destroy']);module[_0xfb95('0x16')]=router;
\ No newline at end of file
+var _0x43c3=['/:id/query','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x5e069d,_0x55f592){var _0x21250a=function(_0x825db3){while(--_0x825db3){_0x5e069d['push'](_0x5e069d['shift']());}};_0x21250a(++_0x55f592);}(_0x43c3,0xa0));var _0x343c=function(_0x3cb1f8,_0x306d54){_0x3cb1f8=_0x3cb1f8-0x0;var _0x3bcb20=_0x43c3[_0x3cb1f8];return _0x3bcb20;};'use strict';var multer=require(_0x343c('0x0'));var util=require(_0x343c('0x1'));var path=require(_0x343c('0x2'));var timeout=require(_0x343c('0x3'));var express=require(_0x343c('0x4'));var router=express[_0x343c('0x5')]();var auth=require(_0x343c('0x6'));var interaction=require(_0x343c('0x7'));var config=require(_0x343c('0x8'));var controller=require(_0x343c('0x9'));router[_0x343c('0xa')]('/',auth[_0x343c('0xb')](),controller[_0x343c('0xc')]);router[_0x343c('0xa')](_0x343c('0xd'),auth['isAuthenticated'](),controller[_0x343c('0xe')]);router[_0x343c('0xa')](_0x343c('0xf'),auth[_0x343c('0xb')](),controller['preview']);router[_0x343c('0xa')]('/:id/run',auth[_0x343c('0xb')](),controller['run']);router[_0x343c('0xa')](_0x343c('0x10'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x343c('0xb')](),controller[_0x343c('0x11')]);router[_0x343c('0x12')](_0x343c('0xd'),auth[_0x343c('0xb')](),controller[_0x343c('0x13')]);router['delete'](_0x343c('0xd'),auth['isAuthenticated'](),controller[_0x343c('0x14')]);module[_0x343c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 73bee64..71d798f 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 _0x39dd=['INTEGER','UNSIGNED','sequelize','moment','ENUM','csv','xlsx','STRING','DATE','Loading','manual','scheduled'];(function(_0x1843f6,_0x90fe65){var _0x12c2e6=function(_0x18ce60){while(--_0x18ce60){_0x1843f6['push'](_0x1843f6['shift']());}};_0x12c2e6(++_0x90fe65);}(_0x39dd,0x1ca));var _0xd39d=function(_0x5a5595,_0x145fa0){_0x5a5595=_0x5a5595-0x0;var _0x43809d=_0x39dd[_0x5a5595];return _0x43809d;};'use strict';var Sequelize=require(_0xd39d('0x0'));var moment=require(_0xd39d('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd39d('0x2')](_0xd39d('0x3'),'pdf',_0xd39d('0x4')),'allowNull':![],'defaultValue':_0xd39d('0x3')},'savename':{'type':Sequelize[_0xd39d('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd39d('0x6')]},'endDate':{'type':Sequelize[_0xd39d('0x6')]},'status':{'type':Sequelize[_0xd39d('0x5')],'defaultValue':_0xd39d('0x7')},'type':{'type':Sequelize['ENUM'](_0xd39d('0x8'),_0xd39d('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xd39d('0xa')](0xb)[_0xd39d('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x113e=['moment','exports','STRING','pdf','xlsx','csv','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize'];(function(_0x3882ac,_0x42fe8e){var _0x170820=function(_0x5d76b6){while(--_0x5d76b6){_0x3882ac['push'](_0x3882ac['shift']());}};_0x170820(++_0x42fe8e);}(_0x113e,0x113));var _0xe113=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x113e[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0xe113('0x0'));var moment=require(_0xe113('0x1'));module[_0xe113('0x2')]={'name':{'type':Sequelize[_0xe113('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xe113('0x4'),_0xe113('0x5')),'allowNull':![],'defaultValue':_0xe113('0x6')},'savename':{'type':Sequelize[_0xe113('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe113('0x3')],'defaultValue':_0xe113('0x7')},'type':{'type':Sequelize[_0xe113('0x8')](_0xe113('0x9'),_0xe113('0xa')),'allowNull':![],'defaultValue':_0xe113('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xe113('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 196341a..922fef0 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 _0x3ad8=['order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','toLowerCase','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','get','ExtractedReports','UserProfileResource','destroy','then','stack','name','send','map','AnalyticExtractedReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x56ffb6,_0x27eab6){var _0x40b63=function(_0x201567){while(--_0x201567){_0x56ffb6['push'](_0x56ffb6['shift']());}};_0x40b63(++_0x27eab6);}(_0x3ad8,0x145));var _0x83ad=function(_0x193905,_0x4d9ac2){_0x193905=_0x193905-0x0;var _0x6c21cb=_0x3ad8[_0x193905];return _0x6c21cb;};'use strict';var pdf=require(_0x83ad('0x0'));var emlformat=require(_0x83ad('0x1'));var rimraf=require(_0x83ad('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83ad('0x3'));var rp=require('request-promise');var moment=require(_0x83ad('0x4'));var BPromise=require(_0x83ad('0x5'));var Mustache=require(_0x83ad('0x6'));var util=require('util');var path=require(_0x83ad('0x7'));var sox=require(_0x83ad('0x8'));var csv=require(_0x83ad('0x9'));var ejs=require(_0x83ad('0xa'));var fs=require('fs');var _=require(_0x83ad('0xb'));var squel=require('squel');var crypto=require(_0x83ad('0xc'));var jsforce=require(_0x83ad('0xd'));var deskjs=require(_0x83ad('0xe'));var toCsv=require(_0x83ad('0x9'));var querystring=require(_0x83ad('0xf'));var Papa=require(_0x83ad('0x10'));var Redis=require(_0x83ad('0x11'));var authService=require(_0x83ad('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83ad('0x13'));var logger=require(_0x83ad('0x14'))(_0x83ad('0x15'));var utils=require(_0x83ad('0x16'));var config=require(_0x83ad('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x83ad('0x18'))['db'];function respondWithStatusCode(_0x354068,_0x11aaf7){_0x11aaf7=_0x11aaf7||0xcc;return function(_0x1a346b){if(_0x1a346b){return _0x354068[_0x83ad('0x19')](_0x11aaf7);}return _0x354068['status'](_0x11aaf7)[_0x83ad('0x1a')]();};}function respondWithResult(_0x361a29,_0x400946){_0x400946=_0x400946||0xc8;return function(_0x353d48){if(_0x353d48){return _0x361a29[_0x83ad('0x1b')](_0x400946)[_0x83ad('0x1c')](_0x353d48);}};}function respondWithFilteredResult(_0x122756,_0x54939a){return function(_0x5c84ec){if(_0x5c84ec){var _0x338bcd=_0x5c84ec[_0x83ad('0x1d')],_0x378ce3=_0x54939a[_0x83ad('0x1e')],_0x2a5cc2=_0x54939a['offset']+_0x54939a[_0x83ad('0x1f')],_0x3f5396;if(_0x2a5cc2>=_0x338bcd){_0x2a5cc2=_0x338bcd;_0x3f5396=0xc8;}else{_0x3f5396=0xce;}_0x122756['status'](_0x3f5396);return _0x122756['set'](_0x83ad('0x20'),_0x378ce3+'-'+_0x2a5cc2+'/'+_0x338bcd)[_0x83ad('0x1c')](_0x5c84ec);}return null;};}function patchUpdates(_0x36d507){return function(_0xe96e56){try{jsonpatch['apply'](_0xe96e56,_0x36d507,!![]);}catch(_0x3509a8){return BPromise['reject'](_0x3509a8);}return _0xe96e56['save']();};}function saveUpdates(_0x3be3f5,_0x1e33fd){return function(_0x5ea63d){if(_0x5ea63d){return _0x5ea63d['update'](_0x3be3f5)['then'](function(_0x490a52){return _0x490a52;});}return null;};}function removeEntity(_0x54d1f0,_0x31ee7e){return function(_0x23654c){if(_0x23654c){return _0x23654c['destroy']()['then'](function(){var _0x55ce50=_0x23654c[_0x83ad('0x21')]({'plain':!![]});var _0x5662f0=_0x83ad('0x22');return db[_0x83ad('0x23')][_0x83ad('0x24')]({'where':{'type':_0x5662f0,'resourceId':_0x55ce50['id']}})[_0x83ad('0x25')](function(){return _0x23654c;});})[_0x83ad('0x25')](function(){_0x54d1f0[_0x83ad('0x1b')](0xcc)[_0x83ad('0x1a')]();});}};}function handleEntityNotFound(_0x41c85c,_0x25e453){return function(_0x21089d){if(!_0x21089d){_0x41c85c['sendStatus'](0x194);}return _0x21089d;};}function handleError(_0x28f421,_0x75cc12){_0x75cc12=_0x75cc12||0x1f4;return function(_0x2c8f21){logger['error'](_0x2c8f21[_0x83ad('0x26')]);if(_0x2c8f21['name']){delete _0x2c8f21[_0x83ad('0x27')];}_0x28f421[_0x83ad('0x1b')](_0x75cc12)[_0x83ad('0x28')](_0x2c8f21);};}exports['index']=function(_0x24245e,_0x5c9eda){var _0x1a9ffd={},_0xd396c5={},_0x274067={'count':0x0,'rows':[]};var _0x1cf0eb=_[_0x83ad('0x29')](db[_0x83ad('0x2a')]['rawAttributes'],function(_0x272ab){return{'name':_0x272ab[_0x83ad('0x2b')],'type':_0x272ab[_0x83ad('0x2c')]['key']};});_0xd396c5[_0x83ad('0x2d')]=_[_0x83ad('0x29')](_0x1cf0eb,'name');_0xd396c5[_0x83ad('0x2e')]=_[_0x83ad('0x2f')](_0x24245e['query']);_0xd396c5[_0x83ad('0x30')]=_['intersection'](_0xd396c5['model'],_0xd396c5[_0x83ad('0x2e')]);_0x1a9ffd[_0x83ad('0x31')]=_[_0x83ad('0x32')](_0xd396c5[_0x83ad('0x2d')],qs[_0x83ad('0x33')](_0x24245e['query']['fields']));_0x1a9ffd[_0x83ad('0x31')]=_0x1a9ffd[_0x83ad('0x31')][_0x83ad('0x34')]?_0x1a9ffd[_0x83ad('0x31')]:_0xd396c5[_0x83ad('0x2d')];if(!_0x24245e[_0x83ad('0x2e')][_0x83ad('0x35')](_0x83ad('0x36'))){_0x1a9ffd[_0x83ad('0x1f')]=qs['limit'](_0x24245e[_0x83ad('0x2e')][_0x83ad('0x1f')]);_0x1a9ffd[_0x83ad('0x1e')]=qs[_0x83ad('0x1e')](_0x24245e['query'][_0x83ad('0x1e')]);}_0x1a9ffd[_0x83ad('0x37')]=qs[_0x83ad('0x38')](_0x24245e[_0x83ad('0x2e')]['sort']);_0x1a9ffd[_0x83ad('0x39')]=qs['filters'](_[_0x83ad('0x3a')](_0x24245e[_0x83ad('0x2e')],_0xd396c5[_0x83ad('0x30')]),_0x1cf0eb);if(_0x24245e[_0x83ad('0x2e')][_0x83ad('0x3b')]){_0x1a9ffd[_0x83ad('0x39')]=_['merge'](_0x1a9ffd[_0x83ad('0x39')],{'$or':_['map'](_0x1cf0eb,function(_0x34c595){if(_0x34c595['type']!=='VIRTUAL'){var _0x318665={};_0x318665[_0x34c595[_0x83ad('0x27')]]={'$like':'%'+_0x24245e[_0x83ad('0x2e')][_0x83ad('0x3b')]+'%'};return _0x318665;}})});}_0x1a9ffd=_[_0x83ad('0x3c')]({},_0x1a9ffd,_0x24245e[_0x83ad('0x3d')]);var _0x1b6e0c={'where':_0x1a9ffd[_0x83ad('0x39')]};return db[_0x83ad('0x2a')][_0x83ad('0x1d')](_0x1b6e0c)[_0x83ad('0x25')](function(_0x2c556c){_0x274067[_0x83ad('0x1d')]=_0x2c556c;if(_0x24245e[_0x83ad('0x2e')][_0x83ad('0x3e')]){_0x1a9ffd[_0x83ad('0x3f')]=[{'all':!![]}];}return db[_0x83ad('0x2a')][_0x83ad('0x40')](_0x1a9ffd);})['then'](function(_0x468868){_0x274067[_0x83ad('0x41')]=_0x468868;return _0x274067;})[_0x83ad('0x25')](respondWithFilteredResult(_0x5c9eda,_0x1a9ffd))[_0x83ad('0x42')](handleError(_0x5c9eda,null));};exports['show']=function(_0x814e75,_0xff36b3){var _0x3de78f={'raw':!![],'where':{'id':_0x814e75['params']['id']}},_0x307ddd={};_0x307ddd[_0x83ad('0x2d')]=_[_0x83ad('0x2f')](db[_0x83ad('0x2a')][_0x83ad('0x43')]);_0x307ddd[_0x83ad('0x2e')]=_[_0x83ad('0x2f')](_0x814e75[_0x83ad('0x2e')]);_0x307ddd[_0x83ad('0x30')]=_[_0x83ad('0x32')](_0x307ddd[_0x83ad('0x2d')],_0x307ddd[_0x83ad('0x2e')]);_0x3de78f[_0x83ad('0x31')]=_[_0x83ad('0x32')](_0x307ddd['model'],qs[_0x83ad('0x33')](_0x814e75[_0x83ad('0x2e')][_0x83ad('0x33')]));_0x3de78f[_0x83ad('0x31')]=_0x3de78f['attributes'][_0x83ad('0x34')]?_0x3de78f['attributes']:_0x307ddd['model'];if(_0x814e75[_0x83ad('0x2e')][_0x83ad('0x3e')]){_0x3de78f[_0x83ad('0x3f')]=[{'all':!![]}];}_0x3de78f=_['merge']({},_0x3de78f,_0x814e75[_0x83ad('0x3d')]);return db[_0x83ad('0x2a')][_0x83ad('0x44')](_0x3de78f)[_0x83ad('0x25')](handleEntityNotFound(_0xff36b3,null))[_0x83ad('0x25')](respondWithResult(_0xff36b3,null))[_0x83ad('0x42')](handleError(_0xff36b3,null));};exports['create']=function(_0x10c93c,_0x1596e1){return db[_0x83ad('0x2a')][_0x83ad('0x45')](_0x10c93c[_0x83ad('0x46')],{})['then'](function(_0x45989d){var _0x1e7c0f=_0x10c93c[_0x83ad('0x47')][_0x83ad('0x21')]({'plain':!![]});if(!_0x1e7c0f)throw new Error(_0x83ad('0x48'));if(_0x1e7c0f[_0x83ad('0x49')]===_0x83ad('0x47')){var _0x7fb5b5=_0x45989d['get']({'plain':!![]});var _0x19e327=_0x83ad('0x22');return db[_0x83ad('0x4a')]['find']({'where':{'name':_0x19e327,'userProfileId':_0x1e7c0f[_0x83ad('0x4b')]},'raw':!![]})[_0x83ad('0x25')](function(_0x5be7dd){if(_0x5be7dd&&_0x5be7dd[_0x83ad('0x4c')]===0x0){return db[_0x83ad('0x23')][_0x83ad('0x45')]({'name':_0x7fb5b5[_0x83ad('0x27')],'resourceId':_0x7fb5b5['id'],'type':_0x5be7dd['name'],'sectionId':_0x5be7dd['id']},{})[_0x83ad('0x25')](function(){return _0x45989d;});}else{return _0x45989d;}})[_0x83ad('0x42')](function(_0x2d1e5b){logger[_0x83ad('0x4d')](_0x83ad('0x4e'),_0x2d1e5b);throw _0x2d1e5b;});}return _0x45989d;})[_0x83ad('0x25')](respondWithResult(_0x1596e1,0xc9))[_0x83ad('0x42')](handleError(_0x1596e1,null));};exports[_0x83ad('0x4f')]=function(_0x15a880,_0x432e83){if(_0x15a880[_0x83ad('0x46')]['id']){delete _0x15a880[_0x83ad('0x46')]['id'];}return db[_0x83ad('0x2a')][_0x83ad('0x44')]({'where':{'id':_0x15a880['params']['id']}})[_0x83ad('0x25')](handleEntityNotFound(_0x432e83,null))[_0x83ad('0x25')](saveUpdates(_0x15a880[_0x83ad('0x46')],null))['then'](respondWithResult(_0x432e83,null))[_0x83ad('0x42')](handleError(_0x432e83,null));};exports[_0x83ad('0x24')]=function(_0x3ec26b,_0x321531){return db[_0x83ad('0x2a')][_0x83ad('0x44')]({'where':{'id':_0x3ec26b[_0x83ad('0x50')]['id']}})['then'](handleEntityNotFound(_0x321531,null))[_0x83ad('0x25')](removeEntity(_0x321531,null))['catch'](handleError(_0x321531,null));};exports[_0x83ad('0x51')]=function(_0x4fc1ca,_0x34043e,_0x4454d3){return db[_0x83ad('0x2a')]['find']({'where':{'id':_0x4fc1ca[_0x83ad('0x50')]['id']},'attributes':[_0x83ad('0x27'),'basename',_0x83ad('0x52'),_0x83ad('0x53')],'raw':!![]})[_0x83ad('0x25')](handleEntityNotFound(_0x34043e,null))[_0x83ad('0x25')](function(_0x2e7e71){if(_0x2e7e71){if(!fs[_0x83ad('0x54')](path[_0x83ad('0x55')](config[_0x83ad('0x56')],_0x83ad('0x57'),_0x2e7e71['savename']))){throw new db['Sequelize'][(_0x83ad('0x58'))](_0x83ad('0x59'));}if(_0x4fc1ca[_0x83ad('0x2e')][_0x83ad('0x5a')]){return _0x34043e[_0x83ad('0x19')](0xc8);}return _0x34043e['download'](path[_0x83ad('0x55')](config['root'],_0x83ad('0x57'),_0x2e7e71[_0x83ad('0x52')]),util[_0x83ad('0x5b')](_0x83ad('0x5c'),_0x2e7e71[_0x83ad('0x5d')]||_0x2e7e71[_0x83ad('0x27')],_0x2e7e71['output'][_0x83ad('0x5e')]()));}})[_0x83ad('0x42')](handleError(_0x34043e,null));};
\ No newline at end of file
+var _0xf8b1=['then','destroy','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','server/files/reports','Sequelize','exists','root','format','%s.%s','basename','toLowerCase','html-pdf','rimraf','request-promise','bluebird','mustache','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x4ecd60,_0x142e11){var _0x29e598=function(_0x2478e0){while(--_0x2478e0){_0x4ecd60['push'](_0x4ecd60['shift']());}};_0x29e598(++_0x142e11);}(_0xf8b1,0x1ac));var _0x1f8b=function(_0x336dbd,_0x21b342){_0x336dbd=_0x336dbd-0x0;var _0x5bcb06=_0xf8b1[_0x336dbd];return _0x5bcb06;};'use strict';var pdf=require(_0x1f8b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1f8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1f8b('0x2'));var moment=require('moment');var BPromise=require(_0x1f8b('0x3'));var Mustache=require(_0x1f8b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1f8b('0x5'));var csv=require('to-csv');var ejs=require(_0x1f8b('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1f8b('0x7'));var jsforce=require(_0x1f8b('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x1f8b('0x9'));var querystring=require(_0x1f8b('0xa'));var Papa=require(_0x1f8b('0xb'));var Redis=require('ioredis');var authService=require(_0x1f8b('0xc'));var qs=require(_0x1f8b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f8b('0xe'));var logger=require('../../config/logger')(_0x1f8b('0xf'));var utils=require(_0x1f8b('0x10'));var config=require(_0x1f8b('0x11'));var licenseUtil=require(_0x1f8b('0x12'));var db=require(_0x1f8b('0x13'))['db'];function respondWithStatusCode(_0x36af5d,_0x3d39b1){_0x3d39b1=_0x3d39b1||0xcc;return function(_0x2a11f4){if(_0x2a11f4){return _0x36af5d[_0x1f8b('0x14')](_0x3d39b1);}return _0x36af5d[_0x1f8b('0x15')](_0x3d39b1)['end']();};}function respondWithResult(_0x57a6ef,_0x253f14){_0x253f14=_0x253f14||0xc8;return function(_0x1473fe){if(_0x1473fe){return _0x57a6ef[_0x1f8b('0x15')](_0x253f14)[_0x1f8b('0x16')](_0x1473fe);}};}function respondWithFilteredResult(_0x16a11d,_0x1bea01){return function(_0x53c0c9){if(_0x53c0c9){var _0x12d150=_0x53c0c9[_0x1f8b('0x17')],_0x58436b=_0x1bea01[_0x1f8b('0x18')],_0x51a05e=_0x1bea01[_0x1f8b('0x18')]+_0x1bea01[_0x1f8b('0x19')],_0x5cdd7d;if(_0x51a05e>=_0x12d150){_0x51a05e=_0x12d150;_0x5cdd7d=0xc8;}else{_0x5cdd7d=0xce;}_0x16a11d['status'](_0x5cdd7d);return _0x16a11d[_0x1f8b('0x1a')](_0x1f8b('0x1b'),_0x58436b+'-'+_0x51a05e+'/'+_0x12d150)[_0x1f8b('0x16')](_0x53c0c9);}return null;};}function patchUpdates(_0x2d7b19){return function(_0x58f68d){try{jsonpatch[_0x1f8b('0x1c')](_0x58f68d,_0x2d7b19,!![]);}catch(_0x24819a){return BPromise[_0x1f8b('0x1d')](_0x24819a);}return _0x58f68d[_0x1f8b('0x1e')]();};}function saveUpdates(_0x21bc20,_0x1c255a){return function(_0x39f937){if(_0x39f937){return _0x39f937[_0x1f8b('0x1f')](_0x21bc20)[_0x1f8b('0x20')](function(_0x32f3b4){return _0x32f3b4;});}return null;};}function removeEntity(_0x97c36b,_0x2ed10d){return function(_0x4973a5){if(_0x4973a5){return _0x4973a5[_0x1f8b('0x21')]()[_0x1f8b('0x20')](function(){var _0x3e719c=_0x4973a5['get']({'plain':!![]});var _0x5bde8='ExtractedReports';return db[_0x1f8b('0x22')][_0x1f8b('0x21')]({'where':{'type':_0x5bde8,'resourceId':_0x3e719c['id']}})[_0x1f8b('0x20')](function(){return _0x4973a5;});})[_0x1f8b('0x20')](function(){_0x97c36b[_0x1f8b('0x15')](0xcc)[_0x1f8b('0x23')]();});}};}function handleEntityNotFound(_0x15935b,_0xeb921){return function(_0x16539e){if(!_0x16539e){_0x15935b[_0x1f8b('0x14')](0x194);}return _0x16539e;};}function handleError(_0x215836,_0x5f4f8d){_0x5f4f8d=_0x5f4f8d||0x1f4;return function(_0x409f72){logger[_0x1f8b('0x24')](_0x409f72[_0x1f8b('0x25')]);if(_0x409f72[_0x1f8b('0x26')]){delete _0x409f72[_0x1f8b('0x26')];}_0x215836[_0x1f8b('0x15')](_0x5f4f8d)[_0x1f8b('0x27')](_0x409f72);};}exports[_0x1f8b('0x28')]=function(_0x127368,_0x4b04b9){var _0x5907ed={},_0x3ffb46={},_0x14130e={'count':0x0,'rows':[]};var _0x4a4304=_[_0x1f8b('0x29')](db[_0x1f8b('0x2a')][_0x1f8b('0x2b')],function(_0x4c749a){return{'name':_0x4c749a['fieldName'],'type':_0x4c749a[_0x1f8b('0x2c')][_0x1f8b('0x2d')]};});_0x3ffb46['model']=_['map'](_0x4a4304,_0x1f8b('0x26'));_0x3ffb46[_0x1f8b('0x2e')]=_[_0x1f8b('0x2f')](_0x127368[_0x1f8b('0x2e')]);_0x3ffb46[_0x1f8b('0x30')]=_[_0x1f8b('0x31')](_0x3ffb46[_0x1f8b('0x32')],_0x3ffb46['query']);_0x5907ed['attributes']=_[_0x1f8b('0x31')](_0x3ffb46['model'],qs[_0x1f8b('0x33')](_0x127368[_0x1f8b('0x2e')]['fields']));_0x5907ed[_0x1f8b('0x34')]=_0x5907ed[_0x1f8b('0x34')][_0x1f8b('0x35')]?_0x5907ed[_0x1f8b('0x34')]:_0x3ffb46[_0x1f8b('0x32')];if(!_0x127368[_0x1f8b('0x2e')][_0x1f8b('0x36')](_0x1f8b('0x37'))){_0x5907ed[_0x1f8b('0x19')]=qs[_0x1f8b('0x19')](_0x127368[_0x1f8b('0x2e')]['limit']);_0x5907ed[_0x1f8b('0x18')]=qs[_0x1f8b('0x18')](_0x127368[_0x1f8b('0x2e')][_0x1f8b('0x18')]);}_0x5907ed[_0x1f8b('0x38')]=qs['sort'](_0x127368[_0x1f8b('0x2e')][_0x1f8b('0x39')]);_0x5907ed[_0x1f8b('0x3a')]=qs[_0x1f8b('0x30')](_[_0x1f8b('0x3b')](_0x127368['query'],_0x3ffb46[_0x1f8b('0x30')]),_0x4a4304);if(_0x127368['query'][_0x1f8b('0x3c')]){_0x5907ed[_0x1f8b('0x3a')]=_[_0x1f8b('0x3d')](_0x5907ed['where'],{'$or':_['map'](_0x4a4304,function(_0x342508){if(_0x342508[_0x1f8b('0x2c')]!==_0x1f8b('0x3e')){var _0x2e831f={};_0x2e831f[_0x342508[_0x1f8b('0x26')]]={'$like':'%'+_0x127368[_0x1f8b('0x2e')][_0x1f8b('0x3c')]+'%'};return _0x2e831f;}})});}_0x5907ed=_[_0x1f8b('0x3d')]({},_0x5907ed,_0x127368[_0x1f8b('0x3f')]);var _0x258f33={'where':_0x5907ed[_0x1f8b('0x3a')]};return db[_0x1f8b('0x2a')][_0x1f8b('0x17')](_0x258f33)[_0x1f8b('0x20')](function(_0x188f61){_0x14130e[_0x1f8b('0x17')]=_0x188f61;if(_0x127368['query'][_0x1f8b('0x40')]){_0x5907ed[_0x1f8b('0x41')]=[{'all':!![]}];}return db[_0x1f8b('0x2a')]['findAll'](_0x5907ed);})['then'](function(_0x162642){_0x14130e[_0x1f8b('0x42')]=_0x162642;return _0x14130e;})[_0x1f8b('0x20')](respondWithFilteredResult(_0x4b04b9,_0x5907ed))[_0x1f8b('0x43')](handleError(_0x4b04b9,null));};exports[_0x1f8b('0x44')]=function(_0x28b43c,_0x236f39){var _0x4103c3={'raw':!![],'where':{'id':_0x28b43c[_0x1f8b('0x45')]['id']}},_0x277dc6={};_0x277dc6['model']=_[_0x1f8b('0x2f')](db['AnalyticExtractedReport'][_0x1f8b('0x2b')]);_0x277dc6[_0x1f8b('0x2e')]=_[_0x1f8b('0x2f')](_0x28b43c[_0x1f8b('0x2e')]);_0x277dc6[_0x1f8b('0x30')]=_[_0x1f8b('0x31')](_0x277dc6[_0x1f8b('0x32')],_0x277dc6['query']);_0x4103c3['attributes']=_[_0x1f8b('0x31')](_0x277dc6['model'],qs['fields'](_0x28b43c[_0x1f8b('0x2e')][_0x1f8b('0x33')]));_0x4103c3[_0x1f8b('0x34')]=_0x4103c3[_0x1f8b('0x34')]['length']?_0x4103c3[_0x1f8b('0x34')]:_0x277dc6['model'];if(_0x28b43c[_0x1f8b('0x2e')]['includeAll']){_0x4103c3['include']=[{'all':!![]}];}_0x4103c3=_[_0x1f8b('0x3d')]({},_0x4103c3,_0x28b43c[_0x1f8b('0x3f')]);return db[_0x1f8b('0x2a')]['find'](_0x4103c3)[_0x1f8b('0x20')](handleEntityNotFound(_0x236f39,null))[_0x1f8b('0x20')](respondWithResult(_0x236f39,null))[_0x1f8b('0x43')](handleError(_0x236f39,null));};exports[_0x1f8b('0x46')]=function(_0x4e9783,_0x58479e){return db['AnalyticExtractedReport'][_0x1f8b('0x46')](_0x4e9783[_0x1f8b('0x47')],{})['then'](function(_0x10d2ed){var _0x18fb2c=_0x4e9783[_0x1f8b('0x48')][_0x1f8b('0x49')]({'plain':!![]});if(!_0x18fb2c)throw new Error(_0x1f8b('0x4a'));if(_0x18fb2c[_0x1f8b('0x4b')]===_0x1f8b('0x48')){var _0x19b6ce=_0x10d2ed[_0x1f8b('0x49')]({'plain':!![]});var _0xfeb37a='ExtractedReports';return db['UserProfileSection'][_0x1f8b('0x4c')]({'where':{'name':_0xfeb37a,'userProfileId':_0x18fb2c['userProfileId']},'raw':!![]})['then'](function(_0x6fe73){if(_0x6fe73&&_0x6fe73[_0x1f8b('0x4d')]===0x0){return db[_0x1f8b('0x22')][_0x1f8b('0x46')]({'name':_0x19b6ce['name'],'resourceId':_0x19b6ce['id'],'type':_0x6fe73[_0x1f8b('0x26')],'sectionId':_0x6fe73['id']},{})[_0x1f8b('0x20')](function(){return _0x10d2ed;});}else{return _0x10d2ed;}})['catch'](function(_0x521d90){logger[_0x1f8b('0x24')](_0x1f8b('0x4e'),_0x521d90);throw _0x521d90;});}return _0x10d2ed;})['then'](respondWithResult(_0x58479e,0xc9))[_0x1f8b('0x43')](handleError(_0x58479e,null));};exports['update']=function(_0x4b9251,_0x29d7d4){if(_0x4b9251[_0x1f8b('0x47')]['id']){delete _0x4b9251[_0x1f8b('0x47')]['id'];}return db[_0x1f8b('0x2a')][_0x1f8b('0x4c')]({'where':{'id':_0x4b9251['params']['id']}})[_0x1f8b('0x20')](handleEntityNotFound(_0x29d7d4,null))['then'](saveUpdates(_0x4b9251[_0x1f8b('0x47')],null))[_0x1f8b('0x20')](respondWithResult(_0x29d7d4,null))[_0x1f8b('0x43')](handleError(_0x29d7d4,null));};exports[_0x1f8b('0x21')]=function(_0x5e7282,_0x331a52){return db[_0x1f8b('0x2a')][_0x1f8b('0x4c')]({'where':{'id':_0x5e7282[_0x1f8b('0x45')]['id']}})[_0x1f8b('0x20')](handleEntityNotFound(_0x331a52,null))[_0x1f8b('0x20')](removeEntity(_0x331a52,null))[_0x1f8b('0x43')](handleError(_0x331a52,null));};exports[_0x1f8b('0x4f')]=function(_0x409a53,_0x49d021,_0x35e378){return db[_0x1f8b('0x2a')][_0x1f8b('0x4c')]({'where':{'id':_0x409a53[_0x1f8b('0x45')]['id']},'attributes':['name','basename',_0x1f8b('0x50'),_0x1f8b('0x51')],'raw':!![]})[_0x1f8b('0x20')](handleEntityNotFound(_0x49d021,null))[_0x1f8b('0x20')](function(_0x1633f5){if(_0x1633f5){if(!fs[_0x1f8b('0x52')](path[_0x1f8b('0x53')](config['root'],_0x1f8b('0x54'),_0x1633f5[_0x1f8b('0x50')]))){throw new db[(_0x1f8b('0x55'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x409a53[_0x1f8b('0x2e')][_0x1f8b('0x56')]){return _0x49d021[_0x1f8b('0x14')](0xc8);}return _0x49d021[_0x1f8b('0x4f')](path['join'](config[_0x1f8b('0x57')],_0x1f8b('0x54'),_0x1633f5[_0x1f8b('0x50')]),util[_0x1f8b('0x58')](_0x1f8b('0x59'),_0x1633f5[_0x1f8b('0x5a')]||_0x1633f5['name'],_0x1633f5[_0x1f8b('0x51')][_0x1f8b('0x5b')]()));}})[_0x1f8b('0x43')](handleError(_0x49d021,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9a79641..e81628b 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 _0x4704=['analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','rimraf','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x4704,0x105));var _0x4470=function(_0x160182,_0x4cf21a){_0x160182=_0x160182-0x0;var _0x1c1e78=_0x4704[_0x160182];return _0x1c1e78;};'use strict';var _=require('lodash');var util=require(_0x4470('0x0'));var logger=require(_0x4470('0x1'))(_0x4470('0x2'));var moment=require(_0x4470('0x3'));var BPromise=require(_0x4470('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4470('0x5'));var config=require('../../config/environment');var attributes=require(_0x4470('0x6'));module[_0x4470('0x7')]=function(_0x43db1f,_0x2bbf76){return _0x43db1f['define'](_0x4470('0x8'),attributes,{'tableName':_0x4470('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a52=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x7a52,0x6e));var _0x27a5=function(_0xd97e8e,_0x48c229){_0xd97e8e=_0xd97e8e-0x0;var _0x16fe4d=_0x7a52[_0xd97e8e];return _0x16fe4d;};'use strict';var _=require(_0x27a5('0x0'));var util=require(_0x27a5('0x1'));var logger=require(_0x27a5('0x2'))('api');var moment=require(_0x27a5('0x3'));var BPromise=require(_0x27a5('0x4'));var rp=require(_0x27a5('0x5'));var fs=require('fs');var path=require(_0x27a5('0x6'));var rimraf=require('rimraf');var config=require(_0x27a5('0x7'));var attributes=require(_0x27a5('0x8'));module[_0x27a5('0x9')]=function(_0x35fb6e,_0x1f3cfe){return _0x35fb6e['define']('AnalyticExtractedReport',attributes,{'tableName':_0x27a5('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 2da02e0..d0df5f1 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 _0xef13=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xef13,0x1f4));var _0x3ef1=function(_0x38e656,_0x21bcb0){_0x38e656=_0x38e656-0x0;var _0x411375=_0xef13[_0x38e656];return _0x411375;};'use strict';var _=require(_0x3ef1('0x0'));var util=require(_0x3ef1('0x1'));var moment=require(_0x3ef1('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ef1('0x3'));var fs=require('fs');var Redis=require(_0x3ef1('0x4'));var db=require(_0x3ef1('0x5'))['db'];var utils=require(_0x3ef1('0x6'));var logger=require(_0x3ef1('0x7'))('rpc');var config=require(_0x3ef1('0x8'));var jayson=require(_0x3ef1('0x9'));var client=jayson[_0x3ef1('0xa')][_0x3ef1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2892e8,_0x1e9104,_0x284b04){return new BPromise(function(_0x5a4765,_0x793eb8){return client[_0x3ef1('0xc')](_0x2892e8,_0x284b04)['then'](function(_0x1a821e){logger[_0x3ef1('0xd')](_0x3ef1('0xe'),_0x1e9104,_0x3ef1('0xf'));logger[_0x3ef1('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1e9104,_0x3ef1('0xf'),JSON['stringify'](_0x1a821e));if(_0x1a821e[_0x3ef1('0x11')]){if(_0x1a821e[_0x3ef1('0x11')]['code']===0x1f4){logger['error'](_0x3ef1('0xe'),_0x1e9104,_0x1a821e[_0x3ef1('0x11')][_0x3ef1('0x12')]);return _0x793eb8(_0x1a821e[_0x3ef1('0x11')]['message']);}logger[_0x3ef1('0x11')](_0x3ef1('0xe'),_0x1e9104,_0x1a821e['error'][_0x3ef1('0x12')]);return _0x5a4765(_0x1a821e[_0x3ef1('0x11')]['message']);}else{logger[_0x3ef1('0xd')](_0x3ef1('0xe'),_0x1e9104,_0x3ef1('0xf'));_0x5a4765(_0x1a821e[_0x3ef1('0x13')][_0x3ef1('0x12')]);}})[_0x3ef1('0x14')](function(_0x285faa){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e9104,_0x285faa);_0x793eb8(_0x285faa);});});}
\ No newline at end of file
+var _0xb9e7=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1830ce,_0x305798){var _0x2bce9f=function(_0x9ea7dc){while(--_0x9ea7dc){_0x1830ce['push'](_0x1830ce['shift']());}};_0x2bce9f(++_0x305798);}(_0xb9e7,0xd7));var _0x7b9e=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xb9e7[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0x7b9e('0x0'));var util=require(_0x7b9e('0x1'));var moment=require(_0x7b9e('0x2'));var BPromise=require(_0x7b9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9e('0x5'));var logger=require(_0x7b9e('0x6'))(_0x7b9e('0x7'));var config=require(_0x7b9e('0x8'));var jayson=require(_0x7b9e('0x9'));var client=jayson[_0x7b9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14fc12,_0xd6298f,_0x434f65){return new BPromise(function(_0x37bd16,_0x2641e4){return client['request'](_0x14fc12,_0x434f65)[_0x7b9e('0xb')](function(_0x19e306){logger[_0x7b9e('0xc')](_0x7b9e('0xd'),_0xd6298f,_0x7b9e('0xe'));logger[_0x7b9e('0xf')](_0x7b9e('0x10'),_0xd6298f,'request\x20sent',JSON[_0x7b9e('0x11')](_0x19e306));if(_0x19e306[_0x7b9e('0x12')]){if(_0x19e306[_0x7b9e('0x12')][_0x7b9e('0x13')]===0x1f4){logger[_0x7b9e('0x12')](_0x7b9e('0xd'),_0xd6298f,_0x19e306[_0x7b9e('0x12')]['message']);return _0x2641e4(_0x19e306[_0x7b9e('0x12')]['message']);}logger['error'](_0x7b9e('0xd'),_0xd6298f,_0x19e306[_0x7b9e('0x12')][_0x7b9e('0x14')]);return _0x37bd16(_0x19e306['error']['message']);}else{logger['info'](_0x7b9e('0xd'),_0xd6298f,_0x7b9e('0xe'));_0x37bd16(_0x19e306[_0x7b9e('0x15')][_0x7b9e('0x14')]);}})[_0x7b9e('0x16')](function(_0xb031b4){logger[_0x7b9e('0x12')](_0x7b9e('0xd'),_0xd6298f,_0xb031b4);_0x2641e4(_0xb031b4);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a97441d..349b1ea 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 _0x6566=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','destroy','exports'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x6566,0x17a));var _0x6656=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x6566[_0x43f881];return _0x365c14;};'use strict';var multer=require(_0x6656('0x0'));var util=require(_0x6656('0x1'));var path=require(_0x6656('0x2'));var timeout=require('connect-timeout');var express=require(_0x6656('0x3'));var router=express['Router']();var auth=require(_0x6656('0x4'));var interaction=require(_0x6656('0x5'));var config=require('../../config/environment');var controller=require(_0x6656('0x6'));router[_0x6656('0x7')]('/',auth[_0x6656('0x8')](),controller[_0x6656('0x9')]);router[_0x6656('0x7')](_0x6656('0xa'),auth[_0x6656('0x8')](),controller['show']);router[_0x6656('0x7')](_0x6656('0xb'),auth[_0x6656('0x8')](),controller[_0x6656('0xc')]);router[_0x6656('0xd')]('/',auth[_0x6656('0x8')](),controller[_0x6656('0xe')]);router[_0x6656('0xf')](_0x6656('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6656('0xa'),auth[_0x6656('0x8')](),controller[_0x6656('0x10')]);module[_0x6656('0x11')]=router;
\ No newline at end of file
+var _0xf81b=['isAuthenticated','show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index'];(function(_0x574ff9,_0x4710e2){var _0x4e8d02=function(_0x183b82){while(--_0x183b82){_0x574ff9['push'](_0x574ff9['shift']());}};_0x4e8d02(++_0x4710e2);}(_0xf81b,0xdc));var _0xbf81=function(_0x3c24c0,_0x2d1815){_0x3c24c0=_0x3c24c0-0x0;var _0x45efa3=_0xf81b[_0x3c24c0];return _0x45efa3;};'use strict';var multer=require(_0xbf81('0x0'));var util=require('util');var path=require(_0xbf81('0x1'));var timeout=require(_0xbf81('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbf81('0x3'));var config=require(_0xbf81('0x4'));var controller=require(_0xbf81('0x5'));router[_0xbf81('0x6')]('/',auth['isAuthenticated'](),controller[_0xbf81('0x7')]);router[_0xbf81('0x6')]('/:id',auth[_0xbf81('0x8')](),controller[_0xbf81('0x9')]);router['get'](_0xbf81('0xa'),auth['isAuthenticated'](),controller[_0xbf81('0xb')]);router[_0xbf81('0xc')]('/',auth['isAuthenticated'](),controller[_0xbf81('0xd')]);router['put'](_0xbf81('0xe'),auth[_0xbf81('0x8')](),controller[_0xbf81('0xf')]);router[_0xbf81('0x10')](_0xbf81('0xe'),auth['isAuthenticated'](),controller[_0xbf81('0x11')]);module[_0xbf81('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 0d5f71a..1881b8b 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 _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x364154,_0x399863){var _0x413d88=function(_0xfca2c5){while(--_0xfca2c5){_0x364154['push'](_0x364154['shift']());}};_0x413d88(++_0x399863);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1261=['exports','TEXT','STRING','BOOLEAN'];(function(_0xa6e6bd,_0x333d97){var _0x499b54=function(_0x4ebd72){while(--_0x4ebd72){_0xa6e6bd['push'](_0xa6e6bd['shift']());}};_0x499b54(++_0x333d97);}(_0x1261,0x144));var _0x1126=function(_0x136a01,_0x3e0f10){_0x136a01=_0x136a01-0x0;var _0x39ccee=_0x1261[_0x136a01];return _0x39ccee;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'field':{'type':Sequelize[_0x1126('0x1')]},'alias':{'type':Sequelize[_0x1126('0x2')]},'function':{'type':Sequelize[_0x1126('0x2')]},'format':{'type':Sequelize[_0x1126('0x2')]},'groupBy':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1126('0x2')]},'custom':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index bf42168..60d124e 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 _0xe8db=['save','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','find','create','catch','bulkCreate','body','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8db,0x11b));var _0xbe8d=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0xe8db[_0x2534cf];return _0x221461;};'use strict';var pdf=require(_0xbe8d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbe8d('0x1'));var zipdir=require(_0xbe8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe8d('0x3'));var BPromise=require(_0xbe8d('0x4'));var Mustache=require(_0xbe8d('0x5'));var util=require(_0xbe8d('0x6'));var path=require('path');var sox=require(_0xbe8d('0x7'));var csv=require(_0xbe8d('0x8'));var ejs=require(_0xbe8d('0x9'));var fs=require('fs');var _=require(_0xbe8d('0xa'));var squel=require(_0xbe8d('0xb'));var crypto=require(_0xbe8d('0xc'));var jsforce=require(_0xbe8d('0xd'));var deskjs=require(_0xbe8d('0xe'));var toCsv=require(_0xbe8d('0x8'));var querystring=require(_0xbe8d('0xf'));var Papa=require(_0xbe8d('0x10'));var Redis=require(_0xbe8d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe8d('0x12'));var hardwareService=require(_0xbe8d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xbe8d('0x14'));var config=require(_0xbe8d('0x15'));var licenseUtil=require(_0xbe8d('0x16'));var db=require(_0xbe8d('0x17'))['db'];function respondWithStatusCode(_0x643e24,_0x2abfd2){_0x2abfd2=_0x2abfd2||0xcc;return function(_0x56d817){if(_0x56d817){return _0x643e24[_0xbe8d('0x18')](_0x2abfd2);}return _0x643e24[_0xbe8d('0x19')](_0x2abfd2)[_0xbe8d('0x1a')]();};}function respondWithResult(_0x46af8f,_0x4b2a53){_0x4b2a53=_0x4b2a53||0xc8;return function(_0x30f888){if(_0x30f888){return _0x46af8f['status'](_0x4b2a53)[_0xbe8d('0x1b')](_0x30f888);}};}function respondWithFilteredResult(_0x5a1cbe,_0x1ea737){return function(_0x2f76cd){if(_0x2f76cd){var _0x2ef458=_0x2f76cd[_0xbe8d('0x1c')],_0x54e3b7=_0x1ea737[_0xbe8d('0x1d')],_0xb7f1e6=_0x1ea737[_0xbe8d('0x1d')]+_0x1ea737[_0xbe8d('0x1e')],_0x4ffd06;if(_0xb7f1e6>=_0x2ef458){_0xb7f1e6=_0x2ef458;_0x4ffd06=0xc8;}else{_0x4ffd06=0xce;}_0x5a1cbe['status'](_0x4ffd06);return _0x5a1cbe[_0xbe8d('0x1f')]('Content-Range',_0x54e3b7+'-'+_0xb7f1e6+'/'+_0x2ef458)[_0xbe8d('0x1b')](_0x2f76cd);}return null;};}function patchUpdates(_0x1ae1ec){return function(_0x35962f){try{jsonpatch['apply'](_0x35962f,_0x1ae1ec,!![]);}catch(_0xace065){return BPromise[_0xbe8d('0x20')](_0xace065);}return _0x35962f[_0xbe8d('0x21')]();};}function saveUpdates(_0x582bbf,_0x3439be){return function(_0x2ceb71){if(_0x2ceb71){return _0x2ceb71[_0xbe8d('0x22')](_0x582bbf)[_0xbe8d('0x23')](function(_0x1e7bea){return _0x1e7bea;});}return null;};}function removeEntity(_0x1c4b5d,_0x351260){return function(_0x407b8f){if(_0x407b8f){return _0x407b8f[_0xbe8d('0x24')]()[_0xbe8d('0x23')](function(){_0x1c4b5d[_0xbe8d('0x19')](0xcc)[_0xbe8d('0x1a')]();});}};}function handleEntityNotFound(_0x387d66,_0x426967){return function(_0x33367e){if(!_0x33367e){_0x387d66['sendStatus'](0x194);}return _0x33367e;};}function handleError(_0x2d9a9f,_0x2fd4be){_0x2fd4be=_0x2fd4be||0x1f4;return function(_0x6fd421){logger['error'](_0x6fd421[_0xbe8d('0x25')]);if(_0x6fd421[_0xbe8d('0x26')]){delete _0x6fd421['name'];}_0x2d9a9f[_0xbe8d('0x19')](_0x2fd4be)[_0xbe8d('0x27')](_0x6fd421);};}exports[_0xbe8d('0x28')]=function(_0x33eeba,_0x4787bc){var _0x453b7c={},_0x33ddc4={},_0x13180c={'count':0x0,'rows':[]};var _0x31c0d8=_[_0xbe8d('0x29')](db[_0xbe8d('0x2a')][_0xbe8d('0x2b')],function(_0x41efde){return{'name':_0x41efde['fieldName'],'type':_0x41efde[_0xbe8d('0x2c')]['key']};});_0x33ddc4[_0xbe8d('0x2d')]=_[_0xbe8d('0x29')](_0x31c0d8,_0xbe8d('0x26'));_0x33ddc4[_0xbe8d('0x2e')]=_[_0xbe8d('0x2f')](_0x33eeba[_0xbe8d('0x2e')]);_0x33ddc4[_0xbe8d('0x30')]=_[_0xbe8d('0x31')](_0x33ddc4[_0xbe8d('0x2d')],_0x33ddc4[_0xbe8d('0x2e')]);_0x453b7c[_0xbe8d('0x32')]=_['intersection'](_0x33ddc4[_0xbe8d('0x2d')],qs[_0xbe8d('0x33')](_0x33eeba[_0xbe8d('0x2e')]['fields']));_0x453b7c[_0xbe8d('0x32')]=_0x453b7c['attributes'][_0xbe8d('0x34')]?_0x453b7c[_0xbe8d('0x32')]:_0x33ddc4[_0xbe8d('0x2d')];if(!_0x33eeba[_0xbe8d('0x2e')][_0xbe8d('0x35')](_0xbe8d('0x36'))){_0x453b7c[_0xbe8d('0x1e')]=qs[_0xbe8d('0x1e')](_0x33eeba[_0xbe8d('0x2e')]['limit']);_0x453b7c[_0xbe8d('0x1d')]=qs[_0xbe8d('0x1d')](_0x33eeba[_0xbe8d('0x2e')][_0xbe8d('0x1d')]);}_0x453b7c[_0xbe8d('0x37')]=qs[_0xbe8d('0x38')](_0x33eeba[_0xbe8d('0x2e')][_0xbe8d('0x38')]);_0x453b7c[_0xbe8d('0x39')]=qs[_0xbe8d('0x30')](_[_0xbe8d('0x3a')](_0x33eeba[_0xbe8d('0x2e')],_0x33ddc4[_0xbe8d('0x30')]),_0x31c0d8);if(_0x33eeba[_0xbe8d('0x2e')][_0xbe8d('0x3b')]){_0x453b7c['where']=_[_0xbe8d('0x3c')](_0x453b7c[_0xbe8d('0x39')],{'$or':_['map'](_0x31c0d8,function(_0x5cae45){if(_0x5cae45[_0xbe8d('0x2c')]!==_0xbe8d('0x3d')){var _0x354d0b={};_0x354d0b[_0x5cae45[_0xbe8d('0x26')]]={'$like':'%'+_0x33eeba[_0xbe8d('0x2e')][_0xbe8d('0x3b')]+'%'};return _0x354d0b;}})});}_0x453b7c=_[_0xbe8d('0x3c')]({},_0x453b7c,_0x33eeba[_0xbe8d('0x3e')]);var _0x2dfe36={'where':_0x453b7c[_0xbe8d('0x39')]};return db['AnalyticFieldReport'][_0xbe8d('0x1c')](_0x2dfe36)[_0xbe8d('0x23')](function(_0xb56ff1){_0x13180c[_0xbe8d('0x1c')]=_0xb56ff1;if(_0x33eeba[_0xbe8d('0x2e')]['includeAll']){_0x453b7c[_0xbe8d('0x3f')]=[{'all':!![]}];}return db[_0xbe8d('0x2a')][_0xbe8d('0x40')](_0x453b7c);})['then'](function(_0x2aa21b){_0x13180c[_0xbe8d('0x41')]=_0x2aa21b;return _0x13180c;})[_0xbe8d('0x23')](respondWithFilteredResult(_0x4787bc,_0x453b7c))['catch'](handleError(_0x4787bc,null));};exports['show']=function(_0x384047,_0x3fc6b3){var _0x28ff47={'raw':![],'where':{'id':_0x384047[_0xbe8d('0x42')]['id']}},_0x5dbf0e={};_0x5dbf0e[_0xbe8d('0x2d')]=_[_0xbe8d('0x2f')](db[_0xbe8d('0x2a')]['rawAttributes']);_0x5dbf0e[_0xbe8d('0x2e')]=_[_0xbe8d('0x2f')](_0x384047[_0xbe8d('0x2e')]);_0x5dbf0e[_0xbe8d('0x30')]=_[_0xbe8d('0x31')](_0x5dbf0e[_0xbe8d('0x2d')],_0x5dbf0e[_0xbe8d('0x2e')]);_0x28ff47[_0xbe8d('0x32')]=_[_0xbe8d('0x31')](_0x5dbf0e[_0xbe8d('0x2d')],qs[_0xbe8d('0x33')](_0x384047[_0xbe8d('0x2e')][_0xbe8d('0x33')]));_0x28ff47[_0xbe8d('0x32')]=_0x28ff47[_0xbe8d('0x32')][_0xbe8d('0x34')]?_0x28ff47[_0xbe8d('0x32')]:_0x5dbf0e[_0xbe8d('0x2d')];if(_0x384047[_0xbe8d('0x2e')]['includeAll']){_0x28ff47[_0xbe8d('0x3f')]=[{'all':!![]}];}_0x28ff47=_[_0xbe8d('0x3c')]({},_0x28ff47,_0x384047[_0xbe8d('0x3e')]);return db[_0xbe8d('0x2a')][_0xbe8d('0x43')](_0x28ff47)['then'](handleEntityNotFound(_0x3fc6b3,null))[_0xbe8d('0x23')](respondWithResult(_0x3fc6b3,null))['catch'](handleError(_0x3fc6b3,null));};exports['create']=function(_0x1f9589,_0xb52023){return db[_0xbe8d('0x2a')][_0xbe8d('0x44')](_0x1f9589['body'],{})[_0xbe8d('0x23')](respondWithResult(_0xb52023,0xc9))[_0xbe8d('0x45')](handleError(_0xb52023,null));};exports[_0xbe8d('0x46')]=function(_0x10e0ac,_0x143aff){return db[_0xbe8d('0x2a')][_0xbe8d('0x46')](_0x10e0ac[_0xbe8d('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x143aff,0xc9))[_0xbe8d('0x45')](handleError(_0x143aff,null));};exports[_0xbe8d('0x22')]=function(_0x383c57,_0xc26d10){if(_0x383c57[_0xbe8d('0x47')]['id']){delete _0x383c57['body']['id'];}return db[_0xbe8d('0x2a')][_0xbe8d('0x43')]({'where':{'id':_0x383c57[_0xbe8d('0x42')]['id']}})[_0xbe8d('0x23')](handleEntityNotFound(_0xc26d10,null))['then'](saveUpdates(_0x383c57['body'],null))[_0xbe8d('0x23')](respondWithResult(_0xc26d10,null))[_0xbe8d('0x45')](handleError(_0xc26d10,null));};exports['destroy']=function(_0x58b9f8,_0x5008bf){return db[_0xbe8d('0x2a')]['find']({'where':{'id':_0x58b9f8[_0xbe8d('0x42')]['id']}})[_0xbe8d('0x23')](handleEntityNotFound(_0x5008bf,null))[_0xbe8d('0x23')](removeEntity(_0x5008bf,null))[_0xbe8d('0x45')](handleError(_0x5008bf,null));};exports['bulkDestroy']=function(_0x37b16e,_0xe5c97e){return db[_0xbe8d('0x2a')][_0xbe8d('0x24')]({'where':{'id':_0x37b16e['query'][_0xbe8d('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xe5c97e,0xcc))['catch'](handleError(_0xe5c97e,null));};exports[_0xbe8d('0x49')]=function(_0x1d217b,_0x53b210,_0x3e86f3){return db[_0xbe8d('0x4a')][_0xbe8d('0x4b')]({'where':{'id':_0x1d217b[_0xbe8d('0x42')]['id']}})['then'](handleEntityNotFound(_0x53b210,null))[_0xbe8d('0x23')](function(_0x5da467){if(_0x5da467){return db[_0xbe8d('0x4c')][_0xbe8d('0x4d')](function(_0x1d5e09){return db[_0xbe8d('0x2a')][_0xbe8d('0x24')]({'where':{'CustomReportId':_0x1d217b[_0xbe8d('0x42')]['id']},'transaction':_0x1d5e09})[_0xbe8d('0x23')](function(_0x26b89a){var _0x207400=_['map'](_0x1d217b[_0xbe8d('0x47')],function(_0x505809){delete _0x505809['id'];_0x505809[_0xbe8d('0x4e')]=_0x1d217b[_0xbe8d('0x42')]['id'];return _0x505809;});return db[_0xbe8d('0x2a')][_0xbe8d('0x46')](_0x207400,{'transaction':_0x1d5e09});});})[_0xbe8d('0x23')](function(){return db[_0xbe8d('0x2a')][_0xbe8d('0x40')]({'where':{'CustomReportId':_0x1d217b['params']['id']}});});}})[_0xbe8d('0x23')](respondWithResult(_0x53b210,null))[_0xbe8d('0x45')](handleError(_0x53b210,null));};
\ No newline at end of file
+var _0x0e89=['end','json','count','offset','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x5196e1,_0x5466cd){var _0xaf48e9=function(_0x41d5d0){while(--_0x41d5d0){_0x5196e1['push'](_0x5196e1['shift']());}};_0xaf48e9(++_0x5466cd);}(_0x0e89,0xd6));var _0x90e8=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0e89[_0x465028];return _0xb783d4;};'use strict';var pdf=require(_0x90e8('0x0'));var emlformat=require(_0x90e8('0x1'));var rimraf=require(_0x90e8('0x2'));var zipdir=require(_0x90e8('0x3'));var jsonpatch=require(_0x90e8('0x4'));var rp=require(_0x90e8('0x5'));var moment=require(_0x90e8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x90e8('0x7'));var util=require(_0x90e8('0x8'));var path=require(_0x90e8('0x9'));var sox=require(_0x90e8('0xa'));var csv=require('to-csv');var ejs=require(_0x90e8('0xb'));var fs=require('fs');var _=require(_0x90e8('0xc'));var squel=require(_0x90e8('0xd'));var crypto=require(_0x90e8('0xe'));var jsforce=require(_0x90e8('0xf'));var deskjs=require(_0x90e8('0x10'));var toCsv=require(_0x90e8('0x11'));var querystring=require(_0x90e8('0x12'));var Papa=require(_0x90e8('0x13'));var Redis=require(_0x90e8('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x90e8('0x15'));var as=require(_0x90e8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x90e8('0x17'));var utils=require(_0x90e8('0x18'));var config=require(_0x90e8('0x19'));var licenseUtil=require(_0x90e8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36bfa2,_0x51e5b0){_0x51e5b0=_0x51e5b0||0xcc;return function(_0x3af949){if(_0x3af949){return _0x36bfa2[_0x90e8('0x1b')](_0x51e5b0);}return _0x36bfa2[_0x90e8('0x1c')](_0x51e5b0)[_0x90e8('0x1d')]();};}function respondWithResult(_0x3b0099,_0x5b04bd){_0x5b04bd=_0x5b04bd||0xc8;return function(_0x5e7ce4){if(_0x5e7ce4){return _0x3b0099[_0x90e8('0x1c')](_0x5b04bd)[_0x90e8('0x1e')](_0x5e7ce4);}};}function respondWithFilteredResult(_0x231aab,_0x84db3d){return function(_0x29efcd){if(_0x29efcd){var _0x2debfd=_0x29efcd[_0x90e8('0x1f')],_0x2acbd3=_0x84db3d['offset'],_0x37b593=_0x84db3d[_0x90e8('0x20')]+_0x84db3d[_0x90e8('0x21')],_0x4df8e2;if(_0x37b593>=_0x2debfd){_0x37b593=_0x2debfd;_0x4df8e2=0xc8;}else{_0x4df8e2=0xce;}_0x231aab[_0x90e8('0x1c')](_0x4df8e2);return _0x231aab['set'](_0x90e8('0x22'),_0x2acbd3+'-'+_0x37b593+'/'+_0x2debfd)[_0x90e8('0x1e')](_0x29efcd);}return null;};}function patchUpdates(_0x3f27f4){return function(_0x5a97b4){try{jsonpatch[_0x90e8('0x23')](_0x5a97b4,_0x3f27f4,!![]);}catch(_0x420eb7){return BPromise['reject'](_0x420eb7);}return _0x5a97b4['save']();};}function saveUpdates(_0x1f24df,_0x4ed1b9){return function(_0x5a18b5){if(_0x5a18b5){return _0x5a18b5[_0x90e8('0x24')](_0x1f24df)[_0x90e8('0x25')](function(_0x44e5d6){return _0x44e5d6;});}return null;};}function removeEntity(_0x260237,_0x4df4ea){return function(_0x2bab58){if(_0x2bab58){return _0x2bab58[_0x90e8('0x26')]()[_0x90e8('0x25')](function(){_0x260237[_0x90e8('0x1c')](0xcc)[_0x90e8('0x1d')]();});}};}function handleEntityNotFound(_0x326ac1,_0x171ffb){return function(_0x25a5f1){if(!_0x25a5f1){_0x326ac1[_0x90e8('0x1b')](0x194);}return _0x25a5f1;};}function handleError(_0x5d44d5,_0x32253c){_0x32253c=_0x32253c||0x1f4;return function(_0x47fe6a){logger[_0x90e8('0x27')](_0x47fe6a[_0x90e8('0x28')]);if(_0x47fe6a[_0x90e8('0x29')]){delete _0x47fe6a[_0x90e8('0x29')];}_0x5d44d5['status'](_0x32253c)[_0x90e8('0x2a')](_0x47fe6a);};}exports['index']=function(_0x53c9a3,_0x2f0d85){var _0x30c9a2={},_0x2ab78b={},_0xb9273e={'count':0x0,'rows':[]};var _0x42a6a5=_[_0x90e8('0x2b')](db[_0x90e8('0x2c')]['rawAttributes'],function(_0x67a26b){return{'name':_0x67a26b[_0x90e8('0x2d')],'type':_0x67a26b['type'][_0x90e8('0x2e')]};});_0x2ab78b[_0x90e8('0x2f')]=_[_0x90e8('0x2b')](_0x42a6a5,_0x90e8('0x29'));_0x2ab78b[_0x90e8('0x30')]=_[_0x90e8('0x31')](_0x53c9a3[_0x90e8('0x30')]);_0x2ab78b[_0x90e8('0x32')]=_[_0x90e8('0x33')](_0x2ab78b[_0x90e8('0x2f')],_0x2ab78b[_0x90e8('0x30')]);_0x30c9a2['attributes']=_[_0x90e8('0x33')](_0x2ab78b[_0x90e8('0x2f')],qs[_0x90e8('0x34')](_0x53c9a3['query']['fields']));_0x30c9a2[_0x90e8('0x35')]=_0x30c9a2[_0x90e8('0x35')][_0x90e8('0x36')]?_0x30c9a2[_0x90e8('0x35')]:_0x2ab78b[_0x90e8('0x2f')];if(!_0x53c9a3[_0x90e8('0x30')]['hasOwnProperty'](_0x90e8('0x37'))){_0x30c9a2[_0x90e8('0x21')]=qs['limit'](_0x53c9a3[_0x90e8('0x30')]['limit']);_0x30c9a2[_0x90e8('0x20')]=qs['offset'](_0x53c9a3[_0x90e8('0x30')][_0x90e8('0x20')]);}_0x30c9a2['order']=qs['sort'](_0x53c9a3['query'][_0x90e8('0x38')]);_0x30c9a2[_0x90e8('0x39')]=qs['filters'](_['pick'](_0x53c9a3[_0x90e8('0x30')],_0x2ab78b[_0x90e8('0x32')]),_0x42a6a5);if(_0x53c9a3[_0x90e8('0x30')][_0x90e8('0x3a')]){_0x30c9a2[_0x90e8('0x39')]=_[_0x90e8('0x3b')](_0x30c9a2[_0x90e8('0x39')],{'$or':_[_0x90e8('0x2b')](_0x42a6a5,function(_0x529c29){if(_0x529c29[_0x90e8('0x3c')]!==_0x90e8('0x3d')){var _0x4ffc33={};_0x4ffc33[_0x529c29[_0x90e8('0x29')]]={'$like':'%'+_0x53c9a3[_0x90e8('0x30')]['filter']+'%'};return _0x4ffc33;}})});}_0x30c9a2=_[_0x90e8('0x3b')]({},_0x30c9a2,_0x53c9a3[_0x90e8('0x3e')]);var _0x33643b={'where':_0x30c9a2['where']};return db[_0x90e8('0x2c')][_0x90e8('0x1f')](_0x33643b)['then'](function(_0x2d6ad6){_0xb9273e['count']=_0x2d6ad6;if(_0x53c9a3[_0x90e8('0x30')][_0x90e8('0x3f')]){_0x30c9a2[_0x90e8('0x40')]=[{'all':!![]}];}return db[_0x90e8('0x2c')][_0x90e8('0x41')](_0x30c9a2);})[_0x90e8('0x25')](function(_0x5a2d7b){_0xb9273e[_0x90e8('0x42')]=_0x5a2d7b;return _0xb9273e;})['then'](respondWithFilteredResult(_0x2f0d85,_0x30c9a2))[_0x90e8('0x43')](handleError(_0x2f0d85,null));};exports[_0x90e8('0x44')]=function(_0x1edd18,_0x506a7d){var _0x38addc={'raw':![],'where':{'id':_0x1edd18[_0x90e8('0x45')]['id']}},_0x3e0d94={};_0x3e0d94[_0x90e8('0x2f')]=_[_0x90e8('0x31')](db[_0x90e8('0x2c')][_0x90e8('0x46')]);_0x3e0d94[_0x90e8('0x30')]=_[_0x90e8('0x31')](_0x1edd18[_0x90e8('0x30')]);_0x3e0d94[_0x90e8('0x32')]=_['intersection'](_0x3e0d94[_0x90e8('0x2f')],_0x3e0d94[_0x90e8('0x30')]);_0x38addc[_0x90e8('0x35')]=_[_0x90e8('0x33')](_0x3e0d94[_0x90e8('0x2f')],qs[_0x90e8('0x34')](_0x1edd18[_0x90e8('0x30')][_0x90e8('0x34')]));_0x38addc[_0x90e8('0x35')]=_0x38addc[_0x90e8('0x35')][_0x90e8('0x36')]?_0x38addc[_0x90e8('0x35')]:_0x3e0d94[_0x90e8('0x2f')];if(_0x1edd18[_0x90e8('0x30')]['includeAll']){_0x38addc[_0x90e8('0x40')]=[{'all':!![]}];}_0x38addc=_[_0x90e8('0x3b')]({},_0x38addc,_0x1edd18[_0x90e8('0x3e')]);return db['AnalyticFieldReport']['find'](_0x38addc)['then'](handleEntityNotFound(_0x506a7d,null))[_0x90e8('0x25')](respondWithResult(_0x506a7d,null))[_0x90e8('0x43')](handleError(_0x506a7d,null));};exports[_0x90e8('0x47')]=function(_0x24792d,_0x4d9c5a){return db[_0x90e8('0x2c')][_0x90e8('0x47')](_0x24792d[_0x90e8('0x48')],{})[_0x90e8('0x25')](respondWithResult(_0x4d9c5a,0xc9))[_0x90e8('0x43')](handleError(_0x4d9c5a,null));};exports['bulkCreate']=function(_0x3598e0,_0x8316f7){return db['AnalyticFieldReport'][_0x90e8('0x49')](_0x3598e0[_0x90e8('0x48')],{'raw':![],'individualHooks':!![]})[_0x90e8('0x25')](respondWithResult(_0x8316f7,0xc9))[_0x90e8('0x43')](handleError(_0x8316f7,null));};exports[_0x90e8('0x24')]=function(_0x17a773,_0x5af8c4){if(_0x17a773[_0x90e8('0x48')]['id']){delete _0x17a773[_0x90e8('0x48')]['id'];}return db['AnalyticFieldReport'][_0x90e8('0x4a')]({'where':{'id':_0x17a773['params']['id']}})[_0x90e8('0x25')](handleEntityNotFound(_0x5af8c4,null))['then'](saveUpdates(_0x17a773['body'],null))[_0x90e8('0x25')](respondWithResult(_0x5af8c4,null))[_0x90e8('0x43')](handleError(_0x5af8c4,null));};exports[_0x90e8('0x26')]=function(_0x2b3a4f,_0x33f0d7){return db[_0x90e8('0x2c')][_0x90e8('0x4a')]({'where':{'id':_0x2b3a4f['params']['id']}})[_0x90e8('0x25')](handleEntityNotFound(_0x33f0d7,null))['then'](removeEntity(_0x33f0d7,null))['catch'](handleError(_0x33f0d7,null));};exports[_0x90e8('0x4b')]=function(_0x5612fa,_0x9c1de6){return db[_0x90e8('0x2c')][_0x90e8('0x26')]({'where':{'id':_0x5612fa[_0x90e8('0x30')][_0x90e8('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x90e8('0x25')](respondWithResult(_0x9c1de6,0xcc))[_0x90e8('0x43')](handleError(_0x9c1de6,null));};exports[_0x90e8('0x4d')]=function(_0xdf025b,_0xe4dd8a,_0x5ef11d){return db[_0x90e8('0x4e')][_0x90e8('0x4f')]({'where':{'id':_0xdf025b[_0x90e8('0x45')]['id']}})[_0x90e8('0x25')](handleEntityNotFound(_0xe4dd8a,null))[_0x90e8('0x25')](function(_0x58a40f){if(_0x58a40f){return db['sequelize'][_0x90e8('0x50')](function(_0x438730){return db[_0x90e8('0x2c')][_0x90e8('0x26')]({'where':{'CustomReportId':_0xdf025b[_0x90e8('0x45')]['id']},'transaction':_0x438730})[_0x90e8('0x25')](function(_0x3c0792){var _0x48afb4=_[_0x90e8('0x2b')](_0xdf025b['body'],function(_0x5e03a1){delete _0x5e03a1['id'];_0x5e03a1['CustomReportId']=_0xdf025b[_0x90e8('0x45')]['id'];return _0x5e03a1;});return db['AnalyticFieldReport'][_0x90e8('0x49')](_0x48afb4,{'transaction':_0x438730});});})[_0x90e8('0x25')](function(){return db['AnalyticFieldReport'][_0x90e8('0x41')]({'where':{'CustomReportId':_0xdf025b[_0x90e8('0x45')]['id']}});});}})[_0x90e8('0x25')](respondWithResult(_0xe4dd8a,null))['catch'](handleError(_0xe4dd8a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index fb58894..cdaa7a9 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 _0x8901=['path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x8901,0x8a));var _0x1890=function(_0x50499c,_0x188984){_0x50499c=_0x50499c-0x0;var _0xd422b3=_0x8901[_0x50499c];return _0xd422b3;};'use strict';var _=require(_0x1890('0x0'));var util=require(_0x1890('0x1'));var logger=require(_0x1890('0x2'))(_0x1890('0x3'));var moment=require(_0x1890('0x4'));var BPromise=require(_0x1890('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1890('0x6'));var rimraf=require(_0x1890('0x7'));var config=require('../../config/environment');var attributes=require(_0x1890('0x8'));module[_0x1890('0x9')]=function(_0x505f13,_0x5932da){return _0x505f13[_0x1890('0xa')](_0x1890('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x57db=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0x57db,0x110));var _0xb57d=function(_0x1f5510,_0x2688b5){_0x1f5510=_0x1f5510-0x0;var _0x3d486e=_0x57db[_0x1f5510];return _0x3d486e;};'use strict';var _=require(_0xb57d('0x0'));var util=require('util');var logger=require(_0xb57d('0x1'))('api');var moment=require(_0xb57d('0x2'));var BPromise=require(_0xb57d('0x3'));var rp=require(_0xb57d('0x4'));var fs=require('fs');var path=require(_0xb57d('0x5'));var rimraf=require('rimraf');var config=require(_0xb57d('0x6'));var attributes=require(_0xb57d('0x7'));module[_0xb57d('0x8')]=function(_0xa06f30,_0x445c4d){return _0xa06f30[_0xb57d('0x9')](_0xb57d('0xa'),attributes,{'tableName':_0xb57d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 99bc6fe..374bd55 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 _0x6acd=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0xb9da54,_0x17ac30){var _0x5b77b5=function(_0x1c1260){while(--_0x1c1260){_0xb9da54['push'](_0xb9da54['shift']());}};_0x5b77b5(++_0x17ac30);}(_0x6acd,0x1e3));var _0xd6ac=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6acd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd6ac('0x0'));var util=require('util');var moment=require(_0xd6ac('0x1'));var BPromise=require(_0xd6ac('0x2'));var rs=require(_0xd6ac('0x3'));var fs=require('fs');var Redis=require(_0xd6ac('0x4'));var db=require(_0xd6ac('0x5'))['db'];var utils=require(_0xd6ac('0x6'));var logger=require('../../config/logger')(_0xd6ac('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd6ac('0x8')][_0xd6ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c829,_0x454fc8,_0x5920a0){return new BPromise(function(_0x4d47e7,_0x228600){return client[_0xd6ac('0xa')](_0x28c829,_0x5920a0)['then'](function(_0x57adba){logger[_0xd6ac('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x454fc8,_0xd6ac('0xc'));logger[_0xd6ac('0xd')](_0xd6ac('0xe'),_0x454fc8,_0xd6ac('0xc'),JSON[_0xd6ac('0xf')](_0x57adba));if(_0x57adba[_0xd6ac('0x10')]){if(_0x57adba['error'][_0xd6ac('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x454fc8,_0x57adba[_0xd6ac('0x10')][_0xd6ac('0x12')]);return _0x228600(_0x57adba['error'][_0xd6ac('0x12')]);}logger[_0xd6ac('0x10')](_0xd6ac('0x13'),_0x454fc8,_0x57adba[_0xd6ac('0x10')][_0xd6ac('0x12')]);return _0x4d47e7(_0x57adba[_0xd6ac('0x10')]['message']);}else{logger[_0xd6ac('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x454fc8,'request\x20sent');_0x4d47e7(_0x57adba[_0xd6ac('0x14')][_0xd6ac('0x12')]);}})[_0xd6ac('0x15')](function(_0x49de6b){logger[_0xd6ac('0x10')](_0xd6ac('0x13'),_0x454fc8,_0x49de6b);_0x228600(_0x49de6b);});});}
\ No newline at end of file
+var _0x816d=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1be7fd,_0x51ff5a){var _0x2f7949=function(_0x1eb3ed){while(--_0x1eb3ed){_0x1be7fd['push'](_0x1be7fd['shift']());}};_0x2f7949(++_0x51ff5a);}(_0x816d,0x68));var _0xd816=function(_0xf239db,_0x2922eb){_0xf239db=_0xf239db-0x0;var _0x45491b=_0x816d[_0xf239db];return _0x45491b;};'use strict';var _=require(_0xd816('0x0'));var util=require(_0xd816('0x1'));var moment=require(_0xd816('0x2'));var BPromise=require(_0xd816('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd816('0x4'));var db=require(_0xd816('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd816('0x6'))(_0xd816('0x7'));var config=require(_0xd816('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd816('0x9')][_0xd816('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x112ac5,_0x48e137,_0x1a97f1){return new BPromise(function(_0x3df144,_0x180266){return client[_0xd816('0xb')](_0x112ac5,_0x1a97f1)[_0xd816('0xc')](function(_0x4b254c){logger[_0xd816('0xd')](_0xd816('0xe'),_0x48e137,_0xd816('0xf'));logger[_0xd816('0x10')](_0xd816('0x11'),_0x48e137,_0xd816('0xf'),JSON[_0xd816('0x12')](_0x4b254c));if(_0x4b254c[_0xd816('0x13')]){if(_0x4b254c['error'][_0xd816('0x14')]===0x1f4){logger[_0xd816('0x13')](_0xd816('0xe'),_0x48e137,_0x4b254c['error']['message']);return _0x180266(_0x4b254c[_0xd816('0x13')][_0xd816('0x15')]);}logger[_0xd816('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x48e137,_0x4b254c[_0xd816('0x13')][_0xd816('0x15')]);return _0x3df144(_0x4b254c['error'][_0xd816('0x15')]);}else{logger[_0xd816('0xd')](_0xd816('0xe'),_0x48e137,_0xd816('0xf'));_0x3df144(_0x4b254c[_0xd816('0x16')][_0xd816('0x15')]);}})['catch'](function(_0x2e0046){logger[_0xd816('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x48e137,_0x2e0046);_0x180266(_0x2e0046);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index e3c62c4..5eeded8 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 _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
+var _0x326f=['/:id','show','post','/create_many','bulkCreate','/:id/create_many','addFields','update','/destroy_many','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x326f,0xd1));var _0xf326=function(_0x27ca11,_0x29162e){_0x27ca11=_0x27ca11-0x0;var _0x566b90=_0x326f[_0x27ca11];return _0x566b90;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf326('0xe'),auth[_0xf326('0x9')](),controller[_0xf326('0xf')]);router[_0xf326('0xd')](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['put'](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x12')]);router['delete'](_0xf326('0x13'),auth[_0xf326('0x9')](),controller['bulkDestroy']);router[_0xf326('0x14')](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 4450a9a..77eafb6 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 _0x827a=['name','STRING','TEXT','sequelize'];(function(_0xced98a,_0x5cb79a){var _0x2055db=function(_0x7c4807){while(--_0x7c4807){_0xced98a['push'](_0xced98a['shift']());}};_0x2055db(++_0x5cb79a);}(_0x827a,0x167));var _0xa827=function(_0x3ca9b8,_0x5ceb5c){_0x3ca9b8=_0x3ca9b8-0x0;var _0xdd996b=_0x827a[_0x3ca9b8];return _0xdd996b;};'use strict';var Sequelize=require(_0xa827('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa827('0x1')},'table':{'type':Sequelize[_0xa827('0x2')]},'metric':{'type':Sequelize[_0xa827('0x3')]},'description':{'type':Sequelize[_0xa827('0x2')]}};
\ No newline at end of file
+var _0x74fd=['STRING','name','TEXT','sequelize'];(function(_0x13159d,_0x198700){var _0x41b180=function(_0x3681b0){while(--_0x3681b0){_0x13159d['push'](_0x13159d['shift']());}};_0x41b180(++_0x198700);}(_0x74fd,0x8f));var _0xd74f=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x74fd[_0xc0a3d3];return _0x3386e8;};'use strict';var Sequelize=require(_0xd74f('0x0'));module['exports']={'name':{'type':Sequelize[_0xd74f('0x1')],'allowNull':![],'unique':_0xd74f('0x2')},'table':{'type':Sequelize[_0xd74f('0x1')]},'metric':{'type':Sequelize[_0xd74f('0x3')]},'description':{'type':Sequelize[_0xd74f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 66396b5..3254bd8 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 _0xa5b0=['limit','set','Content-Range','json','reject','update','then','destroy','get','Metrics','end','sendStatus','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','query','keys','model','intersection','fields','attributes','length','order','sort','filters','where','merge','VIRTUAL','filter','count','include','findAll','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa5b0,0xcd));var _0x0a5b=function(_0x3cf7df,_0x43b053){_0x3cf7df=_0x3cf7df-0x0;var _0x52ca51=_0xa5b0[_0x3cf7df];return _0x52ca51;};'use strict';var pdf=require(_0x0a5b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0a5b('0x1'));var zipdir=require(_0x0a5b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a5b('0x3'));var moment=require(_0x0a5b('0x4'));var BPromise=require(_0x0a5b('0x5'));var Mustache=require(_0x0a5b('0x6'));var util=require(_0x0a5b('0x7'));var path=require(_0x0a5b('0x8'));var sox=require('sox');var csv=require(_0x0a5b('0x9'));var ejs=require(_0x0a5b('0xa'));var fs=require('fs');var _=require(_0x0a5b('0xb'));var squel=require('squel');var crypto=require(_0x0a5b('0xc'));var jsforce=require(_0x0a5b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0a5b('0x9'));var querystring=require(_0x0a5b('0xe'));var Papa=require(_0x0a5b('0xf'));var Redis=require('ioredis');var authService=require(_0x0a5b('0x10'));var qs=require(_0x0a5b('0x11'));var as=require(_0x0a5b('0x12'));var hardwareService=require(_0x0a5b('0x13'));var logger=require(_0x0a5b('0x14'))(_0x0a5b('0x15'));var utils=require('../../config/utils');var config=require(_0x0a5b('0x16'));var licenseUtil=require(_0x0a5b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44933c,_0x213ee7){_0x213ee7=_0x213ee7||0xcc;return function(_0x146072){if(_0x146072){return _0x44933c['sendStatus'](_0x213ee7);}return _0x44933c[_0x0a5b('0x18')](_0x213ee7)['end']();};}function respondWithResult(_0x5bd914,_0x311923){_0x311923=_0x311923||0xc8;return function(_0x12afe9){if(_0x12afe9){return _0x5bd914[_0x0a5b('0x18')](_0x311923)['json'](_0x12afe9);}};}function respondWithFilteredResult(_0x5d0fad,_0x395838){return function(_0x1204f5){if(_0x1204f5){var _0x4ec92b=_0x1204f5['count'],_0x4e1b41=_0x395838[_0x0a5b('0x19')],_0x1a97c9=_0x395838[_0x0a5b('0x19')]+_0x395838[_0x0a5b('0x1a')],_0x2630fb;if(_0x1a97c9>=_0x4ec92b){_0x1a97c9=_0x4ec92b;_0x2630fb=0xc8;}else{_0x2630fb=0xce;}_0x5d0fad['status'](_0x2630fb);return _0x5d0fad[_0x0a5b('0x1b')](_0x0a5b('0x1c'),_0x4e1b41+'-'+_0x1a97c9+'/'+_0x4ec92b)[_0x0a5b('0x1d')](_0x1204f5);}return null;};}function patchUpdates(_0x11987b){return function(_0x1e1398){try{jsonpatch['apply'](_0x1e1398,_0x11987b,!![]);}catch(_0x50ebe2){return BPromise[_0x0a5b('0x1e')](_0x50ebe2);}return _0x1e1398['save']();};}function saveUpdates(_0x1fe6b5,_0x4d3fd1){return function(_0x5df369){if(_0x5df369){return _0x5df369[_0x0a5b('0x1f')](_0x1fe6b5)[_0x0a5b('0x20')](function(_0x165ee2){return _0x165ee2;});}return null;};}function removeEntity(_0x192a90,_0x2c103e){return function(_0x433275){if(_0x433275){return _0x433275[_0x0a5b('0x21')]()[_0x0a5b('0x20')](function(){var _0x912d58=_0x433275[_0x0a5b('0x22')]({'plain':!![]});var _0x30906c=_0x0a5b('0x23');return db['UserProfileResource'][_0x0a5b('0x21')]({'where':{'type':_0x30906c,'resourceId':_0x912d58['id']}})['then'](function(){return _0x433275;});})[_0x0a5b('0x20')](function(){_0x192a90[_0x0a5b('0x18')](0xcc)[_0x0a5b('0x24')]();});}};}function handleEntityNotFound(_0x479871,_0x4066dd){return function(_0x3de486){if(!_0x3de486){_0x479871[_0x0a5b('0x25')](0x194);}return _0x3de486;};}function handleError(_0x2d9831,_0x49cd2d){_0x49cd2d=_0x49cd2d||0x1f4;return function(_0x12c1d5){logger[_0x0a5b('0x26')](_0x12c1d5[_0x0a5b('0x27')]);if(_0x12c1d5[_0x0a5b('0x28')]){delete _0x12c1d5[_0x0a5b('0x28')];}_0x2d9831['status'](_0x49cd2d)[_0x0a5b('0x29')](_0x12c1d5);};}exports[_0x0a5b('0x2a')]=function(_0x4df548,_0x878133){var _0x5c3ce0={},_0x3551b3={},_0x2e8ffc={'count':0x0,'rows':[]};var _0xbf79e3=_[_0x0a5b('0x2b')](db[_0x0a5b('0x2c')][_0x0a5b('0x2d')],function(_0x12a0d5){return{'name':_0x12a0d5[_0x0a5b('0x2e')],'type':_0x12a0d5[_0x0a5b('0x2f')]['key']};});_0x3551b3['model']=_[_0x0a5b('0x2b')](_0xbf79e3,_0x0a5b('0x28'));_0x3551b3[_0x0a5b('0x30')]=_[_0x0a5b('0x31')](_0x4df548[_0x0a5b('0x30')]);_0x3551b3['filters']=_['intersection'](_0x3551b3[_0x0a5b('0x32')],_0x3551b3['query']);_0x5c3ce0['attributes']=_[_0x0a5b('0x33')](_0x3551b3[_0x0a5b('0x32')],qs[_0x0a5b('0x34')](_0x4df548[_0x0a5b('0x30')]['fields']));_0x5c3ce0[_0x0a5b('0x35')]=_0x5c3ce0[_0x0a5b('0x35')][_0x0a5b('0x36')]?_0x5c3ce0[_0x0a5b('0x35')]:_0x3551b3[_0x0a5b('0x32')];if(!_0x4df548[_0x0a5b('0x30')]['hasOwnProperty']('nolimit')){_0x5c3ce0[_0x0a5b('0x1a')]=qs[_0x0a5b('0x1a')](_0x4df548[_0x0a5b('0x30')]['limit']);_0x5c3ce0[_0x0a5b('0x19')]=qs['offset'](_0x4df548[_0x0a5b('0x30')][_0x0a5b('0x19')]);}_0x5c3ce0[_0x0a5b('0x37')]=qs[_0x0a5b('0x38')](_0x4df548[_0x0a5b('0x30')]['sort']);_0x5c3ce0['where']=qs[_0x0a5b('0x39')](_['pick'](_0x4df548[_0x0a5b('0x30')],_0x3551b3[_0x0a5b('0x39')]),_0xbf79e3);if(_0x4df548[_0x0a5b('0x30')]['filter']){_0x5c3ce0[_0x0a5b('0x3a')]=_[_0x0a5b('0x3b')](_0x5c3ce0['where'],{'$or':_[_0x0a5b('0x2b')](_0xbf79e3,function(_0xfa035e){if(_0xfa035e['type']!==_0x0a5b('0x3c')){var _0x592f29={};_0x592f29[_0xfa035e[_0x0a5b('0x28')]]={'$like':'%'+_0x4df548[_0x0a5b('0x30')][_0x0a5b('0x3d')]+'%'};return _0x592f29;}})});}_0x5c3ce0=_[_0x0a5b('0x3b')]({},_0x5c3ce0,_0x4df548['options']);var _0x4202dd={'where':_0x5c3ce0[_0x0a5b('0x3a')]};return db[_0x0a5b('0x2c')][_0x0a5b('0x3e')](_0x4202dd)[_0x0a5b('0x20')](function(_0x3722f3){_0x2e8ffc[_0x0a5b('0x3e')]=_0x3722f3;if(_0x4df548[_0x0a5b('0x30')]['includeAll']){_0x5c3ce0[_0x0a5b('0x3f')]=[{'all':!![]}];}return db[_0x0a5b('0x2c')][_0x0a5b('0x40')](_0x5c3ce0);})[_0x0a5b('0x20')](function(_0x528478){_0x2e8ffc['rows']=_0x528478;return _0x2e8ffc;})[_0x0a5b('0x20')](respondWithFilteredResult(_0x878133,_0x5c3ce0))[_0x0a5b('0x41')](handleError(_0x878133,null));};exports[_0x0a5b('0x42')]=function(_0x550f0c,_0x5d4454){var _0x50e0ff={'raw':!![],'where':{'id':_0x550f0c[_0x0a5b('0x43')]['id']}},_0x5b8f48={};_0x5b8f48['model']=_[_0x0a5b('0x31')](db['AnalyticMetric'][_0x0a5b('0x2d')]);_0x5b8f48[_0x0a5b('0x30')]=_[_0x0a5b('0x31')](_0x550f0c[_0x0a5b('0x30')]);_0x5b8f48[_0x0a5b('0x39')]=_['intersection'](_0x5b8f48[_0x0a5b('0x32')],_0x5b8f48['query']);_0x50e0ff[_0x0a5b('0x35')]=_[_0x0a5b('0x33')](_0x5b8f48['model'],qs[_0x0a5b('0x34')](_0x550f0c[_0x0a5b('0x30')][_0x0a5b('0x34')]));_0x50e0ff[_0x0a5b('0x35')]=_0x50e0ff['attributes']['length']?_0x50e0ff[_0x0a5b('0x35')]:_0x5b8f48[_0x0a5b('0x32')];if(_0x550f0c[_0x0a5b('0x30')][_0x0a5b('0x44')]){_0x50e0ff[_0x0a5b('0x3f')]=[{'all':!![]}];}_0x50e0ff=_['merge']({},_0x50e0ff,_0x550f0c[_0x0a5b('0x45')]);return db['AnalyticMetric'][_0x0a5b('0x46')](_0x50e0ff)['then'](handleEntityNotFound(_0x5d4454,null))['then'](respondWithResult(_0x5d4454,null))[_0x0a5b('0x41')](handleError(_0x5d4454,null));};exports[_0x0a5b('0x47')]=function(_0x3abd30,_0x35ab80){return db[_0x0a5b('0x2c')][_0x0a5b('0x47')](_0x3abd30[_0x0a5b('0x48')],{})[_0x0a5b('0x20')](function(_0x28e437){var _0x1a906d=_0x3abd30[_0x0a5b('0x49')][_0x0a5b('0x22')]({'plain':!![]});if(!_0x1a906d)throw new Error(_0x0a5b('0x4a'));if(_0x1a906d['role']==='user'){var _0x10b126=_0x28e437['get']({'plain':!![]});var _0xd50996=_0x0a5b('0x23');return db[_0x0a5b('0x4b')][_0x0a5b('0x46')]({'where':{'name':_0xd50996,'userProfileId':_0x1a906d[_0x0a5b('0x4c')]},'raw':!![]})[_0x0a5b('0x20')](function(_0x4f5126){if(_0x4f5126&&_0x4f5126['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a5b('0x47')]({'name':_0x10b126[_0x0a5b('0x28')],'resourceId':_0x10b126['id'],'type':_0x4f5126[_0x0a5b('0x28')],'sectionId':_0x4f5126['id']},{})['then'](function(){return _0x28e437;});}else{return _0x28e437;}})['catch'](function(_0x506f1b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x506f1b);throw _0x506f1b;});}return _0x28e437;})['then'](respondWithResult(_0x35ab80,0xc9))[_0x0a5b('0x41')](handleError(_0x35ab80,null));};exports['update']=function(_0xfb14c2,_0x64a36d){if(_0xfb14c2[_0x0a5b('0x48')]['id']){delete _0xfb14c2[_0x0a5b('0x48')]['id'];}return db[_0x0a5b('0x2c')][_0x0a5b('0x46')]({'where':{'id':_0xfb14c2[_0x0a5b('0x43')]['id']}})['then'](handleEntityNotFound(_0x64a36d,null))[_0x0a5b('0x20')](saveUpdates(_0xfb14c2[_0x0a5b('0x48')],null))['then'](respondWithResult(_0x64a36d,null))[_0x0a5b('0x41')](handleError(_0x64a36d,null));};exports['destroy']=function(_0x10f7c5,_0xae9176){return db['AnalyticMetric']['find']({'where':{'id':_0x10f7c5['params']['id']}})[_0x0a5b('0x20')](handleEntityNotFound(_0xae9176,null))[_0x0a5b('0x20')](removeEntity(_0xae9176,null))[_0x0a5b('0x41')](handleError(_0xae9176,null));};
\ No newline at end of file
+var _0x74be=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','count','set','Content-Range','apply','reject','save','update','destroy','Metrics','then','error','stack','name','status','send','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','offset','sort','pick','merge','where','VIRTUAL','filter','AnalyticMetric','includeAll','include','findAll','rows','catch','show','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3ca1fa,_0x44c6b6){var _0x359b9a=function(_0x14dee6){while(--_0x14dee6){_0x3ca1fa['push'](_0x3ca1fa['shift']());}};_0x359b9a(++_0x44c6b6);}(_0x74be,0x8d));var _0xe74b=function(_0x3e1e81,_0x5516f7){_0x3e1e81=_0x3e1e81-0x0;var _0x53fe04=_0x74be[_0x3e1e81];return _0x53fe04;};'use strict';var pdf=require(_0xe74b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe74b('0x1'));var zipdir=require(_0xe74b('0x2'));var jsonpatch=require(_0xe74b('0x3'));var rp=require(_0xe74b('0x4'));var moment=require(_0xe74b('0x5'));var BPromise=require(_0xe74b('0x6'));var Mustache=require('mustache');var util=require(_0xe74b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe74b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe74b('0x9'));var squel=require(_0xe74b('0xa'));var crypto=require('crypto');var jsforce=require(_0xe74b('0xb'));var deskjs=require(_0xe74b('0xc'));var toCsv=require(_0xe74b('0x8'));var querystring=require(_0xe74b('0xd'));var Papa=require(_0xe74b('0xe'));var Redis=require('ioredis');var authService=require(_0xe74b('0xf'));var qs=require(_0xe74b('0x10'));var as=require(_0xe74b('0x11'));var hardwareService=require(_0xe74b('0x12'));var logger=require(_0xe74b('0x13'))(_0xe74b('0x14'));var utils=require(_0xe74b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe74b('0x16'));var db=require(_0xe74b('0x17'))['db'];function respondWithStatusCode(_0x4ccd66,_0x3ece67){_0x3ece67=_0x3ece67||0xcc;return function(_0x5356aa){if(_0x5356aa){return _0x4ccd66[_0xe74b('0x18')](_0x3ece67);}return _0x4ccd66['status'](_0x3ece67)[_0xe74b('0x19')]();};}function respondWithResult(_0x622867,_0x1bfb53){_0x1bfb53=_0x1bfb53||0xc8;return function(_0x4d50cc){if(_0x4d50cc){return _0x622867['status'](_0x1bfb53)[_0xe74b('0x1a')](_0x4d50cc);}};}function respondWithFilteredResult(_0x358e31,_0x5c31e1){return function(_0x626b84){if(_0x626b84){var _0x29f16a=_0x626b84[_0xe74b('0x1b')],_0x213c5d=_0x5c31e1['offset'],_0x491c30=_0x5c31e1['offset']+_0x5c31e1['limit'],_0x590baa;if(_0x491c30>=_0x29f16a){_0x491c30=_0x29f16a;_0x590baa=0xc8;}else{_0x590baa=0xce;}_0x358e31['status'](_0x590baa);return _0x358e31[_0xe74b('0x1c')](_0xe74b('0x1d'),_0x213c5d+'-'+_0x491c30+'/'+_0x29f16a)[_0xe74b('0x1a')](_0x626b84);}return null;};}function patchUpdates(_0xff5dd7){return function(_0xb2a2f5){try{jsonpatch[_0xe74b('0x1e')](_0xb2a2f5,_0xff5dd7,!![]);}catch(_0x3f7187){return BPromise[_0xe74b('0x1f')](_0x3f7187);}return _0xb2a2f5[_0xe74b('0x20')]();};}function saveUpdates(_0x49e1e4,_0x492788){return function(_0x315ba7){if(_0x315ba7){return _0x315ba7[_0xe74b('0x21')](_0x49e1e4)['then'](function(_0x4b357b){return _0x4b357b;});}return null;};}function removeEntity(_0x1de835,_0x519187){return function(_0x17df19){if(_0x17df19){return _0x17df19[_0xe74b('0x22')]()['then'](function(){var _0x58bd8a=_0x17df19['get']({'plain':!![]});var _0x5738e7=_0xe74b('0x23');return db['UserProfileResource'][_0xe74b('0x22')]({'where':{'type':_0x5738e7,'resourceId':_0x58bd8a['id']}})['then'](function(){return _0x17df19;});})[_0xe74b('0x24')](function(){_0x1de835['status'](0xcc)[_0xe74b('0x19')]();});}};}function handleEntityNotFound(_0x56bd65,_0xeb0182){return function(_0x3cbece){if(!_0x3cbece){_0x56bd65[_0xe74b('0x18')](0x194);}return _0x3cbece;};}function handleError(_0x5ae1c5,_0x3057fe){_0x3057fe=_0x3057fe||0x1f4;return function(_0x1a43b7){logger[_0xe74b('0x25')](_0x1a43b7[_0xe74b('0x26')]);if(_0x1a43b7[_0xe74b('0x27')]){delete _0x1a43b7['name'];}_0x5ae1c5[_0xe74b('0x28')](_0x3057fe)[_0xe74b('0x29')](_0x1a43b7);};}exports['index']=function(_0x3133e5,_0x4f675e){var _0x28c1ce={},_0x36652f={},_0x4cdca9={'count':0x0,'rows':[]};var _0x510486=_[_0xe74b('0x2a')](db['AnalyticMetric'][_0xe74b('0x2b')],function(_0x1c24da){return{'name':_0x1c24da['fieldName'],'type':_0x1c24da[_0xe74b('0x2c')]['key']};});_0x36652f['model']=_[_0xe74b('0x2a')](_0x510486,_0xe74b('0x27'));_0x36652f[_0xe74b('0x2d')]=_[_0xe74b('0x2e')](_0x3133e5['query']);_0x36652f[_0xe74b('0x2f')]=_[_0xe74b('0x30')](_0x36652f[_0xe74b('0x31')],_0x36652f[_0xe74b('0x2d')]);_0x28c1ce[_0xe74b('0x32')]=_[_0xe74b('0x30')](_0x36652f['model'],qs[_0xe74b('0x33')](_0x3133e5[_0xe74b('0x2d')][_0xe74b('0x33')]));_0x28c1ce[_0xe74b('0x32')]=_0x28c1ce['attributes'][_0xe74b('0x34')]?_0x28c1ce[_0xe74b('0x32')]:_0x36652f['model'];if(!_0x3133e5[_0xe74b('0x2d')]['hasOwnProperty'](_0xe74b('0x35'))){_0x28c1ce['limit']=qs[_0xe74b('0x36')](_0x3133e5['query'][_0xe74b('0x36')]);_0x28c1ce[_0xe74b('0x37')]=qs[_0xe74b('0x37')](_0x3133e5[_0xe74b('0x2d')][_0xe74b('0x37')]);}_0x28c1ce['order']=qs[_0xe74b('0x38')](_0x3133e5[_0xe74b('0x2d')][_0xe74b('0x38')]);_0x28c1ce['where']=qs['filters'](_[_0xe74b('0x39')](_0x3133e5[_0xe74b('0x2d')],_0x36652f['filters']),_0x510486);if(_0x3133e5[_0xe74b('0x2d')]['filter']){_0x28c1ce['where']=_[_0xe74b('0x3a')](_0x28c1ce[_0xe74b('0x3b')],{'$or':_[_0xe74b('0x2a')](_0x510486,function(_0x189f1f){if(_0x189f1f[_0xe74b('0x2c')]!==_0xe74b('0x3c')){var _0x330232={};_0x330232[_0x189f1f[_0xe74b('0x27')]]={'$like':'%'+_0x3133e5[_0xe74b('0x2d')][_0xe74b('0x3d')]+'%'};return _0x330232;}})});}_0x28c1ce=_[_0xe74b('0x3a')]({},_0x28c1ce,_0x3133e5['options']);var _0x271a80={'where':_0x28c1ce[_0xe74b('0x3b')]};return db[_0xe74b('0x3e')]['count'](_0x271a80)['then'](function(_0x1fec2c){_0x4cdca9[_0xe74b('0x1b')]=_0x1fec2c;if(_0x3133e5['query'][_0xe74b('0x3f')]){_0x28c1ce[_0xe74b('0x40')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xe74b('0x41')](_0x28c1ce);})['then'](function(_0x17b4c0){_0x4cdca9[_0xe74b('0x42')]=_0x17b4c0;return _0x4cdca9;})[_0xe74b('0x24')](respondWithFilteredResult(_0x4f675e,_0x28c1ce))[_0xe74b('0x43')](handleError(_0x4f675e,null));};exports[_0xe74b('0x44')]=function(_0x26c550,_0x51a0c3){var _0x3cafe5={'raw':!![],'where':{'id':_0x26c550['params']['id']}},_0x5d4340={};_0x5d4340[_0xe74b('0x31')]=_[_0xe74b('0x2e')](db['AnalyticMetric']['rawAttributes']);_0x5d4340[_0xe74b('0x2d')]=_['keys'](_0x26c550[_0xe74b('0x2d')]);_0x5d4340['filters']=_[_0xe74b('0x30')](_0x5d4340[_0xe74b('0x31')],_0x5d4340[_0xe74b('0x2d')]);_0x3cafe5[_0xe74b('0x32')]=_[_0xe74b('0x30')](_0x5d4340[_0xe74b('0x31')],qs[_0xe74b('0x33')](_0x26c550[_0xe74b('0x2d')][_0xe74b('0x33')]));_0x3cafe5[_0xe74b('0x32')]=_0x3cafe5[_0xe74b('0x32')][_0xe74b('0x34')]?_0x3cafe5[_0xe74b('0x32')]:_0x5d4340[_0xe74b('0x31')];if(_0x26c550[_0xe74b('0x2d')][_0xe74b('0x3f')]){_0x3cafe5[_0xe74b('0x40')]=[{'all':!![]}];}_0x3cafe5=_[_0xe74b('0x3a')]({},_0x3cafe5,_0x26c550[_0xe74b('0x45')]);return db['AnalyticMetric'][_0xe74b('0x46')](_0x3cafe5)[_0xe74b('0x24')](handleEntityNotFound(_0x51a0c3,null))['then'](respondWithResult(_0x51a0c3,null))[_0xe74b('0x43')](handleError(_0x51a0c3,null));};exports[_0xe74b('0x47')]=function(_0x203e4a,_0x251cd3){return db[_0xe74b('0x3e')][_0xe74b('0x47')](_0x203e4a['body'],{})[_0xe74b('0x24')](function(_0x53e516){var _0x597f14=_0x203e4a[_0xe74b('0x48')][_0xe74b('0x49')]({'plain':!![]});if(!_0x597f14)throw new Error(_0xe74b('0x4a'));if(_0x597f14[_0xe74b('0x4b')]===_0xe74b('0x48')){var _0x58ec19=_0x53e516['get']({'plain':!![]});var _0x287a01=_0xe74b('0x23');return db[_0xe74b('0x4c')]['find']({'where':{'name':_0x287a01,'userProfileId':_0x597f14[_0xe74b('0x4d')]},'raw':!![]})['then'](function(_0x26cb42){if(_0x26cb42&&_0x26cb42['autoAssociation']===0x0){return db[_0xe74b('0x4e')]['create']({'name':_0x58ec19[_0xe74b('0x27')],'resourceId':_0x58ec19['id'],'type':_0x26cb42[_0xe74b('0x27')],'sectionId':_0x26cb42['id']},{})['then'](function(){return _0x53e516;});}else{return _0x53e516;}})['catch'](function(_0x3d5a58){logger[_0xe74b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5a58);throw _0x3d5a58;});}return _0x53e516;})[_0xe74b('0x24')](respondWithResult(_0x251cd3,0xc9))[_0xe74b('0x43')](handleError(_0x251cd3,null));};exports[_0xe74b('0x21')]=function(_0x4d4fc5,_0x13a29e){if(_0x4d4fc5[_0xe74b('0x4f')]['id']){delete _0x4d4fc5[_0xe74b('0x4f')]['id'];}return db[_0xe74b('0x3e')][_0xe74b('0x46')]({'where':{'id':_0x4d4fc5['params']['id']}})['then'](handleEntityNotFound(_0x13a29e,null))[_0xe74b('0x24')](saveUpdates(_0x4d4fc5[_0xe74b('0x4f')],null))[_0xe74b('0x24')](respondWithResult(_0x13a29e,null))[_0xe74b('0x43')](handleError(_0x13a29e,null));};exports['destroy']=function(_0x100767,_0x20abf2){return db['AnalyticMetric'][_0xe74b('0x46')]({'where':{'id':_0x100767['params']['id']}})[_0xe74b('0x24')](handleEntityNotFound(_0x20abf2,null))[_0xe74b('0x24')](removeEntity(_0x20abf2,null))[_0xe74b('0x43')](handleError(_0x20abf2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 603a267..4ffa32b 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 _0x7527=['AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','request-promise','./analyticMetric.attributes','exports','define'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x7527,0x14c));var _0x7752=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7527[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7752('0x0'));var util=require('util');var logger=require(_0x7752('0x1'))(_0x7752('0x2'));var moment=require(_0x7752('0x3'));var BPromise=require('bluebird');var rp=require(_0x7752('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7752('0x5'));module[_0x7752('0x6')]=function(_0x72bf4b,_0x19cff8){return _0x72bf4b[_0x7752('0x7')](_0x7752('0x8'),attributes,{'tableName':_0x7752('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb467=['define','AnalyticMetric','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0x1be48a,_0x3a8218){var _0x31151d=function(_0x5caf01){while(--_0x5caf01){_0x1be48a['push'](_0x1be48a['shift']());}};_0x31151d(++_0x3a8218);}(_0xb467,0x66));var _0x7b46=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0xb467[_0x1ebe90];return _0x447c82;};'use strict';var _=require('lodash');var util=require(_0x7b46('0x0'));var logger=require(_0x7b46('0x1'))(_0x7b46('0x2'));var moment=require('moment');var BPromise=require(_0x7b46('0x3'));var rp=require(_0x7b46('0x4'));var fs=require('fs');var path=require(_0x7b46('0x5'));var rimraf=require('rimraf');var config=require(_0x7b46('0x6'));var attributes=require(_0x7b46('0x7'));module['exports']=function(_0x1933f1,_0x577d70){return _0x1933f1[_0x7b46('0x8')](_0x7b46('0x9'),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 c1028f4..3d0e8a3 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 _0xb22d=['message','request\x20sent','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xb22d,0x67));var _0xdb22=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0xb22d[_0x246227];return _0x37bd4a;};'use strict';var _=require(_0xdb22('0x0'));var util=require('util');var moment=require(_0xdb22('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb22('0x2'));var fs=require('fs');var Redis=require(_0xdb22('0x3'));var db=require(_0xdb22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb22('0x5'))(_0xdb22('0x6'));var config=require(_0xdb22('0x7'));var jayson=require(_0xdb22('0x8'));var client=jayson[_0xdb22('0x9')][_0xdb22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4386ce,_0x34a48c,_0x34e8bb){return new BPromise(function(_0xe758b5,_0x27239f){return client['request'](_0x4386ce,_0x34e8bb)['then'](function(_0x54ee8b){logger[_0xdb22('0xb')](_0xdb22('0xc'),_0x34a48c,'request\x20sent');logger[_0xdb22('0xd')](_0xdb22('0xe'),_0x34a48c,'request\x20sent',JSON['stringify'](_0x54ee8b));if(_0x54ee8b[_0xdb22('0xf')]){if(_0x54ee8b[_0xdb22('0xf')][_0xdb22('0x10')]===0x1f4){logger[_0xdb22('0xf')](_0xdb22('0xc'),_0x34a48c,_0x54ee8b[_0xdb22('0xf')][_0xdb22('0x11')]);return _0x27239f(_0x54ee8b[_0xdb22('0xf')][_0xdb22('0x11')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x34a48c,_0x54ee8b[_0xdb22('0xf')][_0xdb22('0x11')]);return _0xe758b5(_0x54ee8b['error'][_0xdb22('0x11')]);}else{logger[_0xdb22('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x34a48c,_0xdb22('0x12'));_0xe758b5(_0x54ee8b[_0xdb22('0x13')][_0xdb22('0x11')]);}})['catch'](function(_0x426a08){logger[_0xdb22('0xf')](_0xdb22('0xc'),_0x34a48c,_0x426a08);_0x27239f(_0x426a08);});});}
\ No newline at end of file
+var _0x2e9b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','moment'];(function(_0x44913c,_0x754aad){var _0x4b7ca2=function(_0x35345e){while(--_0x35345e){_0x44913c['push'](_0x44913c['shift']());}};_0x4b7ca2(++_0x754aad);}(_0x2e9b,0x179));var _0xb2e9=function(_0x373767,_0x3b3587){_0x373767=_0x373767-0x0;var _0xd808fb=_0x2e9b[_0x373767];return _0xd808fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb2e9('0x0'));var BPromise=require(_0xb2e9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2e9('0x2'));var db=require(_0xb2e9('0x3'))['db'];var utils=require(_0xb2e9('0x4'));var logger=require(_0xb2e9('0x5'))(_0xb2e9('0x6'));var config=require(_0xb2e9('0x7'));var jayson=require(_0xb2e9('0x8'));var client=jayson[_0xb2e9('0x9')][_0xb2e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12eb46,_0xb4bec,_0x418aa9){return new BPromise(function(_0x370d36,_0x194128){return client[_0xb2e9('0xb')](_0x12eb46,_0x418aa9)[_0xb2e9('0xc')](function(_0x304d52){logger[_0xb2e9('0xd')](_0xb2e9('0xe'),_0xb4bec,_0xb2e9('0xf'));logger[_0xb2e9('0x10')](_0xb2e9('0x11'),_0xb4bec,_0xb2e9('0xf'),JSON['stringify'](_0x304d52));if(_0x304d52['error']){if(_0x304d52['error']['code']===0x1f4){logger[_0xb2e9('0x12')](_0xb2e9('0xe'),_0xb4bec,_0x304d52[_0xb2e9('0x12')]['message']);return _0x194128(_0x304d52['error'][_0xb2e9('0x13')]);}logger[_0xb2e9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0xb4bec,_0x304d52[_0xb2e9('0x12')][_0xb2e9('0x13')]);return _0x370d36(_0x304d52[_0xb2e9('0x12')][_0xb2e9('0x13')]);}else{logger['info'](_0xb2e9('0xe'),_0xb4bec,_0xb2e9('0xf'));_0x370d36(_0x304d52[_0xb2e9('0x14')][_0xb2e9('0x13')]);}})['catch'](function(_0x2275f3){logger['error'](_0xb2e9('0xe'),_0xb4bec,_0x2275f3);_0x194128(_0x2275f3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 3d0f4c2..71eebdd 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 _0x7880=['Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x7880,0x1f4));var _0x0788=function(_0x8b9e62,_0x173b44){_0x8b9e62=_0x8b9e62-0x0;var _0x31a9a0=_0x7880[_0x8b9e62];return _0x31a9a0;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var auth=require(_0x0788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require(_0x0788('0x7'));router[_0x0788('0x8')]('/',auth[_0x0788('0x9')](),controller[_0x0788('0xa')]);router[_0x0788('0x8')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')]('/',auth['isAuthenticated'](),controller[_0x0788('0xe')]);router['put'](_0x0788('0xb'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router[_0x0788('0x10')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x2675=['post','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x191f98,_0x30dcf4){var _0x4bc96f=function(_0xc91b37){while(--_0xc91b37){_0x191f98['push'](_0x191f98['shift']());}};_0x4bc96f(++_0x30dcf4);}(_0x2675,0x75));var _0x5267=function(_0x56e75d,_0x1b2f85){_0x56e75d=_0x56e75d-0x0;var _0x380ca8=_0x2675[_0x56e75d];return _0x380ca8;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var controller=require('./analyticMetric.controller');router[_0x5267('0x5')]('/',auth[_0x5267('0x6')](),controller[_0x5267('0x7')]);router[_0x5267('0x5')](_0x5267('0x8'),auth[_0x5267('0x6')](),controller['show']);router[_0x5267('0x9')]('/',auth[_0x5267('0x6')](),controller['create']);router[_0x5267('0xa')]('/:id',auth[_0x5267('0x6')](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x6')](),controller['destroy']);module[_0x5267('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index e60c9fa..b850104 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 _0x0ccc=['exports'];(function(_0x1a31aa,_0x27f6eb){var _0xd1de65=function(_0x843f4e){while(--_0x843f4e){_0x1a31aa['push'](_0x1a31aa['shift']());}};_0xd1de65(++_0x27f6eb);}(_0x0ccc,0x19c));var _0xc0cc=function(_0x5c8a84,_0xfd6bba){_0x5c8a84=_0x5c8a84-0x0;var _0x276b31=_0x0ccc[_0x5c8a84];return _0x276b31;};'use strict';var Sequelize=require('sequelize');module[_0xc0cc('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x0437=['exports','TEXT'];(function(_0x1a1ef8,_0x275a0b){var _0x3da82e=function(_0x3558e0){while(--_0x3558e0){_0x1a1ef8['push'](_0x1a1ef8['shift']());}};_0x3da82e(++_0x275a0b);}(_0x0437,0x116));var _0x7043=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x0437[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require('sequelize');module[_0x7043('0x0')]={'tree':{'type':Sequelize[_0x7043('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index ae3a545..1c65bd4 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 _0xb1b4=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb1b4,0xde));var _0x4b1b=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0xb1b4[_0x49d19d];return _0x4ebef1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4b1b('0x0'));var rimraf=require(_0x4b1b('0x1'));var zipdir=require(_0x4b1b('0x2'));var jsonpatch=require(_0x4b1b('0x3'));var rp=require(_0x4b1b('0x4'));var moment=require(_0x4b1b('0x5'));var BPromise=require(_0x4b1b('0x6'));var Mustache=require(_0x4b1b('0x7'));var util=require(_0x4b1b('0x8'));var path=require(_0x4b1b('0x9'));var sox=require(_0x4b1b('0xa'));var csv=require(_0x4b1b('0xb'));var ejs=require(_0x4b1b('0xc'));var fs=require('fs');var _=require(_0x4b1b('0xd'));var squel=require('squel');var crypto=require(_0x4b1b('0xe'));var jsforce=require(_0x4b1b('0xf'));var deskjs=require(_0x4b1b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b1b('0x11'));var Redis=require(_0x4b1b('0x12'));var authService=require(_0x4b1b('0x13'));var qs=require(_0x4b1b('0x14'));var as=require(_0x4b1b('0x15'));var hardwareService=require(_0x4b1b('0x16'));var logger=require(_0x4b1b('0x17'))(_0x4b1b('0x18'));var utils=require(_0x4b1b('0x19'));var config=require(_0x4b1b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b1b('0x1b'))['db'];function respondWithStatusCode(_0x24b85e,_0x271719){_0x271719=_0x271719||0xcc;return function(_0x13930f){if(_0x13930f){return _0x24b85e['sendStatus'](_0x271719);}return _0x24b85e['status'](_0x271719)['end']();};}function respondWithResult(_0x24cf4a,_0x345935){_0x345935=_0x345935||0xc8;return function(_0x24acb6){if(_0x24acb6){return _0x24cf4a[_0x4b1b('0x1c')](_0x345935)[_0x4b1b('0x1d')](_0x24acb6);}};}function respondWithFilteredResult(_0xa1db4f,_0x13b359){return function(_0x3ae2c8){if(_0x3ae2c8){var _0x4e90bd=_0x3ae2c8['count'],_0x21f7d0=_0x13b359[_0x4b1b('0x1e')],_0x20648d=_0x13b359[_0x4b1b('0x1e')]+_0x13b359[_0x4b1b('0x1f')],_0x1e5bd4;if(_0x20648d>=_0x4e90bd){_0x20648d=_0x4e90bd;_0x1e5bd4=0xc8;}else{_0x1e5bd4=0xce;}_0xa1db4f[_0x4b1b('0x1c')](_0x1e5bd4);return _0xa1db4f[_0x4b1b('0x20')](_0x4b1b('0x21'),_0x21f7d0+'-'+_0x20648d+'/'+_0x4e90bd)[_0x4b1b('0x1d')](_0x3ae2c8);}return null;};}function patchUpdates(_0x5ee2b7){return function(_0x40d650){try{jsonpatch[_0x4b1b('0x22')](_0x40d650,_0x5ee2b7,!![]);}catch(_0x5923cf){return BPromise[_0x4b1b('0x23')](_0x5923cf);}return _0x40d650['save']();};}function saveUpdates(_0x2d91c5,_0x341b33){return function(_0x3d9fca){if(_0x3d9fca){return _0x3d9fca[_0x4b1b('0x24')](_0x2d91c5)[_0x4b1b('0x25')](function(_0x7d3d96){return _0x7d3d96;});}return null;};}function removeEntity(_0x4e43ba,_0x4e7f77){return function(_0x30c0df){if(_0x30c0df){return _0x30c0df[_0x4b1b('0x26')]()[_0x4b1b('0x25')](function(){_0x4e43ba['status'](0xcc)[_0x4b1b('0x27')]();});}};}function handleEntityNotFound(_0x2b18af,_0x23c538){return function(_0x3548ef){if(!_0x3548ef){_0x2b18af[_0x4b1b('0x28')](0x194);}return _0x3548ef;};}function handleError(_0xa4679d,_0x154300){_0x154300=_0x154300||0x1f4;return function(_0x981047){logger[_0x4b1b('0x29')](_0x981047[_0x4b1b('0x2a')]);if(_0x981047['name']){delete _0x981047[_0x4b1b('0x2b')];}_0xa4679d[_0x4b1b('0x1c')](_0x154300)[_0x4b1b('0x2c')](_0x981047);};}exports[_0x4b1b('0x2d')]=function(_0x599a60,_0x1a701e){var _0x479443={},_0x3cd954={},_0x77f585={'count':0x0,'rows':[]};var _0x55cae1=_[_0x4b1b('0x2e')](db[_0x4b1b('0x2f')][_0x4b1b('0x30')],function(_0x4c49d4){return{'name':_0x4c49d4[_0x4b1b('0x31')],'type':_0x4c49d4['type'][_0x4b1b('0x32')]};});_0x3cd954[_0x4b1b('0x33')]=_[_0x4b1b('0x2e')](_0x55cae1,_0x4b1b('0x2b'));_0x3cd954['query']=_[_0x4b1b('0x34')](_0x599a60['query']);_0x3cd954[_0x4b1b('0x35')]=_['intersection'](_0x3cd954['model'],_0x3cd954[_0x4b1b('0x36')]);_0x479443[_0x4b1b('0x37')]=_[_0x4b1b('0x38')](_0x3cd954[_0x4b1b('0x33')],qs[_0x4b1b('0x39')](_0x599a60[_0x4b1b('0x36')]['fields']));_0x479443[_0x4b1b('0x37')]=_0x479443[_0x4b1b('0x37')][_0x4b1b('0x3a')]?_0x479443['attributes']:_0x3cd954[_0x4b1b('0x33')];if(!_0x599a60[_0x4b1b('0x36')][_0x4b1b('0x3b')](_0x4b1b('0x3c'))){_0x479443[_0x4b1b('0x1f')]=qs[_0x4b1b('0x1f')](_0x599a60[_0x4b1b('0x36')][_0x4b1b('0x1f')]);_0x479443[_0x4b1b('0x1e')]=qs[_0x4b1b('0x1e')](_0x599a60[_0x4b1b('0x36')][_0x4b1b('0x1e')]);}_0x479443[_0x4b1b('0x3d')]=qs['sort'](_0x599a60[_0x4b1b('0x36')]['sort']);_0x479443['where']=qs[_0x4b1b('0x35')](_[_0x4b1b('0x3e')](_0x599a60[_0x4b1b('0x36')],_0x3cd954[_0x4b1b('0x35')]),_0x55cae1);if(_0x599a60['query'][_0x4b1b('0x3f')]){_0x479443['where']=_['merge'](_0x479443[_0x4b1b('0x40')],{'$or':_[_0x4b1b('0x2e')](_0x55cae1,function(_0x2d74df){if(_0x2d74df[_0x4b1b('0x41')]!==_0x4b1b('0x42')){var _0x35f53c={};_0x35f53c[_0x2d74df[_0x4b1b('0x2b')]]={'$like':'%'+_0x599a60[_0x4b1b('0x36')][_0x4b1b('0x3f')]+'%'};return _0x35f53c;}})});}_0x479443=_[_0x4b1b('0x43')]({},_0x479443,_0x599a60[_0x4b1b('0x44')]);var _0x43e7e1={'where':_0x479443[_0x4b1b('0x40')]};return db['AnalyticTreeReport'][_0x4b1b('0x45')](_0x43e7e1)['then'](function(_0x3faa56){_0x77f585[_0x4b1b('0x45')]=_0x3faa56;if(_0x599a60['query'][_0x4b1b('0x46')]){_0x479443[_0x4b1b('0x47')]=[{'all':!![]}];}return db[_0x4b1b('0x2f')]['findAll'](_0x479443);})[_0x4b1b('0x25')](function(_0x3a3406){_0x77f585[_0x4b1b('0x48')]=_0x3a3406;return _0x77f585;})[_0x4b1b('0x25')](respondWithFilteredResult(_0x1a701e,_0x479443))['catch'](handleError(_0x1a701e,null));};exports[_0x4b1b('0x49')]=function(_0x59c8bb,_0xda889e){var _0x4dacfe={'raw':!![],'where':{'id':_0x59c8bb[_0x4b1b('0x4a')]['id']}},_0x4fbc0f={};_0x4fbc0f[_0x4b1b('0x33')]=_[_0x4b1b('0x34')](db['AnalyticTreeReport'][_0x4b1b('0x30')]);_0x4fbc0f[_0x4b1b('0x36')]=_[_0x4b1b('0x34')](_0x59c8bb['query']);_0x4fbc0f[_0x4b1b('0x35')]=_[_0x4b1b('0x38')](_0x4fbc0f['model'],_0x4fbc0f[_0x4b1b('0x36')]);_0x4dacfe[_0x4b1b('0x37')]=_['intersection'](_0x4fbc0f[_0x4b1b('0x33')],qs[_0x4b1b('0x39')](_0x59c8bb[_0x4b1b('0x36')][_0x4b1b('0x39')]));_0x4dacfe[_0x4b1b('0x37')]=_0x4dacfe[_0x4b1b('0x37')]['length']?_0x4dacfe[_0x4b1b('0x37')]:_0x4fbc0f[_0x4b1b('0x33')];if(_0x59c8bb[_0x4b1b('0x36')][_0x4b1b('0x46')]){_0x4dacfe[_0x4b1b('0x47')]=[{'all':!![]}];}_0x4dacfe=_[_0x4b1b('0x43')]({},_0x4dacfe,_0x59c8bb['options']);return db[_0x4b1b('0x2f')][_0x4b1b('0x4b')](_0x4dacfe)[_0x4b1b('0x25')](handleEntityNotFound(_0xda889e,null))[_0x4b1b('0x25')](respondWithResult(_0xda889e,null))[_0x4b1b('0x4c')](handleError(_0xda889e,null));};exports[_0x4b1b('0x4d')]=function(_0x56aac7,_0x30e60e){return db[_0x4b1b('0x2f')][_0x4b1b('0x4d')](_0x56aac7['body'],{})[_0x4b1b('0x25')](respondWithResult(_0x30e60e,0xc9))[_0x4b1b('0x4c')](handleError(_0x30e60e,null));};exports[_0x4b1b('0x24')]=function(_0x402861,_0x4cc6bd){if(_0x402861[_0x4b1b('0x4e')]['id']){delete _0x402861[_0x4b1b('0x4e')]['id'];}return db[_0x4b1b('0x2f')][_0x4b1b('0x4b')]({'where':{'id':_0x402861['params']['id']}})['then'](handleEntityNotFound(_0x4cc6bd,null))[_0x4b1b('0x25')](saveUpdates(_0x402861[_0x4b1b('0x4e')],null))[_0x4b1b('0x25')](respondWithResult(_0x4cc6bd,null))[_0x4b1b('0x4c')](handleError(_0x4cc6bd,null));};exports[_0x4b1b('0x26')]=function(_0x202957,_0x5667a6){return db[_0x4b1b('0x2f')]['find']({'where':{'id':_0x202957['params']['id']}})[_0x4b1b('0x25')](handleEntityNotFound(_0x5667a6,null))[_0x4b1b('0x25')](removeEntity(_0x5667a6,null))[_0x4b1b('0x4c')](handleError(_0x5667a6,null));};
\ No newline at end of file
+var _0x6be6=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','AnalyticTreeReport','includeAll','include','rows','show','params','keys','options','find','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus'];(function(_0x103882,_0x185710){var _0x326fc7=function(_0x486a87){while(--_0x486a87){_0x103882['push'](_0x103882['shift']());}};_0x326fc7(++_0x185710);}(_0x6be6,0xfa));var _0x66be=function(_0x2dd10c,_0x2e3d35){_0x2dd10c=_0x2dd10c-0x0;var _0x27575e=_0x6be6[_0x2dd10c];return _0x27575e;};'use strict';var pdf=require(_0x66be('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x66be('0x1'));var zipdir=require(_0x66be('0x2'));var jsonpatch=require(_0x66be('0x3'));var rp=require(_0x66be('0x4'));var moment=require('moment');var BPromise=require(_0x66be('0x5'));var Mustache=require('mustache');var util=require(_0x66be('0x6'));var path=require(_0x66be('0x7'));var sox=require(_0x66be('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x66be('0x9'));var crypto=require(_0x66be('0xa'));var jsforce=require(_0x66be('0xb'));var deskjs=require(_0x66be('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x66be('0xd'));var Redis=require('ioredis');var authService=require(_0x66be('0xe'));var qs=require(_0x66be('0xf'));var as=require(_0x66be('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x66be('0x11'));var utils=require(_0x66be('0x12'));var config=require(_0x66be('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x66be('0x14'))['db'];function respondWithStatusCode(_0x2169b0,_0x49f353){_0x49f353=_0x49f353||0xcc;return function(_0x21f229){if(_0x21f229){return _0x2169b0['sendStatus'](_0x49f353);}return _0x2169b0[_0x66be('0x15')](_0x49f353)['end']();};}function respondWithResult(_0x4333b6,_0x3abd2d){_0x3abd2d=_0x3abd2d||0xc8;return function(_0x4e0513){if(_0x4e0513){return _0x4333b6[_0x66be('0x15')](_0x3abd2d)[_0x66be('0x16')](_0x4e0513);}};}function respondWithFilteredResult(_0x3761e1,_0x1061ed){return function(_0x3297f4){if(_0x3297f4){var _0x579537=_0x3297f4[_0x66be('0x17')],_0x3a8661=_0x1061ed['offset'],_0x1e503b=_0x1061ed[_0x66be('0x18')]+_0x1061ed['limit'],_0x20b0d5;if(_0x1e503b>=_0x579537){_0x1e503b=_0x579537;_0x20b0d5=0xc8;}else{_0x20b0d5=0xce;}_0x3761e1[_0x66be('0x15')](_0x20b0d5);return _0x3761e1[_0x66be('0x19')](_0x66be('0x1a'),_0x3a8661+'-'+_0x1e503b+'/'+_0x579537)[_0x66be('0x16')](_0x3297f4);}return null;};}function patchUpdates(_0x3f0942){return function(_0x5b875e){try{jsonpatch['apply'](_0x5b875e,_0x3f0942,!![]);}catch(_0x53f123){return BPromise[_0x66be('0x1b')](_0x53f123);}return _0x5b875e[_0x66be('0x1c')]();};}function saveUpdates(_0x3681cf,_0x42aafc){return function(_0x34f67c){if(_0x34f67c){return _0x34f67c[_0x66be('0x1d')](_0x3681cf)[_0x66be('0x1e')](function(_0x51696a){return _0x51696a;});}return null;};}function removeEntity(_0x2c3625,_0x424595){return function(_0x358196){if(_0x358196){return _0x358196[_0x66be('0x1f')]()[_0x66be('0x1e')](function(){_0x2c3625[_0x66be('0x15')](0xcc)[_0x66be('0x20')]();});}};}function handleEntityNotFound(_0x304959,_0x189053){return function(_0x1f6e42){if(!_0x1f6e42){_0x304959[_0x66be('0x21')](0x194);}return _0x1f6e42;};}function handleError(_0x3f1dad,_0x3baab5){_0x3baab5=_0x3baab5||0x1f4;return function(_0x154b72){logger[_0x66be('0x22')](_0x154b72[_0x66be('0x23')]);if(_0x154b72[_0x66be('0x24')]){delete _0x154b72[_0x66be('0x24')];}_0x3f1dad[_0x66be('0x15')](_0x3baab5)[_0x66be('0x25')](_0x154b72);};}exports[_0x66be('0x26')]=function(_0x14ef53,_0x17655d){var _0x29249a={},_0x33e782={},_0x19d82a={'count':0x0,'rows':[]};var _0x421c52=_[_0x66be('0x27')](db['AnalyticTreeReport'][_0x66be('0x28')],function(_0x442a58){return{'name':_0x442a58[_0x66be('0x29')],'type':_0x442a58[_0x66be('0x2a')][_0x66be('0x2b')]};});_0x33e782[_0x66be('0x2c')]=_['map'](_0x421c52,'name');_0x33e782['query']=_['keys'](_0x14ef53[_0x66be('0x2d')]);_0x33e782[_0x66be('0x2e')]=_[_0x66be('0x2f')](_0x33e782['model'],_0x33e782[_0x66be('0x2d')]);_0x29249a[_0x66be('0x30')]=_[_0x66be('0x2f')](_0x33e782[_0x66be('0x2c')],qs[_0x66be('0x31')](_0x14ef53[_0x66be('0x2d')][_0x66be('0x31')]));_0x29249a[_0x66be('0x30')]=_0x29249a[_0x66be('0x30')][_0x66be('0x32')]?_0x29249a['attributes']:_0x33e782[_0x66be('0x2c')];if(!_0x14ef53[_0x66be('0x2d')]['hasOwnProperty'](_0x66be('0x33'))){_0x29249a['limit']=qs[_0x66be('0x34')](_0x14ef53[_0x66be('0x2d')][_0x66be('0x34')]);_0x29249a[_0x66be('0x18')]=qs[_0x66be('0x18')](_0x14ef53[_0x66be('0x2d')][_0x66be('0x18')]);}_0x29249a[_0x66be('0x35')]=qs[_0x66be('0x36')](_0x14ef53[_0x66be('0x2d')][_0x66be('0x36')]);_0x29249a[_0x66be('0x37')]=qs['filters'](_['pick'](_0x14ef53[_0x66be('0x2d')],_0x33e782['filters']),_0x421c52);if(_0x14ef53[_0x66be('0x2d')][_0x66be('0x38')]){_0x29249a['where']=_['merge'](_0x29249a[_0x66be('0x37')],{'$or':_[_0x66be('0x27')](_0x421c52,function(_0x1c2d88){if(_0x1c2d88[_0x66be('0x2a')]!==_0x66be('0x39')){var _0x4ce9a9={};_0x4ce9a9[_0x1c2d88[_0x66be('0x24')]]={'$like':'%'+_0x14ef53[_0x66be('0x2d')]['filter']+'%'};return _0x4ce9a9;}})});}_0x29249a=_[_0x66be('0x3a')]({},_0x29249a,_0x14ef53['options']);var _0x52fa68={'where':_0x29249a[_0x66be('0x37')]};return db[_0x66be('0x3b')][_0x66be('0x17')](_0x52fa68)[_0x66be('0x1e')](function(_0x19b53){_0x19d82a[_0x66be('0x17')]=_0x19b53;if(_0x14ef53[_0x66be('0x2d')][_0x66be('0x3c')]){_0x29249a[_0x66be('0x3d')]=[{'all':!![]}];}return db[_0x66be('0x3b')]['findAll'](_0x29249a);})[_0x66be('0x1e')](function(_0x3c1b7e){_0x19d82a[_0x66be('0x3e')]=_0x3c1b7e;return _0x19d82a;})['then'](respondWithFilteredResult(_0x17655d,_0x29249a))['catch'](handleError(_0x17655d,null));};exports[_0x66be('0x3f')]=function(_0x57139c,_0x129741){var _0x432418={'raw':!![],'where':{'id':_0x57139c[_0x66be('0x40')]['id']}},_0x262290={};_0x262290[_0x66be('0x2c')]=_[_0x66be('0x41')](db[_0x66be('0x3b')][_0x66be('0x28')]);_0x262290[_0x66be('0x2d')]=_['keys'](_0x57139c[_0x66be('0x2d')]);_0x262290[_0x66be('0x2e')]=_['intersection'](_0x262290[_0x66be('0x2c')],_0x262290[_0x66be('0x2d')]);_0x432418['attributes']=_['intersection'](_0x262290[_0x66be('0x2c')],qs[_0x66be('0x31')](_0x57139c[_0x66be('0x2d')]['fields']));_0x432418[_0x66be('0x30')]=_0x432418[_0x66be('0x30')][_0x66be('0x32')]?_0x432418['attributes']:_0x262290['model'];if(_0x57139c[_0x66be('0x2d')][_0x66be('0x3c')]){_0x432418['include']=[{'all':!![]}];}_0x432418=_['merge']({},_0x432418,_0x57139c[_0x66be('0x42')]);return db[_0x66be('0x3b')][_0x66be('0x43')](_0x432418)[_0x66be('0x1e')](handleEntityNotFound(_0x129741,null))[_0x66be('0x1e')](respondWithResult(_0x129741,null))[_0x66be('0x44')](handleError(_0x129741,null));};exports['create']=function(_0x2a29f8,_0x5268f6){return db[_0x66be('0x3b')][_0x66be('0x45')](_0x2a29f8['body'],{})[_0x66be('0x1e')](respondWithResult(_0x5268f6,0xc9))[_0x66be('0x44')](handleError(_0x5268f6,null));};exports['update']=function(_0x2613a2,_0x1a4e45){if(_0x2613a2[_0x66be('0x46')]['id']){delete _0x2613a2[_0x66be('0x46')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x2613a2[_0x66be('0x40')]['id']}})[_0x66be('0x1e')](handleEntityNotFound(_0x1a4e45,null))[_0x66be('0x1e')](saveUpdates(_0x2613a2['body'],null))[_0x66be('0x1e')](respondWithResult(_0x1a4e45,null))[_0x66be('0x44')](handleError(_0x1a4e45,null));};exports[_0x66be('0x1f')]=function(_0x1b829d,_0x566ac0){return db['AnalyticTreeReport']['find']({'where':{'id':_0x1b829d[_0x66be('0x40')]['id']}})[_0x66be('0x1e')](handleEntityNotFound(_0x566ac0,null))[_0x66be('0x1e')](removeEntity(_0x566ac0,null))['catch'](handleError(_0x566ac0,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 767e20a..92fdbf4 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 _0xe2fe=['../../config/environment','exports','define','AnalyticTreeReport','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc48=['rimraf','./analyticTreeReport.attributes','define','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x247b1d,_0x36e266){var _0x1fdbb6=function(_0x598856){while(--_0x598856){_0x247b1d['push'](_0x247b1d['shift']());}};_0x1fdbb6(++_0x36e266);}(_0xbc48,0x111));var _0x8bc4=function(_0x26120e,_0x5de509){_0x26120e=_0x26120e-0x0;var _0x362934=_0xbc48[_0x26120e];return _0x362934;};'use strict';var _=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var logger=require(_0x8bc4('0x2'))(_0x8bc4('0x3'));var moment=require('moment');var BPromise=require(_0x8bc4('0x4'));var rp=require(_0x8bc4('0x5'));var fs=require('fs');var path=require(_0x8bc4('0x6'));var rimraf=require(_0x8bc4('0x7'));var config=require('../../config/environment');var attributes=require(_0x8bc4('0x8'));module['exports']=function(_0x59e2cc,_0x5ebb13){return _0x59e2cc[_0x8bc4('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 04f78d5..71c398e 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 _0x2dad=['then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x20c3fc,_0x12080c){var _0xafcb51=function(_0x424a81){while(--_0x424a81){_0x20c3fc['push'](_0x20c3fc['shift']());}};_0xafcb51(++_0x12080c);}(_0x2dad,0x191));var _0xd2da=function(_0xdcb8cd,_0x36101e){_0xdcb8cd=_0xdcb8cd-0x0;var _0x3ab311=_0x2dad[_0xdcb8cd];return _0x3ab311;};'use strict';var _=require(_0xd2da('0x0'));var util=require('util');var moment=require(_0xd2da('0x1'));var BPromise=require(_0xd2da('0x2'));var rs=require(_0xd2da('0x3'));var fs=require('fs');var Redis=require(_0xd2da('0x4'));var db=require(_0xd2da('0x5'))['db'];var utils=require(_0xd2da('0x6'));var logger=require('../../config/logger')(_0xd2da('0x7'));var config=require(_0xd2da('0x8'));var jayson=require(_0xd2da('0x9'));var client=jayson[_0xd2da('0xa')][_0xd2da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16bff6,_0x1e9e83,_0x1ea256){return new BPromise(function(_0xaacae5,_0x5006c8){return client[_0xd2da('0xc')](_0x16bff6,_0x1ea256)[_0xd2da('0xd')](function(_0x17f376){logger['info'](_0xd2da('0xe'),_0x1e9e83,_0xd2da('0xf'));logger[_0xd2da('0x10')](_0xd2da('0x11'),_0x1e9e83,'request\x20sent',JSON[_0xd2da('0x12')](_0x17f376));if(_0x17f376[_0xd2da('0x13')]){if(_0x17f376[_0xd2da('0x13')][_0xd2da('0x14')]===0x1f4){logger[_0xd2da('0x13')](_0xd2da('0xe'),_0x1e9e83,_0x17f376[_0xd2da('0x13')][_0xd2da('0x15')]);return _0x5006c8(_0x17f376[_0xd2da('0x13')][_0xd2da('0x15')]);}logger['error'](_0xd2da('0xe'),_0x1e9e83,_0x17f376[_0xd2da('0x13')][_0xd2da('0x15')]);return _0xaacae5(_0x17f376[_0xd2da('0x13')][_0xd2da('0x15')]);}else{logger[_0xd2da('0x16')](_0xd2da('0xe'),_0x1e9e83,_0xd2da('0xf'));_0xaacae5(_0x17f376['result'][_0xd2da('0x15')]);}})['catch'](function(_0x2eb652){logger[_0xd2da('0x13')](_0xd2da('0xe'),_0x1e9e83,_0x2eb652);_0x5006c8(_0x2eb652);});});}
\ No newline at end of file
+var _0x3a21=['jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x41ac5c,_0x300a26){var _0xeb9c12=function(_0x587593){while(--_0x587593){_0x41ac5c['push'](_0x41ac5c['shift']());}};_0xeb9c12(++_0x300a26);}(_0x3a21,0x117));var _0x13a2=function(_0x1bbbe1,_0x4d7456){_0x1bbbe1=_0x1bbbe1-0x0;var _0x1f8839=_0x3a21[_0x1bbbe1];return _0x1f8839;};'use strict';var _=require('lodash');var util=require(_0x13a2('0x0'));var moment=require(_0x13a2('0x1'));var BPromise=require(_0x13a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13a2('0x3'));var db=require(_0x13a2('0x4'))['db'];var utils=require(_0x13a2('0x5'));var logger=require(_0x13a2('0x6'))(_0x13a2('0x7'));var config=require(_0x13a2('0x8'));var jayson=require(_0x13a2('0x9'));var client=jayson[_0x13a2('0xa')][_0x13a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x409f1b,_0x59d905,_0x4c9eb7){return new BPromise(function(_0x4ae8b7,_0x10d0c2){return client[_0x13a2('0xc')](_0x409f1b,_0x4c9eb7)[_0x13a2('0xd')](function(_0x2b3a65){logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x59d905,_0x13a2('0xe'));logger[_0x13a2('0xf')](_0x13a2('0x10'),_0x59d905,'request\x20sent',JSON[_0x13a2('0x11')](_0x2b3a65));if(_0x2b3a65[_0x13a2('0x12')]){if(_0x2b3a65['error'][_0x13a2('0x13')]===0x1f4){logger[_0x13a2('0x12')](_0x13a2('0x14'),_0x59d905,_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);return _0x10d0c2(_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);}logger[_0x13a2('0x12')](_0x13a2('0x14'),_0x59d905,_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);return _0x4ae8b7(_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);}else{logger[_0x13a2('0x16')](_0x13a2('0x14'),_0x59d905,'request\x20sent');_0x4ae8b7(_0x2b3a65[_0x13a2('0x17')]['message']);}})['catch'](function(_0x19e988){logger[_0x13a2('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x59d905,_0x19e988);_0x10d0c2(_0x19e988);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 2df73ac..2a14056 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 _0x17f8=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x17f8,0x1cd));var _0x817f=function(_0x2d78a4,_0x362f5){_0x2d78a4=_0x2d78a4-0x0;var _0x38d29a=_0x17f8[_0x2d78a4];return _0x38d29a;};'use strict';var multer=require(_0x817f('0x0'));var util=require(_0x817f('0x1'));var path=require(_0x817f('0x2'));var timeout=require(_0x817f('0x3'));var express=require(_0x817f('0x4'));var router=express[_0x817f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x817f('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x817f('0x7')]('/',auth[_0x817f('0x8')](),controller[_0x817f('0x9')]);router[_0x817f('0x7')](_0x817f('0xa'),auth[_0x817f('0x8')](),controller[_0x817f('0xb')]);router['post']('/',auth[_0x817f('0x8')](),controller[_0x817f('0xc')]);router[_0x817f('0xd')](_0x817f('0xa'),auth[_0x817f('0x8')](),controller[_0x817f('0xe')]);router[_0x817f('0xf')](_0x817f('0xa'),auth['isAuthenticated'](),controller[_0x817f('0x10')]);module[_0x817f('0x11')]=router;
\ No newline at end of file
+var _0x65ab=['create','put','update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','show','post'];(function(_0x33d3c9,_0x2c95a8){var _0x1b9229=function(_0x1d4faf){while(--_0x1d4faf){_0x33d3c9['push'](_0x33d3c9['shift']());}};_0x1b9229(++_0x2c95a8);}(_0x65ab,0x66));var _0xb65a=function(_0x1ff0cb,_0x2b1303){_0x1ff0cb=_0x1ff0cb-0x0;var _0x1afb20=_0x65ab[_0x1ff0cb];return _0x1afb20;};'use strict';var multer=require('multer');var util=require(_0xb65a('0x0'));var path=require(_0xb65a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb65a('0x2'));var router=express[_0xb65a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb65a('0x4'));var config=require(_0xb65a('0x5'));var controller=require(_0xb65a('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xb65a('0x7')](),controller[_0xb65a('0x8')]);router[_0xb65a('0x9')]('/',auth[_0xb65a('0x7')](),controller[_0xb65a('0xa')]);router[_0xb65a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb65a('0xc')]);router[_0xb65a('0xd')]('/:id',auth[_0xb65a('0x7')](),controller[_0xb65a('0xe')]);module[_0xb65a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f5155d7..10f8086 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 _0x6999=['STRING','exports'];(function(_0x315a70,_0x3478fd){var _0xbc6674=function(_0x255642){while(--_0x255642){_0x315a70['push'](_0x315a70['shift']());}};_0xbc6674(++_0x3478fd);}(_0x6999,0xff));var _0x9699=function(_0x25cd01,_0x24c3ad){_0x25cd01=_0x25cd01-0x0;var _0x1176cf=_0x6999[_0x25cd01];return _0x1176cf;};'use strict';var Sequelize=require('sequelize');module[_0x9699('0x0')]={'name':{'type':Sequelize[_0x9699('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa4cb=['STRING','sequelize','exports'];(function(_0x3f088c,_0x1e3b3c){var _0x5f065b=function(_0x460e6e){while(--_0x460e6e){_0x3f088c['push'](_0x3f088c['shift']());}};_0x5f065b(++_0x1e3b3c);}(_0xa4cb,0x115));var _0xba4c=function(_0x5299a5,_0x375891){_0x5299a5=_0x5299a5-0x0;var _0xfb00b=_0xa4cb[_0x5299a5];return _0xfb00b;};'use strict';var Sequelize=require(_0xba4c('0x0'));module[_0xba4c('0x1')]={'name':{'type':Sequelize[_0xba4c('0x2')]},'basename':{'type':Sequelize[_0xba4c('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 38190cb..c25ae82 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 _0x424a=['model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','Attachment','includeAll','include','rows','catch','show','params','keys','rawAttributes','merge','clone','find','get','omit','createdAt','body','updatedAt','create','destroy','file','originalname','filename','download','findOne','server/files/attachments/','basename','html-pdf','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type'];(function(_0x19eb9b,_0x3d2e20){var _0x22ea05=function(_0x7af6fd){while(--_0x7af6fd){_0x19eb9b['push'](_0x19eb9b['shift']());}};_0x22ea05(++_0x3d2e20);}(_0x424a,0xc9));var _0xa424=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0x424a[_0x2a7210];return _0x460766;};'use strict';var pdf=require(_0xa424('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa424('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa424('0x2'));var rp=require(_0xa424('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa424('0x4'));var util=require(_0xa424('0x5'));var path=require('path');var sox=require(_0xa424('0x6'));var csv=require(_0xa424('0x7'));var ejs=require(_0xa424('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa424('0x9'));var crypto=require(_0xa424('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa424('0x7'));var querystring=require(_0xa424('0xb'));var Papa=require('papaparse');var Redis=require(_0xa424('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa424('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa424('0xe'));var config=require(_0xa424('0xf'));var licenseUtil=require(_0xa424('0x10'));var db=require(_0xa424('0x11'))['db'];function respondWithStatusCode(_0x59f7a8,_0x4d0127){_0x4d0127=_0x4d0127||0xcc;return function(_0x57bf72){if(_0x57bf72){return _0x59f7a8[_0xa424('0x12')](_0x4d0127);}return _0x59f7a8['status'](_0x4d0127)[_0xa424('0x13')]();};}function respondWithResult(_0x5640cc,_0x3fea1f){_0x3fea1f=_0x3fea1f||0xc8;return function(_0x5605e8){if(_0x5605e8){return _0x5640cc['status'](_0x3fea1f)['json'](_0x5605e8);}};}function respondWithFilteredResult(_0x387c29,_0x5831a3){return function(_0xc6b763){if(_0xc6b763){var _0x557794=_0xc6b763[_0xa424('0x14')],_0x196d35=_0x5831a3[_0xa424('0x15')],_0x5e8c49=_0x5831a3[_0xa424('0x15')]+_0x5831a3[_0xa424('0x16')],_0x4acd92;if(_0x5e8c49>=_0x557794){_0x5e8c49=_0x557794;_0x4acd92=0xc8;}else{_0x4acd92=0xce;}_0x387c29[_0xa424('0x17')](_0x4acd92);return _0x387c29['set'](_0xa424('0x18'),_0x196d35+'-'+_0x5e8c49+'/'+_0x557794)[_0xa424('0x19')](_0xc6b763);}return null;};}function patchUpdates(_0x3d1c8a){return function(_0xb9cbdd){try{jsonpatch[_0xa424('0x1a')](_0xb9cbdd,_0x3d1c8a,!![]);}catch(_0x37df2a){return BPromise[_0xa424('0x1b')](_0x37df2a);}return _0xb9cbdd[_0xa424('0x1c')]();};}function saveUpdates(_0x20192d,_0x86d3b2){return function(_0x4d6717){if(_0x4d6717){return _0x4d6717[_0xa424('0x1d')](_0x20192d)[_0xa424('0x1e')](function(_0x36ca98){return _0x36ca98;});}return null;};}function removeEntity(_0x1bea37,_0x3a71c1){return function(_0x280c47){if(_0x280c47){return _0x280c47['destroy']()[_0xa424('0x1e')](function(){_0x1bea37[_0xa424('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33848f,_0x4fa730){return function(_0x52cbcc){if(!_0x52cbcc){_0x33848f['sendStatus'](0x194);}return _0x52cbcc;};}function handleError(_0x165837,_0x3ce024){_0x3ce024=_0x3ce024||0x1f4;return function(_0x1204a6){logger[_0xa424('0x1f')](_0x1204a6[_0xa424('0x20')]);if(_0x1204a6[_0xa424('0x21')]){delete _0x1204a6[_0xa424('0x21')];}_0x165837[_0xa424('0x17')](_0x3ce024)[_0xa424('0x22')](_0x1204a6);};}exports[_0xa424('0x23')]=function(_0x12a288,_0xea2c00){var _0x41e00d={},_0x276e76={},_0x3d5fa1={'count':0x0,'rows':[]};var _0x5a75c8=_[_0xa424('0x24')](db['Attachment']['rawAttributes'],function(_0xc86af5){return{'name':_0xc86af5[_0xa424('0x25')],'type':_0xc86af5[_0xa424('0x26')]['key']};});_0x276e76[_0xa424('0x27')]=_[_0xa424('0x24')](_0x5a75c8,_0xa424('0x21'));_0x276e76[_0xa424('0x28')]=_['keys'](_0x12a288[_0xa424('0x28')]);_0x276e76[_0xa424('0x29')]=_['intersection'](_0x276e76[_0xa424('0x27')],_0x276e76[_0xa424('0x28')]);_0x41e00d['attributes']=_[_0xa424('0x2a')](_0x276e76['model'],qs[_0xa424('0x2b')](_0x12a288[_0xa424('0x28')][_0xa424('0x2b')]));_0x41e00d[_0xa424('0x2c')]=_0x41e00d[_0xa424('0x2c')][_0xa424('0x2d')]?_0x41e00d['attributes']:_0x276e76['model'];if(!_0x12a288['query'][_0xa424('0x2e')]('nolimit')){_0x41e00d[_0xa424('0x16')]=qs[_0xa424('0x16')](_0x12a288[_0xa424('0x28')][_0xa424('0x16')]);_0x41e00d[_0xa424('0x15')]=qs[_0xa424('0x15')](_0x12a288[_0xa424('0x28')][_0xa424('0x15')]);}_0x41e00d[_0xa424('0x2f')]=qs['sort'](_0x12a288[_0xa424('0x28')][_0xa424('0x30')]);_0x41e00d[_0xa424('0x31')]=qs['filters'](_[_0xa424('0x32')](_0x12a288[_0xa424('0x28')],_0x276e76[_0xa424('0x29')]),_0x5a75c8);if(_0x12a288['query'][_0xa424('0x33')]){_0x41e00d[_0xa424('0x31')]=_['merge'](_0x41e00d[_0xa424('0x31')],{'$or':_['map'](_0x5a75c8,function(_0x2e5e0d){if(_0x2e5e0d[_0xa424('0x26')]!==_0xa424('0x34')){var _0x17be51={};_0x17be51[_0x2e5e0d[_0xa424('0x21')]]={'$like':'%'+_0x12a288[_0xa424('0x28')]['filter']+'%'};return _0x17be51;}})});}_0x41e00d=_['merge']({},_0x41e00d,_0x12a288[_0xa424('0x35')]);var _0x40ea4a={'where':_0x41e00d[_0xa424('0x31')]};return db[_0xa424('0x36')]['count'](_0x40ea4a)[_0xa424('0x1e')](function(_0x4e379d){_0x3d5fa1['count']=_0x4e379d;if(_0x12a288[_0xa424('0x28')][_0xa424('0x37')]){_0x41e00d[_0xa424('0x38')]=[{'all':!![]}];}return db[_0xa424('0x36')]['findAll'](_0x41e00d);})[_0xa424('0x1e')](function(_0x516d6e){_0x3d5fa1[_0xa424('0x39')]=_0x516d6e;return _0x3d5fa1;})[_0xa424('0x1e')](respondWithFilteredResult(_0xea2c00,_0x41e00d))[_0xa424('0x3a')](handleError(_0xea2c00,null));};exports[_0xa424('0x3b')]=function(_0x9e18f,_0x46110e){var _0x33fd71={'raw':!![],'where':{'id':_0x9e18f[_0xa424('0x3c')]['id']}},_0x3db587={};_0x3db587['model']=_[_0xa424('0x3d')](db[_0xa424('0x36')][_0xa424('0x3e')]);_0x3db587[_0xa424('0x28')]=_['keys'](_0x9e18f[_0xa424('0x28')]);_0x3db587['filters']=_[_0xa424('0x2a')](_0x3db587[_0xa424('0x27')],_0x3db587[_0xa424('0x28')]);_0x33fd71['attributes']=_['intersection'](_0x3db587[_0xa424('0x27')],qs[_0xa424('0x2b')](_0x9e18f['query']['fields']));_0x33fd71[_0xa424('0x2c')]=_0x33fd71[_0xa424('0x2c')][_0xa424('0x2d')]?_0x33fd71['attributes']:_0x3db587[_0xa424('0x27')];if(_0x9e18f[_0xa424('0x28')]['includeAll']){_0x33fd71[_0xa424('0x38')]=[{'all':!![]}];}_0x33fd71=_[_0xa424('0x3f')]({},_0x33fd71,_0x9e18f[_0xa424('0x35')]);return db['Attachment']['find'](_0x33fd71)['then'](handleEntityNotFound(_0x46110e,null))[_0xa424('0x1e')](respondWithResult(_0x46110e,null))['catch'](handleError(_0x46110e,null));};exports[_0xa424('0x40')]=function(_0x2f08b1,_0x4e4651){var _0x4bf277={'where':{'id':_0x2f08b1[_0xa424('0x3c')]['id']}},_0x57df12={};_0x57df12['model']=_[_0xa424('0x3d')](db['Attachment']['rawAttributes']);_0x4bf277['attributes']=_['intersection'](_0x57df12[_0xa424('0x27')],qs[_0xa424('0x2b')](_0x2f08b1[_0xa424('0x28')][_0xa424('0x2b')]));_0x4bf277['attributes']=_0x4bf277[_0xa424('0x2c')][_0xa424('0x2d')]?_0x4bf277['attributes']:_0x57df12[_0xa424('0x27')];if(_0x2f08b1[_0xa424('0x28')][_0xa424('0x37')]){_0x4bf277['include']=[{'all':!![]}];}_0x4bf277=_[_0xa424('0x3f')]({},_0x4bf277,_0x2f08b1[_0xa424('0x35')]);return db[_0xa424('0x36')][_0xa424('0x41')](_0x4bf277)[_0xa424('0x1e')](handleEntityNotFound(_0x4e4651,null))['then'](function(_0x32f829){if(_0x32f829){var _0x3db847=_0x32f829[_0xa424('0x42')]({'plain':!![]});_0x3db847=qs[_0xa424('0x43')](_0x3db847,['id',_0xa424('0x44'),'updatedAt']);_0x2f08b1['body']=_[_0xa424('0x43')](_0x2f08b1[_0xa424('0x45')],['id',_0xa424('0x44'),_0xa424('0x46')]);return db[_0xa424('0x36')][_0xa424('0x47')](_[_0xa424('0x3f')](_0x3db847,_0x2f08b1[_0xa424('0x45')]),{'include':_0x2f08b1[_0xa424('0x28')][_0xa424('0x37')]?[{'all':!![]}]:undefined});}})[_0xa424('0x1e')](respondWithResult(_0x4e4651,0xc9))[_0xa424('0x3a')](handleError(_0x4e4651,null));};exports[_0xa424('0x1d')]=function(_0x15cc66,_0x32df48){if(_0x15cc66[_0xa424('0x45')]['id']){delete _0x15cc66[_0xa424('0x45')]['id'];}return db[_0xa424('0x36')][_0xa424('0x41')]({'where':{'id':_0x15cc66[_0xa424('0x3c')]['id']}})[_0xa424('0x1e')](handleEntityNotFound(_0x32df48,null))['then'](saveUpdates(_0x15cc66[_0xa424('0x45')],null))['then'](respondWithResult(_0x32df48,null))[_0xa424('0x3a')](handleError(_0x32df48,null));};exports[_0xa424('0x48')]=function(_0x5267ac,_0x6608b2){return db[_0xa424('0x36')][_0xa424('0x41')]({'where':{'id':_0x5267ac['params']['id']}})[_0xa424('0x1e')](handleEntityNotFound(_0x6608b2,null))[_0xa424('0x1e')](removeEntity(_0x6608b2,null))[_0xa424('0x3a')](handleError(_0x6608b2,null));};exports[_0xa424('0x47')]=function(_0x1c6465,_0x1dee6a,_0x4fe846){_0x1c6465['body'][_0xa424('0x21')]=_0x1c6465[_0xa424('0x49')][_0xa424('0x4a')];_0x1c6465[_0xa424('0x45')]['basename']=_0x1c6465[_0xa424('0x49')][_0xa424('0x4b')];_0x1c6465[_0xa424('0x45')]['type']=_0x1c6465['file']['mimetype'];return db[_0xa424('0x36')][_0xa424('0x47')](_0x1c6465[_0xa424('0x45')])[_0xa424('0x1e')](respondWithResult(_0x1dee6a,0xc9))['catch'](handleError(_0x1dee6a,null));};exports[_0xa424('0x4c')]=function(_0x4dedef,_0x30741f,_0x56947c){return db['Attachment'][_0xa424('0x4d')]({'where':{'id':_0x4dedef[_0xa424('0x3c')]['id']},'raw':!![]})[_0xa424('0x1e')](handleEntityNotFound(_0x30741f,null))[_0xa424('0x1e')](function(_0x3d57d6){if(_0x3d57d6){return _0x30741f['download'](path['join'](config['root'],_0xa424('0x4e'),_0x3d57d6[_0xa424('0x4f')]));}})[_0xa424('0x3a')](handleError(_0x30741f,null));};
\ No newline at end of file
+var _0xb1ee=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','clone','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','download','findOne','root','server/files/attachments/','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','stack','name','index','map','Attachment','fieldName','type','key','model','query','keys','filters'];(function(_0x34a14d,_0xc49d24){var _0x2015f2=function(_0x2a0b48){while(--_0x2a0b48){_0x34a14d['push'](_0x34a14d['shift']());}};_0x2015f2(++_0xc49d24);}(_0xb1ee,0x172));var _0xeb1e=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xb1ee[_0x380a3f];return _0x2b4eca;};'use strict';var pdf=require(_0xeb1e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeb1e('0x1'));var zipdir=require(_0xeb1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb1e('0x3'));var moment=require(_0xeb1e('0x4'));var BPromise=require(_0xeb1e('0x5'));var Mustache=require(_0xeb1e('0x6'));var util=require(_0xeb1e('0x7'));var path=require(_0xeb1e('0x8'));var sox=require(_0xeb1e('0x9'));var csv=require(_0xeb1e('0xa'));var ejs=require(_0xeb1e('0xb'));var fs=require('fs');var _=require(_0xeb1e('0xc'));var squel=require(_0xeb1e('0xd'));var crypto=require('crypto');var jsforce=require(_0xeb1e('0xe'));var deskjs=require(_0xeb1e('0xf'));var toCsv=require(_0xeb1e('0xa'));var querystring=require('querystring');var Papa=require(_0xeb1e('0x10'));var Redis=require('ioredis');var authService=require(_0xeb1e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeb1e('0x12'));var hardwareService=require(_0xeb1e('0x13'));var logger=require('../../config/logger')(_0xeb1e('0x14'));var utils=require(_0xeb1e('0x15'));var config=require(_0xeb1e('0x16'));var licenseUtil=require(_0xeb1e('0x17'));var db=require(_0xeb1e('0x18'))['db'];function respondWithStatusCode(_0x1e8fb0,_0x244c4c){_0x244c4c=_0x244c4c||0xcc;return function(_0x49c161){if(_0x49c161){return _0x1e8fb0[_0xeb1e('0x19')](_0x244c4c);}return _0x1e8fb0[_0xeb1e('0x1a')](_0x244c4c)[_0xeb1e('0x1b')]();};}function respondWithResult(_0xfdd3cf,_0x10af15){_0x10af15=_0x10af15||0xc8;return function(_0x37aab9){if(_0x37aab9){return _0xfdd3cf[_0xeb1e('0x1a')](_0x10af15)[_0xeb1e('0x1c')](_0x37aab9);}};}function respondWithFilteredResult(_0x5b5a27,_0x37faf4){return function(_0x320f89){if(_0x320f89){var _0x79878c=_0x320f89[_0xeb1e('0x1d')],_0x338d50=_0x37faf4['offset'],_0x1ee4ef=_0x37faf4[_0xeb1e('0x1e')]+_0x37faf4[_0xeb1e('0x1f')],_0x4e89b9;if(_0x1ee4ef>=_0x79878c){_0x1ee4ef=_0x79878c;_0x4e89b9=0xc8;}else{_0x4e89b9=0xce;}_0x5b5a27[_0xeb1e('0x1a')](_0x4e89b9);return _0x5b5a27[_0xeb1e('0x20')](_0xeb1e('0x21'),_0x338d50+'-'+_0x1ee4ef+'/'+_0x79878c)[_0xeb1e('0x1c')](_0x320f89);}return null;};}function patchUpdates(_0x57209d){return function(_0x28031e){try{jsonpatch['apply'](_0x28031e,_0x57209d,!![]);}catch(_0x56756c){return BPromise[_0xeb1e('0x22')](_0x56756c);}return _0x28031e[_0xeb1e('0x23')]();};}function saveUpdates(_0x120273,_0x13b320){return function(_0x43bdfb){if(_0x43bdfb){return _0x43bdfb['update'](_0x120273)['then'](function(_0x265aff){return _0x265aff;});}return null;};}function removeEntity(_0x3ec261,_0x452a2c){return function(_0x255858){if(_0x255858){return _0x255858[_0xeb1e('0x24')]()[_0xeb1e('0x25')](function(){_0x3ec261[_0xeb1e('0x1a')](0xcc)[_0xeb1e('0x1b')]();});}};}function handleEntityNotFound(_0x181808,_0x4e6296){return function(_0x6548f2){if(!_0x6548f2){_0x181808['sendStatus'](0x194);}return _0x6548f2;};}function handleError(_0x6db47e,_0x332345){_0x332345=_0x332345||0x1f4;return function(_0x23e235){logger['error'](_0x23e235[_0xeb1e('0x26')]);if(_0x23e235[_0xeb1e('0x27')]){delete _0x23e235[_0xeb1e('0x27')];}_0x6db47e[_0xeb1e('0x1a')](_0x332345)['send'](_0x23e235);};}exports[_0xeb1e('0x28')]=function(_0x494c5f,_0x36b1d1){var _0x450d45={},_0x1babbc={},_0x11fe99={'count':0x0,'rows':[]};var _0x1f92b3=_[_0xeb1e('0x29')](db[_0xeb1e('0x2a')]['rawAttributes'],function(_0x17cac8){return{'name':_0x17cac8[_0xeb1e('0x2b')],'type':_0x17cac8[_0xeb1e('0x2c')][_0xeb1e('0x2d')]};});_0x1babbc[_0xeb1e('0x2e')]=_[_0xeb1e('0x29')](_0x1f92b3,_0xeb1e('0x27'));_0x1babbc[_0xeb1e('0x2f')]=_[_0xeb1e('0x30')](_0x494c5f['query']);_0x1babbc[_0xeb1e('0x31')]=_['intersection'](_0x1babbc[_0xeb1e('0x2e')],_0x1babbc[_0xeb1e('0x2f')]);_0x450d45[_0xeb1e('0x32')]=_[_0xeb1e('0x33')](_0x1babbc[_0xeb1e('0x2e')],qs[_0xeb1e('0x34')](_0x494c5f[_0xeb1e('0x2f')][_0xeb1e('0x34')]));_0x450d45[_0xeb1e('0x32')]=_0x450d45[_0xeb1e('0x32')][_0xeb1e('0x35')]?_0x450d45[_0xeb1e('0x32')]:_0x1babbc[_0xeb1e('0x2e')];if(!_0x494c5f['query'][_0xeb1e('0x36')](_0xeb1e('0x37'))){_0x450d45[_0xeb1e('0x1f')]=qs['limit'](_0x494c5f[_0xeb1e('0x2f')][_0xeb1e('0x1f')]);_0x450d45['offset']=qs[_0xeb1e('0x1e')](_0x494c5f['query']['offset']);}_0x450d45['order']=qs[_0xeb1e('0x38')](_0x494c5f[_0xeb1e('0x2f')][_0xeb1e('0x38')]);_0x450d45[_0xeb1e('0x39')]=qs[_0xeb1e('0x31')](_['pick'](_0x494c5f[_0xeb1e('0x2f')],_0x1babbc[_0xeb1e('0x31')]),_0x1f92b3);if(_0x494c5f['query'][_0xeb1e('0x3a')]){_0x450d45['where']=_['merge'](_0x450d45[_0xeb1e('0x39')],{'$or':_[_0xeb1e('0x29')](_0x1f92b3,function(_0x58c9b1){if(_0x58c9b1[_0xeb1e('0x2c')]!=='VIRTUAL'){var _0x2e4037={};_0x2e4037[_0x58c9b1[_0xeb1e('0x27')]]={'$like':'%'+_0x494c5f[_0xeb1e('0x2f')][_0xeb1e('0x3a')]+'%'};return _0x2e4037;}})});}_0x450d45=_[_0xeb1e('0x3b')]({},_0x450d45,_0x494c5f[_0xeb1e('0x3c')]);var _0x55baec={'where':_0x450d45[_0xeb1e('0x39')]};return db[_0xeb1e('0x2a')][_0xeb1e('0x1d')](_0x55baec)[_0xeb1e('0x25')](function(_0x3695c8){_0x11fe99[_0xeb1e('0x1d')]=_0x3695c8;if(_0x494c5f[_0xeb1e('0x2f')]['includeAll']){_0x450d45[_0xeb1e('0x3d')]=[{'all':!![]}];}return db[_0xeb1e('0x2a')][_0xeb1e('0x3e')](_0x450d45);})[_0xeb1e('0x25')](function(_0x25a5a3){_0x11fe99[_0xeb1e('0x3f')]=_0x25a5a3;return _0x11fe99;})[_0xeb1e('0x25')](respondWithFilteredResult(_0x36b1d1,_0x450d45))['catch'](handleError(_0x36b1d1,null));};exports[_0xeb1e('0x40')]=function(_0x3fd44c,_0x42f029){var _0x2c5ab2={'raw':!![],'where':{'id':_0x3fd44c[_0xeb1e('0x41')]['id']}},_0x3e68bf={};_0x3e68bf[_0xeb1e('0x2e')]=_[_0xeb1e('0x30')](db['Attachment'][_0xeb1e('0x42')]);_0x3e68bf[_0xeb1e('0x2f')]=_['keys'](_0x3fd44c[_0xeb1e('0x2f')]);_0x3e68bf['filters']=_[_0xeb1e('0x33')](_0x3e68bf[_0xeb1e('0x2e')],_0x3e68bf[_0xeb1e('0x2f')]);_0x2c5ab2[_0xeb1e('0x32')]=_[_0xeb1e('0x33')](_0x3e68bf['model'],qs[_0xeb1e('0x34')](_0x3fd44c[_0xeb1e('0x2f')]['fields']));_0x2c5ab2['attributes']=_0x2c5ab2[_0xeb1e('0x32')][_0xeb1e('0x35')]?_0x2c5ab2[_0xeb1e('0x32')]:_0x3e68bf['model'];if(_0x3fd44c[_0xeb1e('0x2f')][_0xeb1e('0x43')]){_0x2c5ab2[_0xeb1e('0x3d')]=[{'all':!![]}];}_0x2c5ab2=_[_0xeb1e('0x3b')]({},_0x2c5ab2,_0x3fd44c[_0xeb1e('0x3c')]);return db[_0xeb1e('0x2a')][_0xeb1e('0x44')](_0x2c5ab2)[_0xeb1e('0x25')](handleEntityNotFound(_0x42f029,null))[_0xeb1e('0x25')](respondWithResult(_0x42f029,null))[_0xeb1e('0x45')](handleError(_0x42f029,null));};exports[_0xeb1e('0x46')]=function(_0x1c9673,_0x72b375){var _0x3990b5={'where':{'id':_0x1c9673[_0xeb1e('0x41')]['id']}},_0x1bf8d9={};_0x1bf8d9['model']=_[_0xeb1e('0x30')](db[_0xeb1e('0x2a')][_0xeb1e('0x42')]);_0x3990b5[_0xeb1e('0x32')]=_['intersection'](_0x1bf8d9[_0xeb1e('0x2e')],qs[_0xeb1e('0x34')](_0x1c9673['query'][_0xeb1e('0x34')]));_0x3990b5['attributes']=_0x3990b5[_0xeb1e('0x32')][_0xeb1e('0x35')]?_0x3990b5[_0xeb1e('0x32')]:_0x1bf8d9[_0xeb1e('0x2e')];if(_0x1c9673[_0xeb1e('0x2f')][_0xeb1e('0x43')]){_0x3990b5[_0xeb1e('0x3d')]=[{'all':!![]}];}_0x3990b5=_['merge']({},_0x3990b5,_0x1c9673[_0xeb1e('0x3c')]);return db[_0xeb1e('0x2a')][_0xeb1e('0x44')](_0x3990b5)[_0xeb1e('0x25')](handleEntityNotFound(_0x72b375,null))[_0xeb1e('0x25')](function(_0x3c30b6){if(_0x3c30b6){var _0x343a10=_0x3c30b6['get']({'plain':!![]});_0x343a10=qs[_0xeb1e('0x47')](_0x343a10,['id',_0xeb1e('0x48'),_0xeb1e('0x49')]);_0x1c9673[_0xeb1e('0x4a')]=_[_0xeb1e('0x47')](_0x1c9673[_0xeb1e('0x4a')],['id',_0xeb1e('0x48'),_0xeb1e('0x49')]);return db['Attachment']['create'](_[_0xeb1e('0x3b')](_0x343a10,_0x1c9673[_0xeb1e('0x4a')]),{'include':_0x1c9673[_0xeb1e('0x2f')][_0xeb1e('0x43')]?[{'all':!![]}]:undefined});}})[_0xeb1e('0x25')](respondWithResult(_0x72b375,0xc9))[_0xeb1e('0x45')](handleError(_0x72b375,null));};exports[_0xeb1e('0x4b')]=function(_0x31bd8e,_0x1fd543){if(_0x31bd8e['body']['id']){delete _0x31bd8e['body']['id'];}return db[_0xeb1e('0x2a')][_0xeb1e('0x44')]({'where':{'id':_0x31bd8e[_0xeb1e('0x41')]['id']}})[_0xeb1e('0x25')](handleEntityNotFound(_0x1fd543,null))['then'](saveUpdates(_0x31bd8e['body'],null))[_0xeb1e('0x25')](respondWithResult(_0x1fd543,null))['catch'](handleError(_0x1fd543,null));};exports[_0xeb1e('0x24')]=function(_0x44a25a,_0xafe438){return db['Attachment'][_0xeb1e('0x44')]({'where':{'id':_0x44a25a[_0xeb1e('0x41')]['id']}})[_0xeb1e('0x25')](handleEntityNotFound(_0xafe438,null))[_0xeb1e('0x25')](removeEntity(_0xafe438,null))[_0xeb1e('0x45')](handleError(_0xafe438,null));};exports[_0xeb1e('0x4c')]=function(_0x3dd798,_0x55b269,_0x2e5d75){_0x3dd798[_0xeb1e('0x4a')]['name']=_0x3dd798[_0xeb1e('0x4d')][_0xeb1e('0x4e')];_0x3dd798[_0xeb1e('0x4a')][_0xeb1e('0x4f')]=_0x3dd798[_0xeb1e('0x4d')]['filename'];_0x3dd798['body'][_0xeb1e('0x2c')]=_0x3dd798[_0xeb1e('0x4d')]['mimetype'];return db[_0xeb1e('0x2a')][_0xeb1e('0x4c')](_0x3dd798['body'])[_0xeb1e('0x25')](respondWithResult(_0x55b269,0xc9))[_0xeb1e('0x45')](handleError(_0x55b269,null));};exports[_0xeb1e('0x50')]=function(_0x271980,_0x4c4931,_0x16ae44){return db[_0xeb1e('0x2a')][_0xeb1e('0x51')]({'where':{'id':_0x271980[_0xeb1e('0x41')]['id']},'raw':!![]})[_0xeb1e('0x25')](handleEntityNotFound(_0x4c4931,null))[_0xeb1e('0x25')](function(_0x47ed64){if(_0x47ed64){return _0x4c4931['download'](path['join'](config[_0xeb1e('0x52')],_0xeb1e('0x53'),_0x47ed64[_0xeb1e('0x4f')]));}})[_0xeb1e('0x45')](handleError(_0x4c4931,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3e81432..70b637a 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 _0x25c2=['attachments','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','Attachment'];(function(_0x14d582,_0x1a1229){var _0x54c4ce=function(_0x3bb626){while(--_0x3bb626){_0x14d582['push'](_0x14d582['shift']());}};_0x54c4ce(++_0x1a1229);}(_0x25c2,0xdd));var _0x225c=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x25c2[_0x999b85];return _0x1d7124;};'use strict';var _=require(_0x225c('0x0'));var util=require('util');var logger=require(_0x225c('0x1'))(_0x225c('0x2'));var moment=require('moment');var BPromise=require(_0x225c('0x3'));var rp=require(_0x225c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x225c('0x5'));var config=require(_0x225c('0x6'));var attributes=require('./attachment.attributes');module[_0x225c('0x7')]=function(_0x1f3b42,_0x1fac61){return _0x1f3b42[_0x225c('0x8')](_0x225c('0x9'),attributes,{'tableName':_0x225c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2ab=['../../config/environment','./attachment.attributes','define','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x225773,_0x65c42a){var _0x27643d=function(_0x143a68){while(--_0x143a68){_0x225773['push'](_0x225773['shift']());}};_0x27643d(++_0x65c42a);}(_0xe2ab,0xc4));var _0xbe2a=function(_0xcac5e5,_0x5f4a78){_0xcac5e5=_0xcac5e5-0x0;var _0x17899e=_0xe2ab[_0xcac5e5];return _0x17899e;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var logger=require(_0xbe2a('0x2'))(_0xbe2a('0x3'));var moment=require(_0xbe2a('0x4'));var BPromise=require(_0xbe2a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe2a('0x6'));var rimraf=require(_0xbe2a('0x7'));var config=require(_0xbe2a('0x8'));var attributes=require(_0xbe2a('0x9'));module['exports']=function(_0x2023d3,_0x521365){return _0x2023d3[_0xbe2a('0xa')]('Attachment',attributes,{'tableName':_0xbe2a('0xb'),'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 3da52e4..1aa5eae 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 _0xcea7=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4db410,_0x422664){var _0x1522b2=function(_0x4474fd){while(--_0x4474fd){_0x4db410['push'](_0x4db410['shift']());}};_0x1522b2(++_0x422664);}(_0xcea7,0x159));var _0x7cea=function(_0x5042c4,_0x21b8d3){_0x5042c4=_0x5042c4-0x0;var _0x5bc3c7=_0xcea7[_0x5042c4];return _0x5bc3c7;};'use strict';var _=require(_0x7cea('0x0'));var util=require(_0x7cea('0x1'));var moment=require('moment');var BPromise=require(_0x7cea('0x2'));var rs=require(_0x7cea('0x3'));var fs=require('fs');var Redis=require(_0x7cea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cea('0x5'));var logger=require(_0x7cea('0x6'))(_0x7cea('0x7'));var config=require(_0x7cea('0x8'));var jayson=require(_0x7cea('0x9'));var client=jayson[_0x7cea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2194d1,_0x29e3b1,_0xaea7d8){return new BPromise(function(_0x1c3ec8,_0x5c84d3){return client[_0x7cea('0xb')](_0x2194d1,_0xaea7d8)[_0x7cea('0xc')](function(_0x47bbef){logger[_0x7cea('0xd')](_0x7cea('0xe'),_0x29e3b1,_0x7cea('0xf'));logger[_0x7cea('0x10')](_0x7cea('0x11'),_0x29e3b1,_0x7cea('0xf'),JSON[_0x7cea('0x12')](_0x47bbef));if(_0x47bbef[_0x7cea('0x13')]){if(_0x47bbef[_0x7cea('0x13')][_0x7cea('0x14')]===0x1f4){logger[_0x7cea('0x13')]('Attachment,\x20%s,\x20%s',_0x29e3b1,_0x47bbef['error'][_0x7cea('0x15')]);return _0x5c84d3(_0x47bbef[_0x7cea('0x13')][_0x7cea('0x15')]);}logger[_0x7cea('0x13')](_0x7cea('0xe'),_0x29e3b1,_0x47bbef[_0x7cea('0x13')][_0x7cea('0x15')]);return _0x1c3ec8(_0x47bbef['error'][_0x7cea('0x15')]);}else{logger['info'](_0x7cea('0xe'),_0x29e3b1,'request\x20sent');_0x1c3ec8(_0x47bbef[_0x7cea('0x16')][_0x7cea('0x15')]);}})['catch'](function(_0x49f826){logger[_0x7cea('0x13')](_0x7cea('0xe'),_0x29e3b1,_0x49f826);_0x5c84d3(_0x49f826);});});}exports['CreateAttachment']=function(_0x1fddd0){var _0x4ea4ae=this;return new Promise(function(_0x4ebac3,_0x1ed0ad){return db[_0x7cea('0x17')][_0x7cea('0x18')](_0x1fddd0[_0x7cea('0x19')],{'raw':_0x1fddd0[_0x7cea('0x1a')]?_0x1fddd0[_0x7cea('0x1a')][_0x7cea('0x1b')]===undefined?!![]:![]:!![]})[_0x7cea('0xc')](function(_0x47a77f){logger[_0x7cea('0xd')](_0x7cea('0x1c'),_0x1fddd0);logger['debug'](_0x7cea('0x1c'),_0x1fddd0,JSON[_0x7cea('0x12')](_0x47a77f));_0x4ebac3(_0x47a77f);})[_0x7cea('0x1d')](function(_0x306240){logger[_0x7cea('0x13')]('CreateAttachment',_0x306240[_0x7cea('0x15')],_0x1fddd0);_0x1ed0ad(_0x4ea4ae[_0x7cea('0x13')](0x1f4,_0x306240[_0x7cea('0x15')]));});});};
\ No newline at end of file
+var _0xc1a0=['stringify','error','code','message','result','create','body','options','raw','info','CreateAttachment','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xc1a0,0xfc));var _0x0c1a=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xc1a0[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require(_0x0c1a('0x0'));var util=require(_0x0c1a('0x1'));var moment=require('moment');var BPromise=require(_0x0c1a('0x2'));var rs=require(_0x0c1a('0x3'));var fs=require('fs');var Redis=require(_0x0c1a('0x4'));var db=require(_0x0c1a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c1a('0x6'))(_0x0c1a('0x7'));var config=require(_0x0c1a('0x8'));var jayson=require(_0x0c1a('0x9'));var client=jayson[_0x0c1a('0xa')][_0x0c1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e58f4,_0x4687de,_0x36a5d3){return new BPromise(function(_0x5a54a3,_0x38d64f){return client[_0x0c1a('0xc')](_0x3e58f4,_0x36a5d3)[_0x0c1a('0xd')](function(_0x18bf47){logger['info'](_0x0c1a('0xe'),_0x4687de,_0x0c1a('0xf'));logger[_0x0c1a('0x10')](_0x0c1a('0x11'),_0x4687de,_0x0c1a('0xf'),JSON[_0x0c1a('0x12')](_0x18bf47));if(_0x18bf47['error']){if(_0x18bf47[_0x0c1a('0x13')][_0x0c1a('0x14')]===0x1f4){logger[_0x0c1a('0x13')]('Attachment,\x20%s,\x20%s',_0x4687de,_0x18bf47[_0x0c1a('0x13')][_0x0c1a('0x15')]);return _0x38d64f(_0x18bf47['error'][_0x0c1a('0x15')]);}logger[_0x0c1a('0x13')](_0x0c1a('0xe'),_0x4687de,_0x18bf47[_0x0c1a('0x13')]['message']);return _0x5a54a3(_0x18bf47[_0x0c1a('0x13')][_0x0c1a('0x15')]);}else{logger['info'](_0x0c1a('0xe'),_0x4687de,_0x0c1a('0xf'));_0x5a54a3(_0x18bf47[_0x0c1a('0x16')][_0x0c1a('0x15')]);}})['catch'](function(_0x424a7a){logger[_0x0c1a('0x13')](_0x0c1a('0xe'),_0x4687de,_0x424a7a);_0x38d64f(_0x424a7a);});});}exports['CreateAttachment']=function(_0x2c3644){var _0x4c085f=this;return new Promise(function(_0xb9ffd5,_0x4355ca){return db['Attachment'][_0x0c1a('0x17')](_0x2c3644[_0x0c1a('0x18')],{'raw':_0x2c3644['options']?_0x2c3644[_0x0c1a('0x19')][_0x0c1a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x54e4ac){logger[_0x0c1a('0x1b')](_0x0c1a('0x1c'),_0x2c3644);logger['debug'](_0x0c1a('0x1c'),_0x2c3644,JSON[_0x0c1a('0x12')](_0x54e4ac));_0xb9ffd5(_0x54e4ac);})[_0x0c1a('0x1d')](function(_0x4c6d94){logger[_0x0c1a('0x13')]('CreateAttachment',_0x4c6d94[_0x0c1a('0x15')],_0x2c3644);_0x4355ca(_0x4c085f[_0x0c1a('0x13')](0x1f4,_0x4c6d94['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index e1cbea4..a51b1cc 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 _0x582b=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','/:id/clone','clone','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','post','single','create','/:id','update','delete','destroy','exports','util'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x582b,0x185));var _0xb582=function(_0x47a90a,_0x5c3276){_0x47a90a=_0x47a90a-0x0;var _0x1557b0=_0x582b[_0x47a90a];return _0x1557b0;};'use strict';var multer=require('multer');var util=require(_0xb582('0x0'));var path=require(_0xb582('0x1'));var timeout=require('connect-timeout');var express=require(_0xb582('0x2'));var router=express['Router']();var auth=require(_0xb582('0x3'));var interaction=require(_0xb582('0x4'));var config=require(_0xb582('0x5'));var controller=require(_0xb582('0x6'));router[_0xb582('0x7')]('/',auth[_0xb582('0x8')](),controller[_0xb582('0x9')]);router[_0xb582('0x7')]('/:id',auth[_0xb582('0x8')](),controller[_0xb582('0xa')]);router['get'](_0xb582('0xb'),auth['isAuthenticated'](),controller['download']);router['post'](_0xb582('0xc'),auth[_0xb582('0x8')](),controller[_0xb582('0xd')]);var upload=multer({'storage':multer[_0xb582('0xe')]({'destination':function(_0x914dec,_0x36b8b2,_0x373cc4){_0x373cc4(null,path[_0xb582('0xf')](config[_0xb582('0x10')],_0xb582('0x11')));},'filename':function(_0x6409d5,_0x361e01,_0x593a8b){_0x593a8b(null,util[_0xb582('0x12')]('%s-%s',Date[_0xb582('0x13')](),_0x361e01[_0xb582('0x14')][_0xb582('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb582('0x16')]('/',upload[_0xb582('0x17')]('file'),controller[_0xb582('0x18')]);router['put'](_0xb582('0x19'),auth[_0xb582('0x8')](),controller[_0xb582('0x1a')]);router[_0xb582('0x1b')](_0xb582('0x19'),auth[_0xb582('0x8')](),controller[_0xb582('0x1c')]);module[_0xb582('0x1d')]=router;
\ No newline at end of file
+var _0xc3b7=['isAuthenticated','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','format','%s-%s','now','replace','single','file','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','index','get','/:id'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x5463c7,_0x143458){_0x5463c7=_0x5463c7-0x0;var _0x2340c1=_0xc3b7[_0x5463c7];return _0x2340c1;};'use strict';var multer=require('multer');var util=require(_0x7c3b('0x0'));var path=require(_0x7c3b('0x1'));var timeout=require(_0x7c3b('0x2'));var express=require(_0x7c3b('0x3'));var router=express[_0x7c3b('0x4')]();var auth=require(_0x7c3b('0x5'));var interaction=require(_0x7c3b('0x6'));var config=require(_0x7c3b('0x7'));var controller=require(_0x7c3b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7c3b('0x9')]);router[_0x7c3b('0xa')](_0x7c3b('0xb'),auth[_0x7c3b('0xc')](),controller['show']);router[_0x7c3b('0xa')](_0x7c3b('0xd'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0xe')]);router[_0x7c3b('0xf')](_0x7c3b('0x10'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0x11')]);var upload=multer({'storage':multer[_0x7c3b('0x12')]({'destination':function(_0x220f21,_0x74dc35,_0xf4883f){_0xf4883f(null,path[_0x7c3b('0x13')](config[_0x7c3b('0x14')],'server/files/attachments/'));},'filename':function(_0x157e55,_0x455145,_0x4c7871){_0x4c7871(null,util[_0x7c3b('0x15')](_0x7c3b('0x16'),Date[_0x7c3b('0x17')](),_0x455145['originalname'][_0x7c3b('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7c3b('0xf')]('/',upload[_0x7c3b('0x19')](_0x7c3b('0x1a')),controller['create']);router[_0x7c3b('0x1b')](_0x7c3b('0xb'),auth['isAuthenticated'](),controller[_0x7c3b('0x1c')]);router[_0x7c3b('0x1d')](_0x7c3b('0xb'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0x1e')]);module[_0x7c3b('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 78c68f3..6c1d2c2 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 _0xc2d5=['allowedLoginAttempts','then','User','find','map','admin','agent','disabled','blockDuration','blocked','blockedAt','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','email','callback','/login','use','secret','callbackURL','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2d5,0x1ca));var _0x5c2d=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xc2d5[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0x5c2d('0x0'));var passport=require(_0x5c2d('0x1'));var GoogleStrategy=require(_0x5c2d('0x2'))[_0x5c2d('0x3')];var moment=require('moment');var db=require(_0x5c2d('0x4'))['db'];var config=require(_0x5c2d('0x5'));var signToken=require(_0x5c2d('0x6'))['signToken'];var utils=require(_0x5c2d('0x7'));exports[_0x5c2d('0x8')]=passport[_0x5c2d('0x9')](_0x5c2d('0xa'),{'failureRedirect':'/login','scope':['profile',_0x5c2d('0xb')],'session':![]});exports[_0x5c2d('0xc')]=passport['authenticate']('google',{'failureRedirect':_0x5c2d('0xd'),'session':![]});passport[_0x5c2d('0xe')](new GoogleStrategy({'clientID':config[_0x5c2d('0xa')]?config[_0x5c2d('0xa')]['clientID']:'id','clientSecret':config[_0x5c2d('0xa')]?config[_0x5c2d('0xa')]['clientSecret']:_0x5c2d('0xf'),'callbackURL':config[_0x5c2d('0xa')]?config[_0x5c2d('0xa')][_0x5c2d('0x10')]:''},function(_0x126492,_0x32a57,_0x759f80,_0x3eed99){var _0xf6f357,_0x4ff86e;return db['Setting'][_0x5c2d('0x11')]({'where':{'id':0x1},'attributes':[_0x5c2d('0x12'),'blockDuration'],'raw':!![]})[_0x5c2d('0x13')](function(_0x312eed){_0xf6f357=_0x312eed;return db[_0x5c2d('0x14')][_0x5c2d('0x15')]({'where':{'email':_[_0x5c2d('0x16')](_0x759f80['emails'],'value'),'role':{'$or':[_0x5c2d('0x17'),'user',_0x5c2d('0x18')]}}});})['then'](function(_0x24efe0){_0x4ff86e=_0x24efe0;if(_0x4ff86e){if(_0x4ff86e[_0x5c2d('0x19')]){return _0x3eed99('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0xf6f357[_0x5c2d('0x1a')]>0x0){if(_0x4ff86e[_0x5c2d('0x1b')]){if(moment(_0x4ff86e[_0x5c2d('0x1c')])['add'](_0xf6f357[_0x5c2d('0x1a')],_0x5c2d('0x1d'))>moment()){return _0x3eed99(_0x5c2d('0x1e'));}else{return utils[_0x5c2d('0x1f')](_0x4ff86e,0x0,![],null)[_0x5c2d('0x13')](function(){return utils[_0x5c2d('0x20')](_0x4ff86e);})['then'](function(){return _0x3eed99(null,_0x4ff86e);});}}else{return utils[_0x5c2d('0x20')](_0x4ff86e)['then'](function(){return _0x3eed99(null,_0x4ff86e);});}}else{return utils[_0x5c2d('0x20')](_0x4ff86e)[_0x5c2d('0x13')](function(){return _0x3eed99(null,_0x4ff86e);});}}return _0x3eed99(_0x5c2d('0x1e'));})[_0x5c2d('0x21')](function(_0x405f58){_0x3eed99(_0x405f58);});}));
\ No newline at end of file
+var _0x4bbb=['signToken','authenticate','google','/login','profile','email','use','clientID','clientSecret','secret','Setting','allowedLoginAttempts','blockDuration','User','map','emails','value','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','then','getLicense','catch','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service'];(function(_0xe29b6d,_0x48731f){var _0x41cf6d=function(_0x230919){while(--_0x230919){_0xe29b6d['push'](_0xe29b6d['shift']());}};_0x41cf6d(++_0x48731f);}(_0x4bbb,0x11b));var _0xb4bb=function(_0x1cc49f,_0x292d58){_0x1cc49f=_0x1cc49f-0x0;var _0x44069c=_0x4bbb[_0x1cc49f];return _0x44069c;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0xb4bb('0x0'))[_0xb4bb('0x1')];var moment=require(_0xb4bb('0x2'));var db=require(_0xb4bb('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0xb4bb('0x4'))[_0xb4bb('0x5')];var utils=require('../../config/utils');exports['login']=passport[_0xb4bb('0x6')](_0xb4bb('0x7'),{'failureRedirect':_0xb4bb('0x8'),'scope':[_0xb4bb('0x9'),_0xb4bb('0xa')],'session':![]});exports['callback']=passport['authenticate']('google',{'failureRedirect':_0xb4bb('0x8'),'session':![]});passport[_0xb4bb('0xb')](new GoogleStrategy({'clientID':config[_0xb4bb('0x7')]?config['google'][_0xb4bb('0xc')]:'id','clientSecret':config[_0xb4bb('0x7')]?config[_0xb4bb('0x7')][_0xb4bb('0xd')]:_0xb4bb('0xe'),'callbackURL':config[_0xb4bb('0x7')]?config[_0xb4bb('0x7')]['callbackURL']:''},function(_0x53e981,_0x79369d,_0x4acec4,_0xf261fe){var _0x5dab79,_0x2926f6;return db[_0xb4bb('0xf')]['findOne']({'where':{'id':0x1},'attributes':[_0xb4bb('0x10'),_0xb4bb('0x11')],'raw':!![]})['then'](function(_0x2cabb6){_0x5dab79=_0x2cabb6;return db[_0xb4bb('0x12')]['find']({'where':{'email':_[_0xb4bb('0x13')](_0x4acec4[_0xb4bb('0x14')],_0xb4bb('0x15')),'role':{'$or':[_0xb4bb('0x16'),_0xb4bb('0x17'),'agent']}}});})['then'](function(_0x4903b2){_0x2926f6=_0x4903b2;if(_0x2926f6){if(_0x2926f6['disabled']){return _0xf261fe(_0xb4bb('0x18'));}else if(_0x5dab79['blockDuration']>0x0){if(_0x2926f6[_0xb4bb('0x19')]){if(moment(_0x2926f6[_0xb4bb('0x1a')])[_0xb4bb('0x1b')](_0x5dab79[_0xb4bb('0x11')],'minutes')>moment()){return _0xf261fe(_0xb4bb('0x18'));}else{return utils[_0xb4bb('0x1c')](_0x2926f6,0x0,![],null)[_0xb4bb('0x1d')](function(){return utils['getLicense'](_0x2926f6);})[_0xb4bb('0x1d')](function(){return _0xf261fe(null,_0x2926f6);});}}else{return utils['getLicense'](_0x2926f6)[_0xb4bb('0x1d')](function(){return _0xf261fe(null,_0x2926f6);});}}else{return utils[_0xb4bb('0x1e')](_0x2926f6)[_0xb4bb('0x1d')](function(){return _0xf261fe(null,_0x2926f6);});}}return _0xf261fe(_0xb4bb('0x18'));})[_0xb4bb('0x1f')](function(_0x479f7f){_0xf261fe(_0x479f7f);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index f435dc9..611acca 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 _0x6953=['exports','express','passport','../../components/auth/service','login','get','/callback','isMiddleware','setTokenCookie'];(function(_0x337cf7,_0x1e7a41){var _0x175ae5=function(_0x457c9f){while(--_0x457c9f){_0x337cf7['push'](_0x337cf7['shift']());}};_0x175ae5(++_0x1e7a41);}(_0x6953,0x91));var _0x3695=function(_0x2f2526,_0x2d32cd){_0x2f2526=_0x2f2526-0x0;var _0x160820=_0x6953[_0x2f2526];return _0x160820;};'use strict';var express=require(_0x3695('0x0'));var passport=require(_0x3695('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x3695('0x2'));router['get']('/',controller[_0x3695('0x3')]);router[_0x3695('0x4')](_0x3695('0x5'),controller['callback'],authService[_0x3695('0x6')],userController['login'],authService[_0x3695('0x7')]);module[_0x3695('0x8')]=router;
\ No newline at end of file
+var _0xd816=['login','get','/callback','callback','exports','express','passport','./authGoogle.controller'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xd816,0xd5));var _0x6d81=function(_0x39a1b2,_0x434c52){_0x39a1b2=_0x39a1b2-0x0;var _0x4cd3dd=_0xd816[_0x39a1b2];return _0x4cd3dd;};'use strict';var express=require(_0x6d81('0x0'));var passport=require(_0x6d81('0x1'));var router=express['Router']();var controller=require(_0x6d81('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0x6d81('0x3')]);router[_0x6d81('0x4')](_0x6d81('0x5'),controller[_0x6d81('0x6')],authService['isMiddleware'],userController[_0x6d81('0x3')],authService['setTokenCookie']);module[_0x6d81('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 08e896f..19513e0 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 _0x32f4=['passwordHistoryLimit','save','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','disabled','blocked','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user','pass','merge','format','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','enforcePasswordHistory','securePassword','validatePasswordPattern','password','previousPasswords'];(function(_0x1c3386,_0x2868c0){var _0x2cc8e9=function(_0x556aa2){while(--_0x556aa2){_0x1c3386['push'](_0x1c3386['shift']());}};_0x2cc8e9(++_0x2868c0);}(_0x32f4,0x154));var _0x432f=function(_0x281037,_0x219e39){_0x281037=_0x281037-0x0;var _0x3e912c=_0x32f4[_0x281037];return _0x3e912c;};'use strict';var util=require(_0x432f('0x0'));var passport=require(_0x432f('0x1'));var LocalStrategy=require(_0x432f('0x2'))[_0x432f('0x3')];var jayson=require('jayson/promise');var _=require(_0x432f('0x4'));var rs=require(_0x432f('0x5'));var moment=require('moment');var db=require(_0x432f('0x6'))['db'];var authService=require(_0x432f('0x7'));var utils=require(_0x432f('0x8'));var client=jayson[_0x432f('0x9')][_0x432f('0xa')]({'port':0x232b});function localAuthenticate(_0x5d8cc0,_0x5b5f08,_0x2f66fd,_0x32b062){var _0x4a5b56,_0x2a2ef6;return db['Setting'][_0x432f('0xb')]({'where':{'id':0x1},'attributes':[_0x432f('0xc'),_0x432f('0xd')],'raw':!![]})[_0x432f('0xe')](function(_0x53f3ef){_0x4a5b56=_0x53f3ef;return _0x5d8cc0['findOne']({'attributes':['id',_0x432f('0xf'),'password',_0x432f('0x10'),'role',_0x432f('0x11'),_0x432f('0x12'),'blockedAt',_0x432f('0x13')],'where':{'name':_0x5b5f08,'role':{'$or':[_0x432f('0x14'),'user',_0x432f('0x15')]}}});})[_0x432f('0xe')](function(_0x5dd518){if(!_0x5dd518||_0x5dd518&&_0x5dd518['name']!==_0x5b5f08){throw new Error(_0x432f('0x16'));}else{_0x2a2ef6=_0x5dd518;return _0x2a2ef6;}})[_0x432f('0xe')](function(){_0x2a2ef6[_0x432f('0x17')](_0x2f66fd,function(_0x453725,_0x419bfe){var _0x4f91c5=_0x2a2ef6[_0x432f('0x13')]+0x1;if(_0x453725){return _0x32b062(_0x453725);}else if(!_0x419bfe){if(_0x2a2ef6[_0x432f('0x11')]){return _0x32b062(null,![],{'message':_0x432f('0x16')});}else if(_0x4a5b56[_0x432f('0xc')]>0x0){if(_0x2a2ef6['blocked']){if(_0x4a5b56[_0x432f('0xd')]>0x0){if(moment(_0x2a2ef6[_0x432f('0x18')])[_0x432f('0x19')](_0x4a5b56[_0x432f('0xd')],_0x432f('0x1a'))>moment()){return _0x32b062(null,![],{'message':_0x432f('0x16')});}else{return utils['clearBlockUser'](_0x2a2ef6,_0x4f91c5,![],null)[_0x432f('0xe')](function(){return _0x32b062(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x32b062(null,![],{'message':_0x432f('0x16')});}}else{if(_0x4f91c5>=_0x4a5b56[_0x432f('0xc')]){return utils[_0x432f('0x1b')](_0x2a2ef6,0x0,!![],moment())[_0x432f('0xe')](function(){return _0x32b062(null,![],{'message':_0x432f('0x16')});});}else{return utils[_0x432f('0x1b')](_0x2a2ef6,_0x4f91c5,![],null)[_0x432f('0xe')](function(){return _0x32b062(null,![],{'message':_0x432f('0x16')});});}}}else{return _0x32b062(null,![],{'message':_0x432f('0x16')});}}else{if(_0x2a2ef6[_0x432f('0x11')]){return _0x32b062(null,![],{'message':_0x432f('0x16')});}else if(_0x4a5b56[_0x432f('0xc')]>0x0){if(_0x2a2ef6['blocked']){if(_0x4a5b56['blockDuration']>0x0){if(moment(_0x2a2ef6[_0x432f('0x18')])['add'](_0x4a5b56[_0x432f('0xd')],'minutes')>moment()){return _0x32b062(null,![],{'message':_0x432f('0x16')});}else{return utils[_0x432f('0x1b')](_0x2a2ef6,0x0,![],null)[_0x432f('0xe')](function(){return utils[_0x432f('0x1c')](_0x2a2ef6);})[_0x432f('0xe')](function(){return _0x32b062(null,_0x2a2ef6);});}}else{return _0x32b062(null,![],{'message':_0x432f('0x16')});}}else{return utils['clearBlockUser'](_0x2a2ef6,0x0,![],null)[_0x432f('0xe')](function(){return utils[_0x432f('0x1c')](_0x2a2ef6);})['then'](function(){return _0x32b062(null,_0x2a2ef6);})[_0x432f('0x1d')](function(_0x3e37ec){return _0x32b062(null,![],_0x3e37ec);});}}else{if(_0x2a2ef6[_0x432f('0x12')]){return _0x32b062(null,![],{'message':_0x432f('0x16')});}else{return utils[_0x432f('0x1c')](_0x2a2ef6)[_0x432f('0xe')](function(){return _0x32b062(null,_0x2a2ef6);});}}}});})[_0x432f('0x1d')](function(_0x5a3d18){return _0x32b062(null,![],_0x5a3d18);});}function sendServiceMail(_0x294bfe){return db['MailAccount'][_0x432f('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x432f('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x432f('0x20')}]})['then'](function(_0x325a9c){if(!_0x325a9c){throw new Error(_0x432f('0x21'));}var _0x263cd8={'tls':{'rejectUnauthorized':![]}};if(_0x325a9c['Smtp'][_0x432f('0x22')]){_0x263cd8[_0x432f('0x22')]=_0x325a9c['Smtp']['service'];}else{_0x263cd8[_0x432f('0x23')]=_0x325a9c[_0x432f('0x20')][_0x432f('0x23')];_0x263cd8[_0x432f('0x24')]=_0x325a9c[_0x432f('0x20')][_0x432f('0x24')];_0x263cd8['secure']=_0x325a9c['Smtp'][_0x432f('0x25')];}if(_0x325a9c[_0x432f('0x20')][_0x432f('0x26')]){_0x263cd8['auth']={'user':_0x325a9c[_0x432f('0x20')][_0x432f('0x27')],'pass':_0x325a9c[_0x432f('0x20')][_0x432f('0x28')]};}var _0x4464f3={'account':_0x263cd8,'message':_[_0x432f('0x29')]({'from':util[_0x432f('0x2a')](_0x432f('0x2b'),_0x325a9c['name'],_0x325a9c['email']||_0x325a9c[_0x432f('0x20')][_0x432f('0x27')])},_0x294bfe)};return client['request']('SendMail',_0x4464f3);})['then'](function(_0x1727b7){if(_0x1727b7[_0x432f('0x2c')]){throw new Error(util['format'](_0x432f('0x2d'),_0x1727b7[_0x432f('0x2c')][_0x432f('0x2e')]||JSON['stringify'](_0x1727b7[_0x432f('0x2c')])));}return!![];});}function handleError(_0x440420,_0x499e58,_0x2ffa04){return _0x440420[_0x432f('0x2f')](_0x499e58||0x1f4)['send']({'message':_0x2ffa04?_0x2ffa04[_0x432f('0x2e')]||_0x2ffa04:''});}exports[_0x432f('0x30')]=function(_0x148a95,_0x1a3273,_0x4190c7){passport[_0x432f('0x17')](_0x432f('0x31'),function(_0x2d0d80,_0x244970,_0x2545b7){var _0xbb7bee=_0x2d0d80||_0x2545b7;if(_0xbb7bee){return handleError(_0x1a3273,0x191,_0xbb7bee);}if(!_0x244970){return handleError(_0x1a3273,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3d835e={'payload':{'id':_0x244970['id'],'role':_0x244970['role']},'options':{'expiresIn':0x15180}};return authService[_0x432f('0x32')](_0x3d835e)[_0x432f('0xe')](function(_0x4f38e5){_0x1a3273[_0x432f('0x33')]({'id':_0x244970['id'],'token':_0x4f38e5,'statusCall':'','isAlreadyLogged':_0x244970['online']});});}})(_0x148a95,_0x1a3273,_0x4190c7);};exports[_0x432f('0x34')]=function(_0x3aca68,_0x5e418c,_0x490db5){if(!_0x3aca68[_0x432f('0x35')][_0x432f('0x1f')]){return handleError(_0x5e418c,0x1f4,{'message':_0x432f('0x36')});}var _0x121687=rs[_0x432f('0x37')]();_0x3aca68['body']['email']=_0x3aca68['body'][_0x432f('0x1f')][_0x432f('0x38')]()['toLowerCase']();var _0x1f58af;return db[_0x432f('0x39')][_0x432f('0xb')]({'where':{'id':0x1},'attributes':[_0x432f('0xc'),_0x432f('0xd')],'raw':!![]})[_0x432f('0xe')](function(_0x2c32d1){_0x1f58af=_0x2c32d1;return db[_0x432f('0x3a')][_0x432f('0x1e')]({'where':{'email':_0x3aca68['body'][_0x432f('0x1f')]}});})[_0x432f('0xe')](function(_0x5227e4){if(!_0x5227e4){throw new Error(_0x432f('0x3b'));}if(_0x5227e4[_0x432f('0x11')]){throw new Error(_0x432f('0x3c'));}if(_0x5227e4[_0x432f('0x12')]){if(moment(_0x5227e4[_0x432f('0x18')])[_0x432f('0x19')](_0x1f58af[_0x432f('0xd')],_0x432f('0x1a'))>moment()){throw new Error(_0x432f('0x3d'));}else{_0x5227e4[_0x432f('0x12')]=![];_0x5227e4[_0x432f('0x18')]=null;}}_0x5227e4[_0x432f('0x3e')]=_0x121687;_0x5227e4[_0x432f('0x3f')]=Date[_0x432f('0x40')]()+0x36ee80;return _0x5227e4['save']();})['then'](function(){return sendServiceMail({'to':_0x3aca68[_0x432f('0x35')][_0x432f('0x1f')],'subject':_0x432f('0x41'),'text':_0x432f('0x42')+_0x432f('0x43')+'https://'+_0x3aca68[_0x432f('0x44')][_0x432f('0x23')]+_0x432f('0x45')+_0x121687+'\x0a\x0a'+_0x432f('0x46')});})[_0x432f('0xe')](function(){_0x5e418c[_0x432f('0x2f')](0xc8)[_0x432f('0x47')]({'message':'Reset\x20Email\x20sent!'});})[_0x432f('0x1d')](function(_0x2dd9c2){return handleError(_0x5e418c,0x1f4,_0x2dd9c2);});};exports[_0x432f('0x48')]=function(_0x547bd0,_0x2c023d,_0x2cdb82){return db['User']['find']({'where':{'resetPasswordToken':_0x547bd0[_0x432f('0x49')][_0x432f('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x33214e){if(!_0x33214e){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x432f('0x39')][_0x432f('0xb')]({'attributes':['id','securePassword',_0x432f('0x4b'),'passwordHistoryLimit']})[_0x432f('0xe')](function(_0x4162ee){if(_0x4162ee[_0x432f('0x4c')])authService[_0x432f('0x4d')](_0x547bd0[_0x432f('0x35')][_0x432f('0x4e')]);if(!_0x4162ee['enforcePasswordHistory']||!_0x33214e[_0x432f('0x4f')])return _0x33214e;authService['validatePasswordHistory'](_0x547bd0[_0x432f('0x35')][_0x432f('0x4e')],_0x33214e[_0x432f('0x4f')],_0x4162ee[_0x432f('0x50')]);return _0x33214e;})['then'](function(){_0x33214e[_0x432f('0x4e')]=_0x547bd0[_0x432f('0x35')][_0x432f('0x4e')];_0x33214e[_0x432f('0x3e')]=null;_0x33214e[_0x432f('0x3f')]=null;return _0x33214e[_0x432f('0x51')]();});})[_0x432f('0xe')](function(){_0x2c023d['status'](0xc8)['send']({'message':_0x432f('0x52')});})[_0x432f('0x1d')](function(_0x2e318b){return handleError(_0x2c023d,0x1f4,_0x2e318b);});};passport[_0x432f('0x53')](new LocalStrategy({'usernameField':_0x432f('0xf'),'passwordField':_0x432f('0x4e')},function(_0x54aa87,_0x134d9b,_0x545035){return localAuthenticate(db['User'],_0x54aa87,_0x134d9b,_0x545035);}));
\ No newline at end of file
+var _0x7b84=['authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','MailServerOut','Smtp','service','port','authentication','auth','pass','merge','format','email','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message'];(function(_0x404c7f,_0x280229){var _0x210d2f=function(_0x392c4e){while(--_0x392c4e){_0x404c7f['push'](_0x404c7f['shift']());}};_0x210d2f(++_0x280229);}(_0x7b84,0x17c));var _0x47b8=function(_0x4f63e9,_0x560ea4){_0x4f63e9=_0x4f63e9-0x0;var _0x318bed=_0x7b84[_0x4f63e9];return _0x318bed;};'use strict';var util=require(_0x47b8('0x0'));var passport=require(_0x47b8('0x1'));var LocalStrategy=require(_0x47b8('0x2'))[_0x47b8('0x3')];var jayson=require(_0x47b8('0x4'));var _=require(_0x47b8('0x5'));var rs=require(_0x47b8('0x6'));var moment=require('moment');var db=require(_0x47b8('0x7'))['db'];var authService=require(_0x47b8('0x8'));var utils=require(_0x47b8('0x9'));var client=jayson[_0x47b8('0xa')][_0x47b8('0xb')]({'port':0x232b});function localAuthenticate(_0xafe88a,_0x53e656,_0x3867ca,_0x3ce846){var _0x46245a,_0xb845c9;return db[_0x47b8('0xc')][_0x47b8('0xd')]({'where':{'id':0x1},'attributes':[_0x47b8('0xe'),_0x47b8('0xf')],'raw':!![]})[_0x47b8('0x10')](function(_0x429262){_0x46245a=_0x429262;return _0xafe88a[_0x47b8('0xd')]({'attributes':['id',_0x47b8('0x11'),_0x47b8('0x12'),_0x47b8('0x13'),_0x47b8('0x14'),_0x47b8('0x15'),_0x47b8('0x16'),_0x47b8('0x17'),_0x47b8('0x18')],'where':{'name':_0x53e656,'role':{'$or':[_0x47b8('0x19'),_0x47b8('0x1a'),_0x47b8('0x1b')]}}});})[_0x47b8('0x10')](function(_0x268440){if(!_0x268440||_0x268440&&_0x268440[_0x47b8('0x11')]!==_0x53e656){throw new Error(_0x47b8('0x1c'));}else{_0xb845c9=_0x268440;return _0xb845c9;}})[_0x47b8('0x10')](function(){_0xb845c9['authenticate'](_0x3867ca,function(_0x1fe3b7,_0x340da0){var _0x3e760a=_0xb845c9[_0x47b8('0x18')]+0x1;if(_0x1fe3b7){return _0x3ce846(_0x1fe3b7);}else if(!_0x340da0){if(_0xb845c9[_0x47b8('0x15')]){return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}else if(_0x46245a[_0x47b8('0xe')]>0x0){if(_0xb845c9['blocked']){if(_0x46245a[_0x47b8('0xf')]>0x0){if(moment(_0xb845c9['blockedAt'])['add'](_0x46245a['blockDuration'],_0x47b8('0x1d'))>moment()){return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}else{return utils[_0x47b8('0x1e')](_0xb845c9,_0x3e760a,![],null)['then'](function(){return _0x3ce846(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3ce846(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3e760a>=_0x46245a[_0x47b8('0xe')]){return utils['clearBlockUser'](_0xb845c9,0x0,!![],moment())[_0x47b8('0x10')](function(){return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});});}else{return utils[_0x47b8('0x1e')](_0xb845c9,_0x3e760a,![],null)[_0x47b8('0x10')](function(){return _0x3ce846(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}}else{if(_0xb845c9[_0x47b8('0x15')]){return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}else if(_0x46245a[_0x47b8('0xe')]>0x0){if(_0xb845c9[_0x47b8('0x16')]){if(_0x46245a[_0x47b8('0xf')]>0x0){if(moment(_0xb845c9['blockedAt'])[_0x47b8('0x1f')](_0x46245a[_0x47b8('0xf')],'minutes')>moment()){return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}else{return utils[_0x47b8('0x1e')](_0xb845c9,0x0,![],null)[_0x47b8('0x10')](function(){return utils[_0x47b8('0x20')](_0xb845c9);})['then'](function(){return _0x3ce846(null,_0xb845c9);});}}else{return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}}else{return utils[_0x47b8('0x1e')](_0xb845c9,0x0,![],null)[_0x47b8('0x10')](function(){return utils[_0x47b8('0x20')](_0xb845c9);})[_0x47b8('0x10')](function(){return _0x3ce846(null,_0xb845c9);})[_0x47b8('0x21')](function(_0x40918f){return _0x3ce846(null,![],_0x40918f);});}}else{if(_0xb845c9['blocked']){return _0x3ce846(null,![],{'message':_0x47b8('0x1c')});}else{return utils[_0x47b8('0x20')](_0xb845c9)['then'](function(){return _0x3ce846(null,_0xb845c9);});}}}});})[_0x47b8('0x21')](function(_0x6d517a){return _0x3ce846(null,![],_0x6d517a);});}function sendServiceMail(_0x147878){return db[_0x47b8('0x22')]['find']({'where':{'service':!![]},'attributes':['id',_0x47b8('0x11'),'email'],'include':[{'model':db[_0x47b8('0x23')],'as':_0x47b8('0x24')}]})[_0x47b8('0x10')](function(_0x2e540d){if(!_0x2e540d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x35fbbb={'tls':{'rejectUnauthorized':![]}};if(_0x2e540d[_0x47b8('0x24')][_0x47b8('0x25')]){_0x35fbbb[_0x47b8('0x25')]=_0x2e540d[_0x47b8('0x24')][_0x47b8('0x25')];}else{_0x35fbbb['host']=_0x2e540d['Smtp']['host'];_0x35fbbb[_0x47b8('0x26')]=_0x2e540d[_0x47b8('0x24')][_0x47b8('0x26')];_0x35fbbb['secure']=_0x2e540d['Smtp']['secure'];}if(_0x2e540d['Smtp'][_0x47b8('0x27')]){_0x35fbbb[_0x47b8('0x28')]={'user':_0x2e540d[_0x47b8('0x24')][_0x47b8('0x1a')],'pass':_0x2e540d[_0x47b8('0x24')][_0x47b8('0x29')]};}var _0x447ed5={'account':_0x35fbbb,'message':_[_0x47b8('0x2a')]({'from':util[_0x47b8('0x2b')]('\x22%s\x22\x20<%s>',_0x2e540d['name'],_0x2e540d[_0x47b8('0x2c')]||_0x2e540d[_0x47b8('0x24')]['user'])},_0x147878)};return client['request'](_0x47b8('0x2d'),_0x447ed5);})[_0x47b8('0x10')](function(_0x171e2f){if(_0x171e2f['error']){throw new Error(util[_0x47b8('0x2b')](_0x47b8('0x2e'),_0x171e2f['error']['message']||JSON['stringify'](_0x171e2f['error'])));}return!![];});}function handleError(_0x8ec36e,_0x12078e,_0x3b09ce){return _0x8ec36e[_0x47b8('0x2f')](_0x12078e||0x1f4)[_0x47b8('0x30')]({'message':_0x3b09ce?_0x3b09ce[_0x47b8('0x31')]||_0x3b09ce:''});}exports['login']=function(_0x494a53,_0x1259b7,_0x2faffc){passport[_0x47b8('0x32')]('local',function(_0x50127f,_0x996261,_0x2c89bc){var _0x5b1359=_0x50127f||_0x2c89bc;if(_0x5b1359){return handleError(_0x1259b7,0x191,_0x5b1359);}if(!_0x996261){return handleError(_0x1259b7,0x194,{'message':_0x47b8('0x33')});}else{var _0x19082a={'payload':{'id':_0x996261['id'],'role':_0x996261['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x19082a)['then'](function(_0x508947){_0x1259b7[_0x47b8('0x34')]({'id':_0x996261['id'],'token':_0x508947,'statusCall':'','isAlreadyLogged':_0x996261[_0x47b8('0x35')]});});}})(_0x494a53,_0x1259b7,_0x2faffc);};exports[_0x47b8('0x36')]=function(_0x28cf2c,_0x3289c1,_0x5abcd1){if(!_0x28cf2c[_0x47b8('0x37')]['email']){return handleError(_0x3289c1,0x1f4,{'message':_0x47b8('0x38')});}var _0x8dc3fd=rs[_0x47b8('0x39')]();_0x28cf2c['body'][_0x47b8('0x2c')]=_0x28cf2c[_0x47b8('0x37')][_0x47b8('0x2c')][_0x47b8('0x3a')]()[_0x47b8('0x3b')]();var _0x15b9a1;return db[_0x47b8('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x47b8('0xe'),'blockDuration'],'raw':!![]})[_0x47b8('0x10')](function(_0x31c653){_0x15b9a1=_0x31c653;return db[_0x47b8('0x3c')][_0x47b8('0x3d')]({'where':{'email':_0x28cf2c[_0x47b8('0x37')][_0x47b8('0x2c')]}});})['then'](function(_0x493730){if(!_0x493730){throw new Error(_0x47b8('0x3e'));}if(_0x493730[_0x47b8('0x15')]){throw new Error(_0x47b8('0x3f'));}if(_0x493730['blocked']){if(moment(_0x493730[_0x47b8('0x17')])['add'](_0x15b9a1[_0x47b8('0xf')],_0x47b8('0x1d'))>moment()){throw new Error(_0x47b8('0x40'));}else{_0x493730[_0x47b8('0x16')]=![];_0x493730[_0x47b8('0x17')]=null;}}_0x493730['resetPasswordToken']=_0x8dc3fd;_0x493730[_0x47b8('0x41')]=Date[_0x47b8('0x42')]()+0x36ee80;return _0x493730[_0x47b8('0x43')]();})[_0x47b8('0x10')](function(){return sendServiceMail({'to':_0x28cf2c[_0x47b8('0x37')][_0x47b8('0x2c')],'subject':_0x47b8('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x47b8('0x45')+'https://'+_0x28cf2c[_0x47b8('0x46')][_0x47b8('0x47')]+'/reset/'+_0x8dc3fd+'\x0a\x0a'+_0x47b8('0x48')});})[_0x47b8('0x10')](function(){_0x3289c1[_0x47b8('0x2f')](0xc8)[_0x47b8('0x30')]({'message':_0x47b8('0x49')});})[_0x47b8('0x21')](function(_0x1b1733){return handleError(_0x3289c1,0x1f4,_0x1b1733);});};exports[_0x47b8('0x4a')]=function(_0x4ad8a8,_0xf69232,_0x2e5996){return db[_0x47b8('0x3c')]['find']({'where':{'resetPasswordToken':_0x4ad8a8[_0x47b8('0x4b')][_0x47b8('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x47b8('0x42')]()}}})[_0x47b8('0x10')](function(_0x5edde7){if(!_0x5edde7){throw new Error(_0x47b8('0x4d'));}return db[_0x47b8('0xc')]['findOne']({'attributes':['id',_0x47b8('0x4e'),_0x47b8('0x4f'),_0x47b8('0x50')]})['then'](function(_0x267aef){if(_0x267aef['securePassword'])authService[_0x47b8('0x51')](_0x4ad8a8['body'][_0x47b8('0x12')]);if(!_0x267aef['enforcePasswordHistory']||!_0x5edde7[_0x47b8('0x52')])return _0x5edde7;authService[_0x47b8('0x53')](_0x4ad8a8[_0x47b8('0x37')][_0x47b8('0x12')],_0x5edde7['previousPasswords'],_0x267aef[_0x47b8('0x50')]);return _0x5edde7;})[_0x47b8('0x10')](function(){_0x5edde7[_0x47b8('0x12')]=_0x4ad8a8[_0x47b8('0x37')]['password'];_0x5edde7[_0x47b8('0x54')]=null;_0x5edde7[_0x47b8('0x41')]=null;return _0x5edde7[_0x47b8('0x43')]();});})['then'](function(){_0xf69232['status'](0xc8)[_0x47b8('0x30')]({'message':'Password\x20reset!'});})[_0x47b8('0x21')](function(_0x3128ef){return handleError(_0xf69232,0x1f4,_0x3128ef);});};passport[_0x47b8('0x55')](new LocalStrategy({'usernameField':_0x47b8('0x11'),'passwordField':'password'},function(_0x27d91c,_0x3bfeee,_0x157bf5){return localAuthenticate(db['User'],_0x27d91c,_0x3bfeee,_0x157bf5);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 56e123d..0d6d8dc 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 _0xbe8e=['post','login','/forgot','forgot','exports','express','Router','./authLocal.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe8e,0xd5));var _0xebe8=function(_0x2475e4,_0x2845d2){_0x2475e4=_0x2475e4-0x0;var _0x2d3af3=_0xbe8e[_0x2475e4];return _0x2d3af3;};'use strict';var express=require(_0xebe8('0x0'));var router=express[_0xebe8('0x1')]();var controller=require(_0xebe8('0x2'));router[_0xebe8('0x3')]('/',controller[_0xebe8('0x4')]);router['post'](_0xebe8('0x5'),controller[_0xebe8('0x6')]);router[_0xebe8('0x3')]('/reset/:token',controller['reset']);module[_0xebe8('0x7')]=router;
\ No newline at end of file
+var _0x9973=['express','./authLocal.controller','login','/forgot','forgot','post','reset','exports'];(function(_0x53e4d4,_0x23432e){var _0x1a02f6=function(_0x46b2ef){while(--_0x46b2ef){_0x53e4d4['push'](_0x53e4d4['shift']());}};_0x1a02f6(++_0x23432e);}(_0x9973,0x130));var _0x3997=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9973[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0x3997('0x0'));var router=express['Router']();var controller=require(_0x3997('0x1'));router['post']('/',controller[_0x3997('0x2')]);router['post'](_0x3997('0x3'),controller[_0x3997('0x4')]);router[_0x3997('0x5')]('/reset/:token',controller[_0x3997('0x6')]);module[_0x3997('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6aef742..8872432 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 _0xbe2a=['INTEGER','sequelize','STRING'];(function(_0x1986b6,_0x53b923){var _0x4fbf17=function(_0x48bcdb){while(--_0x48bcdb){_0x1986b6['push'](_0x1986b6['shift']());}};_0x4fbf17(++_0x53b923);}(_0xbe2a,0x15a));var _0xabe2=function(_0x11e182,_0x7bd3cd){_0x11e182=_0x11e182-0x0;var _0x438579=_0xbe2a[_0x11e182];return _0x438579;};'use strict';var Sequelize=require(_0xabe2('0x0'));module['exports']={'name':{'type':Sequelize[_0xabe2('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xabe2('0x1')]},'description':{'type':Sequelize[_0xabe2('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xabe2('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x88e3=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x88e3,0x157));var _0x388e=function(_0x1dc01f,_0x157a75){_0x1dc01f=_0x1dc01f-0x0;var _0x298041=_0x88e3[_0x1dc01f];return _0x298041;};'use strict';var Sequelize=require(_0x388e('0x0'));module['exports']={'name':{'type':Sequelize[_0x388e('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x388e('0x1')]},'description':{'type':Sequelize[_0x388e('0x1')]},'status':{'type':Sequelize[_0x388e('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x388e('0x3')],'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 a5c2700..c8d39b4 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 _0xa9e0=['apply','reject','save','update','destroy','then','name','send','map','Automation','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','addConditions','Condition','ids','findOne','pick','getConditions','addActions','Action','omit','getActions','hasOwnProperty','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range'];(function(_0x4958ce,_0x5c963c){var _0xe36f28=function(_0x2b86c8){while(--_0x2b86c8){_0x4958ce['push'](_0x4958ce['shift']());}};_0xe36f28(++_0x5c963c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(!_0x3b45bc){_0xfb6e48[_0x0a9e('0x15')](0x194);}return _0x3b45bc;};}function handleError(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0x1f4;return function(_0x16b1ca){logger['error'](_0x16b1ca['stack']);if(_0x16b1ca[_0x0a9e('0x23')]){delete _0x16b1ca[_0x0a9e('0x23')];}_0x370d86[_0x0a9e('0x17')](_0x42ac8f)[_0x0a9e('0x24')](_0x16b1ca);};}exports['index']=function(_0x384319,_0x479bc4){var _0x45a1e7={},_0x5bfb33={},_0x1dc186={'count':0x0,'rows':[]};var _0x34dc65=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x1538a4){return{'name':_0x1538a4[_0x0a9e('0x28')],'type':_0x1538a4[_0x0a9e('0x29')]['key']};});_0x5bfb33[_0x0a9e('0x2a')]=_[_0x0a9e('0x25')](_0x34dc65,_0x0a9e('0x23'));_0x5bfb33[_0x0a9e('0x2b')]=_['keys'](_0x384319[_0x0a9e('0x2b')]);_0x5bfb33[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],_0x5bfb33[_0x0a9e('0x2b')]);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],qs[_0x0a9e('0x2f')](_0x384319['query'][_0x0a9e('0x2f')]));_0x45a1e7['attributes']=_0x45a1e7[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x45a1e7[_0x0a9e('0x2e')]:_0x5bfb33[_0x0a9e('0x2a')];if(!_0x384319[_0x0a9e('0x2b')]['hasOwnProperty'](_0x0a9e('0x31'))){_0x45a1e7[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x45a1e7[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x384319[_0x0a9e('0x2b')]['offset']);}_0x45a1e7[_0x0a9e('0x32')]=qs['sort'](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x33')]);_0x45a1e7[_0x0a9e('0x34')]=qs[_0x0a9e('0x2c')](_['pick'](_0x384319[_0x0a9e('0x2b')],_0x5bfb33[_0x0a9e('0x2c')]),_0x34dc65);if(_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]){_0x45a1e7['where']=_['merge'](_0x45a1e7[_0x0a9e('0x34')],{'$or':_['map'](_0x34dc65,function(_0x24936a){if(_0x24936a[_0x0a9e('0x29')]!==_0x0a9e('0x36')){var _0x1ef87a={};_0x1ef87a[_0x24936a['name']]={'$like':'%'+_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]+'%'};return _0x1ef87a;}})});}_0x45a1e7=_[_0x0a9e('0x37')]({},_0x45a1e7,_0x384319['options']);var _0x1dbf74={'where':_0x45a1e7[_0x0a9e('0x34')]};return db[_0x0a9e('0x26')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x1dc186[_0x0a9e('0x38')]=_0x11b61d;if(_0x384319['query'][_0x0a9e('0x39')]){_0x45a1e7[_0x0a9e('0x3a')]=[{'all':!![]}];}return db[_0x0a9e('0x26')][_0x0a9e('0x3b')](_0x45a1e7);})['then'](function(_0x5a594b){_0x1dc186[_0x0a9e('0x3c')]=_0x5a594b;return _0x1dc186;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x479bc4,_0x45a1e7))['catch'](handleError(_0x479bc4,null));};exports[_0x0a9e('0x3d')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':![],'where':{'id':_0x1dec2e[_0x0a9e('0x3e')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x2a')]=_[_0x0a9e('0x3f')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x316c8f[_0x0a9e('0x2b')]=_[_0x0a9e('0x3f')](_0x1dec2e[_0x0a9e('0x2b')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x316c8f[_0x0a9e('0x2a')],_0x316c8f[_0x0a9e('0x2b')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x2f')]));_0x5b4f5e[_0x0a9e('0x2e')]=_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x5b4f5e[_0x0a9e('0x2e')]:_0x316c8f[_0x0a9e('0x2a')];if(_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x39')]){_0x5b4f5e[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x37')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x40')]);return db['Automation'][_0x0a9e('0x41')](_0x5b4f5e)[_0x0a9e('0x22')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x22')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x42')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x43')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x26')]['create'](_0xbe9d19[_0x0a9e('0x44')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x42')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x20')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x44')]['id']){delete _0x8d6dd1[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x22')](saveUpdates(_0x8d6dd1['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x42')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x21')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x16f976[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x409789,null))['then'](removeEntity(_0x409789,null))[_0x0a9e('0x42')](handleError(_0x409789,null));};exports[_0x0a9e('0x45')]=function(_0x4f7240,_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x46')][_0x0a9e('0x41')]({'where':{'id':_0x4f7240[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4ae14b,null))[_0x0a9e('0x22')](function(_0x30decb){if(_0x30decb){return _0x30decb[_0x0a9e('0x45')](_0x4f7240[_0x0a9e('0x44')]['ids'],_['omit'](_0x4f7240['body'],[_0x0a9e('0x47'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4ae14b,null))[_0x0a9e('0x42')](handleError(_0x4ae14b,null));};exports['getConditions']=function(_0x2b69d9,_0x161aa7,_0x53d113){var _0x5a88da={};var _0x2ef381={};var _0x59c6ff;var _0x443e72;return db['Automation'][_0x0a9e('0x48')]({'where':{'id':_0x2b69d9[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x161aa7,null))['then'](function(_0x2f82da){if(_0x2f82da){_0x59c6ff=_0x2f82da;_0x2ef381[_0x0a9e('0x2a')]=_['keys'](db['Condition'][_0x0a9e('0x27')]);_0x2ef381[_0x0a9e('0x2b')]=_['keys'](_0x2b69d9[_0x0a9e('0x2b')]);_0x2ef381['filters']=_[_0x0a9e('0x2d')](_0x2ef381['model'],_0x2ef381[_0x0a9e('0x2b')]);_0x5a88da['attributes']=_['intersection'](_0x2ef381['model'],qs[_0x0a9e('0x2f')](_0x2b69d9['query'][_0x0a9e('0x2f')]));_0x5a88da[_0x0a9e('0x2e')]=_0x5a88da[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x5a88da[_0x0a9e('0x2e')]:_0x2ef381[_0x0a9e('0x2a')];_0x5a88da[_0x0a9e('0x32')]=qs[_0x0a9e('0x33')](_0x2b69d9['query'][_0x0a9e('0x33')]);_0x5a88da[_0x0a9e('0x34')]=qs[_0x0a9e('0x2c')](_[_0x0a9e('0x49')](_0x2b69d9[_0x0a9e('0x2b')],_0x2ef381[_0x0a9e('0x2c')]));if(_0x2b69d9['query'][_0x0a9e('0x35')]){_0x5a88da[_0x0a9e('0x34')]=_['merge'](_0x5a88da[_0x0a9e('0x34')],{'$or':_['map'](_0x5a88da[_0x0a9e('0x2e')],function(_0x5ba1f9){var _0x4b3c1a={};_0x4b3c1a[_0x5ba1f9]={'$like':'%'+_0x2b69d9['query'][_0x0a9e('0x35')]+'%'};return _0x4b3c1a;})});}_0x5a88da=_['merge']({},_0x5a88da,_0x2b69d9[_0x0a9e('0x40')]);return _0x59c6ff[_0x0a9e('0x4a')](_0x5a88da);}})[_0x0a9e('0x22')](function(_0x7be420){if(_0x7be420){_0x443e72=_0x7be420[_0x0a9e('0x30')];if(!_0x2b69d9[_0x0a9e('0x2b')]['hasOwnProperty'](_0x0a9e('0x31'))){_0x5a88da['limit']=qs[_0x0a9e('0x1a')](_0x2b69d9[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x5a88da['offset']=qs[_0x0a9e('0x19')](_0x2b69d9[_0x0a9e('0x2b')][_0x0a9e('0x19')]);}return _0x59c6ff[_0x0a9e('0x4a')](_0x5a88da);}})['then'](function(_0x1d0dc8){if(_0x1d0dc8){return _0x1d0dc8?{'count':_0x443e72,'rows':_0x1d0dc8}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x161aa7,null))['catch'](handleError(_0x161aa7,null));};exports[_0x0a9e('0x4b')]=function(_0x17e88c,_0x88dcbf,_0x409b29){return db[_0x0a9e('0x4c')]['find']({'where':{'id':_0x17e88c[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x22')](function(_0x47bb43){if(_0x47bb43){return _0x47bb43[_0x0a9e('0x4b')](_0x17e88c['body']['ids'],_[_0x0a9e('0x4d')](_0x17e88c[_0x0a9e('0x44')],[_0x0a9e('0x47'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x88dcbf,null))[_0x0a9e('0x42')](handleError(_0x88dcbf,null));};exports[_0x0a9e('0x4e')]=function(_0x387489,_0x54a37d,_0x2d7205){var _0x1cc4f3={};var _0x2e89b7={};var _0x19012b;var _0x2bbb86;return db[_0x0a9e('0x26')][_0x0a9e('0x48')]({'where':{'id':_0x387489[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x54a37d,null))[_0x0a9e('0x22')](function(_0x5150a4){if(_0x5150a4){_0x19012b=_0x5150a4;_0x2e89b7[_0x0a9e('0x2a')]=_[_0x0a9e('0x3f')](db[_0x0a9e('0x4c')]['rawAttributes']);_0x2e89b7[_0x0a9e('0x2b')]=_[_0x0a9e('0x3f')](_0x387489['query']);_0x2e89b7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x2e89b7[_0x0a9e('0x2a')],_0x2e89b7[_0x0a9e('0x2b')]);_0x1cc4f3[_0x0a9e('0x2e')]=_['intersection'](_0x2e89b7['model'],qs['fields'](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x2f')]));_0x1cc4f3[_0x0a9e('0x2e')]=_0x1cc4f3[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x1cc4f3[_0x0a9e('0x2e')]:_0x2e89b7[_0x0a9e('0x2a')];_0x1cc4f3[_0x0a9e('0x32')]=qs['sort'](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x33')]);_0x1cc4f3[_0x0a9e('0x34')]=qs['filters'](_[_0x0a9e('0x49')](_0x387489['query'],_0x2e89b7[_0x0a9e('0x2c')]));if(_0x387489[_0x0a9e('0x2b')]['filter']){_0x1cc4f3[_0x0a9e('0x34')]=_[_0x0a9e('0x37')](_0x1cc4f3[_0x0a9e('0x34')],{'$or':_[_0x0a9e('0x25')](_0x1cc4f3['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x35')]+'%'};return _0x2e9552;})});}_0x1cc4f3=_['merge']({},_0x1cc4f3,_0x387489[_0x0a9e('0x40')]);return _0x19012b[_0x0a9e('0x4e')](_0x1cc4f3);}})[_0x0a9e('0x22')](function(_0x361b21){if(_0x361b21){_0x2bbb86=_0x361b21['length'];if(!_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x4f')](_0x0a9e('0x31'))){_0x1cc4f3[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x1cc4f3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x19')]);}return _0x19012b[_0x0a9e('0x4e')](_0x1cc4f3);}})[_0x0a9e('0x22')](function(_0xe0749e){if(_0xe0749e){return _0xe0749e?{'count':_0x2bbb86,'rows':_0xe0749e}:null;}})['then'](respondWithResult(_0x54a37d,null))[_0x0a9e('0x42')](handleError(_0x54a37d,null));};
\ No newline at end of file
+var _0xa9e0=['apply','reject','save','update','destroy','then','name','send','map','Automation','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','addConditions','Condition','ids','findOne','pick','getConditions','addActions','Action','omit','getActions','hasOwnProperty','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range'];(function(_0x11645b,_0x26eb5c){var _0x361e60=function(_0x449acf){while(--_0x449acf){_0x11645b['push'](_0x11645b['shift']());}};_0x361e60(++_0x26eb5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(!_0x3b45bc){_0xfb6e48[_0x0a9e('0x15')](0x194);}return _0x3b45bc;};}function handleError(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0x1f4;return function(_0x16b1ca){logger['error'](_0x16b1ca['stack']);if(_0x16b1ca[_0x0a9e('0x23')]){delete _0x16b1ca[_0x0a9e('0x23')];}_0x370d86[_0x0a9e('0x17')](_0x42ac8f)[_0x0a9e('0x24')](_0x16b1ca);};}exports['index']=function(_0x384319,_0x479bc4){var _0x45a1e7={},_0x5bfb33={},_0x1dc186={'count':0x0,'rows':[]};var _0x34dc65=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x1538a4){return{'name':_0x1538a4[_0x0a9e('0x28')],'type':_0x1538a4[_0x0a9e('0x29')]['key']};});_0x5bfb33[_0x0a9e('0x2a')]=_[_0x0a9e('0x25')](_0x34dc65,_0x0a9e('0x23'));_0x5bfb33[_0x0a9e('0x2b')]=_['keys'](_0x384319[_0x0a9e('0x2b')]);_0x5bfb33[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],_0x5bfb33[_0x0a9e('0x2b')]);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],qs[_0x0a9e('0x2f')](_0x384319['query'][_0x0a9e('0x2f')]));_0x45a1e7['attributes']=_0x45a1e7[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x45a1e7[_0x0a9e('0x2e')]:_0x5bfb33[_0x0a9e('0x2a')];if(!_0x384319[_0x0a9e('0x2b')]['hasOwnProperty'](_0x0a9e('0x31'))){_0x45a1e7[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x45a1e7[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x384319[_0x0a9e('0x2b')]['offset']);}_0x45a1e7[_0x0a9e('0x32')]=qs['sort'](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x33')]);_0x45a1e7[_0x0a9e('0x34')]=qs[_0x0a9e('0x2c')](_['pick'](_0x384319[_0x0a9e('0x2b')],_0x5bfb33[_0x0a9e('0x2c')]),_0x34dc65);if(_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]){_0x45a1e7['where']=_['merge'](_0x45a1e7[_0x0a9e('0x34')],{'$or':_['map'](_0x34dc65,function(_0x24936a){if(_0x24936a[_0x0a9e('0x29')]!==_0x0a9e('0x36')){var _0x1ef87a={};_0x1ef87a[_0x24936a['name']]={'$like':'%'+_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]+'%'};return _0x1ef87a;}})});}_0x45a1e7=_[_0x0a9e('0x37')]({},_0x45a1e7,_0x384319['options']);var _0x1dbf74={'where':_0x45a1e7[_0x0a9e('0x34')]};return db[_0x0a9e('0x26')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x1dc186[_0x0a9e('0x38')]=_0x11b61d;if(_0x384319['query'][_0x0a9e('0x39')]){_0x45a1e7[_0x0a9e('0x3a')]=[{'all':!![]}];}return db[_0x0a9e('0x26')][_0x0a9e('0x3b')](_0x45a1e7);})['then'](function(_0x5a594b){_0x1dc186[_0x0a9e('0x3c')]=_0x5a594b;return _0x1dc186;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x479bc4,_0x45a1e7))['catch'](handleError(_0x479bc4,null));};exports[_0x0a9e('0x3d')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':![],'where':{'id':_0x1dec2e[_0x0a9e('0x3e')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x2a')]=_[_0x0a9e('0x3f')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x316c8f[_0x0a9e('0x2b')]=_[_0x0a9e('0x3f')](_0x1dec2e[_0x0a9e('0x2b')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x316c8f[_0x0a9e('0x2a')],_0x316c8f[_0x0a9e('0x2b')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x2f')]));_0x5b4f5e[_0x0a9e('0x2e')]=_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x5b4f5e[_0x0a9e('0x2e')]:_0x316c8f[_0x0a9e('0x2a')];if(_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x39')]){_0x5b4f5e[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x37')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x40')]);return db['Automation'][_0x0a9e('0x41')](_0x5b4f5e)[_0x0a9e('0x22')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x22')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x42')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x43')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x26')]['create'](_0xbe9d19[_0x0a9e('0x44')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x42')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x20')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x44')]['id']){delete _0x8d6dd1[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x22')](saveUpdates(_0x8d6dd1['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x42')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x21')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x16f976[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x409789,null))['then'](removeEntity(_0x409789,null))[_0x0a9e('0x42')](handleError(_0x409789,null));};exports[_0x0a9e('0x45')]=function(_0x4f7240,_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x46')][_0x0a9e('0x41')]({'where':{'id':_0x4f7240[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4ae14b,null))[_0x0a9e('0x22')](function(_0x30decb){if(_0x30decb){return _0x30decb[_0x0a9e('0x45')](_0x4f7240[_0x0a9e('0x44')]['ids'],_['omit'](_0x4f7240['body'],[_0x0a9e('0x47'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4ae14b,null))[_0x0a9e('0x42')](handleError(_0x4ae14b,null));};exports['getConditions']=function(_0x2b69d9,_0x161aa7,_0x53d113){var _0x5a88da={};var _0x2ef381={};var _0x59c6ff;var _0x443e72;return db['Automation'][_0x0a9e('0x48')]({'where':{'id':_0x2b69d9[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x161aa7,null))['then'](function(_0x2f82da){if(_0x2f82da){_0x59c6ff=_0x2f82da;_0x2ef381[_0x0a9e('0x2a')]=_['keys'](db['Condition'][_0x0a9e('0x27')]);_0x2ef381[_0x0a9e('0x2b')]=_['keys'](_0x2b69d9[_0x0a9e('0x2b')]);_0x2ef381['filters']=_[_0x0a9e('0x2d')](_0x2ef381['model'],_0x2ef381[_0x0a9e('0x2b')]);_0x5a88da['attributes']=_['intersection'](_0x2ef381['model'],qs[_0x0a9e('0x2f')](_0x2b69d9['query'][_0x0a9e('0x2f')]));_0x5a88da[_0x0a9e('0x2e')]=_0x5a88da[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x5a88da[_0x0a9e('0x2e')]:_0x2ef381[_0x0a9e('0x2a')];_0x5a88da[_0x0a9e('0x32')]=qs[_0x0a9e('0x33')](_0x2b69d9['query'][_0x0a9e('0x33')]);_0x5a88da[_0x0a9e('0x34')]=qs[_0x0a9e('0x2c')](_[_0x0a9e('0x49')](_0x2b69d9[_0x0a9e('0x2b')],_0x2ef381[_0x0a9e('0x2c')]));if(_0x2b69d9['query'][_0x0a9e('0x35')]){_0x5a88da[_0x0a9e('0x34')]=_['merge'](_0x5a88da[_0x0a9e('0x34')],{'$or':_['map'](_0x5a88da[_0x0a9e('0x2e')],function(_0x5ba1f9){var _0x4b3c1a={};_0x4b3c1a[_0x5ba1f9]={'$like':'%'+_0x2b69d9['query'][_0x0a9e('0x35')]+'%'};return _0x4b3c1a;})});}_0x5a88da=_['merge']({},_0x5a88da,_0x2b69d9[_0x0a9e('0x40')]);return _0x59c6ff[_0x0a9e('0x4a')](_0x5a88da);}})[_0x0a9e('0x22')](function(_0x7be420){if(_0x7be420){_0x443e72=_0x7be420[_0x0a9e('0x30')];if(!_0x2b69d9[_0x0a9e('0x2b')]['hasOwnProperty'](_0x0a9e('0x31'))){_0x5a88da['limit']=qs[_0x0a9e('0x1a')](_0x2b69d9[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x5a88da['offset']=qs[_0x0a9e('0x19')](_0x2b69d9[_0x0a9e('0x2b')][_0x0a9e('0x19')]);}return _0x59c6ff[_0x0a9e('0x4a')](_0x5a88da);}})['then'](function(_0x1d0dc8){if(_0x1d0dc8){return _0x1d0dc8?{'count':_0x443e72,'rows':_0x1d0dc8}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x161aa7,null))['catch'](handleError(_0x161aa7,null));};exports[_0x0a9e('0x4b')]=function(_0x17e88c,_0x88dcbf,_0x409b29){return db[_0x0a9e('0x4c')]['find']({'where':{'id':_0x17e88c[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x22')](function(_0x47bb43){if(_0x47bb43){return _0x47bb43[_0x0a9e('0x4b')](_0x17e88c['body']['ids'],_[_0x0a9e('0x4d')](_0x17e88c[_0x0a9e('0x44')],[_0x0a9e('0x47'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x88dcbf,null))[_0x0a9e('0x42')](handleError(_0x88dcbf,null));};exports[_0x0a9e('0x4e')]=function(_0x387489,_0x54a37d,_0x2d7205){var _0x1cc4f3={};var _0x2e89b7={};var _0x19012b;var _0x2bbb86;return db[_0x0a9e('0x26')][_0x0a9e('0x48')]({'where':{'id':_0x387489[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x54a37d,null))[_0x0a9e('0x22')](function(_0x5150a4){if(_0x5150a4){_0x19012b=_0x5150a4;_0x2e89b7[_0x0a9e('0x2a')]=_[_0x0a9e('0x3f')](db[_0x0a9e('0x4c')]['rawAttributes']);_0x2e89b7[_0x0a9e('0x2b')]=_[_0x0a9e('0x3f')](_0x387489['query']);_0x2e89b7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x2e89b7[_0x0a9e('0x2a')],_0x2e89b7[_0x0a9e('0x2b')]);_0x1cc4f3[_0x0a9e('0x2e')]=_['intersection'](_0x2e89b7['model'],qs['fields'](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x2f')]));_0x1cc4f3[_0x0a9e('0x2e')]=_0x1cc4f3[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x1cc4f3[_0x0a9e('0x2e')]:_0x2e89b7[_0x0a9e('0x2a')];_0x1cc4f3[_0x0a9e('0x32')]=qs['sort'](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x33')]);_0x1cc4f3[_0x0a9e('0x34')]=qs['filters'](_[_0x0a9e('0x49')](_0x387489['query'],_0x2e89b7[_0x0a9e('0x2c')]));if(_0x387489[_0x0a9e('0x2b')]['filter']){_0x1cc4f3[_0x0a9e('0x34')]=_[_0x0a9e('0x37')](_0x1cc4f3[_0x0a9e('0x34')],{'$or':_[_0x0a9e('0x25')](_0x1cc4f3['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x35')]+'%'};return _0x2e9552;})});}_0x1cc4f3=_['merge']({},_0x1cc4f3,_0x387489[_0x0a9e('0x40')]);return _0x19012b[_0x0a9e('0x4e')](_0x1cc4f3);}})[_0x0a9e('0x22')](function(_0x361b21){if(_0x361b21){_0x2bbb86=_0x361b21['length'];if(!_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x4f')](_0x0a9e('0x31'))){_0x1cc4f3[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x1cc4f3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x387489[_0x0a9e('0x2b')][_0x0a9e('0x19')]);}return _0x19012b[_0x0a9e('0x4e')](_0x1cc4f3);}})[_0x0a9e('0x22')](function(_0xe0749e){if(_0xe0749e){return _0xe0749e?{'count':_0x2bbb86,'rows':_0xe0749e}:null;}})['then'](respondWithResult(_0x54a37d,null))[_0x0a9e('0x42')](handleError(_0x54a37d,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index b79035b..d91ebc0 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 _0xf865=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xf865,0x11a));var _0x5f86=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0xf865[_0x770f7];return _0xe797c6;};'use strict';var _=require(_0x5f86('0x0'));var util=require(_0x5f86('0x1'));var logger=require(_0x5f86('0x2'))(_0x5f86('0x3'));var moment=require(_0x5f86('0x4'));var BPromise=require(_0x5f86('0x5'));var rp=require(_0x5f86('0x6'));var fs=require('fs');var path=require(_0x5f86('0x7'));var rimraf=require(_0x5f86('0x8'));var config=require(_0x5f86('0x9'));var attributes=require(_0x5f86('0xa'));module['exports']=function(_0x341d37,_0x5332e4){return _0x341d37[_0x5f86('0xb')]('Automation',attributes,{'tableName':_0x5f86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc5d=['exports','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x305551,_0x868339){var _0x115ce2=function(_0x49265b){while(--_0x49265b){_0x305551['push'](_0x305551['shift']());}};_0x115ce2(++_0x868339);}(_0xdc5d,0x14d));var _0xddc5=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0xdc5d[_0x13ff53];return _0x290228;};'use strict';var _=require(_0xddc5('0x0'));var util=require(_0xddc5('0x1'));var logger=require(_0xddc5('0x2'))(_0xddc5('0x3'));var moment=require(_0xddc5('0x4'));var BPromise=require(_0xddc5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddc5('0x6'));var rimraf=require(_0xddc5('0x7'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xddc5('0x8')]=function(_0x29fb3a,_0x55edd4){return _0x29fb3a[_0xddc5('0x9')]('Automation',attributes,{'tableName':_0xddc5('0xa'),'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 b9b547a..de05ee5 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 _0x153a=['Automation,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf175ff,_0x2ec742){var _0x34f944=function(_0x3e245a){while(--_0x3e245a){_0xf175ff['push'](_0xf175ff['shift']());}};_0x34f944(++_0x2ec742);}(_0x153a,0x172));var _0xa153=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x153a[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0xa153('0x0'));var util=require(_0xa153('0x1'));var moment=require(_0xa153('0x2'));var BPromise=require(_0xa153('0x3'));var rs=require(_0xa153('0x4'));var fs=require('fs');var Redis=require(_0xa153('0x5'));var db=require(_0xa153('0x6'))['db'];var utils=require(_0xa153('0x7'));var logger=require(_0xa153('0x8'))(_0xa153('0x9'));var config=require(_0xa153('0xa'));var jayson=require(_0xa153('0xb'));var client=jayson['client'][_0xa153('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ca177,_0x36c970,_0x11457a){return new BPromise(function(_0x5b2676,_0x5423f7){return client['request'](_0x3ca177,_0x11457a)[_0xa153('0xd')](function(_0x3e7328){logger[_0xa153('0xe')]('Automation,\x20%s,\x20%s',_0x36c970,_0xa153('0xf'));logger[_0xa153('0x10')](_0xa153('0x11'),_0x36c970,_0xa153('0xf'),JSON[_0xa153('0x12')](_0x3e7328));if(_0x3e7328[_0xa153('0x13')]){if(_0x3e7328[_0xa153('0x13')][_0xa153('0x14')]===0x1f4){logger['error'](_0xa153('0x15'),_0x36c970,_0x3e7328[_0xa153('0x13')][_0xa153('0x16')]);return _0x5423f7(_0x3e7328[_0xa153('0x13')][_0xa153('0x16')]);}logger[_0xa153('0x13')]('Automation,\x20%s,\x20%s',_0x36c970,_0x3e7328['error'][_0xa153('0x16')]);return _0x5b2676(_0x3e7328[_0xa153('0x13')][_0xa153('0x16')]);}else{logger[_0xa153('0xe')](_0xa153('0x15'),_0x36c970,_0xa153('0xf'));_0x5b2676(_0x3e7328['result'][_0xa153('0x16')]);}})['catch'](function(_0x13e807){logger[_0xa153('0x13')](_0xa153('0x15'),_0x36c970,_0x13e807);_0x5423f7(_0x13e807);});});}
\ No newline at end of file
+var _0x8f73=['info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then'];(function(_0x8d695e,_0x394999){var _0x3d156e=function(_0x38cf6f){while(--_0x38cf6f){_0x8d695e['push'](_0x8d695e['shift']());}};_0x3d156e(++_0x394999);}(_0x8f73,0x12b));var _0x38f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f73[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x38f7('0x0'));var util=require(_0x38f7('0x1'));var moment=require(_0x38f7('0x2'));var BPromise=require(_0x38f7('0x3'));var rs=require(_0x38f7('0x4'));var fs=require('fs');var Redis=require(_0x38f7('0x5'));var db=require(_0x38f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x38f7('0x7'));var config=require(_0x38f7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x38f7('0x9')][_0x38f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ef086,_0x5a8dc8,_0x53e886){return new BPromise(function(_0x12959e,_0x268acf){return client[_0x38f7('0xb')](_0x4ef086,_0x53e886)[_0x38f7('0xc')](function(_0x3a0c27){logger[_0x38f7('0xd')](_0x38f7('0xe'),_0x5a8dc8,'request\x20sent');logger[_0x38f7('0xf')](_0x38f7('0x10'),_0x5a8dc8,_0x38f7('0x11'),JSON[_0x38f7('0x12')](_0x3a0c27));if(_0x3a0c27[_0x38f7('0x13')]){if(_0x3a0c27[_0x38f7('0x13')][_0x38f7('0x14')]===0x1f4){logger['error'](_0x38f7('0xe'),_0x5a8dc8,_0x3a0c27['error']['message']);return _0x268acf(_0x3a0c27[_0x38f7('0x13')][_0x38f7('0x15')]);}logger['error'](_0x38f7('0xe'),_0x5a8dc8,_0x3a0c27[_0x38f7('0x13')][_0x38f7('0x15')]);return _0x12959e(_0x3a0c27[_0x38f7('0x13')][_0x38f7('0x15')]);}else{logger['info'](_0x38f7('0xe'),_0x5a8dc8,_0x38f7('0x11'));_0x12959e(_0x3a0c27[_0x38f7('0x16')]['message']);}})[_0x38f7('0x17')](function(_0x87e53e){logger[_0x38f7('0x13')](_0x38f7('0xe'),_0x5a8dc8,_0x87e53e);_0x268acf(_0x87e53e);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 4b85ee5..6e090f0 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 _0xd6aa=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','update','delete'];(function(_0x1f5c85,_0x5e4141){var _0xc6dd55=function(_0x35b107){while(--_0x35b107){_0x1f5c85['push'](_0x1f5c85['shift']());}};_0xc6dd55(++_0x5e4141);}(_0xd6aa,0x182));var _0xad6a=function(_0x59bffa,_0x598dd8){_0x59bffa=_0x59bffa-0x0;var _0x8ea3ba=_0xd6aa[_0x59bffa];return _0x8ea3ba;};'use strict';var multer=require(_0xad6a('0x0'));var util=require(_0xad6a('0x1'));var path=require('path');var timeout=require(_0xad6a('0x2'));var express=require('express');var router=express[_0xad6a('0x3')]();var auth=require(_0xad6a('0x4'));var interaction=require(_0xad6a('0x5'));var config=require(_0xad6a('0x6'));var controller=require(_0xad6a('0x7'));router[_0xad6a('0x8')]('/',auth[_0xad6a('0x9')](),controller[_0xad6a('0xa')]);router[_0xad6a('0x8')](_0xad6a('0xb'),auth['isAuthenticated'](),controller[_0xad6a('0xc')]);router['get'](_0xad6a('0xd'),auth['isAuthenticated'](),controller[_0xad6a('0xe')]);router[_0xad6a('0x8')](_0xad6a('0xf'),auth[_0xad6a('0x9')](),controller[_0xad6a('0x10')]);router['post']('/',auth[_0xad6a('0x9')](),controller[_0xad6a('0x11')]);router[_0xad6a('0x12')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0xad6a('0x12')]('/:id/actions',auth['isAuthenticated'](),controller[_0xad6a('0x13')]);router['put'](_0xad6a('0xb'),auth[_0xad6a('0x9')](),controller[_0xad6a('0x14')]);router[_0xad6a('0x15')](_0xad6a('0xb'),auth[_0xad6a('0x9')](),controller[_0xad6a('0x16')]);module[_0xad6a('0x17')]=router;
\ No newline at end of file
+var _0x597c=['/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x480f4a,_0x2ea3f8){var _0xdccb7d=function(_0x151258){while(--_0x151258){_0x480f4a['push'](_0x480f4a['shift']());}};_0xdccb7d(++_0x2ea3f8);}(_0x597c,0x16d));var _0xc597=function(_0x212dcf,_0x4f4e83){_0x212dcf=_0x212dcf-0x0;var _0x53f0b1=_0x597c[_0x212dcf];return _0x53f0b1;};'use strict';var multer=require(_0xc597('0x0'));var util=require(_0xc597('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc597('0x2')]();var auth=require(_0xc597('0x3'));var interaction=require(_0xc597('0x4'));var config=require(_0xc597('0x5'));var controller=require('./automation.controller');router[_0xc597('0x6')]('/',auth[_0xc597('0x7')](),controller[_0xc597('0x8')]);router[_0xc597('0x6')](_0xc597('0x9'),auth[_0xc597('0x7')](),controller[_0xc597('0xa')]);router['get'](_0xc597('0xb'),auth[_0xc597('0x7')](),controller[_0xc597('0xc')]);router[_0xc597('0x6')]('/:id/actions',auth[_0xc597('0x7')](),controller[_0xc597('0xd')]);router[_0xc597('0xe')]('/',auth[_0xc597('0x7')](),controller[_0xc597('0xf')]);router[_0xc597('0xe')](_0xc597('0xb'),auth[_0xc597('0x7')](),controller[_0xc597('0x10')]);router[_0xc597('0xe')](_0xc597('0x11'),auth['isAuthenticated'](),controller[_0xc597('0x12')]);router[_0xc597('0x13')](_0xc597('0x9'),auth[_0xc597('0x7')](),controller[_0xc597('0x14')]);router[_0xc597('0x15')](_0xc597('0x9'),auth[_0xc597('0x7')](),controller['destroy']);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 b9453c1..f0f7ed5 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 _0x23e8=['exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x235802,_0x423aaa){var _0xd80393=function(_0x2e061a){while(--_0x2e061a){_0x235802['push'](_0x235802['shift']());}};_0xd80393(++_0x423aaa);}(_0x23e8,0x180));var _0x823e=function(_0x53d48b,_0x23ceb3){_0x53d48b=_0x53d48b-0x0;var _0x1d95f6=_0x23e8[_0x53d48b];return _0x1d95f6;};'use strict';var Sequelize=require(_0x823e('0x0'));module[_0x823e('0x1')]={'name':{'type':Sequelize[_0x823e('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x823e('0x3')](_0x823e('0x4')),'allowNull':![],'defaultValue':_0x823e('0x4')},'description':{'type':Sequelize[_0x823e('0x2')]},'active':{'type':Sequelize[_0x823e('0x5')],'defaultValue':0x0,'comment':_0x823e('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x823e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x823e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x823e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)[_0x823e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)[_0x823e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x823e('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)[_0x823e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x823e('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x823e('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x823e('0x3')](_0x823e('0xf'),_0x823e('0x10'),'onlyIfOpen'),'defaultValue':_0x823e('0xf')},'dialAMDActive':{'type':Sequelize[_0x823e('0x5')],'defaultValue':0x0,'comment':_0x823e('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x823e('0x8')](0x9)[_0x823e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x823e('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x823e('0x8')](0x9)[_0x823e('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x823e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x823e('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x823e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x823e('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x823e('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x823e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x823e('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x823e('0x8')](0x5)[_0x823e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x823e('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x823e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x823e('0x17'),'ASC'),'defaultValue':_0x823e('0x17')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x823e('0x18')},'dialCutDigit':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x823e('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x823e('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)[_0x823e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x823e('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x823e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x823e('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x823e('0x8')](0x3)[_0x823e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x823e('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x823e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x823e('0x22')}};
\ No newline at end of file
+var _0xa162=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xa162,0x15f));var _0x2a16=function(_0x140466,_0x3d32d1){_0x140466=_0x140466-0x0;var _0x2bbe06=_0xa162[_0x140466];return _0x2bbe06;};'use strict';var Sequelize=require(_0x2a16('0x0'));module[_0x2a16('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2a16('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2a16('0x3')](_0x2a16('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x2a16('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x2a16('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2a16('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2a16('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2a16('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2a16('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a16('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)[_0x2a16('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a16('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x2a16('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)[_0x2a16('0x6')],'defaultValue':0x3,'comment':_0x2a16('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2a16('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a16('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2a16('0xd')},'dialTimezone':{'type':Sequelize[_0x2a16('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2a16('0x5')],'defaultValue':_0x2a16('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x2a16('0x3')]('always',_0x2a16('0xf'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x2a16('0x10')],'defaultValue':0x0,'comment':_0x2a16('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x2a16('0x9')](0x9)[_0x2a16('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x2a16('0x9')](0x9)[_0x2a16('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a16('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a16('0x9')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2a16('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a16('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2a16('0x9')](0x9)[_0x2a16('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a16('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a16('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2a16('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x2a16('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2a16('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a16('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a16('0x3')](_0x2a16('0x18'),_0x2a16('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x2a16('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2a16('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a16('0x1a')},'dialCutDigit':{'type':Sequelize[_0x2a16('0x9')](0x3)[_0x2a16('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a16('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)[_0x2a16('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a16('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a16('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a16('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x2a16('0x9')](0x5)[_0x2a16('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a16('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)[_0x2a16('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2a16('0x9')](0x5)[_0x2a16('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a16('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a16('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2a16('0x9')](0x5)[_0x2a16('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a16('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2a16('0x9')](0x3)[_0x2a16('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2a16('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 3d03c94..808a7f6 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 _0xa9e0=['NOW()','scheduledAt','ContactId','CmListId','toString','from','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_contacts','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','count','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','autoAssociation','getHoppers','findOne','CmHopper','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ListId','select','field'];(function(_0x43a847,_0x6219a7){var _0x40366b=function(_0x10e153){while(--_0x10e153){_0x43a847['push'](_0x43a847['shift']());}};_0x40366b(++_0x6219a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);_0x11c3b6['where']=qs[_0x0a9e('0x39')](_['pick'](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]),_0x3652a7);if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x11c3b6['where']=_[_0x0a9e('0x3b')](_0x11c3b6[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x533942){if(_0x533942[_0x0a9e('0x2d')]!==_0x0a9e('0x3d')){var _0x289467={};_0x289467[_0x533942['name']]={'$like':'%'+_0x140511['query'][_0x0a9e('0x3a')]+'%'};return _0x289467;}})});}_0x11c3b6=_[_0x0a9e('0x3b')]({},_0x11c3b6,_0x140511['options']);var _0x2b814e={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x3e')](_0x2b814e)['then'](function(_0x5a594b){_0x5a101a[_0x0a9e('0x3e')]=_0x5a594b;if(_0x140511[_0x0a9e('0x30')]['includeAll']){_0x11c3b6[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x11c3b6);})['then'](function(_0x316c8f){_0x5a101a[_0x0a9e('0x41')]=_0x316c8f;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x42')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x43')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':![],'where':{'id':_0xeaa5e5[_0x0a9e('0x44')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x30')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],_0x23b089[_0x0a9e('0x30')]);_0x45a9b8[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x33')]=_0x45a9b8[_0x0a9e('0x33')]['length']?_0x45a9b8[_0x0a9e('0x33')]:_0x23b089[_0x0a9e('0x2f')];if(_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x45a9b8[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3b')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x46')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x22')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x42')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x48')],{})[_0x0a9e('0x22')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x49')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4a'));if(_0x37be73[_0x0a9e('0x4b')]===_0x0a9e('0x49')){var _0x16f976=_0x45c845[_0x0a9e('0x4c')]({'plain':!![]});var _0x992c77=_0x0a9e('0x23');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x22')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x42')](function(_0x61bb17){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x22')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['clone']=function(_0x53975a,_0x39d77d){var _0x204173={'where':{'id':_0x53975a['params']['id']}},_0x14d602={};_0x14d602[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db['Campaign']['rawAttributes']);_0x204173[_0x0a9e('0x33')]=_['intersection'](_0x14d602[_0x0a9e('0x2f')],qs['fields'](_0x53975a[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x204173[_0x0a9e('0x33')]=_0x204173['attributes'][_0x0a9e('0x35')]?_0x204173[_0x0a9e('0x33')]:_0x14d602['model'];if(_0x53975a['query'][_0x0a9e('0x45')]){_0x204173[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x204173=_['merge']({},_0x204173,_0x53975a[_0x0a9e('0x46')]);return db['Campaign'][_0x0a9e('0x4e')](_0x204173)['then'](handleEntityNotFound(_0x39d77d,null))[_0x0a9e('0x22')](function(_0x4a6deb){if(_0x4a6deb){var _0x5da27d=_0x4a6deb['get']({'plain':!![]});_0x5da27d=qs[_0x0a9e('0x51')](_0x5da27d,['id','createdAt',_0x0a9e('0x52')]);_0x53975a[_0x0a9e('0x48')]=_[_0x0a9e('0x51')](_0x53975a[_0x0a9e('0x48')],['id',_0x0a9e('0x53'),_0x0a9e('0x52')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_['merge'](_0x5da27d,_0x53975a[_0x0a9e('0x48')]),{'include':_0x53975a[_0x0a9e('0x30')][_0x0a9e('0x45')]?[{'all':!![]}]:undefined})[_0x0a9e('0x22')](function(_0xb83dfd){var _0x156662=_0x53975a['user'][_0x0a9e('0x4c')]({'plain':!![]});if(!_0x156662)throw new Error(_0x0a9e('0x4a'));if(_0x156662['role']===_0x0a9e('0x49')){var _0x5cc8fb=_0xb83dfd[_0x0a9e('0x4c')]({'plain':!![]});var _0x5ba1f9='IvrCampaigns';return db['UserProfileSection'][_0x0a9e('0x4e')]({'where':{'name':_0x5ba1f9,'userProfileId':_0x156662['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x1fc70e){if(_0x1fc70e&&_0x1fc70e[_0x0a9e('0x54')]===0x0){return db[_0x0a9e('0x24')][_0x0a9e('0x47')]({'name':_0x5cc8fb[_0x0a9e('0x26')],'resourceId':_0x5cc8fb['id'],'type':_0x1fc70e['name'],'sectionId':_0x1fc70e['id']},{})[_0x0a9e('0x22')](function(){return _0xb83dfd;});}else{return _0xb83dfd;}})['catch'](function(_0xca4ade){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0xca4ade);throw _0xca4ade;});}return _0xb83dfd;});}})['then'](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x42')](handleError(_0x39d77d,null));};exports[_0x0a9e('0x20')]=function(_0x119677,_0x32e134){if(_0x119677['body']['id']){delete _0x119677[_0x0a9e('0x48')]['id'];}return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x119677[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x32e134,null))[_0x0a9e('0x22')](saveUpdates(_0x119677[_0x0a9e('0x48')],null))[_0x0a9e('0x22')](respondWithResult(_0x32e134,null))['catch'](handleError(_0x32e134,null));};exports[_0x0a9e('0x21')]=function(_0x2937e0,_0x281c7d){return db['Campaign'][_0x0a9e('0x4e')]({'where':{'id':_0x2937e0['params']['id']}})['then'](handleEntityNotFound(_0x281c7d,null))[_0x0a9e('0x22')](removeEntity(_0x281c7d,null))[_0x0a9e('0x42')](handleError(_0x281c7d,null));};exports[_0x0a9e('0x55')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489={'raw':!![],'where':{}};var _0x54a37d={};var _0x2d7205={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x19c995[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x186f39,null))[_0x0a9e('0x22')](function(_0x320898){if(_0x320898){_0x54a37d[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x57')]['rawAttributes']);_0x54a37d[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x19c995[_0x0a9e('0x30')]);_0x54a37d['filters']=_[_0x0a9e('0x32')](_0x54a37d[_0x0a9e('0x2f')],_0x54a37d['query']);_0x387489[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x54a37d[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x19c995[_0x0a9e('0x30')]['fields']));_0x387489['attributes']=_0x387489['attributes'][_0x0a9e('0x35')]?_0x387489[_0x0a9e('0x33')]:_0x54a37d[_0x0a9e('0x2f')];if(!_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x387489[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x19c995['query'][_0x0a9e('0x1a')]);_0x387489[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x19c995['query'][_0x0a9e('0x19')]);}_0x387489['order']=qs[_0x0a9e('0x38')](_0x19c995[_0x0a9e('0x30')]['sort']);_0x387489[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x19c995[_0x0a9e('0x30')],_0x54a37d['filters']));_0x387489[_0x0a9e('0x3c')][_0x0a9e('0x5a')]=_0x320898['id'];if(_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x387489['where']=_[_0x0a9e('0x3b')](_0x387489[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x387489[_0x0a9e('0x33')],function(_0x4abc8f){var _0x290d43={};_0x290d43[_0x4abc8f]={'$like':'%'+_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x290d43;})});}_0x387489=_[_0x0a9e('0x3b')]({},_0x387489,_0x19c995[_0x0a9e('0x46')]);return db[_0x0a9e('0x57')][_0x0a9e('0x3e')]({'where':_0x387489[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0x336dc3){_0x2d7205[_0x0a9e('0x3e')]=_0x336dc3;if(_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x387489[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x0a9e('0x40')](_0x387489);})[_0x0a9e('0x22')](function(_0xc599b3){_0x2d7205['rows']=_0xc599b3;return _0x2d7205;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x186f39,_0x387489))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x5b')]=function(_0x2b9463,_0x56d650,_0x541e80){var _0x7ebea8={'raw':!![],'where':{}};var _0x2bbdb5={};var _0x4c54fa={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x2b9463[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x56d650,null))['then'](function(_0x28a942){if(_0x28a942){_0x2bbdb5[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x5c')][_0x0a9e('0x2b')]);_0x2bbdb5[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x2b9463['query']);_0x2bbdb5[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2bbdb5[_0x0a9e('0x2f')],_0x2bbdb5[_0x0a9e('0x30')]);_0x7ebea8['attributes']=_[_0x0a9e('0x32')](_0x2bbdb5[_0x0a9e('0x2f')],qs['fields'](_0x2b9463[_0x0a9e('0x30')]['fields']));_0x7ebea8[_0x0a9e('0x33')]=_0x7ebea8[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x7ebea8[_0x0a9e('0x33')]:_0x2bbdb5['model'];if(!_0x2b9463['query'][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x7ebea8[_0x0a9e('0x1a')]=qs['limit'](_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x7ebea8['offset']=qs['offset'](_0x2b9463[_0x0a9e('0x30')]['offset']);}_0x7ebea8['order']=qs['sort'](_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x7ebea8[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x2b9463[_0x0a9e('0x30')],_0x2bbdb5['filters']));_0x7ebea8[_0x0a9e('0x3c')]['CampaignId']=_0x28a942['id'];if(_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x7ebea8[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x7ebea8['where'],{'$or':_[_0x0a9e('0x29')](_0x7ebea8[_0x0a9e('0x33')],function(_0x1d4877){var _0x5b74c3={};_0x5b74c3[_0x1d4877]={'$like':'%'+_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x5b74c3;})});}_0x7ebea8=_[_0x0a9e('0x3b')]({},_0x7ebea8,_0x2b9463[_0x0a9e('0x46')]);return db[_0x0a9e('0x5c')][_0x0a9e('0x3e')]({'where':_0x7ebea8[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0x509efe){_0x4c54fa[_0x0a9e('0x3e')]=_0x509efe;if(_0x2b9463[_0x0a9e('0x30')]['includeAll']){_0x7ebea8[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5c')][_0x0a9e('0x40')](_0x7ebea8);})['then'](function(_0x96672f){_0x4c54fa['rows']=_0x96672f;return _0x4c54fa;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x56d650,_0x7ebea8))[_0x0a9e('0x42')](handleError(_0x56d650,null));};exports[_0x0a9e('0x5d')]=function(_0x1f29bd,_0x842d6f,_0x16341a){var _0x16a039={'raw':!![],'where':{}};var _0x3a9a85={};var _0x501050={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x1f29bd[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x842d6f,null))[_0x0a9e('0x22')](function(_0x3df9e4){if(_0x3df9e4){_0x3a9a85[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x5e')][_0x0a9e('0x2b')]);_0x3a9a85[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1f29bd[_0x0a9e('0x30')]);_0x3a9a85['filters']=_[_0x0a9e('0x32')](_0x3a9a85[_0x0a9e('0x2f')],_0x3a9a85[_0x0a9e('0x30')]);_0x16a039[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x3a9a85['model'],qs[_0x0a9e('0x34')](_0x1f29bd[_0x0a9e('0x30')]['fields']));_0x16a039[_0x0a9e('0x33')]=_0x16a039['attributes'][_0x0a9e('0x35')]?_0x16a039[_0x0a9e('0x33')]:_0x3a9a85[_0x0a9e('0x2f')];if(!_0x1f29bd[_0x0a9e('0x30')]['hasOwnProperty'](_0x0a9e('0x58'))){_0x16a039['limit']=qs[_0x0a9e('0x1a')](_0x1f29bd[_0x0a9e('0x30')]['limit']);_0x16a039[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1f29bd[_0x0a9e('0x30')]['offset']);}_0x16a039['order']=qs[_0x0a9e('0x38')](_0x1f29bd[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x16a039[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x1f29bd[_0x0a9e('0x30')],_0x3a9a85[_0x0a9e('0x39')]));_0x16a039[_0x0a9e('0x3c')]['CampaignId']=_0x3df9e4['id'];if(_0x1f29bd[_0x0a9e('0x30')]['filter']){_0x16a039[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x16a039[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x16a039[_0x0a9e('0x33')],function(_0x4e7273){var _0x436313={};_0x436313[_0x4e7273]={'$like':'%'+_0x1f29bd[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x436313;})});}_0x16a039=_[_0x0a9e('0x3b')]({},_0x16a039,_0x1f29bd[_0x0a9e('0x46')]);return db['CmHopperFinal']['count']({'where':_0x16a039[_0x0a9e('0x3c')]})['then'](function(_0x25eae0){_0x501050[_0x0a9e('0x3e')]=_0x25eae0;if(_0x1f29bd[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x16a039[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5e')]['findAll'](_0x16a039);})['then'](function(_0x1889ed){_0x501050['rows']=_0x1889ed;return _0x501050;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x842d6f,_0x16a039))['catch'](handleError(_0x842d6f,null));};exports[_0x0a9e('0x5f')]=function(_0x564db2,_0x558d60,_0x1c49dc){var _0xb8db59={'raw':!![],'where':{}};var _0x5e9b0b={};var _0x170af6={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x564db2[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x558d60,null))['then'](function(_0x5505f4){if(_0x5505f4){_0x5e9b0b[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x60')][_0x0a9e('0x2b')]);_0x5e9b0b[_0x0a9e('0x30')]=_['keys'](_0x564db2[_0x0a9e('0x30')]);_0x5e9b0b[_0x0a9e('0x39')]=_['intersection'](_0x5e9b0b[_0x0a9e('0x2f')],_0x5e9b0b[_0x0a9e('0x30')]);_0xb8db59[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5e9b0b[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0xb8db59[_0x0a9e('0x33')]=_0xb8db59[_0x0a9e('0x33')]['length']?_0xb8db59[_0x0a9e('0x33')]:_0x5e9b0b[_0x0a9e('0x2f')];if(!_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0xb8db59['limit']=qs['limit'](_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0xb8db59[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x564db2[_0x0a9e('0x30')]['offset']);}_0xb8db59[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x564db2[_0x0a9e('0x30')]['sort']);_0xb8db59[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x59')](_0x564db2['query'],_0x5e9b0b[_0x0a9e('0x39')]));_0xb8db59[_0x0a9e('0x3c')][_0x0a9e('0x5a')]=_0x5505f4['id'];if(_0x564db2['query'][_0x0a9e('0x3a')]){_0xb8db59['where']=_[_0x0a9e('0x3b')](_0xb8db59[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0xb8db59[_0x0a9e('0x33')],function(_0x3a5836){var _0x1bee04={};_0x1bee04[_0x3a5836]={'$like':'%'+_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x1bee04;})});}_0xb8db59=_[_0x0a9e('0x3b')]({},_0xb8db59,_0x564db2[_0x0a9e('0x46')]);return db[_0x0a9e('0x60')][_0x0a9e('0x3e')]({'where':_0xb8db59[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0x98c62c){_0x170af6[_0x0a9e('0x3e')]=_0x98c62c;if(_0x564db2['query']['includeAll']){_0xb8db59[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0a9e('0x40')](_0xb8db59);})[_0x0a9e('0x22')](function(_0x5d6b69){_0x170af6[_0x0a9e('0x41')]=_0x5d6b69;return _0x170af6;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x558d60,_0xb8db59))[_0x0a9e('0x42')](handleError(_0x558d60,null));};exports[_0x0a9e('0x61')]=function(_0x5585d5,_0x148fd9,_0x26cb76){var _0x374f0b={};var _0x34a791={};var _0x5d0e1f;var _0x19e9ed;return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x5585d5['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x148fd9,null))[_0x0a9e('0x22')](function(_0x17b29d){if(_0x17b29d){_0x5d0e1f=_0x17b29d;_0x34a791['model']=_[_0x0a9e('0x31')](db[_0x0a9e('0x62')][_0x0a9e('0x2b')]);_0x34a791[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x5585d5['query']);_0x34a791[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x34a791['model'],_0x34a791[_0x0a9e('0x30')]);_0x374f0b[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x34a791['model'],qs['fields'](_0x5585d5['query'][_0x0a9e('0x34')]));_0x374f0b[_0x0a9e('0x33')]=_0x374f0b['attributes'][_0x0a9e('0x35')]?_0x374f0b[_0x0a9e('0x33')]:_0x34a791[_0x0a9e('0x2f')];_0x374f0b['order']=qs[_0x0a9e('0x38')](_0x5585d5[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x374f0b[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x5585d5[_0x0a9e('0x30')],_0x34a791[_0x0a9e('0x39')]));if(_0x5585d5[_0x0a9e('0x30')]['filter']){_0x374f0b[_0x0a9e('0x3c')]=_['merge'](_0x374f0b[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x374f0b[_0x0a9e('0x33')],function(_0x3cf222){var _0x407e9d={};_0x407e9d[_0x3cf222]={'$like':'%'+_0x5585d5[_0x0a9e('0x30')]['filter']+'%'};return _0x407e9d;})});}_0x374f0b=_[_0x0a9e('0x3b')]({},_0x374f0b,_0x5585d5[_0x0a9e('0x46')]);return _0x5d0e1f[_0x0a9e('0x61')](_0x374f0b);}})[_0x0a9e('0x22')](function(_0x51aa2f){if(_0x51aa2f){_0x19e9ed=_0x51aa2f[_0x0a9e('0x35')];if(!_0x5585d5[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x374f0b[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x5585d5[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x374f0b[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x5585d5['query'][_0x0a9e('0x19')]);}return _0x5d0e1f[_0x0a9e('0x61')](_0x374f0b);}})[_0x0a9e('0x22')](function(_0x26b826){if(_0x26b826){return _0x26b826?{'count':_0x19e9ed,'rows':_0x26b826}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x148fd9,null))[_0x0a9e('0x42')](handleError(_0x148fd9,null));};exports[_0x0a9e('0x63')]=function(_0x20ae21,_0x566b90,_0x3b581c){var _0xd2391,_0x1a9ef1;return db['Campaign'][_0x0a9e('0x4e')]({'where':{'id':_0x20ae21[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x22')](function(_0x370b5e){if(_0x370b5e){_0x1a9ef1=_0x370b5e;return _0x370b5e[_0x0a9e('0x63')](_0x20ae21[_0x0a9e('0x48')][_0x0a9e('0x64')],_[_0x0a9e('0x51')](_0x20ae21[_0x0a9e('0x48')],['ids','id'])||{});}return null;})[_0x0a9e('0x65')](function(_0x446e6){var _0x15a9ed;_0xd2391=_0x446e6||[];var _0x3db98f=[];if(_0x446e6){for(var _0x2b624e=0x0;_0x2b624e<_0x446e6[_0x0a9e('0x35')];_0x2b624e+=0x1){var _0x5cb48d=_0x446e6[_0x2b624e][_0x0a9e('0x4c')]({'plain':!![]});_0x1a9ef1['dialCheckDuplicateType']=_0x20ae21['body']['dialCheckDuplicateType']?_0x20ae21[_0x0a9e('0x48')][_0x0a9e('0x66')]:_0x1a9ef1[_0x0a9e('0x66')];switch(_0x1a9ef1[_0x0a9e('0x66')]){case'always':_0x15a9ed=squel[_0x0a9e('0x67')]()[_0x0a9e('0x68')](_0x0a9e('0x69'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),'scheduledAt','ContactId',_0x0a9e('0x6c'),_0x0a9e('0x5a'),_0x0a9e('0x53'),'updatedAt'],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x6b'),'phone')[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x70'))['field']('id',_0x0a9e('0x71'))[_0x0a9e('0x6e')](_0x5cb48d[_0x0a9e('0x72')]['toString'](),'ListId')['field'](_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')](),_0x0a9e('0x5a'))[_0x0a9e('0x6e')]('NOW()',_0x0a9e('0x53'))['field'](_0x0a9e('0x6f'),_0x0a9e('0x52'))[_0x0a9e('0x74')]('cm_contacts')[_0x0a9e('0x3c')](_0x0a9e('0x75'))[_0x0a9e('0x3c')]('ListId\x20=\x20?',_0x5cb48d[_0x0a9e('0x72')]['toString']())[_0x0a9e('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x0a9e('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x76'))[_0x0a9e('0x74')](_0x0a9e('0x77'))[_0x0a9e('0x3c')](_0x0a9e('0x78'),_0x20ae21['params']['id'][_0x0a9e('0x73')]()))[_0x0a9e('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')]('COALESCE(phone,\x27\x27)')[_0x0a9e('0x74')](_0x0a9e('0x69'))[_0x0a9e('0x3c')]('CampaignId\x20=\x20?',_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')]())))[_0x0a9e('0x73')]();break;case _0x0a9e('0x79'):_0x15a9ed=squel[_0x0a9e('0x67')]()[_0x0a9e('0x68')](_0x0a9e('0x69'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),_0x0a9e('0x70'),'ContactId',_0x0a9e('0x6c'),'CampaignId',_0x0a9e('0x53'),_0x0a9e('0x52')],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x6b'),_0x0a9e('0x6b'))['field'](_0x0a9e('0x6f'),_0x0a9e('0x70'))[_0x0a9e('0x6e')]('id','ContactId')[_0x0a9e('0x6e')](_0x5cb48d[_0x0a9e('0x72')][_0x0a9e('0x73')](),_0x0a9e('0x6c'))[_0x0a9e('0x6e')](_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')](),'CampaignId')[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x53'))[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x52'))[_0x0a9e('0x74')]('cm_contacts')['where'](_0x0a9e('0x75'))[_0x0a9e('0x3c')](_0x0a9e('0x7a'),_0x5cb48d[_0x0a9e('0x72')][_0x0a9e('0x73')]())[_0x0a9e('0x3c')](_0x0a9e('0x7b'))['where'](_0x0a9e('0x7c'),squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x7d'))[_0x0a9e('0x74')](_0x0a9e('0x69'))[_0x0a9e('0x3c')]('CampaignId\x20=\x20?',_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')]())))[_0x0a9e('0x73')]();break;default:_0x15a9ed=squel['insert']()[_0x0a9e('0x68')](_0x0a9e('0x69'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),'scheduledAt',_0x0a9e('0x71'),_0x0a9e('0x6c'),_0x0a9e('0x5a'),_0x0a9e('0x53'),_0x0a9e('0x52')],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x6b'),'phone')[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x70'))[_0x0a9e('0x6e')]('id','ContactId')['field'](_0x5cb48d[_0x0a9e('0x72')][_0x0a9e('0x73')](),_0x0a9e('0x6c'))['field'](_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')](),'CampaignId')[_0x0a9e('0x6e')]('NOW()',_0x0a9e('0x53'))['field']('NOW()','updatedAt')[_0x0a9e('0x74')](_0x0a9e('0x7e'))[_0x0a9e('0x3c')](_0x0a9e('0x75'))[_0x0a9e('0x3c')](_0x0a9e('0x7a'),_0x5cb48d['CmListId'][_0x0a9e('0x73')]())[_0x0a9e('0x3c')](_0x0a9e('0x7b')))[_0x0a9e('0x73')]();}_0x3db98f[_0x0a9e('0x7f')](db[_0x0a9e('0x80')][_0x0a9e('0x30')](_0x15a9ed));}return BPromise['all'](_0x3db98f);}})['then'](function(){return _0xd2391;})[_0x0a9e('0x22')](respondWithResult(_0x566b90,null))['catch'](handleError(_0x566b90,null));};exports[_0x0a9e('0x81')]=function(_0xb326cb,_0x1f0318,_0xa3695f){return db[_0x0a9e('0x2a')][_0x0a9e('0x4e')]({'where':{'id':_0xb326cb['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1f0318,null))['then'](function(_0x50e32a){if(_0x50e32a){return _0x50e32a[_0x0a9e('0x81')](_0xb326cb['query'][_0x0a9e('0x64')]);}})['then'](function(_0x550cbf){if(_0x550cbf){return db[_0x0a9e('0x57')]['destroy']({'where':{'ListId':_0xb326cb[_0x0a9e('0x30')][_0x0a9e('0x64')],'CampaignId':_0xb326cb[_0x0a9e('0x44')]['id']}})['then'](function(){return _0x550cbf;});}})[_0x0a9e('0x22')](respondWithStatusCode(_0x1f0318,null))[_0x0a9e('0x42')](handleError(_0x1f0318,null));};exports[_0x0a9e('0x82')]=function(_0x55b69e,_0x5236c9,_0xdc77d){var _0x948aab={'raw':!![],'where':{}};var _0x89d2cb={};var _0x2f79fb={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x55b69e[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x5236c9,null))[_0x0a9e('0x22')](function(_0x1020a0){if(_0x1020a0){_0x89d2cb['model']=_['keys'](db['CmList'][_0x0a9e('0x2b')]);_0x89d2cb[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x55b69e[_0x0a9e('0x30')]);_0x89d2cb[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x89d2cb[_0x0a9e('0x2f')],_0x89d2cb[_0x0a9e('0x30')]);_0x948aab['attributes']=_['intersection'](_0x89d2cb[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x55b69e['query'][_0x0a9e('0x34')]));_0x948aab[_0x0a9e('0x33')]=_0x948aab[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x948aab[_0x0a9e('0x33')]:_0x89d2cb[_0x0a9e('0x2f')];if(!_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x948aab[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x55b69e[_0x0a9e('0x30')]['limit']);_0x948aab[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x19')]);}_0x948aab[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x948aab[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x55b69e[_0x0a9e('0x30')],_0x89d2cb['filters']));_0x948aab['where'][_0x0a9e('0x5a')]=_0x1020a0['id'];if(_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x948aab[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x948aab[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x948aab['attributes'],function(_0x26a204){var _0x49fd0e={};_0x49fd0e[_0x26a204]={'$like':'%'+_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x49fd0e;})});}_0x948aab=_[_0x0a9e('0x3b')]({},_0x948aab,_0x55b69e[_0x0a9e('0x46')]);return db[_0x0a9e('0x62')][_0x0a9e('0x3e')]({'where':_0x948aab[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0xa7a754){_0x2f79fb[_0x0a9e('0x3e')]=_0xa7a754;if(_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x948aab[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x62')][_0x0a9e('0x40')](_0x948aab);})[_0x0a9e('0x22')](function(_0x5b78a8){_0x2f79fb['rows']=_0x5b78a8;return _0x2f79fb;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x5236c9,_0x948aab))[_0x0a9e('0x42')](handleError(_0x5236c9,null));};exports['addBlackLists']=function(_0x5500de,_0x2cb05c,_0x1feb9){var _0x3304a1,_0x596178;return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x5500de[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cb05c,null))[_0x0a9e('0x22')](function(_0x5e9c92){if(_0x5e9c92){_0x596178=_0x5e9c92;return _0x5e9c92[_0x0a9e('0x83')](_0x5500de[_0x0a9e('0x48')][_0x0a9e('0x64')],_['omit'](_0x5500de[_0x0a9e('0x48')],['ids','id'])||{});}return null;})['spread'](function(_0x44b7af){var _0x23993f;_0x3304a1=_0x44b7af||[];var _0x3c691f=[];if(_0x44b7af){for(var _0x1542e8=0x0;_0x1542e8<_0x44b7af[_0x0a9e('0x35')];_0x1542e8+=0x1){var _0x7b05ba=_0x44b7af[_0x1542e8][_0x0a9e('0x4c')]({'plain':!![]});_0x23993f=squel[_0x0a9e('0x67')]()[_0x0a9e('0x68')](_0x0a9e('0x84'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),_0x0a9e('0x71'),_0x0a9e('0x6c'),_0x0a9e('0x5a'),_0x0a9e('0x53'),_0x0a9e('0x52')],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')]('phone',_0x0a9e('0x6b'))[_0x0a9e('0x6e')]('id',_0x0a9e('0x71'))[_0x0a9e('0x6e')](_0x7b05ba['CmListId']['toString'](),'ListId')[_0x0a9e('0x6e')](_0x5500de['params']['id'][_0x0a9e('0x73')](),_0x0a9e('0x5a'))[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x53'))[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x52'))[_0x0a9e('0x74')](_0x0a9e('0x7e'))['where'](_0x0a9e('0x75'))['where'](_0x0a9e('0x7a'),_0x7b05ba['CmListId'][_0x0a9e('0x73')]())[_0x0a9e('0x3c')](_0x0a9e('0x7b')))['toString']();_0x3c691f[_0x0a9e('0x7f')](db[_0x0a9e('0x80')]['query'](_0x23993f));}return BPromise['all'](_0x3c691f);}})[_0x0a9e('0x22')](function(){return _0x3304a1;})[_0x0a9e('0x22')](respondWithResult(_0x2cb05c,null))[_0x0a9e('0x42')](handleError(_0x2cb05c,null));};exports['removeBlackLists']=function(_0x578e8d,_0x4869c1,_0x374964){return db[_0x0a9e('0x2a')][_0x0a9e('0x4e')]({'where':{'id':_0x578e8d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4869c1,null))[_0x0a9e('0x22')](function(_0x183b9b){if(_0x183b9b){return _0x183b9b[_0x0a9e('0x85')](_0x578e8d[_0x0a9e('0x30')][_0x0a9e('0x64')]);}})[_0x0a9e('0x22')](function(_0x2f4de1){if(_0x2f4de1){return db[_0x0a9e('0x60')][_0x0a9e('0x21')]({'where':{'ListId':_0x578e8d[_0x0a9e('0x30')][_0x0a9e('0x64')],'CampaignId':_0x578e8d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](function(){return _0x2f4de1;});}})['then'](respondWithStatusCode(_0x4869c1,null))[_0x0a9e('0x42')](handleError(_0x4869c1,null));};
\ No newline at end of file
+var _0xa9e0=['NOW()','scheduledAt','ContactId','CmListId','toString','from','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_contacts','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','count','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','autoAssociation','getHoppers','findOne','CmHopper','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ListId','select','field'];(function(_0x43474f,_0x17b0fb){var _0x2ee9de=function(_0x400234){while(--_0x400234){_0x43474f['push'](_0x43474f['shift']());}};_0x2ee9de(++_0x17b0fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);_0x11c3b6['where']=qs[_0x0a9e('0x39')](_['pick'](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]),_0x3652a7);if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x11c3b6['where']=_[_0x0a9e('0x3b')](_0x11c3b6[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x533942){if(_0x533942[_0x0a9e('0x2d')]!==_0x0a9e('0x3d')){var _0x289467={};_0x289467[_0x533942['name']]={'$like':'%'+_0x140511['query'][_0x0a9e('0x3a')]+'%'};return _0x289467;}})});}_0x11c3b6=_[_0x0a9e('0x3b')]({},_0x11c3b6,_0x140511['options']);var _0x2b814e={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x3e')](_0x2b814e)['then'](function(_0x5a594b){_0x5a101a[_0x0a9e('0x3e')]=_0x5a594b;if(_0x140511[_0x0a9e('0x30')]['includeAll']){_0x11c3b6[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x11c3b6);})['then'](function(_0x316c8f){_0x5a101a[_0x0a9e('0x41')]=_0x316c8f;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x42')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x43')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':![],'where':{'id':_0xeaa5e5[_0x0a9e('0x44')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x30')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],_0x23b089[_0x0a9e('0x30')]);_0x45a9b8[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x33')]=_0x45a9b8[_0x0a9e('0x33')]['length']?_0x45a9b8[_0x0a9e('0x33')]:_0x23b089[_0x0a9e('0x2f')];if(_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x45a9b8[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3b')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x46')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x22')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x42')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x48')],{})[_0x0a9e('0x22')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x49')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4a'));if(_0x37be73[_0x0a9e('0x4b')]===_0x0a9e('0x49')){var _0x16f976=_0x45c845[_0x0a9e('0x4c')]({'plain':!![]});var _0x992c77=_0x0a9e('0x23');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x22')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x42')](function(_0x61bb17){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x22')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['clone']=function(_0x53975a,_0x39d77d){var _0x204173={'where':{'id':_0x53975a['params']['id']}},_0x14d602={};_0x14d602[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db['Campaign']['rawAttributes']);_0x204173[_0x0a9e('0x33')]=_['intersection'](_0x14d602[_0x0a9e('0x2f')],qs['fields'](_0x53975a[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x204173[_0x0a9e('0x33')]=_0x204173['attributes'][_0x0a9e('0x35')]?_0x204173[_0x0a9e('0x33')]:_0x14d602['model'];if(_0x53975a['query'][_0x0a9e('0x45')]){_0x204173[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x204173=_['merge']({},_0x204173,_0x53975a[_0x0a9e('0x46')]);return db['Campaign'][_0x0a9e('0x4e')](_0x204173)['then'](handleEntityNotFound(_0x39d77d,null))[_0x0a9e('0x22')](function(_0x4a6deb){if(_0x4a6deb){var _0x5da27d=_0x4a6deb['get']({'plain':!![]});_0x5da27d=qs[_0x0a9e('0x51')](_0x5da27d,['id','createdAt',_0x0a9e('0x52')]);_0x53975a[_0x0a9e('0x48')]=_[_0x0a9e('0x51')](_0x53975a[_0x0a9e('0x48')],['id',_0x0a9e('0x53'),_0x0a9e('0x52')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_['merge'](_0x5da27d,_0x53975a[_0x0a9e('0x48')]),{'include':_0x53975a[_0x0a9e('0x30')][_0x0a9e('0x45')]?[{'all':!![]}]:undefined})[_0x0a9e('0x22')](function(_0xb83dfd){var _0x156662=_0x53975a['user'][_0x0a9e('0x4c')]({'plain':!![]});if(!_0x156662)throw new Error(_0x0a9e('0x4a'));if(_0x156662['role']===_0x0a9e('0x49')){var _0x5cc8fb=_0xb83dfd[_0x0a9e('0x4c')]({'plain':!![]});var _0x5ba1f9='IvrCampaigns';return db['UserProfileSection'][_0x0a9e('0x4e')]({'where':{'name':_0x5ba1f9,'userProfileId':_0x156662['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x1fc70e){if(_0x1fc70e&&_0x1fc70e[_0x0a9e('0x54')]===0x0){return db[_0x0a9e('0x24')][_0x0a9e('0x47')]({'name':_0x5cc8fb[_0x0a9e('0x26')],'resourceId':_0x5cc8fb['id'],'type':_0x1fc70e['name'],'sectionId':_0x1fc70e['id']},{})[_0x0a9e('0x22')](function(){return _0xb83dfd;});}else{return _0xb83dfd;}})['catch'](function(_0xca4ade){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0xca4ade);throw _0xca4ade;});}return _0xb83dfd;});}})['then'](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x42')](handleError(_0x39d77d,null));};exports[_0x0a9e('0x20')]=function(_0x119677,_0x32e134){if(_0x119677['body']['id']){delete _0x119677[_0x0a9e('0x48')]['id'];}return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x119677[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x32e134,null))[_0x0a9e('0x22')](saveUpdates(_0x119677[_0x0a9e('0x48')],null))[_0x0a9e('0x22')](respondWithResult(_0x32e134,null))['catch'](handleError(_0x32e134,null));};exports[_0x0a9e('0x21')]=function(_0x2937e0,_0x281c7d){return db['Campaign'][_0x0a9e('0x4e')]({'where':{'id':_0x2937e0['params']['id']}})['then'](handleEntityNotFound(_0x281c7d,null))[_0x0a9e('0x22')](removeEntity(_0x281c7d,null))[_0x0a9e('0x42')](handleError(_0x281c7d,null));};exports[_0x0a9e('0x55')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489={'raw':!![],'where':{}};var _0x54a37d={};var _0x2d7205={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x19c995[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x186f39,null))[_0x0a9e('0x22')](function(_0x320898){if(_0x320898){_0x54a37d[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x57')]['rawAttributes']);_0x54a37d[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x19c995[_0x0a9e('0x30')]);_0x54a37d['filters']=_[_0x0a9e('0x32')](_0x54a37d[_0x0a9e('0x2f')],_0x54a37d['query']);_0x387489[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x54a37d[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x19c995[_0x0a9e('0x30')]['fields']));_0x387489['attributes']=_0x387489['attributes'][_0x0a9e('0x35')]?_0x387489[_0x0a9e('0x33')]:_0x54a37d[_0x0a9e('0x2f')];if(!_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x387489[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x19c995['query'][_0x0a9e('0x1a')]);_0x387489[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x19c995['query'][_0x0a9e('0x19')]);}_0x387489['order']=qs[_0x0a9e('0x38')](_0x19c995[_0x0a9e('0x30')]['sort']);_0x387489[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x19c995[_0x0a9e('0x30')],_0x54a37d['filters']));_0x387489[_0x0a9e('0x3c')][_0x0a9e('0x5a')]=_0x320898['id'];if(_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x387489['where']=_[_0x0a9e('0x3b')](_0x387489[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x387489[_0x0a9e('0x33')],function(_0x4abc8f){var _0x290d43={};_0x290d43[_0x4abc8f]={'$like':'%'+_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x290d43;})});}_0x387489=_[_0x0a9e('0x3b')]({},_0x387489,_0x19c995[_0x0a9e('0x46')]);return db[_0x0a9e('0x57')][_0x0a9e('0x3e')]({'where':_0x387489[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0x336dc3){_0x2d7205[_0x0a9e('0x3e')]=_0x336dc3;if(_0x19c995[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x387489[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x0a9e('0x40')](_0x387489);})[_0x0a9e('0x22')](function(_0xc599b3){_0x2d7205['rows']=_0xc599b3;return _0x2d7205;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x186f39,_0x387489))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x5b')]=function(_0x2b9463,_0x56d650,_0x541e80){var _0x7ebea8={'raw':!![],'where':{}};var _0x2bbdb5={};var _0x4c54fa={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x2b9463[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x56d650,null))['then'](function(_0x28a942){if(_0x28a942){_0x2bbdb5[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x5c')][_0x0a9e('0x2b')]);_0x2bbdb5[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x2b9463['query']);_0x2bbdb5[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2bbdb5[_0x0a9e('0x2f')],_0x2bbdb5[_0x0a9e('0x30')]);_0x7ebea8['attributes']=_[_0x0a9e('0x32')](_0x2bbdb5[_0x0a9e('0x2f')],qs['fields'](_0x2b9463[_0x0a9e('0x30')]['fields']));_0x7ebea8[_0x0a9e('0x33')]=_0x7ebea8[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x7ebea8[_0x0a9e('0x33')]:_0x2bbdb5['model'];if(!_0x2b9463['query'][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x7ebea8[_0x0a9e('0x1a')]=qs['limit'](_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x7ebea8['offset']=qs['offset'](_0x2b9463[_0x0a9e('0x30')]['offset']);}_0x7ebea8['order']=qs['sort'](_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x7ebea8[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x2b9463[_0x0a9e('0x30')],_0x2bbdb5['filters']));_0x7ebea8[_0x0a9e('0x3c')]['CampaignId']=_0x28a942['id'];if(_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x7ebea8[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x7ebea8['where'],{'$or':_[_0x0a9e('0x29')](_0x7ebea8[_0x0a9e('0x33')],function(_0x1d4877){var _0x5b74c3={};_0x5b74c3[_0x1d4877]={'$like':'%'+_0x2b9463[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x5b74c3;})});}_0x7ebea8=_[_0x0a9e('0x3b')]({},_0x7ebea8,_0x2b9463[_0x0a9e('0x46')]);return db[_0x0a9e('0x5c')][_0x0a9e('0x3e')]({'where':_0x7ebea8[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0x509efe){_0x4c54fa[_0x0a9e('0x3e')]=_0x509efe;if(_0x2b9463[_0x0a9e('0x30')]['includeAll']){_0x7ebea8[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5c')][_0x0a9e('0x40')](_0x7ebea8);})['then'](function(_0x96672f){_0x4c54fa['rows']=_0x96672f;return _0x4c54fa;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x56d650,_0x7ebea8))[_0x0a9e('0x42')](handleError(_0x56d650,null));};exports[_0x0a9e('0x5d')]=function(_0x1f29bd,_0x842d6f,_0x16341a){var _0x16a039={'raw':!![],'where':{}};var _0x3a9a85={};var _0x501050={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x1f29bd[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x842d6f,null))[_0x0a9e('0x22')](function(_0x3df9e4){if(_0x3df9e4){_0x3a9a85[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x5e')][_0x0a9e('0x2b')]);_0x3a9a85[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1f29bd[_0x0a9e('0x30')]);_0x3a9a85['filters']=_[_0x0a9e('0x32')](_0x3a9a85[_0x0a9e('0x2f')],_0x3a9a85[_0x0a9e('0x30')]);_0x16a039[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x3a9a85['model'],qs[_0x0a9e('0x34')](_0x1f29bd[_0x0a9e('0x30')]['fields']));_0x16a039[_0x0a9e('0x33')]=_0x16a039['attributes'][_0x0a9e('0x35')]?_0x16a039[_0x0a9e('0x33')]:_0x3a9a85[_0x0a9e('0x2f')];if(!_0x1f29bd[_0x0a9e('0x30')]['hasOwnProperty'](_0x0a9e('0x58'))){_0x16a039['limit']=qs[_0x0a9e('0x1a')](_0x1f29bd[_0x0a9e('0x30')]['limit']);_0x16a039[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1f29bd[_0x0a9e('0x30')]['offset']);}_0x16a039['order']=qs[_0x0a9e('0x38')](_0x1f29bd[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x16a039[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x1f29bd[_0x0a9e('0x30')],_0x3a9a85[_0x0a9e('0x39')]));_0x16a039[_0x0a9e('0x3c')]['CampaignId']=_0x3df9e4['id'];if(_0x1f29bd[_0x0a9e('0x30')]['filter']){_0x16a039[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x16a039[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x16a039[_0x0a9e('0x33')],function(_0x4e7273){var _0x436313={};_0x436313[_0x4e7273]={'$like':'%'+_0x1f29bd[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x436313;})});}_0x16a039=_[_0x0a9e('0x3b')]({},_0x16a039,_0x1f29bd[_0x0a9e('0x46')]);return db['CmHopperFinal']['count']({'where':_0x16a039[_0x0a9e('0x3c')]})['then'](function(_0x25eae0){_0x501050[_0x0a9e('0x3e')]=_0x25eae0;if(_0x1f29bd[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x16a039[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5e')]['findAll'](_0x16a039);})['then'](function(_0x1889ed){_0x501050['rows']=_0x1889ed;return _0x501050;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x842d6f,_0x16a039))['catch'](handleError(_0x842d6f,null));};exports[_0x0a9e('0x5f')]=function(_0x564db2,_0x558d60,_0x1c49dc){var _0xb8db59={'raw':!![],'where':{}};var _0x5e9b0b={};var _0x170af6={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x564db2[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x558d60,null))['then'](function(_0x5505f4){if(_0x5505f4){_0x5e9b0b[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x60')][_0x0a9e('0x2b')]);_0x5e9b0b[_0x0a9e('0x30')]=_['keys'](_0x564db2[_0x0a9e('0x30')]);_0x5e9b0b[_0x0a9e('0x39')]=_['intersection'](_0x5e9b0b[_0x0a9e('0x2f')],_0x5e9b0b[_0x0a9e('0x30')]);_0xb8db59[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5e9b0b[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0xb8db59[_0x0a9e('0x33')]=_0xb8db59[_0x0a9e('0x33')]['length']?_0xb8db59[_0x0a9e('0x33')]:_0x5e9b0b[_0x0a9e('0x2f')];if(!_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0xb8db59['limit']=qs['limit'](_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0xb8db59[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x564db2[_0x0a9e('0x30')]['offset']);}_0xb8db59[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x564db2[_0x0a9e('0x30')]['sort']);_0xb8db59[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x59')](_0x564db2['query'],_0x5e9b0b[_0x0a9e('0x39')]));_0xb8db59[_0x0a9e('0x3c')][_0x0a9e('0x5a')]=_0x5505f4['id'];if(_0x564db2['query'][_0x0a9e('0x3a')]){_0xb8db59['where']=_[_0x0a9e('0x3b')](_0xb8db59[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0xb8db59[_0x0a9e('0x33')],function(_0x3a5836){var _0x1bee04={};_0x1bee04[_0x3a5836]={'$like':'%'+_0x564db2[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x1bee04;})});}_0xb8db59=_[_0x0a9e('0x3b')]({},_0xb8db59,_0x564db2[_0x0a9e('0x46')]);return db[_0x0a9e('0x60')][_0x0a9e('0x3e')]({'where':_0xb8db59[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0x98c62c){_0x170af6[_0x0a9e('0x3e')]=_0x98c62c;if(_0x564db2['query']['includeAll']){_0xb8db59[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0a9e('0x40')](_0xb8db59);})[_0x0a9e('0x22')](function(_0x5d6b69){_0x170af6[_0x0a9e('0x41')]=_0x5d6b69;return _0x170af6;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x558d60,_0xb8db59))[_0x0a9e('0x42')](handleError(_0x558d60,null));};exports[_0x0a9e('0x61')]=function(_0x5585d5,_0x148fd9,_0x26cb76){var _0x374f0b={};var _0x34a791={};var _0x5d0e1f;var _0x19e9ed;return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x5585d5['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x148fd9,null))[_0x0a9e('0x22')](function(_0x17b29d){if(_0x17b29d){_0x5d0e1f=_0x17b29d;_0x34a791['model']=_[_0x0a9e('0x31')](db[_0x0a9e('0x62')][_0x0a9e('0x2b')]);_0x34a791[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x5585d5['query']);_0x34a791[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x34a791['model'],_0x34a791[_0x0a9e('0x30')]);_0x374f0b[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x34a791['model'],qs['fields'](_0x5585d5['query'][_0x0a9e('0x34')]));_0x374f0b[_0x0a9e('0x33')]=_0x374f0b['attributes'][_0x0a9e('0x35')]?_0x374f0b[_0x0a9e('0x33')]:_0x34a791[_0x0a9e('0x2f')];_0x374f0b['order']=qs[_0x0a9e('0x38')](_0x5585d5[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x374f0b[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x5585d5[_0x0a9e('0x30')],_0x34a791[_0x0a9e('0x39')]));if(_0x5585d5[_0x0a9e('0x30')]['filter']){_0x374f0b[_0x0a9e('0x3c')]=_['merge'](_0x374f0b[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x374f0b[_0x0a9e('0x33')],function(_0x3cf222){var _0x407e9d={};_0x407e9d[_0x3cf222]={'$like':'%'+_0x5585d5[_0x0a9e('0x30')]['filter']+'%'};return _0x407e9d;})});}_0x374f0b=_[_0x0a9e('0x3b')]({},_0x374f0b,_0x5585d5[_0x0a9e('0x46')]);return _0x5d0e1f[_0x0a9e('0x61')](_0x374f0b);}})[_0x0a9e('0x22')](function(_0x51aa2f){if(_0x51aa2f){_0x19e9ed=_0x51aa2f[_0x0a9e('0x35')];if(!_0x5585d5[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x374f0b[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x5585d5[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x374f0b[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x5585d5['query'][_0x0a9e('0x19')]);}return _0x5d0e1f[_0x0a9e('0x61')](_0x374f0b);}})[_0x0a9e('0x22')](function(_0x26b826){if(_0x26b826){return _0x26b826?{'count':_0x19e9ed,'rows':_0x26b826}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x148fd9,null))[_0x0a9e('0x42')](handleError(_0x148fd9,null));};exports[_0x0a9e('0x63')]=function(_0x20ae21,_0x566b90,_0x3b581c){var _0xd2391,_0x1a9ef1;return db['Campaign'][_0x0a9e('0x4e')]({'where':{'id':_0x20ae21[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x22')](function(_0x370b5e){if(_0x370b5e){_0x1a9ef1=_0x370b5e;return _0x370b5e[_0x0a9e('0x63')](_0x20ae21[_0x0a9e('0x48')][_0x0a9e('0x64')],_[_0x0a9e('0x51')](_0x20ae21[_0x0a9e('0x48')],['ids','id'])||{});}return null;})[_0x0a9e('0x65')](function(_0x446e6){var _0x15a9ed;_0xd2391=_0x446e6||[];var _0x3db98f=[];if(_0x446e6){for(var _0x2b624e=0x0;_0x2b624e<_0x446e6[_0x0a9e('0x35')];_0x2b624e+=0x1){var _0x5cb48d=_0x446e6[_0x2b624e][_0x0a9e('0x4c')]({'plain':!![]});_0x1a9ef1['dialCheckDuplicateType']=_0x20ae21['body']['dialCheckDuplicateType']?_0x20ae21[_0x0a9e('0x48')][_0x0a9e('0x66')]:_0x1a9ef1[_0x0a9e('0x66')];switch(_0x1a9ef1[_0x0a9e('0x66')]){case'always':_0x15a9ed=squel[_0x0a9e('0x67')]()[_0x0a9e('0x68')](_0x0a9e('0x69'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),'scheduledAt','ContactId',_0x0a9e('0x6c'),_0x0a9e('0x5a'),_0x0a9e('0x53'),'updatedAt'],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x6b'),'phone')[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x70'))['field']('id',_0x0a9e('0x71'))[_0x0a9e('0x6e')](_0x5cb48d[_0x0a9e('0x72')]['toString'](),'ListId')['field'](_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')](),_0x0a9e('0x5a'))[_0x0a9e('0x6e')]('NOW()',_0x0a9e('0x53'))['field'](_0x0a9e('0x6f'),_0x0a9e('0x52'))[_0x0a9e('0x74')]('cm_contacts')[_0x0a9e('0x3c')](_0x0a9e('0x75'))[_0x0a9e('0x3c')]('ListId\x20=\x20?',_0x5cb48d[_0x0a9e('0x72')]['toString']())[_0x0a9e('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x0a9e('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x76'))[_0x0a9e('0x74')](_0x0a9e('0x77'))[_0x0a9e('0x3c')](_0x0a9e('0x78'),_0x20ae21['params']['id'][_0x0a9e('0x73')]()))[_0x0a9e('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')]('COALESCE(phone,\x27\x27)')[_0x0a9e('0x74')](_0x0a9e('0x69'))[_0x0a9e('0x3c')]('CampaignId\x20=\x20?',_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')]())))[_0x0a9e('0x73')]();break;case _0x0a9e('0x79'):_0x15a9ed=squel[_0x0a9e('0x67')]()[_0x0a9e('0x68')](_0x0a9e('0x69'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),_0x0a9e('0x70'),'ContactId',_0x0a9e('0x6c'),'CampaignId',_0x0a9e('0x53'),_0x0a9e('0x52')],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x6b'),_0x0a9e('0x6b'))['field'](_0x0a9e('0x6f'),_0x0a9e('0x70'))[_0x0a9e('0x6e')]('id','ContactId')[_0x0a9e('0x6e')](_0x5cb48d[_0x0a9e('0x72')][_0x0a9e('0x73')](),_0x0a9e('0x6c'))[_0x0a9e('0x6e')](_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')](),'CampaignId')[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x53'))[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x52'))[_0x0a9e('0x74')]('cm_contacts')['where'](_0x0a9e('0x75'))[_0x0a9e('0x3c')](_0x0a9e('0x7a'),_0x5cb48d[_0x0a9e('0x72')][_0x0a9e('0x73')]())[_0x0a9e('0x3c')](_0x0a9e('0x7b'))['where'](_0x0a9e('0x7c'),squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x7d'))[_0x0a9e('0x74')](_0x0a9e('0x69'))[_0x0a9e('0x3c')]('CampaignId\x20=\x20?',_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')]())))[_0x0a9e('0x73')]();break;default:_0x15a9ed=squel['insert']()[_0x0a9e('0x68')](_0x0a9e('0x69'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),'scheduledAt',_0x0a9e('0x71'),_0x0a9e('0x6c'),_0x0a9e('0x5a'),_0x0a9e('0x53'),_0x0a9e('0x52')],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')](_0x0a9e('0x6b'),'phone')[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x70'))[_0x0a9e('0x6e')]('id','ContactId')['field'](_0x5cb48d[_0x0a9e('0x72')][_0x0a9e('0x73')](),_0x0a9e('0x6c'))['field'](_0x20ae21[_0x0a9e('0x44')]['id'][_0x0a9e('0x73')](),'CampaignId')[_0x0a9e('0x6e')]('NOW()',_0x0a9e('0x53'))['field']('NOW()','updatedAt')[_0x0a9e('0x74')](_0x0a9e('0x7e'))[_0x0a9e('0x3c')](_0x0a9e('0x75'))[_0x0a9e('0x3c')](_0x0a9e('0x7a'),_0x5cb48d['CmListId'][_0x0a9e('0x73')]())[_0x0a9e('0x3c')](_0x0a9e('0x7b')))[_0x0a9e('0x73')]();}_0x3db98f[_0x0a9e('0x7f')](db[_0x0a9e('0x80')][_0x0a9e('0x30')](_0x15a9ed));}return BPromise['all'](_0x3db98f);}})['then'](function(){return _0xd2391;})[_0x0a9e('0x22')](respondWithResult(_0x566b90,null))['catch'](handleError(_0x566b90,null));};exports[_0x0a9e('0x81')]=function(_0xb326cb,_0x1f0318,_0xa3695f){return db[_0x0a9e('0x2a')][_0x0a9e('0x4e')]({'where':{'id':_0xb326cb['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1f0318,null))['then'](function(_0x50e32a){if(_0x50e32a){return _0x50e32a[_0x0a9e('0x81')](_0xb326cb['query'][_0x0a9e('0x64')]);}})['then'](function(_0x550cbf){if(_0x550cbf){return db[_0x0a9e('0x57')]['destroy']({'where':{'ListId':_0xb326cb[_0x0a9e('0x30')][_0x0a9e('0x64')],'CampaignId':_0xb326cb[_0x0a9e('0x44')]['id']}})['then'](function(){return _0x550cbf;});}})[_0x0a9e('0x22')](respondWithStatusCode(_0x1f0318,null))[_0x0a9e('0x42')](handleError(_0x1f0318,null));};exports[_0x0a9e('0x82')]=function(_0x55b69e,_0x5236c9,_0xdc77d){var _0x948aab={'raw':!![],'where':{}};var _0x89d2cb={};var _0x2f79fb={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x56')]({'where':{'id':_0x55b69e[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x5236c9,null))[_0x0a9e('0x22')](function(_0x1020a0){if(_0x1020a0){_0x89d2cb['model']=_['keys'](db['CmList'][_0x0a9e('0x2b')]);_0x89d2cb[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x55b69e[_0x0a9e('0x30')]);_0x89d2cb[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x89d2cb[_0x0a9e('0x2f')],_0x89d2cb[_0x0a9e('0x30')]);_0x948aab['attributes']=_['intersection'](_0x89d2cb[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x55b69e['query'][_0x0a9e('0x34')]));_0x948aab[_0x0a9e('0x33')]=_0x948aab[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x948aab[_0x0a9e('0x33')]:_0x89d2cb[_0x0a9e('0x2f')];if(!_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x58'))){_0x948aab[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x55b69e[_0x0a9e('0x30')]['limit']);_0x948aab[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x19')]);}_0x948aab[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x948aab[_0x0a9e('0x3c')]=qs[_0x0a9e('0x39')](_[_0x0a9e('0x59')](_0x55b69e[_0x0a9e('0x30')],_0x89d2cb['filters']));_0x948aab['where'][_0x0a9e('0x5a')]=_0x1020a0['id'];if(_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x948aab[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x948aab[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x948aab['attributes'],function(_0x26a204){var _0x49fd0e={};_0x49fd0e[_0x26a204]={'$like':'%'+_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x3a')]+'%'};return _0x49fd0e;})});}_0x948aab=_[_0x0a9e('0x3b')]({},_0x948aab,_0x55b69e[_0x0a9e('0x46')]);return db[_0x0a9e('0x62')][_0x0a9e('0x3e')]({'where':_0x948aab[_0x0a9e('0x3c')]})[_0x0a9e('0x22')](function(_0xa7a754){_0x2f79fb[_0x0a9e('0x3e')]=_0xa7a754;if(_0x55b69e[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x948aab[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x62')][_0x0a9e('0x40')](_0x948aab);})[_0x0a9e('0x22')](function(_0x5b78a8){_0x2f79fb['rows']=_0x5b78a8;return _0x2f79fb;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x5236c9,_0x948aab))[_0x0a9e('0x42')](handleError(_0x5236c9,null));};exports['addBlackLists']=function(_0x5500de,_0x2cb05c,_0x1feb9){var _0x3304a1,_0x596178;return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x5500de[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cb05c,null))[_0x0a9e('0x22')](function(_0x5e9c92){if(_0x5e9c92){_0x596178=_0x5e9c92;return _0x5e9c92[_0x0a9e('0x83')](_0x5500de[_0x0a9e('0x48')][_0x0a9e('0x64')],_['omit'](_0x5500de[_0x0a9e('0x48')],['ids','id'])||{});}return null;})['spread'](function(_0x44b7af){var _0x23993f;_0x3304a1=_0x44b7af||[];var _0x3c691f=[];if(_0x44b7af){for(var _0x1542e8=0x0;_0x1542e8<_0x44b7af[_0x0a9e('0x35')];_0x1542e8+=0x1){var _0x7b05ba=_0x44b7af[_0x1542e8][_0x0a9e('0x4c')]({'plain':!![]});_0x23993f=squel[_0x0a9e('0x67')]()[_0x0a9e('0x68')](_0x0a9e('0x84'))[_0x0a9e('0x6a')]([_0x0a9e('0x6b'),_0x0a9e('0x71'),_0x0a9e('0x6c'),_0x0a9e('0x5a'),_0x0a9e('0x53'),_0x0a9e('0x52')],squel[_0x0a9e('0x6d')]()[_0x0a9e('0x6e')]('phone',_0x0a9e('0x6b'))[_0x0a9e('0x6e')]('id',_0x0a9e('0x71'))[_0x0a9e('0x6e')](_0x7b05ba['CmListId']['toString'](),'ListId')[_0x0a9e('0x6e')](_0x5500de['params']['id'][_0x0a9e('0x73')](),_0x0a9e('0x5a'))[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x53'))[_0x0a9e('0x6e')](_0x0a9e('0x6f'),_0x0a9e('0x52'))[_0x0a9e('0x74')](_0x0a9e('0x7e'))['where'](_0x0a9e('0x75'))['where'](_0x0a9e('0x7a'),_0x7b05ba['CmListId'][_0x0a9e('0x73')]())[_0x0a9e('0x3c')](_0x0a9e('0x7b')))['toString']();_0x3c691f[_0x0a9e('0x7f')](db[_0x0a9e('0x80')]['query'](_0x23993f));}return BPromise['all'](_0x3c691f);}})[_0x0a9e('0x22')](function(){return _0x3304a1;})[_0x0a9e('0x22')](respondWithResult(_0x2cb05c,null))[_0x0a9e('0x42')](handleError(_0x2cb05c,null));};exports['removeBlackLists']=function(_0x578e8d,_0x4869c1,_0x374964){return db[_0x0a9e('0x2a')][_0x0a9e('0x4e')]({'where':{'id':_0x578e8d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4869c1,null))[_0x0a9e('0x22')](function(_0x183b9b){if(_0x183b9b){return _0x183b9b[_0x0a9e('0x85')](_0x578e8d[_0x0a9e('0x30')][_0x0a9e('0x64')]);}})[_0x0a9e('0x22')](function(_0x2f4de1){if(_0x2f4de1){return db[_0x0a9e('0x60')][_0x0a9e('0x21')]({'where':{'ListId':_0x578e8d[_0x0a9e('0x30')][_0x0a9e('0x64')],'CampaignId':_0x578e8d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](function(){return _0x2f4de1;});}})['then'](respondWithStatusCode(_0x4869c1,null))[_0x0a9e('0x42')](handleError(_0x4869c1,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 94ab438..98d70d1 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 _0x98ce=['moment','bluebird','path','../../config/environment','./campaign.attributes','exports','define','Campaign','util','../../config/logger','api'];(function(_0x4a99d6,_0x2026d4){var _0x3ccebc=function(_0xa9637d){while(--_0xa9637d){_0x4a99d6['push'](_0x4a99d6['shift']());}};_0x3ccebc(++_0x2026d4);}(_0x98ce,0x126));var _0xe98c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x98ce[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xe98c('0x0'));var logger=require(_0xe98c('0x1'))(_0xe98c('0x2'));var moment=require(_0xe98c('0x3'));var BPromise=require(_0xe98c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe98c('0x5'));var rimraf=require('rimraf');var config=require(_0xe98c('0x6'));var attributes=require(_0xe98c('0x7'));module[_0xe98c('0x8')]=function(_0xee8bc7,_0x289537){return _0xee8bc7[_0xe98c('0x9')](_0xe98c('0xa'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a1a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns'];(function(_0x49f0d2,_0x1e20e4){var _0x2a9f08=function(_0x26295d){while(--_0x26295d){_0x49f0d2['push'](_0x49f0d2['shift']());}};_0x2a9f08(++_0x1e20e4);}(_0x3a1a,0x11e));var _0xa3a1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3a1a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xa3a1('0x0'));var logger=require(_0xa3a1('0x1'))(_0xa3a1('0x2'));var moment=require(_0xa3a1('0x3'));var BPromise=require(_0xa3a1('0x4'));var rp=require(_0xa3a1('0x5'));var fs=require('fs');var path=require(_0xa3a1('0x6'));var rimraf=require(_0xa3a1('0x7'));var config=require(_0xa3a1('0x8'));var attributes=require(_0xa3a1('0x9'));module[_0xa3a1('0xa')]=function(_0x22fb69,_0x5b231a){return _0x22fb69[_0xa3a1('0xb')]('Campaign',attributes,{'tableName':_0xa3a1('0xc'),'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 7dfd466..807be3f 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(_0x1d982d,_0xfb3a79){var _0x2d24ba=function(_0xee2fd){while(--_0xee2fd){_0x1d982d['push'](_0x1d982d['shift']());}};_0x2d24ba(++_0xfb3a79);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 _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(_0x329f22,_0xe1ba1d){var _0x3490b3=function(_0x344268){while(--_0x344268){_0x329f22['push'](_0x329f22['shift']());}};_0x3490b3(++_0xe1ba1d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9508aa5..4a677af 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 _0xc8a8=['addBlackLists','put','delete','destroy','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc8a8,0xde));var _0x8c8a=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0xc8a8[_0x595604];return _0x1466f3;};'use strict';var multer=require(_0x8c8a('0x0'));var util=require(_0x8c8a('0x1'));var path=require(_0x8c8a('0x2'));var timeout=require(_0x8c8a('0x3'));var express=require('express');var router=express[_0x8c8a('0x4')]();var auth=require(_0x8c8a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c8a('0x6'));var controller=require(_0x8c8a('0x7'));router[_0x8c8a('0x8')]('/',auth[_0x8c8a('0x9')](),controller[_0x8c8a('0xa')]);router[_0x8c8a('0x8')](_0x8c8a('0xb'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0xc')]);router[_0x8c8a('0x8')](_0x8c8a('0xd'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0xe')]);router[_0x8c8a('0x8')](_0x8c8a('0xf'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x10')]);router[_0x8c8a('0x8')](_0x8c8a('0x11'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x12')]);router[_0x8c8a('0x8')](_0x8c8a('0x13'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x8c8a('0x8')](_0x8c8a('0x14'),auth[_0x8c8a('0x9')](),controller['getLists']);router[_0x8c8a('0x8')](_0x8c8a('0x15'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x16')]);router['post']('/',auth[_0x8c8a('0x9')](),controller['create']);router[_0x8c8a('0x17')](_0x8c8a('0x18'),auth[_0x8c8a('0x9')](),controller['clone']);router[_0x8c8a('0x17')](_0x8c8a('0x14'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x19')]);router[_0x8c8a('0x17')](_0x8c8a('0x15'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x1a')]);router[_0x8c8a('0x1b')](_0x8c8a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8c8a('0x1c')](_0x8c8a('0xb'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x1d')]);router[_0x8c8a('0x1c')](_0x8c8a('0x14'),auth['isAuthenticated'](),controller['removeLists']);router[_0x8c8a('0x1c')](_0x8c8a('0x15'),auth[_0x8c8a('0x9')](),controller[_0x8c8a('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x7604=['./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','update','delete','destroy','removeLists','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc29e32,_0x4e79bf){var _0x4506f9=function(_0x1ee869){while(--_0x1ee869){_0xc29e32['push'](_0xc29e32['shift']());}};_0x4506f9(++_0x4e79bf);}(_0x7604,0x127));var _0x4760=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7604[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x4760('0x0'));var path=require(_0x4760('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x4760('0x2'));var interaction=require(_0x4760('0x3'));var config=require(_0x4760('0x4'));var controller=require(_0x4760('0x5'));router[_0x4760('0x6')]('/',auth['isAuthenticated'](),controller[_0x4760('0x7')]);router[_0x4760('0x6')](_0x4760('0x8'),auth[_0x4760('0x9')](),controller[_0x4760('0xa')]);router[_0x4760('0x6')](_0x4760('0xb'),auth[_0x4760('0x9')](),controller[_0x4760('0xc')]);router[_0x4760('0x6')](_0x4760('0xd'),auth[_0x4760('0x9')](),controller[_0x4760('0xe')]);router[_0x4760('0x6')]('/:id/hopper_finals',auth[_0x4760('0x9')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x4760('0x9')](),controller[_0x4760('0xf')]);router[_0x4760('0x6')](_0x4760('0x10'),auth[_0x4760('0x9')](),controller[_0x4760('0x11')]);router['get'](_0x4760('0x12'),auth[_0x4760('0x9')](),controller[_0x4760('0x13')]);router[_0x4760('0x14')]('/',auth[_0x4760('0x9')](),controller['create']);router['post'](_0x4760('0x15'),auth[_0x4760('0x9')](),controller[_0x4760('0x16')]);router[_0x4760('0x14')](_0x4760('0x10'),auth['isAuthenticated'](),controller[_0x4760('0x17')]);router[_0x4760('0x14')]('/:id/blacklists',auth[_0x4760('0x9')](),controller['addBlackLists']);router[_0x4760('0x18')](_0x4760('0x8'),auth[_0x4760('0x9')](),controller[_0x4760('0x19')]);router[_0x4760('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x4760('0x1b')]);router[_0x4760('0x1a')]('/:id/lists',auth[_0x4760('0x9')](),controller[_0x4760('0x1c')]);router[_0x4760('0x1a')](_0x4760('0x12'),auth[_0x4760('0x9')](),controller['removeBlackLists']);module[_0x4760('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 984adf4..efccdb3 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 _0x725a=['TEXT','VIRTUAL','exports','STRING'];(function(_0x2e8ba4,_0x409f8f){var _0x1ac85e=function(_0x419e35){while(--_0x419e35){_0x2e8ba4['push'](_0x2e8ba4['shift']());}};_0x1ac85e(++_0x409f8f);}(_0x725a,0x1de));var _0xa725=function(_0x3e1926,_0x11e729){_0x3e1926=_0x3e1926-0x0;var _0x5517e9=_0x725a[_0x3e1926];return _0x5517e9;};'use strict';var Sequelize=require('sequelize');module[_0xa725('0x0')]={'key':{'type':Sequelize[_0xa725('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xa725('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa725('0x1')]},'name':{'type':Sequelize[_0xa725('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x1b5e=['TEXT','VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x1b5e,0x74));var _0xe1b5=function(_0x35ca08,_0x18ff82){_0x35ca08=_0x35ca08-0x0;var _0x5108ce=_0x1b5e[_0x35ca08];return _0x5108ce;};'use strict';var Sequelize=require(_0xe1b5('0x0'));module[_0xe1b5('0x1')]={'key':{'type':Sequelize[_0xe1b5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe1b5('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe1b5('0x4')],'get':function(){return this[_0xe1b5('0x5')](_0xe1b5('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a5b92e0..5cf3a1a 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 _0x9957=['set','reject','update','then','get','CannedAnswers','UserProfileResource','destroy','end','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','catch','show','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=_0x2202ce[_0x7995('0x1e')],_0x5377e5=_0x1a5310[_0x7995('0x1f')],_0x2eeacc=_0x1a5310[_0x7995('0x1f')]+_0x1a5310[_0x7995('0x20')],_0x565d97;if(_0x2eeacc>=_0x41cbf0){_0x2eeacc=_0x41cbf0;_0x565d97=0xc8;}else{_0x565d97=0xce;}_0x3f1d3e[_0x7995('0x1c')](_0x565d97);return _0x3f1d3e[_0x7995('0x21')]('Content-Range',_0x5377e5+'-'+_0x2eeacc+'/'+_0x41cbf0)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x2536c8){return function(_0x5e6f90){try{jsonpatch['apply'](_0x5e6f90,_0x2536c8,!![]);}catch(_0x3ec178){return BPromise[_0x7995('0x22')](_0x3ec178);}return _0x5e6f90['save']();};}function saveUpdates(_0x3a9b54,_0x51f276){return function(_0x4b1a8e){if(_0x4b1a8e){return _0x4b1a8e[_0x7995('0x23')](_0x3a9b54)[_0x7995('0x24')](function(_0x350fd9){return _0x350fd9;});}return null;};}function removeEntity(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['destroy']()[_0x7995('0x24')](function(){var _0x46ee4b=_0x1c278a[_0x7995('0x25')]({'plain':!![]});var _0x285437=_0x7995('0x26');return db[_0x7995('0x27')][_0x7995('0x28')]({'where':{'type':_0x285437,'resourceId':_0x46ee4b['id']}})[_0x7995('0x24')](function(){return _0x1c278a;});})['then'](function(){_0x1a8568[_0x7995('0x1c')](0xcc)[_0x7995('0x29')]();});}};}function handleEntityNotFound(_0x401dc3,_0x268ce7){return function(_0x3a3fcf){if(!_0x3a3fcf){_0x401dc3[_0x7995('0x1b')](0x194);}return _0x3a3fcf;};}function handleError(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0x1f4;return function(_0x5911c3){logger[_0x7995('0x2a')](_0x5911c3[_0x7995('0x2b')]);if(_0x5911c3[_0x7995('0x2c')]){delete _0x5911c3[_0x7995('0x2c')];}_0x56691a[_0x7995('0x1c')](_0x47625f)['send'](_0x5911c3);};}exports[_0x7995('0x2d')]=function(_0x514445,_0x456a28){var _0x3250e0={},_0x4253e5={},_0x574574={'count':0x0,'rows':[]};var _0x530611=_['map'](db[_0x7995('0x2e')][_0x7995('0x2f')],function(_0x327a81){return{'name':_0x327a81[_0x7995('0x30')],'type':_0x327a81[_0x7995('0x31')][_0x7995('0x32')]};});_0x4253e5['model']=_['map'](_0x530611,_0x7995('0x2c'));_0x4253e5['query']=_[_0x7995('0x33')](_0x514445[_0x7995('0x34')]);_0x4253e5[_0x7995('0x35')]=_[_0x7995('0x36')](_0x4253e5[_0x7995('0x37')],_0x4253e5['query']);_0x3250e0[_0x7995('0x38')]=_[_0x7995('0x36')](_0x4253e5['model'],qs['fields'](_0x514445['query'][_0x7995('0x39')]));_0x3250e0[_0x7995('0x38')]=_0x3250e0['attributes'][_0x7995('0x3a')]?_0x3250e0['attributes']:_0x4253e5[_0x7995('0x37')];if(!_0x514445[_0x7995('0x34')][_0x7995('0x3b')]('nolimit')){_0x3250e0['limit']=qs[_0x7995('0x20')](_0x514445['query']['limit']);_0x3250e0[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x514445['query'][_0x7995('0x1f')]);}_0x3250e0[_0x7995('0x3c')]=qs[_0x7995('0x3d')](_0x514445[_0x7995('0x34')][_0x7995('0x3d')]);_0x3250e0['where']=qs[_0x7995('0x35')](_[_0x7995('0x3e')](_0x514445[_0x7995('0x34')],_0x4253e5[_0x7995('0x35')]),_0x530611);if(_0x514445['query'][_0x7995('0x3f')]){_0x3250e0[_0x7995('0x40')]=_[_0x7995('0x41')](_0x3250e0[_0x7995('0x40')],{'$or':_[_0x7995('0x42')](_0x530611,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x43')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x2c')]]={'$like':'%'+_0x514445[_0x7995('0x34')][_0x7995('0x3f')]+'%'};return _0x3be298;}})});}_0x3250e0=_[_0x7995('0x41')]({},_0x3250e0,_0x514445[_0x7995('0x44')]);var _0x270c0e={'where':_0x3250e0[_0x7995('0x40')]};return db[_0x7995('0x2e')][_0x7995('0x1e')](_0x270c0e)[_0x7995('0x24')](function(_0x7b4e67){_0x574574['count']=_0x7b4e67;if(_0x514445['query'][_0x7995('0x45')]){_0x3250e0[_0x7995('0x46')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3250e0);})[_0x7995('0x24')](function(_0x4a9fef){_0x574574['rows']=_0x4a9fef;return _0x574574;})[_0x7995('0x24')](respondWithFilteredResult(_0x456a28,_0x3250e0))[_0x7995('0x47')](handleError(_0x456a28,null));};exports[_0x7995('0x48')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':!![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x33')](db[_0x7995('0x2e')][_0x7995('0x2f')]);_0x3993b5[_0x7995('0x34')]=_['keys'](_0x576b96[_0x7995('0x34')]);_0x3993b5[_0x7995('0x35')]=_[_0x7995('0x36')](_0x3993b5[_0x7995('0x37')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x36')](_0x3993b5['model'],qs[_0x7995('0x39')](_0x576b96['query'][_0x7995('0x39')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x38')][_0x7995('0x3a')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x37')];if(_0x576b96[_0x7995('0x34')][_0x7995('0x45')]){_0x5e85b9[_0x7995('0x46')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x44')]);return db[_0x7995('0x2e')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x24')](respondWithResult(_0x46ac4f,null))[_0x7995('0x47')](handleError(_0x46ac4f,null));};exports[_0x7995('0x23')]=function(_0x3d8ae3,_0x255313){if(_0x3d8ae3['body']['id']){delete _0x3d8ae3[_0x7995('0x4a')]['id'];}return db[_0x7995('0x2e')]['find']({'where':{'id':_0x3d8ae3[_0x7995('0x4b')]['id']}})['then'](handleEntityNotFound(_0x255313,null))[_0x7995('0x24')](saveUpdates(_0x3d8ae3[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x255313,null))[_0x7995('0x47')](handleError(_0x255313,null));};exports[_0x7995('0x28')]=function(_0x14b537,_0x1579b9){return db['CannedAnswer'][_0x7995('0x49')]({'where':{'id':_0x14b537[_0x7995('0x4b')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1579b9,null))['then'](removeEntity(_0x1579b9,null))[_0x7995('0x47')](handleError(_0x1579b9,null));};exports[_0x7995('0x4c')]=function(_0x12d4b8,_0x47d1d8){var _0x4ec548={'key':_0x12d4b8['body'][_0x7995('0x32')]};if(_0x12d4b8[_0x7995('0x4a')]['MailAccountId']){_0x4ec548[_0x7995('0x4d')]=_0x12d4b8[_0x7995('0x4a')][_0x7995('0x4d')];}else if(_0x12d4b8[_0x7995('0x4a')][_0x7995('0x4e')]){_0x4ec548['SmsAccountId']=_0x12d4b8[_0x7995('0x4a')]['SmsAccountId'];}else if(_0x12d4b8[_0x7995('0x4a')][_0x7995('0x4f')]){_0x4ec548[_0x7995('0x4f')]=_0x12d4b8['body']['OpenchannelAccountId'];}else if(_0x12d4b8['body']['ChatWebsiteId']){_0x4ec548[_0x7995('0x50')]=_0x12d4b8[_0x7995('0x4a')][_0x7995('0x50')];}return db[_0x7995('0x2e')][_0x7995('0x49')]({'where':_0x4ec548})[_0x7995('0x24')](function(_0x1f4270){if(_0x1f4270){throw new db[(_0x7995('0x51'))][(_0x7995('0x52'))](_0x7995('0x53'));}return db[_0x7995('0x2e')][_0x7995('0x4c')](_0x12d4b8[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x1ea1dc){var _0x416133=_0x12d4b8[_0x7995('0x54')][_0x7995('0x25')]({'plain':!![]});if(!_0x416133)throw new Error(_0x7995('0x55'));if(_0x416133['role']===_0x7995('0x54')){var _0x630737=_0x1ea1dc[_0x7995('0x25')]({'plain':!![]});return db[_0x7995('0x56')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x416133[_0x7995('0x57')]},'raw':!![]})[_0x7995('0x24')](function(_0x5b9467){if(_0x5b9467&&_0x5b9467[_0x7995('0x58')]===0x0){return db['UserProfileResource'][_0x7995('0x4c')]({'name':_0x630737[_0x7995('0x2c')],'resourceId':_0x630737['id'],'type':_0x5b9467[_0x7995('0x2c')],'sectionId':_0x5b9467['id']},{})[_0x7995('0x24')](function(){return _0x1ea1dc;});}else{return _0x1ea1dc;}})['catch'](function(_0x5e2d97){logger[_0x7995('0x2a')](_0x7995('0x59'),_0x5e2d97);throw _0x5e2d97;});}return _0x1ea1dc;})[_0x7995('0x24')](respondWithResult(_0x47d1d8,0xc9))[_0x7995('0x47')](handleError(_0x47d1d8,null));};
\ No newline at end of file
+var _0x9957=['set','reject','update','then','get','CannedAnswers','UserProfileResource','destroy','end','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','catch','show','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=_0x2202ce[_0x7995('0x1e')],_0x5377e5=_0x1a5310[_0x7995('0x1f')],_0x2eeacc=_0x1a5310[_0x7995('0x1f')]+_0x1a5310[_0x7995('0x20')],_0x565d97;if(_0x2eeacc>=_0x41cbf0){_0x2eeacc=_0x41cbf0;_0x565d97=0xc8;}else{_0x565d97=0xce;}_0x3f1d3e[_0x7995('0x1c')](_0x565d97);return _0x3f1d3e[_0x7995('0x21')]('Content-Range',_0x5377e5+'-'+_0x2eeacc+'/'+_0x41cbf0)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x2536c8){return function(_0x5e6f90){try{jsonpatch['apply'](_0x5e6f90,_0x2536c8,!![]);}catch(_0x3ec178){return BPromise[_0x7995('0x22')](_0x3ec178);}return _0x5e6f90['save']();};}function saveUpdates(_0x3a9b54,_0x51f276){return function(_0x4b1a8e){if(_0x4b1a8e){return _0x4b1a8e[_0x7995('0x23')](_0x3a9b54)[_0x7995('0x24')](function(_0x350fd9){return _0x350fd9;});}return null;};}function removeEntity(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['destroy']()[_0x7995('0x24')](function(){var _0x46ee4b=_0x1c278a[_0x7995('0x25')]({'plain':!![]});var _0x285437=_0x7995('0x26');return db[_0x7995('0x27')][_0x7995('0x28')]({'where':{'type':_0x285437,'resourceId':_0x46ee4b['id']}})[_0x7995('0x24')](function(){return _0x1c278a;});})['then'](function(){_0x1a8568[_0x7995('0x1c')](0xcc)[_0x7995('0x29')]();});}};}function handleEntityNotFound(_0x401dc3,_0x268ce7){return function(_0x3a3fcf){if(!_0x3a3fcf){_0x401dc3[_0x7995('0x1b')](0x194);}return _0x3a3fcf;};}function handleError(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0x1f4;return function(_0x5911c3){logger[_0x7995('0x2a')](_0x5911c3[_0x7995('0x2b')]);if(_0x5911c3[_0x7995('0x2c')]){delete _0x5911c3[_0x7995('0x2c')];}_0x56691a[_0x7995('0x1c')](_0x47625f)['send'](_0x5911c3);};}exports[_0x7995('0x2d')]=function(_0x514445,_0x456a28){var _0x3250e0={},_0x4253e5={},_0x574574={'count':0x0,'rows':[]};var _0x530611=_['map'](db[_0x7995('0x2e')][_0x7995('0x2f')],function(_0x327a81){return{'name':_0x327a81[_0x7995('0x30')],'type':_0x327a81[_0x7995('0x31')][_0x7995('0x32')]};});_0x4253e5['model']=_['map'](_0x530611,_0x7995('0x2c'));_0x4253e5['query']=_[_0x7995('0x33')](_0x514445[_0x7995('0x34')]);_0x4253e5[_0x7995('0x35')]=_[_0x7995('0x36')](_0x4253e5[_0x7995('0x37')],_0x4253e5['query']);_0x3250e0[_0x7995('0x38')]=_[_0x7995('0x36')](_0x4253e5['model'],qs['fields'](_0x514445['query'][_0x7995('0x39')]));_0x3250e0[_0x7995('0x38')]=_0x3250e0['attributes'][_0x7995('0x3a')]?_0x3250e0['attributes']:_0x4253e5[_0x7995('0x37')];if(!_0x514445[_0x7995('0x34')][_0x7995('0x3b')]('nolimit')){_0x3250e0['limit']=qs[_0x7995('0x20')](_0x514445['query']['limit']);_0x3250e0[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x514445['query'][_0x7995('0x1f')]);}_0x3250e0[_0x7995('0x3c')]=qs[_0x7995('0x3d')](_0x514445[_0x7995('0x34')][_0x7995('0x3d')]);_0x3250e0['where']=qs[_0x7995('0x35')](_[_0x7995('0x3e')](_0x514445[_0x7995('0x34')],_0x4253e5[_0x7995('0x35')]),_0x530611);if(_0x514445['query'][_0x7995('0x3f')]){_0x3250e0[_0x7995('0x40')]=_[_0x7995('0x41')](_0x3250e0[_0x7995('0x40')],{'$or':_[_0x7995('0x42')](_0x530611,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x43')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x2c')]]={'$like':'%'+_0x514445[_0x7995('0x34')][_0x7995('0x3f')]+'%'};return _0x3be298;}})});}_0x3250e0=_[_0x7995('0x41')]({},_0x3250e0,_0x514445[_0x7995('0x44')]);var _0x270c0e={'where':_0x3250e0[_0x7995('0x40')]};return db[_0x7995('0x2e')][_0x7995('0x1e')](_0x270c0e)[_0x7995('0x24')](function(_0x7b4e67){_0x574574['count']=_0x7b4e67;if(_0x514445['query'][_0x7995('0x45')]){_0x3250e0[_0x7995('0x46')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3250e0);})[_0x7995('0x24')](function(_0x4a9fef){_0x574574['rows']=_0x4a9fef;return _0x574574;})[_0x7995('0x24')](respondWithFilteredResult(_0x456a28,_0x3250e0))[_0x7995('0x47')](handleError(_0x456a28,null));};exports[_0x7995('0x48')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':!![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x33')](db[_0x7995('0x2e')][_0x7995('0x2f')]);_0x3993b5[_0x7995('0x34')]=_['keys'](_0x576b96[_0x7995('0x34')]);_0x3993b5[_0x7995('0x35')]=_[_0x7995('0x36')](_0x3993b5[_0x7995('0x37')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x36')](_0x3993b5['model'],qs[_0x7995('0x39')](_0x576b96['query'][_0x7995('0x39')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x38')][_0x7995('0x3a')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x37')];if(_0x576b96[_0x7995('0x34')][_0x7995('0x45')]){_0x5e85b9[_0x7995('0x46')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x44')]);return db[_0x7995('0x2e')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x24')](respondWithResult(_0x46ac4f,null))[_0x7995('0x47')](handleError(_0x46ac4f,null));};exports[_0x7995('0x23')]=function(_0x3d8ae3,_0x255313){if(_0x3d8ae3['body']['id']){delete _0x3d8ae3[_0x7995('0x4a')]['id'];}return db[_0x7995('0x2e')]['find']({'where':{'id':_0x3d8ae3[_0x7995('0x4b')]['id']}})['then'](handleEntityNotFound(_0x255313,null))[_0x7995('0x24')](saveUpdates(_0x3d8ae3[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x255313,null))[_0x7995('0x47')](handleError(_0x255313,null));};exports[_0x7995('0x28')]=function(_0x14b537,_0x1579b9){return db['CannedAnswer'][_0x7995('0x49')]({'where':{'id':_0x14b537[_0x7995('0x4b')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1579b9,null))['then'](removeEntity(_0x1579b9,null))[_0x7995('0x47')](handleError(_0x1579b9,null));};exports[_0x7995('0x4c')]=function(_0x12d4b8,_0x47d1d8){var _0x4ec548={'key':_0x12d4b8['body'][_0x7995('0x32')]};if(_0x12d4b8[_0x7995('0x4a')]['MailAccountId']){_0x4ec548[_0x7995('0x4d')]=_0x12d4b8[_0x7995('0x4a')][_0x7995('0x4d')];}else if(_0x12d4b8[_0x7995('0x4a')][_0x7995('0x4e')]){_0x4ec548['SmsAccountId']=_0x12d4b8[_0x7995('0x4a')]['SmsAccountId'];}else if(_0x12d4b8[_0x7995('0x4a')][_0x7995('0x4f')]){_0x4ec548[_0x7995('0x4f')]=_0x12d4b8['body']['OpenchannelAccountId'];}else if(_0x12d4b8['body']['ChatWebsiteId']){_0x4ec548[_0x7995('0x50')]=_0x12d4b8[_0x7995('0x4a')][_0x7995('0x50')];}return db[_0x7995('0x2e')][_0x7995('0x49')]({'where':_0x4ec548})[_0x7995('0x24')](function(_0x1f4270){if(_0x1f4270){throw new db[(_0x7995('0x51'))][(_0x7995('0x52'))](_0x7995('0x53'));}return db[_0x7995('0x2e')][_0x7995('0x4c')](_0x12d4b8[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x1ea1dc){var _0x416133=_0x12d4b8[_0x7995('0x54')][_0x7995('0x25')]({'plain':!![]});if(!_0x416133)throw new Error(_0x7995('0x55'));if(_0x416133['role']===_0x7995('0x54')){var _0x630737=_0x1ea1dc[_0x7995('0x25')]({'plain':!![]});return db[_0x7995('0x56')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x416133[_0x7995('0x57')]},'raw':!![]})[_0x7995('0x24')](function(_0x5b9467){if(_0x5b9467&&_0x5b9467[_0x7995('0x58')]===0x0){return db['UserProfileResource'][_0x7995('0x4c')]({'name':_0x630737[_0x7995('0x2c')],'resourceId':_0x630737['id'],'type':_0x5b9467[_0x7995('0x2c')],'sectionId':_0x5b9467['id']},{})[_0x7995('0x24')](function(){return _0x1ea1dc;});}else{return _0x1ea1dc;}})['catch'](function(_0x5e2d97){logger[_0x7995('0x2a')](_0x7995('0x59'),_0x5e2d97);throw _0x5e2d97;});}return _0x1ea1dc;})[_0x7995('0x24')](respondWithResult(_0x47d1d8,0xc9))[_0x7995('0x47')](handleError(_0x47d1d8,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 82a7fdc..1eca588 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 _0xbfd5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dfb84,_0x430ee0){var _0x5ca5e4=function(_0x4863ac){while(--_0x4863ac){_0x3dfb84['push'](_0x3dfb84['shift']());}};_0x5ca5e4(++_0x430ee0);}(_0xbfd5,0x1dc));var _0x5bfd=function(_0x2ee810,_0x59c070){_0x2ee810=_0x2ee810-0x0;var _0x257dd4=_0xbfd5[_0x2ee810];return _0x257dd4;};'use strict';var _=require(_0x5bfd('0x0'));var util=require(_0x5bfd('0x1'));var logger=require(_0x5bfd('0x2'))(_0x5bfd('0x3'));var moment=require(_0x5bfd('0x4'));var BPromise=require(_0x5bfd('0x5'));var rp=require(_0x5bfd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bfd('0x7'));var config=require(_0x5bfd('0x8'));var attributes=require(_0x5bfd('0x9'));module[_0x5bfd('0xa')]=function(_0x162375,_0x2042e5){return _0x162375['define']('CannedAnswer',attributes,{'tableName':_0x5bfd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5bfd('0xc'),'collate':_0x5bfd('0xd')});};
\ No newline at end of file
+var _0xe79c=['moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x55f78c,_0x364b1f){var _0x33f2d6=function(_0x203a09){while(--_0x203a09){_0x55f78c['push'](_0x55f78c['shift']());}};_0x33f2d6(++_0x364b1f);}(_0xe79c,0x106));var _0xce79=function(_0x1a34b7,_0x59f119){_0x1a34b7=_0x1a34b7-0x0;var _0x521179=_0xe79c[_0x1a34b7];return _0x521179;};'use strict';var _=require(_0xce79('0x0'));var util=require(_0xce79('0x1'));var logger=require(_0xce79('0x2'))(_0xce79('0x3'));var moment=require(_0xce79('0x4'));var BPromise=require(_0xce79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce79('0x6'));var rimraf=require(_0xce79('0x7'));var config=require(_0xce79('0x8'));var attributes=require(_0xce79('0x9'));module['exports']=function(_0x1f9d9b,_0x3ce3af){return _0x1f9d9b[_0xce79('0xa')](_0xce79('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce79('0xc'),'collate':_0xce79('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 15710b9..89f84b8 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 _0x2d53=['../../config/utils','../../config/logger','rpc','client','http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x4bd1d0,_0x17c43f){var _0x1fea67=function(_0x9eb66c){while(--_0x9eb66c){_0x4bd1d0['push'](_0x4bd1d0['shift']());}};_0x1fea67(++_0x17c43f);}(_0x2d53,0x1c3));var _0x32d5=function(_0x1c1172,_0x27c3c4){_0x1c1172=_0x1c1172-0x0;var _0x300943=_0x2d53[_0x1c1172];return _0x300943;};'use strict';var _=require(_0x32d5('0x0'));var util=require(_0x32d5('0x1'));var moment=require(_0x32d5('0x2'));var BPromise=require(_0x32d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32d5('0x4'))['db'];var utils=require(_0x32d5('0x5'));var logger=require(_0x32d5('0x6'))(_0x32d5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x32d5('0x8')][_0x32d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f5546,_0x297217,_0x590ccf){return new BPromise(function(_0x5585e1,_0x3ef505){return client['request'](_0x2f5546,_0x590ccf)['then'](function(_0x3bdb41){logger[_0x32d5('0xa')](_0x32d5('0xb'),_0x297217,_0x32d5('0xc'));logger['debug'](_0x32d5('0xd'),_0x297217,_0x32d5('0xc'),JSON['stringify'](_0x3bdb41));if(_0x3bdb41[_0x32d5('0xe')]){if(_0x3bdb41[_0x32d5('0xe')][_0x32d5('0xf')]===0x1f4){logger[_0x32d5('0xe')](_0x32d5('0xb'),_0x297217,_0x3bdb41[_0x32d5('0xe')]['message']);return _0x3ef505(_0x3bdb41[_0x32d5('0xe')][_0x32d5('0x10')]);}logger[_0x32d5('0xe')](_0x32d5('0xb'),_0x297217,_0x3bdb41[_0x32d5('0xe')][_0x32d5('0x10')]);return _0x5585e1(_0x3bdb41[_0x32d5('0xe')][_0x32d5('0x10')]);}else{logger[_0x32d5('0xa')]('CannedAnswer,\x20%s,\x20%s',_0x297217,'request\x20sent');_0x5585e1(_0x3bdb41[_0x32d5('0x11')][_0x32d5('0x10')]);}})[_0x32d5('0x12')](function(_0x81c3d8){logger[_0x32d5('0xe')](_0x32d5('0xb'),_0x297217,_0x81c3d8);_0x3ef505(_0x81c3d8);});});}
\ No newline at end of file
+var _0xd529=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x2e10ae,_0x2f7199){var _0x59710a=function(_0xe3403c){while(--_0xe3403c){_0x2e10ae['push'](_0x2e10ae['shift']());}};_0x59710a(++_0x2f7199);}(_0xd529,0x17d));var _0x9d52=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd529[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9d52('0x0'));var util=require(_0x9d52('0x1'));var moment=require('moment');var BPromise=require(_0x9d52('0x2'));var rs=require(_0x9d52('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d52('0x4'))['db'];var utils=require(_0x9d52('0x5'));var logger=require(_0x9d52('0x6'))(_0x9d52('0x7'));var config=require(_0x9d52('0x8'));var jayson=require(_0x9d52('0x9'));var client=jayson[_0x9d52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17387c,_0x3bdfc3,_0x2336cd){return new BPromise(function(_0x306886,_0x2c3853){return client[_0x9d52('0xb')](_0x17387c,_0x2336cd)['then'](function(_0x452936){logger['info'](_0x9d52('0xc'),_0x3bdfc3,_0x9d52('0xd'));logger[_0x9d52('0xe')](_0x9d52('0xf'),_0x3bdfc3,_0x9d52('0xd'),JSON['stringify'](_0x452936));if(_0x452936[_0x9d52('0x10')]){if(_0x452936['error']['code']===0x1f4){logger[_0x9d52('0x10')](_0x9d52('0xc'),_0x3bdfc3,_0x452936['error'][_0x9d52('0x11')]);return _0x2c3853(_0x452936[_0x9d52('0x10')][_0x9d52('0x11')]);}logger[_0x9d52('0x10')](_0x9d52('0xc'),_0x3bdfc3,_0x452936[_0x9d52('0x10')][_0x9d52('0x11')]);return _0x306886(_0x452936[_0x9d52('0x10')][_0x9d52('0x11')]);}else{logger[_0x9d52('0x12')](_0x9d52('0xc'),_0x3bdfc3,_0x9d52('0xd'));_0x306886(_0x452936['result'][_0x9d52('0x11')]);}})[_0x9d52('0x13')](function(_0x21896c){logger[_0x9d52('0x10')](_0x9d52('0xc'),_0x3bdfc3,_0x21896c);_0x2c3853(_0x21896c);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index bdd890c..ded1a23 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 _0x00b3=['/:id','show','post','create','put','update','destroy','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x00b3,0x97));var _0x300b=function(_0x1a9a81,_0x4e04c7){_0x1a9a81=_0x1a9a81-0x0;var _0x59bf1f=_0x00b3[_0x1a9a81];return _0x59bf1f;};'use strict';var multer=require(_0x300b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x300b('0x1'));var express=require(_0x300b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x300b('0x3'));var config=require(_0x300b('0x4'));var controller=require(_0x300b('0x5'));router['get']('/',auth[_0x300b('0x6')](),controller[_0x300b('0x7')]);router[_0x300b('0x8')](_0x300b('0x9'),auth[_0x300b('0x6')](),controller[_0x300b('0xa')]);router[_0x300b('0xb')]('/',auth[_0x300b('0x6')](),controller[_0x300b('0xc')]);router[_0x300b('0xd')](_0x300b('0x9'),auth[_0x300b('0x6')](),controller[_0x300b('0xe')]);router['delete'](_0x300b('0x9'),auth[_0x300b('0x6')](),controller[_0x300b('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xeea1=['Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','update','delete','exports','multer','connect-timeout'];(function(_0x4a88b5,_0x5cd99c){var _0xc55b9b=function(_0x51559c){while(--_0x51559c){_0x4a88b5['push'](_0x4a88b5['shift']());}};_0xc55b9b(++_0x5cd99c);}(_0xeea1,0xfd));var _0x1eea=function(_0x1e2532,_0xb156e8){_0x1e2532=_0x1e2532-0x0;var _0x159658=_0xeea1[_0x1e2532];return _0x159658;};'use strict';var multer=require(_0x1eea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1eea('0x1'));var express=require('express');var router=express[_0x1eea('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1eea('0x3'));var config=require(_0x1eea('0x4'));var controller=require(_0x1eea('0x5'));router[_0x1eea('0x6')]('/',auth['isAuthenticated'](),controller[_0x1eea('0x7')]);router[_0x1eea('0x6')](_0x1eea('0x8'),auth[_0x1eea('0x9')](),controller[_0x1eea('0xa')]);router['post']('/',auth[_0x1eea('0x9')](),controller[_0x1eea('0xb')]);router['put'](_0x1eea('0x8'),auth[_0x1eea('0x9')](),controller[_0x1eea('0xc')]);router[_0x1eea('0xd')](_0x1eea('0x8'),auth[_0x1eea('0x9')](),controller['destroy']);module[_0x1eea('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 276698d..4886a4d 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 _0x9692=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x205328,_0x12c15a){var _0x4a30eb=function(_0x226d48){while(--_0x226d48){_0x205328['push'](_0x205328['shift']());}};_0x4a30eb(++_0x12c15a);}(_0x9692,0xa2));var _0x2969=function(_0x28c188,_0x1951e4){_0x28c188=_0x28c188-0x0;var _0x880523=_0x9692[_0x28c188];return _0x880523;};'use strict';var Sequelize=require(_0x2969('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x2969('0x1')],'allowNull':![],'defaultValue':_0x2969('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x2969('0x3')]},'dst':{'type':Sequelize[_0x2969('0x3')]},'dcontext':{'type':Sequelize[_0x2969('0x3')]},'channel':{'type':Sequelize[_0x2969('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x2969('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2969('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2969('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2969('0x3')]},'amaflags':{'type':Sequelize[_0x2969('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2969('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2969('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x2969('0x3')]},'peeraccount':{'type':Sequelize[_0x2969('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x2969('0x3')]}};
\ No newline at end of file
+var _0x4e40=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e40,0x166));var _0x04e4=function(_0x439e0a,_0x5b465f){_0x439e0a=_0x439e0a-0x0;var _0x462d66=_0x4e40[_0x439e0a];return _0x462d66;};'use strict';var Sequelize=require(_0x04e4('0x0'));module[_0x04e4('0x1')]={'calldate':{'type':Sequelize[_0x04e4('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x04e4('0x3')]},'src':{'type':Sequelize[_0x04e4('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x04e4('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x04e4('0x3')]},'lastdata':{'type':Sequelize[_0x04e4('0x3')]},'duration':{'type':Sequelize[_0x04e4('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x04e4('0x3')]},'amaflags':{'type':Sequelize[_0x04e4('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x04e4('0x3')]},'userfield':{'type':Sequelize[_0x04e4('0x3')]},'uniqueid':{'type':Sequelize[_0x04e4('0x3')]},'linkedid':{'type':Sequelize[_0x04e4('0x3')]},'sequence':{'type':Sequelize[_0x04e4('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x04e4('0x3')]},'tag':{'type':Sequelize[_0x04e4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 713c646..bf7df38 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 _0xd384=['show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Cdr','include','rows','catch'];(function(_0x4f20a9,_0x329426){var _0x4ebe5b=function(_0x17e0cb){while(--_0x17e0cb){_0x4f20a9['push'](_0x4f20a9['shift']());}};_0x4ebe5b(++_0x329426);}(_0xd384,0x133));var _0x4d38=function(_0x5696a4,_0xb07ad0){_0x5696a4=_0x5696a4-0x0;var _0x6dec9d=_0xd384[_0x5696a4];return _0x6dec9d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4d38('0x0'));var rimraf=require(_0x4d38('0x1'));var zipdir=require(_0x4d38('0x2'));var jsonpatch=require(_0x4d38('0x3'));var rp=require('request-promise');var moment=require(_0x4d38('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d38('0x5'));var util=require(_0x4d38('0x6'));var path=require(_0x4d38('0x7'));var sox=require(_0x4d38('0x8'));var csv=require(_0x4d38('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d38('0xa'));var squel=require('squel');var crypto=require(_0x4d38('0xb'));var jsforce=require(_0x4d38('0xc'));var deskjs=require(_0x4d38('0xd'));var toCsv=require(_0x4d38('0x9'));var querystring=require(_0x4d38('0xe'));var Papa=require(_0x4d38('0xf'));var Redis=require(_0x4d38('0x10'));var authService=require(_0x4d38('0x11'));var qs=require(_0x4d38('0x12'));var as=require(_0x4d38('0x13'));var hardwareService=require(_0x4d38('0x14'));var logger=require(_0x4d38('0x15'))('api');var utils=require(_0x4d38('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4d38('0x17'))['db'];function respondWithStatusCode(_0x2e6c51,_0xec6def){_0xec6def=_0xec6def||0xcc;return function(_0xb86d71){if(_0xb86d71){return _0x2e6c51[_0x4d38('0x18')](_0xec6def);}return _0x2e6c51[_0x4d38('0x19')](_0xec6def)[_0x4d38('0x1a')]();};}function respondWithResult(_0x4fbec8,_0x3c69fb){_0x3c69fb=_0x3c69fb||0xc8;return function(_0x4700e9){if(_0x4700e9){return _0x4fbec8[_0x4d38('0x19')](_0x3c69fb)[_0x4d38('0x1b')](_0x4700e9);}};}function respondWithFilteredResult(_0x428a05,_0x12250d){return function(_0x5e1ea5){if(_0x5e1ea5){var _0x30b868=_0x5e1ea5[_0x4d38('0x1c')],_0x1bbb7f=_0x12250d['offset'],_0x55abe6=_0x12250d[_0x4d38('0x1d')]+_0x12250d['limit'],_0x230745;if(_0x55abe6>=_0x30b868){_0x55abe6=_0x30b868;_0x230745=0xc8;}else{_0x230745=0xce;}_0x428a05[_0x4d38('0x19')](_0x230745);return _0x428a05[_0x4d38('0x1e')]('Content-Range',_0x1bbb7f+'-'+_0x55abe6+'/'+_0x30b868)[_0x4d38('0x1b')](_0x5e1ea5);}return null;};}function patchUpdates(_0x641979){return function(_0x3e3079){try{jsonpatch[_0x4d38('0x1f')](_0x3e3079,_0x641979,!![]);}catch(_0x2e137b){return BPromise[_0x4d38('0x20')](_0x2e137b);}return _0x3e3079[_0x4d38('0x21')]();};}function saveUpdates(_0x1737c6,_0x444c0d){return function(_0x23a64c){if(_0x23a64c){return _0x23a64c[_0x4d38('0x22')](_0x1737c6)['then'](function(_0x7aaebd){return _0x7aaebd;});}return null;};}function removeEntity(_0x524f33,_0x448b34){return function(_0x4ac26b){if(_0x4ac26b){return _0x4ac26b[_0x4d38('0x23')]()[_0x4d38('0x24')](function(){_0x524f33[_0x4d38('0x19')](0xcc)[_0x4d38('0x1a')]();});}};}function handleEntityNotFound(_0x30c1a4,_0x7eb685){return function(_0x426a5d){if(!_0x426a5d){_0x30c1a4['sendStatus'](0x194);}return _0x426a5d;};}function handleError(_0x57242e,_0x479a04){_0x479a04=_0x479a04||0x1f4;return function(_0x641a30){logger[_0x4d38('0x25')](_0x641a30[_0x4d38('0x26')]);if(_0x641a30['name']){delete _0x641a30[_0x4d38('0x27')];}_0x57242e[_0x4d38('0x19')](_0x479a04)['send'](_0x641a30);};}exports[_0x4d38('0x28')]=function(_0x5322d4,_0x555a12){var _0x359278={},_0x457a60={},_0x32be32={'count':0x0,'rows':[]};var _0x3a5416=_[_0x4d38('0x29')](db['Cdr'][_0x4d38('0x2a')],function(_0x215f0e){return{'name':_0x215f0e[_0x4d38('0x2b')],'type':_0x215f0e['type']['key']};});_0x457a60['model']=_[_0x4d38('0x29')](_0x3a5416,_0x4d38('0x27'));_0x457a60[_0x4d38('0x2c')]=_[_0x4d38('0x2d')](_0x5322d4[_0x4d38('0x2c')]);_0x457a60[_0x4d38('0x2e')]=_[_0x4d38('0x2f')](_0x457a60[_0x4d38('0x30')],_0x457a60[_0x4d38('0x2c')]);_0x359278[_0x4d38('0x31')]=_[_0x4d38('0x2f')](_0x457a60[_0x4d38('0x30')],qs[_0x4d38('0x32')](_0x5322d4['query'][_0x4d38('0x32')]));_0x359278[_0x4d38('0x31')]=_0x359278[_0x4d38('0x31')][_0x4d38('0x33')]?_0x359278[_0x4d38('0x31')]:_0x457a60[_0x4d38('0x30')];if(!_0x5322d4[_0x4d38('0x2c')][_0x4d38('0x34')](_0x4d38('0x35'))){_0x359278[_0x4d38('0x36')]=qs['limit'](_0x5322d4[_0x4d38('0x2c')][_0x4d38('0x36')]);_0x359278['offset']=qs[_0x4d38('0x1d')](_0x5322d4[_0x4d38('0x2c')]['offset']);}_0x359278[_0x4d38('0x37')]=qs['sort'](_0x5322d4[_0x4d38('0x2c')][_0x4d38('0x38')]);_0x359278[_0x4d38('0x39')]=qs[_0x4d38('0x2e')](_[_0x4d38('0x3a')](_0x5322d4['query'],_0x457a60[_0x4d38('0x2e')]),_0x3a5416);if(_0x5322d4[_0x4d38('0x2c')][_0x4d38('0x3b')]){_0x359278[_0x4d38('0x39')]=_['merge'](_0x359278[_0x4d38('0x39')],{'$or':_['map'](_0x3a5416,function(_0x2d1234){if(_0x2d1234[_0x4d38('0x3c')]!==_0x4d38('0x3d')){var _0x4c9ea3={};_0x4c9ea3[_0x2d1234[_0x4d38('0x27')]]={'$like':'%'+_0x5322d4[_0x4d38('0x2c')][_0x4d38('0x3b')]+'%'};return _0x4c9ea3;}})});}_0x359278=_[_0x4d38('0x3e')]({},_0x359278,_0x5322d4[_0x4d38('0x3f')]);var _0x336cc8={'where':_0x359278[_0x4d38('0x39')]};return db[_0x4d38('0x40')][_0x4d38('0x1c')](_0x336cc8)[_0x4d38('0x24')](function(_0x3cf2b8){_0x32be32[_0x4d38('0x1c')]=_0x3cf2b8;if(_0x5322d4[_0x4d38('0x2c')]['includeAll']){_0x359278[_0x4d38('0x41')]=[{'all':!![]}];}return db[_0x4d38('0x40')]['findAll'](_0x359278);})[_0x4d38('0x24')](function(_0x39280b){_0x32be32[_0x4d38('0x42')]=_0x39280b;return _0x32be32;})['then'](respondWithFilteredResult(_0x555a12,_0x359278))[_0x4d38('0x43')](handleError(_0x555a12,null));};exports[_0x4d38('0x44')]=function(_0x893756,_0x2cd10d){var _0x54362e={'raw':!![],'where':{'id':_0x893756[_0x4d38('0x45')]['id']}},_0x38ba1f={};_0x38ba1f['model']=_['keys'](db[_0x4d38('0x40')][_0x4d38('0x2a')]);_0x38ba1f[_0x4d38('0x2c')]=_[_0x4d38('0x2d')](_0x893756[_0x4d38('0x2c')]);_0x38ba1f[_0x4d38('0x2e')]=_[_0x4d38('0x2f')](_0x38ba1f['model'],_0x38ba1f[_0x4d38('0x2c')]);_0x54362e[_0x4d38('0x31')]=_[_0x4d38('0x2f')](_0x38ba1f[_0x4d38('0x30')],qs[_0x4d38('0x32')](_0x893756[_0x4d38('0x2c')][_0x4d38('0x32')]));_0x54362e[_0x4d38('0x31')]=_0x54362e[_0x4d38('0x31')][_0x4d38('0x33')]?_0x54362e[_0x4d38('0x31')]:_0x38ba1f[_0x4d38('0x30')];if(_0x893756['query'][_0x4d38('0x46')]){_0x54362e['include']=[{'all':!![]}];}_0x54362e=_[_0x4d38('0x3e')]({},_0x54362e,_0x893756[_0x4d38('0x3f')]);return db['Cdr'][_0x4d38('0x47')](_0x54362e)['then'](handleEntityNotFound(_0x2cd10d,null))['then'](respondWithResult(_0x2cd10d,null))[_0x4d38('0x43')](handleError(_0x2cd10d,null));};exports['create']=function(_0x40f507,_0x6ee63){return db['Cdr'][_0x4d38('0x48')](_0x40f507[_0x4d38('0x49')],{})['then'](respondWithResult(_0x6ee63,0xc9))['catch'](handleError(_0x6ee63,null));};exports['update']=function(_0xb77936,_0x28bce5){if(_0xb77936[_0x4d38('0x49')]['id']){delete _0xb77936[_0x4d38('0x49')]['id'];}return db[_0x4d38('0x40')]['find']({'where':{'id':_0xb77936['params']['id']}})[_0x4d38('0x24')](handleEntityNotFound(_0x28bce5,null))['then'](saveUpdates(_0xb77936[_0x4d38('0x49')],null))[_0x4d38('0x24')](respondWithResult(_0x28bce5,null))[_0x4d38('0x43')](handleError(_0x28bce5,null));};exports[_0x4d38('0x23')]=function(_0x5bb2e4,_0x491945){return db[_0x4d38('0x40')][_0x4d38('0x47')]({'where':{'id':_0x5bb2e4[_0x4d38('0x45')]['id']}})[_0x4d38('0x24')](handleEntityNotFound(_0x491945,null))[_0x4d38('0x24')](removeEntity(_0x491945,null))[_0x4d38('0x43')](handleError(_0x491945,null));};exports[_0x4d38('0x4a')]=function(_0x56ed05,_0x1a093b){return db[_0x4d38('0x40')][_0x4d38('0x4a')]()[_0x4d38('0x24')](respondWithResult(_0x1a093b,null))[_0x4d38('0x43')](handleError(_0x1a093b,null));};
\ No newline at end of file
+var _0xc0e2=['map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params','find','create','body','update','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','destroy','error','stack','name','Cdr','rawAttributes','type','key'];(function(_0x5a9841,_0x950566){var _0xb4f748=function(_0xdecea8){while(--_0xdecea8){_0x5a9841['push'](_0x5a9841['shift']());}};_0xb4f748(++_0x950566);}(_0xc0e2,0xb1));var _0x2c0e=function(_0xa69f72,_0x2f95b6){_0xa69f72=_0xa69f72-0x0;var _0x3ab3e8=_0xc0e2[_0xa69f72];return _0x3ab3e8;};'use strict';var pdf=require(_0x2c0e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c0e('0x1'));var jsonpatch=require(_0x2c0e('0x2'));var rp=require(_0x2c0e('0x3'));var moment=require(_0x2c0e('0x4'));var BPromise=require(_0x2c0e('0x5'));var Mustache=require(_0x2c0e('0x6'));var util=require(_0x2c0e('0x7'));var path=require(_0x2c0e('0x8'));var sox=require(_0x2c0e('0x9'));var csv=require(_0x2c0e('0xa'));var ejs=require(_0x2c0e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2c0e('0xc'));var crypto=require(_0x2c0e('0xd'));var jsforce=require(_0x2c0e('0xe'));var deskjs=require(_0x2c0e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2c0e('0x10'));var authService=require(_0x2c0e('0x11'));var qs=require(_0x2c0e('0x12'));var as=require(_0x2c0e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c0e('0x14'))(_0x2c0e('0x15'));var utils=require(_0x2c0e('0x16'));var config=require(_0x2c0e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x372630,_0x236b8c){_0x236b8c=_0x236b8c||0xcc;return function(_0x565d95){if(_0x565d95){return _0x372630[_0x2c0e('0x18')](_0x236b8c);}return _0x372630['status'](_0x236b8c)[_0x2c0e('0x19')]();};}function respondWithResult(_0x536665,_0x519634){_0x519634=_0x519634||0xc8;return function(_0x2c1a52){if(_0x2c1a52){return _0x536665[_0x2c0e('0x1a')](_0x519634)[_0x2c0e('0x1b')](_0x2c1a52);}};}function respondWithFilteredResult(_0xbe67af,_0x228578){return function(_0x31ac77){if(_0x31ac77){var _0x5e97dc=_0x31ac77[_0x2c0e('0x1c')],_0x269ffa=_0x228578[_0x2c0e('0x1d')],_0x284e20=_0x228578['offset']+_0x228578[_0x2c0e('0x1e')],_0x79a65;if(_0x284e20>=_0x5e97dc){_0x284e20=_0x5e97dc;_0x79a65=0xc8;}else{_0x79a65=0xce;}_0xbe67af[_0x2c0e('0x1a')](_0x79a65);return _0xbe67af[_0x2c0e('0x1f')](_0x2c0e('0x20'),_0x269ffa+'-'+_0x284e20+'/'+_0x5e97dc)[_0x2c0e('0x1b')](_0x31ac77);}return null;};}function patchUpdates(_0x31c4c4){return function(_0x51ce38){try{jsonpatch['apply'](_0x51ce38,_0x31c4c4,!![]);}catch(_0x3b3fee){return BPromise['reject'](_0x3b3fee);}return _0x51ce38[_0x2c0e('0x21')]();};}function saveUpdates(_0x40817a,_0xd8cd68){return function(_0xaf0062){if(_0xaf0062){return _0xaf0062['update'](_0x40817a)['then'](function(_0x2e1236){return _0x2e1236;});}return null;};}function removeEntity(_0x5e69da,_0x2b4578){return function(_0x45420a){if(_0x45420a){return _0x45420a[_0x2c0e('0x22')]()['then'](function(){_0x5e69da[_0x2c0e('0x1a')](0xcc)[_0x2c0e('0x19')]();});}};}function handleEntityNotFound(_0x366864,_0x1b2451){return function(_0x33b2d0){if(!_0x33b2d0){_0x366864[_0x2c0e('0x18')](0x194);}return _0x33b2d0;};}function handleError(_0x3e3664,_0x5c2a46){_0x5c2a46=_0x5c2a46||0x1f4;return function(_0x3de47d){logger[_0x2c0e('0x23')](_0x3de47d[_0x2c0e('0x24')]);if(_0x3de47d[_0x2c0e('0x25')]){delete _0x3de47d[_0x2c0e('0x25')];}_0x3e3664[_0x2c0e('0x1a')](_0x5c2a46)['send'](_0x3de47d);};}exports['index']=function(_0x7dd1ae,_0x36874e){var _0x47a5d8={},_0x5d67f6={},_0x428ff5={'count':0x0,'rows':[]};var _0x36d735=_['map'](db[_0x2c0e('0x26')][_0x2c0e('0x27')],function(_0x2f20ee){return{'name':_0x2f20ee['fieldName'],'type':_0x2f20ee[_0x2c0e('0x28')][_0x2c0e('0x29')]};});_0x5d67f6['model']=_[_0x2c0e('0x2a')](_0x36d735,_0x2c0e('0x25'));_0x5d67f6['query']=_[_0x2c0e('0x2b')](_0x7dd1ae[_0x2c0e('0x2c')]);_0x5d67f6[_0x2c0e('0x2d')]=_[_0x2c0e('0x2e')](_0x5d67f6[_0x2c0e('0x2f')],_0x5d67f6[_0x2c0e('0x2c')]);_0x47a5d8[_0x2c0e('0x30')]=_[_0x2c0e('0x2e')](_0x5d67f6[_0x2c0e('0x2f')],qs[_0x2c0e('0x31')](_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x31')]));_0x47a5d8[_0x2c0e('0x30')]=_0x47a5d8[_0x2c0e('0x30')][_0x2c0e('0x32')]?_0x47a5d8['attributes']:_0x5d67f6[_0x2c0e('0x2f')];if(!_0x7dd1ae['query'][_0x2c0e('0x33')](_0x2c0e('0x34'))){_0x47a5d8[_0x2c0e('0x1e')]=qs['limit'](_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x1e')]);_0x47a5d8[_0x2c0e('0x1d')]=qs['offset'](_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x1d')]);}_0x47a5d8['order']=qs[_0x2c0e('0x35')](_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x35')]);_0x47a5d8[_0x2c0e('0x36')]=qs[_0x2c0e('0x2d')](_[_0x2c0e('0x37')](_0x7dd1ae[_0x2c0e('0x2c')],_0x5d67f6[_0x2c0e('0x2d')]),_0x36d735);if(_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x38')]){_0x47a5d8[_0x2c0e('0x36')]=_[_0x2c0e('0x39')](_0x47a5d8[_0x2c0e('0x36')],{'$or':_[_0x2c0e('0x2a')](_0x36d735,function(_0x2f5be4){if(_0x2f5be4[_0x2c0e('0x28')]!==_0x2c0e('0x3a')){var _0x4b503b={};_0x4b503b[_0x2f5be4['name']]={'$like':'%'+_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x38')]+'%'};return _0x4b503b;}})});}_0x47a5d8=_[_0x2c0e('0x39')]({},_0x47a5d8,_0x7dd1ae[_0x2c0e('0x3b')]);var _0x156b92={'where':_0x47a5d8[_0x2c0e('0x36')]};return db[_0x2c0e('0x26')][_0x2c0e('0x1c')](_0x156b92)['then'](function(_0x1d5aa4){_0x428ff5['count']=_0x1d5aa4;if(_0x7dd1ae[_0x2c0e('0x2c')][_0x2c0e('0x3c')]){_0x47a5d8[_0x2c0e('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x2c0e('0x3e')](_0x47a5d8);})['then'](function(_0x410033){_0x428ff5[_0x2c0e('0x3f')]=_0x410033;return _0x428ff5;})[_0x2c0e('0x40')](respondWithFilteredResult(_0x36874e,_0x47a5d8))[_0x2c0e('0x41')](handleError(_0x36874e,null));};exports[_0x2c0e('0x42')]=function(_0x5b6685,_0x2f91a7){var _0x268a63={'raw':!![],'where':{'id':_0x5b6685[_0x2c0e('0x43')]['id']}},_0x180313={};_0x180313['model']=_['keys'](db[_0x2c0e('0x26')][_0x2c0e('0x27')]);_0x180313[_0x2c0e('0x2c')]=_[_0x2c0e('0x2b')](_0x5b6685['query']);_0x180313['filters']=_[_0x2c0e('0x2e')](_0x180313[_0x2c0e('0x2f')],_0x180313[_0x2c0e('0x2c')]);_0x268a63[_0x2c0e('0x30')]=_[_0x2c0e('0x2e')](_0x180313[_0x2c0e('0x2f')],qs['fields'](_0x5b6685['query'][_0x2c0e('0x31')]));_0x268a63[_0x2c0e('0x30')]=_0x268a63[_0x2c0e('0x30')][_0x2c0e('0x32')]?_0x268a63['attributes']:_0x180313[_0x2c0e('0x2f')];if(_0x5b6685['query'][_0x2c0e('0x3c')]){_0x268a63['include']=[{'all':!![]}];}_0x268a63=_[_0x2c0e('0x39')]({},_0x268a63,_0x5b6685[_0x2c0e('0x3b')]);return db[_0x2c0e('0x26')][_0x2c0e('0x44')](_0x268a63)[_0x2c0e('0x40')](handleEntityNotFound(_0x2f91a7,null))[_0x2c0e('0x40')](respondWithResult(_0x2f91a7,null))[_0x2c0e('0x41')](handleError(_0x2f91a7,null));};exports[_0x2c0e('0x45')]=function(_0x3ebc81,_0x2e04b1){return db[_0x2c0e('0x26')]['create'](_0x3ebc81[_0x2c0e('0x46')],{})[_0x2c0e('0x40')](respondWithResult(_0x2e04b1,0xc9))[_0x2c0e('0x41')](handleError(_0x2e04b1,null));};exports[_0x2c0e('0x47')]=function(_0x227f26,_0x4c04d5){if(_0x227f26[_0x2c0e('0x46')]['id']){delete _0x227f26[_0x2c0e('0x46')]['id'];}return db[_0x2c0e('0x26')]['find']({'where':{'id':_0x227f26[_0x2c0e('0x43')]['id']}})[_0x2c0e('0x40')](handleEntityNotFound(_0x4c04d5,null))['then'](saveUpdates(_0x227f26[_0x2c0e('0x46')],null))[_0x2c0e('0x40')](respondWithResult(_0x4c04d5,null))['catch'](handleError(_0x4c04d5,null));};exports[_0x2c0e('0x22')]=function(_0x312c8b,_0x634081){return db['Cdr'][_0x2c0e('0x44')]({'where':{'id':_0x312c8b[_0x2c0e('0x43')]['id']}})[_0x2c0e('0x40')](handleEntityNotFound(_0x634081,null))[_0x2c0e('0x40')](removeEntity(_0x634081,null))[_0x2c0e('0x41')](handleError(_0x634081,null));};exports[_0x2c0e('0x48')]=function(_0x1bfc7f,_0x5e2427){return db['Cdr'][_0x2c0e('0x48')]()[_0x2c0e('0x40')](respondWithResult(_0x5e2427,null))[_0x2c0e('0x41')](handleError(_0x5e2427,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 4274fa4..5ed0484 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 _0x4991=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid'];(function(_0x17278e,_0x1e3e64){var _0x370d47=function(_0x41bb5f){while(--_0x41bb5f){_0x17278e['push'](_0x17278e['shift']());}};_0x370d47(++_0x1e3e64);}(_0x4991,0xf7));var _0x1499=function(_0x4ba660,_0x3f299f){_0x4ba660=_0x4ba660-0x0;var _0x120b2b=_0x4991[_0x4ba660];return _0x120b2b;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));module[_0x1499('0x9')]=function(_0x4b6154,_0x2a8e96){return _0x4b6154[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[{'name':_0x1499('0xd'),'fields':[_0x1499('0xd')]},{'name':_0x1499('0xe'),'fields':[_0x1499('0xe')]},{'name':'disposition','fields':[_0x1499('0xf')]},{'name':_0x1499('0x10'),'fields':['dst']},{'name':_0x1499('0x11'),'fields':[_0x1499('0x11')]},{'name':'uniqueid','fields':[_0x1499('0x12')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x57ca=['rimraf','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x20e283,_0x2b5a6e){var _0x199e10=function(_0xaccd3a){while(--_0xaccd3a){_0x20e283['push'](_0x20e283['shift']());}};_0x199e10(++_0x2b5a6e);}(_0x57ca,0x108));var _0xa57c=function(_0x43ab88,_0x1a9e35){_0x43ab88=_0x43ab88-0x0;var _0x2bafa0=_0x57ca[_0x43ab88];return _0x2bafa0;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['accountcode']},{'name':_0xa57c('0xd'),'fields':['calldate']},{'name':_0xa57c('0xe'),'fields':[_0xa57c('0xe')]},{'name':'dst','fields':[_0xa57c('0xf')]},{'name':'src','fields':[_0xa57c('0x10')]},{'name':_0xa57c('0x11'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 4b5e9c2..30633b6 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 _0xed5e=['client','http','then','info','request\x20sent','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x24003a,_0x4f4649){var _0x1d76b0=function(_0x5d020c){while(--_0x5d020c){_0x24003a['push'](_0x24003a['shift']());}};_0x1d76b0(++_0x4f4649);}(_0xed5e,0x102));var _0xeed5=function(_0x13b948,_0x2a5a86){_0x13b948=_0x13b948-0x0;var _0x2f0044=_0xed5e[_0x13b948];return _0x2f0044;};'use strict';var _=require(_0xeed5('0x0'));var util=require('util');var moment=require(_0xeed5('0x1'));var BPromise=require(_0xeed5('0x2'));var rs=require(_0xeed5('0x3'));var fs=require('fs');var Redis=require(_0xeed5('0x4'));var db=require(_0xeed5('0x5'))['db'];var utils=require(_0xeed5('0x6'));var logger=require('../../config/logger')(_0xeed5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeed5('0x8')][_0xeed5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b33e2,_0x2d00f4,_0x5aa5e6){return new BPromise(function(_0x1cb839,_0x12a6fd){return client['request'](_0x1b33e2,_0x5aa5e6)[_0xeed5('0xa')](function(_0x4ffe57){logger[_0xeed5('0xb')]('Cdr,\x20%s,\x20%s',_0x2d00f4,_0xeed5('0xc'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x2d00f4,_0xeed5('0xc'),JSON[_0xeed5('0xd')](_0x4ffe57));if(_0x4ffe57[_0xeed5('0xe')]){if(_0x4ffe57['error'][_0xeed5('0xf')]===0x1f4){logger[_0xeed5('0xe')]('Cdr,\x20%s,\x20%s',_0x2d00f4,_0x4ffe57[_0xeed5('0xe')]['message']);return _0x12a6fd(_0x4ffe57[_0xeed5('0xe')][_0xeed5('0x10')]);}logger[_0xeed5('0xe')](_0xeed5('0x11'),_0x2d00f4,_0x4ffe57[_0xeed5('0xe')][_0xeed5('0x10')]);return _0x1cb839(_0x4ffe57[_0xeed5('0xe')]['message']);}else{logger['info'](_0xeed5('0x11'),_0x2d00f4,'request\x20sent');_0x1cb839(_0x4ffe57[_0xeed5('0x12')][_0xeed5('0x10')]);}})['catch'](function(_0x37f890){logger[_0xeed5('0xe')](_0xeed5('0x11'),_0x2d00f4,_0x37f890);_0x12a6fd(_0x37f890);});});}
\ No newline at end of file
+var _0x1a96=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x1e6f26,_0x27d992){var _0x4820f9=function(_0x2d0c4b){while(--_0x2d0c4b){_0x1e6f26['push'](_0x1e6f26['shift']());}};_0x4820f9(++_0x27d992);}(_0x1a96,0x18e));var _0x61a9=function(_0x539243,_0x60bc3d){_0x539243=_0x539243-0x0;var _0x5cc843=_0x1a96[_0x539243];return _0x5cc843;};'use strict';var _=require(_0x61a9('0x0'));var util=require(_0x61a9('0x1'));var moment=require(_0x61a9('0x2'));var BPromise=require(_0x61a9('0x3'));var rs=require(_0x61a9('0x4'));var fs=require('fs');var Redis=require(_0x61a9('0x5'));var db=require(_0x61a9('0x6'))['db'];var utils=require(_0x61a9('0x7'));var logger=require(_0x61a9('0x8'))('rpc');var config=require(_0x61a9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x61a9('0xa')][_0x61a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12d882,_0x81d646,_0xf4cdd9){return new BPromise(function(_0x399c6c,_0x4a6c6e){return client[_0x61a9('0xc')](_0x12d882,_0xf4cdd9)['then'](function(_0x13cdc4){logger[_0x61a9('0xd')](_0x61a9('0xe'),_0x81d646,_0x61a9('0xf'));logger[_0x61a9('0x10')](_0x61a9('0x11'),_0x81d646,_0x61a9('0xf'),JSON[_0x61a9('0x12')](_0x13cdc4));if(_0x13cdc4['error']){if(_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x14')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x81d646,_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);return _0x4a6c6e(_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);}logger['error'](_0x61a9('0xe'),_0x81d646,_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);return _0x399c6c(_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);}else{logger['info'](_0x61a9('0xe'),_0x81d646,_0x61a9('0xf'));_0x399c6c(_0x13cdc4['result'][_0x61a9('0x15')]);}})[_0x61a9('0x16')](function(_0x3b5931){logger[_0x61a9('0x13')](_0x61a9('0xe'),_0x81d646,_0x3b5931);_0x4a6c6e(_0x3b5931);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 18e5d54..69a86de 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 _0xd5b6=['../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x1fd2e8,_0x49432f){var _0x32524e=function(_0x15a743){while(--_0x15a743){_0x1fd2e8['push'](_0x1fd2e8['shift']());}};_0x32524e(++_0x49432f);}(_0xd5b6,0x14a));var _0x6d5b=function(_0x4d0c8a,_0x2a57e2){_0x4d0c8a=_0x4d0c8a-0x0;var _0x1b53e5=_0xd5b6[_0x4d0c8a];return _0x1b53e5;};'use strict';var multer=require(_0x6d5b('0x0'));var util=require(_0x6d5b('0x1'));var path=require(_0x6d5b('0x2'));var timeout=require(_0x6d5b('0x3'));var express=require(_0x6d5b('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6d5b('0x5'));var config=require(_0x6d5b('0x6'));var controller=require(_0x6d5b('0x7'));router[_0x6d5b('0x8')]('/',auth[_0x6d5b('0x9')](),controller[_0x6d5b('0xa')]);router[_0x6d5b('0x8')](_0x6d5b('0xb'),auth[_0x6d5b('0x9')](),controller[_0x6d5b('0xc')]);router[_0x6d5b('0x8')]('/:id',auth[_0x6d5b('0x9')](),controller[_0x6d5b('0xd')]);router[_0x6d5b('0xe')]('/',auth[_0x6d5b('0x9')](),controller[_0x6d5b('0xf')]);router[_0x6d5b('0x10')](_0x6d5b('0x11'),auth[_0x6d5b('0x9')](),controller['update']);router[_0x6d5b('0x12')](_0x6d5b('0x11'),auth[_0x6d5b('0x9')](),controller[_0x6d5b('0x13')]);module[_0x6d5b('0x14')]=router;
\ No newline at end of file
+var _0xe95e=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./cdr.controller','isAuthenticated','index','get','show'];(function(_0x5e3b5d,_0x2deeb2){var _0x5ae21a=function(_0xb885f0){while(--_0xb885f0){_0x5e3b5d['push'](_0x5e3b5d['shift']());}};_0x5ae21a(++_0x2deeb2);}(_0xe95e,0x7a));var _0xee95=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0xe95e[_0x333798];return _0x389f4e;};'use strict';var multer=require(_0xee95('0x0'));var util=require(_0xee95('0x1'));var path=require(_0xee95('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee95('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xee95('0x4'));var config=require(_0xee95('0x5'));var controller=require(_0xee95('0x6'));router['get']('/',auth[_0xee95('0x7')](),controller[_0xee95('0x8')]);router[_0xee95('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xee95('0x9')]('/:id',auth[_0xee95('0x7')](),controller[_0xee95('0xa')]);router[_0xee95('0xb')]('/',auth['isAuthenticated'](),controller[_0xee95('0xc')]);router[_0xee95('0xd')](_0xee95('0xe'),auth[_0xee95('0x7')](),controller[_0xee95('0xf')]);router[_0xee95('0x10')](_0xee95('0xe'),auth['isAuthenticated'](),controller[_0xee95('0x11')]);module[_0xee95('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 67bf964..a61f4f4 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 _0xd505=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x2d67fa,_0x4edc78){var _0x350f91=function(_0x46eeeb){while(--_0x46eeeb){_0x2d67fa['push'](_0x2d67fa['shift']());}};_0x350f91(++_0x4edc78);}(_0xd505,0x111));var _0x5d50=function(_0x4d5ff3,_0x16d226){_0x4d5ff3=_0x4d5ff3-0x0;var _0x45038a=_0xd505[_0x4d5ff3];return _0x45038a;};'use strict';var Sequelize=require(_0x5d50('0x0'));module[_0x5d50('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5d50('0x2')],'allowNull':![],'defaultValue':_0x5d50('0x3')},'appdata':{'type':Sequelize[_0x5d50('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5d50('0x2')],'defaultValue':_0x5d50('0x5')}};
\ No newline at end of file
+var _0x2de1=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x2de1,0x157));var _0x12de=function(_0x501041,_0x34fc51){_0x501041=_0x501041-0x0;var _0x335489=_0x2de1[_0x501041];return _0x335489;};'use strict';var Sequelize=require(_0x12de('0x0'));module[_0x12de('0x1')]={'priority':{'type':Sequelize[_0x12de('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x12de('0x3')},'appdata':{'type':Sequelize[_0x12de('0x4')]()},'description':{'type':Sequelize[_0x12de('0x5')]},'interval':{'type':Sequelize[_0x12de('0x5')],'defaultValue':_0x12de('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 8cc0142..8e4b7e8 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 _0xae02=['params','model','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','merge','options','find','catch','body','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','destroy','then','error','stack','name','send','show'];(function(_0x48677d,_0x5d5fa1){var _0x27d5c6=function(_0x4dac92){while(--_0x4dac92){_0x48677d['push'](_0x48677d['shift']());}};_0x27d5c6(++_0x5d5fa1);}(_0xae02,0xa7));var _0x2ae0=function(_0x3833ce,_0xfec06c){_0x3833ce=_0x3833ce-0x0;var _0x659602=_0xae02[_0x3833ce];return _0x659602;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2ae0('0x0'));var rimraf=require(_0x2ae0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ae0('0x2'));var Mustache=require(_0x2ae0('0x3'));var util=require(_0x2ae0('0x4'));var path=require('path');var sox=require(_0x2ae0('0x5'));var csv=require(_0x2ae0('0x6'));var ejs=require(_0x2ae0('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2ae0('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ae0('0x6'));var querystring=require(_0x2ae0('0x9'));var Papa=require(_0x2ae0('0xa'));var Redis=require(_0x2ae0('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x2ae0('0xc'));var as=require(_0x2ae0('0xd'));var hardwareService=require(_0x2ae0('0xe'));var logger=require(_0x2ae0('0xf'))(_0x2ae0('0x10'));var utils=require('../../config/utils');var config=require(_0x2ae0('0x11'));var licenseUtil=require(_0x2ae0('0x12'));var db=require(_0x2ae0('0x13'))['db'];function respondWithStatusCode(_0xb199fa,_0x427a54){_0x427a54=_0x427a54||0xcc;return function(_0x49ab41){if(_0x49ab41){return _0xb199fa[_0x2ae0('0x14')](_0x427a54);}return _0xb199fa[_0x2ae0('0x15')](_0x427a54)[_0x2ae0('0x16')]();};}function respondWithResult(_0x365370,_0x30c5e2){_0x30c5e2=_0x30c5e2||0xc8;return function(_0xdcb2bc){if(_0xdcb2bc){return _0x365370[_0x2ae0('0x15')](_0x30c5e2)[_0x2ae0('0x17')](_0xdcb2bc);}};}function respondWithFilteredResult(_0x182bf3,_0x1ea033){return function(_0x235e3a){if(_0x235e3a){var _0x31e3ed=_0x235e3a[_0x2ae0('0x18')],_0x4803c8=_0x1ea033[_0x2ae0('0x19')],_0x1fc5f4=_0x1ea033[_0x2ae0('0x19')]+_0x1ea033[_0x2ae0('0x1a')],_0x297689;if(_0x1fc5f4>=_0x31e3ed){_0x1fc5f4=_0x31e3ed;_0x297689=0xc8;}else{_0x297689=0xce;}_0x182bf3[_0x2ae0('0x15')](_0x297689);return _0x182bf3[_0x2ae0('0x1b')]('Content-Range',_0x4803c8+'-'+_0x1fc5f4+'/'+_0x31e3ed)['json'](_0x235e3a);}return null;};}function patchUpdates(_0x3e9edd){return function(_0x3e8319){try{jsonpatch['apply'](_0x3e8319,_0x3e9edd,!![]);}catch(_0x37216d){return BPromise[_0x2ae0('0x1c')](_0x37216d);}return _0x3e8319[_0x2ae0('0x1d')]();};}function saveUpdates(_0x1bf027,_0x5d6b57){return function(_0x1fd01b){if(_0x1fd01b){return _0x1fd01b['update'](_0x1bf027)['then'](function(_0x338958){return _0x338958;});}return null;};}function removeEntity(_0x212e5f,_0x10a0b1){return function(_0x444ac8){if(_0x444ac8){return _0x444ac8[_0x2ae0('0x1e')]()[_0x2ae0('0x1f')](function(){_0x212e5f[_0x2ae0('0x15')](0xcc)[_0x2ae0('0x16')]();});}};}function handleEntityNotFound(_0x50a0ab,_0x49fded){return function(_0x892f55){if(!_0x892f55){_0x50a0ab[_0x2ae0('0x14')](0x194);}return _0x892f55;};}function handleError(_0x207dee,_0x237fce){_0x237fce=_0x237fce||0x1f4;return function(_0x548632){logger[_0x2ae0('0x20')](_0x548632[_0x2ae0('0x21')]);if(_0x548632[_0x2ae0('0x22')]){delete _0x548632['name'];}_0x207dee[_0x2ae0('0x15')](_0x237fce)[_0x2ae0('0x23')](_0x548632);};}exports[_0x2ae0('0x24')]=function(_0x541d5e,_0x4c7dba){var _0x3d1dde={'raw':!![],'where':{'id':_0x541d5e[_0x2ae0('0x25')]['id']}},_0x56316e={};_0x56316e[_0x2ae0('0x26')]=_['keys'](db[_0x2ae0('0x27')][_0x2ae0('0x28')]);_0x56316e['query']=_['keys'](_0x541d5e[_0x2ae0('0x29')]);_0x56316e['filters']=_[_0x2ae0('0x2a')](_0x56316e[_0x2ae0('0x26')],_0x56316e[_0x2ae0('0x29')]);_0x3d1dde['attributes']=_['intersection'](_0x56316e[_0x2ae0('0x26')],qs[_0x2ae0('0x2b')](_0x541d5e[_0x2ae0('0x29')]['fields']));_0x3d1dde[_0x2ae0('0x2c')]=_0x3d1dde[_0x2ae0('0x2c')][_0x2ae0('0x2d')]?_0x3d1dde[_0x2ae0('0x2c')]:_0x56316e[_0x2ae0('0x26')];if(_0x541d5e[_0x2ae0('0x29')]['includeAll']){_0x3d1dde['include']=[{'all':!![]}];}_0x3d1dde=_[_0x2ae0('0x2e')]({},_0x3d1dde,_0x541d5e[_0x2ae0('0x2f')]);return db[_0x2ae0('0x27')][_0x2ae0('0x30')](_0x3d1dde)['then'](handleEntityNotFound(_0x4c7dba,null))['then'](respondWithResult(_0x4c7dba,null))[_0x2ae0('0x31')](handleError(_0x4c7dba,null));};exports['update']=function(_0x3e839c,_0x166f21){if(_0x3e839c[_0x2ae0('0x32')]['id']){delete _0x3e839c[_0x2ae0('0x32')]['id'];}return db[_0x2ae0('0x27')][_0x2ae0('0x30')]({'where':{'id':_0x3e839c['params']['id']}})[_0x2ae0('0x1f')](handleEntityNotFound(_0x166f21,null))[_0x2ae0('0x1f')](saveUpdates(_0x3e839c['body'],null))[_0x2ae0('0x1f')](respondWithResult(_0x166f21,null))[_0x2ae0('0x31')](handleError(_0x166f21,null));};exports[_0x2ae0('0x1e')]=function(_0x418ff2,_0x537f0c){return db[_0x2ae0('0x27')][_0x2ae0('0x30')]({'where':{'id':_0x418ff2[_0x2ae0('0x25')]['id']}})[_0x2ae0('0x1f')](handleEntityNotFound(_0x537f0c,null))[_0x2ae0('0x1f')](removeEntity(_0x537f0c,null))[_0x2ae0('0x31')](handleError(_0x537f0c,null));};
\ No newline at end of file
+var _0xa095=['includeAll','include','options','find','catch','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xa095,0x7c));var _0x5a09=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0xa095[_0x5db313];return _0x36d503;};'use strict';var pdf=require(_0x5a09('0x0'));var emlformat=require(_0x5a09('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5a09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a09('0x3'));var moment=require(_0x5a09('0x4'));var BPromise=require(_0x5a09('0x5'));var Mustache=require(_0x5a09('0x6'));var util=require('util');var path=require(_0x5a09('0x7'));var sox=require(_0x5a09('0x8'));var csv=require(_0x5a09('0x9'));var ejs=require(_0x5a09('0xa'));var fs=require('fs');var _=require(_0x5a09('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a09('0xc'));var toCsv=require(_0x5a09('0x9'));var querystring=require(_0x5a09('0xd'));var Papa=require(_0x5a09('0xe'));var Redis=require(_0x5a09('0xf'));var authService=require(_0x5a09('0x10'));var qs=require(_0x5a09('0x11'));var as=require(_0x5a09('0x12'));var hardwareService=require(_0x5a09('0x13'));var logger=require(_0x5a09('0x14'))(_0x5a09('0x15'));var utils=require(_0x5a09('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5a09('0x17'));var db=require(_0x5a09('0x18'))['db'];function respondWithStatusCode(_0xec677d,_0x49045e){_0x49045e=_0x49045e||0xcc;return function(_0x4706c4){if(_0x4706c4){return _0xec677d['sendStatus'](_0x49045e);}return _0xec677d[_0x5a09('0x19')](_0x49045e)[_0x5a09('0x1a')]();};}function respondWithResult(_0x2f22df,_0x2bf0a5){_0x2bf0a5=_0x2bf0a5||0xc8;return function(_0x36045d){if(_0x36045d){return _0x2f22df['status'](_0x2bf0a5)[_0x5a09('0x1b')](_0x36045d);}};}function respondWithFilteredResult(_0x23d47c,_0x10e59d){return function(_0x1cb5c0){if(_0x1cb5c0){var _0x460d30=_0x1cb5c0[_0x5a09('0x1c')],_0x245af7=_0x10e59d['offset'],_0x2398c5=_0x10e59d[_0x5a09('0x1d')]+_0x10e59d['limit'],_0x477977;if(_0x2398c5>=_0x460d30){_0x2398c5=_0x460d30;_0x477977=0xc8;}else{_0x477977=0xce;}_0x23d47c[_0x5a09('0x19')](_0x477977);return _0x23d47c[_0x5a09('0x1e')](_0x5a09('0x1f'),_0x245af7+'-'+_0x2398c5+'/'+_0x460d30)[_0x5a09('0x1b')](_0x1cb5c0);}return null;};}function patchUpdates(_0x6ebf91){return function(_0x224618){try{jsonpatch[_0x5a09('0x20')](_0x224618,_0x6ebf91,!![]);}catch(_0xaf3bbe){return BPromise[_0x5a09('0x21')](_0xaf3bbe);}return _0x224618['save']();};}function saveUpdates(_0x4d9189,_0x5eb523){return function(_0x4d0767){if(_0x4d0767){return _0x4d0767[_0x5a09('0x22')](_0x4d9189)['then'](function(_0x58bd32){return _0x58bd32;});}return null;};}function removeEntity(_0x24f5ba,_0x4f6842){return function(_0x4784b1){if(_0x4784b1){return _0x4784b1[_0x5a09('0x23')]()[_0x5a09('0x24')](function(){_0x24f5ba[_0x5a09('0x19')](0xcc)[_0x5a09('0x1a')]();});}};}function handleEntityNotFound(_0x116ef0,_0x17e3f7){return function(_0x195435){if(!_0x195435){_0x116ef0[_0x5a09('0x25')](0x194);}return _0x195435;};}function handleError(_0x35c242,_0x437d9d){_0x437d9d=_0x437d9d||0x1f4;return function(_0x542d97){logger[_0x5a09('0x26')](_0x542d97[_0x5a09('0x27')]);if(_0x542d97[_0x5a09('0x28')]){delete _0x542d97['name'];}_0x35c242[_0x5a09('0x19')](_0x437d9d)['send'](_0x542d97);};}exports[_0x5a09('0x29')]=function(_0x2cc527,_0x3deeb2){var _0x1269f1={'raw':!![],'where':{'id':_0x2cc527[_0x5a09('0x2a')]['id']}},_0x946242={};_0x946242[_0x5a09('0x2b')]=_[_0x5a09('0x2c')](db[_0x5a09('0x2d')][_0x5a09('0x2e')]);_0x946242['query']=_[_0x5a09('0x2c')](_0x2cc527[_0x5a09('0x2f')]);_0x946242[_0x5a09('0x30')]=_[_0x5a09('0x31')](_0x946242[_0x5a09('0x2b')],_0x946242['query']);_0x1269f1[_0x5a09('0x32')]=_[_0x5a09('0x31')](_0x946242[_0x5a09('0x2b')],qs[_0x5a09('0x33')](_0x2cc527[_0x5a09('0x2f')]['fields']));_0x1269f1[_0x5a09('0x32')]=_0x1269f1[_0x5a09('0x32')][_0x5a09('0x34')]?_0x1269f1[_0x5a09('0x32')]:_0x946242[_0x5a09('0x2b')];if(_0x2cc527[_0x5a09('0x2f')][_0x5a09('0x35')]){_0x1269f1[_0x5a09('0x36')]=[{'all':!![]}];}_0x1269f1=_['merge']({},_0x1269f1,_0x2cc527[_0x5a09('0x37')]);return db['ChatApplication'][_0x5a09('0x38')](_0x1269f1)['then'](handleEntityNotFound(_0x3deeb2,null))[_0x5a09('0x24')](respondWithResult(_0x3deeb2,null))[_0x5a09('0x39')](handleError(_0x3deeb2,null));};exports['update']=function(_0x386da8,_0x38a5db){if(_0x386da8['body']['id']){delete _0x386da8['body']['id'];}return db['ChatApplication'][_0x5a09('0x38')]({'where':{'id':_0x386da8[_0x5a09('0x2a')]['id']}})[_0x5a09('0x24')](handleEntityNotFound(_0x38a5db,null))[_0x5a09('0x24')](saveUpdates(_0x386da8[_0x5a09('0x3a')],null))[_0x5a09('0x24')](respondWithResult(_0x38a5db,null))['catch'](handleError(_0x38a5db,null));};exports[_0x5a09('0x23')]=function(_0x462b07,_0x437200){return db['ChatApplication'][_0x5a09('0x38')]({'where':{'id':_0x462b07[_0x5a09('0x2a')]['id']}})['then'](handleEntityNotFound(_0x437200,null))[_0x5a09('0x24')](removeEntity(_0x437200,null))['catch'](handleError(_0x437200,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d3fca52..d24963b 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 0980aef..edb35e2 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 _0xfcfb=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring'];(function(_0x5647c8,_0x590008){var _0x1e464f=function(_0x2224a4){while(--_0x2224a4){_0x5647c8['push'](_0x5647c8['shift']());}};_0x1e464f(++_0x590008);}(_0xfcfb,0x9d));var _0xbfcf=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0xfcfb[_0x4ce15c];return _0x5ee259;};'use strict';var _=require(_0xbfcf('0x0'));var util=require('util');var moment=require(_0xbfcf('0x1'));var BPromise=require(_0xbfcf('0x2'));var rs=require(_0xbfcf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfcf('0x4'))['db'];var utils=require(_0xbfcf('0x5'));var logger=require(_0xbfcf('0x6'))('rpc');var config=require(_0xbfcf('0x7'));var jayson=require(_0xbfcf('0x8'));var client=jayson[_0xbfcf('0x9')][_0xbfcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39011a,_0x531aa6,_0x4681c2){return new BPromise(function(_0x18bd30,_0x5da9fa){return client[_0xbfcf('0xb')](_0x39011a,_0x4681c2)[_0xbfcf('0xc')](function(_0x1ca392){logger[_0xbfcf('0xd')]('ChatApplication,\x20%s,\x20%s',_0x531aa6,_0xbfcf('0xe'));logger[_0xbfcf('0xf')](_0xbfcf('0x10'),_0x531aa6,_0xbfcf('0xe'),JSON[_0xbfcf('0x11')](_0x1ca392));if(_0x1ca392[_0xbfcf('0x12')]){if(_0x1ca392[_0xbfcf('0x12')][_0xbfcf('0x13')]===0x1f4){logger[_0xbfcf('0x12')](_0xbfcf('0x14'),_0x531aa6,_0x1ca392[_0xbfcf('0x12')][_0xbfcf('0x15')]);return _0x5da9fa(_0x1ca392[_0xbfcf('0x12')][_0xbfcf('0x15')]);}logger[_0xbfcf('0x12')]('ChatApplication,\x20%s,\x20%s',_0x531aa6,_0x1ca392[_0xbfcf('0x12')][_0xbfcf('0x15')]);return _0x18bd30(_0x1ca392[_0xbfcf('0x12')][_0xbfcf('0x15')]);}else{logger[_0xbfcf('0xd')](_0xbfcf('0x14'),_0x531aa6,_0xbfcf('0xe'));_0x18bd30(_0x1ca392[_0xbfcf('0x16')][_0xbfcf('0x15')]);}})['catch'](function(_0x2a6a4e){logger[_0xbfcf('0x12')](_0xbfcf('0x14'),_0x531aa6,_0x2a6a4e);_0x5da9fa(_0x2a6a4e);});});}
\ No newline at end of file
+var _0x295a=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x295a,0x10e));var _0xa295=function(_0x518cde,_0x3b8f9){_0x518cde=_0x518cde-0x0;var _0x2abde1=_0x295a[_0x518cde];return _0x2abde1;};'use strict';var _=require(_0xa295('0x0'));var util=require(_0xa295('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa295('0x2'));var fs=require('fs');var Redis=require(_0xa295('0x3'));var db=require(_0xa295('0x4'))['db'];var utils=require(_0xa295('0x5'));var logger=require(_0xa295('0x6'))('rpc');var config=require(_0xa295('0x7'));var jayson=require(_0xa295('0x8'));var client=jayson[_0xa295('0x9')][_0xa295('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25ff74,_0x44206d,_0x459c92){return new BPromise(function(_0x28d67c,_0x357206){return client[_0xa295('0xb')](_0x25ff74,_0x459c92)[_0xa295('0xc')](function(_0x3d3270){logger[_0xa295('0xd')](_0xa295('0xe'),_0x44206d,'request\x20sent');logger[_0xa295('0xf')](_0xa295('0x10'),_0x44206d,_0xa295('0x11'),JSON[_0xa295('0x12')](_0x3d3270));if(_0x3d3270[_0xa295('0x13')]){if(_0x3d3270['error']['code']===0x1f4){logger[_0xa295('0x13')](_0xa295('0xe'),_0x44206d,_0x3d3270[_0xa295('0x13')][_0xa295('0x14')]);return _0x357206(_0x3d3270[_0xa295('0x13')][_0xa295('0x14')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x44206d,_0x3d3270[_0xa295('0x13')][_0xa295('0x14')]);return _0x28d67c(_0x3d3270[_0xa295('0x13')]['message']);}else{logger[_0xa295('0xd')](_0xa295('0xe'),_0x44206d,_0xa295('0x11'));_0x28d67c(_0x3d3270[_0xa295('0x15')][_0xa295('0x14')]);}})[_0xa295('0x16')](function(_0x1d33fa){logger[_0xa295('0x13')](_0xa295('0xe'),_0x44206d,_0x1d33fa);_0x357206(_0x1d33fa);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 20a0571..7a64606 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 _0x60ab=['isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x4690e0,_0x5303be){var _0x571881=function(_0x382776){while(--_0x382776){_0x4690e0['push'](_0x4690e0['shift']());}};_0x571881(++_0x5303be);}(_0x60ab,0x141));var _0xb60a=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x60ab[_0x602ca8];return _0x26e8ab;};'use strict';var multer=require(_0xb60a('0x0'));var util=require(_0xb60a('0x1'));var path=require(_0xb60a('0x2'));var timeout=require(_0xb60a('0x3'));var express=require(_0xb60a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb60a('0x5'));var config=require(_0xb60a('0x6'));var controller=require('./chatApplication.controller');router[_0xb60a('0x7')](_0xb60a('0x8'),auth[_0xb60a('0x9')](),controller[_0xb60a('0xa')]);router[_0xb60a('0xb')](_0xb60a('0x8'),auth[_0xb60a('0x9')](),controller[_0xb60a('0xc')]);router[_0xb60a('0xd')](_0xb60a('0x8'),auth[_0xb60a('0x9')](),controller[_0xb60a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x01b1=['put','/:id','isAuthenticated','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get'];(function(_0x3595ca,_0x14fcf0){var _0x51390a=function(_0x14b9a7){while(--_0x14b9a7){_0x3595ca['push'](_0x3595ca['shift']());}};_0x51390a(++_0x14fcf0);}(_0x01b1,0x1ef));var _0x101b=function(_0x57ddbd,_0x1d83de){_0x57ddbd=_0x57ddbd-0x0;var _0x10da80=_0x01b1[_0x57ddbd];return _0x10da80;};'use strict';var multer=require('multer');var util=require(_0x101b('0x0'));var path=require(_0x101b('0x1'));var timeout=require(_0x101b('0x2'));var express=require(_0x101b('0x3'));var router=express[_0x101b('0x4')]();var auth=require(_0x101b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x101b('0x6'));var controller=require(_0x101b('0x7'));router[_0x101b('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x101b('0x9')](_0x101b('0xa'),auth[_0x101b('0xb')](),controller[_0x101b('0xc')]);router['delete']('/:id',auth[_0x101b('0xb')](),controller[_0x101b('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 3874eca..5b2fffe 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 _0x2fab=['exports','STRING','BOOLEAN'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x2fab,0x9c));var _0xb2fa=function(_0xd458a6,_0x1fdf04){_0xd458a6=_0xd458a6-0x0;var _0x28e696=_0x2fab[_0xd458a6];return _0x28e696;};'use strict';var Sequelize=require('sequelize');module[_0xb2fa('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb2fa('0x1')]},'write':{'type':Sequelize[_0xb2fa('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xaf1c=['BOOLEAN','sequelize','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xaf1c,0x7f));var _0xcaf1=function(_0x548e3c,_0x2fb9d1){_0x548e3c=_0x548e3c-0x0;var _0x512542=_0xaf1c[_0x548e3c];return _0x512542;};'use strict';var Sequelize=require(_0xcaf1('0x0'));module['exports']={'name':{'type':Sequelize[_0xcaf1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcaf1('0x1')]},'write':{'type':Sequelize[_0xcaf1('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 5331414..1bb67b5 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 _0xdab3=['describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','pick','nolimit','find','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','client','http','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','show','params','keys','catch','create','body'];(function(_0x122fb3,_0x4bea2d){var _0x29c5f7=function(_0x42d8e1){while(--_0x42d8e1){_0x122fb3['push'](_0x122fb3['shift']());}};_0x29c5f7(++_0x4bea2d);}(_0xdab3,0xeb));var _0x3dab=function(_0x44a3d6,_0x1d93f9){_0x44a3d6=_0x44a3d6-0x0;var _0x24234b=_0xdab3[_0x44a3d6];return _0x24234b;};'use strict';var pdf=require(_0x3dab('0x0'));var emlformat=require(_0x3dab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3dab('0x2'));var jsonpatch=require(_0x3dab('0x3'));var rp=require(_0x3dab('0x4'));var moment=require(_0x3dab('0x5'));var BPromise=require(_0x3dab('0x6'));var Mustache=require(_0x3dab('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3dab('0x8'));var csv=require(_0x3dab('0x9'));var ejs=require(_0x3dab('0xa'));var fs=require('fs');var _=require(_0x3dab('0xb'));var squel=require(_0x3dab('0xc'));var crypto=require(_0x3dab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3dab('0xe'));var toCsv=require(_0x3dab('0x9'));var querystring=require(_0x3dab('0xf'));var Papa=require(_0x3dab('0x10'));var Redis=require(_0x3dab('0x11'));var authService=require(_0x3dab('0x12'));var qs=require(_0x3dab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dab('0x14'));var logger=require(_0x3dab('0x15'))(_0x3dab('0x16'));var utils=require(_0x3dab('0x17'));var config=require(_0x3dab('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3dab('0x19')]=_[_0x3dab('0x1a')](config[_0x3dab('0x19')],{'host':_0x3dab('0x1b'),'port':0x18eb});var socket=require(_0x3dab('0x1c'))(new Redis(config[_0x3dab('0x19')]));require(_0x3dab('0x1d'))[_0x3dab('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3dab('0x1f')][_0x3dab('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5b0784,_0x1bd550,_0x60120a,_0x55cb0a){return new BPromise(function(_0x4bd3f1,_0xbeeee2){var _0x2e9933=_0x55cb0a||client;return _0x2e9933[_0x3dab('0x21')](_0x5b0784,_0x60120a)[_0x3dab('0x22')](function(_0xd70f9a){logger['info'](_0x3dab('0x23'),_0x1bd550,_0x3dab('0x24'));logger['debug'](_0x3dab('0x25'),_0x1bd550,_0x3dab('0x24'),JSON[_0x3dab('0x26')](_0xd70f9a));if(_0xd70f9a[_0x3dab('0x27')]){if(_0xd70f9a['error'][_0x3dab('0x28')]===0x1f4){logger[_0x3dab('0x27')](_0x3dab('0x23'),_0x1bd550,_0xd70f9a[_0x3dab('0x27')][_0x3dab('0x29')]);return _0xbeeee2(_0xd70f9a[_0x3dab('0x27')][_0x3dab('0x29')]);}logger[_0x3dab('0x27')](_0x3dab('0x23'),_0x1bd550,_0xd70f9a['error'][_0x3dab('0x29')]);return _0x4bd3f1(_0xd70f9a['error'][_0x3dab('0x29')]);}else{logger[_0x3dab('0x2a')](_0x3dab('0x23'),_0x1bd550,_0x3dab('0x24'));_0x4bd3f1(_0xd70f9a[_0x3dab('0x2b')][_0x3dab('0x29')]);}})['catch'](function(_0x50bd53){logger[_0x3dab('0x27')](_0x3dab('0x23'),_0x1bd550,_0x50bd53);_0xbeeee2(_0x50bd53);});});}function respondWithStatusCode(_0x4f96aa,_0x21880a){_0x21880a=_0x21880a||0xcc;return function(_0x2f78d7){if(_0x2f78d7){return _0x4f96aa[_0x3dab('0x2c')](_0x21880a);}return _0x4f96aa[_0x3dab('0x2d')](_0x21880a)['end']();};}function respondWithResult(_0x2215d7,_0x4999c4){_0x4999c4=_0x4999c4||0xc8;return function(_0x803cc1){if(_0x803cc1){return _0x2215d7[_0x3dab('0x2d')](_0x4999c4)[_0x3dab('0x2e')](_0x803cc1);}};}function respondWithFilteredResult(_0x464d84,_0x4f81dc){return function(_0x4e562c){if(_0x4e562c){var _0x36f834=_0x4e562c['count'],_0x5bfe9e=_0x4f81dc[_0x3dab('0x2f')],_0x483bce=_0x4f81dc[_0x3dab('0x2f')]+_0x4f81dc[_0x3dab('0x30')],_0x5b6026;if(_0x483bce>=_0x36f834){_0x483bce=_0x36f834;_0x5b6026=0xc8;}else{_0x5b6026=0xce;}_0x464d84[_0x3dab('0x2d')](_0x5b6026);return _0x464d84[_0x3dab('0x31')](_0x3dab('0x32'),_0x5bfe9e+'-'+_0x483bce+'/'+_0x36f834)[_0x3dab('0x2e')](_0x4e562c);}return null;};}function patchUpdates(_0x9d2420){return function(_0x2e67cb){try{jsonpatch[_0x3dab('0x33')](_0x2e67cb,_0x9d2420,!![]);}catch(_0x122437){return BPromise[_0x3dab('0x34')](_0x122437);}return _0x2e67cb[_0x3dab('0x35')]();};}function saveUpdates(_0x477f9f,_0x10f2a0){return function(_0x1226ef){if(_0x1226ef){return _0x1226ef[_0x3dab('0x36')](_0x477f9f)[_0x3dab('0x22')](function(_0x341c2d){return _0x341c2d;});}return null;};}function removeEntity(_0x383ef8,_0x5470ec){return function(_0x599b21){if(_0x599b21){return _0x599b21[_0x3dab('0x37')]()['then'](function(){_0x383ef8[_0x3dab('0x2d')](0xcc)[_0x3dab('0x38')]();});}};}function handleEntityNotFound(_0x492556,_0x325d42){return function(_0x1ea6f1){if(!_0x1ea6f1){_0x492556[_0x3dab('0x2c')](0x194);}return _0x1ea6f1;};}function handleError(_0x45e10d,_0x5430e3){_0x5430e3=_0x5430e3||0x1f4;return function(_0x5ce8e5){logger[_0x3dab('0x27')](_0x5ce8e5['stack']);if(_0x5ce8e5[_0x3dab('0x39')]){delete _0x5ce8e5[_0x3dab('0x39')];}_0x45e10d[_0x3dab('0x2d')](_0x5430e3)['send'](_0x5ce8e5);};}exports['index']=function(_0x372348,_0x20ab66){var _0xac866b={},_0x5b8956={},_0x239212={'count':0x0,'rows':[]};var _0x125d19=_[_0x3dab('0x3a')](db[_0x3dab('0x3b')][_0x3dab('0x3c')],function(_0x5ce6dd){return{'name':_0x5ce6dd[_0x3dab('0x3d')],'type':_0x5ce6dd[_0x3dab('0x3e')][_0x3dab('0x3f')]};});_0x5b8956[_0x3dab('0x40')]=_[_0x3dab('0x3a')](_0x125d19,_0x3dab('0x39'));_0x5b8956[_0x3dab('0x41')]=_['keys'](_0x372348[_0x3dab('0x41')]);_0x5b8956[_0x3dab('0x42')]=_[_0x3dab('0x43')](_0x5b8956['model'],_0x5b8956['query']);_0xac866b[_0x3dab('0x44')]=_[_0x3dab('0x43')](_0x5b8956[_0x3dab('0x40')],qs[_0x3dab('0x45')](_0x372348['query'][_0x3dab('0x45')]));_0xac866b[_0x3dab('0x44')]=_0xac866b[_0x3dab('0x44')][_0x3dab('0x46')]?_0xac866b[_0x3dab('0x44')]:_0x5b8956[_0x3dab('0x40')];if(!_0x372348['query'][_0x3dab('0x47')]('nolimit')){_0xac866b['limit']=qs[_0x3dab('0x30')](_0x372348['query'][_0x3dab('0x30')]);_0xac866b[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0x372348['query'][_0x3dab('0x2f')]);}_0xac866b[_0x3dab('0x48')]=qs[_0x3dab('0x49')](_0x372348[_0x3dab('0x41')][_0x3dab('0x49')]);_0xac866b[_0x3dab('0x4a')]=qs[_0x3dab('0x42')](_['pick'](_0x372348[_0x3dab('0x41')],_0x5b8956['filters']),_0x125d19);if(_0x372348[_0x3dab('0x41')][_0x3dab('0x4b')]){_0xac866b[_0x3dab('0x4a')]=_['merge'](_0xac866b[_0x3dab('0x4a')],{'$or':_[_0x3dab('0x3a')](_0x125d19,function(_0x56422c){if(_0x56422c['type']!==_0x3dab('0x4c')){var _0xf42017={};_0xf42017[_0x56422c[_0x3dab('0x39')]]={'$like':'%'+_0x372348[_0x3dab('0x41')][_0x3dab('0x4b')]+'%'};return _0xf42017;}})});}_0xac866b=_[_0x3dab('0x4d')]({},_0xac866b,_0x372348[_0x3dab('0x4e')]);var _0x24cc78={'where':_0xac866b[_0x3dab('0x4a')]};return db['ChatGroup']['count'](_0x24cc78)['then'](function(_0x14960d){_0x239212[_0x3dab('0x4f')]=_0x14960d;if(_0x372348['query'][_0x3dab('0x50')]){_0xac866b[_0x3dab('0x51')]=[{'all':!![]}];}return db[_0x3dab('0x3b')][_0x3dab('0x52')](_0xac866b);})[_0x3dab('0x22')](function(_0x3fe80f){_0x239212['rows']=_0x3fe80f;return _0x239212;})[_0x3dab('0x22')](respondWithFilteredResult(_0x20ab66,_0xac866b))['catch'](handleError(_0x20ab66,null));};exports[_0x3dab('0x53')]=function(_0x396e5e,_0x2341cd){var _0x3d6844={'raw':!![],'where':{'id':_0x396e5e[_0x3dab('0x54')]['id']}},_0x5afba8={};_0x5afba8[_0x3dab('0x40')]=_[_0x3dab('0x55')](db[_0x3dab('0x3b')]['rawAttributes']);_0x5afba8[_0x3dab('0x41')]=_[_0x3dab('0x55')](_0x396e5e[_0x3dab('0x41')]);_0x5afba8[_0x3dab('0x42')]=_[_0x3dab('0x43')](_0x5afba8['model'],_0x5afba8[_0x3dab('0x41')]);_0x3d6844['attributes']=_[_0x3dab('0x43')](_0x5afba8[_0x3dab('0x40')],qs[_0x3dab('0x45')](_0x396e5e['query']['fields']));_0x3d6844[_0x3dab('0x44')]=_0x3d6844[_0x3dab('0x44')][_0x3dab('0x46')]?_0x3d6844[_0x3dab('0x44')]:_0x5afba8['model'];if(_0x396e5e[_0x3dab('0x41')][_0x3dab('0x50')]){_0x3d6844[_0x3dab('0x51')]=[{'all':!![]}];}_0x3d6844=_[_0x3dab('0x4d')]({},_0x3d6844,_0x396e5e['options']);return db['ChatGroup']['find'](_0x3d6844)[_0x3dab('0x22')](handleEntityNotFound(_0x2341cd,null))[_0x3dab('0x22')](respondWithResult(_0x2341cd,null))[_0x3dab('0x56')](handleError(_0x2341cd,null));};exports[_0x3dab('0x57')]=function(_0x38fbbe,_0x4d9c9a){return db[_0x3dab('0x3b')][_0x3dab('0x57')](_0x38fbbe[_0x3dab('0x58')],{})[_0x3dab('0x22')](respondWithResult(_0x4d9c9a,0xc9))[_0x3dab('0x56')](handleError(_0x4d9c9a,null));};exports['update']=function(_0x565443,_0x593ab9){if(_0x565443[_0x3dab('0x58')]['id']){delete _0x565443[_0x3dab('0x58')]['id'];}return db[_0x3dab('0x3b')]['find']({'where':{'id':_0x565443[_0x3dab('0x54')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x593ab9,null))[_0x3dab('0x22')](saveUpdates(_0x565443[_0x3dab('0x58')],null))[_0x3dab('0x22')](respondWithResult(_0x593ab9,null))['catch'](handleError(_0x593ab9,null));};exports[_0x3dab('0x37')]=function(_0x47d734,_0x5aa4b7){return db[_0x3dab('0x3b')]['find']({'where':{'id':_0x47d734[_0x3dab('0x54')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x5aa4b7,null))[_0x3dab('0x22')](removeEntity(_0x5aa4b7,null))[_0x3dab('0x56')](handleError(_0x5aa4b7,null));};exports[_0x3dab('0x59')]=function(_0x1d776f,_0x39fe65){return db[_0x3dab('0x3b')]['describe']()[_0x3dab('0x22')](respondWithResult(_0x39fe65,null))[_0x3dab('0x56')](handleError(_0x39fe65,null));};exports[_0x3dab('0x5a')]=function(_0x398dd5,_0x2d8760,_0x155af1){return db[_0x3dab('0x5b')][_0x3dab('0x4f')]({'where':{'ChatGroupId':_0x398dd5[_0x3dab('0x54')]['id'],'ToId':_0x398dd5[_0x3dab('0x5c')]['id'],'read':![]}})[_0x3dab('0x22')](function(_0xb541d4){return{'id':_[_0x3dab('0x5d')](_0x398dd5[_0x3dab('0x54')]['id']),'count':_0xb541d4};})[_0x3dab('0x22')](respondWithResult(_0x2d8760,null))[_0x3dab('0x56')](handleError(_0x2d8760,null));};exports[_0x3dab('0x5e')]=function(_0x5df44b,_0x162bad,_0x402ef0){return db[_0x3dab('0x3b')]['find']({'where':{'id':_0x5df44b['params']['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x162bad,null))[_0x3dab('0x22')](function(_0x16ec26){if(_0x16ec26){return _0x16ec26[_0x3dab('0x5e')](_0x5df44b[_0x3dab('0x58')][_0x3dab('0x5f')],_[_0x3dab('0x60')](_0x5df44b[_0x3dab('0x58')],[_0x3dab('0x5f'),'id'])||{});}})[_0x3dab('0x22')](respondWithResult(_0x162bad,null))[_0x3dab('0x56')](handleError(_0x162bad,null));};exports[_0x3dab('0x61')]=function(_0x1b02e5,_0x4701aa,_0x234b84){var _0x42d400={};var _0x3d5fa7={};var _0x4a97c7;var _0x4983c9;return db[_0x3dab('0x3b')]['findOne']({'where':{'id':_0x1b02e5[_0x3dab('0x54')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x4701aa,null))['then'](function(_0xd8fddd){if(_0xd8fddd){_0x4a97c7=_0xd8fddd;_0x3d5fa7[_0x3dab('0x40')]=_[_0x3dab('0x55')](db['User'][_0x3dab('0x3c')]);_0x3d5fa7[_0x3dab('0x41')]=_['keys'](_0x1b02e5[_0x3dab('0x41')]);_0x3d5fa7[_0x3dab('0x42')]=_['intersection'](_0x3d5fa7[_0x3dab('0x40')],_0x3d5fa7[_0x3dab('0x41')]);_0x42d400[_0x3dab('0x44')]=_['intersection'](_0x3d5fa7['model'],qs[_0x3dab('0x45')](_0x1b02e5[_0x3dab('0x41')][_0x3dab('0x45')]));_0x42d400[_0x3dab('0x44')]=_0x42d400[_0x3dab('0x44')][_0x3dab('0x46')]?_0x42d400[_0x3dab('0x44')]:_0x3d5fa7[_0x3dab('0x40')];_0x42d400['order']=qs['sort'](_0x1b02e5['query'][_0x3dab('0x49')]);_0x42d400['where']=qs['filters'](_[_0x3dab('0x62')](_0x1b02e5[_0x3dab('0x41')],_0x3d5fa7[_0x3dab('0x42')]));if(_0x1b02e5[_0x3dab('0x41')][_0x3dab('0x4b')]){_0x42d400[_0x3dab('0x4a')]=_[_0x3dab('0x4d')](_0x42d400[_0x3dab('0x4a')],{'$or':_[_0x3dab('0x3a')](_0x42d400['attributes'],function(_0x4a16b4){var _0x41c705={};_0x41c705[_0x4a16b4]={'$like':'%'+_0x1b02e5[_0x3dab('0x41')][_0x3dab('0x4b')]+'%'};return _0x41c705;})});}_0x42d400=_[_0x3dab('0x4d')]({},_0x42d400,_0x1b02e5[_0x3dab('0x4e')]);return _0x4a97c7[_0x3dab('0x61')](_0x42d400);}})[_0x3dab('0x22')](function(_0xb21c3b){if(_0xb21c3b){_0x4983c9=_0xb21c3b[_0x3dab('0x46')];if(!_0x1b02e5[_0x3dab('0x41')][_0x3dab('0x47')](_0x3dab('0x63'))){_0x42d400[_0x3dab('0x30')]=qs['limit'](_0x1b02e5[_0x3dab('0x41')][_0x3dab('0x30')]);_0x42d400['offset']=qs[_0x3dab('0x2f')](_0x1b02e5[_0x3dab('0x41')]['offset']);}return _0x4a97c7['getMembers'](_0x42d400);}})[_0x3dab('0x22')](function(_0x5b9133){if(_0x5b9133){return _0x5b9133?{'count':_0x4983c9,'rows':_0x5b9133}:null;}})[_0x3dab('0x22')](respondWithResult(_0x4701aa,null))[_0x3dab('0x56')](handleError(_0x4701aa,null));};exports['removeMembers']=function(_0x1afd42,_0x2e5ec7,_0x574822){return db['ChatGroup'][_0x3dab('0x64')]({'where':{'id':_0x1afd42[_0x3dab('0x54')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x2e5ec7,null))[_0x3dab('0x22')](function(_0x59bd8a){if(_0x59bd8a){return _0x59bd8a[_0x3dab('0x65')](_0x1afd42[_0x3dab('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x2e5ec7,null))[_0x3dab('0x56')](handleError(_0x2e5ec7,null));};exports[_0x3dab('0x66')]=function(_0x40b5cc,_0x178160,_0x17086b){if(_0x40b5cc[_0x3dab('0x58')]['id']){delete _0x40b5cc[_0x3dab('0x58')]['id'];}return db[_0x3dab('0x3b')][_0x3dab('0x64')]({'where':{'id':_0x40b5cc[_0x3dab('0x54')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x178160,null))['then'](function(_0x46e0da){if(_0x46e0da){_0x40b5cc['body'][_0x3dab('0x67')]=_0x46e0da['id'];return db[_0x3dab('0x5b')][_0x3dab('0x57')](_0x40b5cc['body']);}})['then'](respondWithResult(_0x178160,null))[_0x3dab('0x56')](handleError(_0x178160,null));};exports[_0x3dab('0x68')]=function(_0xd2a7b5,_0x54229e,_0x45d770){var _0x3d133f={};var _0xfdbb58={};var _0x80e5a2;var _0x32a092;return db[_0x3dab('0x3b')][_0x3dab('0x69')]({'where':{'id':_0xd2a7b5[_0x3dab('0x54')]['id']}})['then'](handleEntityNotFound(_0x54229e,null))['then'](function(_0x3207f6){if(_0x3207f6){_0x80e5a2=_0x3207f6;_0xfdbb58['model']=_[_0x3dab('0x55')](db['ChatInternalMessage'][_0x3dab('0x3c')]);_0xfdbb58['query']=_[_0x3dab('0x55')](_0xd2a7b5[_0x3dab('0x41')]);_0xfdbb58[_0x3dab('0x42')]=_[_0x3dab('0x43')](_0xfdbb58[_0x3dab('0x40')],_0xfdbb58['query']);_0x3d133f[_0x3dab('0x44')]=_[_0x3dab('0x43')](_0xfdbb58['model'],qs['fields'](_0xd2a7b5[_0x3dab('0x41')]['fields']));_0x3d133f[_0x3dab('0x44')]=_0x3d133f[_0x3dab('0x44')][_0x3dab('0x46')]?_0x3d133f[_0x3dab('0x44')]:_0xfdbb58[_0x3dab('0x40')];_0x3d133f[_0x3dab('0x48')]=qs[_0x3dab('0x49')](_0xd2a7b5[_0x3dab('0x41')][_0x3dab('0x49')]);_0x3d133f['where']=qs['filters'](_[_0x3dab('0x62')](_0xd2a7b5[_0x3dab('0x41')],_0xfdbb58[_0x3dab('0x42')]));if(_0xd2a7b5[_0x3dab('0x41')][_0x3dab('0x4b')]){_0x3d133f['where']=_['merge'](_0x3d133f[_0x3dab('0x4a')],{'$or':_['map'](_0x3d133f[_0x3dab('0x44')],function(_0x53df3a){var _0x404294={};_0x404294[_0x53df3a]={'$like':'%'+_0xd2a7b5[_0x3dab('0x41')][_0x3dab('0x4b')]+'%'};return _0x404294;})});}if(_0xd2a7b5['query'][_0x3dab('0x6a')]){var _0x472ebe=_0xd2a7b5[_0x3dab('0x41')][_0x3dab('0x6a')]['split'](',');var _0x25241c={};_0x25241c[_0x472ebe[0x0]]={'$gte':moment(_0x472ebe[0x1])[_0x3dab('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3d133f[_0x3dab('0x4a')]=_[_0x3dab('0x4d')](_0x3d133f[_0x3dab('0x4a')],_0x25241c);}_0x3d133f=_[_0x3dab('0x4d')]({},_0x3d133f,_0xd2a7b5[_0x3dab('0x4e')]);return _0x80e5a2[_0x3dab('0x68')](_0x3d133f);}})['then'](function(_0x5ccef5){if(_0x5ccef5){_0x32a092=_0x5ccef5[_0x3dab('0x46')];if(!_0xd2a7b5[_0x3dab('0x41')][_0x3dab('0x47')](_0x3dab('0x63'))){_0x3d133f['limit']=qs[_0x3dab('0x30')](_0xd2a7b5[_0x3dab('0x41')][_0x3dab('0x30')]);_0x3d133f[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0xd2a7b5['query'][_0x3dab('0x2f')]);}return _0x80e5a2['getMessages'](_0x3d133f);}})[_0x3dab('0x22')](function(_0x57b677){if(_0x57b677){return _0x57b677?{'count':_0x32a092,'rows':_0x57b677}:null;}})[_0x3dab('0x22')](respondWithResult(_0x54229e,null))['catch'](handleError(_0x54229e,null));};
\ No newline at end of file
+var _0xc7da=['options','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','status','end','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','map','VIRTUAL','merge','ChatGroup','count','includeAll','include','findAll','show','params'];(function(_0x1f96d7,_0x20d141){var _0x728705=function(_0x55e0fd){while(--_0x55e0fd){_0x1f96d7['push'](_0x1f96d7['shift']());}};_0x728705(++_0x20d141);}(_0xc7da,0xf2));var _0xac7d=function(_0x4cce3d,_0x3e77b9){_0x4cce3d=_0x4cce3d-0x0;var _0x58ec78=_0xc7da[_0x4cce3d];return _0x58ec78;};'use strict';var pdf=require(_0xac7d('0x0'));var emlformat=require(_0xac7d('0x1'));var rimraf=require(_0xac7d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7d('0x3'));var rp=require(_0xac7d('0x4'));var moment=require('moment');var BPromise=require(_0xac7d('0x5'));var Mustache=require(_0xac7d('0x6'));var util=require('util');var path=require(_0xac7d('0x7'));var sox=require(_0xac7d('0x8'));var csv=require(_0xac7d('0x9'));var ejs=require(_0xac7d('0xa'));var fs=require('fs');var _=require(_0xac7d('0xb'));var squel=require(_0xac7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xac7d('0xd'));var deskjs=require(_0xac7d('0xe'));var toCsv=require(_0xac7d('0x9'));var querystring=require(_0xac7d('0xf'));var Papa=require(_0xac7d('0x10'));var Redis=require(_0xac7d('0x11'));var authService=require(_0xac7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac7d('0x13'));var hardwareService=require(_0xac7d('0x14'));var logger=require(_0xac7d('0x15'))('api');var utils=require(_0xac7d('0x16'));var config=require(_0xac7d('0x17'));var licenseUtil=require(_0xac7d('0x18'));var db=require(_0xac7d('0x19'))['db'];config['redis']=_[_0xac7d('0x1a')](config[_0xac7d('0x1b')],{'host':_0xac7d('0x1c'),'port':0x18eb});var socket=require(_0xac7d('0x1d'))(new Redis(config[_0xac7d('0x1b')]));require('./chatGroup.socket')[_0xac7d('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xac7d('0x1f')][_0xac7d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x34980f,_0x355209,_0x533bac,_0x19e7ba){return new BPromise(function(_0x4283dd,_0x27ed38){var _0x12813a=_0x19e7ba||client;return _0x12813a[_0xac7d('0x21')](_0x34980f,_0x533bac)['then'](function(_0x7df8e0){logger[_0xac7d('0x22')]('ChatGroup,\x20%s,\x20%s',_0x355209,_0xac7d('0x23'));logger[_0xac7d('0x24')](_0xac7d('0x25'),_0x355209,_0xac7d('0x23'),JSON['stringify'](_0x7df8e0));if(_0x7df8e0[_0xac7d('0x26')]){if(_0x7df8e0[_0xac7d('0x26')][_0xac7d('0x27')]===0x1f4){logger['error'](_0xac7d('0x28'),_0x355209,_0x7df8e0['error'][_0xac7d('0x29')]);return _0x27ed38(_0x7df8e0[_0xac7d('0x26')][_0xac7d('0x29')]);}logger[_0xac7d('0x26')](_0xac7d('0x28'),_0x355209,_0x7df8e0[_0xac7d('0x26')]['message']);return _0x4283dd(_0x7df8e0['error'][_0xac7d('0x29')]);}else{logger[_0xac7d('0x22')]('ChatGroup,\x20%s,\x20%s',_0x355209,_0xac7d('0x23'));_0x4283dd(_0x7df8e0[_0xac7d('0x2a')][_0xac7d('0x29')]);}})[_0xac7d('0x2b')](function(_0x43aa8e){logger[_0xac7d('0x26')](_0xac7d('0x28'),_0x355209,_0x43aa8e);_0x27ed38(_0x43aa8e);});});}function respondWithStatusCode(_0x3bb7dd,_0x42e313){_0x42e313=_0x42e313||0xcc;return function(_0x26a8c4){if(_0x26a8c4){return _0x3bb7dd['sendStatus'](_0x42e313);}return _0x3bb7dd[_0xac7d('0x2c')](_0x42e313)[_0xac7d('0x2d')]();};}function respondWithResult(_0x31e220,_0x1bcfd5){_0x1bcfd5=_0x1bcfd5||0xc8;return function(_0x4cc590){if(_0x4cc590){return _0x31e220['status'](_0x1bcfd5)['json'](_0x4cc590);}};}function respondWithFilteredResult(_0xc30df3,_0x32b12c){return function(_0xac3f87){if(_0xac3f87){var _0x5bd39b=_0xac3f87['count'],_0x51df23=_0x32b12c['offset'],_0x506b88=_0x32b12c['offset']+_0x32b12c[_0xac7d('0x2e')],_0x4e2456;if(_0x506b88>=_0x5bd39b){_0x506b88=_0x5bd39b;_0x4e2456=0xc8;}else{_0x4e2456=0xce;}_0xc30df3[_0xac7d('0x2c')](_0x4e2456);return _0xc30df3[_0xac7d('0x2f')](_0xac7d('0x30'),_0x51df23+'-'+_0x506b88+'/'+_0x5bd39b)[_0xac7d('0x31')](_0xac3f87);}return null;};}function patchUpdates(_0x5c3c15){return function(_0x4ce2ed){try{jsonpatch[_0xac7d('0x32')](_0x4ce2ed,_0x5c3c15,!![]);}catch(_0xfbfbf7){return BPromise[_0xac7d('0x33')](_0xfbfbf7);}return _0x4ce2ed[_0xac7d('0x34')]();};}function saveUpdates(_0x39dc77,_0x500161){return function(_0x3ba58d){if(_0x3ba58d){return _0x3ba58d[_0xac7d('0x35')](_0x39dc77)[_0xac7d('0x36')](function(_0x96e66b){return _0x96e66b;});}return null;};}function removeEntity(_0x41c60a,_0x2e10f7){return function(_0x29163c){if(_0x29163c){return _0x29163c[_0xac7d('0x37')]()[_0xac7d('0x36')](function(){_0x41c60a[_0xac7d('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2237be,_0x1835d2){return function(_0x64724b){if(!_0x64724b){_0x2237be[_0xac7d('0x38')](0x194);}return _0x64724b;};}function handleError(_0x204717,_0x5690e4){_0x5690e4=_0x5690e4||0x1f4;return function(_0x2bfc9e){logger['error'](_0x2bfc9e['stack']);if(_0x2bfc9e[_0xac7d('0x39')]){delete _0x2bfc9e[_0xac7d('0x39')];}_0x204717[_0xac7d('0x2c')](_0x5690e4)[_0xac7d('0x3a')](_0x2bfc9e);};}exports[_0xac7d('0x3b')]=function(_0x24cdfb,_0x330fb0){var _0x1e48df={},_0x105bac={},_0x3a0bc2={'count':0x0,'rows':[]};var _0x1c5df3=_['map'](db['ChatGroup'][_0xac7d('0x3c')],function(_0x586b63){return{'name':_0x586b63[_0xac7d('0x3d')],'type':_0x586b63[_0xac7d('0x3e')][_0xac7d('0x3f')]};});_0x105bac[_0xac7d('0x40')]=_['map'](_0x1c5df3,'name');_0x105bac[_0xac7d('0x41')]=_[_0xac7d('0x42')](_0x24cdfb[_0xac7d('0x41')]);_0x105bac[_0xac7d('0x43')]=_[_0xac7d('0x44')](_0x105bac['model'],_0x105bac['query']);_0x1e48df[_0xac7d('0x45')]=_['intersection'](_0x105bac[_0xac7d('0x40')],qs[_0xac7d('0x46')](_0x24cdfb[_0xac7d('0x41')]['fields']));_0x1e48df[_0xac7d('0x45')]=_0x1e48df[_0xac7d('0x45')][_0xac7d('0x47')]?_0x1e48df[_0xac7d('0x45')]:_0x105bac[_0xac7d('0x40')];if(!_0x24cdfb[_0xac7d('0x41')]['hasOwnProperty']('nolimit')){_0x1e48df[_0xac7d('0x2e')]=qs[_0xac7d('0x2e')](_0x24cdfb['query'][_0xac7d('0x2e')]);_0x1e48df[_0xac7d('0x48')]=qs[_0xac7d('0x48')](_0x24cdfb['query']['offset']);}_0x1e48df[_0xac7d('0x49')]=qs['sort'](_0x24cdfb[_0xac7d('0x41')][_0xac7d('0x4a')]);_0x1e48df[_0xac7d('0x4b')]=qs[_0xac7d('0x43')](_[_0xac7d('0x4c')](_0x24cdfb[_0xac7d('0x41')],_0x105bac[_0xac7d('0x43')]),_0x1c5df3);if(_0x24cdfb[_0xac7d('0x41')][_0xac7d('0x4d')]){_0x1e48df[_0xac7d('0x4b')]=_['merge'](_0x1e48df[_0xac7d('0x4b')],{'$or':_[_0xac7d('0x4e')](_0x1c5df3,function(_0x37dca1){if(_0x37dca1[_0xac7d('0x3e')]!==_0xac7d('0x4f')){var _0x4092d1={};_0x4092d1[_0x37dca1[_0xac7d('0x39')]]={'$like':'%'+_0x24cdfb['query'][_0xac7d('0x4d')]+'%'};return _0x4092d1;}})});}_0x1e48df=_[_0xac7d('0x50')]({},_0x1e48df,_0x24cdfb['options']);var _0x1905c5={'where':_0x1e48df[_0xac7d('0x4b')]};return db[_0xac7d('0x51')][_0xac7d('0x52')](_0x1905c5)[_0xac7d('0x36')](function(_0x40abbb){_0x3a0bc2[_0xac7d('0x52')]=_0x40abbb;if(_0x24cdfb['query'][_0xac7d('0x53')]){_0x1e48df[_0xac7d('0x54')]=[{'all':!![]}];}return db['ChatGroup'][_0xac7d('0x55')](_0x1e48df);})[_0xac7d('0x36')](function(_0x3f3e3d){_0x3a0bc2['rows']=_0x3f3e3d;return _0x3a0bc2;})[_0xac7d('0x36')](respondWithFilteredResult(_0x330fb0,_0x1e48df))[_0xac7d('0x2b')](handleError(_0x330fb0,null));};exports[_0xac7d('0x56')]=function(_0x302794,_0x57e0c2){var _0x2cf14d={'raw':!![],'where':{'id':_0x302794[_0xac7d('0x57')]['id']}},_0x14901d={};_0x14901d[_0xac7d('0x40')]=_[_0xac7d('0x42')](db['ChatGroup']['rawAttributes']);_0x14901d[_0xac7d('0x41')]=_[_0xac7d('0x42')](_0x302794[_0xac7d('0x41')]);_0x14901d['filters']=_[_0xac7d('0x44')](_0x14901d['model'],_0x14901d[_0xac7d('0x41')]);_0x2cf14d[_0xac7d('0x45')]=_[_0xac7d('0x44')](_0x14901d[_0xac7d('0x40')],qs[_0xac7d('0x46')](_0x302794[_0xac7d('0x41')]['fields']));_0x2cf14d[_0xac7d('0x45')]=_0x2cf14d[_0xac7d('0x45')][_0xac7d('0x47')]?_0x2cf14d[_0xac7d('0x45')]:_0x14901d[_0xac7d('0x40')];if(_0x302794[_0xac7d('0x41')][_0xac7d('0x53')]){_0x2cf14d[_0xac7d('0x54')]=[{'all':!![]}];}_0x2cf14d=_[_0xac7d('0x50')]({},_0x2cf14d,_0x302794[_0xac7d('0x58')]);return db[_0xac7d('0x51')][_0xac7d('0x59')](_0x2cf14d)[_0xac7d('0x36')](handleEntityNotFound(_0x57e0c2,null))[_0xac7d('0x36')](respondWithResult(_0x57e0c2,null))[_0xac7d('0x2b')](handleError(_0x57e0c2,null));};exports[_0xac7d('0x5a')]=function(_0xda0b68,_0x4c5e10){return db[_0xac7d('0x51')][_0xac7d('0x5a')](_0xda0b68[_0xac7d('0x5b')],{})[_0xac7d('0x36')](respondWithResult(_0x4c5e10,0xc9))[_0xac7d('0x2b')](handleError(_0x4c5e10,null));};exports[_0xac7d('0x35')]=function(_0x5e9fa4,_0x5625f9){if(_0x5e9fa4[_0xac7d('0x5b')]['id']){delete _0x5e9fa4[_0xac7d('0x5b')]['id'];}return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x5e9fa4['params']['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x5625f9,null))[_0xac7d('0x36')](saveUpdates(_0x5e9fa4[_0xac7d('0x5b')],null))[_0xac7d('0x36')](respondWithResult(_0x5625f9,null))[_0xac7d('0x2b')](handleError(_0x5625f9,null));};exports['destroy']=function(_0x28329b,_0x36d8bd){return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x28329b['params']['id']}})['then'](handleEntityNotFound(_0x36d8bd,null))[_0xac7d('0x36')](removeEntity(_0x36d8bd,null))[_0xac7d('0x2b')](handleError(_0x36d8bd,null));};exports[_0xac7d('0x5c')]=function(_0x29fc2c,_0x430260){return db[_0xac7d('0x51')][_0xac7d('0x5c')]()[_0xac7d('0x36')](respondWithResult(_0x430260,null))[_0xac7d('0x2b')](handleError(_0x430260,null));};exports['getUnread']=function(_0x3fedfc,_0x26617a,_0x7a9823){return db[_0xac7d('0x5d')]['count']({'where':{'ChatGroupId':_0x3fedfc[_0xac7d('0x57')]['id'],'ToId':_0x3fedfc[_0xac7d('0x5e')]['id'],'read':![]}})[_0xac7d('0x36')](function(_0x45097a){return{'id':_[_0xac7d('0x5f')](_0x3fedfc['params']['id']),'count':_0x45097a};})[_0xac7d('0x36')](respondWithResult(_0x26617a,null))[_0xac7d('0x2b')](handleError(_0x26617a,null));};exports[_0xac7d('0x60')]=function(_0x13dc6b,_0x336cb2,_0x1b2c24){return db[_0xac7d('0x51')]['find']({'where':{'id':_0x13dc6b[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x336cb2,null))[_0xac7d('0x36')](function(_0x3b670d){if(_0x3b670d){return _0x3b670d[_0xac7d('0x60')](_0x13dc6b[_0xac7d('0x5b')][_0xac7d('0x61')],_[_0xac7d('0x62')](_0x13dc6b[_0xac7d('0x5b')],[_0xac7d('0x61'),'id'])||{});}})[_0xac7d('0x36')](respondWithResult(_0x336cb2,null))[_0xac7d('0x2b')](handleError(_0x336cb2,null));};exports[_0xac7d('0x63')]=function(_0x5b8458,_0x2a6904,_0x388a95){var _0x7b4c80={};var _0x5823fa={};var _0xb0118a;var _0x4d8265;return db['ChatGroup'][_0xac7d('0x64')]({'where':{'id':_0x5b8458[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x2a6904,null))[_0xac7d('0x36')](function(_0x2c7f9d){if(_0x2c7f9d){_0xb0118a=_0x2c7f9d;_0x5823fa['model']=_[_0xac7d('0x42')](db['User'][_0xac7d('0x3c')]);_0x5823fa['query']=_[_0xac7d('0x42')](_0x5b8458[_0xac7d('0x41')]);_0x5823fa[_0xac7d('0x43')]=_['intersection'](_0x5823fa[_0xac7d('0x40')],_0x5823fa[_0xac7d('0x41')]);_0x7b4c80[_0xac7d('0x45')]=_[_0xac7d('0x44')](_0x5823fa['model'],qs[_0xac7d('0x46')](_0x5b8458[_0xac7d('0x41')][_0xac7d('0x46')]));_0x7b4c80['attributes']=_0x7b4c80['attributes'][_0xac7d('0x47')]?_0x7b4c80[_0xac7d('0x45')]:_0x5823fa['model'];_0x7b4c80['order']=qs[_0xac7d('0x4a')](_0x5b8458['query'][_0xac7d('0x4a')]);_0x7b4c80[_0xac7d('0x4b')]=qs[_0xac7d('0x43')](_[_0xac7d('0x4c')](_0x5b8458[_0xac7d('0x41')],_0x5823fa['filters']));if(_0x5b8458[_0xac7d('0x41')][_0xac7d('0x4d')]){_0x7b4c80['where']=_[_0xac7d('0x50')](_0x7b4c80[_0xac7d('0x4b')],{'$or':_[_0xac7d('0x4e')](_0x7b4c80['attributes'],function(_0x28e419){var _0xca2186={};_0xca2186[_0x28e419]={'$like':'%'+_0x5b8458[_0xac7d('0x41')][_0xac7d('0x4d')]+'%'};return _0xca2186;})});}_0x7b4c80=_[_0xac7d('0x50')]({},_0x7b4c80,_0x5b8458[_0xac7d('0x58')]);return _0xb0118a['getMembers'](_0x7b4c80);}})['then'](function(_0x45d0fd){if(_0x45d0fd){_0x4d8265=_0x45d0fd[_0xac7d('0x47')];if(!_0x5b8458[_0xac7d('0x41')]['hasOwnProperty'](_0xac7d('0x65'))){_0x7b4c80[_0xac7d('0x2e')]=qs[_0xac7d('0x2e')](_0x5b8458[_0xac7d('0x41')][_0xac7d('0x2e')]);_0x7b4c80[_0xac7d('0x48')]=qs[_0xac7d('0x48')](_0x5b8458[_0xac7d('0x41')][_0xac7d('0x48')]);}return _0xb0118a['getMembers'](_0x7b4c80);}})['then'](function(_0x5c61d1){if(_0x5c61d1){return _0x5c61d1?{'count':_0x4d8265,'rows':_0x5c61d1}:null;}})[_0xac7d('0x36')](respondWithResult(_0x2a6904,null))['catch'](handleError(_0x2a6904,null));};exports[_0xac7d('0x66')]=function(_0x3a660e,_0x979958,_0xc5ba36){return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x3a660e[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x979958,null))['then'](function(_0x2e5a61){if(_0x2e5a61){return _0x2e5a61[_0xac7d('0x66')](_0x3a660e['query'][_0xac7d('0x61')]);}})['then'](respondWithStatusCode(_0x979958,null))[_0xac7d('0x2b')](handleError(_0x979958,null));};exports[_0xac7d('0x67')]=function(_0x413871,_0x23555d,_0x2d766d){if(_0x413871[_0xac7d('0x5b')]['id']){delete _0x413871['body']['id'];}return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x413871[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x23555d,null))['then'](function(_0x54fa30){if(_0x54fa30){_0x413871['body'][_0xac7d('0x68')]=_0x54fa30['id'];return db['ChatInternalMessage'][_0xac7d('0x5a')](_0x413871[_0xac7d('0x5b')]);}})['then'](respondWithResult(_0x23555d,null))[_0xac7d('0x2b')](handleError(_0x23555d,null));};exports[_0xac7d('0x69')]=function(_0x834710,_0x22a3ab,_0x2bc2c8){var _0xe4c0b={};var _0x1a2b21={};var _0x17dbc1;var _0x22e406;return db[_0xac7d('0x51')][_0xac7d('0x64')]({'where':{'id':_0x834710[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x22a3ab,null))[_0xac7d('0x36')](function(_0x2cde10){if(_0x2cde10){_0x17dbc1=_0x2cde10;_0x1a2b21[_0xac7d('0x40')]=_[_0xac7d('0x42')](db[_0xac7d('0x5d')][_0xac7d('0x3c')]);_0x1a2b21['query']=_['keys'](_0x834710[_0xac7d('0x41')]);_0x1a2b21[_0xac7d('0x43')]=_[_0xac7d('0x44')](_0x1a2b21[_0xac7d('0x40')],_0x1a2b21['query']);_0xe4c0b[_0xac7d('0x45')]=_[_0xac7d('0x44')](_0x1a2b21[_0xac7d('0x40')],qs['fields'](_0x834710[_0xac7d('0x41')][_0xac7d('0x46')]));_0xe4c0b[_0xac7d('0x45')]=_0xe4c0b[_0xac7d('0x45')]['length']?_0xe4c0b[_0xac7d('0x45')]:_0x1a2b21[_0xac7d('0x40')];_0xe4c0b[_0xac7d('0x49')]=qs['sort'](_0x834710[_0xac7d('0x41')]['sort']);_0xe4c0b[_0xac7d('0x4b')]=qs[_0xac7d('0x43')](_[_0xac7d('0x4c')](_0x834710[_0xac7d('0x41')],_0x1a2b21['filters']));if(_0x834710[_0xac7d('0x41')][_0xac7d('0x4d')]){_0xe4c0b['where']=_[_0xac7d('0x50')](_0xe4c0b[_0xac7d('0x4b')],{'$or':_['map'](_0xe4c0b[_0xac7d('0x45')],function(_0x2be9ff){var _0x4efd06={};_0x4efd06[_0x2be9ff]={'$like':'%'+_0x834710['query'][_0xac7d('0x4d')]+'%'};return _0x4efd06;})});}if(_0x834710[_0xac7d('0x41')]['$gte']){var _0x3ca960=_0x834710[_0xac7d('0x41')][_0xac7d('0x6a')][_0xac7d('0x6b')](',');var _0x4d3bb9={};_0x4d3bb9[_0x3ca960[0x0]]={'$gte':moment(_0x3ca960[0x1])[_0xac7d('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe4c0b['where']=_[_0xac7d('0x50')](_0xe4c0b[_0xac7d('0x4b')],_0x4d3bb9);}_0xe4c0b=_['merge']({},_0xe4c0b,_0x834710[_0xac7d('0x58')]);return _0x17dbc1[_0xac7d('0x69')](_0xe4c0b);}})[_0xac7d('0x36')](function(_0x441022){if(_0x441022){_0x22e406=_0x441022[_0xac7d('0x47')];if(!_0x834710[_0xac7d('0x41')][_0xac7d('0x6d')](_0xac7d('0x65'))){_0xe4c0b[_0xac7d('0x2e')]=qs[_0xac7d('0x2e')](_0x834710[_0xac7d('0x41')][_0xac7d('0x2e')]);_0xe4c0b[_0xac7d('0x48')]=qs[_0xac7d('0x48')](_0x834710[_0xac7d('0x41')][_0xac7d('0x48')]);}return _0x17dbc1[_0xac7d('0x69')](_0xe4c0b);}})[_0xac7d('0x36')](function(_0x39b19d){if(_0x39b19d){return _0x39b19d?{'count':_0x22e406,'rows':_0x39b19d}:null;}})['then'](respondWithResult(_0x22a3ab,null))[_0xac7d('0x2b')](handleError(_0x22a3ab,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e098008..cdad990 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 _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x435122,_0x502c99){var _0x3a4d69=function(_0x289d25){while(--_0x289d25){_0x435122['push'](_0x435122['shift']());}};_0x3a4d69(++_0x502c99);}(_0x0b0e,0x187));var _0xe0b0=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x0b0e[_0x260f28];return _0x3aefcc;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatGroupEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatGroupEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatGroup[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x9ee1ff,_0x551dc9){var _0x42e791=function(_0x33a7d2){while(--_0x33a7d2){_0x9ee1ff['push'](_0x9ee1ff['shift']());}};_0x42e791(++_0x551dc9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5624df,_0x527728){_0x5624df=_0x5624df-0x0;var _0x7aea7=_0x5f2f[_0x5624df];return _0x7aea7;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatGroup=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatGroupEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatGroupEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatGroup[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 53a8b39..261e1d5 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 _0x8832=['lodash','util','moment','bluebird','request-promise','rimraf','./chatGroup.attributes','exports','define','chat_groups'];(function(_0x1a08cf,_0x186382){var _0x4174b7=function(_0x263861){while(--_0x263861){_0x1a08cf['push'](_0x1a08cf['shift']());}};_0x4174b7(++_0x186382);}(_0x8832,0x1f4));var _0x2883=function(_0x4d7d63,_0x3b6c22){_0x4d7d63=_0x4d7d63-0x0;var _0x36cc67=_0x8832[_0x4d7d63];return _0x36cc67;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rp=require(_0x2883('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2883('0x5'));var config=require('../../config/environment');var attributes=require(_0x2883('0x6'));module[_0x2883('0x7')]=function(_0x278026,_0x556903){return _0x278026[_0x2883('0x8')]('ChatGroup',attributes,{'tableName':_0x2883('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc770=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','moment','bluebird','request-promise'];(function(_0x2addab,_0x511cec){var _0x180d4f=function(_0x26f64d){while(--_0x26f64d){_0x2addab['push'](_0x2addab['shift']());}};_0x180d4f(++_0x511cec);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x575bb3,_0x26a0ff){return _0x575bb3[_0x0c77('0xa')]('ChatGroup',attributes,{'tableName':_0x0c77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 167394b..7e81797 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 _0xa4cb=['message','info','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatGroup.socket','register','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x263e6d,_0x585ebb){var _0xc8d72=function(_0x54afe4){while(--_0x54afe4){_0x263e6d['push'](_0x263e6d['shift']());}};_0xc8d72(++_0x585ebb);}(_0xa4cb,0x118));var _0xba4c=function(_0x2a18cd,_0x47043f){_0x2a18cd=_0x2a18cd-0x0;var _0x259ce2=_0xa4cb[_0x2a18cd];return _0x259ce2;};'use strict';var _=require(_0xba4c('0x0'));var util=require('util');var moment=require(_0xba4c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba4c('0x2'))['db'];var utils=require(_0xba4c('0x3'));var logger=require(_0xba4c('0x4'))(_0xba4c('0x5'));var config=require(_0xba4c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xba4c('0x7')][_0xba4c('0x8')]({'port':0x232a});config[_0xba4c('0x9')]=_[_0xba4c('0xa')](config[_0xba4c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba4c('0x9')]));require(_0xba4c('0xb'))[_0xba4c('0xc')](socket);function respondWithRpcPromise(_0x367e13,_0x3adf2a,_0x2ca59f){return new BPromise(function(_0x2b6802,_0x39bbda){return client['request'](_0x367e13,_0x2ca59f)['then'](function(_0x18f814){logger['info'](_0xba4c('0xd'),_0x3adf2a,_0xba4c('0xe'));logger[_0xba4c('0xf')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3adf2a,_0xba4c('0xe'),JSON[_0xba4c('0x10')](_0x18f814));if(_0x18f814['error']){if(_0x18f814['error'][_0xba4c('0x11')]===0x1f4){logger[_0xba4c('0x12')](_0xba4c('0xd'),_0x3adf2a,_0x18f814[_0xba4c('0x12')][_0xba4c('0x13')]);return _0x39bbda(_0x18f814[_0xba4c('0x12')][_0xba4c('0x13')]);}logger[_0xba4c('0x12')](_0xba4c('0xd'),_0x3adf2a,_0x18f814[_0xba4c('0x12')][_0xba4c('0x13')]);return _0x2b6802(_0x18f814[_0xba4c('0x12')][_0xba4c('0x13')]);}else{logger[_0xba4c('0x14')](_0xba4c('0xd'),_0x3adf2a,_0xba4c('0xe'));_0x2b6802(_0x18f814[_0xba4c('0x15')][_0xba4c('0x13')]);}})[_0xba4c('0x16')](function(_0x2f6cac){logger[_0xba4c('0x12')](_0xba4c('0xd'),_0x3adf2a,_0x2f6cac);_0x39bbda(_0x2f6cac);});});}
\ No newline at end of file
+var _0x6b9b=['../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x462053,_0x20ecad){var _0x355ec5=function(_0x246146){while(--_0x246146){_0x462053['push'](_0x462053['shift']());}};_0x355ec5(++_0x20ecad);}(_0x6b9b,0x1c1));var _0xb6b9=function(_0x52cef3,_0x4e970f){_0x52cef3=_0x52cef3-0x0;var _0x3adc4b=_0x6b9b[_0x52cef3];return _0x3adc4b;};'use strict';var _=require(_0xb6b9('0x0'));var util=require(_0xb6b9('0x1'));var moment=require(_0xb6b9('0x2'));var BPromise=require(_0xb6b9('0x3'));var rs=require(_0xb6b9('0x4'));var fs=require('fs');var Redis=require(_0xb6b9('0x5'));var db=require(_0xb6b9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6b9('0x7'))(_0xb6b9('0x8'));var config=require(_0xb6b9('0x9'));var jayson=require(_0xb6b9('0xa'));var client=jayson['client'][_0xb6b9('0xb')]({'port':0x232a});config['redis']=_[_0xb6b9('0xc')](config[_0xb6b9('0xd')],{'host':_0xb6b9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6b9('0xd')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x16291d,_0x43289e,_0x233fd9){return new BPromise(function(_0x3b01b9,_0x237a55){return client['request'](_0x16291d,_0x233fd9)['then'](function(_0x35b631){logger[_0xb6b9('0xf')]('ChatGroup,\x20%s,\x20%s',_0x43289e,_0xb6b9('0x10'));logger[_0xb6b9('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x43289e,'request\x20sent',JSON[_0xb6b9('0x12')](_0x35b631));if(_0x35b631[_0xb6b9('0x13')]){if(_0x35b631[_0xb6b9('0x13')][_0xb6b9('0x14')]===0x1f4){logger['error'](_0xb6b9('0x15'),_0x43289e,_0x35b631[_0xb6b9('0x13')][_0xb6b9('0x16')]);return _0x237a55(_0x35b631['error'][_0xb6b9('0x16')]);}logger[_0xb6b9('0x13')](_0xb6b9('0x15'),_0x43289e,_0x35b631[_0xb6b9('0x13')][_0xb6b9('0x16')]);return _0x3b01b9(_0x35b631[_0xb6b9('0x13')][_0xb6b9('0x16')]);}else{logger[_0xb6b9('0xf')](_0xb6b9('0x15'),_0x43289e,_0xb6b9('0x10'));_0x3b01b9(_0x35b631['result'][_0xb6b9('0x16')]);}})[_0xb6b9('0x17')](function(_0x589dbc){logger[_0xb6b9('0x13')](_0xb6b9('0x15'),_0x43289e,_0x589dbc);_0x237a55(_0x589dbc);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 5cd734a..25da54a 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 _0xd9bc=['emit','removeListener','register','length','save','remove','update'];(function(_0x27d0d8,_0x2b657d){var _0x2b79d1=function(_0x249ec1){while(--_0x249ec1){_0x27d0d8['push'](_0x27d0d8['shift']());}};_0x2b79d1(++_0x2b657d);}(_0xd9bc,0xa5));var _0xcd9b=function(_0xcffe38,_0x48fe40){_0xcffe38=_0xcffe38-0x0;var _0x576987=_0xd9bc[_0xcffe38];return _0x576987;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xcd9b('0x0'),_0xcd9b('0x1'),_0xcd9b('0x2')];function createListener(_0x4f02a7,_0x3195c3){return function(_0x38c120){_0x3195c3[_0xcd9b('0x3')](_0x4f02a7,_0x38c120);};}function removeListener(_0x144836,_0x11e26e){return function(){ChatGroupEvents[_0xcd9b('0x4')](_0x144836,_0x11e26e);};}exports[_0xcd9b('0x5')]=function(_0x26f4af){for(var _0x2ea37e=0x0,_0x4aefb2=events[_0xcd9b('0x6')];_0x2ea37e<_0x4aefb2;_0x2ea37e++){var _0x3670e8=events[_0x2ea37e];var _0x297365=createListener('chatGroup:'+_0x3670e8,_0x26f4af);ChatGroupEvents['on'](_0x3670e8,_0x297365);}};
\ No newline at end of file
+var _0x833a=['remove','update','emit','removeListener','./chatGroup.events','save'];(function(_0x29d8a6,_0x287cc6){var _0x447dd9=function(_0x16ff8b){while(--_0x16ff8b){_0x29d8a6['push'](_0x29d8a6['shift']());}};_0x447dd9(++_0x287cc6);}(_0x833a,0x9a));var _0xa833=function(_0x1292b1,_0x4647f4){_0x1292b1=_0x1292b1-0x0;var _0x56df74=_0x833a[_0x1292b1];return _0x56df74;};'use strict';var ChatGroupEvents=require(_0xa833('0x0'));var events=[_0xa833('0x1'),_0xa833('0x2'),_0xa833('0x3')];function createListener(_0x47c396,_0xf55a36){return function(_0x396753){_0xf55a36[_0xa833('0x4')](_0x47c396,_0x396753);};}function removeListener(_0x4a2394,_0x46e8f4){return function(){ChatGroupEvents[_0xa833('0x5')](_0x4a2394,_0x46e8f4);};}exports['register']=function(_0x5825d6){for(var _0x5360e8=0x0,_0x37608b=events['length'];_0x5360e8<_0x37608b;_0x5360e8++){var _0x744726=events[_0x5360e8];var _0x560832=createListener('chatGroup:'+_0x744726,_0x5825d6);ChatGroupEvents['on'](_0x744726,_0x560832);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1e1f273..951504b 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 _0x02fb=['/:id/members','addMessage','put','update','delete','destroy','removeMembers','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','getUnread','/:id/messages','getMessages','post','create'];(function(_0x4ae0f8,_0x481211){var _0xcd39f7=function(_0x2a4134){while(--_0x2a4134){_0x4ae0f8['push'](_0x4ae0f8['shift']());}};_0xcd39f7(++_0x481211);}(_0x02fb,0x198));var _0xb02f=function(_0x53dcd9,_0x4bb8db){_0x53dcd9=_0x53dcd9-0x0;var _0xeeaf58=_0x02fb[_0x53dcd9];return _0xeeaf58;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb02f('0x0'));var express=require(_0xb02f('0x1'));var router=express[_0xb02f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb02f('0x3'));var config=require(_0xb02f('0x4'));var controller=require(_0xb02f('0x5'));router[_0xb02f('0x6')]('/',auth[_0xb02f('0x7')](),controller['index']);router['get'](_0xb02f('0x8'),auth[_0xb02f('0x7')](),controller[_0xb02f('0x9')]);router[_0xb02f('0x6')](_0xb02f('0xa'),auth[_0xb02f('0x7')](),controller[_0xb02f('0xb')]);router[_0xb02f('0x6')]('/:id/unread',auth[_0xb02f('0x7')](),controller[_0xb02f('0xc')]);router[_0xb02f('0x6')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xb02f('0x6')](_0xb02f('0xd'),auth['isAuthenticated'](),controller[_0xb02f('0xe')]);router[_0xb02f('0xf')]('/',auth[_0xb02f('0x7')](),controller[_0xb02f('0x10')]);router[_0xb02f('0xf')](_0xb02f('0x11'),auth[_0xb02f('0x7')](),controller['addMembers']);router['post'](_0xb02f('0xd'),auth['isAuthenticated'](),controller[_0xb02f('0x12')]);router[_0xb02f('0x13')]('/:id',auth[_0xb02f('0x7')](),controller[_0xb02f('0x14')]);router[_0xb02f('0x15')](_0xb02f('0xa'),auth['isAuthenticated'](),controller[_0xb02f('0x16')]);router[_0xb02f('0x15')](_0xb02f('0x11'),auth[_0xb02f('0x7')](),controller[_0xb02f('0x17')]);module[_0xb02f('0x18')]=router;
\ No newline at end of file
+var _0x0e3a=['index','/describe','getUnread','/:id/members','/:id/messages','create','post','addMembers','addMessage','/:id','update','destroy','removeMembers','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x4d1616,_0x541ef6){var _0x593dab=function(_0xf9e565){while(--_0xf9e565){_0x4d1616['push'](_0x4d1616['shift']());}};_0x593dab(++_0x541ef6);}(_0x0e3a,0x16e));var _0xa0e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0e3a[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xa0e3('0x0'));var util=require('util');var path=require(_0xa0e3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa0e3('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xa0e3('0x3'));var config=require(_0xa0e3('0x4'));var controller=require(_0xa0e3('0x5'));router[_0xa0e3('0x6')]('/',auth[_0xa0e3('0x7')](),controller[_0xa0e3('0x8')]);router['get'](_0xa0e3('0x9'),auth[_0xa0e3('0x7')](),controller['describe']);router['get']('/:id',auth[_0xa0e3('0x7')](),controller['show']);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0xa0e3('0xa')]);router[_0xa0e3('0x6')](_0xa0e3('0xb'),auth[_0xa0e3('0x7')](),controller['getMembers']);router[_0xa0e3('0x6')](_0xa0e3('0xc'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0xa0e3('0x7')](),controller[_0xa0e3('0xd')]);router[_0xa0e3('0xe')]('/:id/members',auth[_0xa0e3('0x7')](),controller[_0xa0e3('0xf')]);router[_0xa0e3('0xe')](_0xa0e3('0xc'),auth[_0xa0e3('0x7')](),controller[_0xa0e3('0x10')]);router['put'](_0xa0e3('0x11'),auth['isAuthenticated'](),controller[_0xa0e3('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa0e3('0x13')]);router['delete'](_0xa0e3('0xb'),auth[_0xa0e3('0x7')](),controller[_0xa0e3('0x14')]);module[_0xa0e3('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f08cbf4..f68a718 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 _0xb1a6=['ENUM','thumb','star','TEXT','STRING','long','DATE','sequelize','exports','INTEGER'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0xb1a6,0x147));var _0x6b1a=function(_0xdfde4c,_0x18c4f4){_0xdfde4c=_0xdfde4c-0x0;var _0x3260fa=_0xb1a6[_0xdfde4c];return _0x3260fa;};'use strict';var Sequelize=require(_0x6b1a('0x0'));module[_0x6b1a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6b1a('0x2')]},'ratingType':{'type':Sequelize[_0x6b1a('0x3')]('star',_0x6b1a('0x4')),'defaultValue':_0x6b1a('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x6b1a('0x6')]},'mailTranscript':{'type':Sequelize[_0x6b1a('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6b1a('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6b1a('0x7')]},'note':{'type':Sequelize[_0x6b1a('0x7')]},'browserName':{'type':Sequelize[_0x6b1a('0x7')]},'browserVersion':{'type':Sequelize[_0x6b1a('0x7')]},'osName':{'type':Sequelize[_0x6b1a('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6b1a('0x7')]},'deviceVendor':{'type':Sequelize[_0x6b1a('0x7')]},'deviceType':{'type':Sequelize[_0x6b1a('0x7')]},'referer':{'type':Sequelize[_0x6b1a('0x6')]},'customerIp':{'type':Sequelize[_0x6b1a('0x7')]},'formData':{'type':Sequelize[_0x6b1a('0x6')](_0x6b1a('0x8'))},'read1stAt':{'type':Sequelize[_0x6b1a('0x9')]},'lastMsgAt':{'type':Sequelize[_0x6b1a('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x6b1a('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x6b1a('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6b1a('0x6')]}};
\ No newline at end of file
+var _0x608a=['TEXT','STRING','long','DATE','out','exports','BOOLEAN','ENUM','star','thumb'];(function(_0xabae1e,_0x3f7e5a){var _0x159597=function(_0xf16cf6){while(--_0xf16cf6){_0xabae1e['push'](_0xabae1e['shift']());}};_0x159597(++_0x3f7e5a);}(_0x608a,0xff));var _0xa608=function(_0x526f38,_0x584c8f){_0x526f38=_0x526f38-0x0;var _0x42f8cf=_0x608a[_0x526f38];return _0x42f8cf;};'use strict';var Sequelize=require('sequelize');module[_0xa608('0x0')]={'closed':{'type':Sequelize[_0xa608('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa608('0x2')](_0xa608('0x3'),_0xa608('0x4')),'defaultValue':_0xa608('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xa608('0x5')]},'mailTranscript':{'type':Sequelize[_0xa608('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa608('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa608('0x6')]},'browserName':{'type':Sequelize[_0xa608('0x6')]},'browserVersion':{'type':Sequelize[_0xa608('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa608('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa608('0x6')]},'deviceType':{'type':Sequelize[_0xa608('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa608('0x6')]},'formData':{'type':Sequelize[_0xa608('0x5')](_0xa608('0x7'))},'read1stAt':{'type':Sequelize[_0xa608('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa608('0x2')]('in',_0xa608('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa608('0x6')]},'customerPort':{'type':Sequelize[_0xa608('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xa608('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 359a85c..912679a 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 _0x0598=['i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','params','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','Attachment','attachId','join','server/files/attachments/','close','root','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','MailServerOut','Smtp','service','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','nolimit','secret','includeAgent','includeAll','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','download','unix','server','files','tmp','transcript-%d-%s.zip','CmContact','Contact','lastName','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
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
','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\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
\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%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
\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
\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{{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
\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
\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%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
\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
','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closedAt','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','direction','out','firstName','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','zip-dir','moment','bluebird','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','TagIds','Tags','push','index','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','select','field','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','parseSearch','search','sqlOperator','length','conditions','find','value','having','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','ChatWebsiteId','concat','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition'];(function(_0x4515dd,_0x436dad){var _0x3d49b5=function(_0x19fe92){while(--_0x19fe92){_0x4515dd['push'](_0x4515dd['shift']());}};_0x3d49b5(++_0x436dad);}(_0x0598,0x92));var _0x8059=function(_0x5cf983,_0x1c784d){_0x5cf983=_0x5cf983-0x0;var _0x5c73b0=_0x0598[_0x5cf983];return _0x5c73b0;};'use strict';var pdf=require(_0x8059('0x0'));var emlformat=require(_0x8059('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8059('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8059('0x3'));var BPromise=require(_0x8059('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8059('0x5'));var csv=require(_0x8059('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8059('0x12')]=_[_0x8059('0x13')](config[_0x8059('0x12')],{'host':_0x8059('0x14'),'port':0x18eb});var socket=require(_0x8059('0x15'))(new Redis(config['redis']));require(_0x8059('0x16'))['register'](socket);var jayson=require(_0x8059('0x17'));var client=jayson['client'][_0x8059('0x18')]({'port':0x232b});var client9004=jayson[_0x8059('0x19')][_0x8059('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x4d3873,_0x516c1f,_0x5cda43,_0x3b8f18){return new BPromise(function(_0x239195,_0x2ffebf){var _0x246c9d=_0x3b8f18||client;return _0x246c9d[_0x8059('0x1a')](_0x4d3873,_0x5cda43)['then'](function(_0x10ad98){logger[_0x8059('0x1b')](_0x8059('0x1c'),_0x516c1f,_0x8059('0x1d'));logger['debug'](_0x8059('0x1e'),_0x516c1f,'request\x20sent',JSON[_0x8059('0x1f')](_0x10ad98));if(_0x10ad98['error']){if(_0x10ad98[_0x8059('0x20')]['code']===0x1f4){logger[_0x8059('0x20')](_0x8059('0x1c'),_0x516c1f,_0x10ad98[_0x8059('0x20')]['message']);return _0x2ffebf(_0x10ad98['error'][_0x8059('0x21')]);}logger[_0x8059('0x20')](_0x8059('0x1c'),_0x516c1f,_0x10ad98[_0x8059('0x20')]['message']);return _0x239195(_0x10ad98[_0x8059('0x20')][_0x8059('0x21')]);}else{logger[_0x8059('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x516c1f,_0x8059('0x1d'));_0x239195(_0x10ad98[_0x8059('0x22')][_0x8059('0x21')]);}})[_0x8059('0x23')](function(_0x59d3a6){logger[_0x8059('0x20')](_0x8059('0x1c'),_0x516c1f,_0x59d3a6);_0x2ffebf(_0x59d3a6);});});}function respondWithStatusCode(_0x4781e2,_0x3e2d2b){_0x3e2d2b=_0x3e2d2b||0xcc;return function(_0x202b30){if(_0x202b30){return _0x4781e2['sendStatus'](_0x3e2d2b);}return _0x4781e2[_0x8059('0x24')](_0x3e2d2b)[_0x8059('0x25')]();};}function respondWithResult(_0xd1fa7e,_0x4a294f){_0x4a294f=_0x4a294f||0xc8;return function(_0x582321){if(_0x582321){return _0xd1fa7e['status'](_0x4a294f)[_0x8059('0x26')](_0x582321);}};}function respondWithFilteredResult(_0xbebe0e,_0xc32b1f){return function(_0x1009af){if(_0x1009af){var _0x59abe9=_0x1009af[_0x8059('0x27')],_0x1eb71b=_0xc32b1f['offset'],_0x50b737=_0xc32b1f[_0x8059('0x28')]+_0xc32b1f[_0x8059('0x29')],_0x2f887c;if(_0x50b737>=_0x59abe9){_0x50b737=_0x59abe9;_0x2f887c=0xc8;}else{_0x2f887c=0xce;}_0xbebe0e[_0x8059('0x24')](_0x2f887c);return _0xbebe0e[_0x8059('0x2a')](_0x8059('0x2b'),_0x1eb71b+'-'+_0x50b737+'/'+_0x59abe9)[_0x8059('0x26')](_0x1009af);}return null;};}function patchUpdates(_0x46b6a1){return function(_0x2016ea){try{jsonpatch['apply'](_0x2016ea,_0x46b6a1,!![]);}catch(_0xb3c36e){return BPromise[_0x8059('0x2c')](_0xb3c36e);}return _0x2016ea[_0x8059('0x2d')]();};}function saveUpdates(_0x15f843,_0x289992){return function(_0x53fb30){if(_0x53fb30){return _0x53fb30[_0x8059('0x2e')](_0x15f843)[_0x8059('0x2f')](function(_0x27c947){return _0x27c947;});}return null;};}function removeEntity(_0x15160a,_0x3ee515){return function(_0x22fd6f){if(_0x22fd6f){return _0x22fd6f[_0x8059('0x30')]()[_0x8059('0x2f')](function(){_0x15160a[_0x8059('0x24')](0xcc)[_0x8059('0x25')]();});}};}function handleEntityNotFound(_0x521ca4,_0x45c175){return function(_0x5b0070){if(!_0x5b0070){_0x521ca4[_0x8059('0x31')](0x194);}return _0x5b0070;};}function handleError(_0x5dc3f7,_0x49fb7e){_0x49fb7e=_0x49fb7e||0x1f4;return function(_0x2191a0){logger['error'](_0x2191a0[_0x8059('0x32')]);if(_0x2191a0['name']){delete _0x2191a0[_0x8059('0x33')];}_0x5dc3f7['status'](_0x49fb7e)[_0x8059('0x34')](_0x2191a0);};}function getInteractionUsers(_0x5c4aa0,_0x53252a){return new BPromise(function(_0x3a3e20,_0x7961af){try{if(_0x53252a[_0x5c4aa0['id']]){_0x5c4aa0[_0x8059('0x35')]=_['map'](_0x53252a[_0x5c4aa0['id']],function(_0x241403){return{'id':_0x241403['id'],'fullname':_0x241403['fullname']};});}}catch(_0x1e8596){_0x7961af(_0x1e8596);}_0x3a3e20(_0x5c4aa0);});}function getInteractionTags(_0x50a685,_0x2034ec){return new BPromise(function(_0x1cee2b,_0x45393b){try{if(_0x50a685[_0x8059('0x36')]){_0x50a685['Tags']=[];_0x50a685[_0x8059('0x36')]['split'](',')['forEach'](function(_0x33b3b7){_0x50a685[_0x8059('0x37')][_0x8059('0x38')](_0x2034ec[_0x33b3b7]);});}delete _0x50a685[_0x8059('0x36')];}catch(_0x2f68b0){_0x45393b(_0x2f68b0);}_0x1cee2b(_0x50a685);});}function updateChatInteraction(_0x5b322f,_0x47c3b9,_0x4872f2){return new BPromise(function(_0x5f0c8e,_0x373e10){return getInteractionUsers(_0x5b322f,_0x4872f2)[_0x8059('0x2f')](function(_0xc84f04){return getInteractionTags(_0xc84f04,_0x47c3b9);})['then'](function(_0x29ae1f){_0x5f0c8e(_0x29ae1f);})[_0x8059('0x23')](function(_0x52919a){_0x373e10(_0x52919a);});});}exports[_0x8059('0x39')]=function(_0x2980cb,_0x12c5fa){var _0x5362b5={},_0x2c48cf={},_0x38c320={'count':0x0,'rows':[]};var _0x57eb56=_[_0x8059('0x3a')](db[_0x8059('0x3b')][_0x8059('0x3c')],function(_0x40763d){return{'name':_0x40763d[_0x8059('0x3d')],'type':_0x40763d[_0x8059('0x3e')][_0x8059('0x3f')]};});_0x2c48cf[_0x8059('0x40')]=_[_0x8059('0x3a')](_0x57eb56,_0x8059('0x33'));_0x2c48cf[_0x8059('0x41')]=_[_0x8059('0x42')](_0x2980cb[_0x8059('0x41')]);_0x2c48cf[_0x8059('0x43')]=_[_0x8059('0x44')](_0x2c48cf[_0x8059('0x40')],_0x2c48cf[_0x8059('0x41')]);_0x5362b5[_0x8059('0x45')]=_[_0x8059('0x44')](_0x2c48cf[_0x8059('0x40')],qs[_0x8059('0x46')](_0x2980cb[_0x8059('0x41')][_0x8059('0x46')]));_0x5362b5['attributes']=_0x5362b5[_0x8059('0x45')]['length']?_0x5362b5['attributes']:_0x2c48cf[_0x8059('0x40')];if(!_0x2980cb['query'][_0x8059('0x47')]('nolimit')){_0x5362b5[_0x8059('0x29')]=qs[_0x8059('0x29')](_0x2980cb[_0x8059('0x41')][_0x8059('0x29')]);_0x5362b5[_0x8059('0x28')]=qs[_0x8059('0x28')](_0x2980cb['query'][_0x8059('0x28')]);}_0x5362b5['order']=qs[_0x8059('0x48')](_0x2980cb[_0x8059('0x41')][_0x8059('0x48')]);_0x5362b5['where']=qs[_0x8059('0x43')](_[_0x8059('0x49')](_0x2980cb[_0x8059('0x41')],_0x2c48cf[_0x8059('0x43')]),_0x57eb56);var _0x584e13=[];var _0x3ccfb1=squel[_0x8059('0x4a')]()[_0x8059('0x4b')]('id')['field'](_0x8059('0x33'))['field']('color')[_0x8059('0x4c')]('tools_tags');var _0x20caa3=squel['select']()[_0x8059('0x4b')](_0x8059('0x4d'))['field'](_0x8059('0x4e'))['field'](_0x8059('0x4f'))[_0x8059('0x4c')](_0x8059('0x50'),'ui')['left_join'](_0x8059('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x21ceef=squel[_0x8059('0x4a')]()[_0x8059('0x4c')](_0x8059('0x52'),'i')['left_join'](_0x8059('0x53'),'c',_0x8059('0x54'))['left_join'](_0x8059('0x51'),'o','o.id\x20=\x20i.UserId')[_0x8059('0x55')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x8059('0x55')](_0x8059('0x56'),'me',_0x8059('0x57'))[_0x8059('0x55')](_0x8059('0x58'),'it',_0x8059('0x59'))[_0x8059('0x55')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x52ed37=squel['expr']();var _0x37c254=[];var _0x21d53c=squel['expr']();var _0x411fe1;if(_0x2980cb['query']['search']){_0x411fe1=as[_0x8059('0x5a')](_0x2980cb['query'][_0x8059('0x5b')]);var _0x27dfa5=_0x411fe1[_0x8059('0x5c')];for(var _0x5928a4=0x0;_0x5928a4<_0x411fe1['conditions'][_0x8059('0x5d')];_0x5928a4++){var _0x39b9f6=_0x411fe1[_0x8059('0x5e')][_0x5928a4];var _0x5056e6='i';var _0x501f2c=_[_0x8059('0x5f')](_0x57eb56,['name',_0x39b9f6['field']]);if(!_0x501f2c){switch(_0x39b9f6[_0x8059('0x4b')]){case'unreadMessages':if(_0x39b9f6[_0x8059('0x60')]==0x1){_0x21ceef[_0x8059('0x61')]('`'+_0x39b9f6['field']+'`\x20=\x200');}else{_0x21ceef[_0x8059('0x61')]('`'+_0x39b9f6[_0x8059('0x4b')]+_0x8059('0x62'));}break;case'Contact':if(_0x39b9f6[_0x8059('0x63')]===_0x8059('0x64')){if(_0x39b9f6[_0x8059('0x60')][_0x8059('0x65')]('\x20')['length']>0x1){_0x52ed37[_0x27dfa5](_0x8059('0x66'),qs['getFullTextValue'](_0x39b9f6[_0x8059('0x60')]),null);}else{var _0x176f8a='%'+_0x39b9f6['value']+'%';_0x52ed37[_0x27dfa5](_0x8059('0x67'),_0x176f8a,_0x176f8a,_0x176f8a);}}else{_0x501f2c=_['find'](_0x57eb56,[_0x8059('0x33'),_0x8059('0x68')]);_0x39b9f6[_0x8059('0x4b')]=_0x8059('0x68');_0x3f13a3=as[_0x8059('0x69')](_0x5056e6,_0x501f2c[_0x8059('0x3e')],_0x39b9f6);_0x52ed37[_0x27dfa5](_0x3f13a3[_0x8059('0x6a')],_0x3f13a3[_0x8059('0x60')][_0x8059('0x6b')],_0x3f13a3[_0x8059('0x60')][_0x8059('0x25')]);}break;case _0x8059('0x6c'):var _0x325f9c=_0x39b9f6['value'][_0x8059('0x65')](',')[_0x8059('0x3a')](function(_0x391924){return Number(_0x391924);});_0x325f9c[_0x8059('0x6d')](function(_0x2cf1fd){_0x21d53c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2cf1fd+',%');});_0x37c254=_[_0x8059('0x6e')](_0x37c254,_0x325f9c);break;case _0x8059('0x6f'):if(_0x39b9f6[_0x8059('0x63')]===_0x8059('0x64')){_0x52ed37[_0x27dfa5](_0x8059('0x70'),'%'+_0x39b9f6[_0x8059('0x60')]+'%',null);}else{_0x501f2c=_[_0x8059('0x5f')](_0x57eb56,[_0x8059('0x33'),_0x8059('0x71')]);_0x39b9f6['field']=_0x8059('0x71');_0x3f13a3=as[_0x8059('0x69')](_0x5056e6,_0x501f2c[_0x8059('0x3e')],_0x39b9f6);_0x52ed37[_0x27dfa5](_0x3f13a3['text'],_0x3f13a3['value'][_0x8059('0x6b')],_0x3f13a3[_0x8059('0x60')][_0x8059('0x25')]);}break;case _0x8059('0x72'):_0x3f13a3=as[_0x8059('0x69')]('me',null,_0x39b9f6);_0x52ed37[_0x27dfa5](_0x3f13a3[_0x8059('0x6a')],_0x3f13a3[_0x8059('0x60')]['start'],_0x3f13a3[_0x8059('0x60')][_0x8059('0x25')]);break;}}else{var _0x3f13a3=as['buildExpression'](_0x5056e6,_0x501f2c[_0x8059('0x3e')],_0x39b9f6);_0x52ed37[_0x27dfa5](_0x3f13a3[_0x8059('0x6a')],_0x3f13a3[_0x8059('0x60')][_0x8059('0x6b')],_0x3f13a3['value']['end']);}}}else{var _0x2aa4a0=_(_0x2980cb[_0x8059('0x41')])['keys']()[_0x8059('0x3a')](function(_0x1c19b0){return _[_0x8059('0x73')](_0x57eb56,[_0x8059('0x33'),_0x1c19b0])?_0x1c19b0:undefined;})[_0x8059('0x74')]()[_0x8059('0x60')]();if(!_['isEmpty'](_0x2aa4a0)){_0x2aa4a0[_0x8059('0x6d')](function(_0x2cdcc4){if(_0x2cdcc4===_0x8059('0x75')){_0x21ceef['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x8059('0x76')](_0x2980cb[_0x8059('0x41')][_0x2cdcc4]));}else if(_0x2cdcc4==='createdAt'){var _0x1f9c4f=JSON[_0x8059('0x77')](_0x2980cb[_0x8059('0x41')][_0x2cdcc4])[_0x8059('0x78')];var _0x2009d9=JSON[_0x8059('0x77')](_0x2980cb[_0x8059('0x41')][_0x2cdcc4])[_0x8059('0x79')];_0x21ceef[_0x8059('0x7a')](_0x8059('0x7b'),_0x1f9c4f,_0x2009d9);}else{if(_0x2980cb[_0x8059('0x41')][_0x2cdcc4]===_0x8059('0x7c')){_0x21ceef['where']('i.'+_0x2cdcc4+_0x8059('0x7d'));}else{_0x21ceef[_0x8059('0x7a')]('i.'+_0x2cdcc4+_0x8059('0x7e'),_0x2980cb['query'][_0x2cdcc4]);}}});}if(_0x2980cb['query'][_0x8059('0x7f')]){if(_0x2980cb['query']['read']==0x1){_0x21ceef[_0x8059('0x61')](_0x8059('0x80'));}else{_0x21ceef['having'](_0x8059('0x81'));}}if(_0x2980cb[_0x8059('0x41')]['tag']){_0x37c254=_['isArray'](_0x2980cb[_0x8059('0x41')]['tag'])?_0x2980cb['query'][_0x8059('0x82')]:new Array(_0x2980cb[_0x8059('0x41')][_0x8059('0x82')]);_0x37c254[_0x8059('0x6d')](function(_0x55257a){_0x21d53c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x55257a+',%');});}if(_0x2980cb[_0x8059('0x41')][_0x8059('0x83')]){var _0x402120=_0x2980cb[_0x8059('0x41')][_0x8059('0x83')][_0x8059('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x402120)){_0x52ed37['or'](_0x8059('0x85'),_0x402120+'%');}else{_0x52ed37['or'](_0x8059('0x86'),qs[_0x8059('0x87')](_0x402120))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x402120+'%');}}}_0x21ceef[_0x8059('0x7a')](_0x52ed37);_0x21ceef[_0x8059('0x88')]('i.id');var _0x5a5c7={'type':db[_0x8059('0x89')]['QueryTypes'][_0x8059('0x8a')],'raw':!![]};var _0x3c5ae0=_0x21ceef[_0x8059('0x8b')]();_0x3c5ae0[_0x8059('0x4b')](_0x8059('0x8c'));_0x3c5ae0[_0x8059('0x4b')](_0x8059('0x8d'),_0x8059('0x8e'));if(_0x5362b5[_0x8059('0x8f')]){_0x5362b5['order']['forEach'](function(_0x1b9f1a){var _0x1452ed=_0x1b9f1a[0x0]===_0x8059('0x90')?_0x1b9f1a[0x0]:'i.'+_0x1b9f1a[0x0];_0x21ceef[_0x8059('0x8f')](_0x1452ed,_0x1b9f1a[0x1]===_0x8059('0x91')?![]:!![]);});}if(!_[_0x8059('0x92')](_0x37c254)){_0x21ceef['having'](_0x21d53c);_0x3c5ae0[_0x8059('0x7a')](_0x8059('0x93'),_0x37c254);}BPromise[_0x8059('0x94')]()['then'](function(){if(!_0x411fe1){if(_0x2980cb[_0x8059('0x41')][_0x8059('0x75')]||_0x2980cb[_0x8059('0x41')][_0x8059('0x95')])return;_0x3c5ae0[_0x8059('0x7a')](_0x8059('0x96'));_0x21ceef[_0x8059('0x7a')](_0x8059('0x96'));return;}if(_0x2980cb[_0x8059('0x97')][_0x8059('0x98')]!==_0x8059('0x99'))return;return _0x2980cb[_0x8059('0x97')][_0x8059('0x9a')]({'attributes':['id'],'raw':!![]})[_0x8059('0x2f')](function(_0x397d77){if(_['isEmpty'](_0x397d77)){_0x3c5ae0[_0x8059('0x7a')](_0x8059('0x9b'));_0x21ceef['where'](_0x8059('0x9b'));}else{_0x3c5ae0['where'](_0x8059('0x9c'),_[_0x8059('0x3a')](_0x397d77,'id'));_0x21ceef[_0x8059('0x7a')](_0x8059('0x9c'),_[_0x8059('0x3a')](_0x397d77,'id'));}});})[_0x8059('0x2f')](function(){if(_0x2980cb[_0x8059('0x97')][_0x8059('0x98')]===_0x8059('0x99')&&!_0x411fe1&&!_0x2980cb[_0x8059('0x41')][_0x8059('0x75')])return[];return db[_0x8059('0x9d')]['query'](_0x3c5ae0['toString'](),_0x5a5c7);})[_0x8059('0x2f')](function(_0x276c67){_0x38c320['count']=_0x276c67[_0x8059('0x5d')];if(_0x38c320['count']===0x0)return[];return db[_0x8059('0x9d')][_0x8059('0x41')](_0x3ccfb1[_0x8059('0x9e')](),_0x5a5c7)[_0x8059('0x2f')](function(_0x137855){_0x584e13=_[_0x8059('0x9f')](_0x137855,'id');_0x5a5c7=_[_0x8059('0xa0')](_0x5a5c7,{'model':db[_0x8059('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2980cb[_0x8059('0x41')][_0x8059('0x46')]){_0x5362b5['attributes'][_0x8059('0x6d')](function(_0xdb578){_0x21ceef['field']('i.'+_0xdb578);});}else{_0x21ceef[_0x8059('0x4b')](_0x8059('0x8d'),_0x8059('0x8e'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xa1'),'Account.key');_0x21ceef[_0x8059('0x4b')](_0x8059('0xa2'),_0x8059('0xa3'));_0x21ceef[_0x8059('0x4b')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x8059('0x90'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xa4'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xa5'),_0x8059('0xa6'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xa7'),_0x8059('0xa8'));_0x21ceef[_0x8059('0x4b')]('c.email',_0x8059('0xa9'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xaa'),_0x8059('0xab'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xac'),_0x8059('0xad'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xae'),_0x8059('0xaf'));_0x21ceef['field'](_0x8059('0xb0'),_0x8059('0xb1'));_0x21ceef[_0x8059('0x4b')](_0x8059('0xb2'),_0x8059('0xb3'));_0x21ceef[_0x8059('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x5362b5[_0x8059('0x29')])_0x21ceef['limit'](_0x5362b5['limit']);if(_0x5362b5['offset'])_0x21ceef[_0x8059('0x28')](_0x5362b5[_0x8059('0x28')]);return db[_0x8059('0x9d')][_0x8059('0x41')](_0x21ceef['toString'](),_0x5a5c7);})[_0x8059('0x2f')](function(_0x3fbf03){_0x20caa3[_0x8059('0x7a')](_0x8059('0xb4'),_[_0x8059('0x3a')](_0x3fbf03,'id'));return db[_0x8059('0x9d')]['query'](_0x20caa3[_0x8059('0x9e')](),_0x5a5c7)[_0x8059('0x2f')](function(_0x3aa43b){var _0x111e96=_[_0x8059('0xb5')](_0x3aa43b,_0x8059('0xb6'));var _0x3e2fec=[];_0x3fbf03[_0x8059('0x6d')](function(_0x15a50f){_0x3e2fec[_0x8059('0x38')](updateChatInteraction(_0x15a50f,_0x584e13,_0x111e96));});return BPromise[_0x8059('0xb7')](_0x3e2fec);});});})[_0x8059('0x2f')](function(_0xa088b){_0x38c320[_0x8059('0xb8')]=_0xa088b;return _0x38c320;})['then'](respondWithFilteredResult(_0x12c5fa,_0x5362b5))[_0x8059('0x23')](handleError(_0x12c5fa,null));};exports[_0x8059('0xb9')]=function(_0x247c9f,_0x1c1b32){var _0x5aaff4={'raw':![],'where':{'id':_0x247c9f['params']['id']}},_0x58d66f={};_0x58d66f['model']=_[_0x8059('0x42')](db[_0x8059('0x3b')][_0x8059('0x3c')]);_0x58d66f[_0x8059('0x41')]=_[_0x8059('0x42')](_0x247c9f[_0x8059('0x41')]);_0x58d66f[_0x8059('0x43')]=_[_0x8059('0x44')](_0x58d66f[_0x8059('0x40')],_0x58d66f[_0x8059('0x41')]);_0x5aaff4[_0x8059('0x45')]=_[_0x8059('0x44')](_0x58d66f['model'],qs[_0x8059('0x46')](_0x247c9f[_0x8059('0x41')][_0x8059('0x46')]));_0x5aaff4[_0x8059('0x45')]=_0x5aaff4['attributes'][_0x8059('0x5d')]?_0x5aaff4[_0x8059('0x45')]:_0x58d66f['model'];if(_0x247c9f[_0x8059('0x41')]['includeAll']){_0x5aaff4[_0x8059('0xba')]=[{'all':!![]}];}_0x5aaff4=_[_0x8059('0xa0')]({},_0x5aaff4,_0x247c9f[_0x8059('0xbb')]);return db[_0x8059('0x3b')][_0x8059('0x5f')](_0x5aaff4)[_0x8059('0x2f')](handleEntityNotFound(_0x1c1b32,null))[_0x8059('0x2f')](respondWithResult(_0x1c1b32,null))[_0x8059('0x23')](handleError(_0x1c1b32,null));};exports[_0x8059('0xbc')]=function(_0x267dd9,_0x2dfb03){return db[_0x8059('0x3b')][_0x8059('0xbc')](_0x267dd9[_0x8059('0x72')],{})[_0x8059('0x2f')](respondWithResult(_0x2dfb03,0xc9))['catch'](handleError(_0x2dfb03,null));};exports[_0x8059('0x2e')]=function(_0x597a10,_0x396e77){if(_0x597a10[_0x8059('0x72')]['id']){delete _0x597a10[_0x8059('0x72')]['id'];}return db[_0x8059('0x3b')]['find']({'where':{'id':_0x597a10[_0x8059('0xbd')]['id']}})[_0x8059('0x2f')](handleEntityNotFound(_0x396e77,null))['then'](saveUpdates(_0x597a10['body'],null))[_0x8059('0x2f')](respondWithResult(_0x396e77,null))['catch'](handleError(_0x396e77,null));};exports[_0x8059('0x30')]=function(_0x924189,_0x3464fa){return db[_0x8059('0x3b')][_0x8059('0x5f')]({'where':{'id':_0x924189['params']['id']}})['then'](handleEntityNotFound(_0x3464fa,null))['then'](removeEntity(_0x3464fa,null))['catch'](handleError(_0x3464fa,null));};exports[_0x8059('0xbe')]=function(_0x30fa8e,_0x3741b9){return db['ChatInteraction'][_0x8059('0xbe')]()[_0x8059('0x2f')](respondWithResult(_0x3741b9,null))[_0x8059('0x23')](handleError(_0x3741b9,null));};exports[_0x8059('0xbf')]=function(_0x39dd43,_0x57633f){var _0x4dec29=_0x39dd43['params']['id'];var _0x13f867;var _0xe6758c;var _0x11b71b;return db[_0x8059('0x3b')]['findOne']({'where':{'id':_0x4dec29}})['then'](function(_0x5282b2){_0x13f867=_0x5282b2;return db[_0x8059('0xc0')][_0x8059('0xc1')]({'where':{'id':_0x5282b2['ChatWebsiteId']},'attributes':['id',_0x8059('0xc2'),_0x8059('0xc3')],'raw':!![]});})[_0x8059('0x2f')](function(_0x21fc4b){if(_0x21fc4b&&_0x21fc4b['vidaooApiKey']&&_0x21fc4b[_0x8059('0xc3')]){_0xe6758c=_0x21fc4b;var _0x2823d7={'rejectUnauthorized':![],'method':_0x8059('0xc4'),'uri':_0x8059('0xc5'),'headers':{'X-APIKEY':_0x21fc4b[_0x8059('0xc2')]},'body':{'name':_0x8059('0xc6')+_0x4dec29},'redirect':_0x8059('0xc7'),'json':!![]};return rp(_0x2823d7);}else{throw new db[(_0x8059('0x89'))][(_0x8059('0xc8'))](_0x8059('0xc9'));}})[_0x8059('0x2f')](function(_0x1e5ff8){_0x11b71b=_0x1e5ff8;if(_0x11b71b['id']){var _0x28ed70={'body':_0x11b71b['join_url'],'ChatWebsiteId':_0xe6758c['id'],'ChatInteractionId':_0x13f867['id'],'direction':'out','UserId':_0x39dd43['user']['id']};return db[_0x8059('0xca')][_0x8059('0xbc')](_0x28ed70,{});}else{throw new db[(_0x8059('0x89'))][(_0x8059('0xc8'))](_0x8059('0xcb'));}})[_0x8059('0x2f')](function(){return _0x13f867[_0x8059('0xcc')]({'vidaooSessionId':_0x11b71b['id']});})[_0x8059('0x2f')](respondWithResult(_0x57633f,null))[_0x8059('0x23')](handleError(_0x57633f,null));};exports[_0x8059('0xcd')]=function(_0x3819b8,_0x5aceac){if(_0x3819b8['body']['id']){delete _0x3819b8[_0x8059('0x72')]['id'];}return db['ChatInteraction'][_0x8059('0x5f')]({'where':{'id':_0x3819b8[_0x8059('0xbd')]['id']}})[_0x8059('0x2f')](handleEntityNotFound(_0x5aceac,null))[_0x8059('0x2f')](saveUpdates(_0x3819b8[_0x8059('0x72')],null))[_0x8059('0x2f')](respondWithResult(_0x5aceac,null))['catch'](handleError(_0x5aceac,null));};exports[_0x8059('0xce')]=function(_0x109e26,_0x373d0b,_0x3a5e9a){if(_0x109e26[_0x8059('0x72')]['id']){delete _0x109e26[_0x8059('0x72')]['id'];}return db[_0x8059('0x3b')][_0x8059('0x5f')]({'where':{'id':_0x109e26[_0x8059('0xbd')]['id']}})[_0x8059('0x2f')](function(_0xe04499){if(!_0xe04499){logger[_0x8059('0x20')](_0x8059('0xcf'),_0x8059('0xce'),0x194,'entity\x20not\x20found');_0x373d0b[_0x8059('0x31')](0x194);}else{if(_0xe04499['UserId']){throw new db['Sequelize']['ValidationError'](_0x8059('0xd0'));}}return _0xe04499;})['then'](function(_0x34d821){if(_0x34d821){return _0x34d821['update']({'closed':_0x109e26[_0x8059('0x72')][_0x8059('0xd1')],'disposition':_0x109e26[_0x8059('0x72')][_0x8059('0xd2')]})[_0x8059('0x2f')](function(_0x457e49){return _0x457e49;});}})[_0x8059('0x2f')](function(_0x5217ab){return respondWithRpcPromise(_0x8059('0xd3'),'abandon',_0x109e26['body'],client9004);})['then'](respondWithResult(_0x373d0b,null))['catch'](handleError(_0x373d0b,null));};exports[_0x8059('0xd4')]=function(_0x417ba6,_0xeb9f3a,_0x3b3cfe){_0x417ba6[_0x8059('0x72')][_0x8059('0x33')]=_0x417ba6['file'][_0x8059('0xd5')];_0x417ba6[_0x8059('0x72')][_0x8059('0xd6')]=_0x417ba6[_0x8059('0xd7')][_0x8059('0xd8')];_0x417ba6[_0x8059('0x72')]['type']=_0x417ba6[_0x8059('0xd7')][_0x8059('0xd9')];return db['Attachment'][_0x8059('0xbc')](_0x417ba6[_0x8059('0x72')])[_0x8059('0x2f')](respondWithResult(_0xeb9f3a,0xc9))[_0x8059('0x23')](handleError(_0xeb9f3a,null));};exports[_0x8059('0xda')]=function(_0x53bf3d,_0x35cbf0,_0x5f1f){return db[_0x8059('0x3b')][_0x8059('0xc1')]({'where':{'id':_0x53bf3d['params']['id']},'raw':!![]})[_0x8059('0x2f')](handleEntityNotFound(_0x35cbf0,null))[_0x8059('0x2f')](function(_0x556e15){if(_0x556e15){if(_0x556e15[_0x8059('0xd1')]){return _0x35cbf0[_0x8059('0x24')](0x193)[_0x8059('0x26')]({'status':0x193,'message':'Unauthorized'});}return db[_0x8059('0xdb')]['findOne']({'where':{'id':_0x53bf3d[_0x8059('0x41')][_0x8059('0xdc')]},'raw':!![]})[_0x8059('0x2f')](handleEntityNotFound(_0x35cbf0,null));}})[_0x8059('0x2f')](function(_0x3d8049){if(_0x3d8049){return _0x35cbf0['download'](path[_0x8059('0xdd')](config['root'],_0x8059('0xde'),_0x3d8049[_0x8059('0xd6')]));}})[_0x8059('0x23')](handleError(_0x35cbf0,null));};exports[_0x8059('0xdf')]=function(_0x381b38,_0x4ce086){var _0x258479=null;var _0x48cf24=null;var _0x54a4f1=null;var _0x49fa00=null;if(_0x381b38[_0x8059('0x72')]['id']){delete _0x381b38[_0x8059('0x72')]['id'];}if(_0x381b38[_0x8059('0x72')]['mailTranscript']){_0x49fa00=path['join'](config[_0x8059('0xe0')],'server/files/chat/upload/',util['format'](_0x8059('0xe1'),Date['now']()));_0x381b38[_0x8059('0x72')][_0x8059('0xe2')]=_0x49fa00;}return db[_0x8059('0x3b')][_0x8059('0x5f')]({'where':{'id':_0x381b38[_0x8059('0xbd')]['id']},'include':[{'model':db[_0x8059('0xca')],'as':_0x8059('0xe3'),'include':[{'model':db[_0x8059('0x6f')],'as':_0x8059('0x6f')}]}]})[_0x8059('0x2f')](handleEntityNotFound(_0x4ce086,null))[_0x8059('0x2f')](saveUpdates(_0x381b38[_0x8059('0x72')],null))['then'](function(_0x9e0b23){if(_0x9e0b23){_0x258479=_0x9e0b23;return db[_0x8059('0xc0')]['find']({'where':{'id':_0x258479[_0x8059('0x75')]}});}})[_0x8059('0x2f')](function(_0x5ad5ea){if(_0x5ad5ea){_0x54a4f1=_0x5ad5ea;return db['CmContact'][_0x8059('0x5f')]({'where':{'id':_0x258479[_0x8059('0x68')]}});}})[_0x8059('0x2f')](function(_0x279857){if(_0x279857){_0x48cf24=_0x279857;if(_0x49fa00){var _0x2acfe3=null;for(var _0xdde277=0x1;_0xdde277<_0x258479['Messages']['length'];++_0xdde277){_0x2acfe3=_0x258479[_0x8059('0xe3')][_0xdde277];var _0x72fd77=_0x2acfe3[_0x8059('0x71')]?util[_0x8059('0xe4')](_0x8059('0xe5'),_0x54a4f1[_0x8059('0xe6')],_0x2acfe3[_0x8059('0x71')]):_0x8059('0xe7');var _0x4ae806=_0x381b38[_0x8059('0x72')][_0x8059('0xe8')]||util['format'](_0x8059('0xe5'),_0x8059('0xe9'),_0x2acfe3[_0x8059('0x68')]);switch(_0x54a4f1[_0x8059('0xea')]){case _0x8059('0xeb'):_0x72fd77=_0x2acfe3[_0x8059('0x71')]?util['format'](_0x8059('0xe5'),_0x54a4f1['agentAlias'],_0x2acfe3[_0x8059('0x71')]):_0x8059('0xe7');break;case _0x8059('0xec'):_0x72fd77=_0x2acfe3[_0x8059('0x71')]?_0x2acfe3[_0x8059('0x6f')][_0x8059('0xed')]||_0x2acfe3[_0x8059('0x6f')][_0x8059('0xee')]:_0x8059('0xe7');break;case _0x8059('0xef'):_0x72fd77=_0x2acfe3[_0x8059('0x71')]?_0x2acfe3[_0x8059('0x6f')][_0x8059('0xee')]:'System';break;default:_0x72fd77=_0x2acfe3[_0x8059('0x71')]?util['format'](_0x8059('0xe5'),_0x54a4f1['agentAlias'],_0x2acfe3[_0x8059('0x71')]):_0x8059('0xe7');}var _0x4250c0=util[_0x8059('0xe4')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2acfe3[_0x8059('0xf0')])[_0x8059('0xe4')](_0x8059('0xf1')),_0x2acfe3['direction']==='in'?_0x4ae806:_0x72fd77,_0x2acfe3[_0x8059('0x72')]);if(!_0x2acfe3['secret']){fs['appendFileSync'](_0x49fa00,_0x4250c0);}}return db['MailAccount'][_0x8059('0xc1')]({'where':{'service':!![]},'include':[{'model':db[_0x8059('0xf2')],'as':_0x8059('0xf3'),'raw':!![]}]});}}})['then'](function(_0x4b8496){if(_0x4b8496&&_0x4b8496[_0x8059('0xf3')]&&_0x381b38['body']){var _0x2d213b={'tls':{'rejectUnauthorized':![]}};if(_0x4b8496[_0x8059('0xf3')][_0x8059('0xf4')]){_0x2d213b[_0x8059('0xf4')]=_0x4b8496[_0x8059('0xf3')][_0x8059('0xf4')];}else{_0x2d213b['host']=_0x4b8496[_0x8059('0xf3')][_0x8059('0xf5')];_0x2d213b[_0x8059('0xf6')]=_0x4b8496[_0x8059('0xf3')]['port'];_0x2d213b[_0x8059('0xf7')]=_0x4b8496[_0x8059('0xf3')][_0x8059('0xf7')];}if(_0x4b8496[_0x8059('0xf3')]['authentication']){_0x2d213b[_0x8059('0xf8')]={'user':_0x4b8496['Smtp'][_0x8059('0x97')],'pass':_0x4b8496[_0x8059('0xf3')]['pass']};}return respondWithRpcPromise(_0x8059('0xf9'),_0x8059('0xfa'),{'account':_0x2d213b,'message':{'from':util[_0x8059('0xe4')](_0x8059('0xfb'),_0x4b8496[_0x8059('0x33')],_0x4b8496[_0x8059('0xfc')]||_0x4b8496[_0x8059('0xf3')][_0x8059('0x97')]),'to':_0x381b38[_0x8059('0x72')][_0x8059('0xfd')],'subject':'Mail\x20Transcript','text':util[_0x8059('0xe4')](_0x8059('0xfe'),_0x381b38[_0x8059('0x72')][_0x8059('0xfd')]),'attachments':[{'path':_0x49fa00}]}})[_0x8059('0x2f')](function(){return _0x258479;})['catch'](function(_0x4198d6){console['error'](_0x4198d6);});}else{return _0x258479;}})['then'](respondWithStatusCode(_0x4ce086,0xc8))['catch'](handleError(_0x4ce086,null));};exports[_0x8059('0xff')]=function(_0x2a863b,_0x173efd,_0x11b68e){return db[_0x8059('0xca')][_0x8059('0x5f')]({'where':{'id':_0x2a863b[_0x8059('0xbd')]['id']}})['then'](handleEntityNotFound(_0x173efd,null))[_0x8059('0x2f')](function(_0x2039b7){if(_0x2039b7){return _0x2039b7[_0x8059('0xff')](_0x2a863b[_0x8059('0x72')][_0x8059('0x100')],_[_0x8059('0x101')](_0x2a863b['body'],[_0x8059('0x100'),'id'])||{});}})[_0x8059('0x2f')](respondWithResult(_0x173efd,null))[_0x8059('0x23')](handleError(_0x173efd,null));};exports[_0x8059('0x102')]=function(_0x20373b,_0x2088d9,_0x3c5599){var _0x59e7e4={'raw':![],'where':{}};var _0x31c971={};var _0x3804d4={'count':0x0,'rows':[]};return db[_0x8059('0x3b')][_0x8059('0xc1')]({'where':{'id':_0x20373b[_0x8059('0xbd')]['id']}})[_0x8059('0x2f')](handleEntityNotFound(_0x2088d9,null))[_0x8059('0x2f')](function(_0x46c19b){if(_0x46c19b){_0x31c971[_0x8059('0x40')]=_[_0x8059('0x42')](db[_0x8059('0xca')][_0x8059('0x3c')]);_0x31c971['query']=_[_0x8059('0x42')](_0x20373b[_0x8059('0x41')]);_0x31c971[_0x8059('0x43')]=_['intersection'](_0x31c971['model'],_0x31c971['query']);_0x59e7e4[_0x8059('0x45')]=_[_0x8059('0x44')](_0x31c971['model'],qs[_0x8059('0x46')](_0x20373b['query'][_0x8059('0x46')]));_0x59e7e4[_0x8059('0x45')]=_0x59e7e4[_0x8059('0x45')][_0x8059('0x5d')]?_0x59e7e4[_0x8059('0x45')]:_0x31c971['model'];if(!_0x20373b['query'][_0x8059('0x47')]('nolimit')){_0x59e7e4[_0x8059('0x29')]=qs[_0x8059('0x29')](_0x20373b[_0x8059('0x41')][_0x8059('0x29')]);_0x59e7e4[_0x8059('0x28')]=qs[_0x8059('0x28')](_0x20373b['query'][_0x8059('0x28')]);}_0x59e7e4[_0x8059('0x8f')]=qs['sort'](_0x20373b[_0x8059('0x41')][_0x8059('0x48')]);_0x59e7e4['where']=qs['filters'](_[_0x8059('0x49')](_0x20373b['query'],_0x31c971[_0x8059('0x43')]));_0x59e7e4[_0x8059('0x7a')][_0x8059('0xb6')]=_0x46c19b['id'];if(_0x20373b[_0x8059('0x41')][_0x8059('0x83')]){_0x59e7e4[_0x8059('0x7a')]=_[_0x8059('0xa0')](_0x59e7e4['where'],{'$or':_['map'](_0x59e7e4[_0x8059('0x45')],function(_0x1462e5){var _0x5a3edb={};_0x5a3edb[_0x1462e5]={'$like':'%'+_0x20373b[_0x8059('0x41')]['filter']+'%'};return _0x5a3edb;})});}if(_0x20373b[_0x8059('0x41')][_0x8059('0x78')]){var _0x281605=_0x20373b[_0x8059('0x41')][_0x8059('0x78')][_0x8059('0x65')](',');var _0x4a923f={};_0x4a923f[_0x281605[0x0]]={'$gte':moment(_0x281605[0x1])['format'](_0x8059('0x103'))};_0x59e7e4['where']=_[_0x8059('0xa0')](_0x59e7e4[_0x8059('0x7a')],_0x4a923f);}_0x59e7e4=_[_0x8059('0xa0')]({},_0x59e7e4,_0x20373b[_0x8059('0xbb')]);return db['ChatMessage']['count']({'where':_0x59e7e4[_0x8059('0x7a')]})[_0x8059('0x2f')](function(_0x3a95f5){_0x3804d4[_0x8059('0x27')]=_0x3a95f5;if(_0x20373b['query']['includeAll']){_0x59e7e4[_0x8059('0xba')]=[{'all':!![]}];}return db[_0x8059('0xca')][_0x8059('0x104')](_0x59e7e4);})['then'](function(_0x3273b7){_0x3804d4[_0x8059('0xb8')]=_0x3273b7;return _0x3804d4;});}})[_0x8059('0x2f')](respondWithFilteredResult(_0x2088d9,_0x59e7e4))[_0x8059('0x23')](handleError(_0x2088d9,null));};exports[_0x8059('0x105')]=function(_0x561503,_0x37ad2d,_0x3334d6){var _0xa006fc={'where':{}},_0x42d9fd={},_0x3462aa={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8059('0xc1')]({'where':{'id':_0x561503[_0x8059('0xbd')]['id']}})[_0x8059('0x2f')](handleEntityNotFound(_0x37ad2d,null))[_0x8059('0x2f')](function(_0x38848c){if(_0x38848c){_0x42d9fd['model']=_[_0x8059('0x42')](db[_0x8059('0xca')][_0x8059('0x3c')]);_0x42d9fd[_0x8059('0x41')]=_[_0x8059('0x42')](_0x561503[_0x8059('0x41')]);_0x42d9fd[_0x8059('0x43')]=_[_0x8059('0x44')](_0x42d9fd[_0x8059('0x40')],_0x42d9fd['query']);_0xa006fc[_0x8059('0x45')]=_[_0x8059('0x44')](_0x42d9fd[_0x8059('0x40')],qs[_0x8059('0x46')](_0x561503[_0x8059('0x41')][_0x8059('0x46')]));_0xa006fc[_0x8059('0x45')]=_0xa006fc[_0x8059('0x45')][_0x8059('0x5d')]?_0xa006fc[_0x8059('0x45')]:_0x42d9fd[_0x8059('0x40')];if(!_0x561503[_0x8059('0x41')][_0x8059('0x47')](_0x8059('0x106'))){_0xa006fc[_0x8059('0x29')]=qs[_0x8059('0x29')](_0x561503['query']['limit']);_0xa006fc[_0x8059('0x28')]=qs['offset'](_0x561503[_0x8059('0x41')][_0x8059('0x28')]);}_0xa006fc['order']=qs[_0x8059('0x48')](_0x561503[_0x8059('0x41')][_0x8059('0x48')]);_0xa006fc['where']=qs[_0x8059('0x43')](_[_0x8059('0x49')](_0x561503[_0x8059('0x41')],_0x42d9fd[_0x8059('0x43')]));_0xa006fc[_0x8059('0x7a')][_0x8059('0xb6')]=_0x38848c['id'];if(_0x561503[_0x8059('0x41')][_0x8059('0x83')]){_0xa006fc['where']=_[_0x8059('0xa0')](_0xa006fc[_0x8059('0x7a')],{'$or':_[_0x8059('0x3a')](_0xa006fc[_0x8059('0x45')],function(_0x5d353a){var _0x43e61e={};_0x43e61e[_0x5d353a]={'$like':'%'+_0x561503['query'][_0x8059('0x83')]+'%'};return _0x43e61e;})});}_0xa006fc[_0x8059('0x7a')][_0x8059('0x107')]=![];if(_0x561503[_0x8059('0x41')]['id']){_0xa006fc[_0x8059('0x7a')]['id']={'$gt':_0x561503[_0x8059('0x41')]['id']};}_0xa006fc=_[_0x8059('0xa0')]({},_0xa006fc,_0x561503[_0x8059('0xbb')]);return db[_0x8059('0xca')]['count']({'where':_0xa006fc['where']})['then'](function(_0x4e4c9c){_0x3462aa[_0x8059('0x27')]=_0x4e4c9c;_0xa006fc['include']=[];if(_0x561503[_0x8059('0x41')][_0x8059('0x108')]){_0xa006fc[_0x8059('0xba')][_0x8059('0x38')]({'model':db[_0x8059('0x6f')],'as':'User','attributes':['id',_0x8059('0xee'),_0x8059('0xed')]});}if(_0x561503['query'][_0x8059('0x109')]){_0xa006fc['include']=[{'all':!![]}];}return db[_0x8059('0xca')]['findAll'](_0xa006fc);})[_0x8059('0x2f')](function(_0x5d1c3a){_0x3462aa[_0x8059('0xb8')]=_0x5d1c3a;return _0x3462aa;});}})[_0x8059('0x2f')](respondWithFilteredResult(_0x37ad2d,_0xa006fc))[_0x8059('0x23')](handleError(_0x37ad2d,null));};exports[_0x8059('0x10a')]=function(_0x371bd7,_0x29782b,_0x5ab520){return db[_0x8059('0x3b')][_0x8059('0x5f')]({'where':{'id':_0x371bd7[_0x8059('0xbd')]['id']}})['then'](handleEntityNotFound(_0x29782b,null))['then'](function(_0x4caca7){if(_0x4caca7){return _0x4caca7[_0x8059('0x10b')](_0x371bd7['body'][_0x8059('0x100')],_[_0x8059('0x101')](_0x371bd7[_0x8059('0x72')],[_0x8059('0x100'),'id'])||{})[_0x8059('0x10c')](function(){return db[_0x8059('0x6c')][_0x8059('0x104')]({'attributes':['id',_0x8059('0x33'),_0x8059('0x10d')],'where':{'id':_0x371bd7[_0x8059('0x72')][_0x8059('0x100')]}});})['then'](function(_0x3f6b10){socket['emit'](_0x8059('0x10e'),{'id':Number(_0x371bd7[_0x8059('0xbd')]['id']),'tags':_0x3f6b10||[]});return{'id':Number(_0x371bd7[_0x8059('0xbd')]['id']),'tags':_0x3f6b10||[]};});}})[_0x8059('0x2f')](respondWithResult(_0x29782b,null))['catch'](handleError(_0x29782b,null));};exports['removeTags']=function(_0x5b9874,_0x2288cb,_0x39741f){return db[_0x8059('0x3b')][_0x8059('0x5f')]({'where':{'id':_0x5b9874[_0x8059('0xbd')]['id']}})[_0x8059('0x2f')](handleEntityNotFound(_0x2288cb,null))[_0x8059('0x2f')](function(_0x2c945f){if(_0x2c945f){return _0x2c945f[_0x8059('0x10f')](_0x5b9874[_0x8059('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x2288cb,null))['catch'](handleError(_0x2288cb,null));};exports[_0x8059('0x110')]=function(_0x1fd4cd,_0x4cf7fa){var _0x2d5f75=moment()[_0x8059('0x111')]()['toString']();var _0x405af0=path['join'](config[_0x8059('0xe0')],_0x8059('0x112'),_0x8059('0x113'),_0x8059('0x114'));var _0x19607d=path['join'](config[_0x8059('0xe0')],_0x8059('0x112'),_0x8059('0x113'),'attachments');var _0xb3101c=path[_0x8059('0xdd')](_0x405af0,_0x2d5f75);var _0x36cc44=util[_0x8059('0xe4')](_0x8059('0x115'),_0x1fd4cd[_0x8059('0xbd')]['id'],_0x2d5f75);var _0x566258=path['join'](_0x405af0,_0x36cc44);var _0x46ddb9=[];_0x46ddb9[_0x8059('0x38')]({'model':db[_0x8059('0x6f')],'as':_0x8059('0x6f'),'attributes':['id','fullname'],'raw':!![]});_0x46ddb9[_0x8059('0x38')]({'model':db[_0x8059('0x116')],'as':_0x8059('0x117'),'attributes':['id','firstName',_0x8059('0x118')],'raw':!![]});if(_0x1fd4cd['query']['attachments']){_0x46ddb9[_0x8059('0x38')]({'model':db[_0x8059('0xdb')],'as':_0x8059('0xdb'),'raw':!![]});}var _0x149088=[{'model':db['ChatMessage'],'as':_0x8059('0xe3'),'attributes':['id','body',_0x8059('0xf0'),'direction',_0x8059('0x107'),_0x8059('0x7f')],'include':_0x46ddb9}];_0x149088[_0x8059('0x38')]({'model':db[_0x8059('0xc0')],'as':_0x8059('0x119'),'attributes':['id','name']});_0x149088['push']({'model':db[_0x8059('0x6f')],'as':_0x8059('0x11a'),'attributes':['id','fullname']});return db[_0x8059('0x3b')][_0x8059('0x5f')]({'where':{'id':_0x1fd4cd[_0x8059('0xbd')]['id']},'include':_0x149088})['then'](handleEntityNotFound(_0x4cf7fa,null))[_0x8059('0x2f')](function(_0x1e5ea4){if(_0x1e5ea4){var _0x4bbf2b=_0x1e5ea4[_0x8059('0x11b')]({'plain':!![]});fs['mkdirSync'](_0xb3101c);var _0x47ab82={'format':'A4','border':_0x8059('0x11c'),'header':{'height':_0x8059('0x11d'),'contents':{'first':_0x8059('0x11e')}},'footer':{'height':_0x8059('0x11f'),'contents':{'default':util['format'](_0x8059('0x120'),util[_0x8059('0xe4')](_0x8059('0x121'),_0x8059('0x122'),_0x4bbf2b['id']),moment()[_0x8059('0xe4')](_0x8059('0x123'))[_0x8059('0x9e')]())}}};var _0x370967={'channel':_0x8059('0x122'),'account':_0x4bbf2b[_0x8059('0x119')][_0x8059('0x33')],'agent':_0x4bbf2b['Owner']?_0x4bbf2b['Owner'][_0x8059('0xee')]:_0x8059('0x124'),'createdAt':moment(_0x4bbf2b['createdAt'])[_0x8059('0xe4')](_0x8059('0x103'))[_0x8059('0x9e')](),'closedAt':_0x4bbf2b[_0x8059('0xd1')]?moment(_0x4bbf2b[_0x8059('0x125')])[_0x8059('0xe4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8059('0x9e')]():'','disposition':_0x4bbf2b[_0x8059('0xd2')],'chatInfo':{'browser':_0x4bbf2b[_0x8059('0x126')],'os':_0x4bbf2b[_0x8059('0x127')],'referer':_0x4bbf2b['referer'],'customerIp':_0x4bbf2b['customerIp'],'customerPort':_0x4bbf2b['customerPort']?_0x4bbf2b[_0x8059('0x128')]:_0x8059('0x124')},'messages':_(_0x4bbf2b[_0x8059('0xe3')])[_0x8059('0x129')]()[_0x8059('0x83')]({'secret':![]})[_0x8059('0x3a')](function(_0x31d300){if(_0x31d300['Attachment']){var _0x1eab02=path[_0x8059('0xdd')](_0x19607d,_0x31d300[_0x8059('0xdb')][_0x8059('0xd6')]);if(fs[_0x8059('0x12a')](_0x1eab02)){fs[_0x8059('0x12b')](_0x1eab02)[_0x8059('0x12c')](fs[_0x8059('0x12d')](path[_0x8059('0xdd')](_0xb3101c,_0x31d300['Attachment'][_0x8059('0xd6')])));}}return{'date':moment(_0x31d300[_0x8059('0xf0')])[_0x8059('0xe4')](_0x8059('0x103'))['toString'](),'sender':_0x31d300[_0x8059('0x12e')]===_0x8059('0x12f')?_0x31d300['User']?_0x31d300[_0x8059('0x6f')][_0x8059('0xee')]:'System':_0x31d300['Contact'][_0x8059('0x130')]+(_0x31d300[_0x8059('0x117')][_0x8059('0x118')]?'\x20'+_0x31d300['Contact'][_0x8059('0x118')]:''),'body':_0x31d300[_0x8059('0xdb')]?_0x31d300[_0x8059('0xdb')][_0x8059('0xd6')]:_0x31d300[_0x8059('0x72')],'direction':_0x31d300[_0x8059('0x12e')]===_0x8059('0x12f')?'A':'C','secret':_0x31d300['secret'],'read':_0x31d300['read'],'attachment':_0x31d300[_0x8059('0xdb')]};})[_0x8059('0x60')]()};return ejs['renderFile'](path[_0x8059('0xdd')](config[_0x8059('0xe0')],_0x8059('0x112'),'views','downloadInteraction.html'),{'interaction':_0x370967})['then'](function(_0x469c93){return new BPromise(function(_0x4ff4fb,_0x548293){pdf[_0x8059('0xbc')](_0x469c93,_0x47ab82)[_0x8059('0x131')](path[_0x8059('0xdd')](_0xb3101c,_0x8059('0x132')+_0x4bbf2b['id']+'-'+_0x2d5f75+_0x8059('0x133')),function(_0x1e36a3,_0xb53796){if(_0x1e36a3)return _0x548293(_0x1e36a3);_0x4ff4fb(_0xb53796);});});})[_0x8059('0x2f')](function(){return new BPromise(function(_0x2b3ae4,_0x58a00c){zipdir(_0xb3101c,{'saveTo':_0x566258},function(_0x1d612c,_0x452145){if(_0x1d612c)return _0x58a00c(_0x1d612c);return _0x2b3ae4(_0x452145);});})['then'](function(){return new BPromise(function(_0x19df7a,_0x138e3a){rimraf(_0xb3101c,function(_0x446b0d){if(_0x446b0d)_0x138e3a(_0x446b0d);return _0x19df7a();});});})[_0x8059('0x2f')](function(){return _0x4cf7fa['download'](_0x566258,_0x36cc44,function(_0x32eba7){if(_0x32eba7){console[_0x8059('0x134')](_0x8059('0x135'),_0x32eba7);}else{fs['unlinkSync'](_0x566258);}});});});}else{return _0x4cf7fa['sendStatus'](0xc8);}})[_0x8059('0x23')](handleError(_0x4cf7fa,null));};
\ No newline at end of file
+var _0xc2a2=['Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','includeAll','merge','options','create','update','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','MotionCWB:','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','file','originalname','mimetype','Attachment','attachmentDownload','attachId','download','root','server/files/attachments/','basename','close','join','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','System','customer','Visitor','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','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','getMessages','hasOwnProperty','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','direction','Account','10px','\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
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','
\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\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
\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%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
\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
\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{{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
\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
\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%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
\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
','%s\x20#%d','Chat','YYYY-MM-DD','Owner','closedAt','browserName','osName','referer','customerPort','N.A.','existsSync','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','pick','filters','field','color','from','select','u.id','user_has_chat_interactions','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','ChatWebsiteId','createdAt','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','user','agent','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.mobile'];(function(_0x40d5cc,_0xf9d2c7){var _0x6950af=function(_0x295221){while(--_0x295221){_0x40d5cc['push'](_0x40d5cc['shift']());}};_0x6950af(++_0xf9d2c7);}(_0xc2a2,0x84));var _0x2c2a=function(_0x36bf50,_0x4fbf4e){_0x36bf50=_0x36bf50-0x0;var _0x35babc=_0xc2a2[_0x36bf50];return _0x35babc;};'use strict';var pdf=require(_0x2c2a('0x0'));var emlformat=require(_0x2c2a('0x1'));var rimraf=require(_0x2c2a('0x2'));var zipdir=require(_0x2c2a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c2a('0x4'));var moment=require(_0x2c2a('0x5'));var BPromise=require(_0x2c2a('0x6'));var Mustache=require('mustache');var util=require(_0x2c2a('0x7'));var path=require(_0x2c2a('0x8'));var sox=require(_0x2c2a('0x9'));var csv=require(_0x2c2a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c2a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c2a('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c2a('0xd'));var authService=require(_0x2c2a('0xe'));var qs=require(_0x2c2a('0xf'));var as=require(_0x2c2a('0x10'));var hardwareService=require(_0x2c2a('0x11'));var logger=require(_0x2c2a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2c2a('0x13'));var licenseUtil=require(_0x2c2a('0x14'));var db=require(_0x2c2a('0x15'))['db'];config[_0x2c2a('0x16')]=_[_0x2c2a('0x17')](config[_0x2c2a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c2a('0x18'))(new Redis(config[_0x2c2a('0x16')]));require('./chatInteraction.socket')[_0x2c2a('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2c2a('0x1a')]['http']({'port':0x232b});var client9004=jayson[_0x2c2a('0x1a')][_0x2c2a('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x523692,_0x10b98e,_0x1c9a04,_0x250d08){return new BPromise(function(_0x7af854,_0x93d544){var _0x14486f=_0x250d08||client;return _0x14486f['request'](_0x523692,_0x1c9a04)['then'](function(_0x4149e2){logger['info'](_0x2c2a('0x1c'),_0x10b98e,_0x2c2a('0x1d'));logger[_0x2c2a('0x1e')](_0x2c2a('0x1f'),_0x10b98e,_0x2c2a('0x1d'),JSON[_0x2c2a('0x20')](_0x4149e2));if(_0x4149e2[_0x2c2a('0x21')]){if(_0x4149e2[_0x2c2a('0x21')][_0x2c2a('0x22')]===0x1f4){logger[_0x2c2a('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x10b98e,_0x4149e2[_0x2c2a('0x21')]['message']);return _0x93d544(_0x4149e2[_0x2c2a('0x21')][_0x2c2a('0x23')]);}logger['error'](_0x2c2a('0x1c'),_0x10b98e,_0x4149e2[_0x2c2a('0x21')][_0x2c2a('0x23')]);return _0x7af854(_0x4149e2['error'][_0x2c2a('0x23')]);}else{logger[_0x2c2a('0x24')](_0x2c2a('0x1c'),_0x10b98e,_0x2c2a('0x1d'));_0x7af854(_0x4149e2[_0x2c2a('0x25')][_0x2c2a('0x23')]);}})[_0x2c2a('0x26')](function(_0x459aee){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x10b98e,_0x459aee);_0x93d544(_0x459aee);});});}function respondWithStatusCode(_0x5afa5f,_0x5b0530){_0x5b0530=_0x5b0530||0xcc;return function(_0x35f048){if(_0x35f048){return _0x5afa5f[_0x2c2a('0x27')](_0x5b0530);}return _0x5afa5f[_0x2c2a('0x28')](_0x5b0530)[_0x2c2a('0x29')]();};}function respondWithResult(_0x39e3d6,_0x43239d){_0x43239d=_0x43239d||0xc8;return function(_0x51b536){if(_0x51b536){return _0x39e3d6['status'](_0x43239d)[_0x2c2a('0x2a')](_0x51b536);}};}function respondWithFilteredResult(_0x1d907f,_0x10e371){return function(_0x27dc1b){if(_0x27dc1b){var _0x5c2fbb=_0x27dc1b[_0x2c2a('0x2b')],_0xe8bd4b=_0x10e371[_0x2c2a('0x2c')],_0x735b1b=_0x10e371[_0x2c2a('0x2c')]+_0x10e371[_0x2c2a('0x2d')],_0x134a64;if(_0x735b1b>=_0x5c2fbb){_0x735b1b=_0x5c2fbb;_0x134a64=0xc8;}else{_0x134a64=0xce;}_0x1d907f[_0x2c2a('0x28')](_0x134a64);return _0x1d907f[_0x2c2a('0x2e')](_0x2c2a('0x2f'),_0xe8bd4b+'-'+_0x735b1b+'/'+_0x5c2fbb)[_0x2c2a('0x2a')](_0x27dc1b);}return null;};}function patchUpdates(_0x19a2f6){return function(_0x3fa5e7){try{jsonpatch[_0x2c2a('0x30')](_0x3fa5e7,_0x19a2f6,!![]);}catch(_0x570152){return BPromise[_0x2c2a('0x31')](_0x570152);}return _0x3fa5e7[_0x2c2a('0x32')]();};}function saveUpdates(_0x19b86f,_0x42db35){return function(_0x10f66f){if(_0x10f66f){return _0x10f66f['update'](_0x19b86f)[_0x2c2a('0x33')](function(_0x307c07){return _0x307c07;});}return null;};}function removeEntity(_0x51536b,_0x1c734c){return function(_0x4d94f2){if(_0x4d94f2){return _0x4d94f2[_0x2c2a('0x34')]()[_0x2c2a('0x33')](function(){_0x51536b[_0x2c2a('0x28')](0xcc)[_0x2c2a('0x29')]();});}};}function handleEntityNotFound(_0x1d3152,_0x39d341){return function(_0x3ff77b){if(!_0x3ff77b){_0x1d3152['sendStatus'](0x194);}return _0x3ff77b;};}function handleError(_0x3e9678,_0x385a19){_0x385a19=_0x385a19||0x1f4;return function(_0x231a98){logger['error'](_0x231a98['stack']);if(_0x231a98[_0x2c2a('0x35')]){delete _0x231a98['name'];}_0x3e9678[_0x2c2a('0x28')](_0x385a19)[_0x2c2a('0x36')](_0x231a98);};}function getInteractionUsers(_0x126730,_0x3e6b12){return new BPromise(function(_0x223302,_0x4e4130){try{if(_0x3e6b12[_0x126730['id']]){_0x126730[_0x2c2a('0x37')]=_[_0x2c2a('0x38')](_0x3e6b12[_0x126730['id']],function(_0x439aad){return{'id':_0x439aad['id'],'fullname':_0x439aad[_0x2c2a('0x39')]};});}}catch(_0x38e289){_0x4e4130(_0x38e289);}_0x223302(_0x126730);});}function getInteractionTags(_0x25eec5,_0x10452e){return new BPromise(function(_0x3adb1f,_0x2e7061){try{if(_0x25eec5[_0x2c2a('0x3a')]){_0x25eec5['Tags']=[];_0x25eec5['TagIds'][_0x2c2a('0x3b')](',')[_0x2c2a('0x3c')](function(_0x3c38ed){_0x25eec5[_0x2c2a('0x3d')][_0x2c2a('0x3e')](_0x10452e[_0x3c38ed]);});}delete _0x25eec5[_0x2c2a('0x3a')];}catch(_0x5d4fc4){_0x2e7061(_0x5d4fc4);}_0x3adb1f(_0x25eec5);});}function updateChatInteraction(_0x57e2a4,_0x46928,_0x8eadc3){return new BPromise(function(_0x2589b9,_0x42d135){return getInteractionUsers(_0x57e2a4,_0x8eadc3)[_0x2c2a('0x33')](function(_0x178269){return getInteractionTags(_0x178269,_0x46928);})[_0x2c2a('0x33')](function(_0x1b9ab3){_0x2589b9(_0x1b9ab3);})[_0x2c2a('0x26')](function(_0xa05230){_0x42d135(_0xa05230);});});}exports['index']=function(_0x87a74,_0x5ab83d){var _0x349f9b={},_0x3e339f={},_0x3d6ba6={'count':0x0,'rows':[]};var _0x381b6d=_['map'](db[_0x2c2a('0x3f')][_0x2c2a('0x40')],function(_0x5706f2){return{'name':_0x5706f2[_0x2c2a('0x41')],'type':_0x5706f2[_0x2c2a('0x42')][_0x2c2a('0x43')]};});_0x3e339f[_0x2c2a('0x44')]=_[_0x2c2a('0x38')](_0x381b6d,_0x2c2a('0x35'));_0x3e339f[_0x2c2a('0x45')]=_[_0x2c2a('0x46')](_0x87a74['query']);_0x3e339f['filters']=_[_0x2c2a('0x47')](_0x3e339f['model'],_0x3e339f[_0x2c2a('0x45')]);_0x349f9b['attributes']=_[_0x2c2a('0x47')](_0x3e339f['model'],qs[_0x2c2a('0x48')](_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x48')]));_0x349f9b[_0x2c2a('0x49')]=_0x349f9b['attributes']['length']?_0x349f9b[_0x2c2a('0x49')]:_0x3e339f['model'];if(!_0x87a74[_0x2c2a('0x45')]['hasOwnProperty'](_0x2c2a('0x4a'))){_0x349f9b[_0x2c2a('0x2d')]=qs['limit'](_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x2d')]);_0x349f9b['offset']=qs['offset'](_0x87a74[_0x2c2a('0x45')]['offset']);}_0x349f9b[_0x2c2a('0x4b')]=qs[_0x2c2a('0x4c')](_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x4c')]);_0x349f9b['where']=qs['filters'](_[_0x2c2a('0x4d')](_0x87a74[_0x2c2a('0x45')],_0x3e339f[_0x2c2a('0x4e')]),_0x381b6d);var _0x2030b7=[];var _0x5370cc=squel['select']()[_0x2c2a('0x4f')]('id')['field'](_0x2c2a('0x35'))['field'](_0x2c2a('0x50'))[_0x2c2a('0x51')]('tools_tags');var _0x4e2602=squel[_0x2c2a('0x52')]()[_0x2c2a('0x4f')](_0x2c2a('0x53'))[_0x2c2a('0x4f')]('u.fullname')[_0x2c2a('0x4f')]('ui.ChatInteractionId')[_0x2c2a('0x51')](_0x2c2a('0x54'),'ui')['left_join']('users','u',_0x2c2a('0x55'));var _0x3b3dec=squel[_0x2c2a('0x52')]()[_0x2c2a('0x51')](_0x2c2a('0x56'),'i')[_0x2c2a('0x57')](_0x2c2a('0x58'),'c',_0x2c2a('0x59'))['left_join'](_0x2c2a('0x5a'),'o',_0x2c2a('0x5b'))['left_join'](_0x2c2a('0x5c'),'a',_0x2c2a('0x5d'))[_0x2c2a('0x57')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0x2c2a('0x5e'),'it',_0x2c2a('0x5f'))[_0x2c2a('0x57')](_0x2c2a('0x60'),'t','t.id\x20=\x20it.TagId');var _0x1702d2=squel[_0x2c2a('0x61')]();var _0x15c1af=[];var _0x4f1bed=squel[_0x2c2a('0x61')]();var _0x5eca2d;if(_0x87a74['query'][_0x2c2a('0x62')]){_0x5eca2d=as[_0x2c2a('0x63')](_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x62')]);var _0x157967=_0x5eca2d[_0x2c2a('0x64')];for(var _0x5b65be=0x0;_0x5b65be<_0x5eca2d[_0x2c2a('0x65')][_0x2c2a('0x66')];_0x5b65be++){var _0x106de3=_0x5eca2d[_0x2c2a('0x65')][_0x5b65be];var _0x3b243f='i';var _0x2f2529=_[_0x2c2a('0x67')](_0x381b6d,[_0x2c2a('0x35'),_0x106de3[_0x2c2a('0x4f')]]);if(!_0x2f2529){switch(_0x106de3[_0x2c2a('0x4f')]){case _0x2c2a('0x68'):if(_0x106de3['value']==0x1){_0x3b3dec[_0x2c2a('0x69')]('`'+_0x106de3['field']+_0x2c2a('0x6a'));}else{_0x3b3dec[_0x2c2a('0x69')]('`'+_0x106de3[_0x2c2a('0x4f')]+'`\x20>\x200');}break;case'Contact':if(_0x106de3['operator']===_0x2c2a('0x6b')){if(_0x106de3[_0x2c2a('0x6c')]['split']('\x20')[_0x2c2a('0x66')]>0x1){_0x1702d2[_0x157967](_0x2c2a('0x6d'),qs['getFullTextValue'](_0x106de3['value']),null);}else{var _0x38087e='%'+_0x106de3['value']+'%';_0x1702d2[_0x157967]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x38087e,_0x38087e,_0x38087e);}}else{_0x2f2529=_['find'](_0x381b6d,[_0x2c2a('0x35'),_0x2c2a('0x6e')]);_0x106de3['field']=_0x2c2a('0x6e');_0x3097af=as[_0x2c2a('0x6f')](_0x3b243f,_0x2f2529[_0x2c2a('0x42')],_0x106de3);_0x1702d2[_0x157967](_0x3097af[_0x2c2a('0x70')],_0x3097af['value'][_0x2c2a('0x71')],_0x3097af['value']['end']);}break;case _0x2c2a('0x72'):var _0x503821=_0x106de3[_0x2c2a('0x6c')][_0x2c2a('0x3b')](',')[_0x2c2a('0x38')](function(_0x120770){return Number(_0x120770);});_0x503821[_0x2c2a('0x3c')](function(_0x2b4032){_0x4f1bed['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b4032+',%');});_0x15c1af=_[_0x2c2a('0x73')](_0x15c1af,_0x503821);break;case _0x2c2a('0x74'):if(_0x106de3['operator']===_0x2c2a('0x6b')){_0x1702d2[_0x157967](_0x2c2a('0x75'),'%'+_0x106de3[_0x2c2a('0x6c')]+'%',null);}else{_0x2f2529=_[_0x2c2a('0x67')](_0x381b6d,[_0x2c2a('0x35'),_0x2c2a('0x76')]);_0x106de3[_0x2c2a('0x4f')]='UserId';_0x3097af=as[_0x2c2a('0x6f')](_0x3b243f,_0x2f2529[_0x2c2a('0x42')],_0x106de3);_0x1702d2[_0x157967](_0x3097af['text'],_0x3097af['value'][_0x2c2a('0x71')],_0x3097af[_0x2c2a('0x6c')][_0x2c2a('0x29')]);}break;case _0x2c2a('0x77'):_0x3097af=as[_0x2c2a('0x6f')]('me',null,_0x106de3);_0x1702d2[_0x157967](_0x3097af['text'],_0x3097af[_0x2c2a('0x6c')][_0x2c2a('0x71')],_0x3097af['value'][_0x2c2a('0x29')]);break;}}else{var _0x3097af=as[_0x2c2a('0x6f')](_0x3b243f,_0x2f2529[_0x2c2a('0x42')],_0x106de3);_0x1702d2[_0x157967](_0x3097af['text'],_0x3097af[_0x2c2a('0x6c')][_0x2c2a('0x71')],_0x3097af['value'][_0x2c2a('0x29')]);}}}else{var _0x16dbc3=_(_0x87a74['query'])[_0x2c2a('0x46')]()[_0x2c2a('0x38')](function(_0x484165){return _['some'](_0x381b6d,[_0x2c2a('0x35'),_0x484165])?_0x484165:undefined;})[_0x2c2a('0x78')]()[_0x2c2a('0x6c')]();if(!_[_0x2c2a('0x79')](_0x16dbc3)){_0x16dbc3[_0x2c2a('0x3c')](function(_0x4d01a6){if(_0x4d01a6===_0x2c2a('0x7a')){_0x3b3dec['where']('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x87a74['query'][_0x4d01a6]));}else if(_0x4d01a6===_0x2c2a('0x7b')){var _0x1a1725=JSON[_0x2c2a('0x7c')](_0x87a74[_0x2c2a('0x45')][_0x4d01a6])['$gte'];var _0x3acb44=JSON[_0x2c2a('0x7c')](_0x87a74[_0x2c2a('0x45')][_0x4d01a6])[_0x2c2a('0x7d')];_0x3b3dec[_0x2c2a('0x7e')](_0x2c2a('0x7f'),_0x1a1725,_0x3acb44);}else{if(_0x87a74[_0x2c2a('0x45')][_0x4d01a6]===_0x2c2a('0x80')){_0x3b3dec[_0x2c2a('0x7e')]('i.'+_0x4d01a6+'\x20IS\x20NULL');}else{_0x3b3dec['where']('i.'+_0x4d01a6+_0x2c2a('0x81'),_0x87a74[_0x2c2a('0x45')][_0x4d01a6]);}}});}if(_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x82')]){if(_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x82')]==0x1){_0x3b3dec[_0x2c2a('0x69')](_0x2c2a('0x83'));}else{_0x3b3dec[_0x2c2a('0x69')](_0x2c2a('0x84'));}}if(_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x85')]){_0x15c1af=_['isArray'](_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x85')])?_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x85')]:new Array(_0x87a74['query'][_0x2c2a('0x85')]);_0x15c1af[_0x2c2a('0x3c')](function(_0x40aefe){_0x4f1bed['or'](_0x2c2a('0x86'),'%,'+_0x40aefe+',%');});}if(_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x87')]){var _0x37440a=_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x87')]['replace']('\x5c','\x5c\x5c')[_0x2c2a('0x88')](/'/g,'\x27\x27');if(qs[_0x2c2a('0x89')](_0x37440a)){_0x1702d2['or']('i.id\x20LIKE\x20?',_0x37440a+'%');}else{_0x1702d2['or'](_0x2c2a('0x8a'),qs[_0x2c2a('0x8b')](_0x37440a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x37440a+'%');}}}_0x3b3dec[_0x2c2a('0x7e')](_0x1702d2);_0x3b3dec['group'](_0x2c2a('0x8c'));var _0x2ce170={'type':db[_0x2c2a('0x8d')][_0x2c2a('0x8e')]['SELECT'],'raw':!![]};var _0x135250=_0x3b3dec[_0x2c2a('0x8f')]();_0x135250['field']('i.id');_0x135250[_0x2c2a('0x4f')](_0x2c2a('0x90'),_0x2c2a('0x68'));if(_0x349f9b['order']){_0x349f9b[_0x2c2a('0x4b')][_0x2c2a('0x3c')](function(_0x92f953){var _0x56cc77=_0x92f953[0x0]===_0x2c2a('0x91')?_0x92f953[0x0]:'i.'+_0x92f953[0x0];_0x3b3dec[_0x2c2a('0x4b')](_0x56cc77,_0x92f953[0x1]===_0x2c2a('0x92')?![]:!![]);});}if(!_[_0x2c2a('0x79')](_0x15c1af)){_0x3b3dec['having'](_0x4f1bed);_0x135250[_0x2c2a('0x7e')](_0x2c2a('0x93'),_0x15c1af);}BPromise[_0x2c2a('0x94')]()[_0x2c2a('0x33')](function(){if(!_0x5eca2d){if(_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x7a')]||_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x95')])return;_0x135250[_0x2c2a('0x7e')](_0x2c2a('0x96'));_0x3b3dec['where'](_0x2c2a('0x96'));return;}if(_0x87a74['user'][_0x2c2a('0x97')]!=='agent')return;return _0x87a74['user'][_0x2c2a('0x98')]({'attributes':['id'],'raw':!![]})[_0x2c2a('0x33')](function(_0x41bc3b){if(_['isEmpty'](_0x41bc3b)){_0x135250[_0x2c2a('0x7e')](_0x2c2a('0x99'));_0x3b3dec[_0x2c2a('0x7e')](_0x2c2a('0x99'));}else{_0x135250[_0x2c2a('0x7e')](_0x2c2a('0x9a'),_[_0x2c2a('0x38')](_0x41bc3b,'id'));_0x3b3dec[_0x2c2a('0x7e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x2c2a('0x38')](_0x41bc3b,'id'));}});})[_0x2c2a('0x33')](function(){if(_0x87a74[_0x2c2a('0x9b')][_0x2c2a('0x97')]===_0x2c2a('0x9c')&&!_0x5eca2d&&!_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x7a')])return[];return db[_0x2c2a('0x9d')][_0x2c2a('0x45')](_0x135250['toString'](),_0x2ce170);})[_0x2c2a('0x33')](function(_0x2d63c2){_0x3d6ba6[_0x2c2a('0x2b')]=_0x2d63c2[_0x2c2a('0x66')];if(_0x3d6ba6[_0x2c2a('0x2b')]===0x0)return[];return db[_0x2c2a('0x9d')][_0x2c2a('0x45')](_0x5370cc[_0x2c2a('0x9e')](),_0x2ce170)['then'](function(_0x7d7d53){_0x2030b7=_[_0x2c2a('0x9f')](_0x7d7d53,'id');_0x2ce170=_['merge'](_0x2ce170,{'model':db[_0x2c2a('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x87a74[_0x2c2a('0x45')][_0x2c2a('0x48')]){_0x349f9b[_0x2c2a('0x49')][_0x2c2a('0x3c')](function(_0x3c23e6){_0x3b3dec[_0x2c2a('0x4f')]('i.'+_0x3c23e6);});}else{_0x3b3dec['field'](_0x2c2a('0x90'),_0x2c2a('0x68'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xa0'),_0x2c2a('0xa1'));_0x3b3dec[_0x2c2a('0x4f')]('a.mandatoryDisposition',_0x2c2a('0xa2'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xa3'),_0x2c2a('0x91'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xa4'));_0x3b3dec['field'](_0x2c2a('0xa5'),_0x2c2a('0xa6'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xa7'),_0x2c2a('0xa8'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xa9'),'Contact.email');_0x3b3dec[_0x2c2a('0x4f')]('c.phone','Contact.phone');_0x3b3dec['field'](_0x2c2a('0xaa'),_0x2c2a('0xab'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xac'),_0x2c2a('0xad'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xae'),_0x2c2a('0xaf'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xb0'),_0x2c2a('0xb1'));_0x3b3dec[_0x2c2a('0x4f')](_0x2c2a('0xb2'),_0x2c2a('0x3a'));}if(_0x349f9b[_0x2c2a('0x2d')])_0x3b3dec[_0x2c2a('0x2d')](_0x349f9b[_0x2c2a('0x2d')]);if(_0x349f9b[_0x2c2a('0x2c')])_0x3b3dec[_0x2c2a('0x2c')](_0x349f9b['offset']);return db[_0x2c2a('0x9d')][_0x2c2a('0x45')](_0x3b3dec['toString'](),_0x2ce170);})[_0x2c2a('0x33')](function(_0x2d0479){_0x4e2602['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x2c2a('0x38')](_0x2d0479,'id'));return db['sequelize'][_0x2c2a('0x45')](_0x4e2602[_0x2c2a('0x9e')](),_0x2ce170)['then'](function(_0x51560b){var _0x5bbc9f=_[_0x2c2a('0xb3')](_0x51560b,'ChatInteractionId');var _0x281c59=[];_0x2d0479[_0x2c2a('0x3c')](function(_0x2f10cf){_0x281c59['push'](updateChatInteraction(_0x2f10cf,_0x2030b7,_0x5bbc9f));});return BPromise[_0x2c2a('0xb4')](_0x281c59);});});})['then'](function(_0x1af3ed){_0x3d6ba6[_0x2c2a('0xb5')]=_0x1af3ed;return _0x3d6ba6;})[_0x2c2a('0x33')](respondWithFilteredResult(_0x5ab83d,_0x349f9b))[_0x2c2a('0x26')](handleError(_0x5ab83d,null));};exports['show']=function(_0x3d6f59,_0x3c6617){var _0x5e60cc={'raw':![],'where':{'id':_0x3d6f59['params']['id']}},_0x49698d={};_0x49698d['model']=_[_0x2c2a('0x46')](db[_0x2c2a('0x3f')][_0x2c2a('0x40')]);_0x49698d[_0x2c2a('0x45')]=_[_0x2c2a('0x46')](_0x3d6f59[_0x2c2a('0x45')]);_0x49698d[_0x2c2a('0x4e')]=_[_0x2c2a('0x47')](_0x49698d['model'],_0x49698d[_0x2c2a('0x45')]);_0x5e60cc[_0x2c2a('0x49')]=_[_0x2c2a('0x47')](_0x49698d[_0x2c2a('0x44')],qs[_0x2c2a('0x48')](_0x3d6f59[_0x2c2a('0x45')][_0x2c2a('0x48')]));_0x5e60cc[_0x2c2a('0x49')]=_0x5e60cc[_0x2c2a('0x49')][_0x2c2a('0x66')]?_0x5e60cc['attributes']:_0x49698d['model'];if(_0x3d6f59[_0x2c2a('0x45')][_0x2c2a('0xb6')]){_0x5e60cc['include']=[{'all':!![]}];}_0x5e60cc=_[_0x2c2a('0xb7')]({},_0x5e60cc,_0x3d6f59[_0x2c2a('0xb8')]);return db['ChatInteraction'][_0x2c2a('0x67')](_0x5e60cc)[_0x2c2a('0x33')](handleEntityNotFound(_0x3c6617,null))[_0x2c2a('0x33')](respondWithResult(_0x3c6617,null))[_0x2c2a('0x26')](handleError(_0x3c6617,null));};exports[_0x2c2a('0xb9')]=function(_0x39fc80,_0x345c30){return db['ChatInteraction'][_0x2c2a('0xb9')](_0x39fc80[_0x2c2a('0x77')],{})[_0x2c2a('0x33')](respondWithResult(_0x345c30,0xc9))['catch'](handleError(_0x345c30,null));};exports[_0x2c2a('0xba')]=function(_0x4c48b2,_0x2b1ef3){if(_0x4c48b2['body']['id']){delete _0x4c48b2[_0x2c2a('0x77')]['id'];}return db[_0x2c2a('0x3f')][_0x2c2a('0x67')]({'where':{'id':_0x4c48b2['params']['id']}})['then'](handleEntityNotFound(_0x2b1ef3,null))['then'](saveUpdates(_0x4c48b2[_0x2c2a('0x77')],null))[_0x2c2a('0x33')](respondWithResult(_0x2b1ef3,null))[_0x2c2a('0x26')](handleError(_0x2b1ef3,null));};exports[_0x2c2a('0x34')]=function(_0x946ea1,_0x4e1813){return db[_0x2c2a('0x3f')][_0x2c2a('0x67')]({'where':{'id':_0x946ea1[_0x2c2a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x4e1813,null))['then'](removeEntity(_0x4e1813,null))[_0x2c2a('0x26')](handleError(_0x4e1813,null));};exports['describe']=function(_0x1e3eeb,_0x4b1719){return db[_0x2c2a('0x3f')][_0x2c2a('0xbc')]()[_0x2c2a('0x33')](respondWithResult(_0x4b1719,null))[_0x2c2a('0x26')](handleError(_0x4b1719,null));};exports[_0x2c2a('0xbd')]=function(_0x4fbb13,_0x4c74f1){var _0xecbe68=_0x4fbb13[_0x2c2a('0xbb')]['id'];var _0x19b35f;var _0x8cc163;var _0x20b867;return db[_0x2c2a('0x3f')][_0x2c2a('0xbe')]({'where':{'id':_0xecbe68}})[_0x2c2a('0x33')](function(_0x379cc7){_0x19b35f=_0x379cc7;return db[_0x2c2a('0xbf')][_0x2c2a('0xbe')]({'where':{'id':_0x379cc7[_0x2c2a('0x7a')]},'attributes':['id',_0x2c2a('0xc0'),_0x2c2a('0xc1')],'raw':!![]});})[_0x2c2a('0x33')](function(_0x66f592){if(_0x66f592&&_0x66f592[_0x2c2a('0xc0')]&&_0x66f592[_0x2c2a('0xc1')]){_0x8cc163=_0x66f592;var _0x4c9014={'rejectUnauthorized':![],'method':_0x2c2a('0xc2'),'uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x66f592[_0x2c2a('0xc0')]},'body':{'name':_0x2c2a('0xc3')+_0xecbe68},'redirect':_0x2c2a('0xc4'),'json':!![]};return rp(_0x4c9014);}else{throw new db[(_0x2c2a('0x8d'))][(_0x2c2a('0xc5'))](_0x2c2a('0xc6'));}})[_0x2c2a('0x33')](function(_0x45f138){_0x20b867=_0x45f138;if(_0x20b867['id']){var _0x21d734={'body':_0x20b867[_0x2c2a('0xc7')],'ChatWebsiteId':_0x8cc163['id'],'ChatInteractionId':_0x19b35f['id'],'direction':_0x2c2a('0xc8'),'UserId':_0x4fbb13[_0x2c2a('0x9b')]['id']};return db[_0x2c2a('0xc9')][_0x2c2a('0xb9')](_0x21d734,{});}else{throw new db[(_0x2c2a('0x8d'))]['ValidationError'](_0x2c2a('0xca'));}})[_0x2c2a('0x33')](function(){return _0x19b35f[_0x2c2a('0xcb')]({'vidaooSessionId':_0x20b867['id']});})[_0x2c2a('0x33')](respondWithResult(_0x4c74f1,null))[_0x2c2a('0x26')](handleError(_0x4c74f1,null));};exports[_0x2c2a('0xcc')]=function(_0x4d50ed,_0x51f687){if(_0x4d50ed[_0x2c2a('0x77')]['id']){delete _0x4d50ed[_0x2c2a('0x77')]['id'];}return db[_0x2c2a('0x3f')][_0x2c2a('0x67')]({'where':{'id':_0x4d50ed[_0x2c2a('0xbb')]['id']}})[_0x2c2a('0x33')](handleEntityNotFound(_0x51f687,null))[_0x2c2a('0x33')](saveUpdates(_0x4d50ed[_0x2c2a('0x77')],null))[_0x2c2a('0x33')](respondWithResult(_0x51f687,null))[_0x2c2a('0x26')](handleError(_0x51f687,null));};exports[_0x2c2a('0xcd')]=function(_0x1ab982,_0x5354a7,_0x3f4982){if(_0x1ab982[_0x2c2a('0x77')]['id']){delete _0x1ab982[_0x2c2a('0x77')]['id'];}return db[_0x2c2a('0x3f')][_0x2c2a('0x67')]({'where':{'id':_0x1ab982[_0x2c2a('0xbb')]['id']}})[_0x2c2a('0x33')](function(_0xe91256){if(!_0xe91256){logger[_0x2c2a('0x21')](_0x2c2a('0xce'),'abandon',0x194,_0x2c2a('0xcf'));_0x5354a7[_0x2c2a('0x27')](0x194);}else{if(_0xe91256[_0x2c2a('0x76')]){throw new db['Sequelize'][(_0x2c2a('0xc5'))](_0x2c2a('0xd0'));}}return _0xe91256;})['then'](function(_0x40a1b5){if(_0x40a1b5){return _0x40a1b5[_0x2c2a('0xba')]({'closed':_0x1ab982['body'][_0x2c2a('0xd1')],'disposition':_0x1ab982[_0x2c2a('0x77')][_0x2c2a('0xd2')]})[_0x2c2a('0x33')](function(_0x134606){return _0x134606;});}})[_0x2c2a('0x33')](function(_0x17d2ed){return respondWithRpcPromise('AbandonInteraction',_0x2c2a('0xcd'),_0x1ab982[_0x2c2a('0x77')],client9004);})[_0x2c2a('0x33')](respondWithResult(_0x5354a7,null))[_0x2c2a('0x26')](handleError(_0x5354a7,null));};exports['attachmentUpload']=function(_0x3d12c5,_0x13c073,_0xeec6a8){_0x3d12c5[_0x2c2a('0x77')]['name']=_0x3d12c5[_0x2c2a('0xd3')][_0x2c2a('0xd4')];_0x3d12c5[_0x2c2a('0x77')]['basename']=_0x3d12c5[_0x2c2a('0xd3')]['filename'];_0x3d12c5[_0x2c2a('0x77')]['type']=_0x3d12c5[_0x2c2a('0xd3')][_0x2c2a('0xd5')];return db[_0x2c2a('0xd6')][_0x2c2a('0xb9')](_0x3d12c5[_0x2c2a('0x77')])[_0x2c2a('0x33')](respondWithResult(_0x13c073,0xc9))[_0x2c2a('0x26')](handleError(_0x13c073,null));};exports[_0x2c2a('0xd7')]=function(_0x541f0e,_0x4858f1,_0x421205){return db[_0x2c2a('0x3f')][_0x2c2a('0xbe')]({'where':{'id':_0x541f0e[_0x2c2a('0xbb')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4858f1,null))['then'](function(_0x2aee0d){if(_0x2aee0d){if(_0x2aee0d[_0x2c2a('0xd1')]){return _0x4858f1[_0x2c2a('0x28')](0x193)[_0x2c2a('0x2a')]({'status':0x193,'message':'Unauthorized'});}return db[_0x2c2a('0xd6')][_0x2c2a('0xbe')]({'where':{'id':_0x541f0e[_0x2c2a('0x45')][_0x2c2a('0xd8')]},'raw':!![]})['then'](handleEntityNotFound(_0x4858f1,null));}})[_0x2c2a('0x33')](function(_0x2a3be2){if(_0x2a3be2){return _0x4858f1[_0x2c2a('0xd9')](path['join'](config[_0x2c2a('0xda')],_0x2c2a('0xdb'),_0x2a3be2[_0x2c2a('0xdc')]));}})[_0x2c2a('0x26')](handleError(_0x4858f1,null));};exports[_0x2c2a('0xdd')]=function(_0x3396fe,_0x2af202){var _0x162068=null;var _0x35dd7b=null;var _0x1a58ea=null;var _0x57250f=null;if(_0x3396fe[_0x2c2a('0x77')]['id']){delete _0x3396fe[_0x2c2a('0x77')]['id'];}if(_0x3396fe[_0x2c2a('0x77')]['mailTranscript']){_0x57250f=path[_0x2c2a('0xde')](config[_0x2c2a('0xda')],_0x2c2a('0xdf'),util[_0x2c2a('0xe0')](_0x2c2a('0xe1'),Date[_0x2c2a('0xe2')]()));_0x3396fe[_0x2c2a('0x77')][_0x2c2a('0xe3')]=_0x57250f;}return db[_0x2c2a('0x3f')][_0x2c2a('0x67')]({'where':{'id':_0x3396fe[_0x2c2a('0xbb')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x2c2a('0xe4'),'include':[{'model':db[_0x2c2a('0x74')],'as':_0x2c2a('0x74')}]}]})['then'](handleEntityNotFound(_0x2af202,null))[_0x2c2a('0x33')](saveUpdates(_0x3396fe['body'],null))[_0x2c2a('0x33')](function(_0x53c345){if(_0x53c345){_0x162068=_0x53c345;return db['ChatWebsite'][_0x2c2a('0x67')]({'where':{'id':_0x162068[_0x2c2a('0x7a')]}});}})[_0x2c2a('0x33')](function(_0x2712fb){if(_0x2712fb){_0x1a58ea=_0x2712fb;return db[_0x2c2a('0xe5')][_0x2c2a('0x67')]({'where':{'id':_0x162068[_0x2c2a('0x6e')]}});}})['then'](function(_0x425073){if(_0x425073){_0x35dd7b=_0x425073;if(_0x57250f){var _0x52b938=null;for(var _0x2ab1b8=0x1;_0x2ab1b8<_0x162068['Messages'][_0x2c2a('0x66')];++_0x2ab1b8){_0x52b938=_0x162068[_0x2c2a('0xe4')][_0x2ab1b8];var _0x2c2816=_0x52b938[_0x2c2a('0x76')]?util[_0x2c2a('0xe0')](_0x2c2a('0xe6'),_0x1a58ea['agentAlias'],_0x52b938[_0x2c2a('0x76')]):_0x2c2a('0xe7');var _0x42abcb=_0x3396fe['body'][_0x2c2a('0xe8')]||util[_0x2c2a('0xe0')](_0x2c2a('0xe6'),_0x2c2a('0xe9'),_0x52b938[_0x2c2a('0x6e')]);switch(_0x1a58ea['agentIdentifier']){case'website_alias':_0x2c2816=_0x52b938[_0x2c2a('0x76')]?util[_0x2c2a('0xe0')](_0x2c2a('0xe6'),_0x1a58ea[_0x2c2a('0xea')],_0x52b938[_0x2c2a('0x76')]):_0x2c2a('0xe7');break;case _0x2c2a('0xeb'):_0x2c2816=_0x52b938['UserId']?_0x52b938[_0x2c2a('0x74')][_0x2c2a('0xec')]||_0x52b938[_0x2c2a('0x74')][_0x2c2a('0x39')]:'System';break;case'agent_fullname':_0x2c2816=_0x52b938[_0x2c2a('0x76')]?_0x52b938[_0x2c2a('0x74')][_0x2c2a('0x39')]:_0x2c2a('0xe7');break;default:_0x2c2816=_0x52b938[_0x2c2a('0x76')]?util[_0x2c2a('0xe0')](_0x2c2a('0xe6'),_0x1a58ea['agentAlias'],_0x52b938[_0x2c2a('0x76')]):_0x2c2a('0xe7');}var _0x569e5a=util[_0x2c2a('0xe0')](_0x2c2a('0xed'),moment(_0x52b938[_0x2c2a('0x7b')])[_0x2c2a('0xe0')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52b938['direction']==='in'?_0x42abcb:_0x2c2816,_0x52b938[_0x2c2a('0x77')]);if(!_0x52b938[_0x2c2a('0xee')]){fs[_0x2c2a('0xef')](_0x57250f,_0x569e5a);}}return db[_0x2c2a('0xf0')][_0x2c2a('0xbe')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2c2a('0xf1'),'raw':!![]}]});}}})['then'](function(_0x4acb27){if(_0x4acb27&&_0x4acb27['Smtp']&&_0x3396fe['body']){var _0x5b2238={'tls':{'rejectUnauthorized':![]}};if(_0x4acb27[_0x2c2a('0xf1')][_0x2c2a('0xf2')]){_0x5b2238[_0x2c2a('0xf2')]=_0x4acb27['Smtp'][_0x2c2a('0xf2')];}else{_0x5b2238[_0x2c2a('0xf3')]=_0x4acb27[_0x2c2a('0xf1')][_0x2c2a('0xf3')];_0x5b2238[_0x2c2a('0xf4')]=_0x4acb27[_0x2c2a('0xf1')][_0x2c2a('0xf4')];_0x5b2238[_0x2c2a('0xf5')]=_0x4acb27[_0x2c2a('0xf1')][_0x2c2a('0xf5')];}if(_0x4acb27['Smtp'][_0x2c2a('0xf6')]){_0x5b2238['auth']={'user':_0x4acb27[_0x2c2a('0xf1')]['user'],'pass':_0x4acb27[_0x2c2a('0xf1')][_0x2c2a('0xf7')]};}return respondWithRpcPromise(_0x2c2a('0xf8'),_0x2c2a('0xf9'),{'account':_0x5b2238,'message':{'from':util[_0x2c2a('0xe0')](_0x2c2a('0xfa'),_0x4acb27[_0x2c2a('0x35')],_0x4acb27[_0x2c2a('0xfb')]||_0x4acb27[_0x2c2a('0xf1')][_0x2c2a('0x9b')]),'to':_0x3396fe[_0x2c2a('0x77')][_0x2c2a('0xfc')],'subject':_0x2c2a('0xfd'),'text':util[_0x2c2a('0xe0')](_0x2c2a('0xfe'),_0x3396fe['body'][_0x2c2a('0xfc')]),'attachments':[{'path':_0x57250f}]}})[_0x2c2a('0x33')](function(){return _0x162068;})[_0x2c2a('0x26')](function(_0x1879ac){console[_0x2c2a('0x21')](_0x1879ac);});}else{return _0x162068;}})['then'](respondWithStatusCode(_0x2af202,0xc8))[_0x2c2a('0x26')](handleError(_0x2af202,null));};exports[_0x2c2a('0xff')]=function(_0x4c7e40,_0x46ffb0,_0x4d657c){return db['ChatMessage'][_0x2c2a('0x67')]({'where':{'id':_0x4c7e40['params']['id']}})[_0x2c2a('0x33')](handleEntityNotFound(_0x46ffb0,null))[_0x2c2a('0x33')](function(_0x3965c6){if(_0x3965c6){return _0x3965c6[_0x2c2a('0xff')](_0x4c7e40[_0x2c2a('0x77')][_0x2c2a('0x100')],_[_0x2c2a('0x101')](_0x4c7e40['body'],[_0x2c2a('0x100'),'id'])||{});}})['then'](respondWithResult(_0x46ffb0,null))[_0x2c2a('0x26')](handleError(_0x46ffb0,null));};exports[_0x2c2a('0x102')]=function(_0x2dec23,_0x56645b,_0x50d056){var _0x1a2ff5={'raw':![],'where':{}};var _0x286d07={};var _0x472f9a={'count':0x0,'rows':[]};return db[_0x2c2a('0x3f')][_0x2c2a('0xbe')]({'where':{'id':_0x2dec23[_0x2c2a('0xbb')]['id']}})[_0x2c2a('0x33')](handleEntityNotFound(_0x56645b,null))[_0x2c2a('0x33')](function(_0x346d05){if(_0x346d05){_0x286d07['model']=_[_0x2c2a('0x46')](db[_0x2c2a('0xc9')][_0x2c2a('0x40')]);_0x286d07[_0x2c2a('0x45')]=_[_0x2c2a('0x46')](_0x2dec23[_0x2c2a('0x45')]);_0x286d07[_0x2c2a('0x4e')]=_['intersection'](_0x286d07[_0x2c2a('0x44')],_0x286d07[_0x2c2a('0x45')]);_0x1a2ff5[_0x2c2a('0x49')]=_[_0x2c2a('0x47')](_0x286d07[_0x2c2a('0x44')],qs[_0x2c2a('0x48')](_0x2dec23['query'][_0x2c2a('0x48')]));_0x1a2ff5[_0x2c2a('0x49')]=_0x1a2ff5[_0x2c2a('0x49')][_0x2c2a('0x66')]?_0x1a2ff5['attributes']:_0x286d07[_0x2c2a('0x44')];if(!_0x2dec23['query'][_0x2c2a('0x103')]('nolimit')){_0x1a2ff5[_0x2c2a('0x2d')]=qs['limit'](_0x2dec23[_0x2c2a('0x45')][_0x2c2a('0x2d')]);_0x1a2ff5['offset']=qs[_0x2c2a('0x2c')](_0x2dec23[_0x2c2a('0x45')]['offset']);}_0x1a2ff5[_0x2c2a('0x4b')]=qs[_0x2c2a('0x4c')](_0x2dec23['query'][_0x2c2a('0x4c')]);_0x1a2ff5['where']=qs[_0x2c2a('0x4e')](_[_0x2c2a('0x4d')](_0x2dec23['query'],_0x286d07[_0x2c2a('0x4e')]));_0x1a2ff5[_0x2c2a('0x7e')][_0x2c2a('0x104')]=_0x346d05['id'];if(_0x2dec23[_0x2c2a('0x45')]['filter']){_0x1a2ff5['where']=_['merge'](_0x1a2ff5['where'],{'$or':_['map'](_0x1a2ff5[_0x2c2a('0x49')],function(_0x5978e8){var _0x55ed61={};_0x55ed61[_0x5978e8]={'$like':'%'+_0x2dec23[_0x2c2a('0x45')][_0x2c2a('0x87')]+'%'};return _0x55ed61;})});}if(_0x2dec23['query'][_0x2c2a('0x105')]){var _0x200e2c=_0x2dec23[_0x2c2a('0x45')][_0x2c2a('0x105')][_0x2c2a('0x3b')](',');var _0xa61691={};_0xa61691[_0x200e2c[0x0]]={'$gte':moment(_0x200e2c[0x1])[_0x2c2a('0xe0')](_0x2c2a('0x106'))};_0x1a2ff5[_0x2c2a('0x7e')]=_['merge'](_0x1a2ff5['where'],_0xa61691);}_0x1a2ff5=_[_0x2c2a('0xb7')]({},_0x1a2ff5,_0x2dec23[_0x2c2a('0xb8')]);return db[_0x2c2a('0xc9')][_0x2c2a('0x2b')]({'where':_0x1a2ff5[_0x2c2a('0x7e')]})[_0x2c2a('0x33')](function(_0x2d1891){_0x472f9a[_0x2c2a('0x2b')]=_0x2d1891;if(_0x2dec23[_0x2c2a('0x45')][_0x2c2a('0xb6')]){_0x1a2ff5[_0x2c2a('0x107')]=[{'all':!![]}];}return db[_0x2c2a('0xc9')][_0x2c2a('0x108')](_0x1a2ff5);})[_0x2c2a('0x33')](function(_0x39788b){_0x472f9a[_0x2c2a('0xb5')]=_0x39788b;return _0x472f9a;});}})[_0x2c2a('0x33')](respondWithFilteredResult(_0x56645b,_0x1a2ff5))[_0x2c2a('0x26')](handleError(_0x56645b,null));};exports[_0x2c2a('0x109')]=function(_0x5744b9,_0x14f473,_0x4e40ee){var _0x129699={'where':{}},_0x434aa2={},_0x67184={'count':0x0,'rows':[]};return db[_0x2c2a('0x3f')][_0x2c2a('0xbe')]({'where':{'id':_0x5744b9['params']['id']}})[_0x2c2a('0x33')](handleEntityNotFound(_0x14f473,null))[_0x2c2a('0x33')](function(_0x4b218a){if(_0x4b218a){_0x434aa2[_0x2c2a('0x44')]=_[_0x2c2a('0x46')](db['ChatMessage'][_0x2c2a('0x40')]);_0x434aa2['query']=_['keys'](_0x5744b9[_0x2c2a('0x45')]);_0x434aa2[_0x2c2a('0x4e')]=_[_0x2c2a('0x47')](_0x434aa2[_0x2c2a('0x44')],_0x434aa2[_0x2c2a('0x45')]);_0x129699[_0x2c2a('0x49')]=_[_0x2c2a('0x47')](_0x434aa2['model'],qs[_0x2c2a('0x48')](_0x5744b9['query'][_0x2c2a('0x48')]));_0x129699['attributes']=_0x129699['attributes']['length']?_0x129699[_0x2c2a('0x49')]:_0x434aa2[_0x2c2a('0x44')];if(!_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x103')](_0x2c2a('0x4a'))){_0x129699[_0x2c2a('0x2d')]=qs[_0x2c2a('0x2d')](_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x2d')]);_0x129699[_0x2c2a('0x2c')]=qs['offset'](_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x2c')]);}_0x129699['order']=qs[_0x2c2a('0x4c')](_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x4c')]);_0x129699['where']=qs[_0x2c2a('0x4e')](_['pick'](_0x5744b9[_0x2c2a('0x45')],_0x434aa2['filters']));_0x129699[_0x2c2a('0x7e')][_0x2c2a('0x104')]=_0x4b218a['id'];if(_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x87')]){_0x129699['where']=_['merge'](_0x129699[_0x2c2a('0x7e')],{'$or':_['map'](_0x129699['attributes'],function(_0x252c62){var _0x2e74a2={};_0x2e74a2[_0x252c62]={'$like':'%'+_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x87')]+'%'};return _0x2e74a2;})});}_0x129699[_0x2c2a('0x7e')][_0x2c2a('0xee')]=![];if(_0x5744b9[_0x2c2a('0x45')]['id']){_0x129699[_0x2c2a('0x7e')]['id']={'$gt':_0x5744b9[_0x2c2a('0x45')]['id']};}_0x129699=_[_0x2c2a('0xb7')]({},_0x129699,_0x5744b9[_0x2c2a('0xb8')]);return db['ChatMessage'][_0x2c2a('0x2b')]({'where':_0x129699[_0x2c2a('0x7e')]})[_0x2c2a('0x33')](function(_0x5aa471){_0x67184[_0x2c2a('0x2b')]=_0x5aa471;_0x129699[_0x2c2a('0x107')]=[];if(_0x5744b9[_0x2c2a('0x45')][_0x2c2a('0x10a')]){_0x129699[_0x2c2a('0x107')][_0x2c2a('0x3e')]({'model':db[_0x2c2a('0x74')],'as':_0x2c2a('0x74'),'attributes':['id',_0x2c2a('0x39'),'alias']});}if(_0x5744b9['query']['includeAll']){_0x129699[_0x2c2a('0x107')]=[{'all':!![]}];}return db[_0x2c2a('0xc9')][_0x2c2a('0x108')](_0x129699);})[_0x2c2a('0x33')](function(_0x13265b){_0x67184[_0x2c2a('0xb5')]=_0x13265b;return _0x67184;});}})[_0x2c2a('0x33')](respondWithFilteredResult(_0x14f473,_0x129699))[_0x2c2a('0x26')](handleError(_0x14f473,null));};exports[_0x2c2a('0x10b')]=function(_0xd8110,_0x585549,_0x1cc531){return db['ChatInteraction']['find']({'where':{'id':_0xd8110['params']['id']}})[_0x2c2a('0x33')](handleEntityNotFound(_0x585549,null))['then'](function(_0x177bda){if(_0x177bda){return _0x177bda[_0x2c2a('0x10c')](_0xd8110[_0x2c2a('0x77')][_0x2c2a('0x100')],_[_0x2c2a('0x101')](_0xd8110[_0x2c2a('0x77')],['ids','id'])||{})[_0x2c2a('0x10d')](function(){return db[_0x2c2a('0x72')]['findAll']({'attributes':['id','name',_0x2c2a('0x50')],'where':{'id':_0xd8110['body'][_0x2c2a('0x100')]}});})['then'](function(_0x1831ee){socket[_0x2c2a('0x10e')]('chatInteractionTags:save',{'id':Number(_0xd8110['params']['id']),'tags':_0x1831ee||[]});return{'id':Number(_0xd8110['params']['id']),'tags':_0x1831ee||[]};});}})[_0x2c2a('0x33')](respondWithResult(_0x585549,null))[_0x2c2a('0x26')](handleError(_0x585549,null));};exports[_0x2c2a('0x10f')]=function(_0x4b71f9,_0x41c59f,_0x1494ea){return db[_0x2c2a('0x3f')]['find']({'where':{'id':_0x4b71f9['params']['id']}})['then'](handleEntityNotFound(_0x41c59f,null))[_0x2c2a('0x33')](function(_0x21ec57){if(_0x21ec57){return _0x21ec57[_0x2c2a('0x10f')](_0x4b71f9[_0x2c2a('0x45')][_0x2c2a('0x100')]);}})[_0x2c2a('0x33')](respondWithStatusCode(_0x41c59f,null))[_0x2c2a('0x26')](handleError(_0x41c59f,null));};exports[_0x2c2a('0xd9')]=function(_0x5a08ad,_0x17f768){var _0x350478=moment()['unix']()[_0x2c2a('0x9e')]();var _0xd5472f=path['join'](config[_0x2c2a('0xda')],_0x2c2a('0x110'),_0x2c2a('0x111'),'tmp');var _0x10a692=path['join'](config['root'],'server',_0x2c2a('0x111'),_0x2c2a('0x112'));var _0x158af7=path[_0x2c2a('0xde')](_0xd5472f,_0x350478);var _0x47f278=util[_0x2c2a('0xe0')](_0x2c2a('0x113'),_0x5a08ad[_0x2c2a('0xbb')]['id'],_0x350478);var _0x4cef8a=path['join'](_0xd5472f,_0x47f278);var _0x58e5a8=[];_0x58e5a8[_0x2c2a('0x3e')]({'model':db[_0x2c2a('0x74')],'as':'User','attributes':['id',_0x2c2a('0x39')],'raw':!![]});_0x58e5a8[_0x2c2a('0x3e')]({'model':db[_0x2c2a('0xe5')],'as':_0x2c2a('0x114'),'attributes':['id',_0x2c2a('0x115'),_0x2c2a('0x116')],'raw':!![]});if(_0x5a08ad[_0x2c2a('0x45')][_0x2c2a('0x112')]){_0x58e5a8[_0x2c2a('0x3e')]({'model':db[_0x2c2a('0xd6')],'as':'Attachment','raw':!![]});}var _0x136d62=[{'model':db[_0x2c2a('0xc9')],'as':_0x2c2a('0xe4'),'attributes':['id','body','createdAt',_0x2c2a('0x117'),_0x2c2a('0xee'),'read'],'include':_0x58e5a8}];_0x136d62[_0x2c2a('0x3e')]({'model':db[_0x2c2a('0xbf')],'as':_0x2c2a('0x118'),'attributes':['id',_0x2c2a('0x35')]});_0x136d62[_0x2c2a('0x3e')]({'model':db[_0x2c2a('0x74')],'as':'Owner','attributes':['id','fullname']});return db[_0x2c2a('0x3f')][_0x2c2a('0x67')]({'where':{'id':_0x5a08ad['params']['id']},'include':_0x136d62})[_0x2c2a('0x33')](handleEntityNotFound(_0x17f768,null))[_0x2c2a('0x33')](function(_0x125b91){if(_0x125b91){var _0x55a008=_0x125b91['get']({'plain':!![]});fs['mkdirSync'](_0x158af7);var _0x1edc3d={'format':'A4','border':_0x2c2a('0x119'),'header':{'height':'40px','contents':{'first':_0x2c2a('0x11a')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x2c2a('0x11b'),util['format'](_0x2c2a('0x11c'),_0x2c2a('0x11d'),_0x55a008['id']),moment()[_0x2c2a('0xe0')](_0x2c2a('0x11e'))[_0x2c2a('0x9e')]())}}};var _0x401adf={'channel':_0x2c2a('0x11d'),'account':_0x55a008[_0x2c2a('0x118')]['name'],'agent':_0x55a008[_0x2c2a('0x11f')]?_0x55a008[_0x2c2a('0x11f')][_0x2c2a('0x39')]:'N.A.','createdAt':moment(_0x55a008['createdAt'])[_0x2c2a('0xe0')](_0x2c2a('0x106'))['toString'](),'closedAt':_0x55a008['closed']?moment(_0x55a008[_0x2c2a('0x120')])[_0x2c2a('0xe0')](_0x2c2a('0x106'))[_0x2c2a('0x9e')]():'','disposition':_0x55a008[_0x2c2a('0xd2')],'chatInfo':{'browser':_0x55a008[_0x2c2a('0x121')],'os':_0x55a008[_0x2c2a('0x122')],'referer':_0x55a008[_0x2c2a('0x123')],'customerIp':_0x55a008['customerIp'],'customerPort':_0x55a008[_0x2c2a('0x124')]?_0x55a008[_0x2c2a('0x124')]:_0x2c2a('0x125')},'messages':_(_0x55a008[_0x2c2a('0xe4')])['tail']()['filter']({'secret':![]})[_0x2c2a('0x38')](function(_0x292568){if(_0x292568[_0x2c2a('0xd6')]){var _0x2cc34c=path[_0x2c2a('0xde')](_0x10a692,_0x292568[_0x2c2a('0xd6')][_0x2c2a('0xdc')]);if(fs[_0x2c2a('0x126')](_0x2cc34c)){fs['createReadStream'](_0x2cc34c)['pipe'](fs['createWriteStream'](path[_0x2c2a('0xde')](_0x158af7,_0x292568[_0x2c2a('0xd6')][_0x2c2a('0xdc')])));}}return{'date':moment(_0x292568[_0x2c2a('0x7b')])[_0x2c2a('0xe0')](_0x2c2a('0x106'))['toString'](),'sender':_0x292568['direction']===_0x2c2a('0xc8')?_0x292568['User']?_0x292568[_0x2c2a('0x74')][_0x2c2a('0x39')]:_0x2c2a('0xe7'):_0x292568[_0x2c2a('0x114')][_0x2c2a('0x115')]+(_0x292568[_0x2c2a('0x114')]['lastName']?'\x20'+_0x292568[_0x2c2a('0x114')][_0x2c2a('0x116')]:''),'body':_0x292568[_0x2c2a('0xd6')]?_0x292568[_0x2c2a('0xd6')][_0x2c2a('0xdc')]:_0x292568[_0x2c2a('0x77')],'direction':_0x292568['direction']===_0x2c2a('0xc8')?'A':'C','secret':_0x292568[_0x2c2a('0xee')],'read':_0x292568['read'],'attachment':_0x292568[_0x2c2a('0xd6')]};})[_0x2c2a('0x6c')]()};return ejs[_0x2c2a('0x127')](path['join'](config[_0x2c2a('0xda')],'server',_0x2c2a('0x128'),_0x2c2a('0x129')),{'interaction':_0x401adf})[_0x2c2a('0x33')](function(_0x386419){return new BPromise(function(_0x4657e4,_0x421bdc){pdf[_0x2c2a('0xb9')](_0x386419,_0x1edc3d)[_0x2c2a('0x12a')](path['join'](_0x158af7,_0x2c2a('0x12b')+_0x55a008['id']+'-'+_0x350478+'.pdf'),function(_0x5e1827,_0xe3dc9c){if(_0x5e1827)return _0x421bdc(_0x5e1827);_0x4657e4(_0xe3dc9c);});});})[_0x2c2a('0x33')](function(){return new BPromise(function(_0x10b942,_0x1530ae){zipdir(_0x158af7,{'saveTo':_0x4cef8a},function(_0x40e555,_0x2af57a){if(_0x40e555)return _0x1530ae(_0x40e555);return _0x10b942(_0x2af57a);});})[_0x2c2a('0x33')](function(){return new BPromise(function(_0x37339b,_0x3aa78e){rimraf(_0x158af7,function(_0x2642ee){if(_0x2642ee)_0x3aa78e(_0x2642ee);return _0x37339b();});});})['then'](function(){return _0x17f768[_0x2c2a('0xd9')](_0x4cef8a,_0x47f278,function(_0x546b24){if(_0x546b24){console[_0x2c2a('0x12c')](_0x2c2a('0x12d'),_0x546b24);}else{fs[_0x2c2a('0x12e')](_0x4cef8a);}});});});}else{return _0x17f768[_0x2c2a('0x27')](0xc8);}})['catch'](handleError(_0x17f768,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index ca7973a..7889525 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 _0xacfd=['map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','setMaxListeners','save','update','getUsers','setDataValue','Users'];(function(_0x25678f,_0x5958d5){var _0x1961b5=function(_0x3d0258){while(--_0x3d0258){_0x25678f['push'](_0x25678f['shift']());}};_0x1961b5(++_0x5958d5);}(_0xacfd,0x119));var _0xdacf=function(_0x26b366,_0x1c0399){_0x26b366=_0x26b366-0x0;var _0x52a840=_0xacfd[_0x26b366];return _0x52a840;};'use strict';var EventEmitter=require(_0xdacf('0x0'));var ChatInteraction=require(_0xdacf('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdacf('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdacf('0x2')](0x0);var events={'afterCreate':_0xdacf('0x3'),'afterUpdate':_0xdacf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x31dc33){return function(_0xc430a3,_0x72e494,_0x5e84b4){_0xc430a3[_0xdacf('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e582b){_0xc430a3[_0xdacf('0x6')](_0xdacf('0x7'),_0x5e582b[_0xdacf('0x8')](function(_0x4febf6){return{'id':_0x4febf6['id']};}));return ChatMessage[_0xdacf('0x9')]({'where':{'ChatInteractionId':_0xc430a3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdacf('0xa')](function(_0xd56dd3){_0xc430a3[_0xdacf('0x6')](_0xdacf('0xb'),_0xd56dd3[_0xdacf('0xc')]);ChatInteractionEvents[_0xdacf('0xd')](_0x31dc33+':'+_0xc430a3['id'],_0xc430a3);ChatInteractionEvents[_0xdacf('0xd')](_0x31dc33,_0xc430a3);_0x5e84b4(null);})[_0xdacf('0xe')](_0x5e84b4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdacf('0xf')](e,emitEvent(event));}}module[_0xdacf('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x30d4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x30d4,0xed));var _0x430d=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x30d4[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x430d('0x0'));var ChatInteraction=require(_0x430d('0x1'))['db'][_0x430d('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x430d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x430d('0x4'),'afterUpdate':_0x430d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x121ec1){return function(_0x34d4f9,_0x197d7b,_0x44dffe){_0x34d4f9[_0x430d('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x391fe8){_0x34d4f9[_0x430d('0x7')](_0x430d('0x8'),_0x391fe8[_0x430d('0x9')](function(_0x570cd5){return{'id':_0x570cd5['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x34d4f9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x430d('0xa')](function(_0x14d62f){_0x34d4f9[_0x430d('0x7')](_0x430d('0xb'),_0x14d62f[_0x430d('0xc')]);ChatInteractionEvents['emit'](_0x121ec1+':'+_0x34d4f9['id'],_0x34d4f9);ChatInteractionEvents[_0x430d('0xd')](_0x121ec1,_0x34d4f9);_0x44dffe(null);})[_0x430d('0xe')](_0x44dffe(null));};}for(var e in events){if(events[_0x430d('0xf')](e)){var event=events[e];ChatInteraction[_0x430d('0x10')](e,emitEvent(event));}}module[_0x430d('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index caa7698..e06d4e0 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 _0x85cb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x33fd2d,_0x3a1843){var _0x20bfc5=function(_0x2dcd10){while(--_0x2dcd10){_0x33fd2d['push'](_0x33fd2d['shift']());}};_0x20bfc5(++_0x3a1843);}(_0x85cb,0x164));var _0xb85c=function(_0x544b7c,_0x306ded){_0x544b7c=_0x544b7c-0x0;var _0x5b0f0a=_0x85cb[_0x544b7c];return _0x5b0f0a;};'use strict';var _=require(_0xb85c('0x0'));var util=require(_0xb85c('0x1'));var logger=require(_0xb85c('0x2'))(_0xb85c('0x3'));var moment=require(_0xb85c('0x4'));var BPromise=require(_0xb85c('0x5'));var rp=require(_0xb85c('0x6'));var fs=require('fs');var path=require(_0xb85c('0x7'));var rimraf=require(_0xb85c('0x8'));var config=require(_0xb85c('0x9'));var attributes=require('./chatInteraction.attributes');module[_0xb85c('0xa')]=function(_0x21614e,_0x1013c1){return _0x21614e[_0xb85c('0xb')](_0xb85c('0xc'),attributes,{'tableName':_0xb85c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b9d28,_0xcad977,_0x26a69a){if(_0x5b9d28[_0xb85c('0xe')](_0xb85c('0xf'))){_0x5b9d28[_0xb85c('0x10')]=moment()[_0xb85c('0x11')](_0xb85c('0x12'));}_0x26a69a(null,_0x5b9d28);}},'charset':_0xb85c('0x13'),'collate':_0xb85c('0x14')});};
\ No newline at end of file
+var _0xd1f7=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0xd812c8,_0x2d76b2){var _0x303c48=function(_0x1d43a2){while(--_0x1d43a2){_0xd812c8['push'](_0xd812c8['shift']());}};_0x303c48(++_0x2d76b2);}(_0xd1f7,0x1ab));var _0x7d1f=function(_0x5f4f34,_0x45345b){_0x5f4f34=_0x5f4f34-0x0;var _0x30311b=_0xd1f7[_0x5f4f34];return _0x30311b;};'use strict';var _=require(_0x7d1f('0x0'));var util=require(_0x7d1f('0x1'));var logger=require(_0x7d1f('0x2'))('api');var moment=require(_0x7d1f('0x3'));var BPromise=require(_0x7d1f('0x4'));var rp=require(_0x7d1f('0x5'));var fs=require('fs');var path=require(_0x7d1f('0x6'));var rimraf=require(_0x7d1f('0x7'));var config=require(_0x7d1f('0x8'));var attributes=require(_0x7d1f('0x9'));module[_0x7d1f('0xa')]=function(_0x44fd33,_0x231407){return _0x44fd33[_0x7d1f('0xb')]('ChatInteraction',attributes,{'tableName':_0x7d1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x201b50,_0x5ed375,_0x15db5f){if(_0x201b50[_0x7d1f('0xd')](_0x7d1f('0xe'))){_0x201b50[_0x7d1f('0xf')]=moment()[_0x7d1f('0x10')](_0x7d1f('0x11'));}_0x15db5f(null,_0x201b50);}},'charset':_0x7d1f('0x12'),'collate':_0x7d1f('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 3b95272..215e4b7 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 _0x99e6=['options','raw','where','attributes','then','stringify','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x99e6,0x18e));var _0x699e=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x99e6[_0x585133];return _0x18254a;};'use strict';var _=require(_0x699e('0x0'));var util=require(_0x699e('0x1'));var moment=require(_0x699e('0x2'));var BPromise=require(_0x699e('0x3'));var rs=require(_0x699e('0x4'));var fs=require('fs');var Redis=require(_0x699e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x699e('0x6'));var logger=require(_0x699e('0x7'))(_0x699e('0x8'));var config=require(_0x699e('0x9'));var jayson=require(_0x699e('0xa'));var client=jayson[_0x699e('0xb')][_0x699e('0xc')]({'port':0x232a});config[_0x699e('0xd')]=_['defaults'](config[_0x699e('0xd')],{'host':_0x699e('0xe'),'port':0x18eb});var socket=require(_0x699e('0xf'))(new Redis(config[_0x699e('0xd')]));require(_0x699e('0x10'))['register'](socket);function respondWithRpcPromise(_0x567019,_0x44d958,_0xd99302){return new BPromise(function(_0x2efca8,_0x3090cc){return client[_0x699e('0x11')](_0x567019,_0xd99302)['then'](function(_0x80ee8c){logger['info'](_0x699e('0x12'),_0x44d958,_0x699e('0x13'));logger[_0x699e('0x14')](_0x699e('0x15'),_0x44d958,_0x699e('0x13'),JSON['stringify'](_0x80ee8c));if(_0x80ee8c[_0x699e('0x16')]){if(_0x80ee8c[_0x699e('0x16')][_0x699e('0x17')]===0x1f4){logger[_0x699e('0x16')](_0x699e('0x12'),_0x44d958,_0x80ee8c[_0x699e('0x16')][_0x699e('0x18')]);return _0x3090cc(_0x80ee8c[_0x699e('0x16')][_0x699e('0x18')]);}logger[_0x699e('0x16')](_0x699e('0x12'),_0x44d958,_0x80ee8c['error'][_0x699e('0x18')]);return _0x2efca8(_0x80ee8c[_0x699e('0x16')][_0x699e('0x18')]);}else{logger[_0x699e('0x19')](_0x699e('0x12'),_0x44d958,'request\x20sent');_0x2efca8(_0x80ee8c[_0x699e('0x1a')][_0x699e('0x18')]);}})[_0x699e('0x1b')](function(_0x427ace){logger['error'](_0x699e('0x12'),_0x44d958,_0x427ace);_0x3090cc(_0x427ace);});});}exports[_0x699e('0x1c')]=function(_0x520834){var _0x37f93a=this;return new Promise(function(_0x59c6d1,_0x505493){return db[_0x699e('0x1d')][_0x699e('0x1e')](_0x520834[_0x699e('0x1f')],{'raw':_0x520834[_0x699e('0x20')]?_0x520834[_0x699e('0x20')][_0x699e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x520834[_0x699e('0x20')]?_0x520834[_0x699e('0x20')][_0x699e('0x22')]||null:null,'attributes':_0x520834['options']?_0x520834[_0x699e('0x20')][_0x699e('0x23')]||null:null,'limit':_0x520834['options']?_0x520834['options']['limit']||null:null})[_0x699e('0x24')](function(_0x3671fa){logger[_0x699e('0x19')](_0x699e('0x1c'),_0x520834);logger['debug'](_0x699e('0x1c'),_0x520834,JSON[_0x699e('0x25')](_0x3671fa));_0x59c6d1(_0x3671fa);})[_0x699e('0x1b')](function(_0x4e4272){logger['error'](_0x699e('0x1c'),_0x4e4272[_0x699e('0x18')],_0x520834);_0x505493(_0x37f93a[_0x699e('0x16')](0x1f4,_0x4e4272[_0x699e('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x459606){return new Promise(function(_0x58b517,_0x158276){return db['ChatInteraction']['find']({'where':_0x459606['options']?_0x459606[_0x699e('0x20')][_0x699e('0x22')]||null:null})[_0x699e('0x24')](function(_0x11998e){if(_0x11998e){return _0x11998e[_0x699e('0x26')](_0x459606[_0x699e('0x1f')][_0x699e('0x27')],_[_0x699e('0x28')](_0x459606[_0x699e('0x1f')],[_0x699e('0x27'),'id'])||{});}})[_0x699e('0x29')](function(_0x4d93a5){logger[_0x699e('0x19')](_0x699e('0x2a'),_0x459606);logger[_0x699e('0x14')](_0x699e('0x2a'),_0x459606,JSON['stringify'](_0x4d93a5));_0x58b517(_0x4d93a5);})[_0x699e('0x1b')](function(_0x473dfa){logger['error'](_0x699e('0x2a'),_0x473dfa[_0x699e('0x18')],_0x459606);_0x158276(_this['error'](0x1f4,_0x473dfa['message']));});});};
\ No newline at end of file
+var _0x02b3=['where','attributes','limit','info','find','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw'];(function(_0x1ef38c,_0x145209){var _0x239516=function(_0x1dd66b){while(--_0x1dd66b){_0x1ef38c['push'](_0x1ef38c['shift']());}};_0x239516(++_0x145209);}(_0x02b3,0x183));var _0x302b=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x02b3[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0x302b('0x0'));var util=require('util');var moment=require(_0x302b('0x1'));var BPromise=require(_0x302b('0x2'));var rs=require(_0x302b('0x3'));var fs=require('fs');var Redis=require(_0x302b('0x4'));var db=require(_0x302b('0x5'))['db'];var utils=require(_0x302b('0x6'));var logger=require(_0x302b('0x7'))(_0x302b('0x8'));var config=require(_0x302b('0x9'));var jayson=require(_0x302b('0xa'));var client=jayson[_0x302b('0xb')][_0x302b('0xc')]({'port':0x232a});config[_0x302b('0xd')]=_[_0x302b('0xe')](config[_0x302b('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x302b('0xf'))[_0x302b('0x10')](socket);function respondWithRpcPromise(_0x1b2e18,_0xdf7711,_0x5ea398){return new BPromise(function(_0x22d281,_0x78266c){return client[_0x302b('0x11')](_0x1b2e18,_0x5ea398)[_0x302b('0x12')](function(_0x25bf64){logger['info'](_0x302b('0x13'),_0xdf7711,_0x302b('0x14'));logger[_0x302b('0x15')](_0x302b('0x16'),_0xdf7711,'request\x20sent',JSON[_0x302b('0x17')](_0x25bf64));if(_0x25bf64[_0x302b('0x18')]){if(_0x25bf64[_0x302b('0x18')]['code']===0x1f4){logger['error'](_0x302b('0x13'),_0xdf7711,_0x25bf64[_0x302b('0x18')][_0x302b('0x19')]);return _0x78266c(_0x25bf64[_0x302b('0x18')][_0x302b('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0xdf7711,_0x25bf64[_0x302b('0x18')]['message']);return _0x22d281(_0x25bf64[_0x302b('0x18')]['message']);}else{logger['info'](_0x302b('0x13'),_0xdf7711,_0x302b('0x14'));_0x22d281(_0x25bf64['result']['message']);}})[_0x302b('0x1a')](function(_0x2784fd){logger[_0x302b('0x18')]('ChatInteraction,\x20%s,\x20%s',_0xdf7711,_0x2784fd);_0x78266c(_0x2784fd);});});}exports[_0x302b('0x1b')]=function(_0x137521){var _0x41979a=this;return new Promise(function(_0x16438c,_0x3b530a){return db[_0x302b('0x1c')][_0x302b('0x1d')](_0x137521[_0x302b('0x1e')],{'raw':_0x137521[_0x302b('0x1f')]?_0x137521['options'][_0x302b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x137521[_0x302b('0x1f')]?_0x137521[_0x302b('0x1f')][_0x302b('0x21')]||null:null,'attributes':_0x137521[_0x302b('0x1f')]?_0x137521[_0x302b('0x1f')][_0x302b('0x22')]||null:null,'limit':_0x137521[_0x302b('0x1f')]?_0x137521[_0x302b('0x1f')][_0x302b('0x23')]||null:null})[_0x302b('0x12')](function(_0x1d81ce){logger[_0x302b('0x24')](_0x302b('0x1b'),_0x137521);logger[_0x302b('0x15')]('UpdateChatInteraction',_0x137521,JSON[_0x302b('0x17')](_0x1d81ce));_0x16438c(_0x1d81ce);})['catch'](function(_0x9c9d81){logger[_0x302b('0x18')](_0x302b('0x1b'),_0x9c9d81[_0x302b('0x19')],_0x137521);_0x3b530a(_0x41979a['error'](0x1f4,_0x9c9d81[_0x302b('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x5e4e72){return new Promise(function(_0x4df5d6,_0x919897){return db[_0x302b('0x1c')][_0x302b('0x25')]({'where':_0x5e4e72[_0x302b('0x1f')]?_0x5e4e72[_0x302b('0x1f')][_0x302b('0x21')]||null:null})[_0x302b('0x12')](function(_0x1f09da){if(_0x1f09da){return _0x1f09da['addTags'](_0x5e4e72['body'][_0x302b('0x26')],_[_0x302b('0x27')](_0x5e4e72['body'],[_0x302b('0x26'),'id'])||{});}})[_0x302b('0x28')](function(_0x5f171d){logger[_0x302b('0x24')](_0x302b('0x29'),_0x5e4e72);logger['debug'](_0x302b('0x29'),_0x5e4e72,JSON[_0x302b('0x17')](_0x5f171d));_0x4df5d6(_0x5f171d);})[_0x302b('0x1a')](function(_0xba0cfb){logger[_0x302b('0x18')]('AddTags',_0xba0cfb[_0x302b('0x19')],_0x5e4e72);_0x919897(_this['error'](0x1f4,_0xba0cfb['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0799493..7e21ed6 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 _0x4444=['length','chatInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x5850b0,_0x4e7c3c){var _0x43b448=function(_0x320407){while(--_0x320407){_0x5850b0['push'](_0x5850b0['shift']());}};_0x43b448(++_0x4e7c3c);}(_0x4444,0x1a2));var _0x4444=function(_0x30f020,_0x7d2cfa){_0x30f020=_0x30f020-0x0;var _0x3933c0=_0x4444[_0x30f020];return _0x3933c0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4444('0x0'),_0x4444('0x1'),_0x4444('0x2')];function createListener(_0x3907b8,_0x567b2d){return function(_0x5e3530){_0x567b2d[_0x4444('0x3')](_0x3907b8,_0x5e3530);};}function removeListener(_0x48082e,_0x2fbd55){return function(){ChatInteractionEvents[_0x4444('0x4')](_0x48082e,_0x2fbd55);};}exports[_0x4444('0x5')]=function(_0x1000ed){for(var _0x2ee1ed=0x0,_0x23a792=events[_0x4444('0x6')];_0x2ee1ed<_0x23a792;_0x2ee1ed++){var _0x21073e=events[_0x2ee1ed];var _0x4222ff=createListener(_0x4444('0x7')+_0x21073e,_0x1000ed);ChatInteractionEvents['on'](_0x21073e,_0x4222ff);}};
\ No newline at end of file
+var _0x5964=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x2b05a6,_0x32ebdc){var _0x17501c=function(_0x5ca941){while(--_0x5ca941){_0x2b05a6['push'](_0x2b05a6['shift']());}};_0x17501c(++_0x32ebdc);}(_0x5964,0x1d3));var _0x4596=function(_0x405778,_0xa4dd3b){_0x405778=_0x405778-0x0;var _0x341735=_0x5964[_0x405778];return _0x341735;};'use strict';var ChatInteractionEvents=require(_0x4596('0x0'));var events=['save','remove',_0x4596('0x1')];function createListener(_0x711794,_0x1fa543){return function(_0x43b163){_0x1fa543[_0x4596('0x2')](_0x711794,_0x43b163);};}function removeListener(_0x290f5d,_0x5ee1aa){return function(){ChatInteractionEvents[_0x4596('0x3')](_0x290f5d,_0x5ee1aa);};}exports['register']=function(_0x361f28){for(var _0x59f356=0x0,_0x4181e9=events[_0x4596('0x4')];_0x59f356<_0x4181e9;_0x59f356++){var _0x339446=events[_0x59f356];var _0x517ae6=createListener(_0x4596('0x5')+_0x339446,_0x361f28);ChatInteractionEvents['on'](_0x339446,_0x517ae6);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 45adbf6..9339977 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 _0xf720=['isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','replace','single','file','attachmentUpload','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','Router','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x430469,_0x20e783){var _0x1ca55e=function(_0x42e6e6){while(--_0x42e6e6){_0x430469['push'](_0x430469['shift']());}};_0x1ca55e(++_0x20e783);}(_0xf720,0x16e));var _0x0f72=function(_0x1a788a,_0x3d0b62){_0x1a788a=_0x1a788a-0x0;var _0x86edb3=_0xf720[_0x1a788a];return _0x86edb3;};'use strict';var multer=require(_0x0f72('0x0'));var util=require(_0x0f72('0x1'));var path=require('path');var timeout=require(_0x0f72('0x2'));var express=require('express');var router=express[_0x0f72('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0f72('0x4'));router[_0x0f72('0x5')]('/',auth[_0x0f72('0x6')](),controller[_0x0f72('0x7')]);router[_0x0f72('0x5')]('/describe',auth[_0x0f72('0x6')](),controller[_0x0f72('0x8')]);router[_0x0f72('0x5')](_0x0f72('0x9'),auth[_0x0f72('0xa')](),controller['show']);router['get'](_0x0f72('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x0f72('0xc')]);router[_0x0f72('0x5')](_0x0f72('0xd'),auth['isAuthenticated'](),controller[_0x0f72('0xe')]);router[_0x0f72('0x5')](_0x0f72('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x0f72('0x10')]);router[_0x0f72('0x5')](_0x0f72('0x11'),auth['isAuthenticated'](),controller['download']);router[_0x0f72('0x12')]('/',auth[_0x0f72('0x6')](),controller['create']);router['post'](_0x0f72('0x13'),auth[_0x0f72('0x6')](),controller[_0x0f72('0x14')]);var upload=multer({'storage':multer[_0x0f72('0x15')]({'destination':function(_0x3d2888,_0x4ca380,_0x1a69bc){_0x1a69bc(null,path[_0x0f72('0x16')](config[_0x0f72('0x17')],_0x0f72('0x18')));},'filename':function(_0xa6221,_0x3fa20f,_0x203efa){_0x203efa(null,util[_0x0f72('0x19')]('%s-%s',Date['now'](),_0x3fa20f['originalname'][_0x0f72('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x0f72('0x1b')](_0x0f72('0x1c')),controller[_0x0f72('0x1d')]);router[_0x0f72('0x12')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x0f72('0x1e'),auth[_0x0f72('0x6')](),interaction[_0x0f72('0x1f')](_0x0f72('0x20'),'chatinteraction:addtags'),controller[_0x0f72('0x21')]);router[_0x0f72('0x22')](_0x0f72('0x9'),auth[_0x0f72('0x6')](),interaction[_0x0f72('0x1f')](_0x0f72('0x20'),_0x0f72('0x23')),controller[_0x0f72('0x24')]);router[_0x0f72('0x22')](_0x0f72('0x25'),controller['customUpdate']);router[_0x0f72('0x22')](_0x0f72('0x26'),auth[_0x0f72('0xa')](),controller[_0x0f72('0x27')]);router[_0x0f72('0x22')](_0x0f72('0x28'),controller[_0x0f72('0x29')]);router[_0x0f72('0x2a')](_0x0f72('0x9'),auth[_0x0f72('0x6')](),interaction[_0x0f72('0x1f')](_0x0f72('0x20'),_0x0f72('0x2b')),controller[_0x0f72('0x2c')]);router[_0x0f72('0x2a')](_0x0f72('0x1e'),auth[_0x0f72('0x6')](),controller[_0x0f72('0x2d')]);module[_0x0f72('0x2e')]=router;
\ No newline at end of file
+var _0xec3d=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','now','originalname','single','file','/:id/messages','addMessage','tracked','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatInteraction.controller'];(function(_0x2cd180,_0x441df6){var _0x33140f=function(_0x285971){while(--_0x285971){_0x2cd180['push'](_0x2cd180['shift']());}};_0x33140f(++_0x441df6);}(_0xec3d,0x179));var _0xdec3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec3d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdec3('0x0'));var util=require(_0xdec3('0x1'));var path=require(_0xdec3('0x2'));var timeout=require(_0xdec3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xdec3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdec3('0x5'));var controller=require(_0xdec3('0x6'));router[_0xdec3('0x7')]('/',auth[_0xdec3('0x8')](),controller[_0xdec3('0x9')]);router[_0xdec3('0x7')](_0xdec3('0xa'),auth[_0xdec3('0x8')](),controller[_0xdec3('0xb')]);router[_0xdec3('0x7')](_0xdec3('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xdec3('0xd')]);router['get'](_0xdec3('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xdec3('0xf')]);router[_0xdec3('0x7')]('/:id/messages',auth[_0xdec3('0x8')](),controller[_0xdec3('0x10')]);router[_0xdec3('0x7')](_0xdec3('0x11'),auth[_0xdec3('0x12')](),controller[_0xdec3('0x13')]);router[_0xdec3('0x7')](_0xdec3('0x14'),auth[_0xdec3('0x8')](),controller[_0xdec3('0x15')]);router[_0xdec3('0x16')]('/',auth[_0xdec3('0x8')](),controller[_0xdec3('0x17')]);router['post'](_0xdec3('0x18'),auth[_0xdec3('0x8')](),controller[_0xdec3('0x19')]);var upload=multer({'storage':multer[_0xdec3('0x1a')]({'destination':function(_0x462c41,_0x1980a2,_0xaa4683){_0xaa4683(null,path['join'](config['root'],_0xdec3('0x1b')));},'filename':function(_0x4d2663,_0x5d8d2e,_0x262074){_0x262074(null,util['format']('%s-%s',Date[_0xdec3('0x1c')](),_0x5d8d2e[_0xdec3('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdec3('0x16')]('/:id/attachment_upload',upload[_0xdec3('0x1e')](_0xdec3('0x1f')),controller['attachmentUpload']);router[_0xdec3('0x16')](_0xdec3('0x20'),auth[_0xdec3('0x12')](),controller[_0xdec3('0x21')]);router['post']('/:id/tags',auth[_0xdec3('0x8')](),interaction[_0xdec3('0x22')]('chat','chatinteraction:addtags'),controller[_0xdec3('0x23')]);router[_0xdec3('0x24')](_0xdec3('0xc'),auth['isAuthenticated'](),interaction['tracked']('chat',_0xdec3('0x25')),controller[_0xdec3('0x26')]);router[_0xdec3('0x24')]('/:id/custom_update',controller[_0xdec3('0x27')]);router['put'](_0xdec3('0x28'),auth[_0xdec3('0x12')](),controller[_0xdec3('0x29')]);router[_0xdec3('0x24')]('/:id/close',controller[_0xdec3('0x2a')]);router[_0xdec3('0x2b')](_0xdec3('0xc'),auth[_0xdec3('0x8')](),interaction[_0xdec3('0x22')]('chat',_0xdec3('0x2c')),controller[_0xdec3('0x2d')]);router[_0xdec3('0x2b')](_0xdec3('0x2e'),auth['isAuthenticated'](),controller[_0xdec3('0x2f')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b9606be..0416874 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 _0x5f66=['exports','medium','BOOLEAN','INTEGER'];(function(_0x4915bb,_0x1fd2ca){var _0x5e8bad=function(_0x189cd6){while(--_0x189cd6){_0x4915bb['push'](_0x4915bb['shift']());}};_0x5e8bad(++_0x1fd2ca);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65f6('0x3')]}};
\ No newline at end of file
+var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x5ca581,_0x1e7ed8){var _0x10e67a=function(_0x2c7b65){while(--_0x2c7b65){_0x5ca581['push'](_0x5ca581['shift']());}};_0x10e67a(++_0x1e7ed8);}(_0xda2d,0x102));var _0xdda2=function(_0x1eaeee,_0x291a3d){_0x1eaeee=_0x1eaeee-0x0;var _0xc324b=_0xda2d[_0x1eaeee];return _0xc324b;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 6817ce4..1d1a0c1 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 _0x6659=['find','create','body','params','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','length','push','FromId','ToId','read','all','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','keys'];(function(_0x32b0b2,_0x4f3f45){var _0x5b595e=function(_0x5e6952){while(--_0x5e6952){_0x32b0b2['push'](_0x32b0b2['shift']());}};_0x5b595e(++_0x4f3f45);}(_0x6659,0x176));var _0x9665=function(_0x132ca3,_0x4be008){_0x132ca3=_0x132ca3-0x0;var _0x3e2ee0=_0x6659[_0x132ca3];return _0x3e2ee0;};'use strict';var pdf=require(_0x9665('0x0'));var emlformat=require(_0x9665('0x1'));var rimraf=require(_0x9665('0x2'));var zipdir=require(_0x9665('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9665('0x4'));var moment=require(_0x9665('0x5'));var BPromise=require(_0x9665('0x6'));var Mustache=require(_0x9665('0x7'));var util=require(_0x9665('0x8'));var path=require(_0x9665('0x9'));var sox=require(_0x9665('0xa'));var csv=require(_0x9665('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9665('0xc'));var squel=require(_0x9665('0xd'));var crypto=require(_0x9665('0xe'));var jsforce=require(_0x9665('0xf'));var deskjs=require(_0x9665('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9665('0x11'));var Papa=require(_0x9665('0x12'));var Redis=require(_0x9665('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9665('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9665('0x15'));var logger=require(_0x9665('0x16'))(_0x9665('0x17'));var utils=require(_0x9665('0x18'));var config=require(_0x9665('0x19'));var licenseUtil=require(_0x9665('0x1a'));var db=require(_0x9665('0x1b'))['db'];config[_0x9665('0x1c')]=_[_0x9665('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9665('0x1e'))(new Redis(config['redis']));require(_0x9665('0x1f'))[_0x9665('0x20')](socket);function respondWithStatusCode(_0x50fe25,_0x314b67){_0x314b67=_0x314b67||0xcc;return function(_0xd93bc1){if(_0xd93bc1){return _0x50fe25[_0x9665('0x21')](_0x314b67);}return _0x50fe25[_0x9665('0x22')](_0x314b67)[_0x9665('0x23')]();};}function respondWithResult(_0xdb5d65,_0x73cd12){_0x73cd12=_0x73cd12||0xc8;return function(_0x362ed4){if(_0x362ed4){return _0xdb5d65['status'](_0x73cd12)['json'](_0x362ed4);}};}function respondWithFilteredResult(_0x26125b,_0x23b0b0){return function(_0x15f797){if(_0x15f797){var _0x364a03=_0x15f797[_0x9665('0x24')],_0x2b59d7=_0x23b0b0[_0x9665('0x25')],_0x200ea5=_0x23b0b0['offset']+_0x23b0b0[_0x9665('0x26')],_0x5ea7a1;if(_0x200ea5>=_0x364a03){_0x200ea5=_0x364a03;_0x5ea7a1=0xc8;}else{_0x5ea7a1=0xce;}_0x26125b[_0x9665('0x22')](_0x5ea7a1);return _0x26125b['set'](_0x9665('0x27'),_0x2b59d7+'-'+_0x200ea5+'/'+_0x364a03)[_0x9665('0x28')](_0x15f797);}return null;};}function patchUpdates(_0x4672a2){return function(_0x17a0bb){try{jsonpatch[_0x9665('0x29')](_0x17a0bb,_0x4672a2,!![]);}catch(_0x38b564){return BPromise[_0x9665('0x2a')](_0x38b564);}return _0x17a0bb[_0x9665('0x2b')]();};}function saveUpdates(_0xd6857c,_0x29c7d0){return function(_0x267e88){if(_0x267e88){return _0x267e88[_0x9665('0x2c')](_0xd6857c)[_0x9665('0x2d')](function(_0x3190d4){return _0x3190d4;});}return null;};}function removeEntity(_0x5c0fbf,_0x2d15b7){return function(_0x2366ee){if(_0x2366ee){return _0x2366ee[_0x9665('0x2e')]()[_0x9665('0x2d')](function(){_0x5c0fbf[_0x9665('0x22')](0xcc)[_0x9665('0x23')]();});}};}function handleEntityNotFound(_0x545500,_0x6c68bd){return function(_0x57b67f){if(!_0x57b67f){_0x545500['sendStatus'](0x194);}return _0x57b67f;};}function handleError(_0x251cb0,_0x4427df){_0x4427df=_0x4427df||0x1f4;return function(_0x36f637){logger[_0x9665('0x2f')](_0x36f637['stack']);if(_0x36f637[_0x9665('0x30')]){delete _0x36f637['name'];}_0x251cb0['status'](_0x4427df)[_0x9665('0x31')](_0x36f637);};}exports[_0x9665('0x32')]=function(_0x54c0f5,_0x3aa324){var _0x4208b5={},_0x16637f={},_0x336c32={'count':0x0,'rows':[]};var _0x7efa76=_[_0x9665('0x33')](db['ChatInternalMessage'][_0x9665('0x34')],function(_0x493544){return{'name':_0x493544[_0x9665('0x35')],'type':_0x493544['type']['key']};});_0x16637f[_0x9665('0x36')]=_[_0x9665('0x33')](_0x7efa76,_0x9665('0x30'));_0x16637f[_0x9665('0x37')]=_['keys'](_0x54c0f5[_0x9665('0x37')]);_0x16637f[_0x9665('0x38')]=_['intersection'](_0x16637f['model'],_0x16637f[_0x9665('0x37')]);_0x4208b5[_0x9665('0x39')]=_[_0x9665('0x3a')](_0x16637f['model'],qs[_0x9665('0x3b')](_0x54c0f5['query'][_0x9665('0x3b')]));_0x4208b5[_0x9665('0x39')]=_0x4208b5[_0x9665('0x39')]['length']?_0x4208b5['attributes']:_0x16637f[_0x9665('0x36')];if(!_0x54c0f5[_0x9665('0x37')][_0x9665('0x3c')](_0x9665('0x3d'))){_0x4208b5[_0x9665('0x26')]=qs['limit'](_0x54c0f5[_0x9665('0x37')][_0x9665('0x26')]);_0x4208b5[_0x9665('0x25')]=qs[_0x9665('0x25')](_0x54c0f5[_0x9665('0x37')][_0x9665('0x25')]);}_0x4208b5[_0x9665('0x3e')]=qs[_0x9665('0x3f')](_0x54c0f5['query'][_0x9665('0x3f')]);_0x4208b5[_0x9665('0x40')]=qs[_0x9665('0x38')](_[_0x9665('0x41')](_0x54c0f5[_0x9665('0x37')],_0x16637f[_0x9665('0x38')]),_0x7efa76);if(_0x54c0f5[_0x9665('0x37')][_0x9665('0x42')]){_0x4208b5[_0x9665('0x40')]=_[_0x9665('0x43')](_0x4208b5[_0x9665('0x40')],{'$or':_[_0x9665('0x33')](_0x7efa76,function(_0x54a57){if(_0x54a57[_0x9665('0x44')]!==_0x9665('0x45')){var _0x35771d={};_0x35771d[_0x54a57['name']]={'$like':'%'+_0x54c0f5[_0x9665('0x37')][_0x9665('0x42')]+'%'};return _0x35771d;}})});}_0x4208b5=_[_0x9665('0x43')]({},_0x4208b5,_0x54c0f5[_0x9665('0x46')]);var _0x493c0e={'where':_0x4208b5[_0x9665('0x40')]};return db[_0x9665('0x47')]['count'](_0x493c0e)[_0x9665('0x2d')](function(_0x570f5c){_0x336c32[_0x9665('0x24')]=_0x570f5c;if(_0x54c0f5[_0x9665('0x37')][_0x9665('0x48')]){_0x4208b5[_0x9665('0x49')]=[{'all':!![]}];}return db[_0x9665('0x47')][_0x9665('0x4a')](_0x4208b5);})['then'](function(_0x234610){_0x336c32[_0x9665('0x4b')]=_0x234610;return _0x336c32;})[_0x9665('0x2d')](respondWithFilteredResult(_0x3aa324,_0x4208b5))[_0x9665('0x4c')](handleError(_0x3aa324,null));};exports['show']=function(_0x3d2d67,_0x12d574){var _0x590fd4={'raw':!![],'where':{'id':_0x3d2d67['params']['id']}},_0x4ec039={};_0x4ec039['model']=_[_0x9665('0x4d')](db['ChatInternalMessage'][_0x9665('0x34')]);_0x4ec039[_0x9665('0x37')]=_[_0x9665('0x4d')](_0x3d2d67['query']);_0x4ec039['filters']=_[_0x9665('0x3a')](_0x4ec039['model'],_0x4ec039[_0x9665('0x37')]);_0x590fd4[_0x9665('0x39')]=_[_0x9665('0x3a')](_0x4ec039[_0x9665('0x36')],qs[_0x9665('0x3b')](_0x3d2d67[_0x9665('0x37')][_0x9665('0x3b')]));_0x590fd4[_0x9665('0x39')]=_0x590fd4[_0x9665('0x39')]['length']?_0x590fd4[_0x9665('0x39')]:_0x4ec039[_0x9665('0x36')];if(_0x3d2d67['query'][_0x9665('0x48')]){_0x590fd4['include']=[{'all':!![]}];}_0x590fd4=_[_0x9665('0x43')]({},_0x590fd4,_0x3d2d67[_0x9665('0x46')]);return db['ChatInternalMessage'][_0x9665('0x4e')](_0x590fd4)[_0x9665('0x2d')](handleEntityNotFound(_0x12d574,null))[_0x9665('0x2d')](respondWithResult(_0x12d574,null))[_0x9665('0x4c')](handleError(_0x12d574,null));};exports[_0x9665('0x4f')]=function(_0x2d3f1b,_0x4d9360){return db[_0x9665('0x47')][_0x9665('0x4f')](_0x2d3f1b['body'],{})[_0x9665('0x2d')](respondWithResult(_0x4d9360,0xc9))[_0x9665('0x4c')](handleError(_0x4d9360,null));};exports[_0x9665('0x2c')]=function(_0x3a22c7,_0x179280){if(_0x3a22c7[_0x9665('0x50')]['id']){delete _0x3a22c7['body']['id'];}return db[_0x9665('0x47')][_0x9665('0x4e')]({'where':{'id':_0x3a22c7[_0x9665('0x51')]['id']}})['then'](handleEntityNotFound(_0x179280,null))['then'](saveUpdates(_0x3a22c7[_0x9665('0x50')],null))[_0x9665('0x2d')](respondWithResult(_0x179280,null))[_0x9665('0x4c')](handleError(_0x179280,null));};exports[_0x9665('0x2e')]=function(_0x5e91aa,_0x27612a){return db[_0x9665('0x47')][_0x9665('0x4e')]({'where':{'id':_0x5e91aa[_0x9665('0x51')]['id']}})['then'](handleEntityNotFound(_0x27612a,null))[_0x9665('0x2d')](removeEntity(_0x27612a,null))['catch'](handleError(_0x27612a,null));};exports['describe']=function(_0x245b93,_0x4c5e41){return db[_0x9665('0x47')]['describe']()[_0x9665('0x2d')](respondWithResult(_0x4c5e41,null))[_0x9665('0x4c')](handleError(_0x4c5e41,null));};function wrapUser(_0x16825e){return function(_0x10d33b){var _0x2fdd32=_0x16825e[_0x9665('0x52')]({'plain':!![]});_0x2fdd32[_0x9665('0x53')]=[];if(_0x10d33b){_0x2fdd32[_0x9665('0x54')]=_0x10d33b[_0x9665('0x55')];_0x2fdd32[_0x9665('0x56')]=_0x10d33b;}else{_0x2fdd32[_0x9665('0x54')]=moment(0x0)[_0x9665('0x57')](_0x9665('0x58'));_0x2fdd32[_0x9665('0x56')]={};}return _0x2fdd32;};}exports['getUsers']=function(_0x32ed5e,_0x5f119c,_0x56124b){var _0x4a180b=[];return db['User'][_0x9665('0x4a')]({'where':{'role':[_0x9665('0x59'),'admin',_0x9665('0x5a')]},'attributes':['id',_0x9665('0x5b'),_0x9665('0x30'),_0x9665('0x5c'),_0x9665('0x5d'),_0x9665('0x5e'),_0x9665('0x5f'),_0x9665('0x60'),_0x9665('0x61'),_0x9665('0x62')],'order':qs[_0x9665('0x3f')](_0x9665('0x63')),'include':[{'model':db[_0x9665('0x64')],'as':'VoiceQueues','attributes':['id','name',_0x9665('0x44')],'through':{'attributes':[]}}]})['then'](function(_0x3dcbfc){if(_0x3dcbfc){var _0x1c73b0=_0x32ed5e[_0x9665('0x5a')][_0x9665('0x52')]({'plain':!![]});if(!_0x1c73b0)throw new Error(_0x9665('0x65'));if(_0x1c73b0['role']==='user'){return db[_0x9665('0x66')][_0x9665('0x4e')]({'where':{'name':_0x9665('0x67'),'userProfileId':_0x1c73b0[_0x9665('0x68')]},'raw':!![]})[_0x9665('0x2d')](function(_0x52333c){if(_0x52333c){if(_0x52333c[_0x9665('0x69')]===0x0){return db[_0x9665('0x6a')]['findAll']({'where':{'sectionId':_0x52333c['id']},'raw':!![]})['then'](function(_0x404889){var _0x358a89=[];if(_['isEmpty'](_0x404889)){_0x358a89=_['filter'](_0x3dcbfc,function(_0x1eef79){if(_0x1eef79[_0x9665('0x5c')]!==_0x9665('0x59')){return _0x1eef79;}});return _0x358a89;}else{for(var _0x4d6f4e=0x0;_0x4d6f4e<_0x3dcbfc[_0x9665('0x6b')];_0x4d6f4e++){var _0x40cf59=_0x3dcbfc[_0x4d6f4e];if(_0x40cf59['role']==='agent'){var _0x5be196=_[_0x9665('0x4e')](_0x404889,function(_0x43b8df){return _0x43b8df['resourceId']===_0x40cf59['id'];});if(_0x5be196)_0x358a89['push'](_0x40cf59);}else{_0x358a89[_0x9665('0x6c')](_0x40cf59);}}return _0x358a89;}});}else{return _0x3dcbfc;}}else{var _0x5b4892=_[_0x9665('0x42')](_0x3dcbfc,function(_0x55f4a4){if(_0x55f4a4[_0x9665('0x5c')]!==_0x9665('0x59')){return _0x55f4a4;}});return _0x5b4892;}});}else{return _0x3dcbfc;}}})[_0x9665('0x2d')](function(_0x2e2eb7){var _0x33876e=[];if(_0x2e2eb7){_0x4a180b=_0x2e2eb7;for(var _0x440e39=0x0;_0x440e39<_0x2e2eb7[_0x9665('0x6b')];_0x440e39+=0x1){_0x4a180b[_0x440e39][_0x9665('0x53')]=[];_0x33876e[_0x9665('0x6c')](db[_0x9665('0x47')][_0x9665('0x4e')]({'where':{'FromId':[_0x32ed5e[_0x9665('0x5a')]['id'],_0x2e2eb7[_0x440e39]['id']],'ToId':[_0x32ed5e['user']['id'],_0x2e2eb7[_0x440e39]['id']],'ChatGroupId':null},'attributes':['id',_0x9665('0x55'),_0x9665('0x6d'),_0x9665('0x6e'),_0x9665('0x6f'),_0x9665('0x50')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9665('0x2d')](wrapUser(_0x2e2eb7[_0x440e39])));}return BPromise[_0x9665('0x70')](_0x33876e);}return[];})[_0x9665('0x2d')](function(_0x1e36e0){return{'rows':_0x1e36e0,'count':_0x1e36e0[_0x9665('0x6b')]};})[_0x9665('0x2d')](respondWithResult(_0x5f119c,null))[_0x9665('0x4c')](handleError(_0x5f119c,null));};
\ No newline at end of file
+var _0x326c=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','status','json','count','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','model','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','admin','user','fullname','role','userpic','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Agents','userProfileId','agent','resourceId','push','ToId','read','all','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x6788fd,_0x1b5fb2){var _0x2c218b=function(_0x4c2abf){while(--_0x4c2abf){_0x6788fd['push'](_0x6788fd['shift']());}};_0x2c218b(++_0x1b5fb2);}(_0x326c,0x13b));var _0xc326=function(_0x619634,_0x5e5e62){_0x619634=_0x619634-0x0;var _0x5f4629=_0x326c[_0x619634];return _0x5f4629;};'use strict';var pdf=require(_0xc326('0x0'));var emlformat=require(_0xc326('0x1'));var rimraf=require(_0xc326('0x2'));var zipdir=require(_0xc326('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc326('0x4'));var moment=require(_0xc326('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc326('0x6'));var util=require(_0xc326('0x7'));var path=require(_0xc326('0x8'));var sox=require(_0xc326('0x9'));var csv=require(_0xc326('0xa'));var ejs=require(_0xc326('0xb'));var fs=require('fs');var _=require(_0xc326('0xc'));var squel=require(_0xc326('0xd'));var crypto=require(_0xc326('0xe'));var jsforce=require(_0xc326('0xf'));var deskjs=require(_0xc326('0x10'));var toCsv=require(_0xc326('0xa'));var querystring=require(_0xc326('0x11'));var Papa=require(_0xc326('0x12'));var Redis=require(_0xc326('0x13'));var authService=require(_0xc326('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc326('0x15'));var hardwareService=require(_0xc326('0x16'));var logger=require(_0xc326('0x17'))(_0xc326('0x18'));var utils=require(_0xc326('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc326('0x1a'));var db=require(_0xc326('0x1b'))['db'];config[_0xc326('0x1c')]=_[_0xc326('0x1d')](config[_0xc326('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc326('0x1c')]));require(_0xc326('0x1e'))[_0xc326('0x1f')](socket);function respondWithStatusCode(_0x46a1d0,_0x4817e4){_0x4817e4=_0x4817e4||0xcc;return function(_0x2d5a20){if(_0x2d5a20){return _0x46a1d0['sendStatus'](_0x4817e4);}return _0x46a1d0[_0xc326('0x20')](_0x4817e4)['end']();};}function respondWithResult(_0x215582,_0x225731){_0x225731=_0x225731||0xc8;return function(_0x1a8f06){if(_0x1a8f06){return _0x215582['status'](_0x225731)[_0xc326('0x21')](_0x1a8f06);}};}function respondWithFilteredResult(_0x40e63b,_0x14b772){return function(_0x22a4b0){if(_0x22a4b0){var _0x3b8846=_0x22a4b0[_0xc326('0x22')],_0x5d3bcb=_0x14b772[_0xc326('0x23')],_0x5a4f08=_0x14b772[_0xc326('0x23')]+_0x14b772['limit'],_0x8e2d24;if(_0x5a4f08>=_0x3b8846){_0x5a4f08=_0x3b8846;_0x8e2d24=0xc8;}else{_0x8e2d24=0xce;}_0x40e63b[_0xc326('0x20')](_0x8e2d24);return _0x40e63b[_0xc326('0x24')](_0xc326('0x25'),_0x5d3bcb+'-'+_0x5a4f08+'/'+_0x3b8846)[_0xc326('0x21')](_0x22a4b0);}return null;};}function patchUpdates(_0x42523d){return function(_0x2b0280){try{jsonpatch[_0xc326('0x26')](_0x2b0280,_0x42523d,!![]);}catch(_0x5a2614){return BPromise[_0xc326('0x27')](_0x5a2614);}return _0x2b0280['save']();};}function saveUpdates(_0x1f98ed,_0x1b61f7){return function(_0x121481){if(_0x121481){return _0x121481[_0xc326('0x28')](_0x1f98ed)[_0xc326('0x29')](function(_0x37e692){return _0x37e692;});}return null;};}function removeEntity(_0x4f1b36,_0x96b734){return function(_0x38a6fc){if(_0x38a6fc){return _0x38a6fc['destroy']()[_0xc326('0x29')](function(){_0x4f1b36[_0xc326('0x20')](0xcc)[_0xc326('0x2a')]();});}};}function handleEntityNotFound(_0x237fb6,_0x46c7fd){return function(_0x2181ae){if(!_0x2181ae){_0x237fb6[_0xc326('0x2b')](0x194);}return _0x2181ae;};}function handleError(_0x3973f2,_0x1ca974){_0x1ca974=_0x1ca974||0x1f4;return function(_0x4d62ac){logger[_0xc326('0x2c')](_0x4d62ac[_0xc326('0x2d')]);if(_0x4d62ac['name']){delete _0x4d62ac[_0xc326('0x2e')];}_0x3973f2[_0xc326('0x20')](_0x1ca974)[_0xc326('0x2f')](_0x4d62ac);};}exports[_0xc326('0x30')]=function(_0x42c7b1,_0x5ac16b){var _0x37428c={},_0x1d6881={},_0xb38f15={'count':0x0,'rows':[]};var _0xc1b701=_[_0xc326('0x31')](db[_0xc326('0x32')][_0xc326('0x33')],function(_0x3cc520){return{'name':_0x3cc520[_0xc326('0x34')],'type':_0x3cc520[_0xc326('0x35')][_0xc326('0x36')]};});_0x1d6881['model']=_[_0xc326('0x31')](_0xc1b701,_0xc326('0x2e'));_0x1d6881['query']=_[_0xc326('0x37')](_0x42c7b1[_0xc326('0x38')]);_0x1d6881['filters']=_[_0xc326('0x39')](_0x1d6881['model'],_0x1d6881[_0xc326('0x38')]);_0x37428c[_0xc326('0x3a')]=_[_0xc326('0x39')](_0x1d6881['model'],qs[_0xc326('0x3b')](_0x42c7b1[_0xc326('0x38')][_0xc326('0x3b')]));_0x37428c['attributes']=_0x37428c[_0xc326('0x3a')][_0xc326('0x3c')]?_0x37428c['attributes']:_0x1d6881['model'];if(!_0x42c7b1['query'][_0xc326('0x3d')](_0xc326('0x3e'))){_0x37428c[_0xc326('0x3f')]=qs[_0xc326('0x3f')](_0x42c7b1[_0xc326('0x38')]['limit']);_0x37428c[_0xc326('0x23')]=qs['offset'](_0x42c7b1['query'][_0xc326('0x23')]);}_0x37428c[_0xc326('0x40')]=qs[_0xc326('0x41')](_0x42c7b1[_0xc326('0x38')][_0xc326('0x41')]);_0x37428c[_0xc326('0x42')]=qs['filters'](_['pick'](_0x42c7b1[_0xc326('0x38')],_0x1d6881[_0xc326('0x43')]),_0xc1b701);if(_0x42c7b1[_0xc326('0x38')]['filter']){_0x37428c['where']=_[_0xc326('0x44')](_0x37428c['where'],{'$or':_['map'](_0xc1b701,function(_0x2cbf7a){if(_0x2cbf7a['type']!==_0xc326('0x45')){var _0x34663f={};_0x34663f[_0x2cbf7a[_0xc326('0x2e')]]={'$like':'%'+_0x42c7b1['query'][_0xc326('0x46')]+'%'};return _0x34663f;}})});}_0x37428c=_[_0xc326('0x44')]({},_0x37428c,_0x42c7b1[_0xc326('0x47')]);var _0x5115cd={'where':_0x37428c['where']};return db[_0xc326('0x32')][_0xc326('0x22')](_0x5115cd)[_0xc326('0x29')](function(_0x3ec512){_0xb38f15[_0xc326('0x22')]=_0x3ec512;if(_0x42c7b1[_0xc326('0x38')][_0xc326('0x48')]){_0x37428c[_0xc326('0x49')]=[{'all':!![]}];}return db[_0xc326('0x32')][_0xc326('0x4a')](_0x37428c);})[_0xc326('0x29')](function(_0x4b1ef3){_0xb38f15['rows']=_0x4b1ef3;return _0xb38f15;})[_0xc326('0x29')](respondWithFilteredResult(_0x5ac16b,_0x37428c))[_0xc326('0x4b')](handleError(_0x5ac16b,null));};exports[_0xc326('0x4c')]=function(_0x1b880a,_0x5dafae){var _0x5dd9cf={'raw':!![],'where':{'id':_0x1b880a[_0xc326('0x4d')]['id']}},_0x31c26a={};_0x31c26a[_0xc326('0x4e')]=_[_0xc326('0x37')](db['ChatInternalMessage'][_0xc326('0x33')]);_0x31c26a[_0xc326('0x38')]=_[_0xc326('0x37')](_0x1b880a[_0xc326('0x38')]);_0x31c26a['filters']=_[_0xc326('0x39')](_0x31c26a[_0xc326('0x4e')],_0x31c26a['query']);_0x5dd9cf[_0xc326('0x3a')]=_[_0xc326('0x39')](_0x31c26a[_0xc326('0x4e')],qs[_0xc326('0x3b')](_0x1b880a[_0xc326('0x38')][_0xc326('0x3b')]));_0x5dd9cf[_0xc326('0x3a')]=_0x5dd9cf[_0xc326('0x3a')][_0xc326('0x3c')]?_0x5dd9cf[_0xc326('0x3a')]:_0x31c26a['model'];if(_0x1b880a[_0xc326('0x38')]['includeAll']){_0x5dd9cf[_0xc326('0x49')]=[{'all':!![]}];}_0x5dd9cf=_[_0xc326('0x44')]({},_0x5dd9cf,_0x1b880a[_0xc326('0x47')]);return db[_0xc326('0x32')][_0xc326('0x4f')](_0x5dd9cf)['then'](handleEntityNotFound(_0x5dafae,null))[_0xc326('0x29')](respondWithResult(_0x5dafae,null))['catch'](handleError(_0x5dafae,null));};exports['create']=function(_0x3a0c97,_0x549a44){return db[_0xc326('0x32')][_0xc326('0x50')](_0x3a0c97['body'],{})[_0xc326('0x29')](respondWithResult(_0x549a44,0xc9))[_0xc326('0x4b')](handleError(_0x549a44,null));};exports[_0xc326('0x28')]=function(_0x3da64d,_0x5b2e8d){if(_0x3da64d[_0xc326('0x51')]['id']){delete _0x3da64d['body']['id'];}return db[_0xc326('0x32')]['find']({'where':{'id':_0x3da64d[_0xc326('0x4d')]['id']}})[_0xc326('0x29')](handleEntityNotFound(_0x5b2e8d,null))[_0xc326('0x29')](saveUpdates(_0x3da64d[_0xc326('0x51')],null))[_0xc326('0x29')](respondWithResult(_0x5b2e8d,null))[_0xc326('0x4b')](handleError(_0x5b2e8d,null));};exports[_0xc326('0x52')]=function(_0x4137c2,_0x38bf1f){return db[_0xc326('0x32')][_0xc326('0x4f')]({'where':{'id':_0x4137c2[_0xc326('0x4d')]['id']}})[_0xc326('0x29')](handleEntityNotFound(_0x38bf1f,null))[_0xc326('0x29')](removeEntity(_0x38bf1f,null))[_0xc326('0x4b')](handleError(_0x38bf1f,null));};exports['describe']=function(_0x571733,_0x64d584){return db[_0xc326('0x32')][_0xc326('0x53')]()[_0xc326('0x29')](respondWithResult(_0x64d584,null))[_0xc326('0x4b')](handleError(_0x64d584,null));};function wrapUser(_0x2b5686){return function(_0x4c2c32){var _0x5f09c7=_0x2b5686[_0xc326('0x54')]({'plain':!![]});_0x5f09c7[_0xc326('0x55')]=[];if(_0x4c2c32){_0x5f09c7[_0xc326('0x56')]=_0x4c2c32[_0xc326('0x57')];_0x5f09c7[_0xc326('0x58')]=_0x4c2c32;}else{_0x5f09c7[_0xc326('0x56')]=moment(0x0)[_0xc326('0x59')](_0xc326('0x5a'));_0x5f09c7[_0xc326('0x58')]={};}return _0x5f09c7;};}exports['getUsers']=function(_0x15f877,_0x5306f9,_0x2263a3){var _0x596686=[];return db['User']['findAll']({'where':{'role':['agent',_0xc326('0x5b'),_0xc326('0x5c')]},'attributes':['id',_0xc326('0x5d'),_0xc326('0x2e'),_0xc326('0x5e'),_0xc326('0x5f'),'internal','online',_0xc326('0x60'),'allowmessenger',_0xc326('0x61')],'order':qs['sort'](_0xc326('0x62')),'include':[{'model':db[_0xc326('0x63')],'as':_0xc326('0x64'),'attributes':['id',_0xc326('0x2e'),_0xc326('0x35')],'through':{'attributes':[]}}]})['then'](function(_0x52eed0){if(_0x52eed0){var _0x3cc200=_0x15f877[_0xc326('0x5c')][_0xc326('0x54')]({'plain':!![]});if(!_0x3cc200)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cc200['role']===_0xc326('0x5c')){return db['UserProfileSection']['find']({'where':{'name':_0xc326('0x65'),'userProfileId':_0x3cc200[_0xc326('0x66')]},'raw':!![]})[_0xc326('0x29')](function(_0x24b9a4){if(_0x24b9a4){if(_0x24b9a4['autoAssociation']===0x0){return db['UserProfileResource'][_0xc326('0x4a')]({'where':{'sectionId':_0x24b9a4['id']},'raw':!![]})[_0xc326('0x29')](function(_0xfcf0d2){var _0x1340ea=[];if(_['isEmpty'](_0xfcf0d2)){_0x1340ea=_[_0xc326('0x46')](_0x52eed0,function(_0x5942d5){if(_0x5942d5[_0xc326('0x5e')]!=='agent'){return _0x5942d5;}});return _0x1340ea;}else{for(var _0x55f2f9=0x0;_0x55f2f9<_0x52eed0[_0xc326('0x3c')];_0x55f2f9++){var _0x4dba01=_0x52eed0[_0x55f2f9];if(_0x4dba01[_0xc326('0x5e')]===_0xc326('0x67')){var _0x1f1d9d=_[_0xc326('0x4f')](_0xfcf0d2,function(_0x1d7711){return _0x1d7711[_0xc326('0x68')]===_0x4dba01['id'];});if(_0x1f1d9d)_0x1340ea[_0xc326('0x69')](_0x4dba01);}else{_0x1340ea[_0xc326('0x69')](_0x4dba01);}}return _0x1340ea;}});}else{return _0x52eed0;}}else{var _0x2161bd=_['filter'](_0x52eed0,function(_0x1462df){if(_0x1462df[_0xc326('0x5e')]!=='agent'){return _0x1462df;}});return _0x2161bd;}});}else{return _0x52eed0;}}})['then'](function(_0x483dd4){var _0x127d09=[];if(_0x483dd4){_0x596686=_0x483dd4;for(var _0x26b51f=0x0;_0x26b51f<_0x483dd4[_0xc326('0x3c')];_0x26b51f+=0x1){_0x596686[_0x26b51f][_0xc326('0x55')]=[];_0x127d09[_0xc326('0x69')](db[_0xc326('0x32')][_0xc326('0x4f')]({'where':{'FromId':[_0x15f877[_0xc326('0x5c')]['id'],_0x483dd4[_0x26b51f]['id']],'ToId':[_0x15f877[_0xc326('0x5c')]['id'],_0x483dd4[_0x26b51f]['id']],'ChatGroupId':null},'attributes':['id',_0xc326('0x57'),'FromId',_0xc326('0x6a'),_0xc326('0x6b'),'body'],'order':qs[_0xc326('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc326('0x29')](wrapUser(_0x483dd4[_0x26b51f])));}return BPromise[_0xc326('0x6c')](_0x127d09);}return[];})['then'](function(_0x17fc00){return{'rows':_0x17fc00,'count':_0x17fc00[_0xc326('0x3c')]};})['then'](respondWithResult(_0x5306f9,null))[_0xc326('0x4b')](handleError(_0x5306f9,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 3fe627b..d0d1c1d 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 _0x5af9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x2db4b2,_0x5a978b){var _0x1e993b=function(_0xd57833){while(--_0xd57833){_0x2db4b2['push'](_0x2db4b2['shift']());}};_0x1e993b(++_0x5a978b);}(_0x5af9,0xdc));var _0x95af=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x5af9[_0x710815];return _0x5b3b89;};'use strict';var EventEmitter=require(_0x95af('0x0'));var ChatInternalMessage=require(_0x95af('0x1'))['db'][_0x95af('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x95af('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3fe14a){return function(_0x111852,_0x44f419,_0x583ef1){ChatInternalMessageEvents[_0x95af('0x4')](_0x3fe14a+':'+_0x111852['id'],_0x111852);ChatInternalMessageEvents[_0x95af('0x4')](_0x3fe14a,_0x111852);_0x583ef1(null);};}for(var e in events){if(events[_0x95af('0x5')](e)){var event=events[e];ChatInternalMessage[_0x95af('0x6')](e,emitEvent(event));}}module[_0x95af('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8838=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x8838,0xeb));var _0x8883=function(_0x40ec80,_0x349400){_0x40ec80=_0x40ec80-0x0;var _0x37bde8=_0x8838[_0x40ec80];return _0x37bde8;};'use strict';var EventEmitter=require(_0x8883('0x0'));var ChatInternalMessage=require(_0x8883('0x1'))['db'][_0x8883('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8883('0x3')](0x0);var events={'afterCreate':_0x8883('0x4'),'afterUpdate':'update','afterDestroy':_0x8883('0x5')};function emitEvent(_0x5cd654){return function(_0x38fe28,_0x11bac0,_0x2c689d){ChatInternalMessageEvents['emit'](_0x5cd654+':'+_0x38fe28['id'],_0x38fe28);ChatInternalMessageEvents[_0x8883('0x6')](_0x5cd654,_0x38fe28);_0x2c689d(null);};}for(var e in events){if(events[_0x8883('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x8883('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 d48b0bc..aab7f57 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(_0x3bd56a,_0x5b0eb5){var _0x4b2849=function(_0x380730){while(--_0x380730){_0x3bd56a['push'](_0x3bd56a['shift']());}};_0x4b2849(++_0x5b0eb5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1a1bc6,_0x1763c1){_0x1a1bc6=_0x1a1bc6-0x0;var _0xf264c5=_0x9ffd[_0x1a1bc6];return _0xf264c5;};'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 _0xbdb7=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2fac71,_0x2ae81d){_0x2fac71=_0x2fac71-0x0;var _0x28cb27=_0xbdb7[_0x2fac71];return _0x28cb27;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bdb('0xb'),'collate':_0x7bdb('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index c7f8b37..6c46504 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 _0xd884=['stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x124033,_0x422590){var _0x453b40=function(_0x352fd8){while(--_0x352fd8){_0x124033['push'](_0x124033['shift']());}};_0x453b40(++_0x422590);}(_0xd884,0x6f));var _0x4d88=function(_0x46b5b1,_0x373190){_0x46b5b1=_0x46b5b1-0x0;var _0x344652=_0xd884[_0x46b5b1];return _0x344652;};'use strict';var _=require(_0x4d88('0x0'));var util=require(_0x4d88('0x1'));var moment=require(_0x4d88('0x2'));var BPromise=require(_0x4d88('0x3'));var rs=require(_0x4d88('0x4'));var fs=require('fs');var Redis=require(_0x4d88('0x5'));var db=require(_0x4d88('0x6'))['db'];var utils=require(_0x4d88('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d88('0x8')]({'port':0x232a});config[_0x4d88('0x9')]=_['defaults'](config[_0x4d88('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d88('0xa'))(new Redis(config[_0x4d88('0x9')]));require(_0x4d88('0xb'))[_0x4d88('0xc')](socket);function respondWithRpcPromise(_0x6e66e1,_0x43ac77,_0x46cc5b){return new BPromise(function(_0x339e16,_0x46b18c){return client[_0x4d88('0xd')](_0x6e66e1,_0x46cc5b)[_0x4d88('0xe')](function(_0x204f82){logger[_0x4d88('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x43ac77,_0x4d88('0x10'));logger[_0x4d88('0x11')](_0x4d88('0x12'),_0x43ac77,_0x4d88('0x10'),JSON[_0x4d88('0x13')](_0x204f82));if(_0x204f82[_0x4d88('0x14')]){if(_0x204f82[_0x4d88('0x14')][_0x4d88('0x15')]===0x1f4){logger[_0x4d88('0x14')](_0x4d88('0x16'),_0x43ac77,_0x204f82[_0x4d88('0x14')][_0x4d88('0x17')]);return _0x46b18c(_0x204f82[_0x4d88('0x14')]['message']);}logger[_0x4d88('0x14')](_0x4d88('0x16'),_0x43ac77,_0x204f82[_0x4d88('0x14')][_0x4d88('0x17')]);return _0x339e16(_0x204f82[_0x4d88('0x14')]['message']);}else{logger[_0x4d88('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x43ac77,_0x4d88('0x10'));_0x339e16(_0x204f82[_0x4d88('0x18')][_0x4d88('0x17')]);}})[_0x4d88('0x19')](function(_0x3ccbed){logger[_0x4d88('0x14')](_0x4d88('0x16'),_0x43ac77,_0x3ccbed);_0x46b18c(_0x3ccbed);});});}
\ No newline at end of file
+var _0xf8b2=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e3b0e,_0xf2d310){var _0x20069e=function(_0x44828c){while(--_0x44828c){_0x3e3b0e['push'](_0x3e3b0e['shift']());}};_0x20069e(++_0xf2d310);}(_0xf8b2,0xc1));var _0x2f8b=function(_0x55b35e,_0x12e037){_0x55b35e=_0x55b35e-0x0;var _0x1278ac=_0xf8b2[_0x55b35e];return _0x1278ac;};'use strict';var _=require('lodash');var util=require(_0x2f8b('0x0'));var moment=require(_0x2f8b('0x1'));var BPromise=require(_0x2f8b('0x2'));var rs=require(_0x2f8b('0x3'));var fs=require('fs');var Redis=require(_0x2f8b('0x4'));var db=require(_0x2f8b('0x5'))['db'];var utils=require(_0x2f8b('0x6'));var logger=require(_0x2f8b('0x7'))(_0x2f8b('0x8'));var config=require(_0x2f8b('0x9'));var jayson=require(_0x2f8b('0xa'));var client=jayson['client'][_0x2f8b('0xb')]({'port':0x232a});config[_0x2f8b('0xc')]=_[_0x2f8b('0xd')](config[_0x2f8b('0xc')],{'host':_0x2f8b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f8b('0xc')]));require(_0x2f8b('0xf'))[_0x2f8b('0x10')](socket);function respondWithRpcPromise(_0x250a24,_0x3267b6,_0x41a5ff){return new BPromise(function(_0x107242,_0xb05108){return client[_0x2f8b('0x11')](_0x250a24,_0x41a5ff)['then'](function(_0x36f25a){logger[_0x2f8b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x3267b6,_0x2f8b('0x13'));logger[_0x2f8b('0x14')](_0x2f8b('0x15'),_0x3267b6,_0x2f8b('0x13'),JSON[_0x2f8b('0x16')](_0x36f25a));if(_0x36f25a[_0x2f8b('0x17')]){if(_0x36f25a[_0x2f8b('0x17')][_0x2f8b('0x18')]===0x1f4){logger[_0x2f8b('0x17')](_0x2f8b('0x19'),_0x3267b6,_0x36f25a['error'][_0x2f8b('0x1a')]);return _0xb05108(_0x36f25a[_0x2f8b('0x17')][_0x2f8b('0x1a')]);}logger['error'](_0x2f8b('0x19'),_0x3267b6,_0x36f25a[_0x2f8b('0x17')][_0x2f8b('0x1a')]);return _0x107242(_0x36f25a[_0x2f8b('0x17')]['message']);}else{logger[_0x2f8b('0x12')](_0x2f8b('0x19'),_0x3267b6,'request\x20sent');_0x107242(_0x36f25a['result'][_0x2f8b('0x1a')]);}})['catch'](function(_0x5df48b){logger['error'](_0x2f8b('0x19'),_0x3267b6,_0x5df48b);_0xb05108(_0x5df48b);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7dc26f4..1ccc59f 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 _0x7333=['./chatInternalMessage.events','remove','removeListener','length'];(function(_0x4adac9,_0x29cd19){var _0x187968=function(_0x289b54){while(--_0x289b54){_0x4adac9['push'](_0x4adac9['shift']());}};_0x187968(++_0x29cd19);}(_0x7333,0xfc));var _0x3733=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7333[_0x17d9e3];return _0x14192d;};'use strict';var ChatInternalMessageEvents=require(_0x3733('0x0'));var events=['save',_0x3733('0x1'),'update'];function createListener(_0x2b6c52,_0x146076){return function(_0x1c96f5){_0x146076['emit'](_0x2b6c52,_0x1c96f5);};}function removeListener(_0x1bf202,_0x3959ac){return function(){ChatInternalMessageEvents[_0x3733('0x2')](_0x1bf202,_0x3959ac);};}exports['register']=function(_0xa51fdb){for(var _0x27c9b7=0x0,_0x3330c6=events[_0x3733('0x3')];_0x27c9b7<_0x3330c6;_0x27c9b7++){var _0x5b5a50=events[_0x27c9b7];var _0x1ee542=createListener('chatInternalMessage:'+_0x5b5a50,_0xa51fdb);ChatInternalMessageEvents['on'](_0x5b5a50,_0x1ee542);}};
\ No newline at end of file
+var _0xd847=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xd847,0x18a));var _0x7d84=function(_0x1d96b6,_0x289b87){_0x1d96b6=_0x1d96b6-0x0;var _0x2667d2=_0xd847[_0x1d96b6];return _0x2667d2;};'use strict';var ChatInternalMessageEvents=require(_0x7d84('0x0'));var events=[_0x7d84('0x1'),_0x7d84('0x2'),_0x7d84('0x3')];function createListener(_0x58816d,_0x5a1e39){return function(_0x4492d5){_0x5a1e39[_0x7d84('0x4')](_0x58816d,_0x4492d5);};}function removeListener(_0x207e6f,_0x15f200){return function(){ChatInternalMessageEvents[_0x7d84('0x5')](_0x207e6f,_0x15f200);};}exports['register']=function(_0x1544e7){for(var _0x5d8f76=0x0,_0x3c57cd=events[_0x7d84('0x6')];_0x5d8f76<_0x3c57cd;_0x5d8f76++){var _0x1d6297=events[_0x5d8f76];var _0x32da6d=createListener(_0x7d84('0x7')+_0x1d6297,_0x1544e7);ChatInternalMessageEvents['on'](_0x1d6297,_0x32da6d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index bc99df2..5ca212b 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 _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x15bb81,_0xa0b321){var _0x4c7218=function(_0xc44f74){while(--_0xc44f74){_0x15bb81['push'](_0x15bb81['shift']());}};_0x4c7218(++_0xa0b321);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xb7e7[_0x1ae5ab];return _0x1ce001;};'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
+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(_0x8ea77e,_0x3996d6){var _0x395958=function(_0x30271c){while(--_0x30271c){_0x8ea77e['push'](_0x8ea77e['shift']());}};_0x395958(++_0x3996d6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb7e7[_0x468b0f];return _0x3e74d9;};'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 79e0669..5e39919 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 _0x235b=['exports','TEXT','medium','BOOLEAN','out','STRING','sequelize'];(function(_0xa9714f,_0x5ef031){var _0x3bf072=function(_0x342134){while(--_0x342134){_0xa9714f['push'](_0xa9714f['shift']());}};_0x3bf072(++_0x5ef031);}(_0x235b,0xca));var _0xb235=function(_0x469889,_0x1e640a){_0x469889=_0x469889-0x0;var _0x3e72c1=_0x235b[_0x469889];return _0x3e72c1;};'use strict';var Sequelize=require(_0xb235('0x0'));module[_0xb235('0x1')]={'body':{'type':Sequelize[_0xb235('0x2')](_0xb235('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb235('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb235('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb235('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb235('0x6')]},'providerResponse':{'type':Sequelize[_0xb235('0x2')]}};
\ No newline at end of file
+var _0xfc18=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc18,0xc7));var _0x8fc1=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0xfc18[_0x35af23];return _0x340506;};'use strict';var Sequelize=require('sequelize');module[_0x8fc1('0x0')]={'body':{'type':Sequelize[_0x8fc1('0x1')](_0x8fc1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8fc1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8fc1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8fc1('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8fc1('0x5')]},'providerName':{'type':Sequelize[_0x8fc1('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 59b3cf8..564bc29 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 _0xc6e3=['includeAll','include','findAll','show','intersection','length','find','create','body','params','describe','chat-interactions','accept','read','readAt','format','UserId','CmContact','Contact','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','acceptMessage','manual','channel','event','EventManager','acceptmessage','parse','chat','agent','ChatInteraction','[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','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','catch','status','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','keys','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','count'];(function(_0x490da9,_0x31214f){var _0x5b9821=function(_0x1423e0){while(--_0x1423e0){_0x490da9['push'](_0x490da9['shift']());}};_0x5b9821(++_0x31214f);}(_0xc6e3,0x11e));var _0x3c6e=function(_0x239e6d,_0x31be14){_0x239e6d=_0x239e6d-0x0;var _0x8d1bd5=_0xc6e3[_0x239e6d];return _0x8d1bd5;};'use strict';var pdf=require(_0x3c6e('0x0'));var emlformat=require(_0x3c6e('0x1'));var rimraf=require(_0x3c6e('0x2'));var zipdir=require(_0x3c6e('0x3'));var jsonpatch=require(_0x3c6e('0x4'));var rp=require(_0x3c6e('0x5'));var moment=require(_0x3c6e('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3c6e('0x7'));var sox=require(_0x3c6e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c6e('0x9'));var squel=require(_0x3c6e('0xa'));var crypto=require('crypto');var jsforce=require(_0x3c6e('0xb'));var deskjs=require(_0x3c6e('0xc'));var toCsv=require(_0x3c6e('0xd'));var querystring=require(_0x3c6e('0xe'));var Papa=require(_0x3c6e('0xf'));var Redis=require(_0x3c6e('0x10'));var authService=require(_0x3c6e('0x11'));var qs=require(_0x3c6e('0x12'));var as=require(_0x3c6e('0x13'));var hardwareService=require(_0x3c6e('0x14'));var logger=require(_0x3c6e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3c6e('0x16'));var licenseUtil=require(_0x3c6e('0x17'));var db=require(_0x3c6e('0x18'))['db'];config[_0x3c6e('0x19')]=_['defaults'](config[_0x3c6e('0x19')],{'host':_0x3c6e('0x1a'),'port':0x18eb});var socket=require(_0x3c6e('0x1b'))(new Redis(config[_0x3c6e('0x19')]));require('./chatMessage.socket')[_0x3c6e('0x1c')](socket);var jayson=require(_0x3c6e('0x1d'));var client=jayson[_0x3c6e('0x1e')][_0x3c6e('0x1f')]({'port':0x232c});var client9002=jayson[_0x3c6e('0x1e')][_0x3c6e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4750af,_0x17f603,_0x27e192,_0x3643ba){return new BPromise(function(_0x3f48a9,_0x366e6e){var _0x4d8f10=_0x3643ba||client;return _0x4d8f10[_0x3c6e('0x20')](_0x4750af,_0x27e192)['then'](function(_0x5bad43){logger[_0x3c6e('0x21')]('ChatMessage,\x20%s,\x20%s',_0x17f603,_0x3c6e('0x22'));logger[_0x3c6e('0x23')](_0x3c6e('0x24'),_0x17f603,_0x3c6e('0x22'),JSON['stringify'](_0x5bad43));if(_0x5bad43['error']){if(_0x5bad43[_0x3c6e('0x25')][_0x3c6e('0x26')]===0x1f4){logger[_0x3c6e('0x25')](_0x3c6e('0x27'),_0x17f603,_0x5bad43[_0x3c6e('0x25')]['message']);return _0x366e6e(_0x5bad43[_0x3c6e('0x25')][_0x3c6e('0x28')]);}logger[_0x3c6e('0x25')](_0x3c6e('0x27'),_0x17f603,_0x5bad43[_0x3c6e('0x25')][_0x3c6e('0x28')]);return _0x3f48a9(_0x5bad43['error'][_0x3c6e('0x28')]);}else{logger[_0x3c6e('0x21')](_0x3c6e('0x27'),_0x17f603,_0x3c6e('0x22'));_0x3f48a9(_0x5bad43['result'][_0x3c6e('0x28')]);}})[_0x3c6e('0x29')](function(_0x1eb0d0){logger['error'](_0x3c6e('0x27'),_0x17f603,_0x1eb0d0);_0x366e6e(_0x1eb0d0);});});}function respondWithStatusCode(_0x33b540,_0x21a4d9){_0x21a4d9=_0x21a4d9||0xcc;return function(_0xf792c0){if(_0xf792c0){return _0x33b540['sendStatus'](_0x21a4d9);}return _0x33b540[_0x3c6e('0x2a')](_0x21a4d9)['end']();};}function respondWithResult(_0x53518f,_0x1108f1){_0x1108f1=_0x1108f1||0xc8;return function(_0x2aaef7){if(_0x2aaef7){return _0x53518f[_0x3c6e('0x2a')](_0x1108f1)['json'](_0x2aaef7);}};}function respondWithFilteredResult(_0x262f44,_0x1f145c){return function(_0x32acb8){if(_0x32acb8){var _0x355ccd=_0x32acb8['count'],_0x3c0c11=_0x1f145c[_0x3c6e('0x2b')],_0x247cfb=_0x1f145c[_0x3c6e('0x2b')]+_0x1f145c[_0x3c6e('0x2c')],_0x42952f;if(_0x247cfb>=_0x355ccd){_0x247cfb=_0x355ccd;_0x42952f=0xc8;}else{_0x42952f=0xce;}_0x262f44['status'](_0x42952f);return _0x262f44['set'](_0x3c6e('0x2d'),_0x3c0c11+'-'+_0x247cfb+'/'+_0x355ccd)[_0x3c6e('0x2e')](_0x32acb8);}return null;};}function patchUpdates(_0x36cac7){return function(_0x3e2a87){try{jsonpatch[_0x3c6e('0x2f')](_0x3e2a87,_0x36cac7,!![]);}catch(_0x455f6f){return BPromise[_0x3c6e('0x30')](_0x455f6f);}return _0x3e2a87[_0x3c6e('0x31')]();};}function saveUpdates(_0x33d6a6,_0x2feea4){return function(_0x1bb111){if(_0x1bb111){return _0x1bb111[_0x3c6e('0x32')](_0x33d6a6)[_0x3c6e('0x33')](function(_0x43d445){return _0x43d445;});}return null;};}function removeEntity(_0x2174d9,_0x21f2d3){return function(_0x47df04){if(_0x47df04){return _0x47df04[_0x3c6e('0x34')]()[_0x3c6e('0x33')](function(){_0x2174d9[_0x3c6e('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4551eb,_0x2feb74){return function(_0x5bfbc0){if(!_0x5bfbc0){_0x4551eb[_0x3c6e('0x35')](0x194);}return _0x5bfbc0;};}function handleError(_0x3a7a3e,_0x2dfef7){_0x2dfef7=_0x2dfef7||0x1f4;return function(_0x8c726e){logger[_0x3c6e('0x25')](_0x8c726e[_0x3c6e('0x36')]);if(_0x8c726e[_0x3c6e('0x37')]){delete _0x8c726e[_0x3c6e('0x37')];}_0x3a7a3e[_0x3c6e('0x2a')](_0x2dfef7)[_0x3c6e('0x38')](_0x8c726e);};}exports[_0x3c6e('0x39')]=function(_0x49792a,_0x3a67b){var _0x5e582c={},_0x4dfb13={},_0x5ccd97={'count':0x0,'rows':[]};var _0x5c3ca3=_[_0x3c6e('0x3a')](db[_0x3c6e('0x3b')][_0x3c6e('0x3c')],function(_0x48ce6c){return{'name':_0x48ce6c[_0x3c6e('0x3d')],'type':_0x48ce6c['type']['key']};});_0x4dfb13['model']=_[_0x3c6e('0x3a')](_0x5c3ca3,_0x3c6e('0x37'));_0x4dfb13['query']=_[_0x3c6e('0x3e')](_0x49792a[_0x3c6e('0x3f')]);_0x4dfb13[_0x3c6e('0x40')]=_['intersection'](_0x4dfb13[_0x3c6e('0x41')],_0x4dfb13[_0x3c6e('0x3f')]);_0x5e582c[_0x3c6e('0x42')]=_['intersection'](_0x4dfb13[_0x3c6e('0x41')],qs[_0x3c6e('0x43')](_0x49792a[_0x3c6e('0x3f')][_0x3c6e('0x43')]));_0x5e582c[_0x3c6e('0x42')]=_0x5e582c[_0x3c6e('0x42')]['length']?_0x5e582c[_0x3c6e('0x42')]:_0x4dfb13[_0x3c6e('0x41')];if(!_0x49792a[_0x3c6e('0x3f')][_0x3c6e('0x44')](_0x3c6e('0x45'))){_0x5e582c[_0x3c6e('0x2c')]=qs[_0x3c6e('0x2c')](_0x49792a[_0x3c6e('0x3f')]['limit']);_0x5e582c[_0x3c6e('0x2b')]=qs['offset'](_0x49792a['query'][_0x3c6e('0x2b')]);}_0x5e582c[_0x3c6e('0x46')]=qs['sort'](_0x49792a[_0x3c6e('0x3f')]['sort']);_0x5e582c[_0x3c6e('0x47')]=qs[_0x3c6e('0x40')](_[_0x3c6e('0x48')](_0x49792a[_0x3c6e('0x3f')],_0x4dfb13[_0x3c6e('0x40')]),_0x5c3ca3);if(_0x49792a[_0x3c6e('0x3f')][_0x3c6e('0x49')]){_0x5e582c['where']=_[_0x3c6e('0x4a')](_0x5e582c[_0x3c6e('0x47')],{'$or':_[_0x3c6e('0x3a')](_0x5c3ca3,function(_0xa88f4a){if(_0xa88f4a['type']!=='VIRTUAL'){var _0x449b1={};_0x449b1[_0xa88f4a[_0x3c6e('0x37')]]={'$like':'%'+_0x49792a[_0x3c6e('0x3f')]['filter']+'%'};return _0x449b1;}})});}_0x5e582c=_['merge']({},_0x5e582c,_0x49792a[_0x3c6e('0x4b')]);var _0x1ecc06={'where':_0x5e582c[_0x3c6e('0x47')]};return db['ChatMessage']['count'](_0x1ecc06)[_0x3c6e('0x33')](function(_0x1c6129){_0x5ccd97[_0x3c6e('0x4c')]=_0x1c6129;if(_0x49792a[_0x3c6e('0x3f')][_0x3c6e('0x4d')]){_0x5e582c[_0x3c6e('0x4e')]=[{'all':!![]}];}return db[_0x3c6e('0x3b')][_0x3c6e('0x4f')](_0x5e582c);})[_0x3c6e('0x33')](function(_0x502938){_0x5ccd97['rows']=_0x502938;return _0x5ccd97;})[_0x3c6e('0x33')](respondWithFilteredResult(_0x3a67b,_0x5e582c))[_0x3c6e('0x29')](handleError(_0x3a67b,null));};exports[_0x3c6e('0x50')]=function(_0x437a96,_0x349916){var _0x17fc29={'raw':!![],'where':{'id':_0x437a96['params']['id']}},_0x3ce16f={};_0x3ce16f[_0x3c6e('0x41')]=_[_0x3c6e('0x3e')](db[_0x3c6e('0x3b')][_0x3c6e('0x3c')]);_0x3ce16f[_0x3c6e('0x3f')]=_[_0x3c6e('0x3e')](_0x437a96[_0x3c6e('0x3f')]);_0x3ce16f[_0x3c6e('0x40')]=_[_0x3c6e('0x51')](_0x3ce16f[_0x3c6e('0x41')],_0x3ce16f[_0x3c6e('0x3f')]);_0x17fc29[_0x3c6e('0x42')]=_['intersection'](_0x3ce16f[_0x3c6e('0x41')],qs[_0x3c6e('0x43')](_0x437a96[_0x3c6e('0x3f')]['fields']));_0x17fc29[_0x3c6e('0x42')]=_0x17fc29[_0x3c6e('0x42')][_0x3c6e('0x52')]?_0x17fc29[_0x3c6e('0x42')]:_0x3ce16f['model'];if(_0x437a96[_0x3c6e('0x3f')]['includeAll']){_0x17fc29[_0x3c6e('0x4e')]=[{'all':!![]}];}_0x17fc29=_[_0x3c6e('0x4a')]({},_0x17fc29,_0x437a96[_0x3c6e('0x4b')]);return db['ChatMessage'][_0x3c6e('0x53')](_0x17fc29)[_0x3c6e('0x33')](handleEntityNotFound(_0x349916,null))[_0x3c6e('0x33')](respondWithResult(_0x349916,null))[_0x3c6e('0x29')](handleError(_0x349916,null));};exports[_0x3c6e('0x54')]=function(_0x355736,_0x4773be){return db['ChatMessage'][_0x3c6e('0x54')](_0x355736[_0x3c6e('0x55')],{})[_0x3c6e('0x33')](respondWithResult(_0x4773be,0xc9))[_0x3c6e('0x29')](handleError(_0x4773be,null));};exports[_0x3c6e('0x32')]=function(_0x2c73bc,_0x14190a){if(_0x2c73bc['body']['id']){delete _0x2c73bc[_0x3c6e('0x55')]['id'];}return db[_0x3c6e('0x3b')][_0x3c6e('0x53')]({'where':{'id':_0x2c73bc[_0x3c6e('0x56')]['id']}})[_0x3c6e('0x33')](handleEntityNotFound(_0x14190a,null))[_0x3c6e('0x33')](saveUpdates(_0x2c73bc[_0x3c6e('0x55')],null))[_0x3c6e('0x33')](respondWithResult(_0x14190a,null))['catch'](handleError(_0x14190a,null));};exports[_0x3c6e('0x34')]=function(_0x462180,_0x1ae05){return db['ChatMessage']['find']({'where':{'id':_0x462180['params']['id']}})['then'](handleEntityNotFound(_0x1ae05,null))['then'](removeEntity(_0x1ae05,null))[_0x3c6e('0x29')](handleError(_0x1ae05,null));};exports[_0x3c6e('0x57')]=function(_0x1ac792,_0x211943){return db[_0x3c6e('0x3b')]['describe']()['then'](respondWithResult(_0x211943,null))[_0x3c6e('0x29')](handleError(_0x211943,null));};var interaction_log=require('../../config/logger')(_0x3c6e('0x58'));exports[_0x3c6e('0x59')]=function(_0x48a1c5,_0x9e2cf5,_0x4d029e){var _0x21de82={'channel':'chat'};if(_0x48a1c5['body']['id']){delete _0x48a1c5['body']['id'];}_0x48a1c5['body'][_0x3c6e('0x5a')]=!![];_0x48a1c5[_0x3c6e('0x55')][_0x3c6e('0x5b')]=moment()[_0x3c6e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x48a1c5[_0x3c6e('0x55')][_0x3c6e('0x5d')]=_0x48a1c5['body'][_0x3c6e('0x5d')]||_0x48a1c5['user']['id'];return db[_0x3c6e('0x3b')]['find']({'where':{'id':_0x48a1c5[_0x3c6e('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x3c6e('0x5e')],'as':_0x3c6e('0x5f')}]})[_0x3c6e('0x33')](handleEntityNotFound(_0x9e2cf5,null))[_0x3c6e('0x33')](saveUpdates(_0x48a1c5['body'],null))['then'](function(_0x5e0aa3){if(_0x5e0aa3){_0x21de82[_0x3c6e('0x28')]=_0x5e0aa3['get']({'plain':!![]});return db['ChatInteraction'][_0x3c6e('0x53')]({'where':{'id':_0x5e0aa3[_0x3c6e('0x60')]}});}return null;})[_0x3c6e('0x33')](handleEntityNotFound(_0x9e2cf5,null))[_0x3c6e('0x33')](function(_0x8d1702){if(_0x8d1702){return _0x8d1702['update']({'UserId':_0x48a1c5[_0x3c6e('0x55')][_0x3c6e('0x5d')],'read1stAt':_['isNil'](_0x8d1702[_0x3c6e('0x61')])?moment()[_0x3c6e('0x5c')](_0x3c6e('0x62')):undefined});}return null;})[_0x3c6e('0x33')](function(_0x434c3c){if(_0x434c3c){_0x21de82['interaction']=_0x434c3c[_0x3c6e('0x63')]({'plain':!![]});interaction_log[_0x3c6e('0x21')](_0x3c6e('0x64'),_0x48a1c5[_0x3c6e('0x65')]['id'],_0x48a1c5[_0x3c6e('0x65')][_0x3c6e('0x37')],_0x48a1c5['user'][_0x3c6e('0x66')],_0x21de82[_0x3c6e('0x67')]['id'],_0x48a1c5[_0x3c6e('0x55')]?JSON[_0x3c6e('0x68')](_0x48a1c5[_0x3c6e('0x55')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3c6e('0x69'),_0x21de82);}return null;})[_0x3c6e('0x33')](function(_0x2371f0){if(_0x2371f0){if(_0x48a1c5[_0x3c6e('0x55')][_0x3c6e('0x6a')]){_0x21de82[_0x3c6e('0x28')]['interface']=util[_0x3c6e('0x5c')]('SIP/%s',_0x48a1c5[_0x3c6e('0x65')][_0x3c6e('0x37')]);_0x21de82[_0x3c6e('0x28')]['channel']=_0x21de82[_0x3c6e('0x6b')];_0x21de82[_0x3c6e('0x28')][_0x3c6e('0x6c')]=_0x3c6e('0x59');return respondWithRpcPromise('EventManager',_0x3c6e('0x6d'),{'event':_0x3c6e('0x6e'),'message':_['merge'](_0x21de82[_0x3c6e('0x28')],JSON[_0x3c6e('0x6f')](_0x21de82['interaction']['formData']))},client9002)[_0x3c6e('0x33')](function(){return _0x21de82;});}return _0x21de82;}return null;})['then'](respondWithResult(_0x9e2cf5,null))[_0x3c6e('0x29')](handleError(_0x9e2cf5,null));};var interaction_log=require(_0x3c6e('0x15'))(_0x3c6e('0x58'));exports[_0x3c6e('0x30')]=function(_0x49b848,_0x2b9433,_0x2d8b5f){var _0x16ef07={'agent':{},'channel':_0x3c6e('0x70')};if(_0x49b848[_0x3c6e('0x55')]['id']){delete _0x49b848[_0x3c6e('0x55')]['id'];}_0x49b848[_0x3c6e('0x55')][_0x3c6e('0x5d')]=_0x49b848['body'][_0x3c6e('0x5d')]||_0x49b848['user']['id'];_0x16ef07[_0x3c6e('0x71')]['id']=_0x49b848[_0x3c6e('0x55')][_0x3c6e('0x5d')];return db['ChatMessage'][_0x3c6e('0x53')]({'where':{'id':_0x49b848['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b9433,null))[_0x3c6e('0x33')](function(_0x311f0a){if(_0x311f0a){_0x16ef07['message']=_0x311f0a[_0x3c6e('0x63')]({'plain':!![]});return db[_0x3c6e('0x72')]['find']({'where':{'id':_0x311f0a[_0x3c6e('0x60')]}});}return null;})[_0x3c6e('0x33')](handleEntityNotFound(_0x2b9433,null))['then'](function(_0xa6aaf6){if(_0xa6aaf6){_0x16ef07[_0x3c6e('0x67')]=_0xa6aaf6['get']({'plain':!![]});interaction_log[_0x3c6e('0x21')](_0x3c6e('0x73'),_0x49b848['user']['id'],_0x49b848[_0x3c6e('0x65')][_0x3c6e('0x37')],_0x49b848[_0x3c6e('0x65')]['role'],_0x16ef07[_0x3c6e('0x67')]['id'],_0x49b848[_0x3c6e('0x55')]?JSON[_0x3c6e('0x68')](_0x49b848['body']):_0x3c6e('0x74'));return respondWithRpcPromise(_0x3c6e('0x75'),_0x3c6e('0x76'),_0x16ef07);}return null;})['then'](function(_0x12ccda){if(_0x12ccda){_0x12ccda[_0x3c6e('0x28')][_0x3c6e('0x77')]=util['format']('SIP/%s',_0x49b848[_0x3c6e('0x65')][_0x3c6e('0x37')]);_0x12ccda['message'][_0x3c6e('0x6b')]=_0x16ef07[_0x3c6e('0x6b')];_0x12ccda[_0x3c6e('0x28')]['event']=_0x3c6e('0x30');respondWithRpcPromise(_0x3c6e('0x6d'),'EventManager',{'event':_0x3c6e('0x78'),'message':_0x12ccda[_0x3c6e('0x28')]},client9002);return _0x16ef07;}return null;})[_0x3c6e('0x33')](respondWithResult(_0x2b9433,null))['catch'](handleError(_0x2b9433,null));};
\ No newline at end of file
+var _0x5d84=['map','ChatMessage','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','keys','include','options','find','create','body','update','destroy','chat','read','readAt','format','UserId','user','CmContact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','parse','formData','chat-interactions','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','client','http','request','request\x20sent','debug','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','then','end','stack','send','index'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5d84,0x1ad));var _0x45d8=function(_0x3c5e1d,_0x713313){_0x3c5e1d=_0x3c5e1d-0x0;var _0x1bd0ed=_0x5d84[_0x3c5e1d];return _0x1bd0ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x45d8('0x0'));var rimraf=require(_0x45d8('0x1'));var zipdir=require(_0x45d8('0x2'));var jsonpatch=require(_0x45d8('0x3'));var rp=require(_0x45d8('0x4'));var moment=require(_0x45d8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x45d8('0x6'));var sox=require(_0x45d8('0x7'));var csv=require(_0x45d8('0x8'));var ejs=require(_0x45d8('0x9'));var fs=require('fs');var _=require(_0x45d8('0xa'));var squel=require(_0x45d8('0xb'));var crypto=require(_0x45d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x45d8('0xd'));var toCsv=require(_0x45d8('0x8'));var querystring=require(_0x45d8('0xe'));var Papa=require('papaparse');var Redis=require(_0x45d8('0xf'));var authService=require(_0x45d8('0x10'));var qs=require(_0x45d8('0x11'));var as=require(_0x45d8('0x12'));var hardwareService=require(_0x45d8('0x13'));var logger=require(_0x45d8('0x14'))(_0x45d8('0x15'));var utils=require('../../config/utils');var config=require(_0x45d8('0x16'));var licenseUtil=require(_0x45d8('0x17'));var db=require(_0x45d8('0x18'))['db'];config['redis']=_[_0x45d8('0x19')](config['redis'],{'host':_0x45d8('0x1a'),'port':0x18eb});var socket=require(_0x45d8('0x1b'))(new Redis(config[_0x45d8('0x1c')]));require(_0x45d8('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x45d8('0x1e')][_0x45d8('0x1f')]({'port':0x232c});var client9002=jayson[_0x45d8('0x1e')][_0x45d8('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1ca540,_0x1b32fc,_0x3f5e9a,_0x226a38){return new BPromise(function(_0x48c667,_0x5d310b){var _0x424357=_0x226a38||client;return _0x424357[_0x45d8('0x20')](_0x1ca540,_0x3f5e9a)['then'](function(_0x5301ec){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1b32fc,_0x45d8('0x21'));logger[_0x45d8('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1b32fc,_0x45d8('0x21'),JSON[_0x45d8('0x23')](_0x5301ec));if(_0x5301ec[_0x45d8('0x24')]){if(_0x5301ec[_0x45d8('0x24')]['code']===0x1f4){logger['error'](_0x45d8('0x25'),_0x1b32fc,_0x5301ec[_0x45d8('0x24')][_0x45d8('0x26')]);return _0x5d310b(_0x5301ec['error']['message']);}logger[_0x45d8('0x24')](_0x45d8('0x25'),_0x1b32fc,_0x5301ec[_0x45d8('0x24')][_0x45d8('0x26')]);return _0x48c667(_0x5301ec[_0x45d8('0x24')][_0x45d8('0x26')]);}else{logger[_0x45d8('0x27')]('ChatMessage,\x20%s,\x20%s',_0x1b32fc,_0x45d8('0x21'));_0x48c667(_0x5301ec['result'][_0x45d8('0x26')]);}})[_0x45d8('0x28')](function(_0x245754){logger[_0x45d8('0x24')]('ChatMessage,\x20%s,\x20%s',_0x1b32fc,_0x245754);_0x5d310b(_0x245754);});});}function respondWithStatusCode(_0x82037d,_0x34c011){_0x34c011=_0x34c011||0xcc;return function(_0x2d439f){if(_0x2d439f){return _0x82037d[_0x45d8('0x29')](_0x34c011);}return _0x82037d[_0x45d8('0x2a')](_0x34c011)['end']();};}function respondWithResult(_0x1f5f3a,_0x62fbba){_0x62fbba=_0x62fbba||0xc8;return function(_0x3e92bd){if(_0x3e92bd){return _0x1f5f3a[_0x45d8('0x2a')](_0x62fbba)[_0x45d8('0x2b')](_0x3e92bd);}};}function respondWithFilteredResult(_0x3c9683,_0x455164){return function(_0x1213f1){if(_0x1213f1){var _0x312267=_0x1213f1[_0x45d8('0x2c')],_0x4e3c0f=_0x455164['offset'],_0x2edb11=_0x455164['offset']+_0x455164[_0x45d8('0x2d')],_0x57a9e8;if(_0x2edb11>=_0x312267){_0x2edb11=_0x312267;_0x57a9e8=0xc8;}else{_0x57a9e8=0xce;}_0x3c9683[_0x45d8('0x2a')](_0x57a9e8);return _0x3c9683[_0x45d8('0x2e')](_0x45d8('0x2f'),_0x4e3c0f+'-'+_0x2edb11+'/'+_0x312267)[_0x45d8('0x2b')](_0x1213f1);}return null;};}function patchUpdates(_0x362b8c){return function(_0x4c65d8){try{jsonpatch[_0x45d8('0x30')](_0x4c65d8,_0x362b8c,!![]);}catch(_0x8de9b8){return BPromise[_0x45d8('0x31')](_0x8de9b8);}return _0x4c65d8['save']();};}function saveUpdates(_0x1e2156,_0xee4d10){return function(_0x308883){if(_0x308883){return _0x308883['update'](_0x1e2156)[_0x45d8('0x32')](function(_0x2d207c){return _0x2d207c;});}return null;};}function removeEntity(_0x9f6d4f,_0x59e3ba){return function(_0x5726a3){if(_0x5726a3){return _0x5726a3['destroy']()[_0x45d8('0x32')](function(){_0x9f6d4f[_0x45d8('0x2a')](0xcc)[_0x45d8('0x33')]();});}};}function handleEntityNotFound(_0x4feaa3,_0x35641c){return function(_0x6356c9){if(!_0x6356c9){_0x4feaa3[_0x45d8('0x29')](0x194);}return _0x6356c9;};}function handleError(_0x4157df,_0x1805f5){_0x1805f5=_0x1805f5||0x1f4;return function(_0x3c9cef){logger[_0x45d8('0x24')](_0x3c9cef[_0x45d8('0x34')]);if(_0x3c9cef['name']){delete _0x3c9cef['name'];}_0x4157df[_0x45d8('0x2a')](_0x1805f5)[_0x45d8('0x35')](_0x3c9cef);};}exports[_0x45d8('0x36')]=function(_0x467859,_0x34e996){var _0x2257fa={},_0x207b5f={},_0x4313b2={'count':0x0,'rows':[]};var _0x41b716=_[_0x45d8('0x37')](db[_0x45d8('0x38')][_0x45d8('0x39')],function(_0x56aaaa){return{'name':_0x56aaaa[_0x45d8('0x3a')],'type':_0x56aaaa[_0x45d8('0x3b')]['key']};});_0x207b5f[_0x45d8('0x3c')]=_[_0x45d8('0x37')](_0x41b716,_0x45d8('0x3d'));_0x207b5f[_0x45d8('0x3e')]=_['keys'](_0x467859[_0x45d8('0x3e')]);_0x207b5f[_0x45d8('0x3f')]=_[_0x45d8('0x40')](_0x207b5f[_0x45d8('0x3c')],_0x207b5f[_0x45d8('0x3e')]);_0x2257fa['attributes']=_[_0x45d8('0x40')](_0x207b5f[_0x45d8('0x3c')],qs['fields'](_0x467859[_0x45d8('0x3e')][_0x45d8('0x41')]));_0x2257fa[_0x45d8('0x42')]=_0x2257fa['attributes'][_0x45d8('0x43')]?_0x2257fa['attributes']:_0x207b5f['model'];if(!_0x467859['query'][_0x45d8('0x44')]('nolimit')){_0x2257fa['limit']=qs[_0x45d8('0x2d')](_0x467859['query'][_0x45d8('0x2d')]);_0x2257fa['offset']=qs[_0x45d8('0x45')](_0x467859[_0x45d8('0x3e')][_0x45d8('0x45')]);}_0x2257fa[_0x45d8('0x46')]=qs[_0x45d8('0x47')](_0x467859[_0x45d8('0x3e')][_0x45d8('0x47')]);_0x2257fa[_0x45d8('0x48')]=qs[_0x45d8('0x3f')](_[_0x45d8('0x49')](_0x467859[_0x45d8('0x3e')],_0x207b5f[_0x45d8('0x3f')]),_0x41b716);if(_0x467859[_0x45d8('0x3e')][_0x45d8('0x4a')]){_0x2257fa[_0x45d8('0x48')]=_[_0x45d8('0x4b')](_0x2257fa['where'],{'$or':_[_0x45d8('0x37')](_0x41b716,function(_0x2f373d){if(_0x2f373d[_0x45d8('0x3b')]!=='VIRTUAL'){var _0x126c01={};_0x126c01[_0x2f373d[_0x45d8('0x3d')]]={'$like':'%'+_0x467859[_0x45d8('0x3e')]['filter']+'%'};return _0x126c01;}})});}_0x2257fa=_[_0x45d8('0x4b')]({},_0x2257fa,_0x467859['options']);var _0x19b353={'where':_0x2257fa[_0x45d8('0x48')]};return db['ChatMessage']['count'](_0x19b353)[_0x45d8('0x32')](function(_0x49c977){_0x4313b2[_0x45d8('0x2c')]=_0x49c977;if(_0x467859[_0x45d8('0x3e')][_0x45d8('0x4c')]){_0x2257fa['include']=[{'all':!![]}];}return db[_0x45d8('0x38')][_0x45d8('0x4d')](_0x2257fa);})[_0x45d8('0x32')](function(_0x3dfb7f){_0x4313b2[_0x45d8('0x4e')]=_0x3dfb7f;return _0x4313b2;})[_0x45d8('0x32')](respondWithFilteredResult(_0x34e996,_0x2257fa))['catch'](handleError(_0x34e996,null));};exports[_0x45d8('0x4f')]=function(_0x4e2b82,_0x20af67){var _0x51dc1a={'raw':!![],'where':{'id':_0x4e2b82[_0x45d8('0x50')]['id']}},_0x322196={};_0x322196['model']=_[_0x45d8('0x51')](db[_0x45d8('0x38')][_0x45d8('0x39')]);_0x322196[_0x45d8('0x3e')]=_[_0x45d8('0x51')](_0x4e2b82[_0x45d8('0x3e')]);_0x322196[_0x45d8('0x3f')]=_[_0x45d8('0x40')](_0x322196[_0x45d8('0x3c')],_0x322196['query']);_0x51dc1a['attributes']=_[_0x45d8('0x40')](_0x322196[_0x45d8('0x3c')],qs[_0x45d8('0x41')](_0x4e2b82[_0x45d8('0x3e')][_0x45d8('0x41')]));_0x51dc1a[_0x45d8('0x42')]=_0x51dc1a['attributes'][_0x45d8('0x43')]?_0x51dc1a[_0x45d8('0x42')]:_0x322196[_0x45d8('0x3c')];if(_0x4e2b82['query'][_0x45d8('0x4c')]){_0x51dc1a[_0x45d8('0x52')]=[{'all':!![]}];}_0x51dc1a=_[_0x45d8('0x4b')]({},_0x51dc1a,_0x4e2b82[_0x45d8('0x53')]);return db['ChatMessage'][_0x45d8('0x54')](_0x51dc1a)['then'](handleEntityNotFound(_0x20af67,null))[_0x45d8('0x32')](respondWithResult(_0x20af67,null))[_0x45d8('0x28')](handleError(_0x20af67,null));};exports[_0x45d8('0x55')]=function(_0x5d8830,_0xdb4c){return db[_0x45d8('0x38')][_0x45d8('0x55')](_0x5d8830[_0x45d8('0x56')],{})[_0x45d8('0x32')](respondWithResult(_0xdb4c,0xc9))['catch'](handleError(_0xdb4c,null));};exports[_0x45d8('0x57')]=function(_0x255ce6,_0x325981){if(_0x255ce6['body']['id']){delete _0x255ce6[_0x45d8('0x56')]['id'];}return db[_0x45d8('0x38')][_0x45d8('0x54')]({'where':{'id':_0x255ce6[_0x45d8('0x50')]['id']}})[_0x45d8('0x32')](handleEntityNotFound(_0x325981,null))['then'](saveUpdates(_0x255ce6[_0x45d8('0x56')],null))[_0x45d8('0x32')](respondWithResult(_0x325981,null))[_0x45d8('0x28')](handleError(_0x325981,null));};exports[_0x45d8('0x58')]=function(_0xb4436f,_0x349796){return db[_0x45d8('0x38')][_0x45d8('0x54')]({'where':{'id':_0xb4436f[_0x45d8('0x50')]['id']}})['then'](handleEntityNotFound(_0x349796,null))[_0x45d8('0x32')](removeEntity(_0x349796,null))[_0x45d8('0x28')](handleError(_0x349796,null));};exports['describe']=function(_0x2c5be2,_0x118fd8){return db['ChatMessage']['describe']()[_0x45d8('0x32')](respondWithResult(_0x118fd8,null))[_0x45d8('0x28')](handleError(_0x118fd8,null));};var interaction_log=require(_0x45d8('0x14'))('chat-interactions');exports['accept']=function(_0x5583ab,_0x364955,_0x423af5){var _0x13fe48={'channel':_0x45d8('0x59')};if(_0x5583ab[_0x45d8('0x56')]['id']){delete _0x5583ab['body']['id'];}_0x5583ab[_0x45d8('0x56')][_0x45d8('0x5a')]=!![];_0x5583ab['body'][_0x45d8('0x5b')]=moment()[_0x45d8('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5583ab[_0x45d8('0x56')]['UserId']=_0x5583ab[_0x45d8('0x56')][_0x45d8('0x5d')]||_0x5583ab[_0x45d8('0x5e')]['id'];return db['ChatMessage'][_0x45d8('0x54')]({'where':{'id':_0x5583ab['params']['id'],'UserId':null},'include':[{'model':db[_0x45d8('0x5f')],'as':'Contact'}]})[_0x45d8('0x32')](handleEntityNotFound(_0x364955,null))['then'](saveUpdates(_0x5583ab[_0x45d8('0x56')],null))[_0x45d8('0x32')](function(_0x4553c1){if(_0x4553c1){_0x13fe48[_0x45d8('0x26')]=_0x4553c1[_0x45d8('0x60')]({'plain':!![]});return db[_0x45d8('0x61')][_0x45d8('0x54')]({'where':{'id':_0x4553c1[_0x45d8('0x62')]}});}return null;})[_0x45d8('0x32')](handleEntityNotFound(_0x364955,null))[_0x45d8('0x32')](function(_0x1b7d32){if(_0x1b7d32){return _0x1b7d32['update']({'UserId':_0x5583ab[_0x45d8('0x56')][_0x45d8('0x5d')],'read1stAt':_[_0x45d8('0x63')](_0x1b7d32[_0x45d8('0x64')])?moment()[_0x45d8('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x45d8('0x32')](function(_0x1bee78){if(_0x1bee78){_0x13fe48[_0x45d8('0x65')]=_0x1bee78['get']({'plain':!![]});interaction_log[_0x45d8('0x27')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5583ab[_0x45d8('0x5e')]['id'],_0x5583ab[_0x45d8('0x5e')][_0x45d8('0x3d')],_0x5583ab[_0x45d8('0x5e')][_0x45d8('0x66')],_0x13fe48[_0x45d8('0x65')]['id'],_0x5583ab['body']?JSON[_0x45d8('0x23')](_0x5583ab[_0x45d8('0x56')]):_0x45d8('0x67'));return respondWithRpcPromise(_0x45d8('0x68'),_0x45d8('0x69'),_0x13fe48);}return null;})[_0x45d8('0x32')](function(_0x3e43c3){if(_0x3e43c3){if(_0x5583ab['body'][_0x45d8('0x6a')]){_0x13fe48[_0x45d8('0x26')][_0x45d8('0x6b')]=util[_0x45d8('0x5c')](_0x45d8('0x6c'),_0x5583ab[_0x45d8('0x5e')][_0x45d8('0x3d')]);_0x13fe48[_0x45d8('0x26')][_0x45d8('0x6d')]=_0x13fe48[_0x45d8('0x6d')];_0x13fe48['message'][_0x45d8('0x6e')]=_0x45d8('0x6f');return respondWithRpcPromise(_0x45d8('0x70'),_0x45d8('0x70'),{'event':'acceptmessage','message':_['merge'](_0x13fe48['message'],JSON[_0x45d8('0x71')](_0x13fe48['interaction'][_0x45d8('0x72')]))},client9002)[_0x45d8('0x32')](function(){return _0x13fe48;});}return _0x13fe48;}return null;})[_0x45d8('0x32')](respondWithResult(_0x364955,null))[_0x45d8('0x28')](handleError(_0x364955,null));};var interaction_log=require(_0x45d8('0x14'))(_0x45d8('0x73'));exports[_0x45d8('0x31')]=function(_0xf44b75,_0x5b6e08,_0x502d2c){var _0x2ec559={'agent':{},'channel':_0x45d8('0x59')};if(_0xf44b75[_0x45d8('0x56')]['id']){delete _0xf44b75['body']['id'];}_0xf44b75[_0x45d8('0x56')]['UserId']=_0xf44b75[_0x45d8('0x56')][_0x45d8('0x5d')]||_0xf44b75['user']['id'];_0x2ec559[_0x45d8('0x74')]['id']=_0xf44b75[_0x45d8('0x56')]['UserId'];return db[_0x45d8('0x38')][_0x45d8('0x54')]({'where':{'id':_0xf44b75[_0x45d8('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5b6e08,null))[_0x45d8('0x32')](function(_0x32cd2f){if(_0x32cd2f){_0x2ec559['message']=_0x32cd2f['get']({'plain':!![]});return db[_0x45d8('0x61')][_0x45d8('0x54')]({'where':{'id':_0x32cd2f['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5b6e08,null))[_0x45d8('0x32')](function(_0x59d3a8){if(_0x59d3a8){_0x2ec559['interaction']=_0x59d3a8[_0x45d8('0x60')]({'plain':!![]});interaction_log[_0x45d8('0x27')](_0x45d8('0x75'),_0xf44b75[_0x45d8('0x5e')]['id'],_0xf44b75[_0x45d8('0x5e')]['name'],_0xf44b75[_0x45d8('0x5e')][_0x45d8('0x66')],_0x2ec559['interaction']['id'],_0xf44b75['body']?JSON['stringify'](_0xf44b75[_0x45d8('0x56')]):'null');return respondWithRpcPromise(_0x45d8('0x76'),_0x45d8('0x77'),_0x2ec559);}return null;})[_0x45d8('0x32')](function(_0x405e3a){if(_0x405e3a){_0x405e3a['message']['interface']=util['format']('SIP/%s',_0xf44b75['user']['name']);_0x405e3a[_0x45d8('0x26')]['channel']=_0x2ec559[_0x45d8('0x6d')];_0x405e3a[_0x45d8('0x26')][_0x45d8('0x6e')]=_0x45d8('0x31');respondWithRpcPromise(_0x45d8('0x70'),_0x45d8('0x70'),{'event':_0x45d8('0x78'),'message':_0x405e3a[_0x45d8('0x26')]},client9002);return _0x2ec559;}return null;})[_0x45d8('0x32')](respondWithResult(_0x5b6e08,null))[_0x45d8('0x28')](handleError(_0x5b6e08,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b97c780..3b0a96f 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 _0xaa1f=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xaa1f,0xde));var _0xfaa1=function(_0xccf1b4,_0x43b32d){_0xccf1b4=_0xccf1b4-0x0;var _0x13f1ab=_0xaa1f[_0xccf1b4];return _0x13f1ab;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xfaa1('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xfaa1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfaa1('0x2'),'afterDestroy':_0xfaa1('0x3')};function emitEvent(_0x4e6515){return function(_0x599bf6,_0x42412e,_0x22bd18){ChatMessageEvents[_0xfaa1('0x4')](_0x4e6515+':'+_0x599bf6['id'],_0x599bf6);ChatMessageEvents['emit'](_0x4e6515,_0x599bf6);_0x22bd18(null);};}for(var e in events){if(events[_0xfaa1('0x5')](e)){var event=events[e];ChatMessage[_0xfaa1('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xfc18=['hook','exports','events','ChatMessage','save','update','emit','hasOwnProperty'];(function(_0x4fa08c,_0x30cac4){var _0x7a920a=function(_0x213fd1){while(--_0x213fd1){_0x4fa08c['push'](_0x4fa08c['shift']());}};_0x7a920a(++_0x30cac4);}(_0xfc18,0xa2));var _0x8fc1=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0xfc18[_0x1b92a6];return _0x24be5b;};'use strict';var EventEmitter=require(_0x8fc1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x8fc1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8fc1('0x2'),'afterUpdate':_0x8fc1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e800c){return function(_0x5e9fe3,_0x15d03e,_0x139e69){ChatMessageEvents[_0x8fc1('0x4')](_0x3e800c+':'+_0x5e9fe3['id'],_0x5e9fe3);ChatMessageEvents['emit'](_0x3e800c,_0x5e9fe3);_0x139e69(null);};}for(var e in events){if(events[_0x8fc1('0x5')](e)){var event=events[e];ChatMessage[_0x8fc1('0x6')](e,emitEvent(event));}}module[_0x8fc1('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 fbbfbda..442ecd0 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 _0x64b6=['UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','models','direction','toLowerCase','secret'];(function(_0x3a6c31,_0xd178e2){var _0xf99bc9=function(_0x38b90a){while(--_0x38b90a){_0x3a6c31['push'](_0x3a6c31['shift']());}};_0xf99bc9(++_0xd178e2);}(_0x64b6,0x13d));var _0x664b=function(_0x7a6aed,_0x335e68){_0x7a6aed=_0x7a6aed-0x0;var _0x9dbabf=_0x64b6[_0x7a6aed];return _0x9dbabf;};'use strict';var _=require(_0x664b('0x0'));var util=require('util');var logger=require(_0x664b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x664b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x664b('0x3'));var config=require(_0x664b('0x4'));var attributes=require(_0x664b('0x5'));module['exports']=function(_0x268a35,_0x268e73){return _0x268a35[_0x664b('0x6')](_0x664b('0x7'),attributes,{'tableName':_0x664b('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3949e0,_0x993dad,_0x356727){var _0x53a28a=_0x268a35[_0x664b('0x9')];var _0x916a3c=_0x3949e0['get']({'plain':!![]});if(_0x916a3c[_0x664b('0xa')][_0x664b('0xb')]()==='in'||_0x916a3c['direction'][_0x664b('0xb')]()==='out'&&!_0x916a3c[_0x664b('0xc')]&&!_['isNil'](_0x916a3c[_0x664b('0xd')])){_0x53a28a[_0x664b('0xe')]['findOne']({'where':{'id':_0x916a3c[_0x664b('0xf')]}})[_0x664b('0x10')](function(_0x5f2ec1){if(_0x5f2ec1){_0x5f2ec1[_0x664b('0x11')]({'lastMsgAt':_0x916a3c[_0x664b('0x12')],'lastMsgDirection':_0x916a3c['direction']['toLowerCase']()});}})[_0x664b('0x13')](function(_0x56e0fa){console['error'](_0x56e0fa);});}_0x356727();}},'charset':_0x664b('0x14'),'collate':_0x664b('0x15')});};
\ No newline at end of file
+var _0xd01d=['models','direction','toLowerCase','secret','isNil','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xd01d,0x1b2));var _0xdd01=function(_0x154d33,_0x1fbe10){_0x154d33=_0x154d33-0x0;var _0x300ce6=_0xd01d[_0x154d33];return _0x300ce6;};'use strict';var _=require(_0xdd01('0x0'));var util=require(_0xdd01('0x1'));var logger=require(_0xdd01('0x2'))(_0xdd01('0x3'));var moment=require(_0xdd01('0x4'));var BPromise=require(_0xdd01('0x5'));var rp=require(_0xdd01('0x6'));var fs=require('fs');var path=require(_0xdd01('0x7'));var rimraf=require(_0xdd01('0x8'));var config=require(_0xdd01('0x9'));var attributes=require(_0xdd01('0xa'));module[_0xdd01('0xb')]=function(_0x1728dd,_0x27ccf3){return _0x1728dd[_0xdd01('0xc')]('ChatMessage',attributes,{'tableName':_0xdd01('0xd'),'paranoid':![],'indexes':[{'name':_0xdd01('0xe'),'fields':[_0xdd01('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56e2ec,_0x5dd662,_0x3d0cbe){var _0x2cf00d=_0x1728dd[_0xdd01('0x10')];var _0x1489fb=_0x56e2ec['get']({'plain':!![]});if(_0x1489fb[_0xdd01('0x11')][_0xdd01('0x12')]()==='in'||_0x1489fb[_0xdd01('0x11')][_0xdd01('0x12')]()==='out'&&!_0x1489fb[_0xdd01('0x13')]&&!_[_0xdd01('0x14')](_0x1489fb['UserId'])){_0x2cf00d[_0xdd01('0x15')]['findOne']({'where':{'id':_0x1489fb[_0xdd01('0x16')]}})[_0xdd01('0x17')](function(_0x33f1f7){if(_0x33f1f7){_0x33f1f7[_0xdd01('0x18')]({'lastMsgAt':_0x1489fb[_0xdd01('0x19')],'lastMsgDirection':_0x1489fb[_0xdd01('0x11')][_0xdd01('0x12')]()});}})[_0xdd01('0x1a')](function(_0x1c6987){console[_0xdd01('0x1b')](_0x1c6987);});}_0x3d0cbe();}},'charset':_0xdd01('0x1c'),'collate':_0xdd01('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 049bea0..f953f0f 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 _0x1c53=['debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateChatMessage','ChatMessage','body','options','then'];(function(_0x42c7f4,_0x4898f4){var _0x51cdd9=function(_0x35d53d){while(--_0x35d53d){_0x42c7f4['push'](_0x42c7f4['shift']());}};_0x51cdd9(++_0x4898f4);}(_0x1c53,0x18e));var _0x31c5=function(_0x172a34,_0x587d42){_0x172a34=_0x172a34-0x0;var _0x5d2b80=_0x1c53[_0x172a34];return _0x5d2b80;};'use strict';var _=require(_0x31c5('0x0'));var util=require(_0x31c5('0x1'));var moment=require(_0x31c5('0x2'));var BPromise=require(_0x31c5('0x3'));var rs=require(_0x31c5('0x4'));var fs=require('fs');var Redis=require(_0x31c5('0x5'));var db=require(_0x31c5('0x6'))['db'];var utils=require(_0x31c5('0x7'));var logger=require(_0x31c5('0x8'))(_0x31c5('0x9'));var config=require(_0x31c5('0xa'));var jayson=require(_0x31c5('0xb'));var client=jayson[_0x31c5('0xc')][_0x31c5('0xd')]({'port':0x232a});config[_0x31c5('0xe')]=_[_0x31c5('0xf')](config[_0x31c5('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x31c5('0x10'))(new Redis(config[_0x31c5('0xe')]));require(_0x31c5('0x11'))[_0x31c5('0x12')](socket);function respondWithRpcPromise(_0x36dd24,_0x5bb402,_0x3b03af){return new BPromise(function(_0x36e25e,_0x1e6389){return client[_0x31c5('0x13')](_0x36dd24,_0x3b03af)['then'](function(_0x1f94d6){logger['info'](_0x31c5('0x14'),_0x5bb402,_0x31c5('0x15'));logger['debug'](_0x31c5('0x16'),_0x5bb402,_0x31c5('0x15'),JSON['stringify'](_0x1f94d6));if(_0x1f94d6[_0x31c5('0x17')]){if(_0x1f94d6[_0x31c5('0x17')]['code']===0x1f4){logger[_0x31c5('0x17')](_0x31c5('0x14'),_0x5bb402,_0x1f94d6[_0x31c5('0x17')][_0x31c5('0x18')]);return _0x1e6389(_0x1f94d6[_0x31c5('0x17')][_0x31c5('0x18')]);}logger[_0x31c5('0x17')](_0x31c5('0x14'),_0x5bb402,_0x1f94d6[_0x31c5('0x17')][_0x31c5('0x18')]);return _0x36e25e(_0x1f94d6['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5bb402,_0x31c5('0x15'));_0x36e25e(_0x1f94d6[_0x31c5('0x19')][_0x31c5('0x18')]);}})['catch'](function(_0x486201){logger[_0x31c5('0x17')](_0x31c5('0x14'),_0x5bb402,_0x486201);_0x1e6389(_0x486201);});});}exports[_0x31c5('0x1a')]=function(_0x256afb){var _0x34a348=this;return new Promise(function(_0x500448,_0x46630f){return db[_0x31c5('0x1b')]['create'](_0x256afb[_0x31c5('0x1c')],{'raw':_0x256afb[_0x31c5('0x1d')]?_0x256afb['options']['raw']===undefined?!![]:![]:!![]})[_0x31c5('0x1e')](function(_0x5b3659){logger['info']('CreateChatMessage',_0x256afb);logger[_0x31c5('0x1f')](_0x31c5('0x1a'),_0x256afb,JSON['stringify'](_0x5b3659));_0x500448(_0x5b3659);})[_0x31c5('0x20')](function(_0x197f6d){logger[_0x31c5('0x17')](_0x31c5('0x1a'),_0x197f6d[_0x31c5('0x18')],_0x256afb);_0x46630f(_0x34a348[_0x31c5('0x17')](0x1f4,_0x197f6d['message']));});});};
\ No newline at end of file
+var _0x3026=['message','result','catch','CreateChatMessage','body','options','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s'];(function(_0x7f878d,_0x52e6b8){var _0xb81fb4=function(_0xdb6d73){while(--_0xdb6d73){_0x7f878d['push'](_0x7f878d['shift']());}};_0xb81fb4(++_0x52e6b8);}(_0x3026,0xe0));var _0x6302=function(_0x4802ac,_0xf1b1cf){_0x4802ac=_0x4802ac-0x0;var _0x2055ea=_0x3026[_0x4802ac];return _0x2055ea;};'use strict';var _=require(_0x6302('0x0'));var util=require(_0x6302('0x1'));var moment=require(_0x6302('0x2'));var BPromise=require('bluebird');var rs=require(_0x6302('0x3'));var fs=require('fs');var Redis=require(_0x6302('0x4'));var db=require(_0x6302('0x5'))['db'];var utils=require(_0x6302('0x6'));var logger=require(_0x6302('0x7'))(_0x6302('0x8'));var config=require(_0x6302('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x6302('0xa')]=_['defaults'](config['redis'],{'host':_0x6302('0xb'),'port':0x18eb});var socket=require(_0x6302('0xc'))(new Redis(config[_0x6302('0xa')]));require(_0x6302('0xd'))[_0x6302('0xe')](socket);function respondWithRpcPromise(_0x2e02a2,_0x4a481a,_0x2d36f2){return new BPromise(function(_0x5be8ee,_0x405ea2){return client[_0x6302('0xf')](_0x2e02a2,_0x2d36f2)['then'](function(_0x46a320){logger[_0x6302('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4a481a,_0x6302('0x11'));logger[_0x6302('0x12')](_0x6302('0x13'),_0x4a481a,_0x6302('0x11'),JSON[_0x6302('0x14')](_0x46a320));if(_0x46a320['error']){if(_0x46a320[_0x6302('0x15')][_0x6302('0x16')]===0x1f4){logger['error'](_0x6302('0x17'),_0x4a481a,_0x46a320[_0x6302('0x15')]['message']);return _0x405ea2(_0x46a320[_0x6302('0x15')][_0x6302('0x18')]);}logger[_0x6302('0x15')](_0x6302('0x17'),_0x4a481a,_0x46a320[_0x6302('0x15')]['message']);return _0x5be8ee(_0x46a320['error'][_0x6302('0x18')]);}else{logger[_0x6302('0x10')](_0x6302('0x17'),_0x4a481a,'request\x20sent');_0x5be8ee(_0x46a320[_0x6302('0x19')][_0x6302('0x18')]);}})[_0x6302('0x1a')](function(_0x597640){logger[_0x6302('0x15')]('ChatMessage,\x20%s,\x20%s',_0x4a481a,_0x597640);_0x405ea2(_0x597640);});});}exports[_0x6302('0x1b')]=function(_0x1e9cef){var _0x516c57=this;return new Promise(function(_0x4ede6b,_0x5c8a55){return db['ChatMessage']['create'](_0x1e9cef[_0x6302('0x1c')],{'raw':_0x1e9cef[_0x6302('0x1d')]?_0x1e9cef[_0x6302('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6302('0x1e')](function(_0x12a843){logger[_0x6302('0x10')](_0x6302('0x1b'),_0x1e9cef);logger['debug'](_0x6302('0x1b'),_0x1e9cef,JSON[_0x6302('0x14')](_0x12a843));_0x4ede6b(_0x12a843);})[_0x6302('0x1a')](function(_0x10be7a){logger['error']('CreateChatMessage',_0x10be7a[_0x6302('0x18')],_0x1e9cef);_0x5c8a55(_0x516c57[_0x6302('0x15')](0x1f4,_0x10be7a[_0x6302('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 19abcdc..5849c0d 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 _0xc2c7=['register','chatMessage:','save','remove','update','emit'];(function(_0x5b7f4d,_0x1370b6){var _0x296966=function(_0x4d982b){while(--_0x4d982b){_0x5b7f4d['push'](_0x5b7f4d['shift']());}};_0x296966(++_0x1370b6);}(_0xc2c7,0x134));var _0x7c2c=function(_0x271de4,_0x197b86){_0x271de4=_0x271de4-0x0;var _0x4f80c7=_0xc2c7[_0x271de4];return _0x4f80c7;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7c2c('0x0'),_0x7c2c('0x1'),_0x7c2c('0x2')];function createListener(_0x330870,_0x380d13){return function(_0x237e4d){_0x380d13[_0x7c2c('0x3')](_0x330870,_0x237e4d);};}function removeListener(_0x116f8a,_0x4bbc14){return function(){ChatMessageEvents['removeListener'](_0x116f8a,_0x4bbc14);};}exports[_0x7c2c('0x4')]=function(_0x42ecc9){for(var _0x23c038=0x0,_0x54f027=events['length'];_0x23c038<_0x54f027;_0x23c038++){var _0x5a1027=events[_0x23c038];var _0x2274cd=createListener(_0x7c2c('0x5')+_0x5a1027,_0x42ecc9);ChatMessageEvents['on'](_0x5a1027,_0x2274cd);}};
\ No newline at end of file
+var _0x1967=['remove','update','emit','removeListener','length','save'];(function(_0x1fba44,_0x19210a){var _0x2e0606=function(_0x3db95d){while(--_0x3db95d){_0x1fba44['push'](_0x1fba44['shift']());}};_0x2e0606(++_0x19210a);}(_0x1967,0x173));var _0x7196=function(_0x32ef2e,_0x19aeb6){_0x32ef2e=_0x32ef2e-0x0;var _0x4aa9d0=_0x1967[_0x32ef2e];return _0x4aa9d0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2')];function createListener(_0x35803d,_0x3319fa){return function(_0xa80a3f){_0x3319fa[_0x7196('0x3')](_0x35803d,_0xa80a3f);};}function removeListener(_0x1aaddd,_0x458ae8){return function(){ChatMessageEvents[_0x7196('0x4')](_0x1aaddd,_0x458ae8);};}exports['register']=function(_0x36b01e){for(var _0x186175=0x0,_0x194746=events[_0x7196('0x5')];_0x186175<_0x194746;_0x186175++){var _0x266a6e=events[_0x186175];var _0xad78a=createListener('chatMessage:'+_0x266a6e,_0x36b01e);ChatMessageEvents['on'](_0x266a6e,_0xad78a);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 244b330..0666048 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 _0x1d7d=['/:id/reject','delete','/:id','destroy','exports','multer','util','path','Router','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','show','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','put'];(function(_0x85d56d,_0x37f5c1){var _0x51f613=function(_0x4927df){while(--_0x4927df){_0x85d56d['push'](_0x85d56d['shift']());}};_0x51f613(++_0x37f5c1);}(_0x1d7d,0x1b5));var _0xd1d7=function(_0x41558a,_0x2950e5){_0x41558a=_0x41558a-0x0;var _0x371c3e=_0x1d7d[_0x41558a];return _0x371c3e;};'use strict';var multer=require(_0xd1d7('0x0'));var util=require(_0xd1d7('0x1'));var path=require(_0xd1d7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd1d7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd1d7('0x4'));var config=require('../../config/environment');var controller=require(_0xd1d7('0x5'));router['get']('/',auth[_0xd1d7('0x6')](),controller[_0xd1d7('0x7')]);router[_0xd1d7('0x8')](_0xd1d7('0x9'),auth[_0xd1d7('0x6')](),controller['describe']);router['get']('/:id',auth[_0xd1d7('0x6')](),controller[_0xd1d7('0xa')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd1d7('0xb')](_0xd1d7('0xc'),_0xd1d7('0xd')),controller[_0xd1d7('0xe')]);router['put']('/:id',controller[_0xd1d7('0xf')]);router['put'](_0xd1d7('0x10'),auth[_0xd1d7('0x6')](),controller[_0xd1d7('0x11')]);router[_0xd1d7('0x12')](_0xd1d7('0x13'),auth[_0xd1d7('0x6')](),controller['reject']);router[_0xd1d7('0x14')](_0xd1d7('0x15'),auth[_0xd1d7('0x6')](),controller[_0xd1d7('0x16')]);module[_0xd1d7('0x17')]=router;
\ No newline at end of file
+var _0x35a6=['get','isAuthenticated','index','/:id','show','post','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x53ed59,_0x4beb34){var _0x5834ca=function(_0x5f51f0){while(--_0x5f51f0){_0x53ed59['push'](_0x53ed59['shift']());}};_0x5834ca(++_0x4beb34);}(_0x35a6,0x13b));var _0x635a=function(_0x718eaf,_0x41155c){_0x718eaf=_0x718eaf-0x0;var _0x1e4944=_0x35a6[_0x718eaf];return _0x1e4944;};'use strict';var multer=require(_0x635a('0x0'));var util=require('util');var path=require(_0x635a('0x1'));var timeout=require(_0x635a('0x2'));var express=require(_0x635a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x635a('0x4'));var config=require(_0x635a('0x5'));var controller=require(_0x635a('0x6'));router[_0x635a('0x7')]('/',auth[_0x635a('0x8')](),controller[_0x635a('0x9')]);router[_0x635a('0x7')]('/describe',auth[_0x635a('0x8')](),controller['describe']);router[_0x635a('0x7')](_0x635a('0xa'),auth[_0x635a('0x8')](),controller[_0x635a('0xb')]);router[_0x635a('0xc')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x635a('0xd'),_0x635a('0xe')),controller['create']);router[_0x635a('0xf')](_0x635a('0xa'),controller[_0x635a('0x10')]);router['put'](_0x635a('0x11'),auth['isAuthenticated'](),controller[_0x635a('0x12')]);router[_0x635a('0xf')](_0x635a('0x13'),auth[_0x635a('0x8')](),controller[_0x635a('0x14')]);router['delete'](_0x635a('0xa'),auth['isAuthenticated'](),controller[_0x635a('0x15')]);module[_0x635a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 71b26fb..44b9d03 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 _0xb029=['exports','TEXT','medium'];(function(_0x5401ae,_0x5e58ac){var _0x286068=function(_0x2cac88){while(--_0x2cac88){_0x5401ae['push'](_0x5401ae['shift']());}};_0x286068(++_0x5e58ac);}(_0xb029,0x8a));var _0x9b02=function(_0x368084,_0x401d23){_0x368084=_0x368084-0x0;var _0x2e4477=_0xb029[_0x368084];return _0x2e4477;};'use strict';var Sequelize=require('sequelize');module[_0x9b02('0x0')]={'body':{'type':Sequelize[_0x9b02('0x1')](_0x9b02('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5981=['medium','sequelize','exports'];(function(_0x465fac,_0x442b2e){var _0x24282d=function(_0x39dd44){while(--_0x39dd44){_0x465fac['push'](_0x465fac['shift']());}};_0x24282d(++_0x442b2e);}(_0x5981,0x163));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1598('0x0'));module[_0x1598('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1598('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 ef32ae2..7959dd8 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 _0xc648=['bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','limit','Content-Range','json','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','ChatOfflineMessage','includeAll','include','findAll','rows','show','params','keys','fields','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc648,0x171));var _0x8c64=function(_0xed4430,_0x28d1e4){_0xed4430=_0xed4430-0x0;var _0x82a008=_0xc648[_0xed4430];return _0x82a008;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8c64('0x0'));var rimraf=require(_0x8c64('0x1'));var zipdir=require(_0x8c64('0x2'));var jsonpatch=require(_0x8c64('0x3'));var rp=require(_0x8c64('0x4'));var moment=require(_0x8c64('0x5'));var BPromise=require(_0x8c64('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8c64('0x7'));var csv=require(_0x8c64('0x8'));var ejs=require(_0x8c64('0x9'));var fs=require('fs');var _=require(_0x8c64('0xa'));var squel=require('squel');var crypto=require(_0x8c64('0xb'));var jsforce=require(_0x8c64('0xc'));var deskjs=require(_0x8c64('0xd'));var toCsv=require(_0x8c64('0x8'));var querystring=require(_0x8c64('0xe'));var Papa=require('papaparse');var Redis=require(_0x8c64('0xf'));var authService=require(_0x8c64('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8c64('0x11'));var hardwareService=require(_0x8c64('0x12'));var logger=require(_0x8c64('0x13'))(_0x8c64('0x14'));var utils=require(_0x8c64('0x15'));var config=require(_0x8c64('0x16'));var licenseUtil=require(_0x8c64('0x17'));var db=require(_0x8c64('0x18'))['db'];function respondWithStatusCode(_0x3834e6,_0x19a173){_0x19a173=_0x19a173||0xcc;return function(_0x54e0f0){if(_0x54e0f0){return _0x3834e6[_0x8c64('0x19')](_0x19a173);}return _0x3834e6[_0x8c64('0x1a')](_0x19a173)[_0x8c64('0x1b')]();};}function respondWithResult(_0x36e227,_0x3a4cbf){_0x3a4cbf=_0x3a4cbf||0xc8;return function(_0xeb374){if(_0xeb374){return _0x36e227[_0x8c64('0x1a')](_0x3a4cbf)['json'](_0xeb374);}};}function respondWithFilteredResult(_0x14df4a,_0x16c84e){return function(_0x4dbf8d){if(_0x4dbf8d){var _0xfacf06=_0x4dbf8d[_0x8c64('0x1c')],_0x232c95=_0x16c84e['offset'],_0x4cd286=_0x16c84e['offset']+_0x16c84e[_0x8c64('0x1d')],_0x2c3739;if(_0x4cd286>=_0xfacf06){_0x4cd286=_0xfacf06;_0x2c3739=0xc8;}else{_0x2c3739=0xce;}_0x14df4a[_0x8c64('0x1a')](_0x2c3739);return _0x14df4a['set'](_0x8c64('0x1e'),_0x232c95+'-'+_0x4cd286+'/'+_0xfacf06)[_0x8c64('0x1f')](_0x4dbf8d);}return null;};}function patchUpdates(_0x550d38){return function(_0x4d7350){try{jsonpatch['apply'](_0x4d7350,_0x550d38,!![]);}catch(_0xb94635){return BPromise['reject'](_0xb94635);}return _0x4d7350['save']();};}function saveUpdates(_0x45839d,_0x6d288f){return function(_0x400b92){if(_0x400b92){return _0x400b92[_0x8c64('0x20')](_0x45839d)[_0x8c64('0x21')](function(_0x17a1ab){return _0x17a1ab;});}return null;};}function removeEntity(_0x4e7853,_0x28b7dd){return function(_0x51c459){if(_0x51c459){return _0x51c459[_0x8c64('0x22')]()['then'](function(){_0x4e7853[_0x8c64('0x1a')](0xcc)[_0x8c64('0x1b')]();});}};}function handleEntityNotFound(_0x4b2f7b,_0x400bf7){return function(_0x1300b4){if(!_0x1300b4){_0x4b2f7b[_0x8c64('0x19')](0x194);}return _0x1300b4;};}function handleError(_0x55e11c,_0x84ac89){_0x84ac89=_0x84ac89||0x1f4;return function(_0x4ddd8f){logger[_0x8c64('0x23')](_0x4ddd8f[_0x8c64('0x24')]);if(_0x4ddd8f[_0x8c64('0x25')]){delete _0x4ddd8f[_0x8c64('0x25')];}_0x55e11c[_0x8c64('0x1a')](_0x84ac89)['send'](_0x4ddd8f);};}exports[_0x8c64('0x26')]=function(_0x5cf51b,_0x4c1367){var _0x3649f9={},_0x5ec6a0={},_0x33027f={'count':0x0,'rows':[]};var _0x1b4c9d=_[_0x8c64('0x27')](db['ChatOfflineMessage'][_0x8c64('0x28')],function(_0x2d7548){return{'name':_0x2d7548[_0x8c64('0x29')],'type':_0x2d7548[_0x8c64('0x2a')][_0x8c64('0x2b')]};});_0x5ec6a0[_0x8c64('0x2c')]=_[_0x8c64('0x27')](_0x1b4c9d,_0x8c64('0x25'));_0x5ec6a0['query']=_['keys'](_0x5cf51b['query']);_0x5ec6a0[_0x8c64('0x2d')]=_[_0x8c64('0x2e')](_0x5ec6a0[_0x8c64('0x2c')],_0x5ec6a0[_0x8c64('0x2f')]);_0x3649f9['attributes']=_[_0x8c64('0x2e')](_0x5ec6a0[_0x8c64('0x2c')],qs['fields'](_0x5cf51b[_0x8c64('0x2f')]['fields']));_0x3649f9['attributes']=_0x3649f9[_0x8c64('0x30')][_0x8c64('0x31')]?_0x3649f9['attributes']:_0x5ec6a0['model'];if(!_0x5cf51b['query'][_0x8c64('0x32')](_0x8c64('0x33'))){_0x3649f9[_0x8c64('0x1d')]=qs[_0x8c64('0x1d')](_0x5cf51b[_0x8c64('0x2f')][_0x8c64('0x1d')]);_0x3649f9[_0x8c64('0x34')]=qs[_0x8c64('0x34')](_0x5cf51b[_0x8c64('0x2f')]['offset']);}_0x3649f9[_0x8c64('0x35')]=qs[_0x8c64('0x36')](_0x5cf51b[_0x8c64('0x2f')]['sort']);_0x3649f9[_0x8c64('0x37')]=qs[_0x8c64('0x2d')](_[_0x8c64('0x38')](_0x5cf51b['query'],_0x5ec6a0[_0x8c64('0x2d')]),_0x1b4c9d);if(_0x5cf51b[_0x8c64('0x2f')][_0x8c64('0x39')]){_0x3649f9[_0x8c64('0x37')]=_[_0x8c64('0x3a')](_0x3649f9[_0x8c64('0x37')],{'$or':_[_0x8c64('0x27')](_0x1b4c9d,function(_0x2d1811){if(_0x2d1811[_0x8c64('0x2a')]!==_0x8c64('0x3b')){var _0x2d84da={};_0x2d84da[_0x2d1811[_0x8c64('0x25')]]={'$like':'%'+_0x5cf51b[_0x8c64('0x2f')][_0x8c64('0x39')]+'%'};return _0x2d84da;}})});}_0x3649f9=_['merge']({},_0x3649f9,_0x5cf51b['options']);var _0x444a5b={'where':_0x3649f9[_0x8c64('0x37')]};return db[_0x8c64('0x3c')][_0x8c64('0x1c')](_0x444a5b)['then'](function(_0x46e491){_0x33027f[_0x8c64('0x1c')]=_0x46e491;if(_0x5cf51b[_0x8c64('0x2f')][_0x8c64('0x3d')]){_0x3649f9[_0x8c64('0x3e')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x8c64('0x3f')](_0x3649f9);})[_0x8c64('0x21')](function(_0x5348b3){_0x33027f[_0x8c64('0x40')]=_0x5348b3;return _0x33027f;})['then'](respondWithFilteredResult(_0x4c1367,_0x3649f9))['catch'](handleError(_0x4c1367,null));};exports[_0x8c64('0x41')]=function(_0x1b3b11,_0x5f3c6d){var _0x1d2dd6={'raw':!![],'where':{'id':_0x1b3b11[_0x8c64('0x42')]['id']}},_0x38163e={};_0x38163e[_0x8c64('0x2c')]=_[_0x8c64('0x43')](db[_0x8c64('0x3c')][_0x8c64('0x28')]);_0x38163e[_0x8c64('0x2f')]=_[_0x8c64('0x43')](_0x1b3b11[_0x8c64('0x2f')]);_0x38163e[_0x8c64('0x2d')]=_['intersection'](_0x38163e[_0x8c64('0x2c')],_0x38163e[_0x8c64('0x2f')]);_0x1d2dd6[_0x8c64('0x30')]=_['intersection'](_0x38163e[_0x8c64('0x2c')],qs[_0x8c64('0x44')](_0x1b3b11[_0x8c64('0x2f')]['fields']));_0x1d2dd6[_0x8c64('0x30')]=_0x1d2dd6[_0x8c64('0x30')][_0x8c64('0x31')]?_0x1d2dd6[_0x8c64('0x30')]:_0x38163e[_0x8c64('0x2c')];if(_0x1b3b11[_0x8c64('0x2f')]['includeAll']){_0x1d2dd6[_0x8c64('0x3e')]=[{'all':!![]}];}_0x1d2dd6=_[_0x8c64('0x3a')]({},_0x1d2dd6,_0x1b3b11[_0x8c64('0x45')]);return db[_0x8c64('0x3c')][_0x8c64('0x46')](_0x1d2dd6)[_0x8c64('0x21')](handleEntityNotFound(_0x5f3c6d,null))[_0x8c64('0x21')](respondWithResult(_0x5f3c6d,null))[_0x8c64('0x47')](handleError(_0x5f3c6d,null));};exports[_0x8c64('0x48')]=function(_0x1697fd,_0x2385eb){return db[_0x8c64('0x3c')][_0x8c64('0x48')](_0x1697fd[_0x8c64('0x49')],{})[_0x8c64('0x21')](respondWithResult(_0x2385eb,0xc9))['catch'](handleError(_0x2385eb,null));};exports[_0x8c64('0x20')]=function(_0x3c0ee7,_0x10ee57){if(_0x3c0ee7[_0x8c64('0x49')]['id']){delete _0x3c0ee7[_0x8c64('0x49')]['id'];}return db[_0x8c64('0x3c')]['find']({'where':{'id':_0x3c0ee7[_0x8c64('0x42')]['id']}})[_0x8c64('0x21')](handleEntityNotFound(_0x10ee57,null))[_0x8c64('0x21')](saveUpdates(_0x3c0ee7[_0x8c64('0x49')],null))[_0x8c64('0x21')](respondWithResult(_0x10ee57,null))[_0x8c64('0x47')](handleError(_0x10ee57,null));};exports[_0x8c64('0x22')]=function(_0x4ac42d,_0x2e8082){return db[_0x8c64('0x3c')]['find']({'where':{'id':_0x4ac42d['params']['id']}})[_0x8c64('0x21')](handleEntityNotFound(_0x2e8082,null))[_0x8c64('0x21')](removeEntity(_0x2e8082,null))[_0x8c64('0x47')](handleError(_0x2e8082,null));};exports[_0x8c64('0x4a')]=function(_0xa38f40,_0x411850){return db[_0x8c64('0x3c')]['describe']()[_0x8c64('0x21')](respondWithResult(_0x411850,null))[_0x8c64('0x47')](handleError(_0x411850,null));};
\ No newline at end of file
+var _0x671e=['bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','ChatOfflineMessage','rows','catch','show','length','body','find','params','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x27f5de,_0x577080){var _0x484149=function(_0x7e9adb){while(--_0x7e9adb){_0x27f5de['push'](_0x27f5de['shift']());}};_0x484149(++_0x577080);}(_0x671e,0xd6));var _0xe671=function(_0x1a8770,_0x344224){_0x1a8770=_0x1a8770-0x0;var _0x1528ef=_0x671e[_0x1a8770];return _0x1528ef;};'use strict';var pdf=require(_0xe671('0x0'));var emlformat=require(_0xe671('0x1'));var rimraf=require(_0xe671('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe671('0x3'));var rp=require(_0xe671('0x4'));var moment=require('moment');var BPromise=require(_0xe671('0x5'));var Mustache=require(_0xe671('0x6'));var util=require(_0xe671('0x7'));var path=require('path');var sox=require(_0xe671('0x8'));var csv=require(_0xe671('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe671('0xa'));var squel=require(_0xe671('0xb'));var crypto=require(_0xe671('0xc'));var jsforce=require(_0xe671('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe671('0x9'));var querystring=require(_0xe671('0xe'));var Papa=require(_0xe671('0xf'));var Redis=require(_0xe671('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe671('0x11'));var hardwareService=require(_0xe671('0x12'));var logger=require(_0xe671('0x13'))('api');var utils=require(_0xe671('0x14'));var config=require(_0xe671('0x15'));var licenseUtil=require(_0xe671('0x16'));var db=require(_0xe671('0x17'))['db'];function respondWithStatusCode(_0x57767b,_0x3a051e){_0x3a051e=_0x3a051e||0xcc;return function(_0x4f8054){if(_0x4f8054){return _0x57767b[_0xe671('0x18')](_0x3a051e);}return _0x57767b['status'](_0x3a051e)['end']();};}function respondWithResult(_0x5222a7,_0x59688e){_0x59688e=_0x59688e||0xc8;return function(_0xcf6e92){if(_0xcf6e92){return _0x5222a7[_0xe671('0x19')](_0x59688e)[_0xe671('0x1a')](_0xcf6e92);}};}function respondWithFilteredResult(_0x2d427f,_0x53ceee){return function(_0x19d49c){if(_0x19d49c){var _0x6aea49=_0x19d49c['count'],_0x297452=_0x53ceee[_0xe671('0x1b')],_0x29cae4=_0x53ceee[_0xe671('0x1b')]+_0x53ceee[_0xe671('0x1c')],_0x381dd6;if(_0x29cae4>=_0x6aea49){_0x29cae4=_0x6aea49;_0x381dd6=0xc8;}else{_0x381dd6=0xce;}_0x2d427f[_0xe671('0x19')](_0x381dd6);return _0x2d427f[_0xe671('0x1d')](_0xe671('0x1e'),_0x297452+'-'+_0x29cae4+'/'+_0x6aea49)[_0xe671('0x1a')](_0x19d49c);}return null;};}function patchUpdates(_0x18c364){return function(_0x4a24bf){try{jsonpatch[_0xe671('0x1f')](_0x4a24bf,_0x18c364,!![]);}catch(_0x32484a){return BPromise[_0xe671('0x20')](_0x32484a);}return _0x4a24bf[_0xe671('0x21')]();};}function saveUpdates(_0x565623,_0x1f6521){return function(_0x5d5672){if(_0x5d5672){return _0x5d5672[_0xe671('0x22')](_0x565623)[_0xe671('0x23')](function(_0x59c49c){return _0x59c49c;});}return null;};}function removeEntity(_0x50bc70,_0x2e9d94){return function(_0x23f1db){if(_0x23f1db){return _0x23f1db['destroy']()['then'](function(){_0x50bc70[_0xe671('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1479e9,_0x511ff5){return function(_0x285471){if(!_0x285471){_0x1479e9[_0xe671('0x18')](0x194);}return _0x285471;};}function handleError(_0x49f190,_0x276da8){_0x276da8=_0x276da8||0x1f4;return function(_0x15e433){logger[_0xe671('0x24')](_0x15e433[_0xe671('0x25')]);if(_0x15e433[_0xe671('0x26')]){delete _0x15e433[_0xe671('0x26')];}_0x49f190[_0xe671('0x19')](_0x276da8)['send'](_0x15e433);};}exports[_0xe671('0x27')]=function(_0x2ca3d0,_0x346991){var _0x559872={},_0x1e1d55={},_0x6daba5={'count':0x0,'rows':[]};var _0x3988b7=_[_0xe671('0x28')](db['ChatOfflineMessage'][_0xe671('0x29')],function(_0x1ba7bb){return{'name':_0x1ba7bb[_0xe671('0x2a')],'type':_0x1ba7bb['type'][_0xe671('0x2b')]};});_0x1e1d55[_0xe671('0x2c')]=_['map'](_0x3988b7,_0xe671('0x26'));_0x1e1d55[_0xe671('0x2d')]=_[_0xe671('0x2e')](_0x2ca3d0[_0xe671('0x2d')]);_0x1e1d55[_0xe671('0x2f')]=_[_0xe671('0x30')](_0x1e1d55[_0xe671('0x2c')],_0x1e1d55['query']);_0x559872[_0xe671('0x31')]=_['intersection'](_0x1e1d55[_0xe671('0x2c')],qs[_0xe671('0x32')](_0x2ca3d0[_0xe671('0x2d')]['fields']));_0x559872[_0xe671('0x31')]=_0x559872[_0xe671('0x31')]['length']?_0x559872['attributes']:_0x1e1d55['model'];if(!_0x2ca3d0[_0xe671('0x2d')]['hasOwnProperty'](_0xe671('0x33'))){_0x559872[_0xe671('0x1c')]=qs['limit'](_0x2ca3d0['query'][_0xe671('0x1c')]);_0x559872[_0xe671('0x1b')]=qs[_0xe671('0x1b')](_0x2ca3d0[_0xe671('0x2d')]['offset']);}_0x559872[_0xe671('0x34')]=qs[_0xe671('0x35')](_0x2ca3d0[_0xe671('0x2d')][_0xe671('0x35')]);_0x559872['where']=qs['filters'](_[_0xe671('0x36')](_0x2ca3d0[_0xe671('0x2d')],_0x1e1d55[_0xe671('0x2f')]),_0x3988b7);if(_0x2ca3d0[_0xe671('0x2d')][_0xe671('0x37')]){_0x559872[_0xe671('0x38')]=_[_0xe671('0x39')](_0x559872[_0xe671('0x38')],{'$or':_[_0xe671('0x28')](_0x3988b7,function(_0x12e6c9){if(_0x12e6c9['type']!==_0xe671('0x3a')){var _0x42bcb5={};_0x42bcb5[_0x12e6c9[_0xe671('0x26')]]={'$like':'%'+_0x2ca3d0['query'][_0xe671('0x37')]+'%'};return _0x42bcb5;}})});}_0x559872=_[_0xe671('0x39')]({},_0x559872,_0x2ca3d0[_0xe671('0x3b')]);var _0x538e4a={'where':_0x559872['where']};return db['ChatOfflineMessage']['count'](_0x538e4a)[_0xe671('0x23')](function(_0x56bf3c){_0x6daba5[_0xe671('0x3c')]=_0x56bf3c;if(_0x2ca3d0[_0xe671('0x2d')][_0xe671('0x3d')]){_0x559872[_0xe671('0x3e')]=[{'all':!![]}];}return db[_0xe671('0x3f')]['findAll'](_0x559872);})[_0xe671('0x23')](function(_0x3cbbe1){_0x6daba5[_0xe671('0x40')]=_0x3cbbe1;return _0x6daba5;})[_0xe671('0x23')](respondWithFilteredResult(_0x346991,_0x559872))[_0xe671('0x41')](handleError(_0x346991,null));};exports[_0xe671('0x42')]=function(_0xd03ce2,_0xc0e8ce){var _0x39f8c6={'raw':!![],'where':{'id':_0xd03ce2['params']['id']}},_0x226a42={};_0x226a42[_0xe671('0x2c')]=_['keys'](db[_0xe671('0x3f')][_0xe671('0x29')]);_0x226a42['query']=_['keys'](_0xd03ce2[_0xe671('0x2d')]);_0x226a42[_0xe671('0x2f')]=_[_0xe671('0x30')](_0x226a42[_0xe671('0x2c')],_0x226a42[_0xe671('0x2d')]);_0x39f8c6[_0xe671('0x31')]=_[_0xe671('0x30')](_0x226a42['model'],qs[_0xe671('0x32')](_0xd03ce2[_0xe671('0x2d')][_0xe671('0x32')]));_0x39f8c6['attributes']=_0x39f8c6['attributes'][_0xe671('0x43')]?_0x39f8c6[_0xe671('0x31')]:_0x226a42['model'];if(_0xd03ce2[_0xe671('0x2d')]['includeAll']){_0x39f8c6[_0xe671('0x3e')]=[{'all':!![]}];}_0x39f8c6=_[_0xe671('0x39')]({},_0x39f8c6,_0xd03ce2[_0xe671('0x3b')]);return db[_0xe671('0x3f')]['find'](_0x39f8c6)[_0xe671('0x23')](handleEntityNotFound(_0xc0e8ce,null))[_0xe671('0x23')](respondWithResult(_0xc0e8ce,null))['catch'](handleError(_0xc0e8ce,null));};exports['create']=function(_0x4d7134,_0x19a625){return db[_0xe671('0x3f')]['create'](_0x4d7134[_0xe671('0x44')],{})[_0xe671('0x23')](respondWithResult(_0x19a625,0xc9))[_0xe671('0x41')](handleError(_0x19a625,null));};exports['update']=function(_0x3d216e,_0x56a403){if(_0x3d216e[_0xe671('0x44')]['id']){delete _0x3d216e['body']['id'];}return db[_0xe671('0x3f')][_0xe671('0x45')]({'where':{'id':_0x3d216e[_0xe671('0x46')]['id']}})['then'](handleEntityNotFound(_0x56a403,null))['then'](saveUpdates(_0x3d216e[_0xe671('0x44')],null))[_0xe671('0x23')](respondWithResult(_0x56a403,null))[_0xe671('0x41')](handleError(_0x56a403,null));};exports[_0xe671('0x47')]=function(_0x25c708,_0x218ef3){return db[_0xe671('0x3f')][_0xe671('0x45')]({'where':{'id':_0x25c708['params']['id']}})[_0xe671('0x23')](handleEntityNotFound(_0x218ef3,null))[_0xe671('0x23')](removeEntity(_0x218ef3,null))[_0xe671('0x41')](handleError(_0x218ef3,null));};exports[_0xe671('0x48')]=function(_0x59e40d,_0x4ce59a){return db[_0xe671('0x3f')][_0xe671('0x48')]()['then'](respondWithResult(_0x4ce59a,null))[_0xe671('0x41')](handleError(_0x4ce59a,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 128e2b9..3194655 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 _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x39ddd4,_0x38ce35){var _0x3d642a=function(_0xa05ced){while(--_0xa05ced){_0x39ddd4['push'](_0x39ddd4['shift']());}};_0x3d642a(++_0x38ce35);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x4fdd37,_0x6ddb6){_0x4fdd37=_0x4fdd37-0x0;var _0x46d6d1=_0x4fdb[_0x4fdd37];return _0x46d6d1;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4fd('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdace=['../../config/environment','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x82a03f,_0x83d124){var _0x1da06f=function(_0x3c84e1){while(--_0x3c84e1){_0x82a03f['push'](_0x82a03f['shift']());}};_0x1da06f(++_0x83d124);}(_0xdace,0xc5));var _0xedac=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xdace[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedac('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 3c5718e..1a16c6a 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 _0x5b0e=['ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x5e74a5,_0x150257){var _0x2b1172=function(_0xe202a2){while(--_0xe202a2){_0x5e74a5['push'](_0x5e74a5['shift']());}};_0x2b1172(++_0x150257);}(_0x5b0e,0x8e));var _0xe5b0=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x5b0e[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require('lodash');var util=require(_0xe5b0('0x0'));var moment=require('moment');var BPromise=require(_0xe5b0('0x1'));var rs=require(_0xe5b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe5b0('0x3'));var logger=require(_0xe5b0('0x4'))(_0xe5b0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe5b0('0x6'));var client=jayson['client'][_0xe5b0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x490a99,_0x55f7ec,_0x3ac72c){return new BPromise(function(_0x3429b4,_0x2e353b){return client[_0xe5b0('0x8')](_0x490a99,_0x3ac72c)[_0xe5b0('0x9')](function(_0x4ef294){logger['info'](_0xe5b0('0xa'),_0x55f7ec,'request\x20sent');logger['debug'](_0xe5b0('0xb'),_0x55f7ec,_0xe5b0('0xc'),JSON[_0xe5b0('0xd')](_0x4ef294));if(_0x4ef294[_0xe5b0('0xe')]){if(_0x4ef294[_0xe5b0('0xe')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x55f7ec,_0x4ef294[_0xe5b0('0xe')][_0xe5b0('0xf')]);return _0x2e353b(_0x4ef294[_0xe5b0('0xe')][_0xe5b0('0xf')]);}logger[_0xe5b0('0xe')](_0xe5b0('0xa'),_0x55f7ec,_0x4ef294[_0xe5b0('0xe')][_0xe5b0('0xf')]);return _0x3429b4(_0x4ef294[_0xe5b0('0xe')]['message']);}else{logger[_0xe5b0('0x10')](_0xe5b0('0xa'),_0x55f7ec,_0xe5b0('0xc'));_0x3429b4(_0x4ef294[_0xe5b0('0x11')]['message']);}})[_0xe5b0('0x12')](function(_0x288355){logger['error'](_0xe5b0('0xa'),_0x55f7ec,_0x288355);_0x2e353b(_0x288355);});});}
\ No newline at end of file
+var _0x8b33=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x8b33,0x8f));var _0x38b3=function(_0x2f34d1,_0x3ca5f9){_0x2f34d1=_0x2f34d1-0x0;var _0x2d9e58=_0x8b33[_0x2f34d1];return _0x2d9e58;};'use strict';var _=require(_0x38b3('0x0'));var util=require(_0x38b3('0x1'));var moment=require('moment');var BPromise=require(_0x38b3('0x2'));var rs=require(_0x38b3('0x3'));var fs=require('fs');var Redis=require(_0x38b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x38b3('0x5'));var logger=require(_0x38b3('0x6'))(_0x38b3('0x7'));var config=require(_0x38b3('0x8'));var jayson=require(_0x38b3('0x9'));var client=jayson[_0x38b3('0xa')][_0x38b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c23ca,_0x259df8,_0x2cda72){return new BPromise(function(_0x20a7b3,_0xfaae6f){return client['request'](_0x3c23ca,_0x2cda72)['then'](function(_0x3ee26b){logger['info'](_0x38b3('0xc'),_0x259df8,_0x38b3('0xd'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x259df8,'request\x20sent',JSON[_0x38b3('0xe')](_0x3ee26b));if(_0x3ee26b[_0x38b3('0xf')]){if(_0x3ee26b['error'][_0x38b3('0x10')]===0x1f4){logger[_0x38b3('0xf')](_0x38b3('0xc'),_0x259df8,_0x3ee26b[_0x38b3('0xf')][_0x38b3('0x11')]);return _0xfaae6f(_0x3ee26b['error']['message']);}logger[_0x38b3('0xf')](_0x38b3('0xc'),_0x259df8,_0x3ee26b[_0x38b3('0xf')]['message']);return _0x20a7b3(_0x3ee26b[_0x38b3('0xf')][_0x38b3('0x11')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x259df8,'request\x20sent');_0x20a7b3(_0x3ee26b[_0x38b3('0x12')][_0x38b3('0x11')]);}})[_0x38b3('0x13')](function(_0x36de00){logger[_0x38b3('0xf')](_0x38b3('0xc'),_0x259df8,_0x36de00);_0xfaae6f(_0x36de00);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index b006e80..57d118e 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 _0x2add=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37aebb,_0x5309f4){var _0x97ad33=function(_0x38827c){while(--_0x38827c){_0x37aebb['push'](_0x37aebb['shift']());}};_0x97ad33(++_0x5309f4);}(_0x2add,0x12a));var _0xd2ad=function(_0x4d6767,_0x4c024e){_0x4d6767=_0x4d6767-0x0;var _0x37a4d9=_0x2add[_0x4d6767];return _0x37a4d9;};'use strict';var multer=require('multer');var util=require(_0xd2ad('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd2ad('0x1'));var router=express[_0xd2ad('0x2')]();var auth=require(_0xd2ad('0x3'));var interaction=require(_0xd2ad('0x4'));var config=require(_0xd2ad('0x5'));var controller=require(_0xd2ad('0x6'));router[_0xd2ad('0x7')]('/',auth[_0xd2ad('0x8')](),controller[_0xd2ad('0x9')]);router[_0xd2ad('0x7')](_0xd2ad('0xa'),auth[_0xd2ad('0x8')](),controller[_0xd2ad('0xb')]);router['get'](_0xd2ad('0xc'),auth[_0xd2ad('0x8')](),controller['show']);router['post']('/',auth[_0xd2ad('0x8')](),controller[_0xd2ad('0xd')]);router[_0xd2ad('0xe')](_0xd2ad('0xc'),auth[_0xd2ad('0x8')](),controller[_0xd2ad('0xf')]);router[_0xd2ad('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd2ad('0x11')]);module[_0xd2ad('0x12')]=router;
\ No newline at end of file
+var _0xbe2e=['update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','put'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0xbe2e,0x112));var _0xebe2=function(_0x1c4b30,_0x21d23b){_0x1c4b30=_0x1c4b30-0x0;var _0x536864=_0xbe2e[_0x1c4b30];return _0x536864;};'use strict';var multer=require(_0xebe2('0x0'));var util=require(_0xebe2('0x1'));var path=require(_0xebe2('0x2'));var timeout=require(_0xebe2('0x3'));var express=require(_0xebe2('0x4'));var router=express[_0xebe2('0x5')]();var auth=require(_0xebe2('0x6'));var interaction=require(_0xebe2('0x7'));var config=require('../../config/environment');var controller=require(_0xebe2('0x8'));router[_0xebe2('0x9')]('/',auth[_0xebe2('0xa')](),controller['index']);router[_0xebe2('0x9')]('/describe',auth[_0xebe2('0xa')](),controller[_0xebe2('0xb')]);router[_0xebe2('0x9')](_0xebe2('0xc'),auth[_0xebe2('0xa')](),controller[_0xebe2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xebe2('0xe')](_0xebe2('0xc'),auth[_0xebe2('0xa')](),controller[_0xebe2('0xf')]);router['delete'](_0xebe2('0xc'),auth[_0xebe2('0xa')](),controller[_0xebe2('0x10')]);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 3226e80..379f5a2 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 _0x6c07=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0x6c07,0x143));var _0x76c0=function(_0x2ee8e7,_0x44a4b2){_0x2ee8e7=_0x2ee8e7-0x0;var _0x2594d0=_0x6c07[_0x2ee8e7];return _0x2594d0;};'use strict';var Sequelize=require(_0x76c0('0x0'));module[_0x76c0('0x1')]={'name':{'type':Sequelize[_0x76c0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x76c0('0x3')](_0x76c0('0x4'),'timeout'),'defaultValue':_0x76c0('0x4')},'selector':{'type':Sequelize[_0x76c0('0x2')]},'timeout':{'type':Sequelize[_0x76c0('0x5')]}};
\ No newline at end of file
+var _0x9c19=['ENUM','mouseOver','timeout','INTEGER','exports','STRING'];(function(_0x25cb7d,_0x364692){var _0x2e4663=function(_0x8ff107){while(--_0x8ff107){_0x25cb7d['push'](_0x25cb7d['shift']());}};_0x2e4663(++_0x364692);}(_0x9c19,0xe8));var _0x99c1=function(_0xe4dfd9,_0x34dda4){_0xe4dfd9=_0xe4dfd9-0x0;var _0x1c2a0f=_0x9c19[_0xe4dfd9];return _0x1c2a0f;};'use strict';var Sequelize=require('sequelize');module[_0x99c1('0x0')]={'name':{'type':Sequelize[_0x99c1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x99c1('0x2')](_0x99c1('0x3'),_0x99c1('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x99c1('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d2a7ee1..0409650 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 _0x135c=['rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','options','find','catch','create','body','update','html-pdf'];(function(_0x95cfc5,_0x189bc2){var _0x364a9f=function(_0x134e9f){while(--_0x134e9f){_0x95cfc5['push'](_0x95cfc5['shift']());}};_0x364a9f(++_0x189bc2);}(_0x135c,0xa1));var _0xc135=function(_0x13b3ce,_0x3f37c9){_0x13b3ce=_0x13b3ce-0x0;var _0x24cc3a=_0x135c[_0x13b3ce];return _0x24cc3a;};'use strict';var pdf=require(_0xc135('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc135('0x1'));var zipdir=require(_0xc135('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc135('0x3'));var moment=require(_0xc135('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc135('0x5'));var util=require(_0xc135('0x6'));var path=require(_0xc135('0x7'));var sox=require(_0xc135('0x8'));var csv=require(_0xc135('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc135('0xa'));var squel=require(_0xc135('0xb'));var crypto=require(_0xc135('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc135('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc135('0xe'));var authService=require(_0xc135('0xf'));var qs=require(_0xc135('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc135('0x11'))(_0xc135('0x12'));var utils=require('../../config/utils');var config=require(_0xc135('0x13'));var licenseUtil=require(_0xc135('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f8100,_0x4eca0a){_0x4eca0a=_0x4eca0a||0xcc;return function(_0x5df49f){if(_0x5df49f){return _0x4f8100[_0xc135('0x15')](_0x4eca0a);}return _0x4f8100[_0xc135('0x16')](_0x4eca0a)[_0xc135('0x17')]();};}function respondWithResult(_0x351f03,_0x49efac){_0x49efac=_0x49efac||0xc8;return function(_0x4f15a7){if(_0x4f15a7){return _0x351f03[_0xc135('0x16')](_0x49efac)['json'](_0x4f15a7);}};}function respondWithFilteredResult(_0x4d886a,_0x29e817){return function(_0xee3b7f){if(_0xee3b7f){var _0x53be23=_0xee3b7f[_0xc135('0x18')],_0x4fbefa=_0x29e817[_0xc135('0x19')],_0x1dd6e7=_0x29e817[_0xc135('0x19')]+_0x29e817[_0xc135('0x1a')],_0x211edf;if(_0x1dd6e7>=_0x53be23){_0x1dd6e7=_0x53be23;_0x211edf=0xc8;}else{_0x211edf=0xce;}_0x4d886a[_0xc135('0x16')](_0x211edf);return _0x4d886a[_0xc135('0x1b')](_0xc135('0x1c'),_0x4fbefa+'-'+_0x1dd6e7+'/'+_0x53be23)['json'](_0xee3b7f);}return null;};}function patchUpdates(_0x2470e4){return function(_0x4beda1){try{jsonpatch[_0xc135('0x1d')](_0x4beda1,_0x2470e4,!![]);}catch(_0x4adc0a){return BPromise['reject'](_0x4adc0a);}return _0x4beda1['save']();};}function saveUpdates(_0x11acdf,_0x27a731){return function(_0x3b14a3){if(_0x3b14a3){return _0x3b14a3['update'](_0x11acdf)[_0xc135('0x1e')](function(_0x19542c){return _0x19542c;});}return null;};}function removeEntity(_0x6b197b,_0x3e3f32){return function(_0x38283f){if(_0x38283f){return _0x38283f['destroy']()[_0xc135('0x1e')](function(){_0x6b197b[_0xc135('0x16')](0xcc)[_0xc135('0x17')]();});}};}function handleEntityNotFound(_0x5ee826,_0x4446dc){return function(_0x542689){if(!_0x542689){_0x5ee826[_0xc135('0x15')](0x194);}return _0x542689;};}function handleError(_0x61f89d,_0x14be59){_0x14be59=_0x14be59||0x1f4;return function(_0x17c80c){logger[_0xc135('0x1f')](_0x17c80c[_0xc135('0x20')]);if(_0x17c80c[_0xc135('0x21')]){delete _0x17c80c[_0xc135('0x21')];}_0x61f89d[_0xc135('0x16')](_0x14be59)[_0xc135('0x22')](_0x17c80c);};}exports[_0xc135('0x23')]=function(_0x253270,_0x3889ee){var _0x3a6fb6={'raw':!![],'where':{'id':_0x253270[_0xc135('0x24')]['id']}},_0x134f24={};_0x134f24[_0xc135('0x25')]=_[_0xc135('0x26')](db[_0xc135('0x27')][_0xc135('0x28')]);_0x134f24[_0xc135('0x29')]=_[_0xc135('0x26')](_0x253270['query']);_0x134f24[_0xc135('0x2a')]=_[_0xc135('0x2b')](_0x134f24['model'],_0x134f24[_0xc135('0x29')]);_0x3a6fb6[_0xc135('0x2c')]=_[_0xc135('0x2b')](_0x134f24['model'],qs['fields'](_0x253270[_0xc135('0x29')][_0xc135('0x2d')]));_0x3a6fb6[_0xc135('0x2c')]=_0x3a6fb6[_0xc135('0x2c')]['length']?_0x3a6fb6[_0xc135('0x2c')]:_0x134f24['model'];if(_0x253270['query'][_0xc135('0x2e')]){_0x3a6fb6[_0xc135('0x2f')]=[{'all':!![]}];}_0x3a6fb6=_['merge']({},_0x3a6fb6,_0x253270[_0xc135('0x30')]);return db['ChatProactiveAction'][_0xc135('0x31')](_0x3a6fb6)[_0xc135('0x1e')](handleEntityNotFound(_0x3889ee,null))['then'](respondWithResult(_0x3889ee,null))[_0xc135('0x32')](handleError(_0x3889ee,null));};exports['create']=function(_0x33dc47,_0x8a8074){return db['ChatProactiveAction'][_0xc135('0x33')](_0x33dc47[_0xc135('0x34')],{})[_0xc135('0x1e')](respondWithResult(_0x8a8074,0xc9))['catch'](handleError(_0x8a8074,null));};exports[_0xc135('0x35')]=function(_0x162104,_0x44a847){if(_0x162104['body']['id']){delete _0x162104[_0xc135('0x34')]['id'];}return db[_0xc135('0x27')][_0xc135('0x31')]({'where':{'id':_0x162104['params']['id']}})[_0xc135('0x1e')](handleEntityNotFound(_0x44a847,null))[_0xc135('0x1e')](saveUpdates(_0x162104['body'],null))['then'](respondWithResult(_0x44a847,null))['catch'](handleError(_0x44a847,null));};exports['destroy']=function(_0xd01bf7,_0xcf5714){return db['ChatProactiveAction'][_0xc135('0x31')]({'where':{'id':_0xd01bf7[_0xc135('0x24')]['id']}})[_0xc135('0x1e')](handleEntityNotFound(_0xcf5714,null))['then'](removeEntity(_0xcf5714,null))['catch'](handleError(_0xcf5714,null));};
\ No newline at end of file
+var _0x3f7c=['../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','apply','save','update','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','merge','find','then','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x3f7c,0x13d));var _0xc3f7=function(_0x32fc1d,_0x1bd713){_0x32fc1d=_0x32fc1d-0x0;var _0x3a3714=_0x3f7c[_0x32fc1d];return _0x3a3714;};'use strict';var pdf=require(_0xc3f7('0x0'));var emlformat=require(_0xc3f7('0x1'));var rimraf=require(_0xc3f7('0x2'));var zipdir=require(_0xc3f7('0x3'));var jsonpatch=require(_0xc3f7('0x4'));var rp=require('request-promise');var moment=require(_0xc3f7('0x5'));var BPromise=require(_0xc3f7('0x6'));var Mustache=require(_0xc3f7('0x7'));var util=require(_0xc3f7('0x8'));var path=require(_0xc3f7('0x9'));var sox=require(_0xc3f7('0xa'));var csv=require(_0xc3f7('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc3f7('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc3f7('0xd'));var deskjs=require(_0xc3f7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc3f7('0xf'));var Redis=require(_0xc3f7('0x10'));var authService=require(_0xc3f7('0x11'));var qs=require(_0xc3f7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f7('0x13'));var logger=require(_0xc3f7('0x14'))(_0xc3f7('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc3f7('0x16'));var db=require(_0xc3f7('0x17'))['db'];function respondWithStatusCode(_0x1e6648,_0x497265){_0x497265=_0x497265||0xcc;return function(_0x476a9f){if(_0x476a9f){return _0x1e6648[_0xc3f7('0x18')](_0x497265);}return _0x1e6648[_0xc3f7('0x19')](_0x497265)[_0xc3f7('0x1a')]();};}function respondWithResult(_0xc5f8bc,_0x4309ce){_0x4309ce=_0x4309ce||0xc8;return function(_0x293c60){if(_0x293c60){return _0xc5f8bc[_0xc3f7('0x19')](_0x4309ce)[_0xc3f7('0x1b')](_0x293c60);}};}function respondWithFilteredResult(_0x31a8e5,_0xe1bbe9){return function(_0x429159){if(_0x429159){var _0x5eb078=_0x429159[_0xc3f7('0x1c')],_0x13f6b7=_0xe1bbe9[_0xc3f7('0x1d')],_0x4d65fa=_0xe1bbe9[_0xc3f7('0x1d')]+_0xe1bbe9['limit'],_0x3a1b04;if(_0x4d65fa>=_0x5eb078){_0x4d65fa=_0x5eb078;_0x3a1b04=0xc8;}else{_0x3a1b04=0xce;}_0x31a8e5[_0xc3f7('0x19')](_0x3a1b04);return _0x31a8e5['set']('Content-Range',_0x13f6b7+'-'+_0x4d65fa+'/'+_0x5eb078)['json'](_0x429159);}return null;};}function patchUpdates(_0x5ee21a){return function(_0x5b7304){try{jsonpatch[_0xc3f7('0x1e')](_0x5b7304,_0x5ee21a,!![]);}catch(_0x6d02f3){return BPromise['reject'](_0x6d02f3);}return _0x5b7304[_0xc3f7('0x1f')]();};}function saveUpdates(_0x1ff3a6,_0x4a450f){return function(_0x3f1da1){if(_0x3f1da1){return _0x3f1da1[_0xc3f7('0x20')](_0x1ff3a6)['then'](function(_0x469a04){return _0x469a04;});}return null;};}function removeEntity(_0x4c3489,_0x43fb2d){return function(_0x4b2ded){if(_0x4b2ded){return _0x4b2ded[_0xc3f7('0x21')]()['then'](function(){_0x4c3489[_0xc3f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ae711,_0x2304c3){return function(_0x2edd1d){if(!_0x2edd1d){_0x2ae711[_0xc3f7('0x18')](0x194);}return _0x2edd1d;};}function handleError(_0x32357e,_0x5bb994){_0x5bb994=_0x5bb994||0x1f4;return function(_0x1f96bc){logger[_0xc3f7('0x22')](_0x1f96bc[_0xc3f7('0x23')]);if(_0x1f96bc[_0xc3f7('0x24')]){delete _0x1f96bc[_0xc3f7('0x24')];}_0x32357e[_0xc3f7('0x19')](_0x5bb994)[_0xc3f7('0x25')](_0x1f96bc);};}exports[_0xc3f7('0x26')]=function(_0x5b29db,_0x1312f4){var _0x405aa6={'raw':!![],'where':{'id':_0x5b29db[_0xc3f7('0x27')]['id']}},_0x555ddf={};_0x555ddf[_0xc3f7('0x28')]=_[_0xc3f7('0x29')](db[_0xc3f7('0x2a')][_0xc3f7('0x2b')]);_0x555ddf[_0xc3f7('0x2c')]=_['keys'](_0x5b29db[_0xc3f7('0x2c')]);_0x555ddf['filters']=_[_0xc3f7('0x2d')](_0x555ddf[_0xc3f7('0x28')],_0x555ddf[_0xc3f7('0x2c')]);_0x405aa6['attributes']=_[_0xc3f7('0x2d')](_0x555ddf[_0xc3f7('0x28')],qs[_0xc3f7('0x2e')](_0x5b29db[_0xc3f7('0x2c')][_0xc3f7('0x2e')]));_0x405aa6[_0xc3f7('0x2f')]=_0x405aa6[_0xc3f7('0x2f')][_0xc3f7('0x30')]?_0x405aa6['attributes']:_0x555ddf[_0xc3f7('0x28')];if(_0x5b29db[_0xc3f7('0x2c')][_0xc3f7('0x31')]){_0x405aa6['include']=[{'all':!![]}];}_0x405aa6=_[_0xc3f7('0x32')]({},_0x405aa6,_0x5b29db['options']);return db[_0xc3f7('0x2a')][_0xc3f7('0x33')](_0x405aa6)[_0xc3f7('0x34')](handleEntityNotFound(_0x1312f4,null))[_0xc3f7('0x34')](respondWithResult(_0x1312f4,null))[_0xc3f7('0x35')](handleError(_0x1312f4,null));};exports[_0xc3f7('0x36')]=function(_0x51154b,_0x379aa5){return db[_0xc3f7('0x2a')][_0xc3f7('0x36')](_0x51154b[_0xc3f7('0x37')],{})[_0xc3f7('0x34')](respondWithResult(_0x379aa5,0xc9))['catch'](handleError(_0x379aa5,null));};exports[_0xc3f7('0x20')]=function(_0x35b5a9,_0x3bc1cb){if(_0x35b5a9[_0xc3f7('0x37')]['id']){delete _0x35b5a9[_0xc3f7('0x37')]['id'];}return db[_0xc3f7('0x2a')][_0xc3f7('0x33')]({'where':{'id':_0x35b5a9[_0xc3f7('0x27')]['id']}})[_0xc3f7('0x34')](handleEntityNotFound(_0x3bc1cb,null))[_0xc3f7('0x34')](saveUpdates(_0x35b5a9[_0xc3f7('0x37')],null))[_0xc3f7('0x34')](respondWithResult(_0x3bc1cb,null))['catch'](handleError(_0x3bc1cb,null));};exports[_0xc3f7('0x21')]=function(_0x274566,_0x549381){return db[_0xc3f7('0x2a')]['find']({'where':{'id':_0x274566[_0xc3f7('0x27')]['id']}})[_0xc3f7('0x34')](handleEntityNotFound(_0x549381,null))['then'](removeEntity(_0x549381,null))[_0xc3f7('0x35')](handleError(_0x549381,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7bc9b51..a9728db 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 _0xc37d=['exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x10f43f,_0x4b53d6){var _0x10cfda=function(_0x4dc3b1){while(--_0x4dc3b1){_0x10f43f['push'](_0x10f43f['shift']());}};_0x10cfda(++_0x4b53d6);}(_0xc37d,0x1a7));var _0xdc37=function(_0x3fdcf7,_0x233df7){_0x3fdcf7=_0x3fdcf7-0x0;var _0x624416=_0xc37d[_0x3fdcf7];return _0x624416;};'use strict';var _=require('lodash');var util=require(_0xdc37('0x0'));var logger=require(_0xdc37('0x1'))('api');var moment=require(_0xdc37('0x2'));var BPromise=require(_0xdc37('0x3'));var rp=require(_0xdc37('0x4'));var fs=require('fs');var path=require(_0xdc37('0x5'));var rimraf=require(_0xdc37('0x6'));var config=require(_0xdc37('0x7'));var attributes=require(_0xdc37('0x8'));module[_0xdc37('0x9')]=function(_0x4afbab,_0x1b623c){return _0x4afbab['define'](_0xdc37('0xa'),attributes,{'tableName':_0xdc37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5b4=['moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd5b4,0x1e0));var _0x4d5b=function(_0x36cbc8,_0x2faacc){_0x36cbc8=_0x36cbc8-0x0;var _0x1329c6=_0xd5b4[_0x36cbc8];return _0x1329c6;};'use strict';var _=require(_0x4d5b('0x0'));var util=require(_0x4d5b('0x1'));var logger=require(_0x4d5b('0x2'))(_0x4d5b('0x3'));var moment=require(_0x4d5b('0x4'));var BPromise=require(_0x4d5b('0x5'));var rp=require(_0x4d5b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d5b('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d5b('0x8'));module[_0x4d5b('0x9')]=function(_0x76be97,_0x5cc333){return _0x76be97[_0x4d5b('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 9f396b0..fe717bc 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 _0x08dd=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2be01d,_0x5e7bae){var _0x2918a9=function(_0x1bd70e){while(--_0x1bd70e){_0x2be01d['push'](_0x2be01d['shift']());}};_0x2918a9(++_0x5e7bae);}(_0x08dd,0x1f2));var _0xd08d=function(_0x4a339e,_0xc55463){_0x4a339e=_0x4a339e-0x0;var _0x401b5=_0x08dd[_0x4a339e];return _0x401b5;};'use strict';var _=require(_0xd08d('0x0'));var util=require(_0xd08d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd08d('0x2'));var fs=require('fs');var Redis=require(_0xd08d('0x3'));var db=require(_0xd08d('0x4'))['db'];var utils=require(_0xd08d('0x5'));var logger=require('../../config/logger')(_0xd08d('0x6'));var config=require('../../config/environment');var jayson=require(_0xd08d('0x7'));var client=jayson[_0xd08d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x597ae1,_0x5745e7,_0x1bca82){return new BPromise(function(_0x4cb8fe,_0x285bfc){return client['request'](_0x597ae1,_0x1bca82)[_0xd08d('0x9')](function(_0x38779d){logger[_0xd08d('0xa')](_0xd08d('0xb'),_0x5745e7,_0xd08d('0xc'));logger[_0xd08d('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5745e7,_0xd08d('0xc'),JSON[_0xd08d('0xe')](_0x38779d));if(_0x38779d[_0xd08d('0xf')]){if(_0x38779d[_0xd08d('0xf')][_0xd08d('0x10')]===0x1f4){logger['error'](_0xd08d('0xb'),_0x5745e7,_0x38779d[_0xd08d('0xf')]['message']);return _0x285bfc(_0x38779d['error']['message']);}logger[_0xd08d('0xf')](_0xd08d('0xb'),_0x5745e7,_0x38779d[_0xd08d('0xf')][_0xd08d('0x11')]);return _0x4cb8fe(_0x38779d[_0xd08d('0xf')][_0xd08d('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5745e7,'request\x20sent');_0x4cb8fe(_0x38779d[_0xd08d('0x12')][_0xd08d('0x11')]);}})[_0xd08d('0x13')](function(_0x5710db){logger[_0xd08d('0xf')](_0xd08d('0xb'),_0x5745e7,_0x5710db);_0x285bfc(_0x5710db);});});}
\ No newline at end of file
+var _0xf7a8=['error','message','result','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d54ff,_0x1607de){var _0x2795a7=function(_0x2a1ed6){while(--_0x2a1ed6){_0x5d54ff['push'](_0x5d54ff['shift']());}};_0x2795a7(++_0x1607de);}(_0xf7a8,0x1c5));var _0x8f7a=function(_0x27fe50,_0x44a45a){_0x27fe50=_0x27fe50-0x0;var _0x233ebc=_0xf7a8[_0x27fe50];return _0x233ebc;};'use strict';var _=require('lodash');var util=require(_0x8f7a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8f7a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f7a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f7a('0x3'))(_0x8f7a('0x4'));var config=require(_0x8f7a('0x5'));var jayson=require(_0x8f7a('0x6'));var client=jayson[_0x8f7a('0x7')][_0x8f7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2aebdb,_0x1d001a,_0x484313){return new BPromise(function(_0x4de355,_0x327b20){return client['request'](_0x2aebdb,_0x484313)[_0x8f7a('0x9')](function(_0x18abb2){logger[_0x8f7a('0xa')](_0x8f7a('0xb'),_0x1d001a,_0x8f7a('0xc'));logger['debug'](_0x8f7a('0xd'),_0x1d001a,_0x8f7a('0xc'),JSON[_0x8f7a('0xe')](_0x18abb2));if(_0x18abb2[_0x8f7a('0xf')]){if(_0x18abb2[_0x8f7a('0xf')]['code']===0x1f4){logger[_0x8f7a('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x1d001a,_0x18abb2[_0x8f7a('0xf')][_0x8f7a('0x10')]);return _0x327b20(_0x18abb2[_0x8f7a('0xf')][_0x8f7a('0x10')]);}logger[_0x8f7a('0xf')](_0x8f7a('0xb'),_0x1d001a,_0x18abb2['error']['message']);return _0x4de355(_0x18abb2[_0x8f7a('0xf')]['message']);}else{logger['info'](_0x8f7a('0xb'),_0x1d001a,_0x8f7a('0xc'));_0x4de355(_0x18abb2[_0x8f7a('0x11')]['message']);}})['catch'](function(_0x2a0af4){logger[_0x8f7a('0xf')](_0x8f7a('0xb'),_0x1d001a,_0x2a0af4);_0x327b20(_0x2a0af4);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 45122f4..1452883 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 _0x1b99=['show','post','delete','multer','util','path','express','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x5709ea,_0x5c0089){var _0x1998b4=function(_0x3bab6b){while(--_0x3bab6b){_0x5709ea['push'](_0x5709ea['shift']());}};_0x1998b4(++_0x5c0089);}(_0x1b99,0x17c));var _0x91b9=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0x1b99[_0x51b661];return _0x5d1971;};'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
+var _0x3aff=['update','delete','exports','multer','express','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3aff,0x148));var _0xf3af=function(_0x36ae93,_0x17b708){_0x36ae93=_0x36ae93-0x0;var _0x57ce16=_0x3aff[_0x36ae93];return _0x57ce16;};'use strict';var multer=require(_0xf3af('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf3af('0x1'));var router=express['Router']();var auth=require(_0xf3af('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf3af('0x3'));var controller=require('./chatProactiveAction.controller');router[_0xf3af('0x4')](_0xf3af('0x5'),auth[_0xf3af('0x6')](),controller[_0xf3af('0x7')]);router[_0xf3af('0x8')]('/',auth['isAuthenticated'](),controller[_0xf3af('0x9')]);router['put'](_0xf3af('0x5'),auth[_0xf3af('0x6')](),controller[_0xf3af('0xa')]);router[_0xf3af('0xb')]('/:id',auth[_0xf3af('0x6')](),controller['destroy']);module[_0xf3af('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 32d0298..2a23d8e 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 _0xb061=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1026e5,_0x586b6e){var _0x455c4f=function(_0x5d7534){while(--_0x5d7534){_0x1026e5['push'](_0x1026e5['shift']());}};_0x455c4f(++_0x586b6e);}(_0xb061,0xbe));var _0x1b06=function(_0x3e8c34,_0x549d3c){_0x3e8c34=_0x3e8c34-0x0;var _0x14969e=_0xb061[_0x3e8c34];return _0x14969e;};'use strict';var Sequelize=require(_0x1b06('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b06('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1b06('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b06('0x3')](_0x1b06('0x4'),_0x1b06('0x5'),_0x1b06('0x6'))}};
\ No newline at end of file
+var _0xaa32=['INTEGER','beepall','sequelize','STRING','name'];(function(_0x2cdf04,_0x3b40ec){var _0x383eb3=function(_0x356d7a){while(--_0x356d7a){_0x2cdf04['push'](_0x2cdf04['shift']());}};_0x383eb3(++_0x3b40ec);}(_0xaa32,0xb1));var _0x2aa3=function(_0x5595b0,_0x2a2d18){_0x5595b0=_0x5595b0-0x0;var _0x17a66c=_0xaa32[_0x5595b0];return _0x17a66c;};'use strict';var Sequelize=require(_0x2aa3('0x0'));module['exports']={'name':{'type':Sequelize[_0x2aa3('0x1')],'unique':_0x2aa3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2aa3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x2aa3('0x4'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 75f53af..6de3f10 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 _0xb680=['rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','autoAssociation','describe','getMembers','findOne','keys','UserChatQueue','nolimit','ChatQueueId','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','createdAt','updatedAt','getTeams','hasOwnProperty','addTeams','ids','Team','online','voicePause','flatMap','Agents','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ChatQueue,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x58a4ac,_0x26f3e7){var _0x435e2d=function(_0x1a5660){while(--_0x1a5660){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x435e2d(++_0x26f3e7);}(_0xb680,0x177));var _0x0b68=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0xb680[_0x871ef5];return _0x1f62ea;};'use strict';var pdf=require(_0x0b68('0x0'));var emlformat=require(_0x0b68('0x1'));var rimraf=require(_0x0b68('0x2'));var zipdir=require(_0x0b68('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b68('0x4'));var moment=require(_0x0b68('0x5'));var BPromise=require(_0x0b68('0x6'));var Mustache=require(_0x0b68('0x7'));var util=require(_0x0b68('0x8'));var path=require('path');var sox=require(_0x0b68('0x9'));var csv=require(_0x0b68('0xa'));var ejs=require(_0x0b68('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0b68('0xc'));var crypto=require(_0x0b68('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b68('0xa'));var querystring=require(_0x0b68('0xe'));var Papa=require(_0x0b68('0xf'));var Redis=require(_0x0b68('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b68('0x11'));var as=require(_0x0b68('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b68('0x13'))(_0x0b68('0x14'));var utils=require(_0x0b68('0x15'));var config=require(_0x0b68('0x16'));var licenseUtil=require(_0x0b68('0x17'));var db=require(_0x0b68('0x18'))['db'];config[_0x0b68('0x19')]=_[_0x0b68('0x1a')](config['redis'],{'host':_0x0b68('0x1b'),'port':0x18eb});var socket=require(_0x0b68('0x1c'))(new Redis(config[_0x0b68('0x19')]));require(_0x0b68('0x1d'))[_0x0b68('0x1e')](socket);var jayson=require(_0x0b68('0x1f'));var client=jayson[_0x0b68('0x20')][_0x0b68('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x307c99,_0x90b9a5,_0x10a434,_0x297377){return new BPromise(function(_0x5a77b1,_0x27fd5c){var _0x3dd613=_0x297377||client;return _0x3dd613['request'](_0x307c99,_0x10a434)[_0x0b68('0x22')](function(_0x147f6c){logger['info']('ChatQueue,\x20%s,\x20%s',_0x90b9a5,'request\x20sent');logger[_0x0b68('0x23')](_0x0b68('0x24'),_0x90b9a5,_0x0b68('0x25'),JSON['stringify'](_0x147f6c));if(_0x147f6c['error']){if(_0x147f6c['error'][_0x0b68('0x26')]===0x1f4){logger[_0x0b68('0x27')](_0x0b68('0x28'),_0x90b9a5,_0x147f6c[_0x0b68('0x27')][_0x0b68('0x29')]);return _0x27fd5c(_0x147f6c[_0x0b68('0x27')][_0x0b68('0x29')]);}logger['error'](_0x0b68('0x28'),_0x90b9a5,_0x147f6c[_0x0b68('0x27')]['message']);return _0x5a77b1(_0x147f6c[_0x0b68('0x27')][_0x0b68('0x29')]);}else{logger[_0x0b68('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x90b9a5,_0x0b68('0x25'));_0x5a77b1(_0x147f6c[_0x0b68('0x2b')][_0x0b68('0x29')]);}})[_0x0b68('0x2c')](function(_0x16ac28){logger[_0x0b68('0x27')](_0x0b68('0x28'),_0x90b9a5,_0x16ac28);_0x27fd5c(_0x16ac28);});});}function respondWithStatusCode(_0x1b31de,_0x52fca7){_0x52fca7=_0x52fca7||0xcc;return function(_0x5637b6){if(_0x5637b6){return _0x1b31de[_0x0b68('0x2d')](_0x52fca7);}return _0x1b31de[_0x0b68('0x2e')](_0x52fca7)[_0x0b68('0x2f')]();};}function respondWithResult(_0xb754fc,_0x16b6e5){_0x16b6e5=_0x16b6e5||0xc8;return function(_0x2ffabc){if(_0x2ffabc){return _0xb754fc[_0x0b68('0x2e')](_0x16b6e5)['json'](_0x2ffabc);}};}function respondWithFilteredResult(_0x4e6652,_0x330a34){return function(_0x22d08c){if(_0x22d08c){var _0x20bad7=_0x22d08c[_0x0b68('0x30')],_0x16efb9=_0x330a34[_0x0b68('0x31')],_0x3d8fb7=_0x330a34[_0x0b68('0x31')]+_0x330a34[_0x0b68('0x32')],_0x1d734f;if(_0x3d8fb7>=_0x20bad7){_0x3d8fb7=_0x20bad7;_0x1d734f=0xc8;}else{_0x1d734f=0xce;}_0x4e6652[_0x0b68('0x2e')](_0x1d734f);return _0x4e6652[_0x0b68('0x33')](_0x0b68('0x34'),_0x16efb9+'-'+_0x3d8fb7+'/'+_0x20bad7)[_0x0b68('0x35')](_0x22d08c);}return null;};}function patchUpdates(_0x40198d){return function(_0x5b3068){try{jsonpatch[_0x0b68('0x36')](_0x5b3068,_0x40198d,!![]);}catch(_0x2025a5){return BPromise[_0x0b68('0x37')](_0x2025a5);}return _0x5b3068['save']();};}function saveUpdates(_0x259b0f,_0x4201e0){return function(_0x5ba379){if(_0x5ba379){return _0x5ba379[_0x0b68('0x38')](_0x259b0f)[_0x0b68('0x22')](function(_0xddaa43){return _0xddaa43;});}return null;};}function removeEntity(_0x534a19,_0x577aba){return function(_0x3cb5bb){if(_0x3cb5bb){return _0x3cb5bb['destroy']()[_0x0b68('0x22')](function(){var _0x2062f3=_0x3cb5bb['get']({'plain':!![]});var _0x5c20ab=_0x0b68('0x39');return db[_0x0b68('0x3a')][_0x0b68('0x3b')]({'where':{'type':_0x5c20ab,'resourceId':_0x2062f3['id']}})[_0x0b68('0x22')](function(){return _0x3cb5bb;});})[_0x0b68('0x22')](function(){_0x534a19[_0x0b68('0x2e')](0xcc)[_0x0b68('0x2f')]();});}};}function handleEntityNotFound(_0x25b22d,_0x1a2ef1){return function(_0x444ef0){if(!_0x444ef0){_0x25b22d[_0x0b68('0x2d')](0x194);}return _0x444ef0;};}function handleError(_0x279f06,_0x10656a){_0x10656a=_0x10656a||0x1f4;return function(_0x57c69d){logger['error'](_0x57c69d[_0x0b68('0x3c')]);if(_0x57c69d['name']){delete _0x57c69d[_0x0b68('0x3d')];}_0x279f06[_0x0b68('0x2e')](_0x10656a)[_0x0b68('0x3e')](_0x57c69d);};}exports['index']=function(_0x3ad6d9,_0xab3bc9){var _0x227a3f={},_0x240543={},_0x4e26d0={'count':0x0,'rows':[]};var _0x3bc96c=_[_0x0b68('0x3f')](db[_0x0b68('0x40')][_0x0b68('0x41')],function(_0x5281a5){return{'name':_0x5281a5[_0x0b68('0x42')],'type':_0x5281a5[_0x0b68('0x43')][_0x0b68('0x44')]};});_0x240543['model']=_[_0x0b68('0x3f')](_0x3bc96c,_0x0b68('0x3d'));_0x240543['query']=_['keys'](_0x3ad6d9[_0x0b68('0x45')]);_0x240543[_0x0b68('0x46')]=_[_0x0b68('0x47')](_0x240543[_0x0b68('0x48')],_0x240543[_0x0b68('0x45')]);_0x227a3f[_0x0b68('0x49')]=_[_0x0b68('0x47')](_0x240543[_0x0b68('0x48')],qs[_0x0b68('0x4a')](_0x3ad6d9[_0x0b68('0x45')][_0x0b68('0x4a')]));_0x227a3f[_0x0b68('0x49')]=_0x227a3f[_0x0b68('0x49')][_0x0b68('0x4b')]?_0x227a3f[_0x0b68('0x49')]:_0x240543[_0x0b68('0x48')];if(!_0x3ad6d9[_0x0b68('0x45')]['hasOwnProperty']('nolimit')){_0x227a3f[_0x0b68('0x32')]=qs[_0x0b68('0x32')](_0x3ad6d9['query'][_0x0b68('0x32')]);_0x227a3f[_0x0b68('0x31')]=qs[_0x0b68('0x31')](_0x3ad6d9[_0x0b68('0x45')][_0x0b68('0x31')]);}_0x227a3f[_0x0b68('0x4c')]=qs['sort'](_0x3ad6d9['query'][_0x0b68('0x4d')]);_0x227a3f[_0x0b68('0x4e')]=qs[_0x0b68('0x46')](_[_0x0b68('0x4f')](_0x3ad6d9[_0x0b68('0x45')],_0x240543[_0x0b68('0x46')]),_0x3bc96c);if(_0x3ad6d9[_0x0b68('0x45')][_0x0b68('0x50')]){_0x227a3f[_0x0b68('0x4e')]=_[_0x0b68('0x51')](_0x227a3f[_0x0b68('0x4e')],{'$or':_['map'](_0x3bc96c,function(_0x425571){if(_0x425571[_0x0b68('0x43')]!==_0x0b68('0x52')){var _0x1c23b6={};_0x1c23b6[_0x425571[_0x0b68('0x3d')]]={'$like':'%'+_0x3ad6d9[_0x0b68('0x45')][_0x0b68('0x50')]+'%'};return _0x1c23b6;}})});}_0x227a3f=_['merge']({},_0x227a3f,_0x3ad6d9[_0x0b68('0x53')]);var _0x15bef4={'where':_0x227a3f[_0x0b68('0x4e')]};return db[_0x0b68('0x40')][_0x0b68('0x30')](_0x15bef4)[_0x0b68('0x22')](function(_0x21cbec){_0x4e26d0[_0x0b68('0x30')]=_0x21cbec;if(_0x3ad6d9[_0x0b68('0x45')][_0x0b68('0x54')]){_0x227a3f[_0x0b68('0x55')]=[{'all':!![]}];}return db[_0x0b68('0x40')][_0x0b68('0x56')](_0x227a3f);})[_0x0b68('0x22')](function(_0x3189ea){_0x4e26d0[_0x0b68('0x57')]=_0x3189ea;return _0x4e26d0;})['then'](respondWithFilteredResult(_0xab3bc9,_0x227a3f))['catch'](handleError(_0xab3bc9,null));};exports[_0x0b68('0x58')]=function(_0xaa6d53,_0x1d9557){var _0x462cf5={'raw':!![],'where':{'id':_0xaa6d53[_0x0b68('0x59')]['id']}},_0x501fac={};_0x501fac[_0x0b68('0x48')]=_['keys'](db[_0x0b68('0x40')][_0x0b68('0x41')]);_0x501fac[_0x0b68('0x45')]=_['keys'](_0xaa6d53[_0x0b68('0x45')]);_0x501fac[_0x0b68('0x46')]=_[_0x0b68('0x47')](_0x501fac[_0x0b68('0x48')],_0x501fac[_0x0b68('0x45')]);_0x462cf5[_0x0b68('0x49')]=_['intersection'](_0x501fac[_0x0b68('0x48')],qs['fields'](_0xaa6d53[_0x0b68('0x45')]['fields']));_0x462cf5[_0x0b68('0x49')]=_0x462cf5[_0x0b68('0x49')][_0x0b68('0x4b')]?_0x462cf5['attributes']:_0x501fac[_0x0b68('0x48')];if(_0xaa6d53[_0x0b68('0x45')][_0x0b68('0x54')]){_0x462cf5[_0x0b68('0x55')]=[{'all':!![]}];}_0x462cf5=_[_0x0b68('0x51')]({},_0x462cf5,_0xaa6d53[_0x0b68('0x53')]);return db[_0x0b68('0x40')]['find'](_0x462cf5)[_0x0b68('0x22')](handleEntityNotFound(_0x1d9557,null))[_0x0b68('0x22')](respondWithResult(_0x1d9557,null))[_0x0b68('0x2c')](handleError(_0x1d9557,null));};exports[_0x0b68('0x5a')]=function(_0x34eff4,_0xd3a2e1){return db[_0x0b68('0x40')]['create'](_0x34eff4[_0x0b68('0x5b')],{})[_0x0b68('0x22')](function(_0x59b1f9){var _0x5b858f=_0x34eff4[_0x0b68('0x5c')]['get']({'plain':!![]});if(!_0x5b858f)throw new Error(_0x0b68('0x5d'));if(_0x5b858f['role']===_0x0b68('0x5c')){var _0x24498a=_0x59b1f9[_0x0b68('0x5e')]({'plain':!![]});var _0x591f89=_0x0b68('0x39');return db[_0x0b68('0x5f')][_0x0b68('0x60')]({'where':{'name':_0x591f89,'userProfileId':_0x5b858f['userProfileId']},'raw':!![]})['then'](function(_0x328476){if(_0x328476&&_0x328476[_0x0b68('0x61')]===0x0){return db[_0x0b68('0x3a')]['create']({'name':_0x24498a['name'],'resourceId':_0x24498a['id'],'type':_0x328476[_0x0b68('0x3d')],'sectionId':_0x328476['id']},{})[_0x0b68('0x22')](function(){return _0x59b1f9;});}else{return _0x59b1f9;}})[_0x0b68('0x2c')](function(_0x12f798){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f798);throw _0x12f798;});}return _0x59b1f9;})['then'](respondWithResult(_0xd3a2e1,0xc9))[_0x0b68('0x2c')](handleError(_0xd3a2e1,null));};exports[_0x0b68('0x38')]=function(_0x1ce6c3,_0x1a231d){if(_0x1ce6c3[_0x0b68('0x5b')]['id']){delete _0x1ce6c3[_0x0b68('0x5b')]['id'];}return db[_0x0b68('0x40')][_0x0b68('0x60')]({'where':{'id':_0x1ce6c3[_0x0b68('0x59')]['id']}})['then'](handleEntityNotFound(_0x1a231d,null))['then'](saveUpdates(_0x1ce6c3['body'],null))['then'](respondWithResult(_0x1a231d,null))[_0x0b68('0x2c')](handleError(_0x1a231d,null));};exports[_0x0b68('0x3b')]=function(_0x59c6fa,_0x11196b){return db[_0x0b68('0x40')]['find']({'where':{'id':_0x59c6fa[_0x0b68('0x59')]['id']}})[_0x0b68('0x22')](handleEntityNotFound(_0x11196b,null))[_0x0b68('0x22')](removeEntity(_0x11196b,null))[_0x0b68('0x2c')](handleError(_0x11196b,null));};exports[_0x0b68('0x62')]=function(_0x12852d,_0x3b2ab2){return db['ChatQueue'][_0x0b68('0x62')]()[_0x0b68('0x22')](respondWithResult(_0x3b2ab2,null))[_0x0b68('0x2c')](handleError(_0x3b2ab2,null));};exports[_0x0b68('0x63')]=function(_0x5bb45f,_0xd26664,_0x157116){var _0x29e9ea={'raw':!![],'where':{}},_0x1a5fea={},_0x32eed2;return db['ChatQueue'][_0x0b68('0x64')]({'where':{'id':_0x5bb45f[_0x0b68('0x59')]['id']}})[_0x0b68('0x22')](handleEntityNotFound(_0xd26664,null))[_0x0b68('0x22')](function(_0x117935){if(_0x117935){_0x32eed2=_0x117935['get']({'plain':!![]});_0x1a5fea[_0x0b68('0x48')]=_[_0x0b68('0x65')](db[_0x0b68('0x66')][_0x0b68('0x41')]);_0x1a5fea[_0x0b68('0x45')]=_[_0x0b68('0x65')](_0x5bb45f[_0x0b68('0x45')]);_0x1a5fea[_0x0b68('0x46')]=_[_0x0b68('0x47')](_0x1a5fea['model'],_0x1a5fea[_0x0b68('0x45')]);_0x29e9ea[_0x0b68('0x49')]=_[_0x0b68('0x47')](_0x1a5fea[_0x0b68('0x48')],qs[_0x0b68('0x4a')](_0x5bb45f[_0x0b68('0x45')][_0x0b68('0x4a')]));_0x29e9ea[_0x0b68('0x49')]=_0x29e9ea['attributes'][_0x0b68('0x4b')]?_0x29e9ea[_0x0b68('0x49')]:_0x1a5fea[_0x0b68('0x48')];if(!_0x5bb45f[_0x0b68('0x45')]['hasOwnProperty'](_0x0b68('0x67'))){_0x29e9ea[_0x0b68('0x32')]=qs[_0x0b68('0x32')](_0x5bb45f[_0x0b68('0x45')][_0x0b68('0x32')]);_0x29e9ea['offset']=qs[_0x0b68('0x31')](_0x5bb45f['query']['offset']);}_0x29e9ea[_0x0b68('0x4c')]=qs[_0x0b68('0x4d')](_0x5bb45f[_0x0b68('0x45')][_0x0b68('0x4d')]);_0x29e9ea[_0x0b68('0x4e')]=qs[_0x0b68('0x46')](_[_0x0b68('0x4f')](_0x5bb45f[_0x0b68('0x45')],_0x1a5fea[_0x0b68('0x46')]));_0x29e9ea[_0x0b68('0x4e')][_0x0b68('0x68')]=_0x117935['id'];if(_0x5bb45f[_0x0b68('0x45')][_0x0b68('0x50')]){_0x29e9ea['where']=_[_0x0b68('0x51')](_0x29e9ea[_0x0b68('0x4e')],{'$or':_[_0x0b68('0x3f')](_0x29e9ea[_0x0b68('0x49')],function(_0x236265){var _0x85e510={};_0x85e510[_0x236265]={'$like':'%'+_0x5bb45f[_0x0b68('0x45')][_0x0b68('0x50')]+'%'};return _0x85e510;})});}_0x29e9ea=_[_0x0b68('0x51')]({},_0x29e9ea,_0x5bb45f[_0x0b68('0x53')]);return db['UserChatQueue'][_0x0b68('0x56')](_0x29e9ea);}})[_0x0b68('0x22')](function(_0x4691dd){if(_0x4691dd){return db['User'][_0x0b68('0x69')]({'where':{'id':_[_0x0b68('0x3f')](_0x4691dd,_0x0b68('0x6a')),'role':_0x0b68('0x6b')},'attributes':['id',_0x0b68('0x3d'),_0x0b68('0x6c'),'updatedAt','createdAt']});}})[_0x0b68('0x22')](function(_0x4f7e4a){if(_0x4f7e4a){return{'count':_0x4f7e4a[_0x0b68('0x30')],'rows':_[_0x0b68('0x3f')](_0x4f7e4a['rows'],function(_0x50b7e5){return{'membername':_0x50b7e5[_0x0b68('0x3d')],'UserId':_0x50b7e5['id'],'queue_name':_0x32eed2[_0x0b68('0x3d')],'ChatQueueId':_0x32eed2['id'],'interface':util['format'](_0x0b68('0x6d'),_0x0b68('0x6e'),_0x50b7e5[_0x0b68('0x3d')]),'penalty':0x0,'paused':_0x50b7e5[_0x0b68('0x6c')],'createdAt':_0x50b7e5[_0x0b68('0x6f')],'updatedAt':_0x50b7e5[_0x0b68('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b68('0x22')](respondWithFilteredResult(_0xd26664,_0x29e9ea))[_0x0b68('0x2c')](handleError(_0xd26664,null));};exports[_0x0b68('0x71')]=function(_0x43ceaf,_0x5ba2b2,_0x2529b0){var _0x31d4e2={};var _0x1f9c83={};var _0x397c38;var _0x48133c;return db[_0x0b68('0x40')][_0x0b68('0x64')]({'where':{'id':_0x43ceaf[_0x0b68('0x59')]['id']}})[_0x0b68('0x22')](handleEntityNotFound(_0x5ba2b2,null))[_0x0b68('0x22')](function(_0x458170){if(_0x458170){_0x397c38=_0x458170;_0x1f9c83[_0x0b68('0x48')]=_['keys'](db['Team'][_0x0b68('0x41')]);_0x1f9c83['query']=_[_0x0b68('0x65')](_0x43ceaf[_0x0b68('0x45')]);_0x1f9c83[_0x0b68('0x46')]=_[_0x0b68('0x47')](_0x1f9c83[_0x0b68('0x48')],_0x1f9c83[_0x0b68('0x45')]);_0x31d4e2[_0x0b68('0x49')]=_[_0x0b68('0x47')](_0x1f9c83['model'],qs[_0x0b68('0x4a')](_0x43ceaf['query']['fields']));_0x31d4e2['attributes']=_0x31d4e2[_0x0b68('0x49')][_0x0b68('0x4b')]?_0x31d4e2[_0x0b68('0x49')]:_0x1f9c83[_0x0b68('0x48')];_0x31d4e2['order']=qs[_0x0b68('0x4d')](_0x43ceaf[_0x0b68('0x45')][_0x0b68('0x4d')]);_0x31d4e2[_0x0b68('0x4e')]=qs[_0x0b68('0x46')](_[_0x0b68('0x4f')](_0x43ceaf[_0x0b68('0x45')],_0x1f9c83[_0x0b68('0x46')]));if(_0x43ceaf['query'][_0x0b68('0x50')]){_0x31d4e2[_0x0b68('0x4e')]=_['merge'](_0x31d4e2['where'],{'$or':_['map'](_0x31d4e2['attributes'],function(_0x232866){var _0x3869ac={};_0x3869ac[_0x232866]={'$like':'%'+_0x43ceaf[_0x0b68('0x45')][_0x0b68('0x50')]+'%'};return _0x3869ac;})});}_0x31d4e2=_['merge']({},_0x31d4e2,_0x43ceaf[_0x0b68('0x53')]);return _0x397c38[_0x0b68('0x71')](_0x31d4e2);}})[_0x0b68('0x22')](function(_0xc70db7){if(_0xc70db7){_0x48133c=_0xc70db7['length'];if(!_0x43ceaf[_0x0b68('0x45')][_0x0b68('0x72')](_0x0b68('0x67'))){_0x31d4e2['limit']=qs[_0x0b68('0x32')](_0x43ceaf['query'][_0x0b68('0x32')]);_0x31d4e2[_0x0b68('0x31')]=qs['offset'](_0x43ceaf[_0x0b68('0x45')][_0x0b68('0x31')]);}return _0x397c38[_0x0b68('0x71')](_0x31d4e2);}})[_0x0b68('0x22')](function(_0x3a304e){if(_0x3a304e){return _0x3a304e?{'count':_0x48133c,'rows':_0x3a304e}:null;}})[_0x0b68('0x22')](respondWithResult(_0x5ba2b2,null))[_0x0b68('0x2c')](handleError(_0x5ba2b2,null));};exports[_0x0b68('0x73')]=function(_0x47d711,_0x28d224,_0x5712ad){var _0x472940=_0x47d711[_0x0b68('0x5b')][_0x0b68('0x74')];return db[_0x0b68('0x75')]['findAll']({'where':{'id':_0x472940},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x0b68('0x3d'),_0x0b68('0x76'),_0x0b68('0x77'),'interface'],'raw':!![]}]})['then'](function(_0x470e02){if(_0x470e02){var _0x1f927e=_[_0x0b68('0x78')](_0x470e02,function(_0x43aac9){var _0x367b57=_0x43aac9[_0x0b68('0x5e')]({'plain':!![]});return _0x367b57[_0x0b68('0x79')];});return db[_0x0b68('0x40')][_0x0b68('0x60')]({'where':{'id':_0x47d711['params']['id']}})['then'](function(_0x301f80){return db['sequelize']['transaction'](function(_0x1af5f2){return _0x301f80['addTeams'](_0x472940,{'transaction':_0x1af5f2})[_0x0b68('0x22')](function(){return BPromise[_0x0b68('0x7a')](_0x1f927e,function(_0x255b23){return db[_0x0b68('0x66')][_0x0b68('0x7b')]({'where':{'UserId':_0x255b23['id'],'ChatQueueId':_0x47d711[_0x0b68('0x59')]['id']},'transaction':_0x1af5f2});});})[_0x0b68('0x22')](function(){_0x1f927e[_0x0b68('0x7c')](function(_0x27e4fc){socket[_0x0b68('0x7d')](_0x0b68('0x7e'),{'UserId':_0x27e4fc['id'],'ChatQueueId':_0x301f80['id']});});});});});}})[_0x0b68('0x22')](respondWithStatusCode(_0x28d224,null))[_0x0b68('0x2c')](handleError(_0x28d224,null));};exports[_0x0b68('0x7f')]=function(_0x2acacb,_0x3fadd0,_0xe0f964){return db['Team'][_0x0b68('0x56')]({'where':{'id':_0x2acacb['query'][_0x0b68('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0b68('0x80')],'as':_0x0b68('0x79'),'attributes':['id'],'raw':!![]}]})[_0x0b68('0x22')](handleEntityNotFound(_0x3fadd0,null))[_0x0b68('0x22')](function(_0x3ee6c1){var _0x36d0bf=_[_0x0b68('0x3f')](_0x3ee6c1,'id');var _0x5c000b=[];var _0xc4b958=[];var _0x35acbc=squel[_0x0b68('0x81')]();_0x35acbc['field'](_0x0b68('0x82'))['from'](_0x0b68('0x83'),'tq')[_0x0b68('0x84')](_0x0b68('0x85'),'ut',_0x0b68('0x86'))[_0x0b68('0x4e')](_0x0b68('0x87'),_0x2acacb[_0x0b68('0x59')]['id']);for(var _0x3f01ea=0x0;_0x3f01ea<_0x3ee6c1['length'];_0x3f01ea+=0x1){let _0x495f80=_0x3ee6c1[_0x3f01ea];for(var _0x36785c=0x0;_0x36785c<_0x495f80['Agents'][_0x0b68('0x4b')];_0x36785c+=0x1){let _0x2b9595=_0x495f80['Agents'][_0x36785c];var _0x247ab0=_0x35acbc[_0x0b68('0x88')]();_0x247ab0[_0x0b68('0x4e')](_0x0b68('0x89'),_0x2b9595['id']);_0xc4b958[_0x0b68('0x8a')](db['sequelize']['query'](_0x247ab0['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x0b68('0x22')](function(_0x4a95a1){if(_0x4a95a1[_0x0b68('0x4b')]===0x1){return _0x2b9595['id'];}else{var _0x5c3624=_[_0x0b68('0x8b')](_[_0x0b68('0x3f')](_0x4a95a1,_0x0b68('0x8c')),function(_0x154383){return _[_0x0b68('0x8d')](_0x36d0bf,_0x154383);});if(_0x5c3624){return _0x2b9595['id'];}}}));}}return BPromise[_0x0b68('0x8e')](_0xc4b958)[_0x0b68('0x22')](function(_0x26b358){_0x5c000b=_(_0x5c000b)[_0x0b68('0x8f')](_0x26b358)[_0x0b68('0x90')]()[_0x0b68('0x91')]();return db[_0x0b68('0x40')]['find']({'where':{'id':_0x2acacb[_0x0b68('0x59')]['id']}})['then'](function(_0x1a8353){return db[_0x0b68('0x92')][_0x0b68('0x93')](function(_0x2a4378){return _0x1a8353[_0x0b68('0x7f')](_0x2acacb[_0x0b68('0x45')]['ids'],{'transaction':_0x2a4378})['then'](function(){if(!_[_0x0b68('0x94')](_0x5c000b)){return _0x1a8353[_0x0b68('0x95')](_0x5c000b,{'transaction':_0x2a4378});}})[_0x0b68('0x22')](function(){_0x5c000b['forEach'](function(_0xad0874){socket[_0x0b68('0x7d')](_0x0b68('0x96'),{'UserId':_0xad0874,'ChatQueueId':_0x1a8353['id']});});});});});});})['then'](respondWithStatusCode(_0x3fadd0,null))[_0x0b68('0x2c')](handleError(_0x3fadd0,null));};exports[_0x0b68('0x97')]=function(_0x33644e,_0x38b0bb,_0xdb8201){return db['ChatQueue'][_0x0b68('0x60')]({'where':{'id':_0x33644e[_0x0b68('0x59')]['id']}})[_0x0b68('0x22')](handleEntityNotFound(_0x38b0bb,null))[_0x0b68('0x22')](function(_0x413ab9){if(_0x413ab9){return _0x413ab9[_0x0b68('0x97')](_0x33644e['body']['ids'],_['omit'](_0x33644e[_0x0b68('0x5b')],['ids','id'])||{})[_0x0b68('0x98')](function(_0x5060f5){for(var _0x16e4b8=0x0;_0x16e4b8<_0x33644e[_0x0b68('0x5b')][_0x0b68('0x74')][_0x0b68('0x4b')];_0x16e4b8+=0x1){socket[_0x0b68('0x7d')]('userChatQueue:save',{'UserId':_0x33644e[_0x0b68('0x5b')][_0x0b68('0x74')][_0x16e4b8],'ChatQueueId':_0x33644e[_0x0b68('0x59')]['id']});}return _0x5060f5;});}})[_0x0b68('0x22')](respondWithResult(_0x38b0bb,null))[_0x0b68('0x2c')](handleError(_0x38b0bb,null));};exports[_0x0b68('0x95')]=function(_0x20c61a,_0x347577,_0x361da2){return db[_0x0b68('0x40')][_0x0b68('0x60')]({'where':{'id':_0x20c61a[_0x0b68('0x59')]['id']}})[_0x0b68('0x22')](handleEntityNotFound(_0x347577,null))[_0x0b68('0x22')](function(_0x5500db){if(_0x5500db){return _0x5500db[_0x0b68('0x95')](_0x20c61a['query'][_0x0b68('0x74')])[_0x0b68('0x22')](function(){if(_['isArray'](_0x20c61a[_0x0b68('0x45')][_0x0b68('0x74')])){for(var _0x4d6185=0x0;_0x4d6185<_0x20c61a[_0x0b68('0x45')][_0x0b68('0x74')][_0x0b68('0x4b')];_0x4d6185+=0x1){socket['emit'](_0x0b68('0x96'),{'UserId':Number(_0x20c61a['query']['ids'][_0x4d6185]),'ChatQueueId':Number(_0x20c61a['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x20c61a['query']['ids']),'ChatQueueId':Number(_0x20c61a['params']['id'])});}});}})[_0x0b68('0x22')](respondWithStatusCode(_0x347577,null))[_0x0b68('0x2c')](handleError(_0x347577,null));};exports[_0x0b68('0x99')]=function(_0x5af9bb,_0x24c2e9,_0x1fa6d1){var _0x3daf26={};var _0x13e396={};var _0x11f318;var _0x3dcb00;return db[_0x0b68('0x40')][_0x0b68('0x64')]({'where':{'id':_0x5af9bb['params']['id']}})['then'](handleEntityNotFound(_0x24c2e9,null))['then'](function(_0x37c1b5){if(_0x37c1b5){_0x11f318=_0x37c1b5;_0x13e396[_0x0b68('0x48')]=_[_0x0b68('0x65')](db[_0x0b68('0x80')]['rawAttributes']);_0x13e396[_0x0b68('0x45')]=_[_0x0b68('0x65')](_0x5af9bb[_0x0b68('0x45')]);_0x13e396[_0x0b68('0x46')]=_[_0x0b68('0x47')](_0x13e396[_0x0b68('0x48')],_0x13e396[_0x0b68('0x45')]);_0x3daf26[_0x0b68('0x49')]=_['intersection'](_0x13e396['model'],qs[_0x0b68('0x4a')](_0x5af9bb[_0x0b68('0x45')][_0x0b68('0x4a')]));_0x3daf26[_0x0b68('0x49')]=_0x3daf26['attributes'][_0x0b68('0x4b')]?_0x3daf26[_0x0b68('0x49')]:_0x13e396[_0x0b68('0x48')];_0x3daf26[_0x0b68('0x4c')]=qs['sort'](_0x5af9bb[_0x0b68('0x45')][_0x0b68('0x4d')]);_0x3daf26['where']=qs[_0x0b68('0x46')](_[_0x0b68('0x4f')](_0x5af9bb[_0x0b68('0x45')],_0x13e396['filters']));if(_0x5af9bb[_0x0b68('0x45')][_0x0b68('0x50')]){_0x3daf26[_0x0b68('0x4e')]=_[_0x0b68('0x51')](_0x3daf26[_0x0b68('0x4e')],{'$or':_[_0x0b68('0x3f')](_0x3daf26[_0x0b68('0x49')],function(_0xa606b6){var _0x430eb5={};_0x430eb5[_0xa606b6]={'$like':'%'+_0x5af9bb['query']['filter']+'%'};return _0x430eb5;})});}_0x3daf26=_['merge']({},_0x3daf26,_0x5af9bb[_0x0b68('0x53')]);return _0x11f318[_0x0b68('0x99')](_0x3daf26);}})[_0x0b68('0x22')](function(_0x328923){if(_0x328923){_0x3dcb00=_0x328923[_0x0b68('0x4b')];if(!_0x5af9bb['query'][_0x0b68('0x72')]('nolimit')){_0x3daf26[_0x0b68('0x32')]=qs[_0x0b68('0x32')](_0x5af9bb[_0x0b68('0x45')][_0x0b68('0x32')]);_0x3daf26[_0x0b68('0x31')]=qs[_0x0b68('0x31')](_0x5af9bb[_0x0b68('0x45')][_0x0b68('0x31')]);}return _0x11f318[_0x0b68('0x99')](_0x3daf26);}})[_0x0b68('0x22')](function(_0x303226){if(_0x303226){return _0x303226?{'count':_0x3dcb00,'rows':_0x303226}:null;}})['then'](respondWithResult(_0x24c2e9,null))[_0x0b68('0x2c')](handleError(_0x24c2e9,null));};
\ No newline at end of file
+var _0xfaca=['isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','set','reject','save','destroy','get','ChatQueues','stack','name','index','ChatQueue','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','chatPause','rows','%s/%s','SIP','createdAt','updatedAt','getTeams','ids','Team','findAll','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread'];(function(_0x545d01,_0x4404a2){var _0x575b3e=function(_0x5462f9){while(--_0x5462f9){_0x545d01['push'](_0x545d01['shift']());}};_0x575b3e(++_0x4404a2);}(_0xfaca,0x120));var _0xafac=function(_0x384a78,_0x5ba914){_0x384a78=_0x384a78-0x0;var _0xf4933b=_0xfaca[_0x384a78];return _0xf4933b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xafac('0x0'));var rimraf=require(_0xafac('0x1'));var zipdir=require(_0xafac('0x2'));var jsonpatch=require(_0xafac('0x3'));var rp=require(_0xafac('0x4'));var moment=require(_0xafac('0x5'));var BPromise=require(_0xafac('0x6'));var Mustache=require(_0xafac('0x7'));var util=require(_0xafac('0x8'));var path=require('path');var sox=require(_0xafac('0x9'));var csv=require(_0xafac('0xa'));var ejs=require(_0xafac('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xafac('0xc'));var jsforce=require(_0xafac('0xd'));var deskjs=require(_0xafac('0xe'));var toCsv=require(_0xafac('0xa'));var querystring=require(_0xafac('0xf'));var Papa=require('papaparse');var Redis=require(_0xafac('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xafac('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xafac('0x12'));var logger=require('../../config/logger')(_0xafac('0x13'));var utils=require(_0xafac('0x14'));var config=require(_0xafac('0x15'));var licenseUtil=require(_0xafac('0x16'));var db=require(_0xafac('0x17'))['db'];config[_0xafac('0x18')]=_['defaults'](config[_0xafac('0x18')],{'host':_0xafac('0x19'),'port':0x18eb});var socket=require(_0xafac('0x1a'))(new Redis(config[_0xafac('0x18')]));require(_0xafac('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xafac('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4bc386,_0x4c4e10,_0x4ae948,_0x221be0){return new BPromise(function(_0xc3180b,_0x23cb88){var _0x20251b=_0x221be0||client;return _0x20251b[_0xafac('0x1d')](_0x4bc386,_0x4ae948)[_0xafac('0x1e')](function(_0x4e2c3f){logger[_0xafac('0x1f')](_0xafac('0x20'),_0x4c4e10,_0xafac('0x21'));logger['debug'](_0xafac('0x22'),_0x4c4e10,'request\x20sent',JSON[_0xafac('0x23')](_0x4e2c3f));if(_0x4e2c3f[_0xafac('0x24')]){if(_0x4e2c3f[_0xafac('0x24')][_0xafac('0x25')]===0x1f4){logger[_0xafac('0x24')]('ChatQueue,\x20%s,\x20%s',_0x4c4e10,_0x4e2c3f['error']['message']);return _0x23cb88(_0x4e2c3f[_0xafac('0x24')]['message']);}logger[_0xafac('0x24')]('ChatQueue,\x20%s,\x20%s',_0x4c4e10,_0x4e2c3f[_0xafac('0x24')][_0xafac('0x26')]);return _0xc3180b(_0x4e2c3f[_0xafac('0x24')][_0xafac('0x26')]);}else{logger[_0xafac('0x1f')](_0xafac('0x20'),_0x4c4e10,'request\x20sent');_0xc3180b(_0x4e2c3f[_0xafac('0x27')][_0xafac('0x26')]);}})[_0xafac('0x28')](function(_0x402763){logger['error'](_0xafac('0x20'),_0x4c4e10,_0x402763);_0x23cb88(_0x402763);});});}function respondWithStatusCode(_0x1cba83,_0x41e18b){_0x41e18b=_0x41e18b||0xcc;return function(_0x4c6c15){if(_0x4c6c15){return _0x1cba83[_0xafac('0x29')](_0x41e18b);}return _0x1cba83['status'](_0x41e18b)['end']();};}function respondWithResult(_0x4df34c,_0x213779){_0x213779=_0x213779||0xc8;return function(_0x48c2cb){if(_0x48c2cb){return _0x4df34c[_0xafac('0x2a')](_0x213779)[_0xafac('0x2b')](_0x48c2cb);}};}function respondWithFilteredResult(_0x54965a,_0x2b75ba){return function(_0x4e18ab){if(_0x4e18ab){var _0xf1f997=_0x4e18ab['count'],_0x1cc2ce=_0x2b75ba[_0xafac('0x2c')],_0x17c71b=_0x2b75ba[_0xafac('0x2c')]+_0x2b75ba['limit'],_0x24b9a9;if(_0x17c71b>=_0xf1f997){_0x17c71b=_0xf1f997;_0x24b9a9=0xc8;}else{_0x24b9a9=0xce;}_0x54965a[_0xafac('0x2a')](_0x24b9a9);return _0x54965a[_0xafac('0x2d')]('Content-Range',_0x1cc2ce+'-'+_0x17c71b+'/'+_0xf1f997)['json'](_0x4e18ab);}return null;};}function patchUpdates(_0x4fb9a8){return function(_0xa50fab){try{jsonpatch['apply'](_0xa50fab,_0x4fb9a8,!![]);}catch(_0x31ffbf){return BPromise[_0xafac('0x2e')](_0x31ffbf);}return _0xa50fab[_0xafac('0x2f')]();};}function saveUpdates(_0x2acc38,_0x27f7c0){return function(_0x2f092f){if(_0x2f092f){return _0x2f092f['update'](_0x2acc38)[_0xafac('0x1e')](function(_0x266f24){return _0x266f24;});}return null;};}function removeEntity(_0x260960,_0x458366){return function(_0x3fbd59){if(_0x3fbd59){return _0x3fbd59[_0xafac('0x30')]()[_0xafac('0x1e')](function(){var _0x4b0b6e=_0x3fbd59[_0xafac('0x31')]({'plain':!![]});var _0x17c02e=_0xafac('0x32');return db['UserProfileResource'][_0xafac('0x30')]({'where':{'type':_0x17c02e,'resourceId':_0x4b0b6e['id']}})['then'](function(){return _0x3fbd59;});})[_0xafac('0x1e')](function(){_0x260960[_0xafac('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48bc6a,_0x57aa69){return function(_0x50a91e){if(!_0x50a91e){_0x48bc6a[_0xafac('0x29')](0x194);}return _0x50a91e;};}function handleError(_0x119ffa,_0x2289c8){_0x2289c8=_0x2289c8||0x1f4;return function(_0x487cde){logger[_0xafac('0x24')](_0x487cde[_0xafac('0x33')]);if(_0x487cde['name']){delete _0x487cde[_0xafac('0x34')];}_0x119ffa['status'](_0x2289c8)['send'](_0x487cde);};}exports[_0xafac('0x35')]=function(_0x54c501,_0x17ba00){var _0x5a0369={},_0x69bd30={},_0x370437={'count':0x0,'rows':[]};var _0x2e6a56=_['map'](db[_0xafac('0x36')]['rawAttributes'],function(_0x173981){return{'name':_0x173981[_0xafac('0x37')],'type':_0x173981['type'][_0xafac('0x38')]};});_0x69bd30[_0xafac('0x39')]=_[_0xafac('0x3a')](_0x2e6a56,_0xafac('0x34'));_0x69bd30['query']=_[_0xafac('0x3b')](_0x54c501[_0xafac('0x3c')]);_0x69bd30[_0xafac('0x3d')]=_[_0xafac('0x3e')](_0x69bd30[_0xafac('0x39')],_0x69bd30[_0xafac('0x3c')]);_0x5a0369[_0xafac('0x3f')]=_['intersection'](_0x69bd30[_0xafac('0x39')],qs['fields'](_0x54c501['query'][_0xafac('0x40')]));_0x5a0369[_0xafac('0x3f')]=_0x5a0369[_0xafac('0x3f')][_0xafac('0x41')]?_0x5a0369[_0xafac('0x3f')]:_0x69bd30[_0xafac('0x39')];if(!_0x54c501[_0xafac('0x3c')][_0xafac('0x42')]('nolimit')){_0x5a0369['limit']=qs[_0xafac('0x43')](_0x54c501['query'][_0xafac('0x43')]);_0x5a0369[_0xafac('0x2c')]=qs[_0xafac('0x2c')](_0x54c501[_0xafac('0x3c')][_0xafac('0x2c')]);}_0x5a0369[_0xafac('0x44')]=qs[_0xafac('0x45')](_0x54c501['query'][_0xafac('0x45')]);_0x5a0369['where']=qs[_0xafac('0x3d')](_[_0xafac('0x46')](_0x54c501[_0xafac('0x3c')],_0x69bd30[_0xafac('0x3d')]),_0x2e6a56);if(_0x54c501[_0xafac('0x3c')][_0xafac('0x47')]){_0x5a0369[_0xafac('0x48')]=_[_0xafac('0x49')](_0x5a0369[_0xafac('0x48')],{'$or':_[_0xafac('0x3a')](_0x2e6a56,function(_0x42ebc3){if(_0x42ebc3[_0xafac('0x4a')]!==_0xafac('0x4b')){var _0x991378={};_0x991378[_0x42ebc3[_0xafac('0x34')]]={'$like':'%'+_0x54c501[_0xafac('0x3c')]['filter']+'%'};return _0x991378;}})});}_0x5a0369=_['merge']({},_0x5a0369,_0x54c501[_0xafac('0x4c')]);var _0x16e5dd={'where':_0x5a0369[_0xafac('0x48')]};return db['ChatQueue'][_0xafac('0x4d')](_0x16e5dd)[_0xafac('0x1e')](function(_0x2ce5bf){_0x370437[_0xafac('0x4d')]=_0x2ce5bf;if(_0x54c501[_0xafac('0x3c')][_0xafac('0x4e')]){_0x5a0369[_0xafac('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x5a0369);})[_0xafac('0x1e')](function(_0x2b8b48){_0x370437['rows']=_0x2b8b48;return _0x370437;})[_0xafac('0x1e')](respondWithFilteredResult(_0x17ba00,_0x5a0369))[_0xafac('0x28')](handleError(_0x17ba00,null));};exports[_0xafac('0x50')]=function(_0x136c50,_0x3a3e60){var _0x25e6c0={'raw':!![],'where':{'id':_0x136c50['params']['id']}},_0x757de2={};_0x757de2[_0xafac('0x39')]=_[_0xafac('0x3b')](db[_0xafac('0x36')][_0xafac('0x51')]);_0x757de2['query']=_[_0xafac('0x3b')](_0x136c50[_0xafac('0x3c')]);_0x757de2['filters']=_[_0xafac('0x3e')](_0x757de2[_0xafac('0x39')],_0x757de2[_0xafac('0x3c')]);_0x25e6c0[_0xafac('0x3f')]=_[_0xafac('0x3e')](_0x757de2['model'],qs['fields'](_0x136c50[_0xafac('0x3c')]['fields']));_0x25e6c0[_0xafac('0x3f')]=_0x25e6c0['attributes'][_0xafac('0x41')]?_0x25e6c0['attributes']:_0x757de2[_0xafac('0x39')];if(_0x136c50[_0xafac('0x3c')]['includeAll']){_0x25e6c0['include']=[{'all':!![]}];}_0x25e6c0=_['merge']({},_0x25e6c0,_0x136c50[_0xafac('0x4c')]);return db[_0xafac('0x36')]['find'](_0x25e6c0)[_0xafac('0x1e')](handleEntityNotFound(_0x3a3e60,null))[_0xafac('0x1e')](respondWithResult(_0x3a3e60,null))[_0xafac('0x28')](handleError(_0x3a3e60,null));};exports[_0xafac('0x52')]=function(_0x4f95e1,_0xd2bc4){return db[_0xafac('0x36')][_0xafac('0x52')](_0x4f95e1[_0xafac('0x53')],{})[_0xafac('0x1e')](function(_0x3c6134){var _0x5a6dca=_0x4f95e1[_0xafac('0x54')][_0xafac('0x31')]({'plain':!![]});if(!_0x5a6dca)throw new Error(_0xafac('0x55'));if(_0x5a6dca[_0xafac('0x56')]===_0xafac('0x54')){var _0x39a455=_0x3c6134[_0xafac('0x31')]({'plain':!![]});var _0x3a9238=_0xafac('0x32');return db[_0xafac('0x57')][_0xafac('0x58')]({'where':{'name':_0x3a9238,'userProfileId':_0x5a6dca[_0xafac('0x59')]},'raw':!![]})['then'](function(_0x21989c){if(_0x21989c&&_0x21989c[_0xafac('0x5a')]===0x0){return db[_0xafac('0x5b')][_0xafac('0x52')]({'name':_0x39a455['name'],'resourceId':_0x39a455['id'],'type':_0x21989c[_0xafac('0x34')],'sectionId':_0x21989c['id']},{})[_0xafac('0x1e')](function(){return _0x3c6134;});}else{return _0x3c6134;}})[_0xafac('0x28')](function(_0x4c5579){logger[_0xafac('0x24')](_0xafac('0x5c'),_0x4c5579);throw _0x4c5579;});}return _0x3c6134;})[_0xafac('0x1e')](respondWithResult(_0xd2bc4,0xc9))[_0xafac('0x28')](handleError(_0xd2bc4,null));};exports['update']=function(_0x361b40,_0x3af65d){if(_0x361b40[_0xafac('0x53')]['id']){delete _0x361b40[_0xafac('0x53')]['id'];}return db[_0xafac('0x36')][_0xafac('0x58')]({'where':{'id':_0x361b40['params']['id']}})[_0xafac('0x1e')](handleEntityNotFound(_0x3af65d,null))[_0xafac('0x1e')](saveUpdates(_0x361b40[_0xafac('0x53')],null))[_0xafac('0x1e')](respondWithResult(_0x3af65d,null))[_0xafac('0x28')](handleError(_0x3af65d,null));};exports[_0xafac('0x30')]=function(_0x2f9dbc,_0x4439d7){return db[_0xafac('0x36')][_0xafac('0x58')]({'where':{'id':_0x2f9dbc[_0xafac('0x5d')]['id']}})[_0xafac('0x1e')](handleEntityNotFound(_0x4439d7,null))['then'](removeEntity(_0x4439d7,null))['catch'](handleError(_0x4439d7,null));};exports[_0xafac('0x5e')]=function(_0x52cecb,_0x4fc726){return db[_0xafac('0x36')]['describe']()[_0xafac('0x1e')](respondWithResult(_0x4fc726,null))[_0xafac('0x28')](handleError(_0x4fc726,null));};exports['getMembers']=function(_0x2a8c04,_0x2e997e,_0x469bc8){var _0x54d6d4={'raw':!![],'where':{}},_0x43db3c={},_0x7640b7;return db[_0xafac('0x36')][_0xafac('0x5f')]({'where':{'id':_0x2a8c04['params']['id']}})['then'](handleEntityNotFound(_0x2e997e,null))['then'](function(_0x502671){if(_0x502671){_0x7640b7=_0x502671[_0xafac('0x31')]({'plain':!![]});_0x43db3c[_0xafac('0x39')]=_['keys'](db[_0xafac('0x60')][_0xafac('0x51')]);_0x43db3c[_0xafac('0x3c')]=_[_0xafac('0x3b')](_0x2a8c04[_0xafac('0x3c')]);_0x43db3c[_0xafac('0x3d')]=_[_0xafac('0x3e')](_0x43db3c['model'],_0x43db3c[_0xafac('0x3c')]);_0x54d6d4[_0xafac('0x3f')]=_['intersection'](_0x43db3c[_0xafac('0x39')],qs[_0xafac('0x40')](_0x2a8c04[_0xafac('0x3c')][_0xafac('0x40')]));_0x54d6d4['attributes']=_0x54d6d4[_0xafac('0x3f')][_0xafac('0x41')]?_0x54d6d4[_0xafac('0x3f')]:_0x43db3c[_0xafac('0x39')];if(!_0x2a8c04[_0xafac('0x3c')][_0xafac('0x42')]('nolimit')){_0x54d6d4[_0xafac('0x43')]=qs['limit'](_0x2a8c04[_0xafac('0x3c')][_0xafac('0x43')]);_0x54d6d4[_0xafac('0x2c')]=qs[_0xafac('0x2c')](_0x2a8c04[_0xafac('0x3c')][_0xafac('0x2c')]);}_0x54d6d4[_0xafac('0x44')]=qs['sort'](_0x2a8c04[_0xafac('0x3c')][_0xafac('0x45')]);_0x54d6d4['where']=qs[_0xafac('0x3d')](_[_0xafac('0x46')](_0x2a8c04[_0xafac('0x3c')],_0x43db3c['filters']));_0x54d6d4[_0xafac('0x48')][_0xafac('0x61')]=_0x502671['id'];if(_0x2a8c04[_0xafac('0x3c')][_0xafac('0x47')]){_0x54d6d4[_0xafac('0x48')]=_[_0xafac('0x49')](_0x54d6d4['where'],{'$or':_[_0xafac('0x3a')](_0x54d6d4[_0xafac('0x3f')],function(_0x50691d){var _0x57fba9={};_0x57fba9[_0x50691d]={'$like':'%'+_0x2a8c04[_0xafac('0x3c')][_0xafac('0x47')]+'%'};return _0x57fba9;})});}_0x54d6d4=_[_0xafac('0x49')]({},_0x54d6d4,_0x2a8c04[_0xafac('0x4c')]);return db['UserChatQueue']['findAll'](_0x54d6d4);}})[_0xafac('0x1e')](function(_0x2d61e9){if(_0x2d61e9){return db[_0xafac('0x62')][_0xafac('0x63')]({'where':{'id':_[_0xafac('0x3a')](_0x2d61e9,_0xafac('0x64')),'role':'agent'},'attributes':['id',_0xafac('0x34'),_0xafac('0x65'),'updatedAt','createdAt']});}})[_0xafac('0x1e')](function(_0x5622fa){if(_0x5622fa){return{'count':_0x5622fa['count'],'rows':_[_0xafac('0x3a')](_0x5622fa[_0xafac('0x66')],function(_0x17733e){return{'membername':_0x17733e[_0xafac('0x34')],'UserId':_0x17733e['id'],'queue_name':_0x7640b7[_0xafac('0x34')],'ChatQueueId':_0x7640b7['id'],'interface':util['format'](_0xafac('0x67'),_0xafac('0x68'),_0x17733e[_0xafac('0x34')]),'penalty':0x0,'paused':_0x17733e[_0xafac('0x65')],'createdAt':_0x17733e[_0xafac('0x69')],'updatedAt':_0x17733e[_0xafac('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xafac('0x1e')](respondWithFilteredResult(_0x2e997e,_0x54d6d4))[_0xafac('0x28')](handleError(_0x2e997e,null));};exports[_0xafac('0x6b')]=function(_0x5af887,_0x57b562,_0x7d654e){var _0x55dad2={};var _0xdcb8f9={};var _0x23f8d2;var _0x3f2e7d;return db[_0xafac('0x36')]['findOne']({'where':{'id':_0x5af887['params']['id']}})[_0xafac('0x1e')](handleEntityNotFound(_0x57b562,null))['then'](function(_0x3480b9){if(_0x3480b9){_0x23f8d2=_0x3480b9;_0xdcb8f9['model']=_[_0xafac('0x3b')](db['Team'][_0xafac('0x51')]);_0xdcb8f9[_0xafac('0x3c')]=_[_0xafac('0x3b')](_0x5af887[_0xafac('0x3c')]);_0xdcb8f9[_0xafac('0x3d')]=_[_0xafac('0x3e')](_0xdcb8f9[_0xafac('0x39')],_0xdcb8f9[_0xafac('0x3c')]);_0x55dad2[_0xafac('0x3f')]=_[_0xafac('0x3e')](_0xdcb8f9[_0xafac('0x39')],qs[_0xafac('0x40')](_0x5af887[_0xafac('0x3c')][_0xafac('0x40')]));_0x55dad2['attributes']=_0x55dad2[_0xafac('0x3f')][_0xafac('0x41')]?_0x55dad2[_0xafac('0x3f')]:_0xdcb8f9[_0xafac('0x39')];_0x55dad2['order']=qs[_0xafac('0x45')](_0x5af887[_0xafac('0x3c')][_0xafac('0x45')]);_0x55dad2[_0xafac('0x48')]=qs[_0xafac('0x3d')](_[_0xafac('0x46')](_0x5af887[_0xafac('0x3c')],_0xdcb8f9[_0xafac('0x3d')]));if(_0x5af887[_0xafac('0x3c')][_0xafac('0x47')]){_0x55dad2[_0xafac('0x48')]=_[_0xafac('0x49')](_0x55dad2['where'],{'$or':_[_0xafac('0x3a')](_0x55dad2[_0xafac('0x3f')],function(_0x5002a1){var _0x37f14a={};_0x37f14a[_0x5002a1]={'$like':'%'+_0x5af887[_0xafac('0x3c')][_0xafac('0x47')]+'%'};return _0x37f14a;})});}_0x55dad2=_[_0xafac('0x49')]({},_0x55dad2,_0x5af887[_0xafac('0x4c')]);return _0x23f8d2['getTeams'](_0x55dad2);}})[_0xafac('0x1e')](function(_0x266d61){if(_0x266d61){_0x3f2e7d=_0x266d61[_0xafac('0x41')];if(!_0x5af887[_0xafac('0x3c')][_0xafac('0x42')]('nolimit')){_0x55dad2[_0xafac('0x43')]=qs[_0xafac('0x43')](_0x5af887[_0xafac('0x3c')][_0xafac('0x43')]);_0x55dad2[_0xafac('0x2c')]=qs[_0xafac('0x2c')](_0x5af887[_0xafac('0x3c')][_0xafac('0x2c')]);}return _0x23f8d2[_0xafac('0x6b')](_0x55dad2);}})[_0xafac('0x1e')](function(_0x27adae){if(_0x27adae){return _0x27adae?{'count':_0x3f2e7d,'rows':_0x27adae}:null;}})[_0xafac('0x1e')](respondWithResult(_0x57b562,null))[_0xafac('0x28')](handleError(_0x57b562,null));};exports['addTeams']=function(_0x4470b7,_0x82092c,_0x2d89d5){var _0x78021e=_0x4470b7['body'][_0xafac('0x6c')];return db[_0xafac('0x6d')][_0xafac('0x6e')]({'where':{'id':_0x78021e},'attributes':['id'],'include':[{'model':db[_0xafac('0x62')],'as':_0xafac('0x6f'),'attributes':['id','name',_0xafac('0x70'),_0xafac('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x22efa6){if(_0x22efa6){var _0x2b6517=_[_0xafac('0x72')](_0x22efa6,function(_0xcd6a75){var _0x1332b9=_0xcd6a75[_0xafac('0x31')]({'plain':!![]});return _0x1332b9['Agents'];});return db[_0xafac('0x36')][_0xafac('0x58')]({'where':{'id':_0x4470b7['params']['id']}})[_0xafac('0x1e')](function(_0x2ef702){return db[_0xafac('0x73')]['transaction'](function(_0x9ffbfe){return _0x2ef702['addTeams'](_0x78021e,{'transaction':_0x9ffbfe})[_0xafac('0x1e')](function(){return BPromise[_0xafac('0x74')](_0x2b6517,function(_0x408309){return db[_0xafac('0x60')][_0xafac('0x75')]({'where':{'UserId':_0x408309['id'],'ChatQueueId':_0x4470b7[_0xafac('0x5d')]['id']},'transaction':_0x9ffbfe});});})['then'](function(){_0x2b6517[_0xafac('0x76')](function(_0x2dab58){socket['emit'](_0xafac('0x77'),{'UserId':_0x2dab58['id'],'ChatQueueId':_0x2ef702['id']});});});});});}})[_0xafac('0x1e')](respondWithStatusCode(_0x82092c,null))['catch'](handleError(_0x82092c,null));};exports[_0xafac('0x78')]=function(_0x4edc04,_0x1c3e2a,_0x4edbb1){return db[_0xafac('0x6d')]['findAll']({'where':{'id':_0x4edc04[_0xafac('0x3c')][_0xafac('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xafac('0x62')],'as':_0xafac('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xafac('0x1e')](handleEntityNotFound(_0x1c3e2a,null))['then'](function(_0x536bd9){var _0x270db8=_[_0xafac('0x3a')](_0x536bd9,'id');var _0x1fb7f5=[];var _0x4a650c=[];var _0x49cbfe=squel[_0xafac('0x79')]();_0x49cbfe['field'](_0xafac('0x7a'))[_0xafac('0x7b')]('team_has_chat_queues','tq')[_0xafac('0x7c')](_0xafac('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xafac('0x48')]('ChatQueueId\x20=\x20?',_0x4edc04[_0xafac('0x5d')]['id']);for(var _0x17a6af=0x0;_0x17a6af<_0x536bd9[_0xafac('0x41')];_0x17a6af+=0x1){let _0x1ad148=_0x536bd9[_0x17a6af];for(var _0x912803=0x0;_0x912803<_0x1ad148[_0xafac('0x6f')]['length'];_0x912803+=0x1){let _0x433224=_0x1ad148[_0xafac('0x6f')][_0x912803];var _0x3ff16a=_0x49cbfe[_0xafac('0x7e')]();_0x3ff16a[_0xafac('0x48')](_0xafac('0x7f'),_0x433224['id']);_0x4a650c[_0xafac('0x80')](db[_0xafac('0x73')][_0xafac('0x3c')](_0x3ff16a['toString'](),{'type':db[_0xafac('0x73')][_0xafac('0x81')]['SELECT']})['then'](function(_0x127788){if(_0x127788[_0xafac('0x41')]===0x1){return _0x433224['id'];}else{var _0x301c7f=_['every'](_[_0xafac('0x3a')](_0x127788,_0xafac('0x82')),function(_0x2118c6){return _[_0xafac('0x83')](_0x270db8,_0x2118c6);});if(_0x301c7f){return _0x433224['id'];}}}));}}return BPromise['all'](_0x4a650c)['then'](function(_0x4482c9){_0x1fb7f5=_(_0x1fb7f5)[_0xafac('0x84')](_0x4482c9)[_0xafac('0x85')]()['value']();return db[_0xafac('0x36')][_0xafac('0x58')]({'where':{'id':_0x4edc04['params']['id']}})[_0xafac('0x1e')](function(_0x64a183){return db[_0xafac('0x73')][_0xafac('0x86')](function(_0x14881d){return _0x64a183[_0xafac('0x78')](_0x4edc04['query'][_0xafac('0x6c')],{'transaction':_0x14881d})[_0xafac('0x1e')](function(){if(!_[_0xafac('0x87')](_0x1fb7f5)){return _0x64a183[_0xafac('0x88')](_0x1fb7f5,{'transaction':_0x14881d});}})[_0xafac('0x1e')](function(){_0x1fb7f5[_0xafac('0x76')](function(_0x3e879b){socket[_0xafac('0x89')](_0xafac('0x8a'),{'UserId':_0x3e879b,'ChatQueueId':_0x64a183['id']});});});});});});})[_0xafac('0x1e')](respondWithStatusCode(_0x1c3e2a,null))[_0xafac('0x28')](handleError(_0x1c3e2a,null));};exports[_0xafac('0x8b')]=function(_0x52f5d9,_0xaabaaf,_0x6e3535){return db[_0xafac('0x36')][_0xafac('0x58')]({'where':{'id':_0x52f5d9[_0xafac('0x5d')]['id']}})[_0xafac('0x1e')](handleEntityNotFound(_0xaabaaf,null))[_0xafac('0x1e')](function(_0x3ad5b3){if(_0x3ad5b3){return _0x3ad5b3[_0xafac('0x8b')](_0x52f5d9[_0xafac('0x53')][_0xafac('0x6c')],_['omit'](_0x52f5d9['body'],[_0xafac('0x6c'),'id'])||{})[_0xafac('0x8c')](function(_0x3e14c6){for(var _0x384cbb=0x0;_0x384cbb<_0x52f5d9['body']['ids'][_0xafac('0x41')];_0x384cbb+=0x1){socket[_0xafac('0x89')]('userChatQueue:save',{'UserId':_0x52f5d9[_0xafac('0x53')][_0xafac('0x6c')][_0x384cbb],'ChatQueueId':_0x52f5d9['params']['id']});}return _0x3e14c6;});}})[_0xafac('0x1e')](respondWithResult(_0xaabaaf,null))[_0xafac('0x28')](handleError(_0xaabaaf,null));};exports[_0xafac('0x88')]=function(_0x210adf,_0x1cba3f,_0x56612d){return db['ChatQueue'][_0xafac('0x58')]({'where':{'id':_0x210adf['params']['id']}})['then'](handleEntityNotFound(_0x1cba3f,null))['then'](function(_0x48fbb3){if(_0x48fbb3){return _0x48fbb3[_0xafac('0x88')](_0x210adf[_0xafac('0x3c')]['ids'])[_0xafac('0x1e')](function(){if(_[_0xafac('0x8d')](_0x210adf[_0xafac('0x3c')]['ids'])){for(var _0xe018e1=0x0;_0xe018e1<_0x210adf[_0xafac('0x3c')][_0xafac('0x6c')]['length'];_0xe018e1+=0x1){socket[_0xafac('0x89')](_0xafac('0x8a'),{'UserId':Number(_0x210adf['query'][_0xafac('0x6c')][_0xe018e1]),'ChatQueueId':Number(_0x210adf[_0xafac('0x5d')]['id'])});}}else{socket[_0xafac('0x89')]('userChatQueue:remove',{'UserId':Number(_0x210adf[_0xafac('0x3c')][_0xafac('0x6c')]),'ChatQueueId':Number(_0x210adf[_0xafac('0x5d')]['id'])});}});}})[_0xafac('0x1e')](respondWithStatusCode(_0x1cba3f,null))[_0xafac('0x28')](handleError(_0x1cba3f,null));};exports[_0xafac('0x8e')]=function(_0x23a6cf,_0x499492,_0x45c12b){var _0x5b013b={};var _0x12e8e5={};var _0x3a4b61;var _0x5c473d;return db['ChatQueue'][_0xafac('0x5f')]({'where':{'id':_0x23a6cf['params']['id']}})['then'](handleEntityNotFound(_0x499492,null))[_0xafac('0x1e')](function(_0xa3dcaf){if(_0xa3dcaf){_0x3a4b61=_0xa3dcaf;_0x12e8e5['model']=_[_0xafac('0x3b')](db['User'][_0xafac('0x51')]);_0x12e8e5[_0xafac('0x3c')]=_[_0xafac('0x3b')](_0x23a6cf['query']);_0x12e8e5[_0xafac('0x3d')]=_[_0xafac('0x3e')](_0x12e8e5[_0xafac('0x39')],_0x12e8e5[_0xafac('0x3c')]);_0x5b013b['attributes']=_[_0xafac('0x3e')](_0x12e8e5[_0xafac('0x39')],qs['fields'](_0x23a6cf['query'][_0xafac('0x40')]));_0x5b013b[_0xafac('0x3f')]=_0x5b013b[_0xafac('0x3f')][_0xafac('0x41')]?_0x5b013b[_0xafac('0x3f')]:_0x12e8e5['model'];_0x5b013b['order']=qs[_0xafac('0x45')](_0x23a6cf['query'][_0xafac('0x45')]);_0x5b013b['where']=qs[_0xafac('0x3d')](_[_0xafac('0x46')](_0x23a6cf['query'],_0x12e8e5[_0xafac('0x3d')]));if(_0x23a6cf[_0xafac('0x3c')]['filter']){_0x5b013b[_0xafac('0x48')]=_[_0xafac('0x49')](_0x5b013b[_0xafac('0x48')],{'$or':_[_0xafac('0x3a')](_0x5b013b[_0xafac('0x3f')],function(_0x56a913){var _0x3d0a18={};_0x3d0a18[_0x56a913]={'$like':'%'+_0x23a6cf[_0xafac('0x3c')][_0xafac('0x47')]+'%'};return _0x3d0a18;})});}_0x5b013b=_[_0xafac('0x49')]({},_0x5b013b,_0x23a6cf['options']);return _0x3a4b61['getAgents'](_0x5b013b);}})[_0xafac('0x1e')](function(_0x3e9609){if(_0x3e9609){_0x5c473d=_0x3e9609[_0xafac('0x41')];if(!_0x23a6cf[_0xafac('0x3c')][_0xafac('0x42')]('nolimit')){_0x5b013b[_0xafac('0x43')]=qs[_0xafac('0x43')](_0x23a6cf['query'][_0xafac('0x43')]);_0x5b013b['offset']=qs[_0xafac('0x2c')](_0x23a6cf[_0xafac('0x3c')][_0xafac('0x2c')]);}return _0x3a4b61[_0xafac('0x8e')](_0x5b013b);}})[_0xafac('0x1e')](function(_0x509a10){if(_0x509a10){return _0x509a10?{'count':_0x5c473d,'rows':_0x509a10}:null;}})['then'](respondWithResult(_0x499492,null))['catch'](handleError(_0x499492,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 78ddb1e..2cbe92c 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x51b2c9,_0x155ab8){var _0x1490ea=function(_0x3a1b46){while(--_0x3a1b46){_0x51b2c9['push'](_0x51b2c9['shift']());}};_0x1490ea(++_0x155ab8);}(_0xb10b,0x12a));var _0xbb10=function(_0x22fc1d,_0x5b8ee1){_0x22fc1d=_0x22fc1d-0x0;var _0x29e032=_0xb10b[_0x22fc1d];return _0x29e032;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xc7272c,_0x281fe1){var _0x2760ca=function(_0x3393b4){while(--_0x3393b4){_0xc7272c['push'](_0xc7272c['shift']());}};_0x2760ca(++_0x281fe1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x0b0e[_0x5ce3c8];return _0xa76867;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index bdb152d..937ba25 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 _0x30de=['exports','define','ChatQueue','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes'];(function(_0xaffe9a,_0x13bf53){var _0x4e01bf=function(_0x58ea84){while(--_0x58ea84){_0xaffe9a['push'](_0xaffe9a['shift']());}};_0x4e01bf(++_0x13bf53);}(_0x30de,0x158));var _0xe30d=function(_0x29ad3b,_0x1a729a){_0x29ad3b=_0x29ad3b-0x0;var _0x97be17=_0x30de[_0x29ad3b];return _0x97be17;};'use strict';var _=require(_0xe30d('0x0'));var util=require('util');var logger=require(_0xe30d('0x1'))(_0xe30d('0x2'));var moment=require('moment');var BPromise=require(_0xe30d('0x3'));var rp=require(_0xe30d('0x4'));var fs=require('fs');var path=require(_0xe30d('0x5'));var rimraf=require('rimraf');var config=require(_0xe30d('0x6'));var attributes=require(_0xe30d('0x7'));module[_0xe30d('0x8')]=function(_0x14d5b8,_0x2fa123){return _0x14d5b8[_0xe30d('0x9')](_0xe30d('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x37e8=['exports','define','chat_queues','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x37e8,0x111));var _0x837e=function(_0x3e9e2c,_0x3e2062){_0x3e9e2c=_0x3e9e2c-0x0;var _0x3af1a2=_0x37e8[_0x3e9e2c];return _0x3af1a2;};'use strict';var _=require(_0x837e('0x0'));var util=require(_0x837e('0x1'));var logger=require(_0x837e('0x2'))('api');var moment=require(_0x837e('0x3'));var BPromise=require('bluebird');var rp=require(_0x837e('0x4'));var fs=require('fs');var path=require(_0x837e('0x5'));var rimraf=require('rimraf');var config=require(_0x837e('0x6'));var attributes=require('./chatQueue.attributes');module[_0x837e('0x7')]=function(_0x56a186,_0x51d2d3){return _0x56a186[_0x837e('0x8')]('ChatQueue',attributes,{'tableName':_0x837e('0x9'),'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 92381ec..6990dec 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 _0x316b=['attributes','ShowChatQueue','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','limit','include','map','model'];(function(_0x3e5dc7,_0x375600){var _0x49a701=function(_0x3f8048){while(--_0x3f8048){_0x3e5dc7['push'](_0x3e5dc7['shift']());}};_0x49a701(++_0x375600);}(_0x316b,0x17e));var _0xb316=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0x316b[_0x316c42];return _0x2b38f7;};'use strict';var _=require(_0xb316('0x0'));var util=require('util');var moment=require(_0xb316('0x1'));var BPromise=require('bluebird');var rs=require(_0xb316('0x2'));var fs=require('fs');var Redis=require(_0xb316('0x3'));var db=require(_0xb316('0x4'))['db'];var utils=require(_0xb316('0x5'));var logger=require(_0xb316('0x6'))(_0xb316('0x7'));var config=require(_0xb316('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb316('0x9')][_0xb316('0xa')]({'port':0x232a});config[_0xb316('0xb')]=_[_0xb316('0xc')](config['redis'],{'host':_0xb316('0xd'),'port':0x18eb});var socket=require(_0xb316('0xe'))(new Redis(config['redis']));require(_0xb316('0xf'))[_0xb316('0x10')](socket);function respondWithRpcPromise(_0x23dda9,_0x337c5c,_0x58d622){return new BPromise(function(_0x1d376c,_0xba6dd6){return client[_0xb316('0x11')](_0x23dda9,_0x58d622)[_0xb316('0x12')](function(_0x7d3df7){logger[_0xb316('0x13')](_0xb316('0x14'),_0x337c5c,_0xb316('0x15'));logger[_0xb316('0x16')](_0xb316('0x17'),_0x337c5c,'request\x20sent',JSON[_0xb316('0x18')](_0x7d3df7));if(_0x7d3df7[_0xb316('0x19')]){if(_0x7d3df7['error'][_0xb316('0x1a')]===0x1f4){logger[_0xb316('0x19')](_0xb316('0x14'),_0x337c5c,_0x7d3df7[_0xb316('0x19')]['message']);return _0xba6dd6(_0x7d3df7[_0xb316('0x19')][_0xb316('0x1b')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x337c5c,_0x7d3df7['error'][_0xb316('0x1b')]);return _0x1d376c(_0x7d3df7['error'][_0xb316('0x1b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x337c5c,_0xb316('0x15'));_0x1d376c(_0x7d3df7['result']['message']);}})[_0xb316('0x1c')](function(_0x515543){logger['error'](_0xb316('0x14'),_0x337c5c,_0x515543);_0xba6dd6(_0x515543);});});}exports[_0xb316('0x1d')]=function(_0xbbd51a){var _0x4df491=this;return new Promise(function(_0x4b9b83,_0x3f0c08){return db[_0xb316('0x1e')][_0xb316('0x1f')]({'raw':_0xbbd51a[_0xb316('0x20')]?_0xbbd51a[_0xb316('0x20')][_0xb316('0x21')]===undefined?!![]:![]:!![],'where':_0xbbd51a['options']?_0xbbd51a[_0xb316('0x20')]['where']||null:null,'attributes':_0xbbd51a[_0xb316('0x20')]?_0xbbd51a[_0xb316('0x20')]['attributes']||null:null,'limit':_0xbbd51a['options']?_0xbbd51a['options'][_0xb316('0x22')]||null:null,'include':_0xbbd51a['options']?_0xbbd51a[_0xb316('0x20')][_0xb316('0x23')]?_[_0xb316('0x24')](_0xbbd51a[_0xb316('0x20')][_0xb316('0x23')],function(_0x2ddcf8){return{'model':db[_0x2ddcf8[_0xb316('0x25')]],'as':_0x2ddcf8['as'],'attributes':_0x2ddcf8[_0xb316('0x26')],'include':_0x2ddcf8[_0xb316('0x23')]?_[_0xb316('0x24')](_0x2ddcf8['include'],function(_0x152686){return{'model':db[_0x152686['model']],'as':_0x152686['as'],'attributes':_0x152686[_0xb316('0x26')],'include':_0x152686[_0xb316('0x23')]?_[_0xb316('0x24')](_0x152686[_0xb316('0x23')],function(_0x1dc996){return{'model':db[_0x1dc996['model']],'as':_0x1dc996['as'],'attributes':_0x1dc996[_0xb316('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23fe76){logger['info']('GetChatQueue',_0xbbd51a);logger['debug']('GetChatQueue',_0xbbd51a,JSON[_0xb316('0x18')](_0x23fe76));_0x4b9b83(_0x23fe76);})['catch'](function(_0xd51317){logger[_0xb316('0x19')](_0xb316('0x1d'),_0xd51317['message'],_0xbbd51a);_0x3f0c08(_0x4df491['error'](0x1f4,_0xd51317[_0xb316('0x1b')]));});});};exports[_0xb316('0x27')]=function(_0xbea147){var _0xcea573=this;return new Promise(function(_0x46ee17,_0xc41882){return db[_0xb316('0x1e')][_0xb316('0x28')]({'raw':_0xbea147[_0xb316('0x20')]?_0xbea147['options'][_0xb316('0x21')]===undefined?!![]:![]:!![],'where':_0xbea147[_0xb316('0x20')]?_0xbea147['options'][_0xb316('0x29')]||null:null,'attributes':_0xbea147[_0xb316('0x20')]?_0xbea147[_0xb316('0x20')]['attributes']||null:null,'include':_0xbea147[_0xb316('0x20')]?_0xbea147[_0xb316('0x20')][_0xb316('0x23')]?_[_0xb316('0x24')](_0xbea147['options'][_0xb316('0x23')],function(_0x57b51d){return{'model':db[_0x57b51d[_0xb316('0x25')]],'as':_0x57b51d['as'],'attributes':_0x57b51d[_0xb316('0x26')],'include':_0x57b51d['include']?_[_0xb316('0x24')](_0x57b51d['include'],function(_0x44beb7){return{'model':db[_0x44beb7[_0xb316('0x25')]],'as':_0x44beb7['as'],'attributes':_0x44beb7[_0xb316('0x26')],'include':_0x44beb7[_0xb316('0x23')]?_[_0xb316('0x24')](_0x44beb7[_0xb316('0x23')],function(_0x2f7e73){return{'model':db[_0x2f7e73[_0xb316('0x25')]],'as':_0x2f7e73['as'],'attributes':_0x2f7e73[_0xb316('0x26')]};}):[]};}):[]};}):[]:[]})[_0xb316('0x12')](function(_0x30767f){logger[_0xb316('0x13')](_0xb316('0x27'),_0xbea147);logger['debug'](_0xb316('0x27'),_0xbea147,JSON[_0xb316('0x18')](_0x30767f));_0x46ee17(_0x30767f);})[_0xb316('0x1c')](function(_0x599c86){logger[_0xb316('0x19')](_0xb316('0x27'),_0x599c86['message'],_0xbea147);_0xc41882(_0xcea573[_0xb316('0x19')](0x1f4,_0x599c86[_0xb316('0x1b')]));});});};
\ No newline at end of file
+var _0x6f24=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','where','lodash','util','bluebird','randomstring','ioredis'];(function(_0x2436bf,_0x5bf69f){var _0x173ab5=function(_0x49ec39){while(--_0x49ec39){_0x2436bf['push'](_0x2436bf['shift']());}};_0x173ab5(++_0x5bf69f);}(_0x6f24,0x76));var _0x46f2=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x6f24[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x46f2('0x0'));var util=require(_0x46f2('0x1'));var moment=require('moment');var BPromise=require(_0x46f2('0x2'));var rs=require(_0x46f2('0x3'));var fs=require('fs');var Redis=require(_0x46f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46f2('0x5'));var logger=require('../../config/logger')(_0x46f2('0x6'));var config=require(_0x46f2('0x7'));var jayson=require(_0x46f2('0x8'));var client=jayson[_0x46f2('0x9')][_0x46f2('0xa')]({'port':0x232a});config['redis']=_[_0x46f2('0xb')](config[_0x46f2('0xc')],{'host':_0x46f2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46f2('0xc')]));require(_0x46f2('0xe'))[_0x46f2('0xf')](socket);function respondWithRpcPromise(_0x1504b5,_0x588630,_0x49e81a){return new BPromise(function(_0x42d435,_0x3267d4){return client[_0x46f2('0x10')](_0x1504b5,_0x49e81a)[_0x46f2('0x11')](function(_0x52b5ca){logger[_0x46f2('0x12')](_0x46f2('0x13'),_0x588630,_0x46f2('0x14'));logger[_0x46f2('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x588630,_0x46f2('0x14'),JSON[_0x46f2('0x16')](_0x52b5ca));if(_0x52b5ca[_0x46f2('0x17')]){if(_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x18')]===0x1f4){logger[_0x46f2('0x17')](_0x46f2('0x13'),_0x588630,_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);return _0x3267d4(_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);}logger[_0x46f2('0x17')](_0x46f2('0x13'),_0x588630,_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);return _0x42d435(_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);}else{logger[_0x46f2('0x12')](_0x46f2('0x13'),_0x588630,_0x46f2('0x14'));_0x42d435(_0x52b5ca[_0x46f2('0x1a')]['message']);}})[_0x46f2('0x1b')](function(_0x5a1380){logger[_0x46f2('0x17')](_0x46f2('0x13'),_0x588630,_0x5a1380);_0x3267d4(_0x5a1380);});});}exports['GetChatQueue']=function(_0x5970a1){var _0x45ea96=this;return new Promise(function(_0x1fac0d,_0x170b5e){return db[_0x46f2('0x1c')][_0x46f2('0x1d')]({'raw':_0x5970a1[_0x46f2('0x1e')]?_0x5970a1['options'][_0x46f2('0x1f')]===undefined?!![]:![]:!![],'where':_0x5970a1['options']?_0x5970a1[_0x46f2('0x1e')]['where']||null:null,'attributes':_0x5970a1[_0x46f2('0x1e')]?_0x5970a1[_0x46f2('0x1e')][_0x46f2('0x20')]||null:null,'limit':_0x5970a1[_0x46f2('0x1e')]?_0x5970a1[_0x46f2('0x1e')][_0x46f2('0x21')]||null:null,'include':_0x5970a1['options']?_0x5970a1[_0x46f2('0x1e')][_0x46f2('0x22')]?_[_0x46f2('0x23')](_0x5970a1[_0x46f2('0x1e')]['include'],function(_0x3017c9){return{'model':db[_0x3017c9[_0x46f2('0x24')]],'as':_0x3017c9['as'],'attributes':_0x3017c9[_0x46f2('0x20')],'include':_0x3017c9['include']?_[_0x46f2('0x23')](_0x3017c9['include'],function(_0x5807d9){return{'model':db[_0x5807d9[_0x46f2('0x24')]],'as':_0x5807d9['as'],'attributes':_0x5807d9['attributes'],'include':_0x5807d9[_0x46f2('0x22')]?_[_0x46f2('0x23')](_0x5807d9['include'],function(_0x58e2d8){return{'model':db[_0x58e2d8[_0x46f2('0x24')]],'as':_0x58e2d8['as'],'attributes':_0x58e2d8[_0x46f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x46f2('0x11')](function(_0x4b42c2){logger[_0x46f2('0x12')]('GetChatQueue',_0x5970a1);logger[_0x46f2('0x15')]('GetChatQueue',_0x5970a1,JSON[_0x46f2('0x16')](_0x4b42c2));_0x1fac0d(_0x4b42c2);})[_0x46f2('0x1b')](function(_0x881bf8){logger[_0x46f2('0x17')](_0x46f2('0x25'),_0x881bf8[_0x46f2('0x19')],_0x5970a1);_0x170b5e(_0x45ea96[_0x46f2('0x17')](0x1f4,_0x881bf8[_0x46f2('0x19')]));});});};exports[_0x46f2('0x26')]=function(_0x5ef16f){var _0x4ad380=this;return new Promise(function(_0x1971a5,_0x434ba2){return db[_0x46f2('0x1c')][_0x46f2('0x27')]({'raw':_0x5ef16f['options']?_0x5ef16f[_0x46f2('0x1e')][_0x46f2('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ef16f[_0x46f2('0x1e')]?_0x5ef16f['options'][_0x46f2('0x28')]||null:null,'attributes':_0x5ef16f[_0x46f2('0x1e')]?_0x5ef16f['options'][_0x46f2('0x20')]||null:null,'include':_0x5ef16f[_0x46f2('0x1e')]?_0x5ef16f[_0x46f2('0x1e')][_0x46f2('0x22')]?_['map'](_0x5ef16f[_0x46f2('0x1e')][_0x46f2('0x22')],function(_0x3e9ef5){return{'model':db[_0x3e9ef5[_0x46f2('0x24')]],'as':_0x3e9ef5['as'],'attributes':_0x3e9ef5[_0x46f2('0x20')],'include':_0x3e9ef5[_0x46f2('0x22')]?_['map'](_0x3e9ef5['include'],function(_0x1f4f6c){return{'model':db[_0x1f4f6c['model']],'as':_0x1f4f6c['as'],'attributes':_0x1f4f6c['attributes'],'include':_0x1f4f6c[_0x46f2('0x22')]?_[_0x46f2('0x23')](_0x1f4f6c['include'],function(_0x2b6598){return{'model':db[_0x2b6598[_0x46f2('0x24')]],'as':_0x2b6598['as'],'attributes':_0x2b6598['attributes']};}):[]};}):[]};}):[]:[]})[_0x46f2('0x11')](function(_0x56369a){logger[_0x46f2('0x12')](_0x46f2('0x26'),_0x5ef16f);logger[_0x46f2('0x15')](_0x46f2('0x26'),_0x5ef16f,JSON[_0x46f2('0x16')](_0x56369a));_0x1971a5(_0x56369a);})[_0x46f2('0x1b')](function(_0x5d6049){logger['error']('ShowChatQueue',_0x5d6049[_0x46f2('0x19')],_0x5ef16f);_0x434ba2(_0x4ad380[_0x46f2('0x17')](0x1f4,_0x5d6049[_0x46f2('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6e5f57c..b1afbd2 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0xb62e11,_0x5be8ed){var _0x5cfc1b=function(_0x5e0bdd){while(--_0x5e0bdd){_0xb62e11['push'](_0xb62e11['shift']());}};_0x5cfc1b(++_0x5be8ed);}(_0x0b0e,0x187));var _0xe0b0=function(_0x22f9c0,_0x35410c){_0x22f9c0=_0x22f9c0-0x0;var _0x1883fe=_0x0b0e[_0x22f9c0];return _0x1883fe;};'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
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x5e3139,_0x5bad26){var _0x3cdf31=function(_0x51647e){while(--_0x51647e){_0x5e3139['push'](_0x5e3139['shift']());}};_0x3cdf31(++_0x5bad26);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2bece8,_0x27c181){_0x2bece8=_0x2bece8-0x0;var _0xc01f33=_0x5f2f[_0x2bece8];return _0xc01f33;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 80232f0..3ce5db7 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 _0x9ed9=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getAgents','create','post','addTeams','/:id/users','put','delete','destroy','removeTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ed9,0x15e));var _0x99ed=function(_0x56107e,_0x2bdce4){_0x56107e=_0x56107e-0x0;var _0x2f1322=_0x9ed9[_0x56107e];return _0x2f1322;};'use strict';var multer=require(_0x99ed('0x0'));var util=require(_0x99ed('0x1'));var path=require(_0x99ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x99ed('0x3'));var router=express[_0x99ed('0x4')]();var auth=require(_0x99ed('0x5'));var interaction=require(_0x99ed('0x6'));var config=require('../../config/environment');var controller=require('./chatQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x99ed('0x7')]);router[_0x99ed('0x8')](_0x99ed('0x9'),auth[_0x99ed('0xa')](),controller[_0x99ed('0xb')]);router[_0x99ed('0x8')](_0x99ed('0xc'),auth[_0x99ed('0xa')](),controller[_0x99ed('0xd')]);router[_0x99ed('0x8')](_0x99ed('0xe'),auth[_0x99ed('0xa')](),controller['getMembers']);router['get'](_0x99ed('0xf'),auth[_0x99ed('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0x99ed('0xa')](),controller[_0x99ed('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x99ed('0x11')]);router[_0x99ed('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x99ed('0x13')]);router[_0x99ed('0x12')](_0x99ed('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x99ed('0x15')](_0x99ed('0xc'),auth[_0x99ed('0xa')](),controller['update']);router[_0x99ed('0x16')](_0x99ed('0xc'),auth[_0x99ed('0xa')](),controller[_0x99ed('0x17')]);router['delete']('/:id/teams',auth[_0x99ed('0xa')](),controller[_0x99ed('0x18')]);router['delete'](_0x99ed('0x14'),auth[_0x99ed('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xab96=['/describe','isAuthenticated','/:id','show','/:id/members','getMembers','getAgents','create','post','/:id/teams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index'];(function(_0x4f0fba,_0x4faa95){var _0x13e196=function(_0x5ce11f){while(--_0x5ce11f){_0x4f0fba['push'](_0x4f0fba['shift']());}};_0x13e196(++_0x4faa95);}(_0xab96,0x66));var _0x6ab9=function(_0x49de6f,_0x148549){_0x49de6f=_0x49de6f-0x0;var _0x2761da=_0xab96[_0x49de6f];return _0x2761da;};'use strict';var multer=require(_0x6ab9('0x0'));var util=require(_0x6ab9('0x1'));var path=require(_0x6ab9('0x2'));var timeout=require(_0x6ab9('0x3'));var express=require(_0x6ab9('0x4'));var router=express[_0x6ab9('0x5')]();var auth=require(_0x6ab9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6ab9('0x7'));var controller=require('./chatQueue.controller');router[_0x6ab9('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ab9('0x9')]);router[_0x6ab9('0x8')](_0x6ab9('0xa'),auth[_0x6ab9('0xb')](),controller['describe']);router['get'](_0x6ab9('0xc'),auth[_0x6ab9('0xb')](),controller[_0x6ab9('0xd')]);router[_0x6ab9('0x8')](_0x6ab9('0xe'),auth[_0x6ab9('0xb')](),controller[_0x6ab9('0xf')]);router['get']('/:id/teams',auth[_0x6ab9('0xb')](),controller['getTeams']);router[_0x6ab9('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x6ab9('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6ab9('0x11')]);router[_0x6ab9('0x12')](_0x6ab9('0x13'),auth[_0x6ab9('0xb')](),controller['addTeams']);router[_0x6ab9('0x12')](_0x6ab9('0x14'),auth[_0x6ab9('0xb')](),controller[_0x6ab9('0x15')]);router[_0x6ab9('0x16')](_0x6ab9('0xc'),auth[_0x6ab9('0xb')](),controller['update']);router[_0x6ab9('0x17')](_0x6ab9('0xc'),auth[_0x6ab9('0xb')](),controller[_0x6ab9('0x18')]);router[_0x6ab9('0x17')](_0x6ab9('0x13'),auth[_0x6ab9('0xb')](),controller[_0x6ab9('0x19')]);router[_0x6ab9('0x17')](_0x6ab9('0x14'),auth['isAuthenticated'](),controller[_0x6ab9('0x1a')]);module[_0x6ab9('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ee0af5a..be7e2a8 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 _0x46da=['sequelize','exports','STRING','DATE','moment'];(function(_0x2a3113,_0x4a16c6){var _0x981cf2=function(_0x27c266){while(--_0x27c266){_0x2a3113['push'](_0x2a3113['shift']());}};_0x981cf2(++_0x4a16c6);}(_0x46da,0x199));var _0xa46d=function(_0x5f0e5c,_0x1a621d){_0x5f0e5c=_0x5f0e5c-0x0;var _0x2ded8a=_0x46da[_0x5f0e5c];return _0x2ded8a;};'use strict';var moment=require(_0xa46d('0x0'));var Sequelize=require(_0xa46d('0x1'));module[_0xa46d('0x2')]={'uniqueid':{'type':Sequelize[_0xa46d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa46d('0x3')]},'joinAt':{'type':Sequelize[_0xa46d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x09e1=['sequelize','exports','STRING','DATE','moment'];(function(_0x14e7e8,_0x5e60df){var _0x402654=function(_0x373543){while(--_0x373543){_0x14e7e8['push'](_0x14e7e8['shift']());}};_0x402654(++_0x5e60df);}(_0x09e1,0x176));var _0x109e=function(_0x1a5726,_0xaad56f){_0x1a5726=_0x1a5726-0x0;var _0x118362=_0x09e1[_0x1a5726];return _0x118362;};'use strict';var moment=require(_0x109e('0x0'));var Sequelize=require(_0x109e('0x1'));module[_0x109e('0x2')]={'uniqueid':{'type':Sequelize[_0x109e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x109e('0x3')]},'joinAt':{'type':Sequelize[_0x109e('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x109e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b2d9455..27d83d0 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 _0xce8c=['update','then','destroy','error','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x423a7c,_0x5efcb3){var _0x13be1c=function(_0x14e87b){while(--_0x14e87b){_0x423a7c['push'](_0x423a7c['shift']());}};_0x13be1c(++_0x5efcb3);}(_0xce8c,0x157));var _0xcce8=function(_0x3eba1e,_0x420ac5){_0x3eba1e=_0x3eba1e-0x0;var _0x312ee8=_0xce8c[_0x3eba1e];return _0x312ee8;};'use strict';var pdf=require(_0xcce8('0x0'));var emlformat=require(_0xcce8('0x1'));var rimraf=require(_0xcce8('0x2'));var zipdir=require(_0xcce8('0x3'));var jsonpatch=require(_0xcce8('0x4'));var rp=require(_0xcce8('0x5'));var moment=require(_0xcce8('0x6'));var BPromise=require(_0xcce8('0x7'));var Mustache=require(_0xcce8('0x8'));var util=require('util');var path=require(_0xcce8('0x9'));var sox=require(_0xcce8('0xa'));var csv=require(_0xcce8('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcce8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcce8('0xd'));var deskjs=require(_0xcce8('0xe'));var toCsv=require(_0xcce8('0xb'));var querystring=require(_0xcce8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcce8('0x10'));var qs=require(_0xcce8('0x11'));var as=require(_0xcce8('0x12'));var hardwareService=require(_0xcce8('0x13'));var logger=require(_0xcce8('0x14'))(_0xcce8('0x15'));var utils=require(_0xcce8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcce8('0x17'));var db=require(_0xcce8('0x18'))['db'];function respondWithStatusCode(_0x477e19,_0x1004d3){_0x1004d3=_0x1004d3||0xcc;return function(_0x4d9727){if(_0x4d9727){return _0x477e19[_0xcce8('0x19')](_0x1004d3);}return _0x477e19[_0xcce8('0x1a')](_0x1004d3)[_0xcce8('0x1b')]();};}function respondWithResult(_0x149ce3,_0x22a208){_0x22a208=_0x22a208||0xc8;return function(_0x24f974){if(_0x24f974){return _0x149ce3['status'](_0x22a208)[_0xcce8('0x1c')](_0x24f974);}};}function respondWithFilteredResult(_0x51adc7,_0x5172b1){return function(_0x4454d1){if(_0x4454d1){var _0x5911f6=_0x4454d1[_0xcce8('0x1d')],_0x53b18d=_0x5172b1[_0xcce8('0x1e')],_0x20ece5=_0x5172b1[_0xcce8('0x1e')]+_0x5172b1[_0xcce8('0x1f')],_0x34a1ca;if(_0x20ece5>=_0x5911f6){_0x20ece5=_0x5911f6;_0x34a1ca=0xc8;}else{_0x34a1ca=0xce;}_0x51adc7[_0xcce8('0x1a')](_0x34a1ca);return _0x51adc7[_0xcce8('0x20')](_0xcce8('0x21'),_0x53b18d+'-'+_0x20ece5+'/'+_0x5911f6)[_0xcce8('0x1c')](_0x4454d1);}return null;};}function patchUpdates(_0x20b6fb){return function(_0x5cfb67){try{jsonpatch[_0xcce8('0x22')](_0x5cfb67,_0x20b6fb,!![]);}catch(_0x18a1fd){return BPromise[_0xcce8('0x23')](_0x18a1fd);}return _0x5cfb67[_0xcce8('0x24')]();};}function saveUpdates(_0x4d1b90,_0x37973a){return function(_0x4e42e4){if(_0x4e42e4){return _0x4e42e4[_0xcce8('0x25')](_0x4d1b90)[_0xcce8('0x26')](function(_0x1e4339){return _0x1e4339;});}return null;};}function removeEntity(_0x8fe904,_0x2cf9eb){return function(_0x52b4dd){if(_0x52b4dd){return _0x52b4dd[_0xcce8('0x27')]()[_0xcce8('0x26')](function(){_0x8fe904[_0xcce8('0x1a')](0xcc)[_0xcce8('0x1b')]();});}};}function handleEntityNotFound(_0x5b83df,_0x13b13a){return function(_0x508bfa){if(!_0x508bfa){_0x5b83df[_0xcce8('0x19')](0x194);}return _0x508bfa;};}function handleError(_0x1b3bf9,_0x250f9b){_0x250f9b=_0x250f9b||0x1f4;return function(_0x4d7715){logger[_0xcce8('0x28')](_0x4d7715['stack']);if(_0x4d7715[_0xcce8('0x29')]){delete _0x4d7715['name'];}_0x1b3bf9['status'](_0x250f9b)['send'](_0x4d7715);};}exports[_0xcce8('0x2a')]=function(_0x56b13f,_0x3e0471){var _0x1ea0f6={},_0x31bb5a={},_0x1fa558={'count':0x0,'rows':[]};var _0x542629=_[_0xcce8('0x2b')](db[_0xcce8('0x2c')][_0xcce8('0x2d')],function(_0x3292f2){return{'name':_0x3292f2['fieldName'],'type':_0x3292f2[_0xcce8('0x2e')][_0xcce8('0x2f')]};});_0x31bb5a[_0xcce8('0x30')]=_[_0xcce8('0x2b')](_0x542629,_0xcce8('0x29'));_0x31bb5a[_0xcce8('0x31')]=_[_0xcce8('0x32')](_0x56b13f[_0xcce8('0x31')]);_0x31bb5a['filters']=_[_0xcce8('0x33')](_0x31bb5a[_0xcce8('0x30')],_0x31bb5a[_0xcce8('0x31')]);_0x1ea0f6[_0xcce8('0x34')]=_['intersection'](_0x31bb5a[_0xcce8('0x30')],qs[_0xcce8('0x35')](_0x56b13f[_0xcce8('0x31')][_0xcce8('0x35')]));_0x1ea0f6[_0xcce8('0x34')]=_0x1ea0f6[_0xcce8('0x34')][_0xcce8('0x36')]?_0x1ea0f6[_0xcce8('0x34')]:_0x31bb5a['model'];if(!_0x56b13f['query'][_0xcce8('0x37')](_0xcce8('0x38'))){_0x1ea0f6[_0xcce8('0x1f')]=qs[_0xcce8('0x1f')](_0x56b13f[_0xcce8('0x31')][_0xcce8('0x1f')]);_0x1ea0f6[_0xcce8('0x1e')]=qs['offset'](_0x56b13f[_0xcce8('0x31')][_0xcce8('0x1e')]);}_0x1ea0f6[_0xcce8('0x39')]=qs[_0xcce8('0x3a')](_0x56b13f[_0xcce8('0x31')]['sort']);_0x1ea0f6[_0xcce8('0x3b')]=qs[_0xcce8('0x3c')](_[_0xcce8('0x3d')](_0x56b13f[_0xcce8('0x31')],_0x31bb5a[_0xcce8('0x3c')]),_0x542629);if(_0x56b13f[_0xcce8('0x31')][_0xcce8('0x3e')]){_0x1ea0f6['where']=_[_0xcce8('0x3f')](_0x1ea0f6['where'],{'$or':_[_0xcce8('0x2b')](_0x542629,function(_0x121a85){if(_0x121a85['type']!==_0xcce8('0x40')){var _0x3b0872={};_0x3b0872[_0x121a85['name']]={'$like':'%'+_0x56b13f['query'][_0xcce8('0x3e')]+'%'};return _0x3b0872;}})});}_0x1ea0f6=_[_0xcce8('0x3f')]({},_0x1ea0f6,_0x56b13f[_0xcce8('0x41')]);var _0x3d3ce3={'where':_0x1ea0f6[_0xcce8('0x3b')]};return db[_0xcce8('0x2c')][_0xcce8('0x1d')](_0x3d3ce3)[_0xcce8('0x26')](function(_0x483745){_0x1fa558[_0xcce8('0x1d')]=_0x483745;if(_0x56b13f['query'][_0xcce8('0x42')]){_0x1ea0f6[_0xcce8('0x43')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x1ea0f6);})[_0xcce8('0x26')](function(_0x84450b){_0x1fa558[_0xcce8('0x44')]=_0x84450b;return _0x1fa558;})['then'](respondWithFilteredResult(_0x3e0471,_0x1ea0f6))[_0xcce8('0x45')](handleError(_0x3e0471,null));};exports[_0xcce8('0x46')]=function(_0x4e60c4,_0x47cec8){var _0x3d6d0c={'raw':!![],'where':{'id':_0x4e60c4[_0xcce8('0x47')]['id']}},_0x567fa3={};_0x567fa3['model']=_[_0xcce8('0x32')](db[_0xcce8('0x2c')]['rawAttributes']);_0x567fa3[_0xcce8('0x31')]=_[_0xcce8('0x32')](_0x4e60c4[_0xcce8('0x31')]);_0x567fa3[_0xcce8('0x3c')]=_[_0xcce8('0x33')](_0x567fa3[_0xcce8('0x30')],_0x567fa3[_0xcce8('0x31')]);_0x3d6d0c[_0xcce8('0x34')]=_[_0xcce8('0x33')](_0x567fa3[_0xcce8('0x30')],qs[_0xcce8('0x35')](_0x4e60c4['query']['fields']));_0x3d6d0c[_0xcce8('0x34')]=_0x3d6d0c['attributes']['length']?_0x3d6d0c[_0xcce8('0x34')]:_0x567fa3[_0xcce8('0x30')];if(_0x4e60c4['query'][_0xcce8('0x42')]){_0x3d6d0c[_0xcce8('0x43')]=[{'all':!![]}];}_0x3d6d0c=_[_0xcce8('0x3f')]({},_0x3d6d0c,_0x4e60c4[_0xcce8('0x41')]);return db[_0xcce8('0x2c')][_0xcce8('0x48')](_0x3d6d0c)['then'](handleEntityNotFound(_0x47cec8,null))[_0xcce8('0x26')](respondWithResult(_0x47cec8,null))['catch'](handleError(_0x47cec8,null));};exports[_0xcce8('0x49')]=function(_0x4a5279,_0x254557){return db[_0xcce8('0x2c')][_0xcce8('0x49')](_0x4a5279['body'],{})[_0xcce8('0x26')](respondWithResult(_0x254557,0xc9))['catch'](handleError(_0x254557,null));};exports[_0xcce8('0x25')]=function(_0x100553,_0x16d169){if(_0x100553['body']['id']){delete _0x100553['body']['id'];}return db[_0xcce8('0x2c')][_0xcce8('0x48')]({'where':{'id':_0x100553[_0xcce8('0x47')]['id']}})[_0xcce8('0x26')](handleEntityNotFound(_0x16d169,null))[_0xcce8('0x26')](saveUpdates(_0x100553[_0xcce8('0x4a')],null))[_0xcce8('0x26')](respondWithResult(_0x16d169,null))['catch'](handleError(_0x16d169,null));};exports[_0xcce8('0x27')]=function(_0x1c7197,_0x321929){return db[_0xcce8('0x2c')][_0xcce8('0x48')]({'where':{'id':_0x1c7197[_0xcce8('0x47')]['id']}})['then'](handleEntityNotFound(_0x321929,null))[_0xcce8('0x26')](removeEntity(_0x321929,null))[_0xcce8('0x45')](handleError(_0x321929,null));};exports[_0xcce8('0x4b')]=function(_0x1f3379,_0x1d63d0){return db[_0xcce8('0x2c')]['describe']()[_0xcce8('0x26')](respondWithResult(_0x1d63d0,null))['catch'](handleError(_0x1d63d0,null));};
\ No newline at end of file
+var _0x0466=['params','rawAttributes','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','sox','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','save','update','then','destroy','end','name','send','index','ChatQueueReport','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show'];(function(_0x478cd0,_0x12c1df){var _0x430972=function(_0x13b5ad){while(--_0x13b5ad){_0x478cd0['push'](_0x478cd0['shift']());}};_0x430972(++_0x12c1df);}(_0x0466,0x1c3));var _0x6046=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0466[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x6046('0x0'));var emlformat=require(_0x6046('0x1'));var rimraf=require(_0x6046('0x2'));var zipdir=require(_0x6046('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6046('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6046('0x5'));var util=require('util');var path=require(_0x6046('0x6'));var sox=require(_0x6046('0x7'));var csv=require(_0x6046('0x8'));var ejs=require(_0x6046('0x9'));var fs=require('fs');var _=require(_0x6046('0xa'));var squel=require(_0x6046('0xb'));var crypto=require(_0x6046('0xc'));var jsforce=require(_0x6046('0xd'));var deskjs=require(_0x6046('0xe'));var toCsv=require(_0x6046('0x8'));var querystring=require(_0x6046('0xf'));var Papa=require(_0x6046('0x10'));var Redis=require(_0x6046('0x11'));var authService=require(_0x6046('0x12'));var qs=require(_0x6046('0x13'));var as=require(_0x6046('0x14'));var hardwareService=require(_0x6046('0x15'));var logger=require(_0x6046('0x16'))(_0x6046('0x17'));var utils=require(_0x6046('0x18'));var config=require(_0x6046('0x19'));var licenseUtil=require(_0x6046('0x1a'));var db=require(_0x6046('0x1b'))['db'];function respondWithStatusCode(_0x1ef731,_0x46873f){_0x46873f=_0x46873f||0xcc;return function(_0x297924){if(_0x297924){return _0x1ef731[_0x6046('0x1c')](_0x46873f);}return _0x1ef731[_0x6046('0x1d')](_0x46873f)['end']();};}function respondWithResult(_0x1d8548,_0x4582a8){_0x4582a8=_0x4582a8||0xc8;return function(_0x7589){if(_0x7589){return _0x1d8548[_0x6046('0x1d')](_0x4582a8)[_0x6046('0x1e')](_0x7589);}};}function respondWithFilteredResult(_0x565174,_0x413e2a){return function(_0x2d951e){if(_0x2d951e){var _0x55c52c=_0x2d951e[_0x6046('0x1f')],_0x3e084e=_0x413e2a[_0x6046('0x20')],_0x41c876=_0x413e2a[_0x6046('0x20')]+_0x413e2a[_0x6046('0x21')],_0x3bc9d2;if(_0x41c876>=_0x55c52c){_0x41c876=_0x55c52c;_0x3bc9d2=0xc8;}else{_0x3bc9d2=0xce;}_0x565174[_0x6046('0x1d')](_0x3bc9d2);return _0x565174['set']('Content-Range',_0x3e084e+'-'+_0x41c876+'/'+_0x55c52c)[_0x6046('0x1e')](_0x2d951e);}return null;};}function patchUpdates(_0x2586b1){return function(_0x3abf5e){try{jsonpatch[_0x6046('0x22')](_0x3abf5e,_0x2586b1,!![]);}catch(_0x4b4e07){return BPromise['reject'](_0x4b4e07);}return _0x3abf5e[_0x6046('0x23')]();};}function saveUpdates(_0x23cf2c,_0x484f33){return function(_0x1c0618){if(_0x1c0618){return _0x1c0618[_0x6046('0x24')](_0x23cf2c)[_0x6046('0x25')](function(_0x95ec31){return _0x95ec31;});}return null;};}function removeEntity(_0xe8fa1d,_0x551a6e){return function(_0x2a9070){if(_0x2a9070){return _0x2a9070[_0x6046('0x26')]()[_0x6046('0x25')](function(){_0xe8fa1d[_0x6046('0x1d')](0xcc)[_0x6046('0x27')]();});}};}function handleEntityNotFound(_0xcc3328,_0x14b416){return function(_0x332ccf){if(!_0x332ccf){_0xcc3328['sendStatus'](0x194);}return _0x332ccf;};}function handleError(_0x3722cf,_0x413fb3){_0x413fb3=_0x413fb3||0x1f4;return function(_0x582673){logger['error'](_0x582673['stack']);if(_0x582673[_0x6046('0x28')]){delete _0x582673['name'];}_0x3722cf[_0x6046('0x1d')](_0x413fb3)[_0x6046('0x29')](_0x582673);};}exports[_0x6046('0x2a')]=function(_0x1abe23,_0x297db7){var _0x319b6b={},_0x2657eb={},_0x276a29={'count':0x0,'rows':[]};var _0x319ca1=_['map'](db[_0x6046('0x2b')]['rawAttributes'],function(_0x590237){return{'name':_0x590237['fieldName'],'type':_0x590237['type'][_0x6046('0x2c')]};});_0x2657eb[_0x6046('0x2d')]=_[_0x6046('0x2e')](_0x319ca1,_0x6046('0x28'));_0x2657eb[_0x6046('0x2f')]=_[_0x6046('0x30')](_0x1abe23[_0x6046('0x2f')]);_0x2657eb[_0x6046('0x31')]=_[_0x6046('0x32')](_0x2657eb[_0x6046('0x2d')],_0x2657eb[_0x6046('0x2f')]);_0x319b6b[_0x6046('0x33')]=_['intersection'](_0x2657eb[_0x6046('0x2d')],qs['fields'](_0x1abe23[_0x6046('0x2f')][_0x6046('0x34')]));_0x319b6b[_0x6046('0x33')]=_0x319b6b[_0x6046('0x33')][_0x6046('0x35')]?_0x319b6b[_0x6046('0x33')]:_0x2657eb[_0x6046('0x2d')];if(!_0x1abe23[_0x6046('0x2f')]['hasOwnProperty']('nolimit')){_0x319b6b[_0x6046('0x21')]=qs['limit'](_0x1abe23[_0x6046('0x2f')][_0x6046('0x21')]);_0x319b6b['offset']=qs['offset'](_0x1abe23['query'][_0x6046('0x20')]);}_0x319b6b[_0x6046('0x36')]=qs[_0x6046('0x37')](_0x1abe23[_0x6046('0x2f')][_0x6046('0x37')]);_0x319b6b[_0x6046('0x38')]=qs[_0x6046('0x31')](_[_0x6046('0x39')](_0x1abe23['query'],_0x2657eb[_0x6046('0x31')]),_0x319ca1);if(_0x1abe23[_0x6046('0x2f')]['filter']){_0x319b6b[_0x6046('0x38')]=_[_0x6046('0x3a')](_0x319b6b[_0x6046('0x38')],{'$or':_[_0x6046('0x2e')](_0x319ca1,function(_0x1b69fb){if(_0x1b69fb[_0x6046('0x3b')]!==_0x6046('0x3c')){var _0x3e4fbe={};_0x3e4fbe[_0x1b69fb[_0x6046('0x28')]]={'$like':'%'+_0x1abe23[_0x6046('0x2f')][_0x6046('0x3d')]+'%'};return _0x3e4fbe;}})});}_0x319b6b=_[_0x6046('0x3a')]({},_0x319b6b,_0x1abe23[_0x6046('0x3e')]);var _0x4c964c={'where':_0x319b6b[_0x6046('0x38')]};return db[_0x6046('0x2b')][_0x6046('0x1f')](_0x4c964c)['then'](function(_0x2995f3){_0x276a29[_0x6046('0x1f')]=_0x2995f3;if(_0x1abe23[_0x6046('0x2f')]['includeAll']){_0x319b6b[_0x6046('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x319b6b);})[_0x6046('0x25')](function(_0x316d32){_0x276a29[_0x6046('0x40')]=_0x316d32;return _0x276a29;})['then'](respondWithFilteredResult(_0x297db7,_0x319b6b))[_0x6046('0x41')](handleError(_0x297db7,null));};exports[_0x6046('0x42')]=function(_0x3cac01,_0x416621){var _0x3520dd={'raw':!![],'where':{'id':_0x3cac01[_0x6046('0x43')]['id']}},_0x1930e2={};_0x1930e2[_0x6046('0x2d')]=_[_0x6046('0x30')](db['ChatQueueReport'][_0x6046('0x44')]);_0x1930e2[_0x6046('0x2f')]=_[_0x6046('0x30')](_0x3cac01[_0x6046('0x2f')]);_0x1930e2[_0x6046('0x31')]=_[_0x6046('0x32')](_0x1930e2[_0x6046('0x2d')],_0x1930e2['query']);_0x3520dd['attributes']=_[_0x6046('0x32')](_0x1930e2[_0x6046('0x2d')],qs[_0x6046('0x34')](_0x3cac01[_0x6046('0x2f')]['fields']));_0x3520dd['attributes']=_0x3520dd[_0x6046('0x33')][_0x6046('0x35')]?_0x3520dd[_0x6046('0x33')]:_0x1930e2[_0x6046('0x2d')];if(_0x3cac01['query'][_0x6046('0x45')]){_0x3520dd[_0x6046('0x3f')]=[{'all':!![]}];}_0x3520dd=_[_0x6046('0x3a')]({},_0x3520dd,_0x3cac01['options']);return db[_0x6046('0x2b')][_0x6046('0x46')](_0x3520dd)[_0x6046('0x25')](handleEntityNotFound(_0x416621,null))[_0x6046('0x25')](respondWithResult(_0x416621,null))['catch'](handleError(_0x416621,null));};exports['create']=function(_0x54f760,_0x1cd83a){return db[_0x6046('0x2b')][_0x6046('0x47')](_0x54f760[_0x6046('0x48')],{})['then'](respondWithResult(_0x1cd83a,0xc9))[_0x6046('0x41')](handleError(_0x1cd83a,null));};exports[_0x6046('0x24')]=function(_0x422d7f,_0x26e7c8){if(_0x422d7f[_0x6046('0x48')]['id']){delete _0x422d7f[_0x6046('0x48')]['id'];}return db[_0x6046('0x2b')][_0x6046('0x46')]({'where':{'id':_0x422d7f[_0x6046('0x43')]['id']}})[_0x6046('0x25')](handleEntityNotFound(_0x26e7c8,null))[_0x6046('0x25')](saveUpdates(_0x422d7f[_0x6046('0x48')],null))[_0x6046('0x25')](respondWithResult(_0x26e7c8,null))['catch'](handleError(_0x26e7c8,null));};exports[_0x6046('0x26')]=function(_0x4f4a9d,_0x1ae3e9){return db[_0x6046('0x2b')][_0x6046('0x46')]({'where':{'id':_0x4f4a9d['params']['id']}})[_0x6046('0x25')](handleEntityNotFound(_0x1ae3e9,null))[_0x6046('0x25')](removeEntity(_0x1ae3e9,null))['catch'](handleError(_0x1ae3e9,null));};exports[_0x6046('0x49')]=function(_0x22c011,_0x4c9ce9){return db[_0x6046('0x2b')][_0x6046('0x49')]()['then'](respondWithResult(_0x4c9ce9,null))[_0x6046('0x41')](handleError(_0x4c9ce9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b7bb274..c0bb0d9 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 _0x904a=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid'];(function(_0x4c1dca,_0x1d4587){var _0x3b2ee2=function(_0x28b151){while(--_0x28b151){_0x4c1dca['push'](_0x4c1dca['shift']());}};_0x3b2ee2(++_0x1d4587);}(_0x904a,0x145));var _0xa904=function(_0x3835ec,_0x49c314){_0x3835ec=_0x3835ec-0x0;var _0x9d029c=_0x904a[_0x3835ec];return _0x9d029c;};'use strict';var _=require(_0xa904('0x0'));var util=require(_0xa904('0x1'));var logger=require(_0xa904('0x2'))(_0xa904('0x3'));var moment=require(_0xa904('0x4'));var BPromise=require(_0xa904('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa904('0x6'));var rimraf=require(_0xa904('0x7'));var config=require('../../config/environment');var attributes=require(_0xa904('0x8'));module[_0xa904('0x9')]=function(_0x3a959a,_0x46daba){return _0x3a959a[_0xa904('0xa')]('ChatQueueReport',attributes,{'tableName':_0xa904('0xb'),'paranoid':![],'indexes':[{'name':_0xa904('0xc'),'fields':[_0xa904('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd6e4=['bluebird','request-promise','path','rimraf','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x18d36f,_0x31b65f){var _0x10034d=function(_0x38bb30){while(--_0x38bb30){_0x18d36f['push'](_0x18d36f['shift']());}};_0x10034d(++_0x31b65f);}(_0xd6e4,0x104));var _0x4d6e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd6e4[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x4d6e('0x0'));var util=require(_0x4d6e('0x1'));var logger=require(_0x4d6e('0x2'))(_0x4d6e('0x3'));var moment=require('moment');var BPromise=require(_0x4d6e('0x4'));var rp=require(_0x4d6e('0x5'));var fs=require('fs');var path=require(_0x4d6e('0x6'));var rimraf=require(_0x4d6e('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d6e('0x8'));module['exports']=function(_0x271c4c,_0x1fd8d8){return _0x271c4c[_0x4d6e('0x9')](_0x4d6e('0xa'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x4d6e('0xb'),'fields':[_0x4d6e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 1919887..79d1d85 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 _0x9fb4=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','create','body','options','raw','then','stringify','UpdateChatQueueReport','ChatQueueReport','update','where','attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9fb4,0x96));var _0x49fb=function(_0x4fc702,_0x590060){_0x4fc702=_0x4fc702-0x0;var _0x1357d3=_0x9fb4[_0x4fc702];return _0x1357d3;};'use strict';var _=require(_0x49fb('0x0'));var util=require('util');var moment=require(_0x49fb('0x1'));var BPromise=require('bluebird');var rs=require(_0x49fb('0x2'));var fs=require('fs');var Redis=require(_0x49fb('0x3'));var db=require(_0x49fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x49fb('0x5'))('rpc');var config=require(_0x49fb('0x6'));var jayson=require(_0x49fb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x150e99,_0x7f4d0a,_0x4efff6){return new BPromise(function(_0x49fcdc,_0x3bf8ce){return client[_0x49fb('0x8')](_0x150e99,_0x4efff6)['then'](function(_0x55938b){logger[_0x49fb('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x7f4d0a,_0x49fb('0xa'));logger[_0x49fb('0xb')](_0x49fb('0xc'),_0x7f4d0a,'request\x20sent',JSON['stringify'](_0x55938b));if(_0x55938b[_0x49fb('0xd')]){if(_0x55938b[_0x49fb('0xd')]['code']===0x1f4){logger[_0x49fb('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x7f4d0a,_0x55938b[_0x49fb('0xd')][_0x49fb('0xe')]);return _0x3bf8ce(_0x55938b[_0x49fb('0xd')]['message']);}logger['error'](_0x49fb('0xf'),_0x7f4d0a,_0x55938b[_0x49fb('0xd')][_0x49fb('0xe')]);return _0x49fcdc(_0x55938b[_0x49fb('0xd')][_0x49fb('0xe')]);}else{logger['info'](_0x49fb('0xf'),_0x7f4d0a,_0x49fb('0xa'));_0x49fcdc(_0x55938b[_0x49fb('0x10')][_0x49fb('0xe')]);}})[_0x49fb('0x11')](function(_0x2e3651){logger[_0x49fb('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x7f4d0a,_0x2e3651);_0x3bf8ce(_0x2e3651);});});}exports[_0x49fb('0x12')]=function(_0x55b461){var _0x95af62=this;return new Promise(function(_0x9c462c,_0x2e492d){return db['ChatQueueReport'][_0x49fb('0x13')](_0x55b461[_0x49fb('0x14')],{'raw':_0x55b461[_0x49fb('0x15')]?_0x55b461[_0x49fb('0x15')][_0x49fb('0x16')]===undefined?!![]:![]:!![]})[_0x49fb('0x17')](function(_0x515dc2){logger['info'](_0x49fb('0x12'),_0x55b461);logger['debug'](_0x49fb('0x12'),_0x55b461,JSON[_0x49fb('0x18')](_0x515dc2));_0x9c462c(_0x515dc2);})[_0x49fb('0x11')](function(_0x168a7e){logger[_0x49fb('0xd')](_0x49fb('0x12'),_0x168a7e[_0x49fb('0xe')],_0x55b461);_0x2e492d(_0x95af62[_0x49fb('0xd')](0x1f4,_0x168a7e[_0x49fb('0xe')]));});});};exports[_0x49fb('0x19')]=function(_0x2adadc){var _0x1b0c35=this;return new Promise(function(_0x221a24,_0x18769a){return db[_0x49fb('0x1a')][_0x49fb('0x1b')](_0x2adadc[_0x49fb('0x14')],{'raw':_0x2adadc[_0x49fb('0x15')]?_0x2adadc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2adadc[_0x49fb('0x15')]?_0x2adadc[_0x49fb('0x15')][_0x49fb('0x1c')]||null:null,'attributes':_0x2adadc[_0x49fb('0x15')]?_0x2adadc[_0x49fb('0x15')][_0x49fb('0x1d')]||null:null,'limit':_0x2adadc[_0x49fb('0x15')]?_0x2adadc[_0x49fb('0x15')]['limit']||null:null})[_0x49fb('0x17')](function(_0x46939b){logger[_0x49fb('0x9')](_0x49fb('0x19'),_0x2adadc);logger[_0x49fb('0xb')](_0x49fb('0x19'),_0x2adadc,JSON['stringify'](_0x46939b));_0x221a24(_0x46939b);})[_0x49fb('0x11')](function(_0x1f5b02){logger[_0x49fb('0xd')](_0x49fb('0x19'),_0x1f5b02['message'],_0x2adadc);_0x18769a(_0x1b0c35[_0x49fb('0xd')](0x1f4,_0x1f5b02[_0x49fb('0xe')]));});});};
\ No newline at end of file
+var _0x6d4a=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','info','debug','catch','UpdateChatQueueReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x14f2c0,_0xe0b572){var _0x43196e=function(_0x5b5537){while(--_0x5b5537){_0x14f2c0['push'](_0x14f2c0['shift']());}};_0x43196e(++_0xe0b572);}(_0x6d4a,0x132));var _0xa6d4=function(_0x10d830,_0x1b7aa7){_0x10d830=_0x10d830-0x0;var _0x3814ee=_0x6d4a[_0x10d830];return _0x3814ee;};'use strict';var _=require('lodash');var util=require(_0xa6d4('0x0'));var moment=require(_0xa6d4('0x1'));var BPromise=require(_0xa6d4('0x2'));var rs=require(_0xa6d4('0x3'));var fs=require('fs');var Redis=require(_0xa6d4('0x4'));var db=require(_0xa6d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa6d4('0x6'));var config=require(_0xa6d4('0x7'));var jayson=require(_0xa6d4('0x8'));var client=jayson[_0xa6d4('0x9')][_0xa6d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f5951,_0x236df9,_0x4fea09){return new BPromise(function(_0x38a78c,_0x173aa2){return client['request'](_0x1f5951,_0x4fea09)[_0xa6d4('0xb')](function(_0x54770d){logger['info'](_0xa6d4('0xc'),_0x236df9,_0xa6d4('0xd'));logger['debug'](_0xa6d4('0xe'),_0x236df9,'request\x20sent',JSON[_0xa6d4('0xf')](_0x54770d));if(_0x54770d[_0xa6d4('0x10')]){if(_0x54770d[_0xa6d4('0x10')]['code']===0x1f4){logger[_0xa6d4('0x10')](_0xa6d4('0xc'),_0x236df9,_0x54770d['error'][_0xa6d4('0x11')]);return _0x173aa2(_0x54770d['error']['message']);}logger[_0xa6d4('0x10')](_0xa6d4('0xc'),_0x236df9,_0x54770d[_0xa6d4('0x10')][_0xa6d4('0x11')]);return _0x38a78c(_0x54770d['error'][_0xa6d4('0x11')]);}else{logger['info'](_0xa6d4('0xc'),_0x236df9,_0xa6d4('0xd'));_0x38a78c(_0x54770d[_0xa6d4('0x12')]['message']);}})['catch'](function(_0x40393c){logger[_0xa6d4('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x236df9,_0x40393c);_0x173aa2(_0x40393c);});});}exports[_0xa6d4('0x13')]=function(_0x35955d){var _0x1d4e4c=this;return new Promise(function(_0x482824,_0x1a909e){return db[_0xa6d4('0x14')][_0xa6d4('0x15')](_0x35955d[_0xa6d4('0x16')],{'raw':_0x35955d[_0xa6d4('0x17')]?_0x35955d[_0xa6d4('0x17')][_0xa6d4('0x18')]===undefined?!![]:![]:!![]})[_0xa6d4('0xb')](function(_0x125039){logger[_0xa6d4('0x19')](_0xa6d4('0x13'),_0x35955d);logger[_0xa6d4('0x1a')](_0xa6d4('0x13'),_0x35955d,JSON[_0xa6d4('0xf')](_0x125039));_0x482824(_0x125039);})[_0xa6d4('0x1b')](function(_0x371200){logger[_0xa6d4('0x10')](_0xa6d4('0x13'),_0x371200[_0xa6d4('0x11')],_0x35955d);_0x1a909e(_0x1d4e4c[_0xa6d4('0x10')](0x1f4,_0x371200[_0xa6d4('0x11')]));});});};exports[_0xa6d4('0x1c')]=function(_0x1fcd2f){var _0x11ec8d=this;return new Promise(function(_0x4b7563,_0x4b090d){return db[_0xa6d4('0x14')][_0xa6d4('0x1d')](_0x1fcd2f['body'],{'raw':_0x1fcd2f['options']?_0x1fcd2f[_0xa6d4('0x17')][_0xa6d4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fcd2f[_0xa6d4('0x17')]?_0x1fcd2f[_0xa6d4('0x17')][_0xa6d4('0x1e')]||null:null,'attributes':_0x1fcd2f[_0xa6d4('0x17')]?_0x1fcd2f[_0xa6d4('0x17')]['attributes']||null:null,'limit':_0x1fcd2f[_0xa6d4('0x17')]?_0x1fcd2f['options'][_0xa6d4('0x1f')]||null:null})['then'](function(_0x155f58){logger[_0xa6d4('0x19')](_0xa6d4('0x1c'),_0x1fcd2f);logger['debug'](_0xa6d4('0x1c'),_0x1fcd2f,JSON[_0xa6d4('0xf')](_0x155f58));_0x4b7563(_0x155f58);})[_0xa6d4('0x1b')](function(_0x431ff6){logger[_0xa6d4('0x10')](_0xa6d4('0x1c'),_0x431ff6[_0xa6d4('0x11')],_0x1fcd2f);_0x4b090d(_0x11ec8d['error'](0x1f4,_0x431ff6['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 2405588..7ff0e03 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 _0x3407=['get','/:id','show','post','create','put','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index'];(function(_0x1d5ddb,_0x43a169){var _0xfca6a=function(_0x2f691c){while(--_0x2f691c){_0x1d5ddb['push'](_0x1d5ddb['shift']());}};_0xfca6a(++_0x43a169);}(_0x3407,0x1a6));var _0x7340=function(_0x5a31ea,_0x48622b){_0x5a31ea=_0x5a31ea-0x0;var _0x2466d6=_0x3407[_0x5a31ea];return _0x2466d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7340('0x0'));var timeout=require(_0x7340('0x1'));var express=require(_0x7340('0x2'));var router=express[_0x7340('0x3')]();var auth=require(_0x7340('0x4'));var interaction=require(_0x7340('0x5'));var config=require(_0x7340('0x6'));var controller=require(_0x7340('0x7'));router['get']('/',auth[_0x7340('0x8')](),controller[_0x7340('0x9')]);router['get']('/describe',auth[_0x7340('0x8')](),controller['describe']);router[_0x7340('0xa')](_0x7340('0xb'),auth['isAuthenticated'](),controller[_0x7340('0xc')]);router[_0x7340('0xd')]('/',auth[_0x7340('0x8')](),controller[_0x7340('0xe')]);router[_0x7340('0xf')](_0x7340('0xb'),auth[_0x7340('0x8')](),controller['update']);router['delete']('/:id',auth[_0x7340('0x8')](),controller[_0x7340('0x10')]);module[_0x7340('0x11')]=router;
\ No newline at end of file
+var _0xd22f=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','get','describe','/:id','post'];(function(_0x2614e1,_0x50d107){var _0x50a01d=function(_0x13cf3a){while(--_0x13cf3a){_0x2614e1['push'](_0x2614e1['shift']());}};_0x50a01d(++_0x50d107);}(_0xd22f,0x125));var _0xfd22=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xd22f[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0xfd22('0x0'));var util=require(_0xfd22('0x1'));var path=require(_0xfd22('0x2'));var timeout=require(_0xfd22('0x3'));var express=require(_0xfd22('0x4'));var router=express[_0xfd22('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd22('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xfd22('0x7')](),controller[_0xfd22('0x8')]);router[_0xfd22('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xfd22('0xa')]);router[_0xfd22('0x9')](_0xfd22('0xb'),auth[_0xfd22('0x7')](),controller['show']);router[_0xfd22('0xc')]('/',auth[_0xfd22('0x7')](),controller[_0xfd22('0xd')]);router['put'](_0xfd22('0xb'),auth[_0xfd22('0x7')](),controller[_0xfd22('0xe')]);router[_0xfd22('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfd22('0x10')]);module[_0xfd22('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 5fc031b..5710090 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 _0x35f8=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x177f23,_0x21f7b3){var _0x33303e=function(_0x2a4037){while(--_0x2a4037){_0x177f23['push'](_0x177f23['shift']());}};_0x33303e(++_0x21f7b3);}(_0x35f8,0xb7));var _0x835f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x35f8[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x835f('0x0'));var Sequelize=require(_0x835f('0x1'));module[_0x835f('0x2')]={'uniqueid':{'type':Sequelize[_0x835f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x835f('0x4')](_0x835f('0x5'),'agent',_0x835f('0x6')),'allowNull':![],'defaultValue':_0x835f('0x6')},'transferredAt':{'type':Sequelize[_0x835f('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x835f('0x8')]}};
\ No newline at end of file
+var _0x2ba9=['NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x2ba9,0x1b3));var _0x92ba=function(_0x2af733,_0x30cf83){_0x2af733=_0x2af733-0x0;var _0x41dbe0=_0x2ba9[_0x2af733];return _0x41dbe0;};'use strict';var moment=require(_0x92ba('0x0'));var Sequelize=require(_0x92ba('0x1'));module[_0x92ba('0x2')]={'uniqueid':{'type':Sequelize[_0x92ba('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x92ba('0x4')](_0x92ba('0x5'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x92ba('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 6cbf019..842b35d 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 _0x022d=['../../config/logger','api','sendStatus','end','status','json','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','limit','offset','sort','pick','filter','where','merge','options','then','includeAll','include','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xc91e81,_0x2492a7){var _0x4c364c=function(_0x58c5c9){while(--_0x58c5c9){_0xc91e81['push'](_0xc91e81['shift']());}};_0x4c364c(++_0x2492a7);}(_0x022d,0x14f));var _0xd022=function(_0xa080b5,_0x321624){_0xa080b5=_0xa080b5-0x0;var _0x47b47d=_0x022d[_0xa080b5];return _0x47b47d;};'use strict';var pdf=require(_0xd022('0x0'));var emlformat=require(_0xd022('0x1'));var rimraf=require(_0xd022('0x2'));var zipdir=require(_0xd022('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd022('0x4'));var moment=require(_0xd022('0x5'));var BPromise=require(_0xd022('0x6'));var Mustache=require(_0xd022('0x7'));var util=require(_0xd022('0x8'));var path=require(_0xd022('0x9'));var sox=require(_0xd022('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd022('0xb'));var squel=require('squel');var crypto=require(_0xd022('0xc'));var jsforce=require(_0xd022('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd022('0xe'));var Papa=require(_0xd022('0xf'));var Redis=require(_0xd022('0x10'));var authService=require(_0xd022('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd022('0x12'));var hardwareService=require(_0xd022('0x13'));var logger=require(_0xd022('0x14'))(_0xd022('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d3962,_0x2ca32c){_0x2ca32c=_0x2ca32c||0xcc;return function(_0x2569d0){if(_0x2569d0){return _0x1d3962[_0xd022('0x16')](_0x2ca32c);}return _0x1d3962['status'](_0x2ca32c)[_0xd022('0x17')]();};}function respondWithResult(_0x305fd4,_0x21f896){_0x21f896=_0x21f896||0xc8;return function(_0x3c8589){if(_0x3c8589){return _0x305fd4[_0xd022('0x18')](_0x21f896)[_0xd022('0x19')](_0x3c8589);}};}function respondWithFilteredResult(_0x24b739,_0x4bb7cc){return function(_0x1ca6ba){if(_0x1ca6ba){var _0x344828=_0x1ca6ba[_0xd022('0x1a')],_0x2bb27c=_0x4bb7cc['offset'],_0x58e35d=_0x4bb7cc['offset']+_0x4bb7cc['limit'],_0x2bb3a3;if(_0x58e35d>=_0x344828){_0x58e35d=_0x344828;_0x2bb3a3=0xc8;}else{_0x2bb3a3=0xce;}_0x24b739[_0xd022('0x18')](_0x2bb3a3);return _0x24b739[_0xd022('0x1b')](_0xd022('0x1c'),_0x2bb27c+'-'+_0x58e35d+'/'+_0x344828)[_0xd022('0x19')](_0x1ca6ba);}return null;};}function patchUpdates(_0x50df7c){return function(_0x364a21){try{jsonpatch[_0xd022('0x1d')](_0x364a21,_0x50df7c,!![]);}catch(_0x16ab5c){return BPromise[_0xd022('0x1e')](_0x16ab5c);}return _0x364a21[_0xd022('0x1f')]();};}function saveUpdates(_0x4ef508,_0x5720f2){return function(_0x238b9a){if(_0x238b9a){return _0x238b9a[_0xd022('0x20')](_0x4ef508)['then'](function(_0xbbc500){return _0xbbc500;});}return null;};}function removeEntity(_0x45122e,_0xa252a3){return function(_0x44c1fb){if(_0x44c1fb){return _0x44c1fb[_0xd022('0x21')]()['then'](function(){_0x45122e[_0xd022('0x18')](0xcc)[_0xd022('0x17')]();});}};}function handleEntityNotFound(_0x95f7ae,_0x5518b4){return function(_0x4c2a3b){if(!_0x4c2a3b){_0x95f7ae[_0xd022('0x16')](0x194);}return _0x4c2a3b;};}function handleError(_0x447a49,_0x1033cf){_0x1033cf=_0x1033cf||0x1f4;return function(_0x1b6b82){logger[_0xd022('0x22')](_0x1b6b82[_0xd022('0x23')]);if(_0x1b6b82[_0xd022('0x24')]){delete _0x1b6b82['name'];}_0x447a49[_0xd022('0x18')](_0x1033cf)[_0xd022('0x25')](_0x1b6b82);};}exports[_0xd022('0x26')]=function(_0x2be19f,_0x3f8705){var _0x138baf={},_0xb17d={},_0x1dd5ef={'count':0x0,'rows':[]};var _0x40ef8f=_[_0xd022('0x27')](db[_0xd022('0x28')][_0xd022('0x29')],function(_0x475f03){return{'name':_0x475f03[_0xd022('0x2a')],'type':_0x475f03[_0xd022('0x2b')][_0xd022('0x2c')]};});_0xb17d[_0xd022('0x2d')]=_[_0xd022('0x27')](_0x40ef8f,_0xd022('0x24'));_0xb17d[_0xd022('0x2e')]=_['keys'](_0x2be19f[_0xd022('0x2e')]);_0xb17d[_0xd022('0x2f')]=_[_0xd022('0x30')](_0xb17d['model'],_0xb17d[_0xd022('0x2e')]);_0x138baf[_0xd022('0x31')]=_[_0xd022('0x30')](_0xb17d[_0xd022('0x2d')],qs[_0xd022('0x32')](_0x2be19f[_0xd022('0x2e')]['fields']));_0x138baf[_0xd022('0x31')]=_0x138baf['attributes'][_0xd022('0x33')]?_0x138baf[_0xd022('0x31')]:_0xb17d[_0xd022('0x2d')];if(!_0x2be19f[_0xd022('0x2e')]['hasOwnProperty']('nolimit')){_0x138baf['limit']=qs[_0xd022('0x34')](_0x2be19f[_0xd022('0x2e')][_0xd022('0x34')]);_0x138baf[_0xd022('0x35')]=qs[_0xd022('0x35')](_0x2be19f[_0xd022('0x2e')][_0xd022('0x35')]);}_0x138baf['order']=qs[_0xd022('0x36')](_0x2be19f[_0xd022('0x2e')]['sort']);_0x138baf['where']=qs[_0xd022('0x2f')](_[_0xd022('0x37')](_0x2be19f[_0xd022('0x2e')],_0xb17d['filters']),_0x40ef8f);if(_0x2be19f[_0xd022('0x2e')][_0xd022('0x38')]){_0x138baf[_0xd022('0x39')]=_[_0xd022('0x3a')](_0x138baf[_0xd022('0x39')],{'$or':_[_0xd022('0x27')](_0x40ef8f,function(_0x43bab9){if(_0x43bab9[_0xd022('0x2b')]!=='VIRTUAL'){var _0x55079d={};_0x55079d[_0x43bab9[_0xd022('0x24')]]={'$like':'%'+_0x2be19f['query']['filter']+'%'};return _0x55079d;}})});}_0x138baf=_[_0xd022('0x3a')]({},_0x138baf,_0x2be19f[_0xd022('0x3b')]);var _0x397880={'where':_0x138baf[_0xd022('0x39')]};return db[_0xd022('0x28')][_0xd022('0x1a')](_0x397880)[_0xd022('0x3c')](function(_0x463524){_0x1dd5ef['count']=_0x463524;if(_0x2be19f['query'][_0xd022('0x3d')]){_0x138baf[_0xd022('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x138baf);})[_0xd022('0x3c')](function(_0x1882bd){_0x1dd5ef['rows']=_0x1882bd;return _0x1dd5ef;})[_0xd022('0x3c')](respondWithFilteredResult(_0x3f8705,_0x138baf))[_0xd022('0x3f')](handleError(_0x3f8705,null));};exports[_0xd022('0x40')]=function(_0x481b99,_0x93e29e){var _0x3ca156={'raw':!![],'where':{'id':_0x481b99[_0xd022('0x41')]['id']}},_0x23029d={};_0x23029d[_0xd022('0x2d')]=_[_0xd022('0x42')](db[_0xd022('0x28')][_0xd022('0x29')]);_0x23029d[_0xd022('0x2e')]=_[_0xd022('0x42')](_0x481b99[_0xd022('0x2e')]);_0x23029d['filters']=_['intersection'](_0x23029d[_0xd022('0x2d')],_0x23029d[_0xd022('0x2e')]);_0x3ca156['attributes']=_[_0xd022('0x30')](_0x23029d[_0xd022('0x2d')],qs['fields'](_0x481b99['query'][_0xd022('0x32')]));_0x3ca156['attributes']=_0x3ca156[_0xd022('0x31')][_0xd022('0x33')]?_0x3ca156[_0xd022('0x31')]:_0x23029d[_0xd022('0x2d')];if(_0x481b99[_0xd022('0x2e')][_0xd022('0x3d')]){_0x3ca156[_0xd022('0x3e')]=[{'all':!![]}];}_0x3ca156=_[_0xd022('0x3a')]({},_0x3ca156,_0x481b99['options']);return db[_0xd022('0x28')][_0xd022('0x43')](_0x3ca156)[_0xd022('0x3c')](handleEntityNotFound(_0x93e29e,null))['then'](respondWithResult(_0x93e29e,null))[_0xd022('0x3f')](handleError(_0x93e29e,null));};exports[_0xd022('0x44')]=function(_0xe47ece,_0x5e3b0d){return db[_0xd022('0x28')]['create'](_0xe47ece[_0xd022('0x45')],{})[_0xd022('0x3c')](respondWithResult(_0x5e3b0d,0xc9))[_0xd022('0x3f')](handleError(_0x5e3b0d,null));};exports[_0xd022('0x20')]=function(_0x3e91b4,_0x498631){if(_0x3e91b4[_0xd022('0x45')]['id']){delete _0x3e91b4['body']['id'];}return db[_0xd022('0x28')]['find']({'where':{'id':_0x3e91b4['params']['id']}})[_0xd022('0x3c')](handleEntityNotFound(_0x498631,null))[_0xd022('0x3c')](saveUpdates(_0x3e91b4[_0xd022('0x45')],null))['then'](respondWithResult(_0x498631,null))[_0xd022('0x3f')](handleError(_0x498631,null));};exports[_0xd022('0x21')]=function(_0x5793a6,_0x18ae9b){return db[_0xd022('0x28')]['find']({'where':{'id':_0x5793a6[_0xd022('0x41')]['id']}})[_0xd022('0x3c')](handleEntityNotFound(_0x18ae9b,null))[_0xd022('0x3c')](removeEntity(_0x18ae9b,null))[_0xd022('0x3f')](handleError(_0x18ae9b,null));};exports[_0xd022('0x46')]=function(_0x593131,_0x385026){return db[_0xd022('0x28')][_0xd022('0x46')]()['then'](respondWithResult(_0x385026,null))[_0xd022('0x3f')](handleError(_0x385026,null));};
\ No newline at end of file
+var _0x350c=['error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','count','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1cb28d,_0x34ff99){var _0x4952d6=function(_0x4a96f6){while(--_0x4a96f6){_0x1cb28d['push'](_0x1cb28d['shift']());}};_0x4952d6(++_0x34ff99);}(_0x350c,0xc6));var _0xc350=function(_0x51181a,_0x39f9a3){_0x51181a=_0x51181a-0x0;var _0x3dc991=_0x350c[_0x51181a];return _0x3dc991;};'use strict';var pdf=require(_0xc350('0x0'));var emlformat=require(_0xc350('0x1'));var rimraf=require(_0xc350('0x2'));var zipdir=require(_0xc350('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc350('0x4'));var moment=require(_0xc350('0x5'));var BPromise=require(_0xc350('0x6'));var Mustache=require(_0xc350('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc350('0x8'));var csv=require('to-csv');var ejs=require(_0xc350('0x9'));var fs=require('fs');var _=require(_0xc350('0xa'));var squel=require(_0xc350('0xb'));var crypto=require(_0xc350('0xc'));var jsforce=require(_0xc350('0xd'));var deskjs=require(_0xc350('0xe'));var toCsv=require(_0xc350('0xf'));var querystring=require(_0xc350('0x10'));var Papa=require(_0xc350('0x11'));var Redis=require(_0xc350('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc350('0x13'));var as=require(_0xc350('0x14'));var hardwareService=require(_0xc350('0x15'));var logger=require(_0xc350('0x16'))(_0xc350('0x17'));var utils=require(_0xc350('0x18'));var config=require(_0xc350('0x19'));var licenseUtil=require(_0xc350('0x1a'));var db=require(_0xc350('0x1b'))['db'];function respondWithStatusCode(_0x3f687b,_0x3c2326){_0x3c2326=_0x3c2326||0xcc;return function(_0x26ccb2){if(_0x26ccb2){return _0x3f687b[_0xc350('0x1c')](_0x3c2326);}return _0x3f687b[_0xc350('0x1d')](_0x3c2326)[_0xc350('0x1e')]();};}function respondWithResult(_0x5a5b3f,_0x27499a){_0x27499a=_0x27499a||0xc8;return function(_0x7712e5){if(_0x7712e5){return _0x5a5b3f[_0xc350('0x1d')](_0x27499a)[_0xc350('0x1f')](_0x7712e5);}};}function respondWithFilteredResult(_0x243686,_0x3cda39){return function(_0x15071a){if(_0x15071a){var _0x5c649f=_0x15071a['count'],_0x5e8d48=_0x3cda39[_0xc350('0x20')],_0x564191=_0x3cda39[_0xc350('0x20')]+_0x3cda39[_0xc350('0x21')],_0x280c78;if(_0x564191>=_0x5c649f){_0x564191=_0x5c649f;_0x280c78=0xc8;}else{_0x280c78=0xce;}_0x243686['status'](_0x280c78);return _0x243686[_0xc350('0x22')](_0xc350('0x23'),_0x5e8d48+'-'+_0x564191+'/'+_0x5c649f)[_0xc350('0x1f')](_0x15071a);}return null;};}function patchUpdates(_0xbb2161){return function(_0x1a37a2){try{jsonpatch[_0xc350('0x24')](_0x1a37a2,_0xbb2161,!![]);}catch(_0x1e2236){return BPromise[_0xc350('0x25')](_0x1e2236);}return _0x1a37a2[_0xc350('0x26')]();};}function saveUpdates(_0x2bbe81,_0x3864a4){return function(_0x1992b5){if(_0x1992b5){return _0x1992b5[_0xc350('0x27')](_0x2bbe81)[_0xc350('0x28')](function(_0x52f84a){return _0x52f84a;});}return null;};}function removeEntity(_0x2c7ae1,_0x3b156a){return function(_0x35db61){if(_0x35db61){return _0x35db61[_0xc350('0x29')]()[_0xc350('0x28')](function(){_0x2c7ae1[_0xc350('0x1d')](0xcc)[_0xc350('0x1e')]();});}};}function handleEntityNotFound(_0x76b70,_0x58f57f){return function(_0xed77ea){if(!_0xed77ea){_0x76b70['sendStatus'](0x194);}return _0xed77ea;};}function handleError(_0x3394a8,_0x196614){_0x196614=_0x196614||0x1f4;return function(_0x540ead){logger[_0xc350('0x2a')](_0x540ead['stack']);if(_0x540ead[_0xc350('0x2b')]){delete _0x540ead[_0xc350('0x2b')];}_0x3394a8[_0xc350('0x1d')](_0x196614)[_0xc350('0x2c')](_0x540ead);};}exports[_0xc350('0x2d')]=function(_0x3802b4,_0x21938f){var _0x75fa34={},_0x3cb262={},_0x5c0212={'count':0x0,'rows':[]};var _0x1bddd4=_['map'](db[_0xc350('0x2e')][_0xc350('0x2f')],function(_0x2988b8){return{'name':_0x2988b8[_0xc350('0x30')],'type':_0x2988b8[_0xc350('0x31')][_0xc350('0x32')]};});_0x3cb262[_0xc350('0x33')]=_['map'](_0x1bddd4,_0xc350('0x2b'));_0x3cb262[_0xc350('0x34')]=_[_0xc350('0x35')](_0x3802b4['query']);_0x3cb262[_0xc350('0x36')]=_[_0xc350('0x37')](_0x3cb262[_0xc350('0x33')],_0x3cb262[_0xc350('0x34')]);_0x75fa34[_0xc350('0x38')]=_[_0xc350('0x37')](_0x3cb262[_0xc350('0x33')],qs[_0xc350('0x39')](_0x3802b4[_0xc350('0x34')]['fields']));_0x75fa34['attributes']=_0x75fa34[_0xc350('0x38')]['length']?_0x75fa34[_0xc350('0x38')]:_0x3cb262[_0xc350('0x33')];if(!_0x3802b4[_0xc350('0x34')][_0xc350('0x3a')](_0xc350('0x3b'))){_0x75fa34[_0xc350('0x21')]=qs['limit'](_0x3802b4[_0xc350('0x34')][_0xc350('0x21')]);_0x75fa34['offset']=qs[_0xc350('0x20')](_0x3802b4[_0xc350('0x34')][_0xc350('0x20')]);}_0x75fa34[_0xc350('0x3c')]=qs['sort'](_0x3802b4[_0xc350('0x34')][_0xc350('0x3d')]);_0x75fa34[_0xc350('0x3e')]=qs[_0xc350('0x36')](_[_0xc350('0x3f')](_0x3802b4[_0xc350('0x34')],_0x3cb262[_0xc350('0x36')]),_0x1bddd4);if(_0x3802b4[_0xc350('0x34')][_0xc350('0x40')]){_0x75fa34['where']=_[_0xc350('0x41')](_0x75fa34['where'],{'$or':_[_0xc350('0x42')](_0x1bddd4,function(_0x46a99b){if(_0x46a99b['type']!=='VIRTUAL'){var _0x13d385={};_0x13d385[_0x46a99b[_0xc350('0x2b')]]={'$like':'%'+_0x3802b4[_0xc350('0x34')][_0xc350('0x40')]+'%'};return _0x13d385;}})});}_0x75fa34=_[_0xc350('0x41')]({},_0x75fa34,_0x3802b4[_0xc350('0x43')]);var _0x2d2467={'where':_0x75fa34['where']};return db[_0xc350('0x2e')][_0xc350('0x44')](_0x2d2467)[_0xc350('0x28')](function(_0x32d09b){_0x5c0212[_0xc350('0x44')]=_0x32d09b;if(_0x3802b4['query'][_0xc350('0x45')]){_0x75fa34['include']=[{'all':!![]}];}return db[_0xc350('0x2e')][_0xc350('0x46')](_0x75fa34);})[_0xc350('0x28')](function(_0x12cb19){_0x5c0212[_0xc350('0x47')]=_0x12cb19;return _0x5c0212;})['then'](respondWithFilteredResult(_0x21938f,_0x75fa34))[_0xc350('0x48')](handleError(_0x21938f,null));};exports['show']=function(_0x560659,_0x17fd0b){var _0xbe33dd={'raw':!![],'where':{'id':_0x560659[_0xc350('0x49')]['id']}},_0x407cf2={};_0x407cf2[_0xc350('0x33')]=_['keys'](db['ChatTransferReport'][_0xc350('0x2f')]);_0x407cf2[_0xc350('0x34')]=_[_0xc350('0x35')](_0x560659[_0xc350('0x34')]);_0x407cf2[_0xc350('0x36')]=_[_0xc350('0x37')](_0x407cf2['model'],_0x407cf2['query']);_0xbe33dd['attributes']=_[_0xc350('0x37')](_0x407cf2[_0xc350('0x33')],qs[_0xc350('0x39')](_0x560659[_0xc350('0x34')]['fields']));_0xbe33dd[_0xc350('0x38')]=_0xbe33dd[_0xc350('0x38')][_0xc350('0x4a')]?_0xbe33dd[_0xc350('0x38')]:_0x407cf2[_0xc350('0x33')];if(_0x560659[_0xc350('0x34')][_0xc350('0x45')]){_0xbe33dd[_0xc350('0x4b')]=[{'all':!![]}];}_0xbe33dd=_['merge']({},_0xbe33dd,_0x560659[_0xc350('0x43')]);return db[_0xc350('0x2e')][_0xc350('0x4c')](_0xbe33dd)[_0xc350('0x28')](handleEntityNotFound(_0x17fd0b,null))['then'](respondWithResult(_0x17fd0b,null))[_0xc350('0x48')](handleError(_0x17fd0b,null));};exports[_0xc350('0x4d')]=function(_0x4c2cba,_0x2c8fa5){return db[_0xc350('0x2e')][_0xc350('0x4d')](_0x4c2cba[_0xc350('0x4e')],{})[_0xc350('0x28')](respondWithResult(_0x2c8fa5,0xc9))['catch'](handleError(_0x2c8fa5,null));};exports[_0xc350('0x27')]=function(_0x3b1744,_0x2319c3){if(_0x3b1744[_0xc350('0x4e')]['id']){delete _0x3b1744[_0xc350('0x4e')]['id'];}return db[_0xc350('0x2e')][_0xc350('0x4c')]({'where':{'id':_0x3b1744[_0xc350('0x49')]['id']}})[_0xc350('0x28')](handleEntityNotFound(_0x2319c3,null))[_0xc350('0x28')](saveUpdates(_0x3b1744[_0xc350('0x4e')],null))[_0xc350('0x28')](respondWithResult(_0x2319c3,null))[_0xc350('0x48')](handleError(_0x2319c3,null));};exports[_0xc350('0x29')]=function(_0x2905bb,_0x2bcebf){return db['ChatTransferReport'][_0xc350('0x4c')]({'where':{'id':_0x2905bb[_0xc350('0x49')]['id']}})[_0xc350('0x28')](handleEntityNotFound(_0x2bcebf,null))[_0xc350('0x28')](removeEntity(_0x2bcebf,null))['catch'](handleError(_0x2bcebf,null));};exports['describe']=function(_0x4fcefc,_0x2e3a33){return db['ChatTransferReport'][_0xc350('0x4f')]()['then'](respondWithResult(_0x2e3a33,null))[_0xc350('0x48')](handleError(_0x2e3a33,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 7ea4645..82ab305 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 _0xa711=['ChatTransferReport','report_chat_transfer','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x435ff1,_0x219988){var _0x531991=function(_0x57afda){while(--_0x57afda){_0x435ff1['push'](_0x435ff1['shift']());}};_0x531991(++_0x219988);}(_0xa711,0x6e));var _0x1a71=function(_0x88a94f,_0x3cd27d){_0x88a94f=_0x88a94f-0x0;var _0x4db244=_0xa711[_0x88a94f];return _0x4db244;};'use strict';var _=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var logger=require('../../config/logger')(_0x1a71('0x2'));var moment=require(_0x1a71('0x3'));var BPromise=require(_0x1a71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a71('0x5'));var rimraf=require(_0x1a71('0x6'));var config=require(_0x1a71('0x7'));var attributes=require(_0x1a71('0x8'));module['exports']=function(_0x43455c,_0x5501d6){return _0x43455c[_0x1a71('0x9')](_0x1a71('0xa'),attributes,{'tableName':_0x1a71('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a7a=['api','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x56b273,_0x23d8e2){var _0x3fcd07=function(_0x5655a){while(--_0x5655a){_0x56b273['push'](_0x56b273['shift']());}};_0x3fcd07(++_0x23d8e2);}(_0x6a7a,0x1ad));var _0xa6a7=function(_0x58067e,_0x16acce){_0x58067e=_0x58067e-0x0;var _0xfb88bd=_0x6a7a[_0x58067e];return _0xfb88bd;};'use strict';var _=require(_0xa6a7('0x0'));var util=require(_0xa6a7('0x1'));var logger=require(_0xa6a7('0x2'))(_0xa6a7('0x3'));var moment=require('moment');var BPromise=require(_0xa6a7('0x4'));var rp=require(_0xa6a7('0x5'));var fs=require('fs');var path=require(_0xa6a7('0x6'));var rimraf=require('rimraf');var config=require(_0xa6a7('0x7'));var attributes=require(_0xa6a7('0x8'));module[_0xa6a7('0x9')]=function(_0x56434e,_0x4f2375){return _0x56434e[_0xa6a7('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xa6a7('0xb'),'fields':[_0xa6a7('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index fb87d3a..fb37043 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 _0xc36a=['jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b9716,_0x5218e7){var _0x4a0917=function(_0x5798ec){while(--_0x5798ec){_0x3b9716['push'](_0x3b9716['shift']());}};_0x4a0917(++_0x5218e7);}(_0xc36a,0x1b0));var _0xac36=function(_0x5ec83b,_0x2190e1){_0x5ec83b=_0x5ec83b-0x0;var _0x1c5c08=_0xc36a[_0x5ec83b];return _0x1c5c08;};'use strict';var _=require(_0xac36('0x0'));var util=require('util');var moment=require(_0xac36('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac36('0x2'));var db=require(_0xac36('0x3'))['db'];var utils=require(_0xac36('0x4'));var logger=require(_0xac36('0x5'))(_0xac36('0x6'));var config=require(_0xac36('0x7'));var jayson=require(_0xac36('0x8'));var client=jayson[_0xac36('0x9')][_0xac36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xee0d05,_0x57cce1,_0xd462ae){return new BPromise(function(_0x36a6a3,_0x48a356){return client[_0xac36('0xb')](_0xee0d05,_0xd462ae)['then'](function(_0x107d2d){logger[_0xac36('0xc')](_0xac36('0xd'),_0x57cce1,_0xac36('0xe'));logger[_0xac36('0xf')](_0xac36('0x10'),_0x57cce1,_0xac36('0xe'),JSON[_0xac36('0x11')](_0x107d2d));if(_0x107d2d[_0xac36('0x12')]){if(_0x107d2d[_0xac36('0x12')][_0xac36('0x13')]===0x1f4){logger[_0xac36('0x12')](_0xac36('0xd'),_0x57cce1,_0x107d2d[_0xac36('0x12')][_0xac36('0x14')]);return _0x48a356(_0x107d2d[_0xac36('0x12')][_0xac36('0x14')]);}logger[_0xac36('0x12')](_0xac36('0xd'),_0x57cce1,_0x107d2d[_0xac36('0x12')]['message']);return _0x36a6a3(_0x107d2d[_0xac36('0x12')]['message']);}else{logger['info'](_0xac36('0xd'),_0x57cce1,_0xac36('0xe'));_0x36a6a3(_0x107d2d['result'][_0xac36('0x14')]);}})[_0xac36('0x15')](function(_0x54823f){logger[_0xac36('0x12')](_0xac36('0xd'),_0x57cce1,_0x54823f);_0x48a356(_0x54823f);});});}
\ No newline at end of file
+var _0xf915=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3dbd6d,_0x3ee9d7){var _0x1216f1=function(_0x27b7ad){while(--_0x27b7ad){_0x3dbd6d['push'](_0x3dbd6d['shift']());}};_0x1216f1(++_0x3ee9d7);}(_0xf915,0x6e));var _0x5f91=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf915[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5f91('0x0'));var util=require(_0x5f91('0x1'));var moment=require('moment');var BPromise=require(_0x5f91('0x2'));var rs=require(_0x5f91('0x3'));var fs=require('fs');var Redis=require(_0x5f91('0x4'));var db=require(_0x5f91('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f91('0x6'))(_0x5f91('0x7'));var config=require(_0x5f91('0x8'));var jayson=require(_0x5f91('0x9'));var client=jayson[_0x5f91('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42928e,_0xe9c58c,_0x3a88a5){return new BPromise(function(_0x1f70e0,_0x126dc9){return client[_0x5f91('0xb')](_0x42928e,_0x3a88a5)[_0x5f91('0xc')](function(_0x238553){logger[_0x5f91('0xd')](_0x5f91('0xe'),_0xe9c58c,_0x5f91('0xf'));logger[_0x5f91('0x10')](_0x5f91('0x11'),_0xe9c58c,_0x5f91('0xf'),JSON[_0x5f91('0x12')](_0x238553));if(_0x238553[_0x5f91('0x13')]){if(_0x238553['error'][_0x5f91('0x14')]===0x1f4){logger[_0x5f91('0x13')](_0x5f91('0xe'),_0xe9c58c,_0x238553[_0x5f91('0x13')][_0x5f91('0x15')]);return _0x126dc9(_0x238553[_0x5f91('0x13')][_0x5f91('0x15')]);}logger[_0x5f91('0x13')](_0x5f91('0xe'),_0xe9c58c,_0x238553['error'][_0x5f91('0x15')]);return _0x1f70e0(_0x238553['error']['message']);}else{logger[_0x5f91('0xd')](_0x5f91('0xe'),_0xe9c58c,_0x5f91('0xf'));_0x1f70e0(_0x238553[_0x5f91('0x16')][_0x5f91('0x15')]);}})['catch'](function(_0x2ffda9){logger[_0x5f91('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xe9c58c,_0x2ffda9);_0x126dc9(_0x2ffda9);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 7ce6a05..0b7c9f9 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(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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 _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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index ef25c0f..842f6f0 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 _0xbb36=['website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Skip','Feedback','star','thumb','stringify','input','text','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x4a1320,_0x54a777){var _0xa824b0=function(_0xa52354){while(--_0xa52354){_0x4a1320['push'](_0x4a1320['shift']());}};_0xa824b0(++_0x54a777);}(_0xbb36,0x92));var _0x6bb3=function(_0x8f6832,_0x280948){_0x8f6832=_0x8f6832-0x0;var _0x50f773=_0xbb36[_0x8f6832];return _0x50f773;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6bb3('0x0'));module[_0x6bb3('0x1')]={'name':{'type':Sequelize[_0x6bb3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x6bb3('0x2')],'allowNull':![],'unique':_0x6bb3('0x3')},'description':{'type':Sequelize[_0x6bb3('0x2')]},'mapKey':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x6bb3('0x4')},'key':{'type':Sequelize[_0x6bb3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x5')},'customerAlias':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6bb3('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6bb3('0x2')],'allowNull':![],'defaultValue':_0x6bb3('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6bb3('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6bb3('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6bb3('0x9')](_0x6bb3('0xa'),_0x6bb3('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6bb3('0xc')},'header_offline':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0xd')},'download_transcript':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6bb3('0xe')]},'closingQuestion':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6bb3('0x10')},'noteTitle':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x11')},'placeholderMessage':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0xc')},'skipMessageButton':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x12')},'conditionAgreement':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6bb3('0x13')},'ratingType':{'type':Sequelize[_0x6bb3('0x9')](_0x6bb3('0x14'),_0x6bb3('0x15')),'defaultValue':_0x6bb3('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x6bb3('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6bb3('0xe')],'defaultValue':function(){return JSON[_0x6bb3('0x16')]({'items':[{'type':_0x6bb3('0x17'),'variable':null,'config':{'placeholder':'name','type':_0x6bb3('0x18'),'required':!![]},'props':{'title':_0x6bb3('0x19'),'helpText':''}},{'type':_0x6bb3('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6bb3('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6bb3('0x1a')]('onlineForm')?JSON[_0x6bb3('0x1b')](this[_0x6bb3('0x1a')](_0x6bb3('0x1c'))):{};},'set':function(_0x535494){return this[_0x6bb3('0x1d')](_0x6bb3('0x1c'),JSON[_0x6bb3('0x16')](_0x535494));}},'offlineForm':{'type':Sequelize[_0x6bb3('0xe')],'defaultValue':function(){return JSON[_0x6bb3('0x16')]({'items':[{'type':_0x6bb3('0x17'),'props':{'title':_0x6bb3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6bb3('0x4')},'variable':null},{'type':_0x6bb3('0x1e'),'config':{'placeholder':_0x6bb3('0x1f')},'props':{'title':'Comments','helpText':_0x6bb3('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6bb3('0x21'))?JSON[_0x6bb3('0x1b')](this[_0x6bb3('0x1a')](_0x6bb3('0x21'))):{};},'set':function(_0x5876a7){return this[_0x6bb3('0x1d')](_0x6bb3('0x21'),JSON[_0x6bb3('0x16')](_0x5876a7));}},'token':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6bb3('0x2')]},'forwardOffline':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6bb3('0x2')]},'waitingTitle':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x22')},'waitingMessage':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x12')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6bb3('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6bb3('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6bb3('0x25');}},'notificationSound':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x26')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x27')},'verticalAlignment':{'type':Sequelize[_0x6bb3('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x28')},'defaultTitle':{'type':Sequelize[_0x6bb3('0x2')]},'customerAvatar':{'type':Sequelize[_0x6bb3('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6bb3('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6bb3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6bb3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':_0x6bb3('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6bb3('0x7')],'comment':_0x6bb3('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x6bb3('0x8')],'defaultValue':![],'comment':_0x6bb3('0x2b'),'set':function(_0x1c57bc){if(!_0x1c57bc)this['setDataValue'](_0x6bb3('0x2c'),null);this[_0x6bb3('0x1d')](_0x6bb3('0x2d'),_0x1c57bc);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6bb3('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x96aa=['Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','star','TEXT','input','name','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x26e424,_0xfcf210){var _0x2c81d6=function(_0x58feef){while(--_0x58feef){_0x26e424['push'](_0x26e424['shift']());}};_0x2c81d6(++_0xfcf210);}(_0x96aa,0x67));var _0xa96a=function(_0x41ee7a,_0x2f9689){_0x41ee7a=_0x41ee7a-0x0;var _0x41f6ab=_0x96aa[_0x41ee7a];return _0x41f6ab;};'use strict';var Sequelize=require(_0xa96a('0x0'));var rs=require(_0xa96a('0x1'));module['exports']={'name':{'type':Sequelize[_0xa96a('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa96a('0x2')],'allowNull':![],'unique':_0xa96a('0x3')},'description':{'type':Sequelize[_0xa96a('0x2')]},'mapKey':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x5')},'customerAlias':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa96a('0x2')],'allowNull':![],'defaultValue':_0xa96a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa96a('0x2')],'allowNull':![],'defaultValue':_0xa96a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa96a('0x2')],'allowNull':![],'defaultValue':_0xa96a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa96a('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa96a('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa96a('0x9')]('rounded',_0xa96a('0xa')),'defaultValue':_0xa96a('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa96a('0xc')},'start_chat_button':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0xd')},'offline_chat_button':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0xe')},'header_offline':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0xf')},'download_transcript':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa96a('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa96a('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa96a('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa96a('0x14')},'noteTitle':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x15')},'placeholderMessage':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x16')},'closingMessage':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa96a('0x17')},'conditionAgreement':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x18')},'ratingType':{'type':Sequelize[_0xa96a('0x9')](_0xa96a('0x19'),'thumb'),'defaultValue':_0xa96a('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa96a('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa96a('0x1b'),'variable':null,'config':{'placeholder':_0xa96a('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa96a('0x1b'),'props':{'title':_0xa96a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa96a('0x4'),'type':_0xa96a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa96a('0x1d')](_0xa96a('0x1e'))?JSON['parse'](this['getDataValue'](_0xa96a('0x1e'))):{};},'set':function(_0x5916af){return this[_0xa96a('0x1f')](_0xa96a('0x1e'),JSON[_0xa96a('0x20')](_0x5916af));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa96a('0x20')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa96a('0x4'),'type':'email'},'variable':null},{'type':_0xa96a('0x21'),'config':{'placeholder':_0xa96a('0x22')},'props':{'title':_0xa96a('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xa96a('0x1d')]('offlineForm')?JSON['parse'](this[_0xa96a('0x1d')]('offlineForm')):{};},'set':function(_0x585af1){return this[_0xa96a('0x1f')](_0xa96a('0x23'),JSON['stringify'](_0x585af1));}},'token':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':function(){return rs[_0xa96a('0x24')]();}},'autoclose':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa96a('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa96a('0x25')},'waitingMessage':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x27')},'offlineMessageBody':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x29')},'skipUnmanaged':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x17')},'sendUnmanaged':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa96a('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa96a('0x1a')],'defaultValue':function(){return _0xa96a('0x2a');}},'notificationSound':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa96a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x2c')},'verticalAlignment':{'type':Sequelize[_0xa96a('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa96a('0x2')]},'customerAvatar':{'type':Sequelize[_0xa96a('0x1a')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa96a('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa96a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa96a('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa96a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':_0xa96a('0x2d')},'systemAvatar':{'type':Sequelize[_0xa96a('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa96a('0x8')],'comment':_0xa96a('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa96a('0x2f'),'set':function(_0xc02bee){if(!_0xc02bee)this[_0xa96a('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xc02bee);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 3eadb98..9cd0563 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 _0x5d1b=['user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','lastName','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','CompanyId','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','server/files/templates/chatOfflineMessage.ejs','render','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','addInteraction','ids','Contact','Owner','fullname','internal','Tag','color','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','referer','alignment','verticalAlignment','textColor','transaction','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','omit','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatWebsite.socket','jayson/promise','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','getDispositions','findOne','Disposition','rawAttributes','hasOwnProperty','pick','merge','removeDispositions','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','notify','user-agent-parser','setUA'];(function(_0x56c3eb,_0x5230c6){var _0x518779=function(_0x383c91){while(--_0x383c91){_0x56c3eb['push'](_0x56c3eb['shift']());}};_0x518779(++_0x5230c6);}(_0x5d1b,0x91));var _0xb5d1=function(_0x183a26,_0x19e750){_0x183a26=_0x183a26-0x0;var _0xd92d3e=_0x5d1b[_0x183a26];return _0xd92d3e;};'use strict';var pdf=require(_0xb5d1('0x0'));var emlformat=require(_0xb5d1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb5d1('0x3'));var BPromise=require(_0xb5d1('0x4'));var Mustache=require(_0xb5d1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb5d1('0x6'));var ejs=require(_0xb5d1('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb5d1('0x8'));var crypto=require('crypto');var jsforce=require(_0xb5d1('0x9'));var deskjs=require(_0xb5d1('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb5d1('0xb'));var Papa=require(_0xb5d1('0xc'));var Redis=require(_0xb5d1('0xd'));var authService=require(_0xb5d1('0xe'));var qs=require(_0xb5d1('0xf'));var as=require(_0xb5d1('0x10'));var hardwareService=require(_0xb5d1('0x11'));var logger=require(_0xb5d1('0x12'))(_0xb5d1('0x13'));var utils=require(_0xb5d1('0x14'));var config=require(_0xb5d1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5d1('0x16'))['db'];config[_0xb5d1('0x17')]=_[_0xb5d1('0x18')](config[_0xb5d1('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5d1('0x17')]));require(_0xb5d1('0x19'))['register'](socket);var jayson=require(_0xb5d1('0x1a'));var client=jayson[_0xb5d1('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0xb5d1('0x1c')]({'port':0x232a});var client9003=jayson['client'][_0xb5d1('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x1aa60b,_0x229864,_0x1523f8,_0x468f87){return new BPromise(function(_0x3fafaf,_0x5af7e3){var _0x3061cb=_0x468f87||client;return _0x3061cb['request'](_0x1aa60b,_0x1523f8)['then'](function(_0x496515){logger[_0xb5d1('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x229864,_0xb5d1('0x1e'));logger[_0xb5d1('0x1f')](_0xb5d1('0x20'),_0x229864,'request\x20sent',JSON[_0xb5d1('0x21')](_0x496515));if(_0x496515[_0xb5d1('0x22')]){if(_0x496515['error'][_0xb5d1('0x23')]===0x1f4){logger[_0xb5d1('0x22')](_0xb5d1('0x24'),_0x229864,_0x496515[_0xb5d1('0x22')]['message']);return _0x5af7e3(_0x496515[_0xb5d1('0x22')][_0xb5d1('0x25')]);}logger[_0xb5d1('0x22')](_0xb5d1('0x24'),_0x229864,_0x496515['error'][_0xb5d1('0x25')]);return _0x3fafaf(_0x496515[_0xb5d1('0x22')][_0xb5d1('0x25')]);}else{logger[_0xb5d1('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x229864,_0xb5d1('0x1e'));_0x3fafaf(_0x496515[_0xb5d1('0x26')]['message']);}})['catch'](function(_0xc7377b){logger[_0xb5d1('0x22')](_0xb5d1('0x24'),_0x229864,_0xc7377b);_0x5af7e3(_0xc7377b);});});}function respondWithStatusCode(_0x3ac67a,_0x36ddc3){_0x36ddc3=_0x36ddc3||0xcc;return function(_0x4d5bb1){if(_0x4d5bb1){return _0x3ac67a['sendStatus'](_0x36ddc3);}return _0x3ac67a[_0xb5d1('0x27')](_0x36ddc3)[_0xb5d1('0x28')]();};}function respondWithResult(_0x1dcb0c,_0x5b35ee){_0x5b35ee=_0x5b35ee||0xc8;return function(_0x4a36ae){if(_0x4a36ae){return _0x1dcb0c[_0xb5d1('0x27')](_0x5b35ee)[_0xb5d1('0x29')](_0x4a36ae);}};}function respondWithFilteredResult(_0x55cd8e,_0x4d9a68){return function(_0x6cebde){if(_0x6cebde){var _0x386d01=_0x6cebde[_0xb5d1('0x2a')],_0x39d118=_0x4d9a68[_0xb5d1('0x2b')],_0x2231f7=_0x4d9a68[_0xb5d1('0x2b')]+_0x4d9a68[_0xb5d1('0x2c')],_0x2d4631;if(_0x2231f7>=_0x386d01){_0x2231f7=_0x386d01;_0x2d4631=0xc8;}else{_0x2d4631=0xce;}_0x55cd8e['status'](_0x2d4631);return _0x55cd8e[_0xb5d1('0x2d')](_0xb5d1('0x2e'),_0x39d118+'-'+_0x2231f7+'/'+_0x386d01)[_0xb5d1('0x29')](_0x6cebde);}return null;};}function patchUpdates(_0x4e58da){return function(_0x5d6ca7){try{jsonpatch['apply'](_0x5d6ca7,_0x4e58da,!![]);}catch(_0x5aa1b4){return BPromise['reject'](_0x5aa1b4);}return _0x5d6ca7[_0xb5d1('0x2f')]();};}function saveUpdates(_0x4eb712,_0x58f301){return function(_0x493598){if(_0x493598){return _0x493598[_0xb5d1('0x30')](_0x4eb712)[_0xb5d1('0x31')](function(_0x30f53d){return _0x30f53d;});}return null;};}function removeEntity(_0x42c89b,_0x1687ce){return function(_0x3541d7){if(_0x3541d7){return _0x3541d7[_0xb5d1('0x32')]()[_0xb5d1('0x31')](function(){var _0x1cd88b=_0x3541d7['get']({'plain':!![]});var _0x19140b='ChatWebsites';return db[_0xb5d1('0x33')][_0xb5d1('0x32')]({'where':{'type':_0x19140b,'resourceId':_0x1cd88b['id']}})['then'](function(){return _0x3541d7;});})[_0xb5d1('0x31')](function(){_0x42c89b[_0xb5d1('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x343630,_0x20445c){return function(_0x1b13f9){if(!_0x1b13f9){_0x343630[_0xb5d1('0x34')](0x194);}return _0x1b13f9;};}function handleError(_0x5aa386,_0xc4a7c){_0xc4a7c=_0xc4a7c||0x1f4;return function(_0x13b1a4){logger['error'](_0x13b1a4[_0xb5d1('0x35')]);if(_0x13b1a4[_0xb5d1('0x36')]){delete _0x13b1a4[_0xb5d1('0x36')];}_0x5aa386['status'](_0xc4a7c)[_0xb5d1('0x37')](_0x13b1a4);};}exports[_0xb5d1('0x38')]=function(_0x2cd1fc,_0x571f48){var _0x207f29={'include':[{'model':db[_0xb5d1('0x39')],'as':_0xb5d1('0x3a')}]},_0x44eb1a={},_0xec42c={'count':0x0,'rows':[]};var _0x338d45=_[_0xb5d1('0x3b')](db[_0xb5d1('0x3c')]['rawAttributes'],function(_0x3d875a){return{'name':_0x3d875a[_0xb5d1('0x3d')],'type':_0x3d875a[_0xb5d1('0x3e')][_0xb5d1('0x3f')]};});_0x44eb1a[_0xb5d1('0x40')]=_[_0xb5d1('0x3b')](_0x338d45,'name');_0x44eb1a['query']=_['keys'](_0x2cd1fc[_0xb5d1('0x41')]);_0x44eb1a[_0xb5d1('0x42')]=_[_0xb5d1('0x43')](_0x44eb1a[_0xb5d1('0x40')],_0x44eb1a[_0xb5d1('0x41')]);_0x207f29[_0xb5d1('0x44')]=_['intersection'](_0x44eb1a[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x2cd1fc[_0xb5d1('0x41')][_0xb5d1('0x45')]));_0x207f29['attributes']=_0x207f29[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x207f29[_0xb5d1('0x44')]:_0x44eb1a[_0xb5d1('0x40')];if(!_0x2cd1fc['query']['hasOwnProperty'](_0xb5d1('0x47'))){_0x207f29[_0xb5d1('0x2c')]=qs[_0xb5d1('0x2c')](_0x2cd1fc[_0xb5d1('0x41')][_0xb5d1('0x2c')]);_0x207f29[_0xb5d1('0x2b')]=qs[_0xb5d1('0x2b')](_0x2cd1fc[_0xb5d1('0x41')][_0xb5d1('0x2b')]);}_0x207f29[_0xb5d1('0x48')]=qs['sort'](_0x2cd1fc['query'][_0xb5d1('0x49')]);_0x207f29['where']=qs[_0xb5d1('0x42')](_['pick'](_0x2cd1fc[_0xb5d1('0x41')],_0x44eb1a[_0xb5d1('0x42')]),_0x338d45);if(_0x2cd1fc[_0xb5d1('0x41')][_0xb5d1('0x4a')]){_0x207f29[_0xb5d1('0x4b')]=_['merge'](_0x207f29[_0xb5d1('0x4b')],{'$or':_[_0xb5d1('0x3b')](_0x338d45,function(_0x52dc31){if(_0x52dc31['type']!=='VIRTUAL'){var _0x40d5a6={};_0x40d5a6[_0x52dc31[_0xb5d1('0x36')]]={'$like':'%'+_0x2cd1fc[_0xb5d1('0x41')][_0xb5d1('0x4a')]+'%'};return _0x40d5a6;}})});}_0x207f29=_['merge']({},_0x207f29,_0x2cd1fc[_0xb5d1('0x4c')]);var _0xe40f68={'where':_0x207f29[_0xb5d1('0x4b')]};return db['ChatWebsite']['count'](_0xe40f68)['then'](function(_0x332048){_0xec42c['count']=_0x332048;if(_0x2cd1fc[_0xb5d1('0x41')][_0xb5d1('0x4d')]){_0x207f29['include']=[{'all':!![]}];}return db[_0xb5d1('0x3c')][_0xb5d1('0x4e')](_0x207f29);})[_0xb5d1('0x31')](function(_0x2a2a51){_0xec42c[_0xb5d1('0x4f')]=_0x2a2a51;return _0xec42c;})['then'](respondWithFilteredResult(_0x571f48,_0x207f29))[_0xb5d1('0x50')](handleError(_0x571f48,null));};exports[_0xb5d1('0x51')]=function(_0x2681e7,_0x551601){var _0x38463e={'raw':![],'where':{'id':_0x2681e7[_0xb5d1('0x52')]['id']},'include':[{'model':db[_0xb5d1('0x39')],'as':_0xb5d1('0x3a')}]},_0x2f9af0={};_0x2f9af0['model']=_[_0xb5d1('0x53')](db[_0xb5d1('0x3c')]['rawAttributes']);_0x2f9af0['query']=_[_0xb5d1('0x53')](_0x2681e7[_0xb5d1('0x41')]);_0x2f9af0[_0xb5d1('0x42')]=_[_0xb5d1('0x43')](_0x2f9af0[_0xb5d1('0x40')],_0x2f9af0[_0xb5d1('0x41')]);_0x38463e[_0xb5d1('0x44')]=_[_0xb5d1('0x43')](_0x2f9af0[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x2681e7[_0xb5d1('0x41')][_0xb5d1('0x45')]));_0x38463e[_0xb5d1('0x44')]=_0x38463e[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x38463e[_0xb5d1('0x44')]:_0x2f9af0[_0xb5d1('0x40')];if(_0x2681e7[_0xb5d1('0x41')][_0xb5d1('0x4d')]){_0x38463e[_0xb5d1('0x54')]=[{'all':!![]}];}_0x38463e=_['merge']({},_0x38463e,_0x2681e7[_0xb5d1('0x4c')]);return db['ChatWebsite'][_0xb5d1('0x55')](_0x38463e)['then'](handleEntityNotFound(_0x551601,null))['then'](respondWithResult(_0x551601,null))[_0xb5d1('0x50')](handleError(_0x551601,null));};exports[_0xb5d1('0x56')]=function(_0x1438ad,_0x15234c){return db[_0xb5d1('0x3c')]['create'](_0x1438ad[_0xb5d1('0x57')],{})[_0xb5d1('0x31')](function(_0x4b62a4){var _0x2c5556=_0x1438ad[_0xb5d1('0x58')][_0xb5d1('0x59')]({'plain':!![]});if(!_0x2c5556)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c5556[_0xb5d1('0x5a')]===_0xb5d1('0x58')){var _0xcb6175=_0x4b62a4[_0xb5d1('0x59')]({'plain':!![]});var _0x4870bb='ChatWebsites';return db[_0xb5d1('0x5b')][_0xb5d1('0x55')]({'where':{'name':_0x4870bb,'userProfileId':_0x2c5556[_0xb5d1('0x5c')]},'raw':!![]})['then'](function(_0x198719){if(_0x198719&&_0x198719['autoAssociation']===0x0){return db[_0xb5d1('0x33')][_0xb5d1('0x56')]({'name':_0xcb6175[_0xb5d1('0x36')],'resourceId':_0xcb6175['id'],'type':_0x198719[_0xb5d1('0x36')],'sectionId':_0x198719['id']},{})['then'](function(){return _0x4b62a4;});}else{return _0x4b62a4;}})[_0xb5d1('0x50')](function(_0x436106){logger[_0xb5d1('0x22')](_0xb5d1('0x5d'),_0x436106);throw _0x436106;});}return _0x4b62a4;})[_0xb5d1('0x31')](respondWithResult(_0x15234c,0xc9))[_0xb5d1('0x50')](handleError(_0x15234c,null));};exports[_0xb5d1('0x30')]=function(_0x47fefb,_0x4714d6){if(_0x47fefb[_0xb5d1('0x57')]['id']){delete _0x47fefb[_0xb5d1('0x57')]['id'];}return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x47fefb[_0xb5d1('0x52')]['id']},'include':[{'model':db[_0xb5d1('0x39')],'as':_0xb5d1('0x3a')}]})['then'](handleEntityNotFound(_0x4714d6,null))[_0xb5d1('0x31')](saveUpdates(_0x47fefb[_0xb5d1('0x57')],null))[_0xb5d1('0x31')](respondWithResult(_0x4714d6,null))[_0xb5d1('0x50')](handleError(_0x4714d6,null));};exports[_0xb5d1('0x32')]=function(_0xa84d23,_0x269a73){return db[_0xb5d1('0x3c')]['find']({'where':{'id':_0xa84d23['params']['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x269a73,null))[_0xb5d1('0x31')](removeEntity(_0x269a73,null))[_0xb5d1('0x50')](handleError(_0x269a73,null));};exports[_0xb5d1('0x5e')]=function(_0x99722d,_0x1468c6){return db[_0xb5d1('0x3c')]['describe']()[_0xb5d1('0x31')](respondWithResult(_0x1468c6,null))[_0xb5d1('0x50')](handleError(_0x1468c6,null));};exports['addDisposition']=function(_0xc2fb7b,_0x1a99ca,_0x598890){if(_0xc2fb7b['body']['id']){delete _0xc2fb7b[_0xb5d1('0x57')]['id'];}return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0xc2fb7b[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x1a99ca,null))[_0xb5d1('0x31')](function(_0xb9e359){if(_0xb9e359){_0xc2fb7b['body'][_0xb5d1('0x5f')]=_0xb9e359['id'];return db['Disposition']['create'](_0xc2fb7b['body']);}})[_0xb5d1('0x31')](respondWithResult(_0x1a99ca,null))['catch'](handleError(_0x1a99ca,null));};exports[_0xb5d1('0x60')]=function(_0x1a96a5,_0x2b1bb4,_0x563bf4){var _0x3c9a53={'raw':![],'where':{}};var _0x1ad100={};var _0xd585d2={'count':0x0,'rows':[]};return db[_0xb5d1('0x3c')][_0xb5d1('0x61')]({'where':{'id':_0x1a96a5[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x2b1bb4,null))[_0xb5d1('0x31')](function(_0x31eed9){if(_0x31eed9){_0x1ad100[_0xb5d1('0x40')]=_[_0xb5d1('0x53')](db[_0xb5d1('0x62')][_0xb5d1('0x63')]);_0x1ad100[_0xb5d1('0x41')]=_[_0xb5d1('0x53')](_0x1a96a5[_0xb5d1('0x41')]);_0x1ad100[_0xb5d1('0x42')]=_['intersection'](_0x1ad100[_0xb5d1('0x40')],_0x1ad100[_0xb5d1('0x41')]);_0x3c9a53['attributes']=_[_0xb5d1('0x43')](_0x1ad100[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x1a96a5[_0xb5d1('0x41')][_0xb5d1('0x45')]));_0x3c9a53[_0xb5d1('0x44')]=_0x3c9a53[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x3c9a53['attributes']:_0x1ad100[_0xb5d1('0x40')];if(!_0x1a96a5['query'][_0xb5d1('0x64')](_0xb5d1('0x47'))){_0x3c9a53[_0xb5d1('0x2c')]=qs['limit'](_0x1a96a5['query'][_0xb5d1('0x2c')]);_0x3c9a53[_0xb5d1('0x2b')]=qs['offset'](_0x1a96a5[_0xb5d1('0x41')][_0xb5d1('0x2b')]);}_0x3c9a53[_0xb5d1('0x48')]=qs[_0xb5d1('0x49')](_0x1a96a5[_0xb5d1('0x41')][_0xb5d1('0x49')]);_0x3c9a53[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_[_0xb5d1('0x65')](_0x1a96a5[_0xb5d1('0x41')],_0x1ad100[_0xb5d1('0x42')]));_0x3c9a53[_0xb5d1('0x4b')][_0xb5d1('0x5f')]=_0x31eed9['id'];if(_0x1a96a5[_0xb5d1('0x41')][_0xb5d1('0x4a')]){_0x3c9a53[_0xb5d1('0x4b')]=_[_0xb5d1('0x66')](_0x3c9a53[_0xb5d1('0x4b')],{'$or':_[_0xb5d1('0x3b')](_0x3c9a53[_0xb5d1('0x44')],function(_0x25c2cb){var _0x4b9ef5={};_0x4b9ef5[_0x25c2cb]={'$like':'%'+_0x1a96a5[_0xb5d1('0x41')][_0xb5d1('0x4a')]+'%'};return _0x4b9ef5;})});}_0x3c9a53=_[_0xb5d1('0x66')]({},_0x3c9a53,_0x1a96a5[_0xb5d1('0x4c')]);return db[_0xb5d1('0x62')][_0xb5d1('0x2a')]({'where':_0x3c9a53[_0xb5d1('0x4b')]})['then'](function(_0xa89bb0){_0xd585d2[_0xb5d1('0x2a')]=_0xa89bb0;if(_0x1a96a5['query'][_0xb5d1('0x4d')]){_0x3c9a53[_0xb5d1('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xb5d1('0x4e')](_0x3c9a53);})[_0xb5d1('0x31')](function(_0x50ac77){_0xd585d2[_0xb5d1('0x4f')]=_0x50ac77;return _0xd585d2;});}})[_0xb5d1('0x31')](respondWithFilteredResult(_0x2b1bb4,_0x3c9a53))[_0xb5d1('0x50')](handleError(_0x2b1bb4,null));};exports[_0xb5d1('0x67')]=function(_0x3786fb,_0x53cfd3,_0x4bc178){return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x3786fb[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x53cfd3,null))[_0xb5d1('0x31')](function(_0x75a697){if(_0x75a697){return _0x75a697['removeDispositions'](_0x3786fb[_0xb5d1('0x41')]['ids']);}})[_0xb5d1('0x31')](respondWithStatusCode(_0x53cfd3,null))[_0xb5d1('0x50')](handleError(_0x53cfd3,null));};exports['addAnswer']=function(_0x4befc4,_0x390cd5,_0x3a0451){if(_0x4befc4[_0xb5d1('0x57')]['id']){delete _0x4befc4[_0xb5d1('0x57')]['id'];}return db[_0xb5d1('0x3c')]['find']({'where':{'id':_0x4befc4['params']['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x390cd5,null))[_0xb5d1('0x31')](function(_0x4c658f){if(_0x4c658f){_0x4befc4[_0xb5d1('0x57')]['ChatWebsiteId']=_0x4c658f['id'];return db[_0xb5d1('0x68')][_0xb5d1('0x56')](_0x4befc4[_0xb5d1('0x57')]);}})['then'](respondWithResult(_0x390cd5,null))[_0xb5d1('0x50')](handleError(_0x390cd5,null));};exports[_0xb5d1('0x69')]=function(_0x1e2266,_0x60059f,_0x40e909){var _0x5c21c1={'raw':![],'where':{}};var _0x303d08={};var _0x2b3e7d={'count':0x0,'rows':[]};return db[_0xb5d1('0x3c')]['findOne']({'where':{'id':_0x1e2266[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x60059f,null))[_0xb5d1('0x31')](function(_0x5c3550){if(_0x5c3550){_0x303d08['model']=_['keys'](db['CannedAnswer'][_0xb5d1('0x63')]);_0x303d08['query']=_['keys'](_0x1e2266[_0xb5d1('0x41')]);_0x303d08[_0xb5d1('0x42')]=_[_0xb5d1('0x43')](_0x303d08[_0xb5d1('0x40')],_0x303d08[_0xb5d1('0x41')]);_0x5c21c1[_0xb5d1('0x44')]=_[_0xb5d1('0x43')](_0x303d08[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x1e2266[_0xb5d1('0x41')]['fields']));_0x5c21c1['attributes']=_0x5c21c1[_0xb5d1('0x44')]['length']?_0x5c21c1[_0xb5d1('0x44')]:_0x303d08['model'];if(!_0x1e2266[_0xb5d1('0x41')]['hasOwnProperty']('nolimit')){_0x5c21c1[_0xb5d1('0x2c')]=qs[_0xb5d1('0x2c')](_0x1e2266[_0xb5d1('0x41')][_0xb5d1('0x2c')]);_0x5c21c1[_0xb5d1('0x2b')]=qs[_0xb5d1('0x2b')](_0x1e2266[_0xb5d1('0x41')][_0xb5d1('0x2b')]);}_0x5c21c1[_0xb5d1('0x48')]=qs['sort'](_0x1e2266['query'][_0xb5d1('0x49')]);_0x5c21c1[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_[_0xb5d1('0x65')](_0x1e2266[_0xb5d1('0x41')],_0x303d08[_0xb5d1('0x42')]));_0x5c21c1[_0xb5d1('0x4b')][_0xb5d1('0x5f')]=_0x5c3550['id'];if(_0x1e2266[_0xb5d1('0x41')][_0xb5d1('0x4a')]){_0x5c21c1[_0xb5d1('0x4b')]=_['merge'](_0x5c21c1[_0xb5d1('0x4b')],{'$or':_[_0xb5d1('0x3b')](_0x5c21c1[_0xb5d1('0x44')],function(_0xfffaec){var _0x527512={};_0x527512[_0xfffaec]={'$like':'%'+_0x1e2266[_0xb5d1('0x41')][_0xb5d1('0x4a')]+'%'};return _0x527512;})});}_0x5c21c1=_[_0xb5d1('0x66')]({},_0x5c21c1,_0x1e2266[_0xb5d1('0x4c')]);return db[_0xb5d1('0x68')]['count']({'where':_0x5c21c1['where']})[_0xb5d1('0x31')](function(_0x2cef42){_0x2b3e7d['count']=_0x2cef42;if(_0x1e2266[_0xb5d1('0x41')]['includeAll']){_0x5c21c1[_0xb5d1('0x54')]=[{'all':!![]}];}return db[_0xb5d1('0x68')][_0xb5d1('0x4e')](_0x5c21c1);})['then'](function(_0x8b4bf7){_0x2b3e7d[_0xb5d1('0x4f')]=_0x8b4bf7;return _0x2b3e7d;});}})['then'](respondWithFilteredResult(_0x60059f,_0x5c21c1))[_0xb5d1('0x50')](handleError(_0x60059f,null));};exports[_0xb5d1('0x6a')]=function(_0x2c82f3,_0x36953f,_0x16c894){return db[_0xb5d1('0x3c')]['find']({'where':{'id':_0x2c82f3['params']['id']}})['then'](handleEntityNotFound(_0x36953f,null))[_0xb5d1('0x31')](function(_0xf411cf){if(_0xf411cf){return _0xf411cf[_0xb5d1('0x6a')](_0x2c82f3[_0xb5d1('0x41')]['ids']);}})[_0xb5d1('0x31')](respondWithStatusCode(_0x36953f,null))[_0xb5d1('0x50')](handleError(_0x36953f,null));};exports[_0xb5d1('0x6b')]=function(_0x874a02,_0x42a2ba,_0x4254a2){_0x874a02[_0xb5d1('0x57')]['sitepic']=_0x874a02[_0xb5d1('0x6c')][_0xb5d1('0x6d')];return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x874a02[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x42a2ba,null))['then'](saveUpdates(_0x874a02['body'],null))[_0xb5d1('0x31')](respondWithResult(_0x42a2ba,null))[_0xb5d1('0x50')](handleError(_0x42a2ba,null));};exports[_0xb5d1('0x6e')]=function(_0x229192,_0x40f7a4,_0x53e985){_0x229192[_0xb5d1('0x57')][_0xb5d1('0x6f')]=_0x229192[_0xb5d1('0x6c')][_0xb5d1('0x6d')];return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x229192[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x40f7a4,null))['then'](saveUpdates(_0x229192['body'],null))['then'](respondWithResult(_0x40f7a4,null))['catch'](handleError(_0x40f7a4,null));};exports[_0xb5d1('0x70')]=function(_0xf32f,_0x62c697,_0x3204d3){_0xf32f['body'][_0xb5d1('0x71')]=_0xf32f['file'][_0xb5d1('0x6d')];return db['ChatWebsite'][_0xb5d1('0x55')]({'where':{'id':_0xf32f['params']['id']}})['then'](handleEntityNotFound(_0x62c697,null))[_0xb5d1('0x31')](saveUpdates(_0xf32f[_0xb5d1('0x57')],null))['then'](respondWithResult(_0x62c697,null))['catch'](handleError(_0x62c697,null));};exports[_0xb5d1('0x72')]=function(_0x4b4bf8,_0x130668,_0xee5d9f){_0x4b4bf8[_0xb5d1('0x57')][_0xb5d1('0x73')]=_0x4b4bf8[_0xb5d1('0x6c')][_0xb5d1('0x6d')];return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x4b4bf8[_0xb5d1('0x52')]['id']}})['then'](handleEntityNotFound(_0x130668,null))['then'](saveUpdates(_0x4b4bf8['body'],null))[_0xb5d1('0x31')](respondWithResult(_0x130668,null))['catch'](handleError(_0x130668,null));};exports[_0xb5d1('0x74')]=function(_0x175f72,_0x30a85f,_0x51bd07){var _0x34a112=path['join'](config[_0xb5d1('0x75')],_0xb5d1('0x76'));var _0x10bded={'where':{'id':_0x175f72[_0xb5d1('0x52')]['id']},'attributes':['id',_0xb5d1('0x77')],'raw':!![]};var _0x2b6bd4=![];return require(_0xb5d1('0x78'))[_0xb5d1('0x79')]()[_0xb5d1('0x31')](function(_0x49d2cc){if(_0x49d2cc){_0x2b6bd4=_0x49d2cc['custom'];}})[_0xb5d1('0x31')](function(){return db[_0xb5d1('0x3c')][_0xb5d1('0x55')](_0x10bded);})[_0xb5d1('0x31')](handleEntityNotFound(_0x30a85f,null))['then'](function(_0x32e8b9){if(_0x32e8b9){if(!_[_0xb5d1('0x7a')](_0x32e8b9[_0xb5d1('0x77')])){if(fs[_0xb5d1('0x7b')](path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],'server/files/images/logos/',_0x32e8b9['sitepic']))&&_0x2b6bd4){_0x34a112=path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],_0xb5d1('0x7d'),_0x32e8b9['sitepic']);}}return _0x30a85f[_0xb5d1('0x7e')](_0x34a112);}})[_0xb5d1('0x50')](handleError(_0x30a85f,null));};exports[_0xb5d1('0x7f')]=function(_0x23e361,_0x4e8b6d,_0x227e72){var _0x36990e=path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],_0xb5d1('0x80'));var _0x60259c={'where':{'id':_0x23e361['params']['id']},'attributes':['id',_0xb5d1('0x6f')],'raw':!![]};return db[_0xb5d1('0x3c')]['find'](_0x60259c)[_0xb5d1('0x31')](handleEntityNotFound(_0x4e8b6d,null))['then'](function(_0x2092f2){if(_0x2092f2){if(!_[_0xb5d1('0x7a')](_0x2092f2['agentAvatar'])){if(fs[_0xb5d1('0x7b')](path['join'](config[_0xb5d1('0x75')],'server/files/images/avatars/',_0x2092f2[_0xb5d1('0x6f')]))){_0x36990e=path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],'server/files/images/avatars/',_0x2092f2[_0xb5d1('0x6f')]);}}return _0x4e8b6d[_0xb5d1('0x7e')](_0x36990e);}})[_0xb5d1('0x50')](handleError(_0x4e8b6d,null));};exports['getCustomerAvatar']=function(_0x1fa7f8,_0x1ecc7c,_0x1971b6){var _0x44f3c8=path['join'](config[_0xb5d1('0x75')],_0xb5d1('0x81'));var _0x2b8dd1={'where':{'id':_0x1fa7f8[_0xb5d1('0x52')]['id']},'attributes':['id',_0xb5d1('0x71'),_0xb5d1('0x82')],'raw':!![]};return db[_0xb5d1('0x3c')]['find'](_0x2b8dd1)[_0xb5d1('0x31')](handleEntityNotFound(_0x1ecc7c,null))[_0xb5d1('0x31')](function(_0x13371f){if(_0x13371f){if(!_['isNil'](_0x13371f[_0xb5d1('0x71')])){if(fs['existsSync'](path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],_0xb5d1('0x83'),_0x13371f[_0xb5d1('0x71')]))&&_0x13371f[_0xb5d1('0x82')]){_0x44f3c8=path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],_0xb5d1('0x83'),_0x13371f[_0xb5d1('0x71')]);}}return _0x1ecc7c[_0xb5d1('0x7e')](_0x44f3c8);}})[_0xb5d1('0x50')](handleError(_0x1ecc7c,null));};exports[_0xb5d1('0x84')]=function(_0x411bd9,_0x161db8,_0x44b417){var _0x2ac0e9=path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],'server/files/images/avatars/system_avatar.png');var _0x358044={'where':{'id':_0x411bd9[_0xb5d1('0x52')]['id']},'attributes':['id',_0xb5d1('0x73')],'raw':!![]};return db['ChatWebsite'][_0xb5d1('0x55')](_0x358044)[_0xb5d1('0x31')](handleEntityNotFound(_0x161db8,null))[_0xb5d1('0x31')](function(_0x20647c){if(_0x20647c){if(!_['isNil'](_0x20647c[_0xb5d1('0x73')])){if(fs['existsSync'](path['join'](config[_0xb5d1('0x75')],_0xb5d1('0x83'),_0x20647c[_0xb5d1('0x73')]))){_0x2ac0e9=path[_0xb5d1('0x7c')](config[_0xb5d1('0x75')],_0xb5d1('0x83'),_0x20647c[_0xb5d1('0x73')]);}}return _0x161db8[_0xb5d1('0x7e')](_0x2ac0e9);}})[_0xb5d1('0x50')](handleError(_0x161db8,null));};exports[_0xb5d1('0x85')]=function(_0x5870b4,_0x4d3ee9,_0x3e1921){var _0x3febb2=require(_0xb5d1('0x86'));var _0x27a7ac=new _0x3febb2();var _0x2e5f30=_0x27a7ac[_0xb5d1('0x87')](_0x5870b4['headers'][_0xb5d1('0x88')])[_0xb5d1('0x89')]();var _0x24afba={'body':_0x5870b4[_0xb5d1('0x57')],'channel':_0xb5d1('0x8a')};var _0x3b1b63=[];var _0x384b88=[];var _0x79f748={};var _0x464daa=![];return db[_0xb5d1('0x8b')][_0xb5d1('0x5e')]()[_0xb5d1('0x31')](function(_0x3f5e0e){if(!_0x3f5e0e){throw new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))](_0xb5d1('0x8e'));}_0x3b1b63=_[_0xb5d1('0x8f')](_['keys'](_0x3f5e0e),[_0xb5d1('0x90'),'updatedAt']);_0x384b88=_[_0xb5d1('0x8f')](_['keys'](_0x3f5e0e),[_0xb5d1('0x90'),_0xb5d1('0x91'),'CompanyId',_0xb5d1('0x92')]);if(_0x5870b4['body']['id']){delete _0x5870b4[_0xb5d1('0x57')]['id'];}if(_[_0xb5d1('0x7a')](_0x5870b4['body'][_0xb5d1('0x93')])){throw new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))](_0xb5d1('0x94'));}if(_[_0xb5d1('0x7a')](_0x5870b4['body'][_0xb5d1('0x57')])||_0x5870b4['body'][_0xb5d1('0x57')]===''){throw new db['Sequelize'][(_0xb5d1('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb5d1('0x7a')](_0x5870b4[_0xb5d1('0x57')]['mapKey'])){throw new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x384b88);}if(!_[_0xb5d1('0x95')](_0x384b88,_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0x96')])){throw new db['Sequelize'][(_0xb5d1('0x8d'))](_0xb5d1('0x97')+_0x384b88);}_0x79f748[_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0x96')]]=_0x5870b4['body'][_0xb5d1('0x93')];})[_0xb5d1('0x31')](function(){return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x5870b4[_0xb5d1('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0xb5d1('0x98'),'include':[{'model':db[_0xb5d1('0x8b')],'as':_0xb5d1('0x99'),'where':_0x79f748,'limit':0x1,'order':[[_0xb5d1('0x91'),_0xb5d1('0x9a')]]}]},{'model':db[_0xb5d1('0x9b')],'as':_0xb5d1('0x9c')}]});})[_0xb5d1('0x31')](handleEntityNotFound(_0x4d3ee9,null))[_0xb5d1('0x31')](function(_0x2f9fd7){if(_0x2f9fd7&&_0x2f9fd7['List']){_0x24afba[_0xb5d1('0x9d')]=_0x2f9fd7;_0x24afba[_0xb5d1('0x9e')]=_0x2f9fd7[_0xb5d1('0x9c')];_0x24afba[_0xb5d1('0x9f')]=_0x2f9fd7['List'];_0x24afba['applications']=_[_0xb5d1('0xa0')](_0x24afba[_0xb5d1('0x9e')],['priority'],[_0xb5d1('0xa1')]);if(_0x24afba['account'][_0xb5d1('0x9c')]){delete _0x24afba[_0xb5d1('0x9d')][_0xb5d1('0x9c')];}if(_0x24afba[_0xb5d1('0x9d')][_0xb5d1('0x98')]&&_0x24afba[_0xb5d1('0x9d')][_0xb5d1('0x98')][_0xb5d1('0x99')][_0xb5d1('0x46')]){return _0x24afba[_0xb5d1('0x9d')][_0xb5d1('0x98')][_0xb5d1('0x99')][0x0];}var _0x2c23bd=_[_0xb5d1('0x18')](_0x5870b4['body'],{'firstName':_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0x93')],'ListId':_0x2f9fd7[_0xb5d1('0x92')]});_0x2c23bd[_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0x96')]]=_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0x93')];return db['CmContact']['create'](_0x2c23bd,{'fields':_0x3b1b63,'raw':!![]});}})[_0xb5d1('0x31')](handleEntityNotFound(_0x4d3ee9,null))[_0xb5d1('0x31')](function(_0x4a6736){_0x24afba['contact']=_0x4a6736;var _0x5187c0=_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xa2')];if(_0x5870b4['headers']['cf-connecting-ip']){_0x5187c0=_0x5870b4[_0xb5d1('0xa3')][_0xb5d1('0xa4')];}else if(_0x5870b4[_0xb5d1('0xa3')][_0xb5d1('0xa5')]){_0x5187c0=_[_0xb5d1('0xa6')](_0x5870b4[_0xb5d1('0xa3')][_0xb5d1('0xa5')]['split'](','));}if(_0x4a6736){var _0x5a3a7a={'ContactId':_0x4a6736['id'],'ChatWebsiteId':_0x5870b4[_0xb5d1('0x52')]['id'],'from':(_0x4a6736['firstName']||'')+'\x20'+(_0x4a6736[_0xb5d1('0xa7')]||''),'customerIp':_0x5187c0,'customerPort':_0x5870b4[_0xb5d1('0xa3')]['x-real-port']?_0x5870b4['headers']['x-real-port']:null,'referer':_0x5870b4[_0xb5d1('0x57')]['referer'],'browserName':_0x2e5f30[_0xb5d1('0xa8')][_0xb5d1('0x36')]&&_0x2e5f30[_0xb5d1('0xa8')]['version']?util[_0xb5d1('0xa9')](_0xb5d1('0xaa'),_0x2e5f30[_0xb5d1('0xa8')][_0xb5d1('0x36')],_0x2e5f30[_0xb5d1('0xa8')][_0xb5d1('0xab')]):_0xb5d1('0xac'),'browserVersion':_0x2e5f30['browser'][_0xb5d1('0xab')]||_0xb5d1('0xac'),'osName':util[_0xb5d1('0xa9')](_0xb5d1('0xaa'),_0x2e5f30['os'][_0xb5d1('0x36')],_0x2e5f30['os'][_0xb5d1('0xab')]),'osVersion':_0x2e5f30['os'][_0xb5d1('0xab')],'deviceModel':_0x2e5f30['device'][_0xb5d1('0x40')]&&_0x2e5f30[_0xb5d1('0xad')][_0xb5d1('0xae')]?util[_0xb5d1('0xa9')](_0xb5d1('0xaf'),_0x2e5f30['device'][_0xb5d1('0x40')],_0x2e5f30[_0xb5d1('0xad')][_0xb5d1('0xae')],_0x2e5f30[_0xb5d1('0xad')][_0xb5d1('0x3e')]):null,'deviceVendor':_0x2e5f30[_0xb5d1('0xad')][_0xb5d1('0xae')],'deviceType':_0x2e5f30['device'][_0xb5d1('0x3e')],'formData':JSON[_0xb5d1('0x21')](_0x5870b4[_0xb5d1('0x57')])};var _0x3af070={'ChatWebsiteId':_0x5870b4[_0xb5d1('0x52')]['id'],'closed':![]};if(_0x5870b4['body'][_0xb5d1('0xb0')]){_0x3af070[_0xb5d1('0xb0')]=_0x5870b4[_0xb5d1('0x57')]['threadId'];return db['ChatInteraction'][_0xb5d1('0x55')]({'where':_0x3af070})[_0xb5d1('0x31')](function(_0x567513){if(_0x567513){return[_0x567513,![]];}_0x5a3a7a[_0xb5d1('0xb0')]=_0x5870b4['body'][_0xb5d1('0xb0')];_0x5a3a7a[_0xb5d1('0xb1')]=_0x5870b4[_0xb5d1('0x57')]['externalUrl'];return db[_0xb5d1('0xb2')][_0xb5d1('0x56')](_0x5a3a7a)[_0xb5d1('0x31')](function(_0x28dce2){return[_0x28dce2,!![]];});});}_0x3af070[_0xb5d1('0xb3')]=_0x4a6736['id'];if(_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xb4')]&&_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xb4')]['id']){_0x3af070['id']=_0x5870b4[_0xb5d1('0x57')]['interaction']['id'];return db[_0xb5d1('0xb2')][_0xb5d1('0x55')]({'where':_0x3af070})[_0xb5d1('0x31')](function(_0x57f913){if(_0x57f913){return[_0x57f913,![]];}return db[_0xb5d1('0xb2')][_0xb5d1('0x56')](_0x5a3a7a)[_0xb5d1('0x31')](function(_0x2180ca){return[_0x2180ca,!![]];});});}return db[_0xb5d1('0xb2')][_0xb5d1('0x56')](_0x5a3a7a)[_0xb5d1('0x31')](function(_0x590bd5){return[_0x590bd5,!![]];});}})[_0xb5d1('0xb5')](function(_0x1c8658,_0x26fb32){if(_0x1c8658){_0x464daa=_0x26fb32;if(!_0x26fb32){var _0x3e6ba2={'from':(_0x24afba[_0xb5d1('0xb6')]['firstName']||'')+'\x20'+(_0x24afba[_0xb5d1('0xb6')][_0xb5d1('0xa7')]||'')};if(_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xb0')]&&_0x5870b4[_0xb5d1('0x57')]['messageId']&&_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xb0')]!=_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xb7')]){_0x3e6ba2[_0xb5d1('0xb0')]=_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xb7')];}return _0x1c8658[_0xb5d1('0x30')](_0x3e6ba2);}else{return _0x1c8658;}}})[_0xb5d1('0x31')](function(_0x46ccc5){_0x24afba['interaction']=_0x46ccc5['get']({'plain':!![]});_0x24afba[_0xb5d1('0xb4')][_0xb5d1('0xb8')]=_0x464daa;if(_0x24afba[_0xb5d1('0xb4')][_0xb5d1('0xb8')]){if(_0x24afba[_0xb5d1('0x9d')][_0xb5d1('0xb9')]){_0x24afba[_0xb5d1('0x9e')][_0xb5d1('0xba')]({'id':0x0,'priority':_0x24afba[_0xb5d1('0x9e')][_0xb5d1('0x46')]+0x1,'app':'close','appdata':_0xb5d1('0xbb'),'interval':'*,*,*,*'});}}return db[_0xb5d1('0xbc')][_0xb5d1('0x56')]({'body':_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0x57')],'ChatWebsiteId':_0x5870b4['params']['id'],'ChatInteractionId':_0x46ccc5['id'],'direction':'in','ContactId':_0x24afba[_0xb5d1('0xb6')]['id'],'AttachmentId':_0x5870b4[_0xb5d1('0x57')][_0xb5d1('0xbd')]});})[_0xb5d1('0x31')](function(_0x151eaf){_0x24afba[_0xb5d1('0x25')]=_0x151eaf;if(_0x24afba[_0xb5d1('0xb4')]['UserId']){return db[_0xb5d1('0xbe')][_0xb5d1('0x55')]({'attributes':['id',_0xb5d1('0x36')],'where':{'id':_0x24afba[_0xb5d1('0xb4')][_0xb5d1('0xbf')]}})[_0xb5d1('0x31')](function(_0x2137c2){if(_0x2137c2){_0x24afba[_0xb5d1('0x9e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb5d1('0xc0'),'appdata':_0x2137c2[_0xb5d1('0x36')]+','+(_0x24afba[_0xb5d1('0x9d')][_0xb5d1('0xc1')]||0xa),'interval':'*,*,*,*'});_0x24afba[_0xb5d1('0xc2')]=!![];}return respondWithRpcPromise(_0xb5d1('0xc3'),'startRouting',_0x24afba);});}return respondWithRpcPromise(_0xb5d1('0xc3'),'startRouting',_0x24afba);})['then'](function(_0x473897){respondWithRpcPromise(_0xb5d1('0xc4'),_0xb5d1('0xc4'),{'event':_0xb5d1('0x85'),'message':_0x473897},client9002);return _0x473897;})[_0xb5d1('0x31')](respondWithResult(_0x4d3ee9,null))[_0xb5d1('0x50')](handleError(_0x4d3ee9,null));};exports[_0xb5d1('0xc5')]=function(_0x4064e4,_0x44fffd,_0x502eae){var _0x4887ea,_0x7760ed,_0x4c7bba;var _0xf9af7=[];var _0x3aa158=[];var _0x4fc295={};return db[_0xb5d1('0x8b')][_0xb5d1('0x5e')]()[_0xb5d1('0x31')](function(_0x4228c2){if(!_0x4228c2){throw new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))](_0xb5d1('0x8e'));}_0x3aa158=_[_0xb5d1('0x8f')](_[_0xb5d1('0x53')](_0x4228c2),[_0xb5d1('0x90'),_0xb5d1('0x91')]);_0xf9af7=_[_0xb5d1('0x8f')](_[_0xb5d1('0x53')](_0x4228c2),[_0xb5d1('0x90'),_0xb5d1('0x91'),_0xb5d1('0xc6'),_0xb5d1('0x92')]);if(_0x4064e4[_0xb5d1('0x57')]['id']){delete _0x4064e4[_0xb5d1('0x57')]['id'];}if(_[_0xb5d1('0x7a')](_0x4064e4[_0xb5d1('0x57')][_0xb5d1('0x93')])){throw _0x44fffd['status'](0x1f4)['send'](new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))](_0xb5d1('0x94')));}if(_[_0xb5d1('0x7a')](_0x4064e4[_0xb5d1('0x57')][_0xb5d1('0x57')])||_0x4064e4['body'][_0xb5d1('0x57')]===''){throw _0x44fffd[_0xb5d1('0x27')](0x1f4)[_0xb5d1('0x37')](new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))](_0xb5d1('0xc7')));}if(_[_0xb5d1('0x7a')](_0x4064e4[_0xb5d1('0x57')][_0xb5d1('0xc8')])){throw _0x44fffd['status'](0x1f4)[_0xb5d1('0x37')](new db[(_0xb5d1('0x8c'))][(_0xb5d1('0x8d'))](_0xb5d1('0xc9')+_0xf9af7));}if(!_['includes'](_0xf9af7,_0x4064e4['body'][_0xb5d1('0xc8')])){throw _0x44fffd[_0xb5d1('0x27')](0x1f4)[_0xb5d1('0x37')](new db[(_0xb5d1('0x8c'))]['ValidationError'](_0xb5d1('0xca')+_0xf9af7));}_0x4fc295[_0x4064e4['body'][_0xb5d1('0xc8')]]=_0x4064e4[_0xb5d1('0x57')][_0xb5d1('0x93')];})[_0xb5d1('0x31')](function(){return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x4064e4[_0xb5d1('0x52')]['id']},'include':[{'model':db[_0xb5d1('0xcb')],'as':_0xb5d1('0x98')}]});})[_0xb5d1('0x31')](handleEntityNotFound(_0x44fffd,null))[_0xb5d1('0x31')](function(_0x1bdf0f){if(_0x1bdf0f&&_0x1bdf0f[_0xb5d1('0x98')]){_0x7760ed=_0x1bdf0f;var _0x281d8d=_[_0xb5d1('0x18')](_0x4064e4[_0xb5d1('0x57')],{'firstName':_0x4064e4[_0xb5d1('0x57')][_0xb5d1('0x93')],'phone':_0x4064e4[_0xb5d1('0x57')]['from'],'ListId':_0x1bdf0f[_0xb5d1('0x92')]});_0x281d8d[_0x4064e4[_0xb5d1('0x57')][_0xb5d1('0xc8')]]=_0x4064e4[_0xb5d1('0x57')]['from'];return db[_0xb5d1('0x8b')][_0xb5d1('0xcc')]({'where':_0x4fc295,'defaults':_0x281d8d});}})[_0xb5d1('0xb5')](function(_0x4497c1){if(_0x4497c1){_0x4c7bba=_0x4497c1;var _0x2acecd=fs[_0xb5d1('0xcd')](path[_0xb5d1('0x7c')](config['root'],_0xb5d1('0xce')),'utf8');var _0x2e3e80=ejs[_0xb5d1('0xcf')](_0x2acecd,{'body':_['toPairs'](_0x4064e4[_0xb5d1('0x57')]['body']),'bodyTitle':_0x7760ed['offlineMessageBody']});return db[_0xb5d1('0xd0')][_0xb5d1('0x56')]({'body':_0x2e3e80,'ContactId':_0x4497c1['id'],'ChatWebsiteId':_0x7760ed['id']});}})['then'](function(_0x41f9f8){if(_0x41f9f8){_0x4887ea=_0x41f9f8;return db[_0xb5d1('0xd1')][_0xb5d1('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0xb5d1('0xd2')],'as':_0xb5d1('0xd3'),'raw':!![]}]});}})[_0xb5d1('0x31')](function(_0x5ca92d){if(_0x5ca92d&&_0x5ca92d['Smtp']&&_0x7760ed['forwardOfflineAddress']){var _0x14e60b={'tls':{'rejectUnauthorized':![]}};if(_0x5ca92d[_0xb5d1('0xd3')][_0xb5d1('0xd4')]){_0x14e60b[_0xb5d1('0xd4')]=_0x5ca92d[_0xb5d1('0xd3')]['service'];}else{_0x14e60b[_0xb5d1('0xd5')]=_0x5ca92d[_0xb5d1('0xd3')][_0xb5d1('0xd5')];_0x14e60b[_0xb5d1('0xd6')]=_0x5ca92d[_0xb5d1('0xd3')][_0xb5d1('0xd6')];_0x14e60b['secure']=_0x5ca92d['Smtp'][_0xb5d1('0xd7')];}if(_0x5ca92d[_0xb5d1('0xd3')][_0xb5d1('0xd8')]){_0x14e60b[_0xb5d1('0xd9')]={'user':_0x5ca92d[_0xb5d1('0xd3')][_0xb5d1('0x58')],'pass':_0x5ca92d[_0xb5d1('0xd3')]['pass']};}return respondWithRpcPromise(_0xb5d1('0xda'),_0xb5d1('0xdb'),{'account':_0x14e60b,'message':{'from':util[_0xb5d1('0xa9')](_0xb5d1('0xdc'),_0x5ca92d['name'],_0x5ca92d['email']||_0x5ca92d['Smtp'][_0xb5d1('0x58')]),'to':_0x7760ed[_0xb5d1('0xdd')],'subject':_0x7760ed[_0xb5d1('0xde')],'text':_0x4887ea[_0xb5d1('0x57')]}},client9003)[_0xb5d1('0x31')](function(){return _0x4887ea;})[_0xb5d1('0x50')](function(_0x26bbbc){console[_0xb5d1('0x22')](_0x26bbbc);});}})[_0xb5d1('0x31')](function(){if(_0x4887ea){return _0x4887ea;}})[_0xb5d1('0x31')](respondWithResult(_0x44fffd,null))[_0xb5d1('0x50')](handleError(_0x44fffd,null));};exports[_0xb5d1('0xdf')]=function(_0x121958,_0x5a3b3b,_0x51e1ec){return db[_0xb5d1('0xb2')][_0xb5d1('0x55')]({'where':{'id':_0x121958[_0xb5d1('0x52')]['id']}})['then'](handleEntityNotFound(_0x5a3b3b,null))['then'](function(_0x2b08c0){if(_0x2b08c0){return _0x2b08c0[_0xb5d1('0xdf')](_0x121958[_0xb5d1('0x57')]['ids'],_['omit'](_0x121958['body'],[_0xb5d1('0xe0'),'id'])||{});}})['then'](respondWithResult(_0x5a3b3b,null))[_0xb5d1('0x50')](handleError(_0x5a3b3b,null));};exports['getInteractions']=function(_0x43d0eb,_0x396d24,_0x12bdd8){var _0x1e7693={'raw':![],'where':{}};var _0x1f0bcb={};var _0x1471db={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x43d0eb[_0xb5d1('0x52')]['id']}})['then'](handleEntityNotFound(_0x396d24,null))[_0xb5d1('0x31')](function(_0x54a041){if(_0x54a041){_0x1f0bcb[_0xb5d1('0x40')]=_['keys'](db['ChatInteraction'][_0xb5d1('0x63')]);_0x1f0bcb[_0xb5d1('0x41')]=_['keys'](_0x43d0eb[_0xb5d1('0x41')]);_0x1f0bcb[_0xb5d1('0x42')]=_['intersection'](_0x1f0bcb[_0xb5d1('0x40')],_0x1f0bcb[_0xb5d1('0x41')]);_0x1e7693[_0xb5d1('0x44')]=_[_0xb5d1('0x43')](_0x1f0bcb[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x45')]));_0x1e7693[_0xb5d1('0x44')]=_0x1e7693[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x1e7693[_0xb5d1('0x44')]:_0x1f0bcb[_0xb5d1('0x40')];if(!_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x64')]('nolimit')){_0x1e7693['limit']=qs[_0xb5d1('0x2c')](_0x43d0eb['query']['limit']);_0x1e7693[_0xb5d1('0x2b')]=qs[_0xb5d1('0x2b')](_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x2b')]);}_0x1e7693[_0xb5d1('0x48')]=qs[_0xb5d1('0x49')](_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x49')]);_0x1e7693[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_[_0xb5d1('0x65')](_0x43d0eb[_0xb5d1('0x41')],_0x1f0bcb[_0xb5d1('0x42')]));_0x1e7693[_0xb5d1('0x4b')][_0xb5d1('0x5f')]=_0x54a041['id'];if(_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x4a')]){_0x1e7693[_0xb5d1('0x4b')]=_[_0xb5d1('0x66')](_0x1e7693[_0xb5d1('0x4b')],{'$or':_[_0xb5d1('0x3b')](_0x1e7693['attributes'],function(_0x203bc8){var _0x3653c5={};_0x3653c5[_0x203bc8]={'$like':'%'+_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x4a')]+'%'};return _0x3653c5;})});}_0x1e7693=_['merge']({},_0x1e7693,_0x43d0eb[_0xb5d1('0x4c')]);return db['ChatInteraction'][_0xb5d1('0x2a')]({'where':_0x1e7693[_0xb5d1('0x4b')]})[_0xb5d1('0x31')](function(_0x1fee13){_0x1471db[_0xb5d1('0x2a')]=_0x1fee13;if(_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0x4d')]){_0x1e7693['include']=[{'model':db[_0xb5d1('0x8b')],'as':_0xb5d1('0xe1'),'required':![]},{'model':db[_0xb5d1('0xbe')],'as':_0xb5d1('0xe2'),'attributes':[_0xb5d1('0x36'),_0xb5d1('0xe3'),_0xb5d1('0xe4')],'required':![]},{'model':db[_0xb5d1('0xe5')],'as':'Tags','attributes':['id','name',_0xb5d1('0xe6')],'where':_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0xe7')]?{'id':_0x43d0eb[_0xb5d1('0x41')][_0xb5d1('0xe7')]}:undefined,'required':_0x43d0eb['query'][_0xb5d1('0xe7')]?!![]:![]}];}return db['ChatInteraction'][_0xb5d1('0x4e')](_0x1e7693);})['then'](function(_0x3c3f6b){_0x1471db[_0xb5d1('0x4f')]=_0x3c3f6b;return _0x1471db;});}})[_0xb5d1('0x31')](respondWithFilteredResult(_0x396d24,_0x1e7693))[_0xb5d1('0x50')](handleError(_0x396d24,null));};function iftimePromise(_0x416e47,_0xe1844a){return respondWithRpcPromise('Command','getSnippet',{'command':_0xe1844a[_0xb5d1('0xe8')]?util[_0xb5d1('0xa9')](_0xb5d1('0xe9'),_0x416e47[_0xb5d1('0xea')],_0xe1844a[_0xb5d1('0xe8')]):util['format'](_0xb5d1('0xeb'),_0x416e47[_0xb5d1('0xea')])},client9002)['then'](function(_0x211e91){var _0x2f3f48=_0x211e91&&_0x211e91[_0xb5d1('0xec')]('true')>=0x0?!![]:![];logger['info'](_0xb5d1('0xed'),_0xe1844a['id'],_0x416e47['id'],_0x416e47[_0xb5d1('0xea')],_0x2f3f48?_0xb5d1('0xee'):_0xb5d1('0xef'),_0xe1844a['timezone']?_0xe1844a[_0xb5d1('0xe8')]:_0xb5d1('0xf0'));return _0x2f3f48;})[_0xb5d1('0x50')](function(_0x427acf){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xe1844a['id'],_0x416e47['id'],_0x416e47[_0xb5d1('0xea')],util[_0xb5d1('0xf1')](_0x427acf,{'showHidden':![],'depth':null}),_0xe1844a[_0xb5d1('0xe8')]?_0xe1844a['timezone']:_0xb5d1('0xf0'));return![];});}exports[_0xb5d1('0xf2')]=function(_0x249a51,_0x1d909c,_0x595ce5){var _0xd224bb=0x0;var _0x1f67e9=0x0;var _0x4d17c2=![];var _0x25ed1f;var _0x318f02;return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x249a51[_0xb5d1('0x52')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xb5d1('0xf3')],'as':_0xb5d1('0xf4'),'attributes':['id',_0xb5d1('0xea')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1d909c,null))[_0xb5d1('0x31')](function(_0x48260f){if(_0x48260f){_0x25ed1f=_0x48260f;return _0x48260f[_0xb5d1('0xf5')]({'raw':!![]});}})[_0xb5d1('0x31')](function(_0xa06a88){if(_0x25ed1f){if(_0xa06a88){_0x318f02=_0xa06a88;}}return require(_0xb5d1('0x78'))[_0xb5d1('0x79')]();})[_0xb5d1('0x31')](function(_0x5afb26){if(_0x5afb26){_0x1f67e9=_0x5afb26[_0xb5d1('0xf6')];_0x4d17c2=_0x5afb26[_0xb5d1('0xf7')];}})[_0xb5d1('0x31')](function(){return db[_0xb5d1('0xb2')][_0xb5d1('0x2a')]({'where':{'closed':![]}});})[_0xb5d1('0x31')](function(_0x23afe5){_0xd224bb=_0x23afe5;if(_0x1f67e9&&_0x23afe5>_0x1f67e9){return db['License'][_0xb5d1('0x61')]({'where':{'id':0x1}})['then'](function(_0x317feb){if(_0x317feb){_0x317feb[_0xb5d1('0xf8')](_0xb5d1('0xf9'));}});}})[_0xb5d1('0x31')](function(){if(_0x25ed1f[_0xb5d1('0xf3')]&&_0x25ed1f[_0xb5d1('0xf3')][_0xb5d1('0xf4')]){var _0x674a7d=[];for(var _0x4794f3=0x0;_0x4794f3<_0x25ed1f['Interval'][_0xb5d1('0xf4')][_0xb5d1('0x46')];_0x4794f3++){var _0x34cefa=_0x25ed1f[_0xb5d1('0xf3')][_0xb5d1('0xf4')][_0x4794f3]['get']({'plain':!![]});_0x674a7d[_0xb5d1('0xba')](iftimePromise(_0x34cefa,_0x25ed1f));}return BPromise[_0xb5d1('0xfa')](_0x674a7d)[_0xb5d1('0x31')](function(_0x401c21){return _[_0xb5d1('0xfb')](_0x401c21);});}else{return!![];}})[_0xb5d1('0x31')](function(_0x46733a){var _0x4ec414=fs[_0xb5d1('0xcd')](path[_0xb5d1('0x7c')](config['root'],_0xb5d1('0xfc')),_0xb5d1('0xfd'));var _0xed5ec9={'remote':_0x25ed1f[_0xb5d1('0xfe')],'query':querystring[_0xb5d1('0x21')](_['merge'](_0x25ed1f[_0xb5d1('0x59')]({'plain':!![]}),{'customerIp':_0x249a51[_0xb5d1('0xa3')][_0xb5d1('0xa5')]||_0x249a51[_0xb5d1('0xa3')][_0xb5d1('0xff')]||_0x249a51[_0xb5d1('0x100')]['remoteAddress']||_0x249a51['ip'],'referer':_0x249a51[_0xb5d1('0xa3')][_0xb5d1('0x101')],'openedInteractions':_0xd224bb,'maxInteractions':_0x1f67e9,'virtual':_0x4d17c2[_0xb5d1('0xf6')],'online':_0x46733a,'custom':_0x4d17c2}))['replace'](/'/g,'\x5c\x27')};_0x1d909c[_0xb5d1('0x37')](ejs[_0xb5d1('0xcf')](Mustache['render'](_0x4ec414,_0xed5ec9),{'proactiveActions':_0x318f02,'alignment':_0x25ed1f[_0xb5d1('0x102')],'verticalAlignment':_0x25ed1f[_0xb5d1('0x103')],'div_color':_0x25ed1f[_0xb5d1('0xe6')],'text_color':_0x25ed1f[_0xb5d1('0x104')]}));})['catch'](handleError(_0x1d909c,null));};exports['addApplications']=function(_0x6547f4,_0x32e6c6,_0x469a7d){return db[_0xb5d1('0x3c')][_0xb5d1('0x61')]({'where':{'id':_0x6547f4[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x32e6c6,null))[_0xb5d1('0x31')](function(_0x16a5ba){if(_0x16a5ba){return db['sequelize'][_0xb5d1('0x105')](function(_0x34f46a){return db[_0xb5d1('0x9b')][_0xb5d1('0x32')]({'where':{'ChatWebsiteId':_0x6547f4['params']['id']},'transaction':_0x34f46a})['then'](function(_0x43988a){var _0xd886f0=_[_0xb5d1('0x3b')](_0x6547f4[_0xb5d1('0x57')],function(_0x41d26f){_0x41d26f[_0xb5d1('0x5f')]=_0x6547f4[_0xb5d1('0x52')]['id'];return _0x41d26f;});return db[_0xb5d1('0x9b')][_0xb5d1('0x106')](_0xd886f0,{'transaction':_0x34f46a});});})[_0xb5d1('0x31')](function(){return db[_0xb5d1('0x9b')][_0xb5d1('0x107')]({'where':{'ChatWebsiteId':_0x6547f4[_0xb5d1('0x52')]['id']},'order':'priority'});});}})[_0xb5d1('0x31')](respondWithResult(_0x32e6c6,null))[_0xb5d1('0x50')](handleError(_0x32e6c6,null));};exports[_0xb5d1('0x108')]=function(_0x333de6,_0x222661,_0x553a74){var _0x1d3433={};var _0x4315de={};var _0x146642;var _0xd8d952;return db['ChatWebsite'][_0xb5d1('0x61')]({'where':{'id':_0x333de6['params']['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x222661,null))['then'](function(_0x362582){if(_0x362582){_0x146642=_0x362582;_0x4315de[_0xb5d1('0x40')]=_[_0xb5d1('0x53')](db[_0xb5d1('0x9b')]['rawAttributes']);_0x4315de['query']=_[_0xb5d1('0x53')](_0x333de6[_0xb5d1('0x41')]);_0x4315de['filters']=_[_0xb5d1('0x43')](_0x4315de[_0xb5d1('0x40')],_0x4315de[_0xb5d1('0x41')]);_0x1d3433[_0xb5d1('0x44')]=_['intersection'](_0x4315de[_0xb5d1('0x40')],qs['fields'](_0x333de6[_0xb5d1('0x41')]['fields']));_0x1d3433[_0xb5d1('0x44')]=_0x1d3433['attributes'][_0xb5d1('0x46')]?_0x1d3433['attributes']:_0x4315de['model'];_0x1d3433[_0xb5d1('0x48')]=qs['sort'](_0x333de6[_0xb5d1('0x41')]['sort']);_0x1d3433[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_[_0xb5d1('0x65')](_0x333de6['query'],_0x4315de[_0xb5d1('0x42')]));if(_0x333de6['query']['filter']){_0x1d3433[_0xb5d1('0x4b')]=_[_0xb5d1('0x66')](_0x1d3433[_0xb5d1('0x4b')],{'$or':_[_0xb5d1('0x3b')](_0x1d3433[_0xb5d1('0x44')],function(_0x211449){var _0x85ddce={};_0x85ddce[_0x211449]={'$like':'%'+_0x333de6[_0xb5d1('0x41')][_0xb5d1('0x4a')]+'%'};return _0x85ddce;})});}_0x1d3433=_[_0xb5d1('0x66')]({},_0x1d3433,_0x333de6[_0xb5d1('0x4c')]);return _0x146642[_0xb5d1('0x108')](_0x1d3433);}})[_0xb5d1('0x31')](function(_0x56762c){if(_0x56762c){_0xd8d952=_0x56762c[_0xb5d1('0x46')];if(!_0x333de6[_0xb5d1('0x41')][_0xb5d1('0x64')](_0xb5d1('0x47'))){_0x1d3433[_0xb5d1('0x2c')]=qs[_0xb5d1('0x2c')](_0x333de6[_0xb5d1('0x41')][_0xb5d1('0x2c')]);_0x1d3433[_0xb5d1('0x2b')]=qs[_0xb5d1('0x2b')](_0x333de6[_0xb5d1('0x41')][_0xb5d1('0x2b')]);}return _0x146642[_0xb5d1('0x108')](_0x1d3433);}})[_0xb5d1('0x31')](function(_0x106d49){if(_0x106d49){return _0x106d49?{'count':_0xd8d952,'rows':_0x106d49}:null;}})['then'](respondWithResult(_0x222661,null))[_0xb5d1('0x50')](handleError(_0x222661,null));};exports['addProactiveActions']=function(_0x5c261b,_0x307096,_0x3f271d){return db[_0xb5d1('0x109')][_0xb5d1('0x55')]({'where':{'id':_0x5c261b[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x307096,null))['then'](function(_0x242406){if(_0x242406){return _0x242406['addProactiveActions'](_0x5c261b[_0xb5d1('0x57')][_0xb5d1('0xe0')],_[_0xb5d1('0x10a')](_0x5c261b[_0xb5d1('0x57')],[_0xb5d1('0xe0'),'id'])||{});}})[_0xb5d1('0x31')](respondWithResult(_0x307096,null))['catch'](handleError(_0x307096,null));};exports[_0xb5d1('0xf5')]=function(_0x20689e,_0x11fdba,_0x4ce89a){var _0x2b44d1={};var _0x56ee1a={};var _0x2de698;var _0x4c5bf6;return db[_0xb5d1('0x3c')][_0xb5d1('0x61')]({'where':{'id':_0x20689e[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x11fdba,null))[_0xb5d1('0x31')](function(_0x45250c){if(_0x45250c){_0x2de698=_0x45250c;_0x56ee1a[_0xb5d1('0x40')]=_[_0xb5d1('0x53')](db[_0xb5d1('0x10b')][_0xb5d1('0x63')]);_0x56ee1a[_0xb5d1('0x41')]=_[_0xb5d1('0x53')](_0x20689e[_0xb5d1('0x41')]);_0x56ee1a[_0xb5d1('0x42')]=_[_0xb5d1('0x43')](_0x56ee1a[_0xb5d1('0x40')],_0x56ee1a['query']);_0x2b44d1[_0xb5d1('0x44')]=_[_0xb5d1('0x43')](_0x56ee1a[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x20689e[_0xb5d1('0x41')]['fields']));_0x2b44d1['attributes']=_0x2b44d1[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x2b44d1[_0xb5d1('0x44')]:_0x56ee1a[_0xb5d1('0x40')];_0x2b44d1[_0xb5d1('0x48')]=qs['sort'](_0x20689e[_0xb5d1('0x41')][_0xb5d1('0x49')]);_0x2b44d1[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_[_0xb5d1('0x65')](_0x20689e[_0xb5d1('0x41')],_0x56ee1a[_0xb5d1('0x42')]));if(_0x20689e[_0xb5d1('0x41')][_0xb5d1('0x4a')]){_0x2b44d1[_0xb5d1('0x4b')]=_['merge'](_0x2b44d1['where'],{'$or':_[_0xb5d1('0x3b')](_0x2b44d1['attributes'],function(_0x23f2a4){var _0x19be5b={};_0x19be5b[_0x23f2a4]={'$like':'%'+_0x20689e['query'][_0xb5d1('0x4a')]+'%'};return _0x19be5b;})});}_0x2b44d1=_[_0xb5d1('0x66')]({},_0x2b44d1,_0x20689e[_0xb5d1('0x4c')]);return _0x2de698['getProactiveActions'](_0x2b44d1);}})[_0xb5d1('0x31')](function(_0x32bfbe){if(_0x32bfbe){_0x4c5bf6=_0x32bfbe['length'];if(!_0x20689e[_0xb5d1('0x41')][_0xb5d1('0x64')](_0xb5d1('0x47'))){_0x2b44d1['limit']=qs[_0xb5d1('0x2c')](_0x20689e[_0xb5d1('0x41')][_0xb5d1('0x2c')]);_0x2b44d1[_0xb5d1('0x2b')]=qs[_0xb5d1('0x2b')](_0x20689e['query']['offset']);}return _0x2de698[_0xb5d1('0xf5')](_0x2b44d1);}})[_0xb5d1('0x31')](function(_0x26ea1c){if(_0x26ea1c){return _0x26ea1c?{'count':_0x4c5bf6,'rows':_0x26ea1c}:null;}})[_0xb5d1('0x31')](respondWithResult(_0x11fdba,null))[_0xb5d1('0x50')](handleError(_0x11fdba,null));};exports['getFields']=function(_0x1315e2,_0x3761cc,_0x2ddda4){var _0x59806d=_0x1315e2[_0xb5d1('0x41')][_0xb5d1('0x10c')]==='false'?_0xb5d1('0x10d'):_0xb5d1('0x10e');return db[_0xb5d1('0x3c')]['find']({'attributes':['id',_0x59806d],'where':{'id':_0x1315e2[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x3761cc,null))[_0xb5d1('0x31')](function(_0x2e4df0){if(_0x2e4df0){var _0x3a76e7=_0x2e4df0[_0x59806d];var _0x50f769=_0x3a76e7&&_0x3a76e7['items']?_0x3a76e7[_0xb5d1('0x10f')]:[];_0x3761cc['send']({'fromKey':_[_0xb5d1('0x7a')](_0x3a76e7[_0xb5d1('0x110')])?undefined:_0x3a76e7['fromKey'],'count':_0x50f769[_0xb5d1('0x46')],'rows':_0x50f769});}})[_0xb5d1('0x50')](handleError(_0x3761cc,null));};exports[_0xb5d1('0x111')]=function(_0xcbaf02,_0x210654,_0x3306eb){var _0x37d91d={'raw':![],'where':{}};var _0xe2e775={};var _0x42719a={'count':0x0,'rows':[]};return db[_0xb5d1('0x3c')][_0xb5d1('0x61')]({'where':{'id':_0xcbaf02[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x210654,null))[_0xb5d1('0x31')](function(_0x406ca0){if(_0x406ca0){_0xe2e775['model']=_[_0xb5d1('0x53')](db[_0xb5d1('0xd0')][_0xb5d1('0x63')]);_0xe2e775[_0xb5d1('0x41')]=_[_0xb5d1('0x53')](_0xcbaf02[_0xb5d1('0x41')]);_0xe2e775['filters']=_['intersection'](_0xe2e775['model'],_0xe2e775[_0xb5d1('0x41')]);_0x37d91d[_0xb5d1('0x44')]=_[_0xb5d1('0x43')](_0xe2e775[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0xcbaf02['query'][_0xb5d1('0x45')]));_0x37d91d[_0xb5d1('0x44')]=_0x37d91d[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x37d91d[_0xb5d1('0x44')]:_0xe2e775['model'];if(!_0xcbaf02['query'][_0xb5d1('0x64')](_0xb5d1('0x47'))){_0x37d91d[_0xb5d1('0x2c')]=qs['limit'](_0xcbaf02[_0xb5d1('0x41')]['limit']);_0x37d91d[_0xb5d1('0x2b')]=qs[_0xb5d1('0x2b')](_0xcbaf02['query'][_0xb5d1('0x2b')]);}_0x37d91d[_0xb5d1('0x48')]=qs[_0xb5d1('0x49')](_0xcbaf02[_0xb5d1('0x41')][_0xb5d1('0x49')]);_0x37d91d[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_['pick'](_0xcbaf02[_0xb5d1('0x41')],_0xe2e775[_0xb5d1('0x42')]));_0x37d91d[_0xb5d1('0x4b')][_0xb5d1('0x5f')]=_0x406ca0['id'];if(_0xcbaf02[_0xb5d1('0x41')][_0xb5d1('0x4a')]){_0x37d91d[_0xb5d1('0x4b')]=_[_0xb5d1('0x66')](_0x37d91d[_0xb5d1('0x4b')],{'$or':_['map'](_0x37d91d[_0xb5d1('0x44')],function(_0x1002e4){var _0x3ac23b={};_0x3ac23b[_0x1002e4]={'$like':'%'+_0xcbaf02[_0xb5d1('0x41')]['filter']+'%'};return _0x3ac23b;})});}_0x37d91d=_[_0xb5d1('0x66')]({},_0x37d91d,_0xcbaf02[_0xb5d1('0x4c')]);return db['ChatOfflineMessage'][_0xb5d1('0x2a')]({'where':_0x37d91d['where']})[_0xb5d1('0x31')](function(_0x1cecd4){_0x42719a[_0xb5d1('0x2a')]=_0x1cecd4;if(_0xcbaf02[_0xb5d1('0x41')][_0xb5d1('0x4d')]){_0x37d91d[_0xb5d1('0x54')]=[{'all':!![]}];}else{_0x37d91d[_0xb5d1('0x54')]=[{'model':db[_0xb5d1('0x8b')],'as':_0xb5d1('0xe1'),'required':![]}];}return db['ChatOfflineMessage'][_0xb5d1('0x4e')](_0x37d91d);})[_0xb5d1('0x31')](function(_0x348a24){_0x42719a['rows']=_0x348a24;return _0x42719a;});}})[_0xb5d1('0x31')](respondWithFilteredResult(_0x210654,_0x37d91d))[_0xb5d1('0x50')](handleError(_0x210654,null));};exports[_0xb5d1('0x112')]=function(_0x5480ef,_0x3347ec,_0x309c48){return db['ChatWebsite']['find']({'where':{'id':_0x5480ef[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x3347ec,null))[_0xb5d1('0x31')](function(_0x5c508b){if(_0x5c508b){return _0x5c508b[_0xb5d1('0x112')](_0x5480ef[_0xb5d1('0x57')]['ids'],_[_0xb5d1('0x10a')](_0x5480ef[_0xb5d1('0x57')],[_0xb5d1('0xe0'),'id'])||{})[_0xb5d1('0xb5')](function(_0x49f8a4){for(var _0x5dc153=0x0;_0x5dc153<_0x5480ef['body'][_0xb5d1('0xe0')][_0xb5d1('0x46')];_0x5dc153+=0x1){socket[_0xb5d1('0x113')](_0xb5d1('0x114'),{'UserId':_0x5480ef[_0xb5d1('0x57')]['ids'][_0x5dc153],'ChatWebsiteId':_0x5480ef[_0xb5d1('0x52')]['id']});}return _0x49f8a4;});}})[_0xb5d1('0x31')](respondWithResult(_0x3347ec,null))[_0xb5d1('0x50')](handleError(_0x3347ec,null));};exports[_0xb5d1('0x115')]=function(_0x3bd029,_0x4b6511,_0xb7d71){return db[_0xb5d1('0x3c')][_0xb5d1('0x55')]({'where':{'id':_0x3bd029[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x4b6511,null))['then'](function(_0x349e04){if(_0x349e04){return _0x349e04['removeAgents'](_0x3bd029[_0xb5d1('0x41')][_0xb5d1('0xe0')])[_0xb5d1('0x31')](function(){if(_[_0xb5d1('0x116')](_0x3bd029[_0xb5d1('0x41')][_0xb5d1('0xe0')])){for(var _0x196b69=0x0;_0x196b69<_0x3bd029['query'][_0xb5d1('0xe0')][_0xb5d1('0x46')];_0x196b69+=0x1){socket[_0xb5d1('0x113')](_0xb5d1('0x117'),{'UserId':Number(_0x3bd029[_0xb5d1('0x41')]['ids'][_0x196b69]),'ChatWebsiteId':Number(_0x3bd029[_0xb5d1('0x52')]['id'])});}}else{socket[_0xb5d1('0x113')]('userChatWebsite:remove',{'UserId':Number(_0x3bd029[_0xb5d1('0x41')][_0xb5d1('0xe0')]),'ChatWebsiteId':Number(_0x3bd029['params']['id'])});}});}})[_0xb5d1('0x31')](respondWithStatusCode(_0x4b6511,null))[_0xb5d1('0x50')](handleError(_0x4b6511,null));};exports[_0xb5d1('0x118')]=function(_0x27b224,_0x3048ba,_0x207dce){var _0x588173={};var _0x17fe61={};var _0x18abe6;var _0x5116fc;return db[_0xb5d1('0x3c')][_0xb5d1('0x61')]({'where':{'id':_0x27b224[_0xb5d1('0x52')]['id']}})[_0xb5d1('0x31')](handleEntityNotFound(_0x3048ba,null))[_0xb5d1('0x31')](function(_0x4f3e25){if(_0x4f3e25){_0x18abe6=_0x4f3e25;_0x17fe61[_0xb5d1('0x40')]=_[_0xb5d1('0x53')](db[_0xb5d1('0xbe')][_0xb5d1('0x63')]);_0x17fe61['query']=_['keys'](_0x27b224[_0xb5d1('0x41')]);_0x17fe61['filters']=_[_0xb5d1('0x43')](_0x17fe61['model'],_0x17fe61[_0xb5d1('0x41')]);_0x588173['attributes']=_[_0xb5d1('0x43')](_0x17fe61[_0xb5d1('0x40')],qs[_0xb5d1('0x45')](_0x27b224[_0xb5d1('0x41')][_0xb5d1('0x45')]));_0x588173[_0xb5d1('0x44')]=_0x588173[_0xb5d1('0x44')][_0xb5d1('0x46')]?_0x588173[_0xb5d1('0x44')]:_0x17fe61['model'];_0x588173[_0xb5d1('0x48')]=qs['sort'](_0x27b224['query'][_0xb5d1('0x49')]);_0x588173[_0xb5d1('0x4b')]=qs[_0xb5d1('0x42')](_[_0xb5d1('0x65')](_0x27b224['query'],_0x17fe61[_0xb5d1('0x42')]));if(_0x27b224['query'][_0xb5d1('0x4a')]){_0x588173['where']=_[_0xb5d1('0x66')](_0x588173[_0xb5d1('0x4b')],{'$or':_[_0xb5d1('0x3b')](_0x588173[_0xb5d1('0x44')],function(_0x329172){var _0x4a0115={};_0x4a0115[_0x329172]={'$like':'%'+_0x27b224['query'][_0xb5d1('0x4a')]+'%'};return _0x4a0115;})});}_0x588173=_[_0xb5d1('0x66')]({},_0x588173,_0x27b224[_0xb5d1('0x4c')]);return _0x18abe6[_0xb5d1('0x118')](_0x588173);}})['then'](function(_0x4fea11){if(_0x4fea11){_0x5116fc=_0x4fea11[_0xb5d1('0x46')];if(!_0x27b224['query']['hasOwnProperty']('nolimit')){_0x588173[_0xb5d1('0x2c')]=qs['limit'](_0x27b224[_0xb5d1('0x41')][_0xb5d1('0x2c')]);_0x588173['offset']=qs['offset'](_0x27b224[_0xb5d1('0x41')][_0xb5d1('0x2b')]);}return _0x18abe6[_0xb5d1('0x118')](_0x588173);}})['then'](function(_0x590407){if(_0x590407){return _0x590407?{'count':_0x5116fc,'rows':_0x590407}:null;}})['then'](respondWithResult(_0x3048ba,null))[_0xb5d1('0x50')](handleError(_0x3048ba,null));};
\ No newline at end of file
+var _0x7791=['messageId','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','forcedOwnership','Start','startRouting','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','License','increment','chatLicenseExceeded','Intervals','push','some','readFileSync','server/files/chat/iframe.js','remote','connection','remoteAddress','referer','virtual','replace','alignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','addAnswer','CannedAnswer','pick','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','ChatApplication','Applications','applications','list','asc','account','Contacts','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','lastName'];(function(_0x14b195,_0x460868){var _0x42f003=function(_0x266e88){while(--_0x266e88){_0x14b195['push'](_0x14b195['shift']());}};_0x42f003(++_0x460868);}(_0x7791,0x17c));var _0x1779=function(_0x331958,_0x383b87){_0x331958=_0x331958-0x0;var _0x4d6768=_0x7791[_0x331958];return _0x4d6768;};'use strict';var pdf=require(_0x1779('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1779('0x1'));var zipdir=require(_0x1779('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1779('0x3'));var moment=require(_0x1779('0x4'));var BPromise=require(_0x1779('0x5'));var Mustache=require(_0x1779('0x6'));var util=require(_0x1779('0x7'));var path=require(_0x1779('0x8'));var sox=require(_0x1779('0x9'));var csv=require(_0x1779('0xa'));var ejs=require(_0x1779('0xb'));var fs=require('fs');var _=require(_0x1779('0xc'));var squel=require(_0x1779('0xd'));var crypto=require('crypto');var jsforce=require(_0x1779('0xe'));var deskjs=require(_0x1779('0xf'));var toCsv=require(_0x1779('0xa'));var querystring=require(_0x1779('0x10'));var Papa=require(_0x1779('0x11'));var Redis=require(_0x1779('0x12'));var authService=require(_0x1779('0x13'));var qs=require(_0x1779('0x14'));var as=require(_0x1779('0x15'));var hardwareService=require(_0x1779('0x16'));var logger=require(_0x1779('0x17'))(_0x1779('0x18'));var utils=require(_0x1779('0x19'));var config=require(_0x1779('0x1a'));var licenseUtil=require(_0x1779('0x1b'));var db=require(_0x1779('0x1c'))['db'];config['redis']=_[_0x1779('0x1d')](config[_0x1779('0x1e')],{'host':_0x1779('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1779('0x1e')]));require(_0x1779('0x20'))['register'](socket);var jayson=require(_0x1779('0x21'));var client=jayson[_0x1779('0x22')][_0x1779('0x23')]({'port':0x232c});var client9002=jayson[_0x1779('0x22')][_0x1779('0x23')]({'port':0x232a});var client9003=jayson[_0x1779('0x22')][_0x1779('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x52195d,_0x17a2e5,_0x300f69,_0x29aa39){return new BPromise(function(_0x198b64,_0x5dd983){var _0x33ab85=_0x29aa39||client;return _0x33ab85[_0x1779('0x24')](_0x52195d,_0x300f69)[_0x1779('0x25')](function(_0x546845){logger[_0x1779('0x26')](_0x1779('0x27'),_0x17a2e5,'request\x20sent');logger[_0x1779('0x28')](_0x1779('0x29'),_0x17a2e5,_0x1779('0x2a'),JSON[_0x1779('0x2b')](_0x546845));if(_0x546845[_0x1779('0x2c')]){if(_0x546845[_0x1779('0x2c')]['code']===0x1f4){logger[_0x1779('0x2c')](_0x1779('0x27'),_0x17a2e5,_0x546845[_0x1779('0x2c')][_0x1779('0x2d')]);return _0x5dd983(_0x546845[_0x1779('0x2c')]['message']);}logger[_0x1779('0x2c')](_0x1779('0x27'),_0x17a2e5,_0x546845['error']['message']);return _0x198b64(_0x546845[_0x1779('0x2c')][_0x1779('0x2d')]);}else{logger[_0x1779('0x26')](_0x1779('0x27'),_0x17a2e5,_0x1779('0x2a'));_0x198b64(_0x546845['result'][_0x1779('0x2d')]);}})[_0x1779('0x2e')](function(_0x3d2975){logger[_0x1779('0x2c')]('ChatWebsite,\x20%s,\x20%s',_0x17a2e5,_0x3d2975);_0x5dd983(_0x3d2975);});});}function respondWithStatusCode(_0x234d5f,_0x327af8){_0x327af8=_0x327af8||0xcc;return function(_0x2a1b89){if(_0x2a1b89){return _0x234d5f[_0x1779('0x2f')](_0x327af8);}return _0x234d5f['status'](_0x327af8)[_0x1779('0x30')]();};}function respondWithResult(_0x3e0e4e,_0x128929){_0x128929=_0x128929||0xc8;return function(_0x12e25a){if(_0x12e25a){return _0x3e0e4e[_0x1779('0x31')](_0x128929)[_0x1779('0x32')](_0x12e25a);}};}function respondWithFilteredResult(_0x39c107,_0x7e2f96){return function(_0x419bfa){if(_0x419bfa){var _0xe116=_0x419bfa[_0x1779('0x33')],_0x1d7d7c=_0x7e2f96[_0x1779('0x34')],_0x4ad5ec=_0x7e2f96['offset']+_0x7e2f96[_0x1779('0x35')],_0x36f0a4;if(_0x4ad5ec>=_0xe116){_0x4ad5ec=_0xe116;_0x36f0a4=0xc8;}else{_0x36f0a4=0xce;}_0x39c107[_0x1779('0x31')](_0x36f0a4);return _0x39c107[_0x1779('0x36')](_0x1779('0x37'),_0x1d7d7c+'-'+_0x4ad5ec+'/'+_0xe116)[_0x1779('0x32')](_0x419bfa);}return null;};}function patchUpdates(_0xb25b7f){return function(_0x555f59){try{jsonpatch['apply'](_0x555f59,_0xb25b7f,!![]);}catch(_0x50a94a){return BPromise['reject'](_0x50a94a);}return _0x555f59[_0x1779('0x38')]();};}function saveUpdates(_0x4b1612,_0x2ec291){return function(_0x39f9c2){if(_0x39f9c2){return _0x39f9c2[_0x1779('0x39')](_0x4b1612)[_0x1779('0x25')](function(_0x363032){return _0x363032;});}return null;};}function removeEntity(_0x32f6f2,_0x1da3de){return function(_0x59378d){if(_0x59378d){return _0x59378d[_0x1779('0x3a')]()[_0x1779('0x25')](function(){var _0x4002c6=_0x59378d[_0x1779('0x3b')]({'plain':!![]});var _0x5804a6='ChatWebsites';return db['UserProfileResource'][_0x1779('0x3a')]({'where':{'type':_0x5804a6,'resourceId':_0x4002c6['id']}})[_0x1779('0x25')](function(){return _0x59378d;});})[_0x1779('0x25')](function(){_0x32f6f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab898,_0x9a3d5d){return function(_0x1eb269){if(!_0x1eb269){_0x1ab898[_0x1779('0x2f')](0x194);}return _0x1eb269;};}function handleError(_0x412d54,_0x119220){_0x119220=_0x119220||0x1f4;return function(_0x2a9d2c){logger[_0x1779('0x2c')](_0x2a9d2c['stack']);if(_0x2a9d2c[_0x1779('0x3c')]){delete _0x2a9d2c[_0x1779('0x3c')];}_0x412d54[_0x1779('0x31')](_0x119220)[_0x1779('0x3d')](_0x2a9d2c);};}exports['index']=function(_0x9d0bf4,_0x236574){var _0x545e98={'include':[{'model':db[_0x1779('0x3e')],'as':_0x1779('0x3f')}]},_0x328b5f={},_0x5efa05={'count':0x0,'rows':[]};var _0x456350=_[_0x1779('0x40')](db[_0x1779('0x41')][_0x1779('0x42')],function(_0x1a76c3){return{'name':_0x1a76c3[_0x1779('0x43')],'type':_0x1a76c3[_0x1779('0x44')][_0x1779('0x45')]};});_0x328b5f[_0x1779('0x46')]=_[_0x1779('0x40')](_0x456350,_0x1779('0x3c'));_0x328b5f['query']=_[_0x1779('0x47')](_0x9d0bf4[_0x1779('0x48')]);_0x328b5f[_0x1779('0x49')]=_[_0x1779('0x4a')](_0x328b5f[_0x1779('0x46')],_0x328b5f[_0x1779('0x48')]);_0x545e98[_0x1779('0x4b')]=_[_0x1779('0x4a')](_0x328b5f[_0x1779('0x46')],qs['fields'](_0x9d0bf4['query']['fields']));_0x545e98[_0x1779('0x4b')]=_0x545e98['attributes'][_0x1779('0x4c')]?_0x545e98[_0x1779('0x4b')]:_0x328b5f[_0x1779('0x46')];if(!_0x9d0bf4[_0x1779('0x48')][_0x1779('0x4d')](_0x1779('0x4e'))){_0x545e98[_0x1779('0x35')]=qs[_0x1779('0x35')](_0x9d0bf4[_0x1779('0x48')][_0x1779('0x35')]);_0x545e98[_0x1779('0x34')]=qs['offset'](_0x9d0bf4[_0x1779('0x48')][_0x1779('0x34')]);}_0x545e98[_0x1779('0x4f')]=qs[_0x1779('0x50')](_0x9d0bf4['query']['sort']);_0x545e98['where']=qs[_0x1779('0x49')](_['pick'](_0x9d0bf4[_0x1779('0x48')],_0x328b5f[_0x1779('0x49')]),_0x456350);if(_0x9d0bf4[_0x1779('0x48')][_0x1779('0x51')]){_0x545e98['where']=_[_0x1779('0x52')](_0x545e98[_0x1779('0x53')],{'$or':_[_0x1779('0x40')](_0x456350,function(_0x5c434f){if(_0x5c434f[_0x1779('0x44')]!==_0x1779('0x54')){var _0x276d63={};_0x276d63[_0x5c434f[_0x1779('0x3c')]]={'$like':'%'+_0x9d0bf4[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x276d63;}})});}_0x545e98=_[_0x1779('0x52')]({},_0x545e98,_0x9d0bf4[_0x1779('0x55')]);var _0x116434={'where':_0x545e98[_0x1779('0x53')]};return db['ChatWebsite'][_0x1779('0x33')](_0x116434)['then'](function(_0x29b5de){_0x5efa05[_0x1779('0x33')]=_0x29b5de;if(_0x9d0bf4['query'][_0x1779('0x56')]){_0x545e98[_0x1779('0x57')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x545e98);})[_0x1779('0x25')](function(_0x10b022){_0x5efa05[_0x1779('0x58')]=_0x10b022;return _0x5efa05;})[_0x1779('0x25')](respondWithFilteredResult(_0x236574,_0x545e98))[_0x1779('0x2e')](handleError(_0x236574,null));};exports['show']=function(_0x47da77,_0x93d1ec){var _0x3b5668={'raw':![],'where':{'id':_0x47da77[_0x1779('0x59')]['id']},'include':[{'model':db[_0x1779('0x3e')],'as':_0x1779('0x3f')}]},_0x4cc5ea={};_0x4cc5ea['model']=_[_0x1779('0x47')](db[_0x1779('0x41')][_0x1779('0x42')]);_0x4cc5ea[_0x1779('0x48')]=_[_0x1779('0x47')](_0x47da77[_0x1779('0x48')]);_0x4cc5ea[_0x1779('0x49')]=_[_0x1779('0x4a')](_0x4cc5ea[_0x1779('0x46')],_0x4cc5ea[_0x1779('0x48')]);_0x3b5668[_0x1779('0x4b')]=_[_0x1779('0x4a')](_0x4cc5ea[_0x1779('0x46')],qs[_0x1779('0x5a')](_0x47da77[_0x1779('0x48')][_0x1779('0x5a')]));_0x3b5668[_0x1779('0x4b')]=_0x3b5668['attributes'][_0x1779('0x4c')]?_0x3b5668[_0x1779('0x4b')]:_0x4cc5ea['model'];if(_0x47da77[_0x1779('0x48')][_0x1779('0x56')]){_0x3b5668[_0x1779('0x57')]=[{'all':!![]}];}_0x3b5668=_[_0x1779('0x52')]({},_0x3b5668,_0x47da77['options']);return db['ChatWebsite']['find'](_0x3b5668)[_0x1779('0x25')](handleEntityNotFound(_0x93d1ec,null))[_0x1779('0x25')](respondWithResult(_0x93d1ec,null))['catch'](handleError(_0x93d1ec,null));};exports[_0x1779('0x5b')]=function(_0x7d1aaa,_0x2abb33){return db[_0x1779('0x41')][_0x1779('0x5b')](_0x7d1aaa[_0x1779('0x5c')],{})['then'](function(_0x3c3bf3){var _0x25134f=_0x7d1aaa[_0x1779('0x5d')]['get']({'plain':!![]});if(!_0x25134f)throw new Error(_0x1779('0x5e'));if(_0x25134f[_0x1779('0x5f')]===_0x1779('0x5d')){var _0x2b9274=_0x3c3bf3[_0x1779('0x3b')]({'plain':!![]});var _0x44b95e=_0x1779('0x60');return db[_0x1779('0x61')][_0x1779('0x62')]({'where':{'name':_0x44b95e,'userProfileId':_0x25134f[_0x1779('0x63')]},'raw':!![]})[_0x1779('0x25')](function(_0x3c1a7a){if(_0x3c1a7a&&_0x3c1a7a[_0x1779('0x64')]===0x0){return db['UserProfileResource'][_0x1779('0x5b')]({'name':_0x2b9274[_0x1779('0x3c')],'resourceId':_0x2b9274['id'],'type':_0x3c1a7a['name'],'sectionId':_0x3c1a7a['id']},{})['then'](function(){return _0x3c3bf3;});}else{return _0x3c3bf3;}})['catch'](function(_0x10e35d){logger[_0x1779('0x2c')](_0x1779('0x65'),_0x10e35d);throw _0x10e35d;});}return _0x3c3bf3;})['then'](respondWithResult(_0x2abb33,0xc9))['catch'](handleError(_0x2abb33,null));};exports[_0x1779('0x39')]=function(_0x30fb9c,_0xa33f34){if(_0x30fb9c['body']['id']){delete _0x30fb9c['body']['id'];}return db[_0x1779('0x41')]['find']({'where':{'id':_0x30fb9c['params']['id']},'include':[{'model':db[_0x1779('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x1779('0x25')](handleEntityNotFound(_0xa33f34,null))[_0x1779('0x25')](saveUpdates(_0x30fb9c['body'],null))['then'](respondWithResult(_0xa33f34,null))[_0x1779('0x2e')](handleError(_0xa33f34,null));};exports['destroy']=function(_0x1e90f0,_0x501e7f){return db['ChatWebsite'][_0x1779('0x62')]({'where':{'id':_0x1e90f0[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x501e7f,null))[_0x1779('0x25')](removeEntity(_0x501e7f,null))[_0x1779('0x2e')](handleError(_0x501e7f,null));};exports['describe']=function(_0xa85efb,_0x13e09d){return db[_0x1779('0x41')]['describe']()[_0x1779('0x25')](respondWithResult(_0x13e09d,null))['catch'](handleError(_0x13e09d,null));};exports[_0x1779('0x66')]=function(_0x5ef17f,_0x2aab13,_0x49348c){if(_0x5ef17f[_0x1779('0x5c')]['id']){delete _0x5ef17f['body']['id'];}return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x5ef17f[_0x1779('0x59')]['id']}})['then'](handleEntityNotFound(_0x2aab13,null))[_0x1779('0x25')](function(_0x4bb943){if(_0x4bb943){_0x5ef17f['body'][_0x1779('0x67')]=_0x4bb943['id'];return db[_0x1779('0x68')][_0x1779('0x5b')](_0x5ef17f['body']);}})[_0x1779('0x25')](respondWithResult(_0x2aab13,null))[_0x1779('0x2e')](handleError(_0x2aab13,null));};exports[_0x1779('0x69')]=function(_0x5da55b,_0x24b51f,_0x11c5c1){var _0xf91572={'raw':![],'where':{}};var _0x82103c={};var _0x3c1e81={'count':0x0,'rows':[]};return db[_0x1779('0x41')][_0x1779('0x6a')]({'where':{'id':_0x5da55b['params']['id']}})['then'](handleEntityNotFound(_0x24b51f,null))[_0x1779('0x25')](function(_0x1e2741){if(_0x1e2741){_0x82103c['model']=_['keys'](db['Disposition']['rawAttributes']);_0x82103c[_0x1779('0x48')]=_[_0x1779('0x47')](_0x5da55b[_0x1779('0x48')]);_0x82103c[_0x1779('0x49')]=_[_0x1779('0x4a')](_0x82103c[_0x1779('0x46')],_0x82103c[_0x1779('0x48')]);_0xf91572[_0x1779('0x4b')]=_[_0x1779('0x4a')](_0x82103c[_0x1779('0x46')],qs['fields'](_0x5da55b['query']['fields']));_0xf91572[_0x1779('0x4b')]=_0xf91572[_0x1779('0x4b')][_0x1779('0x4c')]?_0xf91572[_0x1779('0x4b')]:_0x82103c[_0x1779('0x46')];if(!_0x5da55b['query'][_0x1779('0x4d')](_0x1779('0x4e'))){_0xf91572[_0x1779('0x35')]=qs[_0x1779('0x35')](_0x5da55b['query'][_0x1779('0x35')]);_0xf91572['offset']=qs[_0x1779('0x34')](_0x5da55b[_0x1779('0x48')][_0x1779('0x34')]);}_0xf91572['order']=qs[_0x1779('0x50')](_0x5da55b[_0x1779('0x48')][_0x1779('0x50')]);_0xf91572[_0x1779('0x53')]=qs[_0x1779('0x49')](_['pick'](_0x5da55b[_0x1779('0x48')],_0x82103c[_0x1779('0x49')]));_0xf91572[_0x1779('0x53')][_0x1779('0x67')]=_0x1e2741['id'];if(_0x5da55b[_0x1779('0x48')][_0x1779('0x51')]){_0xf91572[_0x1779('0x53')]=_[_0x1779('0x52')](_0xf91572[_0x1779('0x53')],{'$or':_['map'](_0xf91572[_0x1779('0x4b')],function(_0x5aab8a){var _0x274625={};_0x274625[_0x5aab8a]={'$like':'%'+_0x5da55b[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x274625;})});}_0xf91572=_['merge']({},_0xf91572,_0x5da55b['options']);return db[_0x1779('0x68')][_0x1779('0x33')]({'where':_0xf91572['where']})[_0x1779('0x25')](function(_0x5674a1){_0x3c1e81[_0x1779('0x33')]=_0x5674a1;if(_0x5da55b[_0x1779('0x48')][_0x1779('0x56')]){_0xf91572[_0x1779('0x57')]=[{'all':!![]}];}return db[_0x1779('0x68')][_0x1779('0x6b')](_0xf91572);})[_0x1779('0x25')](function(_0x357c0e){_0x3c1e81[_0x1779('0x58')]=_0x357c0e;return _0x3c1e81;});}})[_0x1779('0x25')](respondWithFilteredResult(_0x24b51f,_0xf91572))[_0x1779('0x2e')](handleError(_0x24b51f,null));};exports['removeDispositions']=function(_0x43ee42,_0x555d3b,_0x407ae4){return db[_0x1779('0x41')]['find']({'where':{'id':_0x43ee42[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x555d3b,null))['then'](function(_0x4af279){if(_0x4af279){return _0x4af279['removeDispositions'](_0x43ee42['query']['ids']);}})[_0x1779('0x25')](respondWithStatusCode(_0x555d3b,null))[_0x1779('0x2e')](handleError(_0x555d3b,null));};exports[_0x1779('0x6c')]=function(_0x919480,_0x5ad64c,_0x52313d){if(_0x919480[_0x1779('0x5c')]['id']){delete _0x919480[_0x1779('0x5c')]['id'];}return db[_0x1779('0x41')]['find']({'where':{'id':_0x919480['params']['id']}})['then'](handleEntityNotFound(_0x5ad64c,null))[_0x1779('0x25')](function(_0x1ed042){if(_0x1ed042){_0x919480[_0x1779('0x5c')][_0x1779('0x67')]=_0x1ed042['id'];return db[_0x1779('0x6d')][_0x1779('0x5b')](_0x919480[_0x1779('0x5c')]);}})[_0x1779('0x25')](respondWithResult(_0x5ad64c,null))[_0x1779('0x2e')](handleError(_0x5ad64c,null));};exports['getAnswers']=function(_0x3a56c8,_0x24d064,_0x2612ec){var _0x257c98={'raw':![],'where':{}};var _0x216fa3={};var _0x4027ce={'count':0x0,'rows':[]};return db[_0x1779('0x41')]['findOne']({'where':{'id':_0x3a56c8[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x24d064,null))[_0x1779('0x25')](function(_0x1ec063){if(_0x1ec063){_0x216fa3[_0x1779('0x46')]=_[_0x1779('0x47')](db[_0x1779('0x6d')][_0x1779('0x42')]);_0x216fa3[_0x1779('0x48')]=_[_0x1779('0x47')](_0x3a56c8[_0x1779('0x48')]);_0x216fa3[_0x1779('0x49')]=_['intersection'](_0x216fa3[_0x1779('0x46')],_0x216fa3[_0x1779('0x48')]);_0x257c98[_0x1779('0x4b')]=_[_0x1779('0x4a')](_0x216fa3['model'],qs[_0x1779('0x5a')](_0x3a56c8['query']['fields']));_0x257c98['attributes']=_0x257c98[_0x1779('0x4b')][_0x1779('0x4c')]?_0x257c98[_0x1779('0x4b')]:_0x216fa3[_0x1779('0x46')];if(!_0x3a56c8['query']['hasOwnProperty'](_0x1779('0x4e'))){_0x257c98[_0x1779('0x35')]=qs[_0x1779('0x35')](_0x3a56c8[_0x1779('0x48')][_0x1779('0x35')]);_0x257c98['offset']=qs['offset'](_0x3a56c8[_0x1779('0x48')]['offset']);}_0x257c98[_0x1779('0x4f')]=qs['sort'](_0x3a56c8[_0x1779('0x48')][_0x1779('0x50')]);_0x257c98['where']=qs[_0x1779('0x49')](_[_0x1779('0x6e')](_0x3a56c8[_0x1779('0x48')],_0x216fa3[_0x1779('0x49')]));_0x257c98[_0x1779('0x53')][_0x1779('0x67')]=_0x1ec063['id'];if(_0x3a56c8[_0x1779('0x48')][_0x1779('0x51')]){_0x257c98[_0x1779('0x53')]=_[_0x1779('0x52')](_0x257c98['where'],{'$or':_['map'](_0x257c98[_0x1779('0x4b')],function(_0x2bd580){var _0x714189={};_0x714189[_0x2bd580]={'$like':'%'+_0x3a56c8[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x714189;})});}_0x257c98=_[_0x1779('0x52')]({},_0x257c98,_0x3a56c8['options']);return db['CannedAnswer']['count']({'where':_0x257c98['where']})[_0x1779('0x25')](function(_0xd2a1e){_0x4027ce[_0x1779('0x33')]=_0xd2a1e;if(_0x3a56c8[_0x1779('0x48')][_0x1779('0x56')]){_0x257c98['include']=[{'all':!![]}];}return db[_0x1779('0x6d')][_0x1779('0x6b')](_0x257c98);})[_0x1779('0x25')](function(_0x3327aa){_0x4027ce[_0x1779('0x58')]=_0x3327aa;return _0x4027ce;});}})[_0x1779('0x25')](respondWithFilteredResult(_0x24d064,_0x257c98))['catch'](handleError(_0x24d064,null));};exports[_0x1779('0x6f')]=function(_0x46fb8a,_0x5484c8,_0x57c910){return db['ChatWebsite'][_0x1779('0x62')]({'where':{'id':_0x46fb8a[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x5484c8,null))[_0x1779('0x25')](function(_0x1691c8){if(_0x1691c8){return _0x1691c8[_0x1779('0x6f')](_0x46fb8a['query'][_0x1779('0x70')]);}})[_0x1779('0x25')](respondWithStatusCode(_0x5484c8,null))[_0x1779('0x2e')](handleError(_0x5484c8,null));};exports[_0x1779('0x71')]=function(_0x50cfa6,_0x5716f2,_0x5d70c1){_0x50cfa6[_0x1779('0x5c')][_0x1779('0x72')]=_0x50cfa6[_0x1779('0x73')][_0x1779('0x74')];return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x50cfa6[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x5716f2,null))[_0x1779('0x25')](saveUpdates(_0x50cfa6[_0x1779('0x5c')],null))['then'](respondWithResult(_0x5716f2,null))[_0x1779('0x2e')](handleError(_0x5716f2,null));};exports[_0x1779('0x75')]=function(_0x24b0c0,_0x1e5ee8,_0x1d45a1){_0x24b0c0[_0x1779('0x5c')]['agentAvatar']=_0x24b0c0['file'][_0x1779('0x74')];return db['ChatWebsite'][_0x1779('0x62')]({'where':{'id':_0x24b0c0['params']['id']}})['then'](handleEntityNotFound(_0x1e5ee8,null))[_0x1779('0x25')](saveUpdates(_0x24b0c0['body'],null))[_0x1779('0x25')](respondWithResult(_0x1e5ee8,null))['catch'](handleError(_0x1e5ee8,null));};exports[_0x1779('0x76')]=function(_0x328b9a,_0x36238d,_0x40507d){_0x328b9a[_0x1779('0x5c')][_0x1779('0x77')]=_0x328b9a[_0x1779('0x73')]['filename'];return db[_0x1779('0x41')]['find']({'where':{'id':_0x328b9a[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x36238d,null))[_0x1779('0x25')](saveUpdates(_0x328b9a['body'],null))[_0x1779('0x25')](respondWithResult(_0x36238d,null))['catch'](handleError(_0x36238d,null));};exports[_0x1779('0x78')]=function(_0x238d1f,_0x35137f,_0xd7904e){_0x238d1f[_0x1779('0x5c')]['systemAvatar']=_0x238d1f['file']['filename'];return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x238d1f[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x35137f,null))['then'](saveUpdates(_0x238d1f[_0x1779('0x5c')],null))[_0x1779('0x25')](respondWithResult(_0x35137f,null))[_0x1779('0x2e')](handleError(_0x35137f,null));};exports['getLogo']=function(_0x3f6c2f,_0x33fde1,_0x3b5c94){var _0x2478ed=path['join'](config[_0x1779('0x79')],_0x1779('0x7a'));var _0xb4b48f={'where':{'id':_0x3f6c2f[_0x1779('0x59')]['id']},'attributes':['id',_0x1779('0x72')],'raw':!![]};var _0x1b252b=![];return require(_0x1779('0x1b'))[_0x1779('0x7b')]()[_0x1779('0x25')](function(_0x19f322){if(_0x19f322){_0x1b252b=_0x19f322[_0x1779('0x7c')];}})[_0x1779('0x25')](function(){return db[_0x1779('0x41')][_0x1779('0x62')](_0xb4b48f);})['then'](handleEntityNotFound(_0x33fde1,null))['then'](function(_0x2ea1be){if(_0x2ea1be){if(!_[_0x1779('0x7d')](_0x2ea1be['sitepic'])){if(fs[_0x1779('0x7e')](path[_0x1779('0x7f')](config[_0x1779('0x79')],_0x1779('0x80'),_0x2ea1be[_0x1779('0x72')]))&&_0x1b252b){_0x2478ed=path[_0x1779('0x7f')](config['root'],_0x1779('0x80'),_0x2ea1be['sitepic']);}}return _0x33fde1[_0x1779('0x81')](_0x2478ed);}})[_0x1779('0x2e')](handleError(_0x33fde1,null));};exports['getAvatar']=function(_0x22eafd,_0xca9260,_0x3ddef9){var _0x1263cb=path[_0x1779('0x7f')](config[_0x1779('0x79')],'server/files/images/avatars/default_avatar.png');var _0x2ee7a5={'where':{'id':_0x22eafd[_0x1779('0x59')]['id']},'attributes':['id',_0x1779('0x82')],'raw':!![]};return db[_0x1779('0x41')]['find'](_0x2ee7a5)[_0x1779('0x25')](handleEntityNotFound(_0xca9260,null))[_0x1779('0x25')](function(_0x1f7018){if(_0x1f7018){if(!_[_0x1779('0x7d')](_0x1f7018[_0x1779('0x82')])){if(fs[_0x1779('0x7e')](path[_0x1779('0x7f')](config['root'],'server/files/images/avatars/',_0x1f7018['agentAvatar']))){_0x1263cb=path[_0x1779('0x7f')](config['root'],_0x1779('0x83'),_0x1f7018['agentAvatar']);}}return _0xca9260[_0x1779('0x81')](_0x1263cb);}})[_0x1779('0x2e')](handleError(_0xca9260,null));};exports[_0x1779('0x84')]=function(_0x298561,_0x2d457c,_0x10b0d2){var _0x2fefb8=path[_0x1779('0x7f')](config[_0x1779('0x79')],'server/files/images/avatars/customer_avatar.png');var _0x66eb54={'where':{'id':_0x298561[_0x1779('0x59')]['id']},'attributes':['id',_0x1779('0x77'),_0x1779('0x85')],'raw':!![]};return db[_0x1779('0x41')][_0x1779('0x62')](_0x66eb54)[_0x1779('0x25')](handleEntityNotFound(_0x2d457c,null))[_0x1779('0x25')](function(_0x2872ed){if(_0x2872ed){if(!_[_0x1779('0x7d')](_0x2872ed[_0x1779('0x77')])){if(fs[_0x1779('0x7e')](path[_0x1779('0x7f')](config[_0x1779('0x79')],_0x1779('0x83'),_0x2872ed[_0x1779('0x77')]))&&_0x2872ed[_0x1779('0x85')]){_0x2fefb8=path[_0x1779('0x7f')](config[_0x1779('0x79')],_0x1779('0x83'),_0x2872ed['customerAvatar']);}}return _0x2d457c[_0x1779('0x81')](_0x2fefb8);}})[_0x1779('0x2e')](handleError(_0x2d457c,null));};exports['getSystemAvatar']=function(_0x596a85,_0x72b7bb,_0x21f2c6){var _0x268673=path[_0x1779('0x7f')](config[_0x1779('0x79')],_0x1779('0x86'));var _0x2dd3e3={'where':{'id':_0x596a85['params']['id']},'attributes':['id',_0x1779('0x87')],'raw':!![]};return db['ChatWebsite'][_0x1779('0x62')](_0x2dd3e3)[_0x1779('0x25')](handleEntityNotFound(_0x72b7bb,null))[_0x1779('0x25')](function(_0x374b0e){if(_0x374b0e){if(!_[_0x1779('0x7d')](_0x374b0e[_0x1779('0x87')])){if(fs[_0x1779('0x7e')](path['join'](config['root'],_0x1779('0x83'),_0x374b0e['systemAvatar']))){_0x268673=path['join'](config[_0x1779('0x79')],'server/files/images/avatars/',_0x374b0e[_0x1779('0x87')]);}}return _0x72b7bb[_0x1779('0x81')](_0x268673);}})['catch'](handleError(_0x72b7bb,null));};exports[_0x1779('0x88')]=function(_0x273e88,_0x1fff8b,_0x5c6673){var _0xc8f6cb=require(_0x1779('0x89'));var _0x493bcd=new _0xc8f6cb();var _0x58f933=_0x493bcd[_0x1779('0x8a')](_0x273e88['headers']['user-agent'])[_0x1779('0x8b')]();var _0x2747e4={'body':_0x273e88[_0x1779('0x5c')],'channel':_0x1779('0x8c')};var _0x6a893d=[];var _0x2fe12c=[];var _0x569695={};var _0x584de5=![];return db[_0x1779('0x8d')]['describe']()[_0x1779('0x25')](function(_0x105e5a){if(!_0x105e5a){throw new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0x90'));}_0x6a893d=_[_0x1779('0x91')](_[_0x1779('0x47')](_0x105e5a),[_0x1779('0x92'),_0x1779('0x93')]);_0x2fe12c=_[_0x1779('0x91')](_[_0x1779('0x47')](_0x105e5a),['createdAt',_0x1779('0x93'),'CompanyId',_0x1779('0x94')]);if(_0x273e88[_0x1779('0x5c')]['id']){delete _0x273e88['body']['id'];}if(_[_0x1779('0x7d')](_0x273e88['body'][_0x1779('0x95')])){throw new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0x96'));}if(_[_0x1779('0x7d')](_0x273e88[_0x1779('0x5c')][_0x1779('0x5c')])||_0x273e88[_0x1779('0x5c')][_0x1779('0x5c')]===''){throw new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0x97'));}if(_[_0x1779('0x7d')](_0x273e88[_0x1779('0x5c')][_0x1779('0x98')])){throw new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0x99')+_0x2fe12c);}if(!_[_0x1779('0x9a')](_0x2fe12c,_0x273e88[_0x1779('0x5c')]['mapKey'])){throw new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2fe12c);}_0x569695[_0x273e88[_0x1779('0x5c')][_0x1779('0x98')]]=_0x273e88[_0x1779('0x5c')]['from'];})[_0x1779('0x25')](function(){return db[_0x1779('0x41')]['find']({'where':{'id':_0x273e88['params']['id']},'include':[{'model':db[_0x1779('0x9b')],'as':_0x1779('0x9c'),'include':[{'model':db[_0x1779('0x8d')],'as':'Contacts','where':_0x569695,'limit':0x1,'order':[['updatedAt',_0x1779('0x9d')]]}]},{'model':db[_0x1779('0x9e')],'as':_0x1779('0x9f')}]});})[_0x1779('0x25')](handleEntityNotFound(_0x1fff8b,null))['then'](function(_0x2a1c42){if(_0x2a1c42&&_0x2a1c42[_0x1779('0x9c')]){_0x2747e4['account']=_0x2a1c42;_0x2747e4[_0x1779('0xa0')]=_0x2a1c42[_0x1779('0x9f')];_0x2747e4[_0x1779('0xa1')]=_0x2a1c42['List'];_0x2747e4[_0x1779('0xa0')]=_['orderBy'](_0x2747e4['applications'],['priority'],[_0x1779('0xa2')]);if(_0x2747e4['account']['Applications']){delete _0x2747e4[_0x1779('0xa3')][_0x1779('0x9f')];}if(_0x2747e4[_0x1779('0xa3')][_0x1779('0x9c')]&&_0x2747e4[_0x1779('0xa3')][_0x1779('0x9c')][_0x1779('0xa4')][_0x1779('0x4c')]){return _0x2747e4[_0x1779('0xa3')][_0x1779('0x9c')][_0x1779('0xa4')][0x0];}var _0x2a26e6=_[_0x1779('0x1d')](_0x273e88['body'],{'firstName':_0x273e88[_0x1779('0x5c')][_0x1779('0x95')],'ListId':_0x2a1c42[_0x1779('0x94')]});_0x2a26e6[_0x273e88[_0x1779('0x5c')][_0x1779('0x98')]]=_0x273e88[_0x1779('0x5c')]['from'];return db['CmContact'][_0x1779('0x5b')](_0x2a26e6,{'fields':_0x6a893d,'raw':!![]});}})[_0x1779('0x25')](handleEntityNotFound(_0x1fff8b,null))[_0x1779('0x25')](function(_0x529bfc){_0x2747e4['contact']=_0x529bfc;var _0x20f75f=_0x273e88[_0x1779('0x5c')][_0x1779('0xa5')];if(_0x273e88[_0x1779('0xa6')][_0x1779('0xa7')]){_0x20f75f=_0x273e88['headers'][_0x1779('0xa7')];}else if(_0x273e88[_0x1779('0xa6')][_0x1779('0xa8')]){_0x20f75f=_[_0x1779('0xa9')](_0x273e88[_0x1779('0xa6')]['x-forwarded-for']['split'](','));}if(_0x529bfc){var _0x4d2175={'ContactId':_0x529bfc['id'],'ChatWebsiteId':_0x273e88[_0x1779('0x59')]['id'],'from':(_0x529bfc[_0x1779('0xaa')]||'')+'\x20'+(_0x529bfc['lastName']||''),'customerIp':_0x20f75f,'customerPort':_0x273e88['headers'][_0x1779('0xab')]?_0x273e88[_0x1779('0xa6')][_0x1779('0xab')]:null,'referer':_0x273e88[_0x1779('0x5c')]['referer'],'browserName':_0x58f933[_0x1779('0xac')]['name']&&_0x58f933[_0x1779('0xac')][_0x1779('0xad')]?util[_0x1779('0xae')]('%s\x20%s',_0x58f933['browser']['name'],_0x58f933[_0x1779('0xac')][_0x1779('0xad')]):'unknown','browserVersion':_0x58f933['browser'][_0x1779('0xad')]||_0x1779('0xaf'),'osName':util['format'](_0x1779('0xb0'),_0x58f933['os'][_0x1779('0x3c')],_0x58f933['os'][_0x1779('0xad')]),'osVersion':_0x58f933['os'][_0x1779('0xad')],'deviceModel':_0x58f933['device'][_0x1779('0x46')]&&_0x58f933[_0x1779('0xb1')][_0x1779('0xb2')]?util[_0x1779('0xae')](_0x1779('0xb3'),_0x58f933['device']['model'],_0x58f933[_0x1779('0xb1')][_0x1779('0xb2')],_0x58f933[_0x1779('0xb1')][_0x1779('0x44')]):null,'deviceVendor':_0x58f933[_0x1779('0xb1')][_0x1779('0xb2')],'deviceType':_0x58f933[_0x1779('0xb1')][_0x1779('0x44')],'formData':JSON['stringify'](_0x273e88['body'])};var _0x2b3bc8={'ChatWebsiteId':_0x273e88[_0x1779('0x59')]['id'],'closed':![]};if(_0x273e88[_0x1779('0x5c')][_0x1779('0xb4')]){_0x2b3bc8[_0x1779('0xb4')]=_0x273e88['body'][_0x1779('0xb4')];return db['ChatInteraction'][_0x1779('0x62')]({'where':_0x2b3bc8})[_0x1779('0x25')](function(_0x2d9d5f){if(_0x2d9d5f){return[_0x2d9d5f,![]];}_0x4d2175[_0x1779('0xb4')]=_0x273e88[_0x1779('0x5c')][_0x1779('0xb4')];_0x4d2175['externalUrl']=_0x273e88[_0x1779('0x5c')][_0x1779('0xb5')];return db[_0x1779('0xb6')][_0x1779('0x5b')](_0x4d2175)[_0x1779('0x25')](function(_0x4250f1){return[_0x4250f1,!![]];});});}_0x2b3bc8[_0x1779('0xb7')]=_0x529bfc['id'];if(_0x273e88[_0x1779('0x5c')][_0x1779('0xb8')]&&_0x273e88['body']['interaction']['id']){_0x2b3bc8['id']=_0x273e88['body'][_0x1779('0xb8')]['id'];return db['ChatInteraction'][_0x1779('0x62')]({'where':_0x2b3bc8})['then'](function(_0x571de1){if(_0x571de1){return[_0x571de1,![]];}return db[_0x1779('0xb6')][_0x1779('0x5b')](_0x4d2175)[_0x1779('0x25')](function(_0x139b29){return[_0x139b29,!![]];});});}return db['ChatInteraction'][_0x1779('0x5b')](_0x4d2175)[_0x1779('0x25')](function(_0x851f45){return[_0x851f45,!![]];});}})[_0x1779('0xb9')](function(_0x22c271,_0x37fe04){if(_0x22c271){_0x584de5=_0x37fe04;if(!_0x37fe04){var _0x541a10={'from':(_0x2747e4['contact'][_0x1779('0xaa')]||'')+'\x20'+(_0x2747e4[_0x1779('0xba')][_0x1779('0xbb')]||'')};if(_0x273e88[_0x1779('0x5c')][_0x1779('0xb4')]&&_0x273e88[_0x1779('0x5c')][_0x1779('0xbc')]&&_0x273e88[_0x1779('0x5c')][_0x1779('0xb4')]!=_0x273e88[_0x1779('0x5c')]['messageId']){_0x541a10[_0x1779('0xb4')]=_0x273e88[_0x1779('0x5c')][_0x1779('0xbc')];}return _0x22c271[_0x1779('0x39')](_0x541a10);}else{return _0x22c271;}}})[_0x1779('0x25')](function(_0x5d0a2c){_0x2747e4['interaction']=_0x5d0a2c[_0x1779('0x3b')]({'plain':!![]});_0x2747e4[_0x1779('0xb8')]['created']=_0x584de5;if(_0x2747e4[_0x1779('0xb8')]['created']){if(_0x2747e4[_0x1779('0xa3')][_0x1779('0xbd')]){_0x2747e4['applications']['push']({'id':0x0,'priority':_0x2747e4['applications'][_0x1779('0x4c')]+0x1,'app':_0x1779('0xbe'),'appdata':_0x1779('0xbf'),'interval':_0x1779('0xc0')});}}return db[_0x1779('0xc1')][_0x1779('0x5b')]({'body':_0x273e88[_0x1779('0x5c')][_0x1779('0x5c')],'ChatWebsiteId':_0x273e88[_0x1779('0x59')]['id'],'ChatInteractionId':_0x5d0a2c['id'],'direction':'in','ContactId':_0x2747e4[_0x1779('0xba')]['id'],'AttachmentId':_0x273e88[_0x1779('0x5c')]['AttachmentId']});})[_0x1779('0x25')](function(_0x1f7e17){_0x2747e4[_0x1779('0x2d')]=_0x1f7e17;if(_0x2747e4[_0x1779('0xb8')]['UserId']){return db['User'][_0x1779('0x62')]({'attributes':['id','name'],'where':{'id':_0x2747e4[_0x1779('0xb8')][_0x1779('0xc2')]}})['then'](function(_0x3f892b){if(_0x3f892b){_0x2747e4[_0x1779('0xa0')][_0x1779('0xc3')]({'id':0x0,'priority':0x0,'app':_0x1779('0xc4'),'appdata':_0x3f892b['name']+','+(_0x2747e4[_0x1779('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x2747e4[_0x1779('0xc5')]=!![];}return respondWithRpcPromise(_0x1779('0xc6'),_0x1779('0xc7'),_0x2747e4);});}return respondWithRpcPromise(_0x1779('0xc6'),_0x1779('0xc7'),_0x2747e4);})['then'](function(_0xbd263){respondWithRpcPromise('EventManager','EventManager',{'event':_0x1779('0x88'),'message':_0xbd263},client9002);return _0xbd263;})[_0x1779('0x25')](respondWithResult(_0x1fff8b,null))[_0x1779('0x2e')](handleError(_0x1fff8b,null));};exports[_0x1779('0xc8')]=function(_0x44ed72,_0x4662dd,_0x580880){var _0x45d97e,_0x707007,_0x2f18df;var _0x467c88=[];var _0xefc1ff=[];var _0x16daa8={};return db[_0x1779('0x8d')]['describe']()[_0x1779('0x25')](function(_0x3822a2){if(!_0x3822a2){throw new db[(_0x1779('0x8e'))]['ValidationError']('no\x20available\x20attributes');}_0xefc1ff=_['difference'](_['keys'](_0x3822a2),[_0x1779('0x92'),_0x1779('0x93')]);_0x467c88=_[_0x1779('0x91')](_[_0x1779('0x47')](_0x3822a2),['createdAt','updatedAt',_0x1779('0xc9'),'ListId']);if(_0x44ed72['body']['id']){delete _0x44ed72['body']['id'];}if(_[_0x1779('0x7d')](_0x44ed72[_0x1779('0x5c')][_0x1779('0x95')])){throw _0x4662dd[_0x1779('0x31')](0x1f4)[_0x1779('0x3d')](new db['Sequelize'][(_0x1779('0x8f'))]('from\x20is\x20mandatory'));}if(_[_0x1779('0x7d')](_0x44ed72[_0x1779('0x5c')][_0x1779('0x5c')])||_0x44ed72[_0x1779('0x5c')]['body']===''){throw _0x4662dd[_0x1779('0x31')](0x1f4)['send'](new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0x97')));}if(_[_0x1779('0x7d')](_0x44ed72[_0x1779('0x5c')][_0x1779('0xca')])){throw _0x4662dd[_0x1779('0x31')](0x1f4)[_0x1779('0x3d')](new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0xcb')+_0x467c88));}if(!_['includes'](_0x467c88,_0x44ed72[_0x1779('0x5c')][_0x1779('0xca')])){throw _0x4662dd['status'](0x1f4)[_0x1779('0x3d')](new db[(_0x1779('0x8e'))][(_0x1779('0x8f'))](_0x1779('0xcc')+_0x467c88));}_0x16daa8[_0x44ed72[_0x1779('0x5c')][_0x1779('0xca')]]=_0x44ed72[_0x1779('0x5c')][_0x1779('0x95')];})['then'](function(){return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x44ed72[_0x1779('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x1779('0x9c')}]});})[_0x1779('0x25')](handleEntityNotFound(_0x4662dd,null))['then'](function(_0x1ac0d1){if(_0x1ac0d1&&_0x1ac0d1[_0x1779('0x9c')]){_0x707007=_0x1ac0d1;var _0x253edb=_[_0x1779('0x1d')](_0x44ed72[_0x1779('0x5c')],{'firstName':_0x44ed72[_0x1779('0x5c')][_0x1779('0x95')],'phone':_0x44ed72[_0x1779('0x5c')][_0x1779('0x95')],'ListId':_0x1ac0d1['ListId']});_0x253edb[_0x44ed72[_0x1779('0x5c')][_0x1779('0xca')]]=_0x44ed72['body'][_0x1779('0x95')];return db['CmContact'][_0x1779('0xcd')]({'where':_0x16daa8,'defaults':_0x253edb});}})[_0x1779('0xb9')](function(_0x4eec0a){if(_0x4eec0a){_0x2f18df=_0x4eec0a;var _0x3c7619=fs['readFileSync'](path[_0x1779('0x7f')](config[_0x1779('0x79')],_0x1779('0xce')),_0x1779('0xcf'));var _0x32addf=ejs[_0x1779('0xd0')](_0x3c7619,{'body':_['toPairs'](_0x44ed72['body'][_0x1779('0x5c')]),'bodyTitle':_0x707007[_0x1779('0xd1')]});return db[_0x1779('0xd2')][_0x1779('0x5b')]({'body':_0x32addf,'ContactId':_0x4eec0a['id'],'ChatWebsiteId':_0x707007['id']});}})[_0x1779('0x25')](function(_0x2b6251){if(_0x2b6251){_0x45d97e=_0x2b6251;return db[_0x1779('0xd3')][_0x1779('0x6a')]({'where':{'service':!![]},'include':[{'model':db[_0x1779('0xd4')],'as':'Smtp','raw':!![]}]});}})[_0x1779('0x25')](function(_0x247ed8){if(_0x247ed8&&_0x247ed8[_0x1779('0xd5')]&&_0x707007[_0x1779('0xd6')]){var _0x59a355={'tls':{'rejectUnauthorized':![]}};if(_0x247ed8[_0x1779('0xd5')]['service']){_0x59a355[_0x1779('0xd7')]=_0x247ed8[_0x1779('0xd5')][_0x1779('0xd7')];}else{_0x59a355[_0x1779('0xd8')]=_0x247ed8['Smtp'][_0x1779('0xd8')];_0x59a355[_0x1779('0xd9')]=_0x247ed8[_0x1779('0xd5')][_0x1779('0xd9')];_0x59a355['secure']=_0x247ed8[_0x1779('0xd5')]['secure'];}if(_0x247ed8[_0x1779('0xd5')][_0x1779('0xda')]){_0x59a355[_0x1779('0xdb')]={'user':_0x247ed8[_0x1779('0xd5')][_0x1779('0x5d')],'pass':_0x247ed8['Smtp']['pass']};}return respondWithRpcPromise(_0x1779('0xdc'),'sendMail',{'account':_0x59a355,'message':{'from':util[_0x1779('0xae')](_0x1779('0xdd'),_0x247ed8[_0x1779('0x3c')],_0x247ed8[_0x1779('0xde')]||_0x247ed8[_0x1779('0xd5')][_0x1779('0x5d')]),'to':_0x707007[_0x1779('0xd6')],'subject':_0x707007[_0x1779('0xdf')],'text':_0x45d97e['body']}},client9003)['then'](function(){return _0x45d97e;})['catch'](function(_0x188469){console[_0x1779('0x2c')](_0x188469);});}})[_0x1779('0x25')](function(){if(_0x45d97e){return _0x45d97e;}})[_0x1779('0x25')](respondWithResult(_0x4662dd,null))['catch'](handleError(_0x4662dd,null));};exports['addInteraction']=function(_0x144397,_0xe6ae0d,_0xc75853){return db[_0x1779('0xb6')][_0x1779('0x62')]({'where':{'id':_0x144397[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0xe6ae0d,null))[_0x1779('0x25')](function(_0x1856c7){if(_0x1856c7){return _0x1856c7[_0x1779('0xe0')](_0x144397[_0x1779('0x5c')]['ids'],_[_0x1779('0xe1')](_0x144397['body'],['ids','id'])||{});}})[_0x1779('0x25')](respondWithResult(_0xe6ae0d,null))[_0x1779('0x2e')](handleError(_0xe6ae0d,null));};exports[_0x1779('0xe2')]=function(_0x86292,_0x1716a3,_0x57a3a5){var _0x2cbef3={'raw':![],'where':{}};var _0x5b3268={};var _0x878e6c={'count':0x0,'rows':[]};return db[_0x1779('0x41')]['findOne']({'where':{'id':_0x86292['params']['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x1716a3,null))[_0x1779('0x25')](function(_0x21d3cf){if(_0x21d3cf){_0x5b3268[_0x1779('0x46')]=_[_0x1779('0x47')](db[_0x1779('0xb6')][_0x1779('0x42')]);_0x5b3268[_0x1779('0x48')]=_[_0x1779('0x47')](_0x86292[_0x1779('0x48')]);_0x5b3268[_0x1779('0x49')]=_['intersection'](_0x5b3268[_0x1779('0x46')],_0x5b3268[_0x1779('0x48')]);_0x2cbef3['attributes']=_[_0x1779('0x4a')](_0x5b3268['model'],qs[_0x1779('0x5a')](_0x86292[_0x1779('0x48')]['fields']));_0x2cbef3['attributes']=_0x2cbef3[_0x1779('0x4b')][_0x1779('0x4c')]?_0x2cbef3[_0x1779('0x4b')]:_0x5b3268[_0x1779('0x46')];if(!_0x86292[_0x1779('0x48')][_0x1779('0x4d')](_0x1779('0x4e'))){_0x2cbef3[_0x1779('0x35')]=qs['limit'](_0x86292['query'][_0x1779('0x35')]);_0x2cbef3[_0x1779('0x34')]=qs['offset'](_0x86292[_0x1779('0x48')][_0x1779('0x34')]);}_0x2cbef3['order']=qs['sort'](_0x86292[_0x1779('0x48')][_0x1779('0x50')]);_0x2cbef3['where']=qs[_0x1779('0x49')](_['pick'](_0x86292[_0x1779('0x48')],_0x5b3268[_0x1779('0x49')]));_0x2cbef3[_0x1779('0x53')][_0x1779('0x67')]=_0x21d3cf['id'];if(_0x86292[_0x1779('0x48')][_0x1779('0x51')]){_0x2cbef3[_0x1779('0x53')]=_[_0x1779('0x52')](_0x2cbef3[_0x1779('0x53')],{'$or':_[_0x1779('0x40')](_0x2cbef3[_0x1779('0x4b')],function(_0x5477ed){var _0x2b57e7={};_0x2b57e7[_0x5477ed]={'$like':'%'+_0x86292[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x2b57e7;})});}_0x2cbef3=_[_0x1779('0x52')]({},_0x2cbef3,_0x86292[_0x1779('0x55')]);return db[_0x1779('0xb6')][_0x1779('0x33')]({'where':_0x2cbef3['where']})[_0x1779('0x25')](function(_0x4d011f){_0x878e6c['count']=_0x4d011f;if(_0x86292[_0x1779('0x48')][_0x1779('0x56')]){_0x2cbef3['include']=[{'model':db[_0x1779('0x8d')],'as':_0x1779('0xe3'),'required':![]},{'model':db[_0x1779('0xe4')],'as':'Owner','attributes':[_0x1779('0x3c'),_0x1779('0xe5'),_0x1779('0xe6')],'required':![]},{'model':db[_0x1779('0xe7')],'as':'Tags','attributes':['id',_0x1779('0x3c'),_0x1779('0xe8')],'where':_0x86292[_0x1779('0x48')][_0x1779('0xe9')]?{'id':_0x86292[_0x1779('0x48')][_0x1779('0xe9')]}:undefined,'required':_0x86292['query']['tag']?!![]:![]}];}return db[_0x1779('0xb6')][_0x1779('0x6b')](_0x2cbef3);})[_0x1779('0x25')](function(_0x38471e){_0x878e6c[_0x1779('0x58')]=_0x38471e;return _0x878e6c;});}})[_0x1779('0x25')](respondWithFilteredResult(_0x1716a3,_0x2cbef3))[_0x1779('0x2e')](handleError(_0x1716a3,null));};function iftimePromise(_0x12415a,_0x5edd3e){return respondWithRpcPromise('Command',_0x1779('0xea'),{'command':_0x5edd3e[_0x1779('0xeb')]?util[_0x1779('0xae')](_0x1779('0xec'),_0x12415a[_0x1779('0xed')],_0x5edd3e[_0x1779('0xeb')]):util[_0x1779('0xae')]('iftime\x20%s',_0x12415a[_0x1779('0xed')])},client9002)[_0x1779('0x25')](function(_0x12263c){var _0x2a54e2=_0x12263c&&_0x12263c[_0x1779('0xee')](_0x1779('0xef'))>=0x0?!![]:![];logger[_0x1779('0x26')](_0x1779('0xf0'),_0x5edd3e['id'],_0x12415a['id'],_0x12415a[_0x1779('0xed')],_0x2a54e2?_0x1779('0xf1'):_0x1779('0xf2'),_0x5edd3e[_0x1779('0xeb')]?_0x5edd3e['timezone']:_0x1779('0xf3'));return _0x2a54e2;})[_0x1779('0x2e')](function(_0x3766a3){logger['error'](_0x1779('0xf0'),_0x5edd3e['id'],_0x12415a['id'],_0x12415a['interval'],util[_0x1779('0xf4')](_0x3766a3,{'showHidden':![],'depth':null}),_0x5edd3e[_0x1779('0xeb')]?_0x5edd3e[_0x1779('0xeb')]:_0x1779('0xf3'));return![];});}exports['getSnippet']=function(_0x2fee15,_0x5a858b,_0x52cdda){var _0x2a02f2=0x0;var _0x178064=0x0;var _0x404ff1=![];var _0xb9bceb;var _0x4252f0;return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x2fee15[_0x1779('0x59')]['id']},'include':[{'model':db[_0x1779('0xf5')],'as':_0x1779('0xf5'),'include':[{'model':db[_0x1779('0xf5')],'as':'Intervals','attributes':['id',_0x1779('0xed')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5a858b,null))[_0x1779('0x25')](function(_0x4c8a74){if(_0x4c8a74){_0xb9bceb=_0x4c8a74;return _0x4c8a74['getProactiveActions']({'raw':!![]});}})[_0x1779('0x25')](function(_0x5e0a6e){if(_0xb9bceb){if(_0x5e0a6e){_0x4252f0=_0x5e0a6e;}}return require(_0x1779('0x1b'))[_0x1779('0x7b')]();})[_0x1779('0x25')](function(_0x42ed2a){if(_0x42ed2a){_0x178064=_0x42ed2a['virtual'];_0x404ff1=_0x42ed2a[_0x1779('0x7c')];}})[_0x1779('0x25')](function(){return db[_0x1779('0xb6')]['count']({'where':{'closed':![]}});})[_0x1779('0x25')](function(_0x4738fb){_0x2a02f2=_0x4738fb;if(_0x178064&&_0x4738fb>_0x178064){return db[_0x1779('0xf6')][_0x1779('0x6a')]({'where':{'id':0x1}})[_0x1779('0x25')](function(_0x4125b7){if(_0x4125b7){_0x4125b7[_0x1779('0xf7')](_0x1779('0xf8'));}});}})[_0x1779('0x25')](function(){if(_0xb9bceb['Interval']&&_0xb9bceb[_0x1779('0xf5')]['Intervals']){var _0xc1d1fa=[];for(var _0x1213e8=0x0;_0x1213e8<_0xb9bceb[_0x1779('0xf5')][_0x1779('0xf9')][_0x1779('0x4c')];_0x1213e8++){var _0x2a0b19=_0xb9bceb[_0x1779('0xf5')][_0x1779('0xf9')][_0x1213e8][_0x1779('0x3b')]({'plain':!![]});_0xc1d1fa[_0x1779('0xfa')](iftimePromise(_0x2a0b19,_0xb9bceb));}return BPromise['all'](_0xc1d1fa)[_0x1779('0x25')](function(_0x555223){return _[_0x1779('0xfb')](_0x555223);});}else{return!![];}})[_0x1779('0x25')](function(_0x5d8f6d){var _0x4ae3fc=fs[_0x1779('0xfc')](path['join'](config['root'],_0x1779('0xfd')),'utf8');var _0x37905b={'remote':_0xb9bceb[_0x1779('0xfe')],'query':querystring[_0x1779('0x2b')](_[_0x1779('0x52')](_0xb9bceb['get']({'plain':!![]}),{'customerIp':_0x2fee15[_0x1779('0xa6')][_0x1779('0xa8')]||_0x2fee15[_0x1779('0xa6')]['x-real-ip']||_0x2fee15[_0x1779('0xff')][_0x1779('0x100')]||_0x2fee15['ip'],'referer':_0x2fee15[_0x1779('0xa6')][_0x1779('0x101')],'openedInteractions':_0x2a02f2,'maxInteractions':_0x178064,'virtual':_0x404ff1[_0x1779('0x102')],'online':_0x5d8f6d,'custom':_0x404ff1}))[_0x1779('0x103')](/'/g,'\x5c\x27')};_0x5a858b['send'](ejs[_0x1779('0xd0')](Mustache[_0x1779('0xd0')](_0x4ae3fc,_0x37905b),{'proactiveActions':_0x4252f0,'alignment':_0xb9bceb[_0x1779('0x104')],'verticalAlignment':_0xb9bceb['verticalAlignment'],'div_color':_0xb9bceb['color'],'text_color':_0xb9bceb['textColor']}));})[_0x1779('0x2e')](handleError(_0x5a858b,null));};exports[_0x1779('0x105')]=function(_0x3bf1e5,_0x44a8ca,_0x2e4b32){return db['ChatWebsite']['findOne']({'where':{'id':_0x3bf1e5[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x44a8ca,null))[_0x1779('0x25')](function(_0x3ab7c9){if(_0x3ab7c9){return db[_0x1779('0x106')][_0x1779('0x107')](function(_0x1da2f8){return db['ChatApplication'][_0x1779('0x3a')]({'where':{'ChatWebsiteId':_0x3bf1e5[_0x1779('0x59')]['id']},'transaction':_0x1da2f8})[_0x1779('0x25')](function(_0x48ec3c){var _0xeffe81=_[_0x1779('0x40')](_0x3bf1e5['body'],function(_0x4d81ae){_0x4d81ae[_0x1779('0x67')]=_0x3bf1e5['params']['id'];return _0x4d81ae;});return db[_0x1779('0x9e')][_0x1779('0x108')](_0xeffe81,{'transaction':_0x1da2f8});});})[_0x1779('0x25')](function(){return db[_0x1779('0x9e')][_0x1779('0x109')]({'where':{'ChatWebsiteId':_0x3bf1e5['params']['id']},'order':_0x1779('0x10a')});});}})[_0x1779('0x25')](respondWithResult(_0x44a8ca,null))[_0x1779('0x2e')](handleError(_0x44a8ca,null));};exports[_0x1779('0x10b')]=function(_0x928a6,_0x2f2125,_0x4eb054){var _0x1e5410={};var _0x56ab6b={};var _0x1adabd;var _0x2dd0bd;return db[_0x1779('0x41')][_0x1779('0x6a')]({'where':{'id':_0x928a6['params']['id']}})['then'](handleEntityNotFound(_0x2f2125,null))[_0x1779('0x25')](function(_0x3cb3cc){if(_0x3cb3cc){_0x1adabd=_0x3cb3cc;_0x56ab6b[_0x1779('0x46')]=_[_0x1779('0x47')](db[_0x1779('0x9e')][_0x1779('0x42')]);_0x56ab6b['query']=_[_0x1779('0x47')](_0x928a6[_0x1779('0x48')]);_0x56ab6b[_0x1779('0x49')]=_['intersection'](_0x56ab6b[_0x1779('0x46')],_0x56ab6b['query']);_0x1e5410['attributes']=_[_0x1779('0x4a')](_0x56ab6b[_0x1779('0x46')],qs[_0x1779('0x5a')](_0x928a6['query'][_0x1779('0x5a')]));_0x1e5410[_0x1779('0x4b')]=_0x1e5410['attributes'][_0x1779('0x4c')]?_0x1e5410[_0x1779('0x4b')]:_0x56ab6b[_0x1779('0x46')];_0x1e5410[_0x1779('0x4f')]=qs[_0x1779('0x50')](_0x928a6[_0x1779('0x48')]['sort']);_0x1e5410[_0x1779('0x53')]=qs['filters'](_[_0x1779('0x6e')](_0x928a6['query'],_0x56ab6b[_0x1779('0x49')]));if(_0x928a6[_0x1779('0x48')][_0x1779('0x51')]){_0x1e5410[_0x1779('0x53')]=_[_0x1779('0x52')](_0x1e5410[_0x1779('0x53')],{'$or':_[_0x1779('0x40')](_0x1e5410[_0x1779('0x4b')],function(_0x591f0b){var _0x3a331b={};_0x3a331b[_0x591f0b]={'$like':'%'+_0x928a6[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x3a331b;})});}_0x1e5410=_[_0x1779('0x52')]({},_0x1e5410,_0x928a6['options']);return _0x1adabd[_0x1779('0x10b')](_0x1e5410);}})['then'](function(_0x58275e){if(_0x58275e){_0x2dd0bd=_0x58275e['length'];if(!_0x928a6[_0x1779('0x48')]['hasOwnProperty']('nolimit')){_0x1e5410[_0x1779('0x35')]=qs['limit'](_0x928a6[_0x1779('0x48')][_0x1779('0x35')]);_0x1e5410[_0x1779('0x34')]=qs[_0x1779('0x34')](_0x928a6['query']['offset']);}return _0x1adabd['getApplications'](_0x1e5410);}})[_0x1779('0x25')](function(_0x363bdd){if(_0x363bdd){return _0x363bdd?{'count':_0x2dd0bd,'rows':_0x363bdd}:null;}})['then'](respondWithResult(_0x2f2125,null))['catch'](handleError(_0x2f2125,null));};exports[_0x1779('0x10c')]=function(_0x4b96a5,_0x469d84,_0x475f95){return db[_0x1779('0x10d')]['find']({'where':{'id':_0x4b96a5[_0x1779('0x59')]['id']}})['then'](handleEntityNotFound(_0x469d84,null))[_0x1779('0x25')](function(_0x5c2c92){if(_0x5c2c92){return _0x5c2c92['addProactiveActions'](_0x4b96a5[_0x1779('0x5c')][_0x1779('0x70')],_[_0x1779('0xe1')](_0x4b96a5['body'],[_0x1779('0x70'),'id'])||{});}})['then'](respondWithResult(_0x469d84,null))[_0x1779('0x2e')](handleError(_0x469d84,null));};exports[_0x1779('0x10e')]=function(_0x370c77,_0x43187a,_0x2bd780){var _0x20ebea={};var _0x5ea109={};var _0x5831c6;var _0x310dce;return db[_0x1779('0x41')][_0x1779('0x6a')]({'where':{'id':_0x370c77[_0x1779('0x59')]['id']}})['then'](handleEntityNotFound(_0x43187a,null))['then'](function(_0x19ef0a){if(_0x19ef0a){_0x5831c6=_0x19ef0a;_0x5ea109[_0x1779('0x46')]=_['keys'](db[_0x1779('0x10f')]['rawAttributes']);_0x5ea109[_0x1779('0x48')]=_[_0x1779('0x47')](_0x370c77[_0x1779('0x48')]);_0x5ea109[_0x1779('0x49')]=_[_0x1779('0x4a')](_0x5ea109[_0x1779('0x46')],_0x5ea109['query']);_0x20ebea[_0x1779('0x4b')]=_['intersection'](_0x5ea109[_0x1779('0x46')],qs[_0x1779('0x5a')](_0x370c77[_0x1779('0x48')][_0x1779('0x5a')]));_0x20ebea[_0x1779('0x4b')]=_0x20ebea['attributes']['length']?_0x20ebea['attributes']:_0x5ea109[_0x1779('0x46')];_0x20ebea[_0x1779('0x4f')]=qs[_0x1779('0x50')](_0x370c77['query'][_0x1779('0x50')]);_0x20ebea['where']=qs[_0x1779('0x49')](_[_0x1779('0x6e')](_0x370c77['query'],_0x5ea109['filters']));if(_0x370c77['query'][_0x1779('0x51')]){_0x20ebea[_0x1779('0x53')]=_['merge'](_0x20ebea[_0x1779('0x53')],{'$or':_[_0x1779('0x40')](_0x20ebea['attributes'],function(_0x10208d){var _0x3c68ac={};_0x3c68ac[_0x10208d]={'$like':'%'+_0x370c77[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x3c68ac;})});}_0x20ebea=_[_0x1779('0x52')]({},_0x20ebea,_0x370c77[_0x1779('0x55')]);return _0x5831c6[_0x1779('0x10e')](_0x20ebea);}})[_0x1779('0x25')](function(_0xa0a06f){if(_0xa0a06f){_0x310dce=_0xa0a06f[_0x1779('0x4c')];if(!_0x370c77['query'][_0x1779('0x4d')](_0x1779('0x4e'))){_0x20ebea['limit']=qs[_0x1779('0x35')](_0x370c77['query'][_0x1779('0x35')]);_0x20ebea[_0x1779('0x34')]=qs['offset'](_0x370c77[_0x1779('0x48')]['offset']);}return _0x5831c6[_0x1779('0x10e')](_0x20ebea);}})[_0x1779('0x25')](function(_0x304d33){if(_0x304d33){return _0x304d33?{'count':_0x310dce,'rows':_0x304d33}:null;}})['then'](respondWithResult(_0x43187a,null))[_0x1779('0x2e')](handleError(_0x43187a,null));};exports[_0x1779('0x110')]=function(_0x5273b7,_0x305df6,_0x2143a3){var _0x771074=_0x5273b7[_0x1779('0x48')]['online']===_0x1779('0x111')?_0x1779('0x112'):_0x1779('0x113');return db['ChatWebsite']['find']({'attributes':['id',_0x771074],'where':{'id':_0x5273b7[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x305df6,null))['then'](function(_0x450863){if(_0x450863){var _0x43d299=_0x450863[_0x771074];var _0x546cbf=_0x43d299&&_0x43d299[_0x1779('0x114')]?_0x43d299[_0x1779('0x114')]:[];_0x305df6[_0x1779('0x3d')]({'fromKey':_[_0x1779('0x7d')](_0x43d299[_0x1779('0x115')])?undefined:_0x43d299[_0x1779('0x115')],'count':_0x546cbf[_0x1779('0x4c')],'rows':_0x546cbf});}})[_0x1779('0x2e')](handleError(_0x305df6,null));};exports['getOfflineMessages']=function(_0x377425,_0x36c52e,_0x1d8a93){var _0xda2fb5={'raw':![],'where':{}};var _0x832ca2={};var _0xb31c6d={'count':0x0,'rows':[]};return db[_0x1779('0x41')]['findOne']({'where':{'id':_0x377425['params']['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x36c52e,null))['then'](function(_0x4983e3){if(_0x4983e3){_0x832ca2['model']=_[_0x1779('0x47')](db[_0x1779('0xd2')][_0x1779('0x42')]);_0x832ca2[_0x1779('0x48')]=_[_0x1779('0x47')](_0x377425[_0x1779('0x48')]);_0x832ca2[_0x1779('0x49')]=_[_0x1779('0x4a')](_0x832ca2[_0x1779('0x46')],_0x832ca2['query']);_0xda2fb5[_0x1779('0x4b')]=_['intersection'](_0x832ca2['model'],qs[_0x1779('0x5a')](_0x377425['query'][_0x1779('0x5a')]));_0xda2fb5['attributes']=_0xda2fb5[_0x1779('0x4b')][_0x1779('0x4c')]?_0xda2fb5[_0x1779('0x4b')]:_0x832ca2['model'];if(!_0x377425[_0x1779('0x48')][_0x1779('0x4d')](_0x1779('0x4e'))){_0xda2fb5[_0x1779('0x35')]=qs['limit'](_0x377425[_0x1779('0x48')][_0x1779('0x35')]);_0xda2fb5[_0x1779('0x34')]=qs[_0x1779('0x34')](_0x377425[_0x1779('0x48')]['offset']);}_0xda2fb5['order']=qs['sort'](_0x377425[_0x1779('0x48')]['sort']);_0xda2fb5[_0x1779('0x53')]=qs[_0x1779('0x49')](_[_0x1779('0x6e')](_0x377425['query'],_0x832ca2[_0x1779('0x49')]));_0xda2fb5[_0x1779('0x53')]['ChatWebsiteId']=_0x4983e3['id'];if(_0x377425[_0x1779('0x48')][_0x1779('0x51')]){_0xda2fb5[_0x1779('0x53')]=_[_0x1779('0x52')](_0xda2fb5[_0x1779('0x53')],{'$or':_['map'](_0xda2fb5[_0x1779('0x4b')],function(_0x3773c7){var _0x1d50a4={};_0x1d50a4[_0x3773c7]={'$like':'%'+_0x377425['query']['filter']+'%'};return _0x1d50a4;})});}_0xda2fb5=_[_0x1779('0x52')]({},_0xda2fb5,_0x377425[_0x1779('0x55')]);return db[_0x1779('0xd2')][_0x1779('0x33')]({'where':_0xda2fb5[_0x1779('0x53')]})[_0x1779('0x25')](function(_0x12a255){_0xb31c6d[_0x1779('0x33')]=_0x12a255;if(_0x377425['query']['includeAll']){_0xda2fb5[_0x1779('0x57')]=[{'all':!![]}];}else{_0xda2fb5[_0x1779('0x57')]=[{'model':db[_0x1779('0x8d')],'as':_0x1779('0xe3'),'required':![]}];}return db[_0x1779('0xd2')]['findAll'](_0xda2fb5);})[_0x1779('0x25')](function(_0x4dd5d2){_0xb31c6d['rows']=_0x4dd5d2;return _0xb31c6d;});}})[_0x1779('0x25')](respondWithFilteredResult(_0x36c52e,_0xda2fb5))[_0x1779('0x2e')](handleError(_0x36c52e,null));};exports[_0x1779('0x116')]=function(_0x2c11ef,_0x181287,_0x53be52){return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x2c11ef['params']['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x181287,null))[_0x1779('0x25')](function(_0x1ed058){if(_0x1ed058){return _0x1ed058[_0x1779('0x116')](_0x2c11ef['body'][_0x1779('0x70')],_[_0x1779('0xe1')](_0x2c11ef[_0x1779('0x5c')],[_0x1779('0x70'),'id'])||{})[_0x1779('0xb9')](function(_0x28ac53){for(var _0x52de17=0x0;_0x52de17<_0x2c11ef[_0x1779('0x5c')][_0x1779('0x70')][_0x1779('0x4c')];_0x52de17+=0x1){socket[_0x1779('0x117')]('userChatWebsite:save',{'UserId':_0x2c11ef[_0x1779('0x5c')][_0x1779('0x70')][_0x52de17],'ChatWebsiteId':_0x2c11ef[_0x1779('0x59')]['id']});}return _0x28ac53;});}})[_0x1779('0x25')](respondWithResult(_0x181287,null))[_0x1779('0x2e')](handleError(_0x181287,null));};exports[_0x1779('0x118')]=function(_0x1fe8c7,_0x48206b,_0x1d62fc){return db[_0x1779('0x41')][_0x1779('0x62')]({'where':{'id':_0x1fe8c7[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x48206b,null))[_0x1779('0x25')](function(_0x5895dd){if(_0x5895dd){return _0x5895dd[_0x1779('0x118')](_0x1fe8c7['query']['ids'])[_0x1779('0x25')](function(){if(_[_0x1779('0x119')](_0x1fe8c7[_0x1779('0x48')][_0x1779('0x70')])){for(var _0x4a5c36=0x0;_0x4a5c36<_0x1fe8c7['query'][_0x1779('0x70')][_0x1779('0x4c')];_0x4a5c36+=0x1){socket[_0x1779('0x117')](_0x1779('0x11a'),{'UserId':Number(_0x1fe8c7['query']['ids'][_0x4a5c36]),'ChatWebsiteId':Number(_0x1fe8c7[_0x1779('0x59')]['id'])});}}else{socket[_0x1779('0x117')](_0x1779('0x11a'),{'UserId':Number(_0x1fe8c7[_0x1779('0x48')][_0x1779('0x70')]),'ChatWebsiteId':Number(_0x1fe8c7[_0x1779('0x59')]['id'])});}});}})[_0x1779('0x25')](respondWithStatusCode(_0x48206b,null))['catch'](handleError(_0x48206b,null));};exports[_0x1779('0x11b')]=function(_0x5b9d58,_0x4a57d4,_0xc2200){var _0x13ea6f={};var _0x2f7bfa={};var _0x15adc7;var _0xba34a7;return db[_0x1779('0x41')]['findOne']({'where':{'id':_0x5b9d58[_0x1779('0x59')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x4a57d4,null))[_0x1779('0x25')](function(_0x158db8){if(_0x158db8){_0x15adc7=_0x158db8;_0x2f7bfa[_0x1779('0x46')]=_[_0x1779('0x47')](db[_0x1779('0xe4')][_0x1779('0x42')]);_0x2f7bfa[_0x1779('0x48')]=_[_0x1779('0x47')](_0x5b9d58[_0x1779('0x48')]);_0x2f7bfa[_0x1779('0x49')]=_['intersection'](_0x2f7bfa[_0x1779('0x46')],_0x2f7bfa[_0x1779('0x48')]);_0x13ea6f[_0x1779('0x4b')]=_[_0x1779('0x4a')](_0x2f7bfa['model'],qs['fields'](_0x5b9d58[_0x1779('0x48')][_0x1779('0x5a')]));_0x13ea6f[_0x1779('0x4b')]=_0x13ea6f[_0x1779('0x4b')]['length']?_0x13ea6f[_0x1779('0x4b')]:_0x2f7bfa[_0x1779('0x46')];_0x13ea6f[_0x1779('0x4f')]=qs[_0x1779('0x50')](_0x5b9d58['query'][_0x1779('0x50')]);_0x13ea6f[_0x1779('0x53')]=qs['filters'](_['pick'](_0x5b9d58[_0x1779('0x48')],_0x2f7bfa[_0x1779('0x49')]));if(_0x5b9d58[_0x1779('0x48')][_0x1779('0x51')]){_0x13ea6f[_0x1779('0x53')]=_[_0x1779('0x52')](_0x13ea6f['where'],{'$or':_['map'](_0x13ea6f[_0x1779('0x4b')],function(_0x54c11e){var _0x330eae={};_0x330eae[_0x54c11e]={'$like':'%'+_0x5b9d58[_0x1779('0x48')][_0x1779('0x51')]+'%'};return _0x330eae;})});}_0x13ea6f=_[_0x1779('0x52')]({},_0x13ea6f,_0x5b9d58['options']);return _0x15adc7[_0x1779('0x11b')](_0x13ea6f);}})[_0x1779('0x25')](function(_0x2a9c55){if(_0x2a9c55){_0xba34a7=_0x2a9c55[_0x1779('0x4c')];if(!_0x5b9d58['query'][_0x1779('0x4d')]('nolimit')){_0x13ea6f['limit']=qs[_0x1779('0x35')](_0x5b9d58[_0x1779('0x48')][_0x1779('0x35')]);_0x13ea6f['offset']=qs['offset'](_0x5b9d58['query'][_0x1779('0x34')]);}return _0x15adc7[_0x1779('0x11b')](_0x13ea6f);}})['then'](function(_0x1afeed){if(_0x1afeed){return _0x1afeed?{'count':_0xba34a7,'rows':_0x1afeed}:null;}})[_0x1779('0x25')](respondWithResult(_0x4a57d4,null))[_0x1779('0x2e')](handleError(_0x4a57d4,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3ee4504..aab4403 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 _0xa1a5=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x198b4d,_0xd5c48e){_0x198b4d=_0x198b4d-0x0;var _0x4546e9=_0xa1a5[_0x198b4d];return _0x4546e9;};'use strict';var EventEmitter=require(_0x5a1a('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x5a1a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5a1a('0x2')](0x0);var events={'afterCreate':_0x5a1a('0x3'),'afterUpdate':_0x5a1a('0x4'),'afterDestroy':_0x5a1a('0x5')};function emitEvent(_0x57cba4){return function(_0x3d3652,_0x12138d,_0xfbcda1){ChatWebsiteEvents[_0x5a1a('0x6')](_0x57cba4+':'+_0x3d3652['id'],_0x3d3652);ChatWebsiteEvents[_0x5a1a('0x6')](_0x57cba4,_0x3d3652);_0xfbcda1(null);};}for(var e in events){if(events[_0x5a1a('0x7')](e)){var event=events[e];ChatWebsite[_0x5a1a('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe599=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x210051,_0x58a9eb){var _0x2f7709=function(_0x56aeb2){while(--_0x56aeb2){_0x210051['push'](_0x210051['shift']());}};_0x2f7709(++_0x58a9eb);}(_0xe599,0x1e5));var _0x9e59=function(_0x472531,_0x1d2b2c){_0x472531=_0x472531-0x0;var _0x1922ec=_0xe599[_0x472531];return _0x1922ec;};'use strict';var EventEmitter=require(_0x9e59('0x0'));var ChatWebsite=require(_0x9e59('0x1'))['db'][_0x9e59('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9e59('0x3')](0x0);var events={'afterCreate':_0x9e59('0x4'),'afterUpdate':_0x9e59('0x5'),'afterDestroy':_0x9e59('0x6')};function emitEvent(_0x296a98){return function(_0x3b40cc,_0x568c08,_0x156af6){ChatWebsiteEvents[_0x9e59('0x7')](_0x296a98+':'+_0x3b40cc['id'],_0x3b40cc);ChatWebsiteEvents['emit'](_0x296a98,_0x3b40cc);_0x156af6(null);};}for(var e in events){if(events[_0x9e59('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9e59('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index e783f0c..ab532ea 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 _0x6953=['../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','bluebird','path','rimraf'];(function(_0x3bb651,_0xe2503e){var _0x429075=function(_0x47980f){while(--_0x47980f){_0x3bb651['push'](_0x3bb651['shift']());}};_0x429075(++_0xe2503e);}(_0x6953,0x91));var _0x3695=function(_0x57b96a,_0x14b0cc){_0x57b96a=_0x57b96a-0x0;var _0x53f527=_0x6953[_0x57b96a];return _0x53f527;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3695('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3695('0x3'));var rimraf=require(_0x3695('0x4'));var config=require(_0x3695('0x5'));var attributes=require('./chatWebsite.attributes');module[_0x3695('0x6')]=function(_0x558026,_0x2d7d98){return _0x558026[_0x3695('0x7')](_0x3695('0x8'),attributes,{'tableName':_0x3695('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00b3=['util','../../config/logger','api','moment','request-promise','rimraf','./chatWebsite.attributes','exports','chat_websites'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x00b3,0x17a));var _0x300b=function(_0x5cc9e3,_0xf8dc92){_0x5cc9e3=_0x5cc9e3-0x0;var _0x555212=_0x00b3[_0x5cc9e3];return _0x555212;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var logger=require(_0x300b('0x1'))(_0x300b('0x2'));var moment=require(_0x300b('0x3'));var BPromise=require('bluebird');var rp=require(_0x300b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x300b('0x5'));var config=require('../../config/environment');var attributes=require(_0x300b('0x6'));module[_0x300b('0x7')]=function(_0x3a8c64,_0x10b0a2){return _0x3a8c64['define']('ChatWebsite',attributes,{'tableName':_0x300b('0x8'),'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 7e6378e..bd68b56 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 _0x524e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment'];(function(_0x539709,_0x2c9edd){var _0x73cc7e=function(_0x5d20ea){while(--_0x5d20ea){_0x539709['push'](_0x539709['shift']());}};_0x73cc7e(++_0x2c9edd);}(_0x524e,0x15e));var _0xe524=function(_0x31aa51,_0x64a752){_0x31aa51=_0x31aa51-0x0;var _0x5612bd=_0x524e[_0x31aa51];return _0x5612bd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});config[_0xe524('0xb')]=_[_0xe524('0xc')](config['redis'],{'host':_0xe524('0xd'),'port':0x18eb});var socket=require(_0xe524('0xe'))(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xf'))[_0xe524('0x10')](socket);function respondWithRpcPromise(_0x4082b1,_0x1a08e2,_0xb3eb9f){return new BPromise(function(_0x1b75bd,_0x1641ec){return client[_0xe524('0x11')](_0x4082b1,_0xb3eb9f)[_0xe524('0x12')](function(_0x1184df){logger[_0xe524('0x13')](_0xe524('0x14'),_0x1a08e2,_0xe524('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'),JSON[_0xe524('0x16')](_0x1184df));if(_0x1184df[_0xe524('0x17')]){if(_0x1184df[_0xe524('0x17')][_0xe524('0x18')]===0x1f4){logger['error'](_0xe524('0x14'),_0x1a08e2,_0x1184df['error'][_0xe524('0x19')]);return _0x1641ec(_0x1184df[_0xe524('0x17')]['message']);}logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x1184df[_0xe524('0x17')]['message']);return _0x1b75bd(_0x1184df[_0xe524('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0xe524('0x15'));_0x1b75bd(_0x1184df['result'][_0xe524('0x19')]);}})[_0xe524('0x1a')](function(_0x278de9){logger[_0xe524('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a08e2,_0x278de9);_0x1641ec(_0x278de9);});});}
\ No newline at end of file
+var _0x687b=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x4be0e0,_0x55c777){var _0x5c8b77=function(_0x23cc3e){while(--_0x23cc3e){_0x4be0e0['push'](_0x4be0e0['shift']());}};_0x5c8b77(++_0x55c777);}(_0x687b,0x14a));var _0xb687=function(_0x3d9cfa,_0x596edc){_0x3d9cfa=_0x3d9cfa-0x0;var _0x21d89d=_0x687b[_0x3d9cfa];return _0x21d89d;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});config[_0xb687('0xc')]=_[_0xb687('0xd')](config['redis'],{'host':_0xb687('0xe'),'port':0x18eb});var socket=require(_0xb687('0xf'))(new Redis(config['redis']));require(_0xb687('0x10'))[_0xb687('0x11')](socket);function respondWithRpcPromise(_0x825ad,_0x15dc9a,_0x404fdb){return new BPromise(function(_0x309d84,_0x3e6271){return client[_0xb687('0x12')](_0x825ad,_0x404fdb)[_0xb687('0x13')](function(_0x5103b9){logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));logger[_0xb687('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x15dc9a,'request\x20sent',JSON[_0xb687('0x18')](_0x5103b9));if(_0x5103b9[_0xb687('0x19')]){if(_0x5103b9['error'][_0xb687('0x1a')]===0x1f4){logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x3e6271(_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);}logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x309d84(_0x5103b9[_0xb687('0x19')]['message']);}else{logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));_0x309d84(_0x5103b9['result']['message']);}})[_0xb687('0x1c')](function(_0x3a10ef){logger[_0xb687('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x15dc9a,_0x3a10ef);_0x3e6271(_0x3a10ef);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 11f824e..b41c6ef 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(_0x4eec46,_0x513505){var _0x125ca7=function(_0x6cdfb6){while(--_0x6cdfb6){_0x4eec46['push'](_0x4eec46['shift']());}};_0x125ca7(++_0x513505);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2f06e0,_0x2e1c2a){_0x2f06e0=_0x2f06e0-0x0;var _0xf2711b=_0x5f2f[_0x2f06e0];return _0xf2711b;};'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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x2a5042,_0x307d04){var _0x4bc22f=function(_0x2ef928){while(--_0x2ef928){_0x2a5042['push'](_0x2a5042['shift']());}};_0x4bc22f(++_0x307d04);}(_0xb10b,0x12a));var _0xbb10=function(_0xbd3a05,_0xe6c6b7){_0xbd3a05=_0xbd3a05-0x0;var _0x101f90=_0xb10b[_0xbd3a05];return _0x101f90;};'use strict';var ChatWebsiteEvents=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(){ChatWebsiteEvents[_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);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index cb4b9b9..c943e1a 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 _0xbe7f=['/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','join','server/files/images/avatars/','/:id/avatar','originalname','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','/:id/interactions','addInteraction','addProactiveActions','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','get','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbe7f,0xa7));var _0xfbe7=function(_0x23d7a7,_0x4b0f57){_0x23d7a7=_0x23d7a7-0x0;var _0x43f390=_0xbe7f[_0x23d7a7];return _0x43f390;};'use strict';var multer=require(_0xfbe7('0x0'));var util=require(_0xfbe7('0x1'));var path=require(_0xfbe7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfbe7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xfbe7('0x4'));var config=require(_0xfbe7('0x5'));var controller=require(_0xfbe7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xfbe7('0x7')]);router['get'](_0xfbe7('0x8'),auth[_0xfbe7('0x9')](),controller['describe']);router[_0xfbe7('0xa')]('/:id',auth[_0xfbe7('0x9')](),controller['show']);router['get'](_0xfbe7('0xb'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0xc')]);router['get'](_0xfbe7('0xd'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0xe')]);router['get'](_0xfbe7('0xf'),controller[_0xfbe7('0x10')]);router[_0xfbe7('0xa')]('/:id/avatar',controller['getAvatar']);router['get'](_0xfbe7('0x11'),controller[_0xfbe7('0x12')]);router[_0xfbe7('0xa')]('/:id/system_avatar',controller[_0xfbe7('0x13')]);router[_0xfbe7('0xa')]('/:id/interactions',auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x14')]);router[_0xfbe7('0xa')]('/:id/snippet',controller[_0xfbe7('0x15')]);router[_0xfbe7('0xa')](_0xfbe7('0x16'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x17')]);router['get'](_0xfbe7('0x18'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x19')]);router[_0xfbe7('0xa')](_0xfbe7('0x1a'),controller[_0xfbe7('0x1b')]);router[_0xfbe7('0xa')](_0xfbe7('0x1c'),auth['isAuthenticated'](),controller[_0xfbe7('0x1d')]);router[_0xfbe7('0xa')](_0xfbe7('0x1e'),auth[_0xfbe7('0x9')](),controller['getAgents']);router[_0xfbe7('0x1f')]('/',auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x20')]);router[_0xfbe7('0x1f')](_0xfbe7('0xb'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x21')]);router[_0xfbe7('0x1f')]('/:id/canned_answers',auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x22')]);var upload=multer({'storage':multer[_0xfbe7('0x23')]({'destination':function(_0x12f0dd,_0x4f3273,_0x31252d){_0x31252d(null,path['join'](config[_0xfbe7('0x24')],_0xfbe7('0x25')));},'filename':function(_0x2bb79c,_0x1cdba9,_0x162438){_0x162438(null,util[_0xfbe7('0x26')](_0xfbe7('0x27'),Date[_0xfbe7('0x28')](),_0x1cdba9['originalname']));}})});router['post'](_0xfbe7('0xf'),upload['single'](_0xfbe7('0x29')),controller[_0xfbe7('0x2a')]);var upload=multer({'storage':multer[_0xfbe7('0x23')]({'destination':function(_0x2253d1,_0x2328b7,_0x46264e){_0x46264e(null,path[_0xfbe7('0x2b')](config[_0xfbe7('0x24')],_0xfbe7('0x2c')));},'filename':function(_0x20e300,_0x151f25,_0x1b994){_0x1b994(null,util['format'](_0xfbe7('0x27'),Date['now'](),_0x151f25['originalname']));}})});router['post'](_0xfbe7('0x2d'),upload['single'](_0xfbe7('0x29')),controller['addAvatar']);var upload=multer({'storage':multer[_0xfbe7('0x23')]({'destination':function(_0x430428,_0x3ff9cb,_0x571593){_0x571593(null,path[_0xfbe7('0x2b')](config[_0xfbe7('0x24')],_0xfbe7('0x2c')));},'filename':function(_0x37a41d,_0x42c612,_0x5e4e66){_0x5e4e66(null,util[_0xfbe7('0x26')](_0xfbe7('0x27'),Date[_0xfbe7('0x28')](),_0x42c612[_0xfbe7('0x2e')]));}})});router[_0xfbe7('0x1f')](_0xfbe7('0x11'),upload[_0xfbe7('0x2f')](_0xfbe7('0x29')),controller[_0xfbe7('0x30')]);var upload=multer({'storage':multer[_0xfbe7('0x23')]({'destination':function(_0x2e8215,_0x236fe8,_0x4c7c8f){_0x4c7c8f(null,path[_0xfbe7('0x2b')](config[_0xfbe7('0x24')],_0xfbe7('0x2c')));},'filename':function(_0x2942b7,_0x5e2e3e,_0x3aada4){_0x3aada4(null,util[_0xfbe7('0x26')](_0xfbe7('0x27'),Date['now'](),_0x5e2e3e[_0xfbe7('0x2e')]));}})});router[_0xfbe7('0x1f')](_0xfbe7('0x31'),upload[_0xfbe7('0x2f')](_0xfbe7('0x29')),controller[_0xfbe7('0x32')]);router[_0xfbe7('0x1f')](_0xfbe7('0x33'),controller[_0xfbe7('0x34')]);router[_0xfbe7('0x1f')](_0xfbe7('0x35'),controller[_0xfbe7('0x36')]);router[_0xfbe7('0x1f')](_0xfbe7('0x37'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x38')]);router['post'](_0xfbe7('0x16'),auth[_0xfbe7('0x9')](),controller['addApplications']);router['post'](_0xfbe7('0x18'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x39')]);router[_0xfbe7('0x1f')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xfbe7('0x3a')](_0xfbe7('0x3b'),auth['isAuthenticated'](),controller[_0xfbe7('0x3c')]);router[_0xfbe7('0x3d')](_0xfbe7('0x3b'),auth[_0xfbe7('0x9')](),controller['destroy']);router[_0xfbe7('0x3d')](_0xfbe7('0xb'),auth['isAuthenticated'](),controller[_0xfbe7('0x3e')]);router[_0xfbe7('0x3d')]('/:id/canned_answers',auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x3f')]);router[_0xfbe7('0x3d')](_0xfbe7('0x1e'),auth[_0xfbe7('0x9')](),controller[_0xfbe7('0x40')]);module['exports']=router;
\ No newline at end of file
+var _0x5f3e=['put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','addLogo','server/files/images/avatars/','originalname','file','addAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction'];(function(_0x407b52,_0x5ddf71){var _0x58f49c=function(_0x1bd2cb){while(--_0x1bd2cb){_0x407b52['push'](_0x407b52['shift']());}};_0x58f49c(++_0x5ddf71);}(_0x5f3e,0x117));var _0xe5f3=function(_0x3d9167,_0x2439d3){_0x3d9167=_0x3d9167-0x0;var _0x3c85be=_0x5f3e[_0x3d9167];return _0x3c85be;};'use strict';var multer=require(_0xe5f3('0x0'));var util=require(_0xe5f3('0x1'));var path=require(_0xe5f3('0x2'));var timeout=require(_0xe5f3('0x3'));var express=require(_0xe5f3('0x4'));var router=express[_0xe5f3('0x5')]();var auth=require(_0xe5f3('0x6'));var interaction=require(_0xe5f3('0x7'));var config=require(_0xe5f3('0x8'));var controller=require(_0xe5f3('0x9'));router[_0xe5f3('0xa')]('/',auth['isAuthenticated'](),controller[_0xe5f3('0xb')]);router[_0xe5f3('0xa')](_0xe5f3('0xc'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0xe')]);router[_0xe5f3('0xa')](_0xe5f3('0xf'),auth['isAuthenticated'](),controller[_0xe5f3('0x10')]);router['get'](_0xe5f3('0x11'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x12')]);router[_0xe5f3('0xa')](_0xe5f3('0x13'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x14')]);router[_0xe5f3('0xa')]('/:id/logo',controller[_0xe5f3('0x15')]);router[_0xe5f3('0xa')](_0xe5f3('0x16'),controller[_0xe5f3('0x17')]);router[_0xe5f3('0xa')](_0xe5f3('0x18'),controller[_0xe5f3('0x19')]);router[_0xe5f3('0xa')](_0xe5f3('0x1a'),controller['getSystemAvatar']);router[_0xe5f3('0xa')](_0xe5f3('0x1b'),auth['isAuthenticated'](),controller[_0xe5f3('0x1c')]);router[_0xe5f3('0xa')](_0xe5f3('0x1d'),controller[_0xe5f3('0x1e')]);router[_0xe5f3('0xa')](_0xe5f3('0x1f'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x20')]);router[_0xe5f3('0xa')](_0xe5f3('0x21'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x22')]);router[_0xe5f3('0xa')](_0xe5f3('0x23'),controller[_0xe5f3('0x24')]);router[_0xe5f3('0xa')]('/:id/offline_messages',auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x25')]);router[_0xe5f3('0xa')](_0xe5f3('0x26'),auth['isAuthenticated'](),controller[_0xe5f3('0x27')]);router[_0xe5f3('0x28')]('/',auth[_0xe5f3('0xd')](),controller['create']);router[_0xe5f3('0x28')](_0xe5f3('0x11'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x29')]);router[_0xe5f3('0x28')](_0xe5f3('0x13'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x2a')]);var upload=multer({'storage':multer[_0xe5f3('0x2b')]({'destination':function(_0x3c1797,_0x5309a7,_0x3dd7a6){_0x3dd7a6(null,path[_0xe5f3('0x2c')](config[_0xe5f3('0x2d')],_0xe5f3('0x2e')));},'filename':function(_0x5618cc,_0x1074e1,_0x52d262){_0x52d262(null,util[_0xe5f3('0x2f')](_0xe5f3('0x30'),Date[_0xe5f3('0x31')](),_0x1074e1['originalname']));}})});router[_0xe5f3('0x28')]('/:id/logo',upload[_0xe5f3('0x32')]('file'),controller[_0xe5f3('0x33')]);var upload=multer({'storage':multer[_0xe5f3('0x2b')]({'destination':function(_0xc535fc,_0xc178fc,_0x7008c6){_0x7008c6(null,path['join'](config[_0xe5f3('0x2d')],_0xe5f3('0x34')));},'filename':function(_0x4cac62,_0x16a7a2,_0x29f0e7){_0x29f0e7(null,util[_0xe5f3('0x2f')]('%s-%s',Date['now'](),_0x16a7a2[_0xe5f3('0x35')]));}})});router[_0xe5f3('0x28')](_0xe5f3('0x16'),upload[_0xe5f3('0x32')](_0xe5f3('0x36')),controller[_0xe5f3('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfd9a71,_0x1d0e63,_0x2d2292){_0x2d2292(null,path[_0xe5f3('0x2c')](config[_0xe5f3('0x2d')],_0xe5f3('0x34')));},'filename':function(_0x4da826,_0x513bad,_0x395bb7){_0x395bb7(null,util[_0xe5f3('0x2f')](_0xe5f3('0x30'),Date[_0xe5f3('0x31')](),_0x513bad['originalname']));}})});router[_0xe5f3('0x28')]('/:id/customer_avatar',upload[_0xe5f3('0x32')](_0xe5f3('0x36')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe5f3('0x2b')]({'destination':function(_0x2284fd,_0x10a053,_0x51666e){_0x51666e(null,path[_0xe5f3('0x2c')](config['root'],_0xe5f3('0x34')));},'filename':function(_0x31bb1e,_0x293ae3,_0x1248a6){_0x1248a6(null,util[_0xe5f3('0x2f')]('%s-%s',Date[_0xe5f3('0x31')](),_0x293ae3[_0xe5f3('0x35')]));}})});router['post'](_0xe5f3('0x1a'),upload[_0xe5f3('0x32')]('file'),controller['addSystemAvatar']);router[_0xe5f3('0x28')](_0xe5f3('0x38'),controller[_0xe5f3('0x39')]);router[_0xe5f3('0x28')](_0xe5f3('0x3a'),controller[_0xe5f3('0x3b')]);router[_0xe5f3('0x28')]('/:id/interactions',auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x3c')]);router[_0xe5f3('0x28')](_0xe5f3('0x1f'),auth[_0xe5f3('0xd')](),controller['addApplications']);router[_0xe5f3('0x28')](_0xe5f3('0x21'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xe5f3('0x28')](_0xe5f3('0x26'),auth['isAuthenticated'](),controller['addAgents']);router[_0xe5f3('0x3d')](_0xe5f3('0xf'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x3e')]);router[_0xe5f3('0x3f')](_0xe5f3('0xf'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x40')]);router[_0xe5f3('0x3f')](_0xe5f3('0x11'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x41')]);router[_0xe5f3('0x3f')](_0xe5f3('0x13'),auth[_0xe5f3('0xd')](),controller[_0xe5f3('0x42')]);router[_0xe5f3('0x3f')](_0xe5f3('0x26'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xe5f3('0x43')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f7fe0c2..97e4508 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x980e=['Google','STRING','sequelize','ENUM'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe980('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe980('0x1')]('AmazonAWS',_0xe980('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xe980('0x3')]}};
\ No newline at end of file
+var _0x287e=['ENUM','AmazonAWS','Google','sequelize','exports','STRING'];(function(_0x496a97,_0x17bb54){var _0x3fa053=function(_0xe93214){while(--_0xe93214){_0x496a97['push'](_0x496a97['shift']());}};_0x3fa053(++_0x17bb54);}(_0x287e,0x1e3));var _0xe287=function(_0x19ea88,_0xcddbf0){_0x19ea88=_0x19ea88-0x0;var _0x4e58d3=_0x287e[_0x19ea88];return _0x4e58d3;};'use strict';var Sequelize=require(_0xe287('0x0'));module[_0xe287('0x1')]={'name':{'type':Sequelize[_0xe287('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe287('0x3')](_0xe287('0x4'),_0xe287('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xe287('0x2')]},'data2':{'type':Sequelize[_0xe287('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 2c2d7a5..0c6de8d 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb46=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','options','then','includeAll','catch','params','length','include','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x24422b,_0x1bdee7){var _0x1b7069=function(_0x3e58f3){while(--_0x3e58f3){_0x24422b['push'](_0x24422b['shift']());}};_0x1b7069(++_0x1bdee7);}(_0xbb46,0x80));var _0x6bb4=function(_0xd921e9,_0x301ae3){_0xd921e9=_0xd921e9-0x0;var _0x223407=_0xbb46[_0xd921e9];return _0x223407;};'use strict';var pdf=require(_0x6bb4('0x0'));var emlformat=require(_0x6bb4('0x1'));var rimraf=require(_0x6bb4('0x2'));var zipdir=require(_0x6bb4('0x3'));var jsonpatch=require(_0x6bb4('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bb4('0x5'));var Mustache=require(_0x6bb4('0x6'));var util=require(_0x6bb4('0x7'));var path=require('path');var sox=require(_0x6bb4('0x8'));var csv=require(_0x6bb4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6bb4('0xa'));var squel=require(_0x6bb4('0xb'));var crypto=require(_0x6bb4('0xc'));var jsforce=require(_0x6bb4('0xd'));var deskjs=require(_0x6bb4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6bb4('0xf'));var Papa=require(_0x6bb4('0x10'));var Redis=require(_0x6bb4('0x11'));var authService=require(_0x6bb4('0x12'));var qs=require(_0x6bb4('0x13'));var as=require(_0x6bb4('0x14'));var hardwareService=require(_0x6bb4('0x15'));var logger=require(_0x6bb4('0x16'))(_0x6bb4('0x17'));var utils=require(_0x6bb4('0x18'));var config=require(_0x6bb4('0x19'));var licenseUtil=require(_0x6bb4('0x1a'));var db=require(_0x6bb4('0x1b'))['db'];function respondWithStatusCode(_0x2d557a,_0x2195b2){_0x2195b2=_0x2195b2||0xcc;return function(_0x167d2f){if(_0x167d2f){return _0x2d557a[_0x6bb4('0x1c')](_0x2195b2);}return _0x2d557a[_0x6bb4('0x1d')](_0x2195b2)[_0x6bb4('0x1e')]();};}function respondWithResult(_0x4dad9b,_0x5b071b){_0x5b071b=_0x5b071b||0xc8;return function(_0x15dd99){if(_0x15dd99){return _0x4dad9b[_0x6bb4('0x1d')](_0x5b071b)[_0x6bb4('0x1f')](_0x15dd99);}};}function respondWithFilteredResult(_0x1a0d81,_0x2c97e1){return function(_0x5789ce){if(_0x5789ce){var _0x27f6ca=_0x5789ce[_0x6bb4('0x20')],_0xda2a19=_0x2c97e1[_0x6bb4('0x21')],_0x2b7239=_0x2c97e1[_0x6bb4('0x21')]+_0x2c97e1['limit'],_0x46cd37;if(_0x2b7239>=_0x27f6ca){_0x2b7239=_0x27f6ca;_0x46cd37=0xc8;}else{_0x46cd37=0xce;}_0x1a0d81['status'](_0x46cd37);return _0x1a0d81[_0x6bb4('0x22')](_0x6bb4('0x23'),_0xda2a19+'-'+_0x2b7239+'/'+_0x27f6ca)[_0x6bb4('0x1f')](_0x5789ce);}return null;};}function patchUpdates(_0x5826cb){return function(_0x1a04f3){try{jsonpatch[_0x6bb4('0x24')](_0x1a04f3,_0x5826cb,!![]);}catch(_0x28d90f){return BPromise[_0x6bb4('0x25')](_0x28d90f);}return _0x1a04f3[_0x6bb4('0x26')]();};}function saveUpdates(_0x3b1bb4,_0x320227){return function(_0x28bce0){if(_0x28bce0){return _0x28bce0[_0x6bb4('0x27')](_0x3b1bb4)['then'](function(_0x3a49d5){return _0x3a49d5;});}return null;};}function removeEntity(_0x1b6ded,_0x46103e){return function(_0x23b500){if(_0x23b500){return _0x23b500['destroy']()['then'](function(){_0x1b6ded[_0x6bb4('0x1d')](0xcc)[_0x6bb4('0x1e')]();});}};}function handleEntityNotFound(_0x5491d3,_0x147a25){return function(_0x4a6e80){if(!_0x4a6e80){_0x5491d3[_0x6bb4('0x1c')](0x194);}return _0x4a6e80;};}function handleError(_0x22b2b0,_0x6b2682){_0x6b2682=_0x6b2682||0x1f4;return function(_0x2f8b23){logger[_0x6bb4('0x28')](_0x2f8b23['stack']);if(_0x2f8b23[_0x6bb4('0x29')]){delete _0x2f8b23['name'];}_0x22b2b0[_0x6bb4('0x1d')](_0x6b2682)[_0x6bb4('0x2a')](_0x2f8b23);};}exports[_0x6bb4('0x2b')]=function(_0x3acf1a,_0x46235b){var _0x237fc7={},_0x339cd8={},_0x1c7a3f={'count':0x0,'rows':[]};var _0x2802fc=_[_0x6bb4('0x2c')](db[_0x6bb4('0x2d')][_0x6bb4('0x2e')],function(_0x361c74){return{'name':_0x361c74[_0x6bb4('0x2f')],'type':_0x361c74[_0x6bb4('0x30')][_0x6bb4('0x31')]};});_0x339cd8[_0x6bb4('0x32')]=_[_0x6bb4('0x2c')](_0x2802fc,_0x6bb4('0x29'));_0x339cd8[_0x6bb4('0x33')]=_[_0x6bb4('0x34')](_0x3acf1a[_0x6bb4('0x33')]);_0x339cd8['filters']=_[_0x6bb4('0x35')](_0x339cd8[_0x6bb4('0x32')],_0x339cd8[_0x6bb4('0x33')]);_0x237fc7[_0x6bb4('0x36')]=_['intersection'](_0x339cd8[_0x6bb4('0x32')],qs[_0x6bb4('0x37')](_0x3acf1a['query'][_0x6bb4('0x37')]));_0x237fc7['attributes']=_0x237fc7[_0x6bb4('0x36')]['length']?_0x237fc7[_0x6bb4('0x36')]:_0x339cd8[_0x6bb4('0x32')];if(!_0x3acf1a[_0x6bb4('0x33')][_0x6bb4('0x38')](_0x6bb4('0x39'))){_0x237fc7['limit']=qs[_0x6bb4('0x3a')](_0x3acf1a[_0x6bb4('0x33')][_0x6bb4('0x3a')]);_0x237fc7[_0x6bb4('0x21')]=qs[_0x6bb4('0x21')](_0x3acf1a[_0x6bb4('0x33')]['offset']);}_0x237fc7['order']=qs['sort'](_0x3acf1a[_0x6bb4('0x33')][_0x6bb4('0x3b')]);_0x237fc7[_0x6bb4('0x3c')]=qs['filters'](_[_0x6bb4('0x3d')](_0x3acf1a[_0x6bb4('0x33')],_0x339cd8[_0x6bb4('0x3e')]),_0x2802fc);if(_0x3acf1a['query'][_0x6bb4('0x3f')]){_0x237fc7['where']=_['merge'](_0x237fc7[_0x6bb4('0x3c')],{'$or':_[_0x6bb4('0x2c')](_0x2802fc,function(_0x2ff6c1){if(_0x2ff6c1[_0x6bb4('0x30')]!=='VIRTUAL'){var _0x4fc887={};_0x4fc887[_0x2ff6c1[_0x6bb4('0x29')]]={'$like':'%'+_0x3acf1a[_0x6bb4('0x33')]['filter']+'%'};return _0x4fc887;}})});}_0x237fc7=_[_0x6bb4('0x40')]({},_0x237fc7,_0x3acf1a[_0x6bb4('0x41')]);var _0x2e7e9c={'where':_0x237fc7[_0x6bb4('0x3c')]};return db[_0x6bb4('0x2d')]['count'](_0x2e7e9c)[_0x6bb4('0x42')](function(_0x55354e){_0x1c7a3f[_0x6bb4('0x20')]=_0x55354e;if(_0x3acf1a['query'][_0x6bb4('0x43')]){_0x237fc7['include']=[{'all':!![]}];}return db[_0x6bb4('0x2d')]['findAll'](_0x237fc7);})[_0x6bb4('0x42')](function(_0x20d2eb){_0x1c7a3f['rows']=_0x20d2eb;return _0x1c7a3f;})['then'](respondWithFilteredResult(_0x46235b,_0x237fc7))[_0x6bb4('0x44')](handleError(_0x46235b,null));};exports['show']=function(_0x14c87e,_0x58c126){var _0x424b8b={'raw':!![],'where':{'id':_0x14c87e[_0x6bb4('0x45')]['id']}},_0x264493={};_0x264493[_0x6bb4('0x32')]=_[_0x6bb4('0x34')](db[_0x6bb4('0x2d')][_0x6bb4('0x2e')]);_0x264493[_0x6bb4('0x33')]=_[_0x6bb4('0x34')](_0x14c87e[_0x6bb4('0x33')]);_0x264493['filters']=_[_0x6bb4('0x35')](_0x264493[_0x6bb4('0x32')],_0x264493[_0x6bb4('0x33')]);_0x424b8b['attributes']=_[_0x6bb4('0x35')](_0x264493[_0x6bb4('0x32')],qs['fields'](_0x14c87e['query'][_0x6bb4('0x37')]));_0x424b8b[_0x6bb4('0x36')]=_0x424b8b[_0x6bb4('0x36')][_0x6bb4('0x46')]?_0x424b8b[_0x6bb4('0x36')]:_0x264493['model'];if(_0x14c87e[_0x6bb4('0x33')][_0x6bb4('0x43')]){_0x424b8b[_0x6bb4('0x47')]=[{'all':!![]}];}_0x424b8b=_[_0x6bb4('0x40')]({},_0x424b8b,_0x14c87e[_0x6bb4('0x41')]);return db[_0x6bb4('0x2d')][_0x6bb4('0x48')](_0x424b8b)[_0x6bb4('0x42')](handleEntityNotFound(_0x58c126,null))[_0x6bb4('0x42')](respondWithResult(_0x58c126,null))[_0x6bb4('0x44')](handleError(_0x58c126,null));};exports[_0x6bb4('0x49')]=function(_0x2619f8,_0x38739a){return db[_0x6bb4('0x2d')][_0x6bb4('0x49')](_0x2619f8['body'],{})[_0x6bb4('0x42')](respondWithResult(_0x38739a,0xc9))[_0x6bb4('0x44')](handleError(_0x38739a,null));};exports['update']=function(_0x28fe13,_0x5dc0d3){if(_0x28fe13[_0x6bb4('0x4a')]['id']){delete _0x28fe13[_0x6bb4('0x4a')]['id'];}return db[_0x6bb4('0x2d')][_0x6bb4('0x48')]({'where':{'id':_0x28fe13[_0x6bb4('0x45')]['id']}})[_0x6bb4('0x42')](handleEntityNotFound(_0x5dc0d3,null))[_0x6bb4('0x42')](saveUpdates(_0x28fe13[_0x6bb4('0x4a')],null))[_0x6bb4('0x42')](respondWithResult(_0x5dc0d3,null))['catch'](handleError(_0x5dc0d3,null));};exports[_0x6bb4('0x4b')]=function(_0xc1a062,_0x290f8f){return db[_0x6bb4('0x2d')]['find']({'where':{'id':_0xc1a062['params']['id']}})[_0x6bb4('0x42')](handleEntityNotFound(_0x290f8f,null))[_0x6bb4('0x42')](removeEntity(_0x290f8f,null))['catch'](handleError(_0x290f8f,null));};
\ No newline at end of file
+var _0xcc65=['then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','CloudProvider','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','update'];(function(_0x5bf969,_0x11f7e3){var _0x4055a2=function(_0x3cfe68){while(--_0x3cfe68){_0x5bf969['push'](_0x5bf969['shift']());}};_0x4055a2(++_0x11f7e3);}(_0xcc65,0x71));var _0x5cc6=function(_0x49ca95,_0x50c62b){_0x49ca95=_0x49ca95-0x0;var _0x4699f9=_0xcc65[_0x49ca95];return _0x4699f9;};'use strict';var pdf=require(_0x5cc6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5cc6('0x1'));var zipdir=require(_0x5cc6('0x2'));var jsonpatch=require(_0x5cc6('0x3'));var rp=require(_0x5cc6('0x4'));var moment=require(_0x5cc6('0x5'));var BPromise=require(_0x5cc6('0x6'));var Mustache=require(_0x5cc6('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5cc6('0x8'));var fs=require('fs');var _=require(_0x5cc6('0x9'));var squel=require(_0x5cc6('0xa'));var crypto=require('crypto');var jsforce=require(_0x5cc6('0xb'));var deskjs=require(_0x5cc6('0xc'));var toCsv=require(_0x5cc6('0xd'));var querystring=require('querystring');var Papa=require(_0x5cc6('0xe'));var Redis=require('ioredis');var authService=require(_0x5cc6('0xf'));var qs=require(_0x5cc6('0x10'));var as=require(_0x5cc6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cc6('0x12'))('api');var utils=require(_0x5cc6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5cc6('0x14'));var db=require(_0x5cc6('0x15'))['db'];function respondWithStatusCode(_0x247b5b,_0x2a3ffa){_0x2a3ffa=_0x2a3ffa||0xcc;return function(_0x2f73af){if(_0x2f73af){return _0x247b5b[_0x5cc6('0x16')](_0x2a3ffa);}return _0x247b5b[_0x5cc6('0x17')](_0x2a3ffa)[_0x5cc6('0x18')]();};}function respondWithResult(_0x29c692,_0x86e927){_0x86e927=_0x86e927||0xc8;return function(_0x4b9d09){if(_0x4b9d09){return _0x29c692['status'](_0x86e927)['json'](_0x4b9d09);}};}function respondWithFilteredResult(_0x53dd74,_0x33b577){return function(_0x211a0a){if(_0x211a0a){var _0x2da7eb=_0x211a0a['count'],_0x2bb742=_0x33b577[_0x5cc6('0x19')],_0x80bbf3=_0x33b577[_0x5cc6('0x19')]+_0x33b577['limit'],_0x1291c8;if(_0x80bbf3>=_0x2da7eb){_0x80bbf3=_0x2da7eb;_0x1291c8=0xc8;}else{_0x1291c8=0xce;}_0x53dd74[_0x5cc6('0x17')](_0x1291c8);return _0x53dd74[_0x5cc6('0x1a')](_0x5cc6('0x1b'),_0x2bb742+'-'+_0x80bbf3+'/'+_0x2da7eb)[_0x5cc6('0x1c')](_0x211a0a);}return null;};}function patchUpdates(_0x3edad8){return function(_0x48e7f2){try{jsonpatch[_0x5cc6('0x1d')](_0x48e7f2,_0x3edad8,!![]);}catch(_0x3f65b2){return BPromise['reject'](_0x3f65b2);}return _0x48e7f2['save']();};}function saveUpdates(_0xab0849,_0x53f378){return function(_0x182afa){if(_0x182afa){return _0x182afa[_0x5cc6('0x1e')](_0xab0849)[_0x5cc6('0x1f')](function(_0xbb4f0e){return _0xbb4f0e;});}return null;};}function removeEntity(_0x5a34e9,_0xc0568a){return function(_0x20bf67){if(_0x20bf67){return _0x20bf67[_0x5cc6('0x20')]()[_0x5cc6('0x1f')](function(){_0x5a34e9[_0x5cc6('0x17')](0xcc)[_0x5cc6('0x18')]();});}};}function handleEntityNotFound(_0x2b08c3,_0x25dc21){return function(_0x4a6979){if(!_0x4a6979){_0x2b08c3[_0x5cc6('0x16')](0x194);}return _0x4a6979;};}function handleError(_0x5d7482,_0x547003){_0x547003=_0x547003||0x1f4;return function(_0x5ec49a){logger[_0x5cc6('0x21')](_0x5ec49a['stack']);if(_0x5ec49a[_0x5cc6('0x22')]){delete _0x5ec49a[_0x5cc6('0x22')];}_0x5d7482[_0x5cc6('0x17')](_0x547003)[_0x5cc6('0x23')](_0x5ec49a);};}exports[_0x5cc6('0x24')]=function(_0x48d543,_0x1875bf){var _0x39ff8a={},_0x1e73a2={},_0x42f0e2={'count':0x0,'rows':[]};var _0x346ec1=_[_0x5cc6('0x25')](db['CloudProvider'][_0x5cc6('0x26')],function(_0xc4d1ee){return{'name':_0xc4d1ee[_0x5cc6('0x27')],'type':_0xc4d1ee[_0x5cc6('0x28')]['key']};});_0x1e73a2[_0x5cc6('0x29')]=_['map'](_0x346ec1,_0x5cc6('0x22'));_0x1e73a2['query']=_[_0x5cc6('0x2a')](_0x48d543[_0x5cc6('0x2b')]);_0x1e73a2[_0x5cc6('0x2c')]=_[_0x5cc6('0x2d')](_0x1e73a2['model'],_0x1e73a2['query']);_0x39ff8a[_0x5cc6('0x2e')]=_[_0x5cc6('0x2d')](_0x1e73a2[_0x5cc6('0x29')],qs[_0x5cc6('0x2f')](_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x2f')]));_0x39ff8a[_0x5cc6('0x2e')]=_0x39ff8a[_0x5cc6('0x2e')][_0x5cc6('0x30')]?_0x39ff8a[_0x5cc6('0x2e')]:_0x1e73a2[_0x5cc6('0x29')];if(!_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x31')](_0x5cc6('0x32'))){_0x39ff8a[_0x5cc6('0x33')]=qs[_0x5cc6('0x33')](_0x48d543[_0x5cc6('0x2b')]['limit']);_0x39ff8a[_0x5cc6('0x19')]=qs[_0x5cc6('0x19')](_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x19')]);}_0x39ff8a[_0x5cc6('0x34')]=qs[_0x5cc6('0x35')](_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x35')]);_0x39ff8a[_0x5cc6('0x36')]=qs[_0x5cc6('0x2c')](_[_0x5cc6('0x37')](_0x48d543[_0x5cc6('0x2b')],_0x1e73a2[_0x5cc6('0x2c')]),_0x346ec1);if(_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x38')]){_0x39ff8a['where']=_[_0x5cc6('0x39')](_0x39ff8a[_0x5cc6('0x36')],{'$or':_['map'](_0x346ec1,function(_0x236693){if(_0x236693['type']!==_0x5cc6('0x3a')){var _0x3c7e15={};_0x3c7e15[_0x236693[_0x5cc6('0x22')]]={'$like':'%'+_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x38')]+'%'};return _0x3c7e15;}})});}_0x39ff8a=_[_0x5cc6('0x39')]({},_0x39ff8a,_0x48d543['options']);var _0x54bb1d={'where':_0x39ff8a[_0x5cc6('0x36')]};return db[_0x5cc6('0x3b')][_0x5cc6('0x3c')](_0x54bb1d)[_0x5cc6('0x1f')](function(_0x9e3e22){_0x42f0e2[_0x5cc6('0x3c')]=_0x9e3e22;if(_0x48d543[_0x5cc6('0x2b')][_0x5cc6('0x3d')]){_0x39ff8a[_0x5cc6('0x3e')]=[{'all':!![]}];}return db['CloudProvider'][_0x5cc6('0x3f')](_0x39ff8a);})['then'](function(_0x44dd27){_0x42f0e2[_0x5cc6('0x40')]=_0x44dd27;return _0x42f0e2;})[_0x5cc6('0x1f')](respondWithFilteredResult(_0x1875bf,_0x39ff8a))[_0x5cc6('0x41')](handleError(_0x1875bf,null));};exports[_0x5cc6('0x42')]=function(_0x1a6ab9,_0x3e4c67){var _0x248804={'raw':!![],'where':{'id':_0x1a6ab9[_0x5cc6('0x43')]['id']}},_0x212449={};_0x212449[_0x5cc6('0x29')]=_[_0x5cc6('0x2a')](db['CloudProvider'][_0x5cc6('0x26')]);_0x212449[_0x5cc6('0x2b')]=_['keys'](_0x1a6ab9[_0x5cc6('0x2b')]);_0x212449[_0x5cc6('0x2c')]=_[_0x5cc6('0x2d')](_0x212449[_0x5cc6('0x29')],_0x212449[_0x5cc6('0x2b')]);_0x248804[_0x5cc6('0x2e')]=_[_0x5cc6('0x2d')](_0x212449[_0x5cc6('0x29')],qs['fields'](_0x1a6ab9['query'][_0x5cc6('0x2f')]));_0x248804['attributes']=_0x248804[_0x5cc6('0x2e')][_0x5cc6('0x30')]?_0x248804[_0x5cc6('0x2e')]:_0x212449[_0x5cc6('0x29')];if(_0x1a6ab9['query'][_0x5cc6('0x3d')]){_0x248804[_0x5cc6('0x3e')]=[{'all':!![]}];}_0x248804=_[_0x5cc6('0x39')]({},_0x248804,_0x1a6ab9[_0x5cc6('0x44')]);return db[_0x5cc6('0x3b')]['find'](_0x248804)[_0x5cc6('0x1f')](handleEntityNotFound(_0x3e4c67,null))[_0x5cc6('0x1f')](respondWithResult(_0x3e4c67,null))[_0x5cc6('0x41')](handleError(_0x3e4c67,null));};exports[_0x5cc6('0x45')]=function(_0x8eb680,_0x460e7e){return db[_0x5cc6('0x3b')][_0x5cc6('0x45')](_0x8eb680[_0x5cc6('0x46')],{})['then'](respondWithResult(_0x460e7e,0xc9))[_0x5cc6('0x41')](handleError(_0x460e7e,null));};exports[_0x5cc6('0x1e')]=function(_0x199f4e,_0x884e8e){if(_0x199f4e[_0x5cc6('0x46')]['id']){delete _0x199f4e['body']['id'];}return db[_0x5cc6('0x3b')][_0x5cc6('0x47')]({'where':{'id':_0x199f4e['params']['id']}})['then'](handleEntityNotFound(_0x884e8e,null))[_0x5cc6('0x1f')](saveUpdates(_0x199f4e[_0x5cc6('0x46')],null))[_0x5cc6('0x1f')](respondWithResult(_0x884e8e,null))[_0x5cc6('0x41')](handleError(_0x884e8e,null));};exports[_0x5cc6('0x20')]=function(_0x295c25,_0x739400){return db[_0x5cc6('0x3b')]['find']({'where':{'id':_0x295c25[_0x5cc6('0x43')]['id']}})['then'](handleEntityNotFound(_0x739400,null))[_0x5cc6('0x1f')](removeEntity(_0x739400,null))['catch'](handleError(_0x739400,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index d0fff7e..0d3d4ae 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x74ec=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','util','../../config/logger','moment'];(function(_0x400164,_0x104c28){var _0x55db29=function(_0x1bfb6a){while(--_0x1bfb6a){_0x400164['push'](_0x400164['shift']());}};_0x55db29(++_0x104c28);}(_0x74ec,0x1d1));var _0xc74e=function(_0x410b37,_0x2e74be){_0x410b37=_0x410b37-0x0;var _0x5049df=_0x74ec[_0x410b37];return _0x5049df;};'use strict';var _=require('lodash');var util=require(_0xc74e('0x0'));var logger=require(_0xc74e('0x1'))('api');var moment=require(_0xc74e('0x2'));var BPromise=require(_0xc74e('0x3'));var rp=require(_0xc74e('0x4'));var fs=require('fs');var path=require(_0xc74e('0x5'));var rimraf=require(_0xc74e('0x6'));var config=require(_0xc74e('0x7'));var attributes=require(_0xc74e('0x8'));module[_0xc74e('0x9')]=function(_0x3cca53,_0x32cc89){return _0x3cca53[_0xc74e('0xa')]('CloudProvider',attributes,{'tableName':_0xc74e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x998c=['define','CloudProvider','cloud_providers','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x998c,0x1bb));var _0xc998=function(_0xdb4e73,_0x30b446){_0xdb4e73=_0xdb4e73-0x0;var _0x4578b4=_0x998c[_0xdb4e73];return _0x4578b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc998('0x0'));var moment=require('moment');var BPromise=require(_0xc998('0x1'));var rp=require(_0xc998('0x2'));var fs=require('fs');var path=require(_0xc998('0x3'));var rimraf=require(_0xc998('0x4'));var config=require(_0xc998('0x5'));var attributes=require('./cloudProvider.attributes');module[_0xc998('0x6')]=function(_0x5ee61b,_0x491a35){return _0x5ee61b[_0xc998('0x7')](_0xc998('0x8'),attributes,{'tableName':_0xc998('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index defc184..68d614d 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x644f=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x2113da,_0x3579c3){var _0x505149=function(_0x1e9829){while(--_0x1e9829){_0x2113da['push'](_0x2113da['shift']());}};_0x505149(++_0x3579c3);}(_0x644f,0xce));var _0xf644=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0x644f[_0x2998db];return _0x115fea;};'use strict';var _=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var moment=require(_0xf644('0x2'));var BPromise=require(_0xf644('0x3'));var rs=require(_0xf644('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf644('0x5'));var logger=require(_0xf644('0x6'))(_0xf644('0x7'));var config=require(_0xf644('0x8'));var jayson=require(_0xf644('0x9'));var client=jayson[_0xf644('0xa')][_0xf644('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d722d,_0x3ec341,_0x2e2700){return new BPromise(function(_0x292166,_0x2419bd){return client['request'](_0x1d722d,_0x2e2700)[_0xf644('0xc')](function(_0xde48f9){logger[_0xf644('0xd')](_0xf644('0xe'),_0x3ec341,_0xf644('0xf'));logger[_0xf644('0x10')](_0xf644('0x11'),_0x3ec341,_0xf644('0xf'),JSON[_0xf644('0x12')](_0xde48f9));if(_0xde48f9['error']){if(_0xde48f9[_0xf644('0x13')]['code']===0x1f4){logger[_0xf644('0x13')](_0xf644('0xe'),_0x3ec341,_0xde48f9['error'][_0xf644('0x14')]);return _0x2419bd(_0xde48f9[_0xf644('0x13')][_0xf644('0x14')]);}logger['error'](_0xf644('0xe'),_0x3ec341,_0xde48f9[_0xf644('0x13')][_0xf644('0x14')]);return _0x292166(_0xde48f9['error'][_0xf644('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x3ec341,'request\x20sent');_0x292166(_0xde48f9[_0xf644('0x15')]['message']);}})[_0xf644('0x16')](function(_0x47cbc3){logger[_0xf644('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3ec341,_0x47cbc3);_0x2419bd(_0x47cbc3);});});}
\ No newline at end of file
+var _0x39ff=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util'];(function(_0x22e76d,_0x588d78){var _0x2c631a=function(_0x2d51c2){while(--_0x2d51c2){_0x22e76d['push'](_0x22e76d['shift']());}};_0x2c631a(++_0x588d78);}(_0x39ff,0xe6));var _0xf39f=function(_0x45e1aa,_0x4e1ea5){_0x45e1aa=_0x45e1aa-0x0;var _0xc3a923=_0x39ff[_0x45e1aa];return _0xc3a923;};'use strict';var _=require('lodash');var util=require(_0xf39f('0x0'));var moment=require(_0xf39f('0x1'));var BPromise=require(_0xf39f('0x2'));var rs=require(_0xf39f('0x3'));var fs=require('fs');var Redis=require(_0xf39f('0x4'));var db=require(_0xf39f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf39f('0x6'))('rpc');var config=require(_0xf39f('0x7'));var jayson=require(_0xf39f('0x8'));var client=jayson['client'][_0xf39f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48960f,_0x21d3eb,_0x84b2ca){return new BPromise(function(_0x38a03e,_0x39412a){return client[_0xf39f('0xa')](_0x48960f,_0x84b2ca)[_0xf39f('0xb')](function(_0x1ca827){logger[_0xf39f('0xc')](_0xf39f('0xd'),_0x21d3eb,_0xf39f('0xe'));logger[_0xf39f('0xf')](_0xf39f('0x10'),_0x21d3eb,_0xf39f('0xe'),JSON[_0xf39f('0x11')](_0x1ca827));if(_0x1ca827['error']){if(_0x1ca827[_0xf39f('0x12')]['code']===0x1f4){logger[_0xf39f('0x12')](_0xf39f('0xd'),_0x21d3eb,_0x1ca827[_0xf39f('0x12')][_0xf39f('0x13')]);return _0x39412a(_0x1ca827[_0xf39f('0x12')][_0xf39f('0x13')]);}logger['error'](_0xf39f('0xd'),_0x21d3eb,_0x1ca827[_0xf39f('0x12')]['message']);return _0x38a03e(_0x1ca827['error'][_0xf39f('0x13')]);}else{logger['info'](_0xf39f('0xd'),_0x21d3eb,_0xf39f('0xe'));_0x38a03e(_0x1ca827[_0xf39f('0x14')][_0xf39f('0x13')]);}})['catch'](function(_0x5bb673){logger[_0xf39f('0x12')](_0xf39f('0xd'),_0x21d3eb,_0x5bb673);_0x39412a(_0x5bb673);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b621078..ee8590f 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e0c=['show','post','create','put','update','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x1d292c,_0x57bbbe){var _0x5d08ca=function(_0x4f0a30){while(--_0x4f0a30){_0x1d292c['push'](_0x1d292c['shift']());}};_0x5d08ca(++_0x57bbbe);}(_0x1e0c,0xb5));var _0xc1e0=function(_0x4ba666,_0x5c7893){_0x4ba666=_0x4ba666-0x0;var _0x1526a1=_0x1e0c[_0x4ba666];return _0x1526a1;};'use strict';var multer=require('multer');var util=require(_0xc1e0('0x0'));var path=require(_0xc1e0('0x1'));var timeout=require(_0xc1e0('0x2'));var express=require('express');var router=express[_0xc1e0('0x3')]();var auth=require(_0xc1e0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc1e0('0x5'));var controller=require(_0xc1e0('0x6'));router[_0xc1e0('0x7')]('/',auth[_0xc1e0('0x8')](),controller[_0xc1e0('0x9')]);router[_0xc1e0('0x7')](_0xc1e0('0xa'),auth[_0xc1e0('0x8')](),controller[_0xc1e0('0xb')]);router[_0xc1e0('0xc')]('/',auth[_0xc1e0('0x8')](),controller[_0xc1e0('0xd')]);router[_0xc1e0('0xe')](_0xc1e0('0xa'),auth[_0xc1e0('0x8')](),controller[_0xc1e0('0xf')]);router['delete'](_0xc1e0('0xa'),auth[_0xc1e0('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x28e1=['isAuthenticated','index','show','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0x28e1,0x13a));var _0x128e=function(_0x44dcfd,_0x4ac1a9){_0x44dcfd=_0x44dcfd-0x0;var _0x2d2a46=_0x28e1[_0x44dcfd];return _0x2d2a46;};'use strict';var multer=require(_0x128e('0x0'));var util=require(_0x128e('0x1'));var path=require(_0x128e('0x2'));var timeout=require(_0x128e('0x3'));var express=require(_0x128e('0x4'));var router=express[_0x128e('0x5')]();var auth=require(_0x128e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x128e('0x7'));var controller=require('./cloudProvider.controller');router[_0x128e('0x8')]('/',auth[_0x128e('0x9')](),controller[_0x128e('0xa')]);router[_0x128e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x128e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x128e('0xc')]);router[_0x128e('0xd')](_0x128e('0xe'),auth['isAuthenticated'](),controller[_0x128e('0xf')]);router[_0x128e('0x10')](_0x128e('0xe'),auth[_0x128e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8a67228..d4ded9e 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 _0x7d6c=['STRING','name','sequelize'];(function(_0x59ca94,_0x22f2ab){var _0x663f19=function(_0x29f0fb){while(--_0x29f0fb){_0x59ca94['push'](_0x59ca94['shift']());}};_0x663f19(++_0x22f2ab);}(_0x7d6c,0xd1));var _0xc7d6=function(_0x1f8be7,_0x434d58){_0x1f8be7=_0x1f8be7-0x0;var _0x4f6182=_0x7d6c[_0x1f8be7];return _0x4f6182;};'use strict';var Sequelize=require(_0xc7d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7d6('0x1')],'unique':_0xc7d6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc7d6('0x1')]},'companyId':{'type':Sequelize[_0xc7d6('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc7d6('0x1')]},'fax':{'type':Sequelize[_0xc7d6('0x1')]},'type':{'type':Sequelize[_0xc7d6('0x1')]},'street':{'type':Sequelize[_0xc7d6('0x1')]},'postalCode':{'type':Sequelize[_0xc7d6('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc7d6('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc7d6('0x1')]},'sStreet':{'type':Sequelize[_0xc7d6('0x1')]},'sPostalCode':{'type':Sequelize[_0xc7d6('0x1')]},'sCity':{'type':Sequelize[_0xc7d6('0x1')]},'sCountry':{'type':Sequelize[_0xc7d6('0x1')]},'description':{'type':Sequelize[_0xc7d6('0x1')]}};
\ No newline at end of file
+var _0xf4fd=['STRING','name','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4fd,0x11f));var _0xdf4f=function(_0x5c5e16,_0x111fe7){_0x5c5e16=_0x5c5e16-0x0;var _0x3f890d=_0xf4fd[_0x5c5e16];return _0x3f890d;};'use strict';var Sequelize=require('sequelize');module[_0xdf4f('0x0')]={'name':{'type':Sequelize[_0xdf4f('0x1')],'unique':_0xdf4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdf4f('0x1')]},'companyId':{'type':Sequelize[_0xdf4f('0x1')]},'website':{'type':Sequelize[_0xdf4f('0x1')]},'phone':{'type':Sequelize[_0xdf4f('0x1')]},'fax':{'type':Sequelize[_0xdf4f('0x1')]},'type':{'type':Sequelize[_0xdf4f('0x1')]},'street':{'type':Sequelize[_0xdf4f('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdf4f('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xdf4f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdf4f('0x1')]},'sStreet':{'type':Sequelize[_0xdf4f('0x1')]},'sPostalCode':{'type':Sequelize[_0xdf4f('0x1')]},'sCity':{'type':Sequelize[_0xdf4f('0x1')]},'sCountry':{'type':Sequelize[_0xdf4f('0x1')]},'description':{'type':Sequelize[_0xdf4f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index fb24ff2..5d67112 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 _0xf1dc=['destroy','error','name','CmCompany','describe','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','catch','show','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContact','addContacts','ids','omit','getContacts','findOne','rawAttributes','intersection','pick','map','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Companies'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1dc,0x1db));var _0xcf1d=function(_0x3acb71,_0x3862cd){_0x3acb71=_0x3acb71-0x0;var _0x28ab85=_0xf1dc[_0x3acb71];return _0x28ab85;};'use strict';var pdf=require(_0xcf1d('0x0'));var emlformat=require(_0xcf1d('0x1'));var rimraf=require(_0xcf1d('0x2'));var zipdir=require(_0xcf1d('0x3'));var jsonpatch=require(_0xcf1d('0x4'));var rp=require(_0xcf1d('0x5'));var moment=require(_0xcf1d('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcf1d('0x7'));var path=require('path');var sox=require(_0xcf1d('0x8'));var csv=require('to-csv');var ejs=require(_0xcf1d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf1d('0xa'));var jsforce=require(_0xcf1d('0xb'));var deskjs=require(_0xcf1d('0xc'));var toCsv=require(_0xcf1d('0xd'));var querystring=require(_0xcf1d('0xe'));var Papa=require(_0xcf1d('0xf'));var Redis=require(_0xcf1d('0x10'));var authService=require(_0xcf1d('0x11'));var qs=require(_0xcf1d('0x12'));var as=require(_0xcf1d('0x13'));var hardwareService=require(_0xcf1d('0x14'));var logger=require(_0xcf1d('0x15'))('api');var utils=require(_0xcf1d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcf1d('0x17'));var db=require(_0xcf1d('0x18'))['db'];function respondWithStatusCode(_0x4cb010,_0x26b401){_0x26b401=_0x26b401||0xcc;return function(_0x519311){if(_0x519311){return _0x4cb010[_0xcf1d('0x19')](_0x26b401);}return _0x4cb010[_0xcf1d('0x1a')](_0x26b401)[_0xcf1d('0x1b')]();};}function respondWithResult(_0x331ac8,_0x5eff2f){_0x5eff2f=_0x5eff2f||0xc8;return function(_0x8c8cfb){if(_0x8c8cfb){return _0x331ac8[_0xcf1d('0x1a')](_0x5eff2f)[_0xcf1d('0x1c')](_0x8c8cfb);}};}function respondWithFilteredResult(_0x64bc0b,_0x5c3b93){return function(_0xe6a165){if(_0xe6a165){var _0xa8265d=_0xe6a165[_0xcf1d('0x1d')],_0x5377b7=_0x5c3b93[_0xcf1d('0x1e')],_0x18326b=_0x5c3b93[_0xcf1d('0x1e')]+_0x5c3b93[_0xcf1d('0x1f')],_0x28d309;if(_0x18326b>=_0xa8265d){_0x18326b=_0xa8265d;_0x28d309=0xc8;}else{_0x28d309=0xce;}_0x64bc0b[_0xcf1d('0x1a')](_0x28d309);return _0x64bc0b[_0xcf1d('0x20')](_0xcf1d('0x21'),_0x5377b7+'-'+_0x18326b+'/'+_0xa8265d)[_0xcf1d('0x1c')](_0xe6a165);}return null;};}function patchUpdates(_0x250499){return function(_0x30bc58){try{jsonpatch[_0xcf1d('0x22')](_0x30bc58,_0x250499,!![]);}catch(_0x2df8a6){return BPromise[_0xcf1d('0x23')](_0x2df8a6);}return _0x30bc58[_0xcf1d('0x24')]();};}function saveUpdates(_0x4dafeb,_0x25a004){return function(_0x4e1573){if(_0x4e1573){return _0x4e1573[_0xcf1d('0x25')](_0x4dafeb)[_0xcf1d('0x26')](function(_0x47db34){return _0x47db34;});}return null;};}function removeEntity(_0x36afe4,_0x41bfa7){return function(_0x206094){if(_0x206094){return _0x206094['destroy']()[_0xcf1d('0x26')](function(){var _0x5f58f0=_0x206094[_0xcf1d('0x27')]({'plain':!![]});var _0x84f50d=_0xcf1d('0x28');return db['UserProfileResource'][_0xcf1d('0x29')]({'where':{'type':_0x84f50d,'resourceId':_0x5f58f0['id']}})['then'](function(){return _0x206094;});})[_0xcf1d('0x26')](function(){_0x36afe4[_0xcf1d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4443,_0x161805){return function(_0x47452e){if(!_0x47452e){_0x5f4443[_0xcf1d('0x19')](0x194);}return _0x47452e;};}function handleError(_0x2fcd51,_0x46c565){_0x46c565=_0x46c565||0x1f4;return function(_0x5c2277){logger[_0xcf1d('0x2a')](_0x5c2277['stack']);if(_0x5c2277[_0xcf1d('0x2b')]){delete _0x5c2277[_0xcf1d('0x2b')];}_0x2fcd51[_0xcf1d('0x1a')](_0x46c565)['send'](_0x5c2277);};}exports['index']=function(_0x42cc51,_0x536337){var _0x13d47a={},_0x16326d={},_0x1ae81d={'count':0x0,'rows':[]};return db[_0xcf1d('0x2c')][_0xcf1d('0x2d')]()[_0xcf1d('0x26')](function(_0x59c7ed){_0x16326d[_0xcf1d('0x2e')]=_[_0xcf1d('0x2f')](_0x59c7ed);_0x16326d[_0xcf1d('0x30')]=_[_0xcf1d('0x2f')](_0x42cc51[_0xcf1d('0x30')]);_0x16326d[_0xcf1d('0x31')]=_['intersection'](_0x16326d['model'],_0x16326d[_0xcf1d('0x30')]);_0x13d47a[_0xcf1d('0x32')]=_['intersection'](_0x16326d[_0xcf1d('0x2e')],qs['fields'](_0x42cc51[_0xcf1d('0x30')][_0xcf1d('0x33')]));_0x13d47a[_0xcf1d('0x32')]=_0x13d47a[_0xcf1d('0x32')][_0xcf1d('0x34')]?_0x13d47a[_0xcf1d('0x32')]:_0x16326d[_0xcf1d('0x2e')];if(!_0x42cc51[_0xcf1d('0x30')]['hasOwnProperty'](_0xcf1d('0x35'))){_0x13d47a['limit']=qs[_0xcf1d('0x1f')](_0x42cc51['query'][_0xcf1d('0x1f')]);_0x13d47a[_0xcf1d('0x1e')]=qs['offset'](_0x42cc51[_0xcf1d('0x30')][_0xcf1d('0x1e')]);}_0x13d47a[_0xcf1d('0x36')]=qs[_0xcf1d('0x37')](_0x42cc51[_0xcf1d('0x30')][_0xcf1d('0x37')]);_0x13d47a['where']=qs['filters'](_['pick'](_0x42cc51[_0xcf1d('0x30')],_0x16326d[_0xcf1d('0x31')]),_0x59c7ed);if(_0x42cc51[_0xcf1d('0x30')]['filter']){_0x13d47a[_0xcf1d('0x38')]=_[_0xcf1d('0x39')](_0x13d47a[_0xcf1d('0x38')],{'$or':_['map'](_0x13d47a[_0xcf1d('0x32')],function(_0x4685a2){var _0x376a37={};_0x376a37[_0x4685a2]={'$like':'%'+_0x42cc51[_0xcf1d('0x30')][_0xcf1d('0x3a')]+'%'};return _0x376a37;})});}_0x13d47a=_[_0xcf1d('0x39')]({},_0x13d47a,_0x42cc51[_0xcf1d('0x3b')]);var _0x461c5b={'where':_0x13d47a[_0xcf1d('0x38')]};return db['CmCompany'][_0xcf1d('0x1d')](_0x461c5b)[_0xcf1d('0x26')](function(_0x4753ce){_0x1ae81d[_0xcf1d('0x1d')]=_0x4753ce;if(_0x42cc51[_0xcf1d('0x30')][_0xcf1d('0x3c')]){_0x13d47a['include']=[{'all':!![]}];}return db[_0xcf1d('0x2c')][_0xcf1d('0x3d')](_0x13d47a);})[_0xcf1d('0x26')](function(_0x386bab){_0x1ae81d['rows']=_0x386bab;return _0x1ae81d;})[_0xcf1d('0x26')](respondWithFilteredResult(_0x536337,_0x13d47a))[_0xcf1d('0x3e')](handleError(_0x536337,null));})[_0xcf1d('0x3e')](handleError(_0x536337,null));};exports[_0xcf1d('0x3f')]=function(_0x192a9f,_0x372033){var _0x409e7a={'raw':![],'where':{'id':_0x192a9f['params']['id']}},_0xee3f2d={};_0xee3f2d['model']=_['keys'](db[_0xcf1d('0x2c')]['rawAttributes']);_0xee3f2d['query']=_[_0xcf1d('0x2f')](_0x192a9f[_0xcf1d('0x30')]);_0xee3f2d[_0xcf1d('0x31')]=_['intersection'](_0xee3f2d[_0xcf1d('0x2e')],_0xee3f2d[_0xcf1d('0x30')]);_0x409e7a[_0xcf1d('0x32')]=_['intersection'](_0xee3f2d[_0xcf1d('0x2e')],qs[_0xcf1d('0x33')](_0x192a9f[_0xcf1d('0x30')][_0xcf1d('0x33')]));_0x409e7a[_0xcf1d('0x32')]=_0x409e7a[_0xcf1d('0x32')][_0xcf1d('0x34')]?_0x409e7a[_0xcf1d('0x32')]:_0xee3f2d[_0xcf1d('0x2e')];if(_0x192a9f['query'][_0xcf1d('0x3c')]){_0x409e7a['include']=[{'all':!![]}];}_0x409e7a=_['merge']({},_0x409e7a,_0x192a9f['options']);return db[_0xcf1d('0x2c')][_0xcf1d('0x40')](_0x409e7a)[_0xcf1d('0x26')](handleEntityNotFound(_0x372033,null))[_0xcf1d('0x26')](respondWithResult(_0x372033,null))[_0xcf1d('0x3e')](handleError(_0x372033,null));};exports['create']=function(_0x5eb4e8,_0x38c239){return db[_0xcf1d('0x2c')]['create'](_0x5eb4e8['body'],{})[_0xcf1d('0x26')](function(_0x407632){var _0x37641e=_0x5eb4e8[_0xcf1d('0x41')][_0xcf1d('0x27')]({'plain':!![]});if(!_0x37641e)throw new Error(_0xcf1d('0x42'));if(_0x37641e['role']==='user'){var _0x5c5ea9=_0x407632['get']({'plain':!![]});var _0x25202e=_0xcf1d('0x28');return db[_0xcf1d('0x43')][_0xcf1d('0x40')]({'where':{'name':_0x25202e,'userProfileId':_0x37641e[_0xcf1d('0x44')]},'raw':!![]})[_0xcf1d('0x26')](function(_0x1e894f){if(_0x1e894f&&_0x1e894f[_0xcf1d('0x45')]===0x0){return db[_0xcf1d('0x46')][_0xcf1d('0x47')]({'name':_0x5c5ea9[_0xcf1d('0x2b')],'resourceId':_0x5c5ea9['id'],'type':_0x1e894f['name'],'sectionId':_0x1e894f['id']},{})[_0xcf1d('0x26')](function(){return _0x407632;});}else{return _0x407632;}})[_0xcf1d('0x3e')](function(_0x404951){logger[_0xcf1d('0x2a')](_0xcf1d('0x48'),_0x404951);throw _0x404951;});}return _0x407632;})[_0xcf1d('0x26')](respondWithResult(_0x38c239,0xc9))['catch'](handleError(_0x38c239,null));};exports['update']=function(_0x2f3239,_0x599192){if(_0x2f3239[_0xcf1d('0x49')]['id']){delete _0x2f3239['body']['id'];}return db[_0xcf1d('0x2c')]['find']({'where':{'id':_0x2f3239[_0xcf1d('0x4a')]['id']}})[_0xcf1d('0x26')](handleEntityNotFound(_0x599192,null))[_0xcf1d('0x26')](saveUpdates(_0x2f3239[_0xcf1d('0x49')],null))[_0xcf1d('0x26')](respondWithResult(_0x599192,null))[_0xcf1d('0x3e')](handleError(_0x599192,null));};exports[_0xcf1d('0x29')]=function(_0x430fcd,_0x24812c){return db['CmCompany'][_0xcf1d('0x40')]({'where':{'id':_0x430fcd[_0xcf1d('0x4a')]['id']}})[_0xcf1d('0x26')](handleEntityNotFound(_0x24812c,null))[_0xcf1d('0x26')](removeEntity(_0x24812c,null))['catch'](handleError(_0x24812c,null));};exports[_0xcf1d('0x2d')]=function(_0x3a0001,_0xf35d71){return db['CmCompany'][_0xcf1d('0x2d')]()[_0xcf1d('0x26')](respondWithResult(_0xf35d71,null))[_0xcf1d('0x3e')](handleError(_0xf35d71,null));};exports['addContacts']=function(_0x1b241c,_0x3f3266,_0x22c7f7){return db[_0xcf1d('0x4b')][_0xcf1d('0x40')]({'where':{'id':_0x1b241c['params']['id']}})['then'](handleEntityNotFound(_0x3f3266,null))[_0xcf1d('0x26')](function(_0x3144ed){if(_0x3144ed){return _0x3144ed[_0xcf1d('0x4c')](_0x1b241c[_0xcf1d('0x49')][_0xcf1d('0x4d')],_[_0xcf1d('0x4e')](_0x1b241c[_0xcf1d('0x49')],[_0xcf1d('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x3f3266,null))['catch'](handleError(_0x3f3266,null));};exports[_0xcf1d('0x4f')]=function(_0x2cbdd5,_0x5b9e90,_0x17c5bd){var _0x576e5c={};var _0x53c237={};var _0x3da107;var _0x42bd90;return db[_0xcf1d('0x2c')][_0xcf1d('0x50')]({'where':{'id':_0x2cbdd5[_0xcf1d('0x4a')]['id']}})[_0xcf1d('0x26')](handleEntityNotFound(_0x5b9e90,null))['then'](function(_0x28ba5b){if(_0x28ba5b){_0x3da107=_0x28ba5b;_0x53c237['model']=_[_0xcf1d('0x2f')](db[_0xcf1d('0x4b')][_0xcf1d('0x51')]);_0x53c237['query']=_[_0xcf1d('0x2f')](_0x2cbdd5[_0xcf1d('0x30')]);_0x53c237['filters']=_[_0xcf1d('0x52')](_0x53c237[_0xcf1d('0x2e')],_0x53c237[_0xcf1d('0x30')]);_0x576e5c[_0xcf1d('0x32')]=_[_0xcf1d('0x52')](_0x53c237[_0xcf1d('0x2e')],qs['fields'](_0x2cbdd5[_0xcf1d('0x30')]['fields']));_0x576e5c['attributes']=_0x576e5c[_0xcf1d('0x32')][_0xcf1d('0x34')]?_0x576e5c[_0xcf1d('0x32')]:_0x53c237['model'];_0x576e5c[_0xcf1d('0x36')]=qs['sort'](_0x2cbdd5[_0xcf1d('0x30')][_0xcf1d('0x37')]);_0x576e5c[_0xcf1d('0x38')]=qs[_0xcf1d('0x31')](_[_0xcf1d('0x53')](_0x2cbdd5[_0xcf1d('0x30')],_0x53c237[_0xcf1d('0x31')]));if(_0x2cbdd5[_0xcf1d('0x30')][_0xcf1d('0x3a')]){_0x576e5c[_0xcf1d('0x38')]=_[_0xcf1d('0x39')](_0x576e5c[_0xcf1d('0x38')],{'$or':_[_0xcf1d('0x54')](_0x576e5c['attributes'],function(_0x15ce5f){var _0x501c45={};_0x501c45[_0x15ce5f]={'$like':'%'+_0x2cbdd5[_0xcf1d('0x30')][_0xcf1d('0x3a')]+'%'};return _0x501c45;})});}_0x576e5c=_['merge']({},_0x576e5c,_0x2cbdd5[_0xcf1d('0x3b')]);return _0x3da107[_0xcf1d('0x4f')](_0x576e5c);}})[_0xcf1d('0x26')](function(_0x4850ab){if(_0x4850ab){_0x42bd90=_0x4850ab[_0xcf1d('0x34')];if(!_0x2cbdd5[_0xcf1d('0x30')][_0xcf1d('0x55')](_0xcf1d('0x35'))){_0x576e5c[_0xcf1d('0x1f')]=qs[_0xcf1d('0x1f')](_0x2cbdd5[_0xcf1d('0x30')][_0xcf1d('0x1f')]);_0x576e5c[_0xcf1d('0x1e')]=qs[_0xcf1d('0x1e')](_0x2cbdd5[_0xcf1d('0x30')][_0xcf1d('0x1e')]);}return _0x3da107['getContacts'](_0x576e5c);}})[_0xcf1d('0x26')](function(_0x482828){if(_0x482828){return _0x482828?{'count':_0x42bd90,'rows':_0x482828}:null;}})[_0xcf1d('0x26')](respondWithResult(_0x5b9e90,null))[_0xcf1d('0x3e')](handleError(_0x5b9e90,null));};
\ No newline at end of file
+var _0x276f=['path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','count','includeAll','include','findAll','rawAttributes','filters','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact','ids','omit','getContacts','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4f00b1,_0x3f3728){var _0x4d5f5b=function(_0x34c824){while(--_0x34c824){_0x4f00b1['push'](_0x4f00b1['shift']());}};_0x4d5f5b(++_0x3f3728);}(_0x276f,0x14e));var _0xf276=function(_0xe20045,_0x3fade1){_0xe20045=_0xe20045-0x0;var _0x6c10f3=_0x276f[_0xe20045];return _0x6c10f3;};'use strict';var pdf=require(_0xf276('0x0'));var emlformat=require(_0xf276('0x1'));var rimraf=require(_0xf276('0x2'));var zipdir=require(_0xf276('0x3'));var jsonpatch=require(_0xf276('0x4'));var rp=require(_0xf276('0x5'));var moment=require(_0xf276('0x6'));var BPromise=require(_0xf276('0x7'));var Mustache=require(_0xf276('0x8'));var util=require(_0xf276('0x9'));var path=require(_0xf276('0xa'));var sox=require(_0xf276('0xb'));var csv=require(_0xf276('0xc'));var ejs=require(_0xf276('0xd'));var fs=require('fs');var _=require(_0xf276('0xe'));var squel=require(_0xf276('0xf'));var crypto=require(_0xf276('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf276('0x11'));var Redis=require('ioredis');var authService=require(_0xf276('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf276('0x13'));var logger=require(_0xf276('0x14'))(_0xf276('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf276('0x16'));var db=require(_0xf276('0x17'))['db'];function respondWithStatusCode(_0xac7fe7,_0x1dd50d){_0x1dd50d=_0x1dd50d||0xcc;return function(_0x2f0518){if(_0x2f0518){return _0xac7fe7[_0xf276('0x18')](_0x1dd50d);}return _0xac7fe7[_0xf276('0x19')](_0x1dd50d)[_0xf276('0x1a')]();};}function respondWithResult(_0xd2a0a5,_0x128022){_0x128022=_0x128022||0xc8;return function(_0x30feac){if(_0x30feac){return _0xd2a0a5[_0xf276('0x19')](_0x128022)[_0xf276('0x1b')](_0x30feac);}};}function respondWithFilteredResult(_0x345a17,_0x318d5a){return function(_0x5a5594){if(_0x5a5594){var _0x22ce8c=_0x5a5594['count'],_0x39ed83=_0x318d5a[_0xf276('0x1c')],_0x1047f0=_0x318d5a['offset']+_0x318d5a[_0xf276('0x1d')],_0x4f7e35;if(_0x1047f0>=_0x22ce8c){_0x1047f0=_0x22ce8c;_0x4f7e35=0xc8;}else{_0x4f7e35=0xce;}_0x345a17[_0xf276('0x19')](_0x4f7e35);return _0x345a17[_0xf276('0x1e')]('Content-Range',_0x39ed83+'-'+_0x1047f0+'/'+_0x22ce8c)['json'](_0x5a5594);}return null;};}function patchUpdates(_0x12822e){return function(_0x16f4f7){try{jsonpatch['apply'](_0x16f4f7,_0x12822e,!![]);}catch(_0x1ec2b6){return BPromise[_0xf276('0x1f')](_0x1ec2b6);}return _0x16f4f7[_0xf276('0x20')]();};}function saveUpdates(_0x8fab04,_0x886659){return function(_0x17e051){if(_0x17e051){return _0x17e051['update'](_0x8fab04)[_0xf276('0x21')](function(_0x11836e){return _0x11836e;});}return null;};}function removeEntity(_0x6ec0f1,_0x107fd9){return function(_0x4b64a0){if(_0x4b64a0){return _0x4b64a0[_0xf276('0x22')]()[_0xf276('0x21')](function(){var _0x16e744=_0x4b64a0[_0xf276('0x23')]({'plain':!![]});var _0x15af06=_0xf276('0x24');return db[_0xf276('0x25')][_0xf276('0x22')]({'where':{'type':_0x15af06,'resourceId':_0x16e744['id']}})['then'](function(){return _0x4b64a0;});})[_0xf276('0x21')](function(){_0x6ec0f1[_0xf276('0x19')](0xcc)[_0xf276('0x1a')]();});}};}function handleEntityNotFound(_0x1f40b8,_0x4af400){return function(_0x50867b){if(!_0x50867b){_0x1f40b8['sendStatus'](0x194);}return _0x50867b;};}function handleError(_0x31e44c,_0x3b172f){_0x3b172f=_0x3b172f||0x1f4;return function(_0x476679){logger['error'](_0x476679[_0xf276('0x26')]);if(_0x476679[_0xf276('0x27')]){delete _0x476679[_0xf276('0x27')];}_0x31e44c[_0xf276('0x19')](_0x3b172f)[_0xf276('0x28')](_0x476679);};}exports[_0xf276('0x29')]=function(_0x358a76,_0x3332a4){var _0x3a613a={},_0x152155={},_0x454f94={'count':0x0,'rows':[]};return db[_0xf276('0x2a')]['describe']()['then'](function(_0x36a300){_0x152155[_0xf276('0x2b')]=_[_0xf276('0x2c')](_0x36a300);_0x152155[_0xf276('0x2d')]=_[_0xf276('0x2c')](_0x358a76[_0xf276('0x2d')]);_0x152155['filters']=_['intersection'](_0x152155['model'],_0x152155[_0xf276('0x2d')]);_0x3a613a[_0xf276('0x2e')]=_[_0xf276('0x2f')](_0x152155[_0xf276('0x2b')],qs['fields'](_0x358a76[_0xf276('0x2d')][_0xf276('0x30')]));_0x3a613a[_0xf276('0x2e')]=_0x3a613a[_0xf276('0x2e')][_0xf276('0x31')]?_0x3a613a[_0xf276('0x2e')]:_0x152155['model'];if(!_0x358a76[_0xf276('0x2d')][_0xf276('0x32')](_0xf276('0x33'))){_0x3a613a[_0xf276('0x1d')]=qs[_0xf276('0x1d')](_0x358a76['query'][_0xf276('0x1d')]);_0x3a613a['offset']=qs[_0xf276('0x1c')](_0x358a76['query'][_0xf276('0x1c')]);}_0x3a613a[_0xf276('0x34')]=qs[_0xf276('0x35')](_0x358a76[_0xf276('0x2d')][_0xf276('0x35')]);_0x3a613a[_0xf276('0x36')]=qs['filters'](_[_0xf276('0x37')](_0x358a76[_0xf276('0x2d')],_0x152155['filters']),_0x36a300);if(_0x358a76[_0xf276('0x2d')]['filter']){_0x3a613a[_0xf276('0x36')]=_[_0xf276('0x38')](_0x3a613a['where'],{'$or':_[_0xf276('0x39')](_0x3a613a['attributes'],function(_0xe9d9e4){var _0x1113c0={};_0x1113c0[_0xe9d9e4]={'$like':'%'+_0x358a76[_0xf276('0x2d')][_0xf276('0x3a')]+'%'};return _0x1113c0;})});}_0x3a613a=_[_0xf276('0x38')]({},_0x3a613a,_0x358a76[_0xf276('0x3b')]);var _0x53bf0a={'where':_0x3a613a['where']};return db[_0xf276('0x2a')][_0xf276('0x3c')](_0x53bf0a)[_0xf276('0x21')](function(_0x214fc9){_0x454f94[_0xf276('0x3c')]=_0x214fc9;if(_0x358a76[_0xf276('0x2d')][_0xf276('0x3d')]){_0x3a613a[_0xf276('0x3e')]=[{'all':!![]}];}return db[_0xf276('0x2a')][_0xf276('0x3f')](_0x3a613a);})[_0xf276('0x21')](function(_0x48ef13){_0x454f94['rows']=_0x48ef13;return _0x454f94;})[_0xf276('0x21')](respondWithFilteredResult(_0x3332a4,_0x3a613a))['catch'](handleError(_0x3332a4,null));})['catch'](handleError(_0x3332a4,null));};exports['show']=function(_0x487770,_0x1421b7){var _0x163e94={'raw':![],'where':{'id':_0x487770['params']['id']}},_0x3fa1a3={};_0x3fa1a3[_0xf276('0x2b')]=_[_0xf276('0x2c')](db['CmCompany'][_0xf276('0x40')]);_0x3fa1a3[_0xf276('0x2d')]=_[_0xf276('0x2c')](_0x487770[_0xf276('0x2d')]);_0x3fa1a3[_0xf276('0x41')]=_['intersection'](_0x3fa1a3[_0xf276('0x2b')],_0x3fa1a3['query']);_0x163e94[_0xf276('0x2e')]=_[_0xf276('0x2f')](_0x3fa1a3[_0xf276('0x2b')],qs[_0xf276('0x30')](_0x487770[_0xf276('0x2d')][_0xf276('0x30')]));_0x163e94[_0xf276('0x2e')]=_0x163e94[_0xf276('0x2e')][_0xf276('0x31')]?_0x163e94['attributes']:_0x3fa1a3[_0xf276('0x2b')];if(_0x487770[_0xf276('0x2d')][_0xf276('0x3d')]){_0x163e94[_0xf276('0x3e')]=[{'all':!![]}];}_0x163e94=_[_0xf276('0x38')]({},_0x163e94,_0x487770[_0xf276('0x3b')]);return db['CmCompany'][_0xf276('0x42')](_0x163e94)[_0xf276('0x21')](handleEntityNotFound(_0x1421b7,null))[_0xf276('0x21')](respondWithResult(_0x1421b7,null))[_0xf276('0x43')](handleError(_0x1421b7,null));};exports[_0xf276('0x44')]=function(_0x325197,_0x5b5df7){return db[_0xf276('0x2a')][_0xf276('0x44')](_0x325197['body'],{})['then'](function(_0x14ef0b){var _0xe6aca3=_0x325197[_0xf276('0x45')]['get']({'plain':!![]});if(!_0xe6aca3)throw new Error(_0xf276('0x46'));if(_0xe6aca3[_0xf276('0x47')]===_0xf276('0x45')){var _0x58ad84=_0x14ef0b[_0xf276('0x23')]({'plain':!![]});var _0xe10f0f=_0xf276('0x24');return db[_0xf276('0x48')]['find']({'where':{'name':_0xe10f0f,'userProfileId':_0xe6aca3[_0xf276('0x49')]},'raw':!![]})[_0xf276('0x21')](function(_0x5ae2a8){if(_0x5ae2a8&&_0x5ae2a8[_0xf276('0x4a')]===0x0){return db[_0xf276('0x25')][_0xf276('0x44')]({'name':_0x58ad84[_0xf276('0x27')],'resourceId':_0x58ad84['id'],'type':_0x5ae2a8[_0xf276('0x27')],'sectionId':_0x5ae2a8['id']},{})[_0xf276('0x21')](function(){return _0x14ef0b;});}else{return _0x14ef0b;}})[_0xf276('0x43')](function(_0xfc15a8){logger['error'](_0xf276('0x4b'),_0xfc15a8);throw _0xfc15a8;});}return _0x14ef0b;})[_0xf276('0x21')](respondWithResult(_0x5b5df7,0xc9))['catch'](handleError(_0x5b5df7,null));};exports[_0xf276('0x4c')]=function(_0x1e55e0,_0x2b8743){if(_0x1e55e0[_0xf276('0x4d')]['id']){delete _0x1e55e0[_0xf276('0x4d')]['id'];}return db[_0xf276('0x2a')][_0xf276('0x42')]({'where':{'id':_0x1e55e0['params']['id']}})[_0xf276('0x21')](handleEntityNotFound(_0x2b8743,null))[_0xf276('0x21')](saveUpdates(_0x1e55e0[_0xf276('0x4d')],null))[_0xf276('0x21')](respondWithResult(_0x2b8743,null))[_0xf276('0x43')](handleError(_0x2b8743,null));};exports['destroy']=function(_0x5b60e1,_0x9282aa){return db[_0xf276('0x2a')][_0xf276('0x42')]({'where':{'id':_0x5b60e1[_0xf276('0x4e')]['id']}})[_0xf276('0x21')](handleEntityNotFound(_0x9282aa,null))[_0xf276('0x21')](removeEntity(_0x9282aa,null))[_0xf276('0x43')](handleError(_0x9282aa,null));};exports[_0xf276('0x4f')]=function(_0x2e5691,_0xe6ea0f){return db[_0xf276('0x2a')][_0xf276('0x4f')]()['then'](respondWithResult(_0xe6ea0f,null))[_0xf276('0x43')](handleError(_0xe6ea0f,null));};exports[_0xf276('0x50')]=function(_0x5aff55,_0x89b47e,_0x11d105){return db[_0xf276('0x51')][_0xf276('0x42')]({'where':{'id':_0x5aff55[_0xf276('0x4e')]['id']}})[_0xf276('0x21')](handleEntityNotFound(_0x89b47e,null))[_0xf276('0x21')](function(_0x484e9f){if(_0x484e9f){return _0x484e9f[_0xf276('0x50')](_0x5aff55[_0xf276('0x4d')][_0xf276('0x52')],_[_0xf276('0x53')](_0x5aff55['body'],[_0xf276('0x52'),'id'])||{});}})[_0xf276('0x21')](respondWithResult(_0x89b47e,null))['catch'](handleError(_0x89b47e,null));};exports[_0xf276('0x54')]=function(_0x4c4328,_0x40dd5a,_0x37d5a3){var _0x20b85a={};var _0x190a3a={};var _0xf05787;var _0x210c5e;return db[_0xf276('0x2a')][_0xf276('0x55')]({'where':{'id':_0x4c4328[_0xf276('0x4e')]['id']}})[_0xf276('0x21')](handleEntityNotFound(_0x40dd5a,null))[_0xf276('0x21')](function(_0x24491f){if(_0x24491f){_0xf05787=_0x24491f;_0x190a3a[_0xf276('0x2b')]=_[_0xf276('0x2c')](db['CmContact'][_0xf276('0x40')]);_0x190a3a['query']=_[_0xf276('0x2c')](_0x4c4328[_0xf276('0x2d')]);_0x190a3a[_0xf276('0x41')]=_[_0xf276('0x2f')](_0x190a3a[_0xf276('0x2b')],_0x190a3a['query']);_0x20b85a[_0xf276('0x2e')]=_[_0xf276('0x2f')](_0x190a3a[_0xf276('0x2b')],qs[_0xf276('0x30')](_0x4c4328[_0xf276('0x2d')][_0xf276('0x30')]));_0x20b85a['attributes']=_0x20b85a['attributes']['length']?_0x20b85a['attributes']:_0x190a3a['model'];_0x20b85a[_0xf276('0x34')]=qs[_0xf276('0x35')](_0x4c4328['query'][_0xf276('0x35')]);_0x20b85a[_0xf276('0x36')]=qs[_0xf276('0x41')](_[_0xf276('0x37')](_0x4c4328['query'],_0x190a3a[_0xf276('0x41')]));if(_0x4c4328[_0xf276('0x2d')][_0xf276('0x3a')]){_0x20b85a['where']=_[_0xf276('0x38')](_0x20b85a[_0xf276('0x36')],{'$or':_[_0xf276('0x39')](_0x20b85a[_0xf276('0x2e')],function(_0x44dca3){var _0x5cdfc7={};_0x5cdfc7[_0x44dca3]={'$like':'%'+_0x4c4328['query'][_0xf276('0x3a')]+'%'};return _0x5cdfc7;})});}_0x20b85a=_[_0xf276('0x38')]({},_0x20b85a,_0x4c4328[_0xf276('0x3b')]);return _0xf05787[_0xf276('0x54')](_0x20b85a);}})[_0xf276('0x21')](function(_0x142e06){if(_0x142e06){_0x210c5e=_0x142e06['length'];if(!_0x4c4328[_0xf276('0x2d')][_0xf276('0x32')]('nolimit')){_0x20b85a[_0xf276('0x1d')]=qs['limit'](_0x4c4328[_0xf276('0x2d')][_0xf276('0x1d')]);_0x20b85a['offset']=qs[_0xf276('0x1c')](_0x4c4328[_0xf276('0x2d')][_0xf276('0x1c')]);}return _0xf05787[_0xf276('0x54')](_0x20b85a);}})['then'](function(_0x15ad13){if(_0x15ad13){return _0x15ad13?{'count':_0x210c5e,'rows':_0x15ad13}:null;}})[_0xf276('0x21')](respondWithResult(_0x40dd5a,null))[_0xf276('0x43')](handleError(_0x40dd5a,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 1ea5b97..fc1eb5a 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 _0x0207=['CmCompany','cm_companies','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x47bbd5,_0xfab6bc){var _0xea2a13=function(_0xc1964c){while(--_0xc1964c){_0x47bbd5['push'](_0x47bbd5['shift']());}};_0xea2a13(++_0xfab6bc);}(_0x0207,0x162));var _0x7020=function(_0x1d006a,_0x2812b5){_0x1d006a=_0x1d006a-0x0;var _0x20a76b=_0x0207[_0x1d006a];return _0x20a76b;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7020('0x1'));var BPromise=require(_0x7020('0x2'));var rp=require(_0x7020('0x3'));var fs=require('fs');var path=require(_0x7020('0x4'));var rimraf=require(_0x7020('0x5'));var config=require(_0x7020('0x6'));var attributes=require(_0x7020('0x7'));module['exports']=function(_0x5074d7,_0x38c320){return _0x5074d7[_0x7020('0x8')](_0x7020('0x9'),attributes,{'tableName':_0x7020('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f42=['bluebird','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x7f42,0x1dd));var _0x27f4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7f42[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var moment=require('moment');var BPromise=require(_0x27f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27f4('0x4'));var rimraf=require('rimraf');var config=require(_0x27f4('0x5'));var attributes=require('./cmCompany.attributes');module[_0x27f4('0x6')]=function(_0x5c9286,_0x256ac9){return _0x5c9286[_0x27f4('0x7')](_0x27f4('0x8'),attributes,{'tableName':_0x27f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index b10f3f2..0ad3de0 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 _0x330d=['CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x204922,_0x2322e8){var _0x174e4a=function(_0x21d57d){while(--_0x21d57d){_0x204922['push'](_0x204922['shift']());}};_0x174e4a(++_0x2322e8);}(_0x330d,0xb2));var _0xd330=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x330d[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0xd330('0x0'));var util=require(_0xd330('0x1'));var moment=require(_0xd330('0x2'));var BPromise=require('bluebird');var rs=require(_0xd330('0x3'));var fs=require('fs');var Redis=require(_0xd330('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd330('0x5'));var logger=require(_0xd330('0x6'))('rpc');var config=require(_0xd330('0x7'));var jayson=require(_0xd330('0x8'));var client=jayson[_0xd330('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23fa2f,_0x55d0d0,_0x42cc42){return new BPromise(function(_0x1eed0f,_0x4eee71){return client['request'](_0x23fa2f,_0x42cc42)[_0xd330('0xa')](function(_0x3877ce){logger['info'](_0xd330('0xb'),_0x55d0d0,_0xd330('0xc'));logger['debug'](_0xd330('0xd'),_0x55d0d0,_0xd330('0xc'),JSON[_0xd330('0xe')](_0x3877ce));if(_0x3877ce[_0xd330('0xf')]){if(_0x3877ce[_0xd330('0xf')][_0xd330('0x10')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x55d0d0,_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);return _0x4eee71(_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);}logger[_0xd330('0xf')]('CmCompany,\x20%s,\x20%s',_0x55d0d0,_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);return _0x1eed0f(_0x3877ce[_0xd330('0xf')][_0xd330('0x11')]);}else{logger[_0xd330('0x12')](_0xd330('0xb'),_0x55d0d0,_0xd330('0xc'));_0x1eed0f(_0x3877ce[_0xd330('0x13')][_0xd330('0x11')]);}})[_0xd330('0x14')](function(_0x319ab6){logger[_0xd330('0xf')](_0xd330('0xb'),_0x55d0d0,_0x319ab6);_0x4eee71(_0x319ab6);});});}
\ No newline at end of file
+var _0x3986=['error','code','message','info','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3986,0x16e));var _0x6398=function(_0x287015,_0x217115){_0x287015=_0x287015-0x0;var _0x31ac71=_0x3986[_0x287015];return _0x31ac71;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6398('0x0'));var fs=require('fs');var Redis=require(_0x6398('0x1'));var db=require(_0x6398('0x2'))['db'];var utils=require(_0x6398('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6398('0x4'));var jayson=require(_0x6398('0x5'));var client=jayson[_0x6398('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x474359,_0x1854da,_0x41200a){return new BPromise(function(_0x3e2f15,_0x374939){return client[_0x6398('0x7')](_0x474359,_0x41200a)[_0x6398('0x8')](function(_0x276335){logger['info'](_0x6398('0x9'),_0x1854da,_0x6398('0xa'));logger[_0x6398('0xb')](_0x6398('0xc'),_0x1854da,_0x6398('0xa'),JSON[_0x6398('0xd')](_0x276335));if(_0x276335[_0x6398('0xe')]){if(_0x276335[_0x6398('0xe')][_0x6398('0xf')]===0x1f4){logger[_0x6398('0xe')]('CmCompany,\x20%s,\x20%s',_0x1854da,_0x276335[_0x6398('0xe')][_0x6398('0x10')]);return _0x374939(_0x276335[_0x6398('0xe')][_0x6398('0x10')]);}logger[_0x6398('0xe')]('CmCompany,\x20%s,\x20%s',_0x1854da,_0x276335[_0x6398('0xe')][_0x6398('0x10')]);return _0x3e2f15(_0x276335[_0x6398('0xe')]['message']);}else{logger[_0x6398('0x11')](_0x6398('0x9'),_0x1854da,_0x6398('0xa'));_0x3e2f15(_0x276335[_0x6398('0x12')]['message']);}})['catch'](function(_0x166f26){logger[_0x6398('0xe')](_0x6398('0x9'),_0x1854da,_0x166f26);_0x374939(_0x166f26);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 164adc4..ae421d5 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 _0x66fa=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','create','addContacts','update','multer'];(function(_0x341e80,_0x205963){var _0x4494f9=function(_0x5c8497){while(--_0x5c8497){_0x341e80['push'](_0x341e80['shift']());}};_0x4494f9(++_0x205963);}(_0x66fa,0x117));var _0xa66f=function(_0x223c41,_0x5033cd){_0x223c41=_0x223c41-0x0;var _0x5c485b=_0x66fa[_0x223c41];return _0x5c485b;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var auth=require(_0xa66f('0x5'));var interaction=require(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var controller=require(_0xa66f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa66f('0x9')]);router[_0xa66f('0xa')](_0xa66f('0xb'),auth[_0xa66f('0xc')](),controller[_0xa66f('0xd')]);router['get'](_0xa66f('0xe'),auth['isAuthenticated'](),controller[_0xa66f('0xf')]);router['get'](_0xa66f('0x10'),auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0xa66f('0xc')](),controller[_0xa66f('0x11')]);router['post'](_0xa66f('0x10'),auth['isAuthenticated'](),controller[_0xa66f('0x12')]);router['put'](_0xa66f('0xe'),auth[_0xa66f('0xc')](),controller[_0xa66f('0x13')]);router['delete']('/:id',auth[_0xa66f('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x01d9=['post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts'];(function(_0x376f6d,_0x3fa87d){var _0x532949=function(_0x4220ff){while(--_0x4220ff){_0x376f6d['push'](_0x376f6d['shift']());}};_0x532949(++_0x3fa87d);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0x9')](_0x901d('0xd'),auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0x9')](_0x901d('0xf'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')]('/',auth['isAuthenticated'](),controller[_0x901d('0x12')]);router['post'](_0x901d('0xf'),auth[_0x901d('0xa')](),controller[_0x901d('0x13')]);router[_0x901d('0x14')](_0x901d('0xd'),auth['isAuthenticated'](),controller[_0x901d('0x15')]);router[_0x901d('0x16')](_0x901d('0xd'),auth[_0x901d('0xa')](),controller[_0x901d('0x17')]);module[_0x901d('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6231638..bd1137c 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 _0x50c8=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x4ce93d,_0x552831){var _0x209b1a=function(_0x40358a){while(--_0x40358a){_0x4ce93d['push'](_0x4ce93d['shift']());}};_0x209b1a(++_0x552831);}(_0x50c8,0xcb));var _0x850c=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x50c8[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x850c('0x0'));var Sequelize=require(_0x850c('0x1'));module[_0x850c('0x2')]={'firstName':{'type':Sequelize[_0x850c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x850c('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x850c('0x3')]},'country':{'type':Sequelize[_0x850c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x850c('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x850c('0x3')]},'mobile':{'type':Sequelize[_0x850c('0x3')]},'fax':{'type':Sequelize[_0x850c('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x850c('0x3')]},'facebook':{'type':Sequelize[_0x850c('0x3')]},'fb_data':{'type':Sequelize[_0x850c('0x3')]},'twitter':{'type':Sequelize[_0x850c('0x3')]},'skype':{'type':Sequelize[_0x850c('0x3')]},'teams':{'type':Sequelize[_0x850c('0x3')]},'viber':{'type':Sequelize[_0x850c('0x3')]},'line':{'type':Sequelize[_0x850c('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x850c('0x3')]},'UserId':{'type':Sequelize[_0x850c('0x4')]},'priority':{'type':Sequelize[_0x850c('0x4')](0x2)[_0x850c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x850c('0x6')],'defaultValue':Sequelize[_0x850c('0x7')]}};
\ No newline at end of file
+var _0x9d03=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x2ec112,_0x17df50){var _0x1cc13b=function(_0x52ce5a){while(--_0x52ce5a){_0x2ec112['push'](_0x2ec112['shift']());}};_0x1cc13b(++_0x17df50);}(_0x9d03,0xdb));var _0x39d0=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9d03[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x39d0('0x0'));var Sequelize=require(_0x39d0('0x1'));module[_0x39d0('0x2')]={'firstName':{'type':Sequelize[_0x39d0('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x39d0('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x39d0('0x3')]},'city':{'type':Sequelize[_0x39d0('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x39d0('0x3')]},'description':{'type':Sequelize[_0x39d0('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x39d0('0x3')]},'fax':{'type':Sequelize[_0x39d0('0x3')]},'email':{'type':Sequelize[_0x39d0('0x3')]},'url':{'type':Sequelize[_0x39d0('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x39d0('0x3')]},'teams':{'type':Sequelize[_0x39d0('0x3')]},'viber':{'type':Sequelize[_0x39d0('0x3')]},'line':{'type':Sequelize[_0x39d0('0x3')]},'wechat':{'type':Sequelize[_0x39d0('0x3')]},'telegram':{'type':Sequelize[_0x39d0('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x39d0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x39d0('0x6')],'defaultValue':Sequelize[_0x39d0('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a233292..77f44c1 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 _0x7a83=['sort','pick','select','field','color','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','buildExpression','text','start','filter','isNil','push','isEmpty','ListId','where','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','startsWith','displayName','findAll','alias','custom','columnName','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','show','$and','cf_%d','omit','pickBy','format','setFields','toParam','values','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','includeAll','include','ContactId','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','agent','binding','child_process','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./cmContact.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','CmContact','describe','length','cf_','CmCustomField','findOne','trimStart','fieldType','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x5d35ee,_0x1b0884){var _0xfe7874=function(_0x18b3fe){while(--_0x18b3fe){_0x5d35ee['push'](_0x5d35ee['shift']());}};_0xfe7874(++_0x1b0884);}(_0x7a83,0x1a1));var _0x37a8=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x7a83[_0x5ce15c];return _0x36e4f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x37a8('0x0'));var rimraf=require(_0x37a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37a8('0x2'));var rp=require(_0x37a8('0x3'));var moment=require('moment');var BPromise=require(_0x37a8('0x4'));var Mustache=require(_0x37a8('0x5'));var util=require('util');var path=require(_0x37a8('0x6'));var sox=require(_0x37a8('0x7'));var csv=require(_0x37a8('0x8'));var ejs=require(_0x37a8('0x9'));var fs=require('fs');var _=require(_0x37a8('0xa'));var squel=require(_0x37a8('0xb'));var crypto=require('crypto');var jsforce=require(_0x37a8('0xc'));var deskjs=require(_0x37a8('0xd'));var toCsv=require(_0x37a8('0x8'));var querystring=require(_0x37a8('0xe'));var Papa=require(_0x37a8('0xf'));var Redis=require(_0x37a8('0x10'));var authService=require(_0x37a8('0x11'));var qs=require(_0x37a8('0x12'));var as=require(_0x37a8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x37a8('0x14'));var utils=require(_0x37a8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x37a8('0x16'));var db=require(_0x37a8('0x17'))['db'];config[_0x37a8('0x18')]=_[_0x37a8('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37a8('0x18')]));require(_0x37a8('0x1a'))[_0x37a8('0x1b')](socket);function respondWithStatusCode(_0x2a65ed,_0x479ab1){_0x479ab1=_0x479ab1||0xcc;return function(_0x43a52c){if(_0x43a52c){return _0x2a65ed[_0x37a8('0x1c')](_0x479ab1);}return _0x2a65ed['status'](_0x479ab1)['end']();};}function respondWithResult(_0xf11550,_0xbbdf92){_0xbbdf92=_0xbbdf92||0xc8;return function(_0x10bf03){if(_0x10bf03){return _0xf11550[_0x37a8('0x1d')](_0xbbdf92)[_0x37a8('0x1e')](_0x10bf03);}};}function respondWithFilteredResult(_0x45ba35,_0x75bb23){return function(_0x51111e){if(_0x51111e){var _0x12a50e=_0x51111e[_0x37a8('0x1f')],_0x4bb823=_0x75bb23[_0x37a8('0x20')],_0x324350=_0x75bb23['offset']+_0x75bb23[_0x37a8('0x21')],_0x57e4e0;if(_0x324350>=_0x12a50e){_0x324350=_0x12a50e;_0x57e4e0=0xc8;}else{_0x57e4e0=0xce;}_0x45ba35[_0x37a8('0x1d')](_0x57e4e0);return _0x45ba35['set'](_0x37a8('0x22'),_0x4bb823+'-'+_0x324350+'/'+_0x12a50e)[_0x37a8('0x1e')](_0x51111e);}return null;};}function patchUpdates(_0x5597b4){return function(_0x2326e4){try{jsonpatch[_0x37a8('0x23')](_0x2326e4,_0x5597b4,!![]);}catch(_0x442735){return BPromise['reject'](_0x442735);}return _0x2326e4['save']();};}function saveUpdates(_0x34061f,_0x19a607){return function(_0x1c8ccc){if(_0x1c8ccc){return _0x1c8ccc[_0x37a8('0x24')](_0x34061f)[_0x37a8('0x25')](function(_0x1beb15){return _0x1beb15;});}return null;};}function removeEntity(_0x28aaa7,_0x4d8615){return function(_0xb9275d){if(_0xb9275d){return _0xb9275d[_0x37a8('0x26')]()['then'](function(){_0x28aaa7['status'](0xcc)[_0x37a8('0x27')]();});}};}function handleEntityNotFound(_0x84b6a6,_0x94226c){return function(_0x3d97bc){if(!_0x3d97bc){_0x84b6a6['sendStatus'](0x194);}return _0x3d97bc;};}function handleError(_0x5ec3f7,_0x1997d6){_0x1997d6=_0x1997d6||0x1f4;return function(_0x7991c5){logger[_0x37a8('0x28')](_0x7991c5[_0x37a8('0x29')]);if(_0x7991c5[_0x37a8('0x2a')]){delete _0x7991c5[_0x37a8('0x2a')];}_0x5ec3f7[_0x37a8('0x1d')](_0x1997d6)[_0x37a8('0x2b')](_0x7991c5);};}exports[_0x37a8('0x2c')]=function(_0x359538,_0x8d3c48){var _0x3bc52b={},_0x56ef63={},_0x3eef5d={'count':0x0,'rows':[]};return db[_0x37a8('0x2d')][_0x37a8('0x2e')]()[_0x37a8('0x25')](function(_0x46de80){var _0x3355df=[];for(var _0x3d6750=0x0;_0x3d6750','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','lodash','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','value','name','split','length'];(function(_0x468732,_0x3398b6){var _0x308118=function(_0x744eaf){while(--_0x744eaf){_0x468732['push'](_0x468732['shift']());}};_0x308118(++_0x3398b6);}(_0x17a7,0x1b8));var _0x717a=function(_0x413af5,_0x320df1){_0x413af5=_0x413af5-0x0;var _0x51a0cf=_0x17a7[_0x413af5];return _0x51a0cf;};'use strict';var _=require(_0x717a('0x0'));var moment=require('moment');var random=require(_0x717a('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x717a('0x2'));var tnef=require(_0x717a('0x3'));var logger=require(_0x717a('0x4'))(_0x717a('0x5'));var config=require(_0x717a('0x6'));function getAddress(_0x3b1a1e){var _0x3bb1f6=_[_0x717a('0x7')](_0x3b1a1e['value']);return _0x3bb1f6&&_0x3bb1f6[_0x717a('0x8')]?_0x3bb1f6[_0x717a('0x8')]:_0x717a('0x9')+random[_0x717a('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x48efc4){var _0x42480b=_['head'](_0x48efc4[_0x717a('0xb')]);if(_0x42480b&&_0x42480b[_0x717a('0xc')]){var _0x4fae32=_0x42480b[_0x717a('0xc')][_0x717a('0xd')](/\s+/);return _0x4fae32[_0x717a('0xe')]?_0x4fae32['slice'](0x0,-0x1)['join']('\x20'):_0x42480b[_0x717a('0xc')];}return _0x717a('0xf');}function getLastName(_0x240cd6){var _0x4b2cd7=_[_0x717a('0x7')](_0x240cd6[_0x717a('0xb')]);if(_0x4b2cd7&&_0x4b2cd7[_0x717a('0xc')]){var _0x263671=_0x4b2cd7[_0x717a('0xc')][_0x717a('0xd')](/\s+/);return _0x263671[_0x717a('0xe')]>0x1?_0x263671[_0x717a('0x10')]():'';}return'';}function getMails(_0x3df3d7,_0xe8e22f){var _0x57fc38='';for(var _0x412ef5=0x0;_0x412ef5<_0xe8e22f[_0x717a('0xb')]['length'];_0x412ef5+=0x1){if(_0xe8e22f['value'][_0x412ef5][_0x717a('0x8')]!==_0x3df3d7){if(!_[_0x717a('0x11')](_0x57fc38)){_0x57fc38+=',';}_0x57fc38+=_0xe8e22f['value'][_0x412ef5][_0x717a('0xc')]||_0xe8e22f[_0x717a('0xb')][_0x412ef5][_0x717a('0x8')]||'';_0x57fc38+='\x20<';_0x57fc38+=_0xe8e22f[_0x717a('0xb')][_0x412ef5][_0x717a('0x8')]?_0xe8e22f[_0x717a('0xb')][_0x412ef5]['address']:_0x717a('0x9')+random[_0x717a('0xa')](0x6)+_0x717a('0x12');_0x57fc38+='>';}}return _0x57fc38;}function parseEmail(_0x2397b8,_0x366953,_0x30a174){if(_0x366953[_0x717a('0x13')]){var _0x8c74ee=/